@scalar/api-reference 0.1.4 → 0.1.5

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 (460) hide show
  1. package/README.md +42 -0
  2. package/dist/components/ApiClientModal.vue.d.ts +1 -0
  3. package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
  4. package/dist/components/ApiReference.vue.d.ts +1 -0
  5. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  6. package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
  7. package/dist/components/Content/ReferenceEndpoint/ExampleResponses.vue.d.ts.map +1 -1
  8. package/dist/components/Icon/SvgRenderer.d.ts.map +1 -1
  9. package/dist/index.js +46545 -96774
  10. package/dist/style.css +3319 -1067
  11. package/dist/variables.css +1 -69
  12. package/package.json +20 -15
  13. package/.env.example +0 -1
  14. package/.eslintignore +0 -1
  15. package/.eslintrc.json +0 -21
  16. package/CHANGELOG.md +0 -43
  17. package/dist/index-ad012ba6.js +0 -59729
  18. package/src/assets/css/reset.css +0 -154
  19. package/src/assets/css/variables.css +0 -132
  20. package/src/components/ApiClientModal.vue +0 -184
  21. package/src/components/ApiReference.vue +0 -639
  22. package/src/components/Card/Card.vue +0 -12
  23. package/src/components/Card/CardContent.vue +0 -45
  24. package/src/components/Card/CardFooter.vue +0 -13
  25. package/src/components/Card/CardHeader.vue +0 -37
  26. package/src/components/Card/CardTab.vue +0 -31
  27. package/src/components/Card/CardTabHeader.vue +0 -32
  28. package/src/components/Card/index.ts +0 -6
  29. package/src/components/Content/Content.vue +0 -128
  30. package/src/components/Content/Introduction/BaseUrl.vue +0 -32
  31. package/src/components/Content/Introduction/Introduction.vue +0 -144
  32. package/src/components/Content/Introduction/LanguageSelector.vue +0 -339
  33. package/src/components/Content/Introduction/index.ts +0 -1
  34. package/src/components/Content/MarkdownRenderer.vue +0 -173
  35. package/src/components/Content/ReferenceEndpoint/Copy.vue +0 -97
  36. package/src/components/Content/ReferenceEndpoint/ExampleRequest.vue +0 -365
  37. package/src/components/Content/ReferenceEndpoint/ExampleResponseTab.vue +0 -22
  38. package/src/components/Content/ReferenceEndpoint/ExampleResponses.vue +0 -134
  39. package/src/components/Content/ReferenceEndpoint/ParameterItem.vue +0 -26
  40. package/src/components/Content/ReferenceEndpoint/Parameters.vue +0 -23
  41. package/src/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue +0 -29
  42. package/src/components/Content/ReferenceEndpoint/RequestBody.vue +0 -125
  43. package/src/components/Content/ReferenceEndpoint/RequestBodyProperties.vue +0 -54
  44. package/src/components/Content/ReferenceEndpoint/RequestBodyPropertiesChild.vue +0 -39
  45. package/src/components/Content/ReferenceEndpoint/index.ts +0 -1
  46. package/src/components/Content/ReferenceTag.vue +0 -99
  47. package/src/components/Content/Spinner.vue +0 -51
  48. package/src/components/Content/index.ts +0 -1
  49. package/src/components/FindAnythingButton.vue +0 -55
  50. package/src/components/FlowButton.vue +0 -184
  51. package/src/components/FlowIconButton.vue +0 -25
  52. package/src/components/FlowLoader.vue +0 -207
  53. package/src/components/Icon/FlowIcon.vue +0 -19
  54. package/src/components/Icon/Icon.vue +0 -23
  55. package/src/components/Icon/SvgRenderer.ts +0 -43
  56. package/src/components/Icon/brand/brand-adobe.svg +0 -1
  57. package/src/components/Icon/brand/brand-amazon.svg +0 -1
  58. package/src/components/Icon/brand/brand-browser-firefox.svg +0 -5
  59. package/src/components/Icon/brand/brand-browser-googlechrome.svg +0 -5
  60. package/src/components/Icon/brand/brand-creative-commons.svg +0 -1
  61. package/src/components/Icon/brand/brand-ecommerce-etsy.svg +0 -1
  62. package/src/components/Icon/brand/brand-ecommerce-patreon.svg +0 -1
  63. package/src/components/Icon/brand/brand-ecommerce-shopify.svg +0 -5
  64. package/src/components/Icon/brand/brand-ecommerce-wordpress.svg +0 -1
  65. package/src/components/Icon/brand/brand-gaming-nintendo-switch.svg +0 -5
  66. package/src/components/Icon/brand/brand-gaming-playstation.svg +0 -1
  67. package/src/components/Icon/brand/brand-gaming-xbox-live.svg +0 -5
  68. package/src/components/Icon/brand/brand-google-drive.svg +0 -5
  69. package/src/components/Icon/brand/brand-google-gmail.svg +0 -5
  70. package/src/components/Icon/brand/brand-google.svg +0 -1
  71. package/src/components/Icon/brand/brand-music-itunes.svg +0 -1
  72. package/src/components/Icon/brand/brand-music-soundcloud.svg +0 -1
  73. package/src/components/Icon/brand/brand-music-spotify.svg +0 -1
  74. package/src/components/Icon/brand/brand-office-dropbox.svg +0 -5
  75. package/src/components/Icon/brand/brand-office-slack.svg +0 -5
  76. package/src/components/Icon/brand/brand-office-zoom.svg +0 -1
  77. package/src/components/Icon/brand/brand-payments-alipay.svg +0 -1
  78. package/src/components/Icon/brand/brand-payments-paypal.svg +0 -1
  79. package/src/components/Icon/brand/brand-payments-stripe.svg +0 -1
  80. package/src/components/Icon/brand/brand-platform-android.svg +0 -1
  81. package/src/components/Icon/brand/brand-platform-apple.svg +0 -5
  82. package/src/components/Icon/brand/brand-platform-linux.svg +0 -5
  83. package/src/components/Icon/brand/brand-platform-microsoft-windows.svg +0 -4
  84. package/src/components/Icon/brand/brand-social-chat-discord.svg +0 -5
  85. package/src/components/Icon/brand/brand-social-chat-kuaishou.svg +0 -5
  86. package/src/components/Icon/brand/brand-social-chat-line.svg +0 -5
  87. package/src/components/Icon/brand/brand-social-chat-messenger.svg +0 -5
  88. package/src/components/Icon/brand/brand-social-chat-signal.svg +0 -5
  89. package/src/components/Icon/brand/brand-social-chat-snapchat.svg +0 -5
  90. package/src/components/Icon/brand/brand-social-chat-telegram.svg +0 -5
  91. package/src/components/Icon/brand/brand-social-chat-wechat.svg +0 -5
  92. package/src/components/Icon/brand/brand-social-chat-whatsapp.svg +0 -5
  93. package/src/components/Icon/brand/brand-social-media-deviantart.svg +0 -5
  94. package/src/components/Icon/brand/brand-social-media-dribbble.svg +0 -1
  95. package/src/components/Icon/brand/brand-social-media-facebook.svg +0 -1
  96. package/src/components/Icon/brand/brand-social-media-instagram.svg +0 -5
  97. package/src/components/Icon/brand/brand-social-media-linkedin.svg +0 -5
  98. package/src/components/Icon/brand/brand-social-media-pinterest.svg +0 -5
  99. package/src/components/Icon/brand/brand-social-media-reddit.svg +0 -1
  100. package/src/components/Icon/brand/brand-social-media-sina-weibo.svg +0 -5
  101. package/src/components/Icon/brand/brand-social-media-threads.svg +0 -1
  102. package/src/components/Icon/brand/brand-social-media-tiktok.svg +0 -5
  103. package/src/components/Icon/brand/brand-social-media-tinder.svg +0 -1
  104. package/src/components/Icon/brand/brand-social-media-tumblr.svg +0 -5
  105. package/src/components/Icon/brand/brand-social-media-twitter.svg +0 -5
  106. package/src/components/Icon/brand/brand-software-design-figma.svg +0 -1
  107. package/src/components/Icon/brand/brand-software-development-authy.svg +0 -1
  108. package/src/components/Icon/brand/brand-software-development-digital-ocean.svg +0 -1
  109. package/src/components/Icon/brand/brand-software-development-docker.svg +0 -5
  110. package/src/components/Icon/brand/brand-software-development-github.svg +0 -5
  111. package/src/components/Icon/brand/brand-software-development-jira.svg +0 -1
  112. package/src/components/Icon/brand/brand-software-development-openai.svg +0 -1
  113. package/src/components/Icon/brand/brand-software-development-stackexchange.svg +0 -5
  114. package/src/components/Icon/brand/brand-software-development-stackoverflow.svg +0 -1
  115. package/src/components/Icon/brand/brand-video-netflix.svg +0 -5
  116. package/src/components/Icon/brand/brand-video-twitch.svg +0 -1
  117. package/src/components/Icon/brand/brand-video-vimeo.svg +0 -5
  118. package/src/components/Icon/brand/brand-video-youtube.svg +0 -5
  119. package/src/components/Icon/brand/programming-framework-angular.svg +0 -5
  120. package/src/components/Icon/brand/programming-framework-astro.svg +0 -5
  121. package/src/components/Icon/brand/programming-framework-laravel.svg +0 -1
  122. package/src/components/Icon/brand/programming-framework-nextdotjs.svg +0 -5
  123. package/src/components/Icon/brand/programming-framework-react.svg +0 -5
  124. package/src/components/Icon/brand/programming-framework-vuedotjs.svg +0 -1
  125. package/src/components/Icon/brand/programming-language-c.svg +0 -5
  126. package/src/components/Icon/brand/programming-language-clojure.svg +0 -5
  127. package/src/components/Icon/brand/programming-language-csharp.svg +0 -4
  128. package/src/components/Icon/brand/programming-language-css3.svg +0 -4
  129. package/src/components/Icon/brand/programming-language-go.svg +0 -4
  130. package/src/components/Icon/brand/programming-language-html5.svg +0 -4
  131. package/src/components/Icon/brand/programming-language-java.svg +0 -21
  132. package/src/components/Icon/brand/programming-language-javascript-js.svg +0 -4
  133. package/src/components/Icon/brand/programming-language-json.svg +0 -8
  134. package/src/components/Icon/brand/programming-language-kotlin.svg +0 -3
  135. package/src/components/Icon/brand/programming-language-node.svg +0 -10
  136. package/src/components/Icon/brand/programming-language-objc.svg +0 -6
  137. package/src/components/Icon/brand/programming-language-ocaml.svg +0 -4
  138. package/src/components/Icon/brand/programming-language-php.svg +0 -4
  139. package/src/components/Icon/brand/programming-language-powershell.svg +0 -10
  140. package/src/components/Icon/brand/programming-language-python.svg +0 -4
  141. package/src/components/Icon/brand/programming-language-r.svg +0 -7
  142. package/src/components/Icon/brand/programming-language-ruby.svg +0 -5
  143. package/src/components/Icon/brand/programming-language-scala.svg +0 -5
  144. package/src/components/Icon/brand/programming-language-shell.svg +0 -5
  145. package/src/components/Icon/brand/programming-language-swift.svg +0 -4
  146. package/src/components/Icon/brand/programming-language-typescript.svg +0 -5
  147. package/src/components/Icon/brand/programming-tool-git.svg +0 -1
  148. package/src/components/Icon/brand/programming-tool-tailwindcss.svg +0 -5
  149. package/src/components/Icon/icons/Add.svg +0 -4
  150. package/src/components/Icon/icons/ArrowDown.svg +0 -3
  151. package/src/components/Icon/icons/ArrowLeft.svg +0 -3
  152. package/src/components/Icon/icons/ArrowRight.svg +0 -3
  153. package/src/components/Icon/icons/ArrowUp.svg +0 -3
  154. package/src/components/Icon/icons/Background.svg +0 -8
  155. package/src/components/Icon/icons/CallToAction.svg +0 -5
  156. package/src/components/Icon/icons/CheckMark.svg +0 -3
  157. package/src/components/Icon/icons/ChevronDown.svg +0 -3
  158. package/src/components/Icon/icons/ChevronLeft.svg +0 -3
  159. package/src/components/Icon/icons/ChevronRight.svg +0 -3
  160. package/src/components/Icon/icons/ChevronUp.svg +0 -3
  161. package/src/components/Icon/icons/Close.svg +0 -3
  162. package/src/components/Icon/icons/DarkMode.svg +0 -4
  163. package/src/components/Icon/icons/Delete.svg +0 -5
  164. package/src/components/Icon/icons/Discord.svg +0 -5
  165. package/src/components/Icon/icons/Duplicate.svg +0 -6
  166. package/src/components/Icon/icons/Edit.svg +0 -4
  167. package/src/components/Icon/icons/EditorBold.svg +0 -4
  168. package/src/components/Icon/icons/EditorCode.svg +0 -6
  169. package/src/components/Icon/icons/EditorHighlight.svg +0 -12
  170. package/src/components/Icon/icons/EditorItalic.svg +0 -4
  171. package/src/components/Icon/icons/EditorLink.svg +0 -8
  172. package/src/components/Icon/icons/EditorStrike.svg +0 -4
  173. package/src/components/Icon/icons/EditorUnderline.svg +0 -6
  174. package/src/components/Icon/icons/Ellipses.svg +0 -4
  175. package/src/components/Icon/icons/Error.svg +0 -4
  176. package/src/components/Icon/icons/ExternalLink.svg +0 -7
  177. package/src/components/Icon/icons/Folder.svg +0 -4
  178. package/src/components/Icon/icons/GitHub.svg +0 -4
  179. package/src/components/Icon/icons/Google.svg +0 -4
  180. package/src/components/Icon/icons/Hide.svg +0 -5
  181. package/src/components/Icon/icons/Key.svg +0 -5
  182. package/src/components/Icon/icons/Leave.svg +0 -5
  183. package/src/components/Icon/icons/LightMode.svg +0 -6
  184. package/src/components/Icon/icons/Link.svg +0 -5
  185. package/src/components/Icon/icons/Lock.svg +0 -4
  186. package/src/components/Icon/icons/Logo.svg +0 -4
  187. package/src/components/Icon/icons/LogoAPI.svg +0 -4
  188. package/src/components/Icon/icons/LogoClient.svg +0 -4
  189. package/src/components/Icon/icons/LogoMarket.svg +0 -4
  190. package/src/components/Icon/icons/LogoSwagger.svg +0 -4
  191. package/src/components/Icon/icons/Magic.svg +0 -5
  192. package/src/components/Icon/icons/Menu.svg +0 -3
  193. package/src/components/Icon/icons/Page.svg +0 -8
  194. package/src/components/Icon/icons/Payment.svg +0 -5
  195. package/src/components/Icon/icons/Refresh.svg +0 -4
  196. package/src/components/Icon/icons/Search.svg +0 -4
  197. package/src/components/Icon/icons/Show.svg +0 -5
  198. package/src/components/Icon/icons/Sigma.svg +0 -4
  199. package/src/components/Icon/icons/Trash.svg +0 -5
  200. package/src/components/Icon/icons/index.ts +0 -65
  201. package/src/components/Icon/index.ts +0 -2
  202. package/src/components/Icon/line/arrow-chevron-down.svg +0 -1
  203. package/src/components/Icon/line/arrow-chevron-left.svg +0 -1
  204. package/src/components/Icon/line/arrow-chevron-right.svg +0 -1
  205. package/src/components/Icon/line/arrow-chevron-up.svg +0 -1
  206. package/src/components/Icon/line/arrow-down.svg +0 -1
  207. package/src/components/Icon/line/arrow-left.svg +0 -1
  208. package/src/components/Icon/line/arrow-right.svg +0 -1
  209. package/src/components/Icon/line/arrow-up.svg +0 -1
  210. package/src/components/Icon/line/basic-shape-diamond.svg +0 -1
  211. package/src/components/Icon/line/basic-shape-hexagon.svg +0 -1
  212. package/src/components/Icon/line/basic-shape-primary-circle-ellipse-round.svg +0 -1
  213. package/src/components/Icon/line/basic-shape-primary-square-rectangle.svg +0 -1
  214. package/src/components/Icon/line/basic-shape-shield.svg +0 -1
  215. package/src/components/Icon/line/computer-device-desktop-monitor.svg +0 -1
  216. package/src/components/Icon/line/computer-device-desktop.svg +0 -1
  217. package/src/components/Icon/line/computer-device-laptop.svg +0 -1
  218. package/src/components/Icon/line/computer-device-mobile-phone-android-samsung-back.svg +0 -1
  219. package/src/components/Icon/line/computer-device-mobile-phone-android-samsung.svg +0 -1
  220. package/src/components/Icon/line/computer-device-mobile-phone-iphone-x-back.svg +0 -1
  221. package/src/components/Icon/line/computer-device-mobile-phone-iphone-x.svg +0 -1
  222. package/src/components/Icon/line/computer-device-mobile-tablet-touch.svg +0 -1
  223. package/src/components/Icon/line/computer-device-mobile-tablet.svg +0 -1
  224. package/src/components/Icon/line/computer-device-network-ethernet-cat6.svg +0 -1
  225. package/src/components/Icon/line/computer-device-network-lan-www.svg +0 -1
  226. package/src/components/Icon/line/computer-device-network-wifi-connection.svg +0 -1
  227. package/src/components/Icon/line/computer-device-network-wifi-router.svg +0 -1
  228. package/src/components/Icon/line/computer-keyboard-alt.svg +0 -1
  229. package/src/components/Icon/line/computer-keyboard-command-cmd-control-ctrl.svg +0 -1
  230. package/src/components/Icon/line/computer-keyboard-option.svg +0 -1
  231. package/src/components/Icon/line/computer-keyboard-shift.svg +0 -1
  232. package/src/components/Icon/line/ecology-science-erlenmeyer-flask.svg +0 -1
  233. package/src/components/Icon/line/entertainment-control-button-circle-left-arrow-rewind.svg +0 -1
  234. package/src/components/Icon/line/entertainment-control-button-circle-pause.svg +0 -1
  235. package/src/components/Icon/line/entertainment-control-button-circle-right-arrow-fast-forward.svg +0 -1
  236. package/src/components/Icon/line/entertainment-control-button-circle-stop-square.svg +0 -1
  237. package/src/components/Icon/line/entertainment-control-button-play-circle.svg +0 -1
  238. package/src/components/Icon/line/entertainment-party-popper-confetti.svg +0 -1
  239. package/src/components/Icon/line/image-flash-lightning.svg +0 -1
  240. package/src/components/Icon/line/image-photo-frame.svg +0 -1
  241. package/src/components/Icon/line/image-picture-flower.svg +0 -1
  242. package/src/components/Icon/line/interface-add.svg +0 -1
  243. package/src/components/Icon/line/interface-alert-error-exclamation-block-square.svg +0 -1
  244. package/src/components/Icon/line/interface-alert-error-x-block-square.svg +0 -1
  245. package/src/components/Icon/line/interface-alert-exclamation-diamond.svg +0 -1
  246. package/src/components/Icon/line/interface-alert-exclamation-triangle-warning.svg +0 -1
  247. package/src/components/Icon/line/interface-alert-information-circle.svg +0 -1
  248. package/src/components/Icon/line/interface-award-crown.svg +0 -1
  249. package/src/components/Icon/line/interface-bookmark-tag.svg +0 -1
  250. package/src/components/Icon/line/interface-bookmark.svg +0 -1
  251. package/src/components/Icon/line/interface-calendar-date-one.svg +0 -1
  252. package/src/components/Icon/line/interface-close.svg +0 -1
  253. package/src/components/Icon/line/interface-content-book-open-pages.svg +0 -1
  254. package/src/components/Icon/line/interface-content-book-page.svg +0 -1
  255. package/src/components/Icon/line/interface-content-file.svg +0 -8
  256. package/src/components/Icon/line/interface-content-folder.svg +0 -1
  257. package/src/components/Icon/line/interface-copy-clipboard.svg +0 -1
  258. package/src/components/Icon/line/interface-delete-bin-trash.svg +0 -1
  259. package/src/components/Icon/line/interface-dots-horizontal.svg +0 -1
  260. package/src/components/Icon/line/interface-dots-vertical.svg +0 -1
  261. package/src/components/Icon/line/interface-edit-attachment.svg +0 -1
  262. package/src/components/Icon/line/interface-edit-binocular.svg +0 -1
  263. package/src/components/Icon/line/interface-edit-magic-wand.svg +0 -1
  264. package/src/components/Icon/line/interface-edit-tool-eraser.svg +0 -1
  265. package/src/components/Icon/line/interface-edit-tool-paint-brush.svg +0 -1
  266. package/src/components/Icon/line/interface-edit-tool-paint-roller.svg +0 -1
  267. package/src/components/Icon/line/interface-edit-tool-pen.svg +0 -1
  268. package/src/components/Icon/line/interface-edit-tool-pencil.svg +0 -1
  269. package/src/components/Icon/line/interface-edit-view-eye.svg +0 -1
  270. package/src/components/Icon/line/interface-favorite-award.svg +0 -1
  271. package/src/components/Icon/line/interface-favorite-flag.svg +0 -1
  272. package/src/components/Icon/line/interface-favorite-heart.svg +0 -1
  273. package/src/components/Icon/line/interface-favorite-star.svg +0 -1
  274. package/src/components/Icon/line/interface-favorite-stars-shining.svg +0 -1
  275. package/src/components/Icon/line/interface-favorite-stars-sparkles.svg +0 -1
  276. package/src/components/Icon/line/interface-hierarchy-flowchart.svg +0 -1
  277. package/src/components/Icon/line/interface-home-house.svg +0 -1
  278. package/src/components/Icon/line/interface-hyperlink.svg +0 -1
  279. package/src/components/Icon/line/interface-lighting-brightness.svg +0 -1
  280. package/src/components/Icon/line/interface-lock-closed.svg +0 -1
  281. package/src/components/Icon/line/interface-lock-open-unlock.svg +0 -1
  282. package/src/components/Icon/line/interface-login-key.svg +0 -1
  283. package/src/components/Icon/line/interface-search.svg +0 -1
  284. package/src/components/Icon/line/interface-setting-cog.svg +0 -1
  285. package/src/components/Icon/line/interface-share-megaphone-bullhorn.svg +0 -1
  286. package/src/components/Icon/line/interface-share-rocket.svg +0 -1
  287. package/src/components/Icon/line/interface-share-satellite.svg +0 -1
  288. package/src/components/Icon/line/interface-share-space-ship.svg +0 -1
  289. package/src/components/Icon/line/interface-share.svg +0 -1
  290. package/src/components/Icon/line/interface-signal-square.svg +0 -1
  291. package/src/components/Icon/line/interface-text-formatting-left-open-quote.svg +0 -1
  292. package/src/components/Icon/line/interface-text-formatting-right-close-quote.svg +0 -1
  293. package/src/components/Icon/line/interface-time-clock-circle.svg +0 -1
  294. package/src/components/Icon/line/interface-time-hour-glass.svg +0 -1
  295. package/src/components/Icon/line/interface-users-multiple.svg +0 -1
  296. package/src/components/Icon/line/interface-validation-checkbox-square.svg +0 -1
  297. package/src/components/Icon/line/interface-weather-moon.svg +0 -1
  298. package/src/components/Icon/line/legal-justice-hammer-gavel.svg +0 -1
  299. package/src/components/Icon/line/mail-chat-bubble-square.svg +0 -1
  300. package/src/components/Icon/line/mail-send-email-paper-airplane.svg +0 -1
  301. package/src/components/Icon/line/mail-send-envelope.svg +0 -1
  302. package/src/components/Icon/line/mail-sign-hashtag.svg +0 -1
  303. package/src/components/Icon/line/money-cashier-receipt.svg +0 -1
  304. package/src/components/Icon/line/money-currency-dollar-pay.svg +0 -1
  305. package/src/components/Icon/line/money-graph-arrow-increase.svg +0 -1
  306. package/src/components/Icon/line/money-graph-bar-chart-increase.svg +0 -1
  307. package/src/components/Icon/line/nature-ecology-leaf.svg +0 -1
  308. package/src/components/Icon/line/phone-telephone.svg +0 -1
  309. package/src/components/Icon/line/programming-bug.svg +0 -1
  310. package/src/components/Icon/line/programming-cloud.svg +0 -1
  311. package/src/components/Icon/line/programming-computer-database-server.svg +0 -1
  312. package/src/components/Icon/line/programming-computer-database.svg +0 -1
  313. package/src/components/Icon/line/programming-module-four-layout.svg +0 -1
  314. package/src/components/Icon/line/programming-module-three.svg +0 -1
  315. package/src/components/Icon/line/programming-module.svg +0 -1
  316. package/src/components/Icon/line/programming-script-code.svg +0 -1
  317. package/src/components/Icon/line/shopping-cart.svg +0 -8
  318. package/src/components/Icon/line/shopping-gift-present.svg +0 -1
  319. package/src/components/Icon/line/shopping-shipping-box-parcel-package.svg +0 -1
  320. package/src/components/Icon/line/tag-new-circle.svg +0 -1
  321. package/src/components/Icon/line/travel-map-earth-globe.svg +0 -1
  322. package/src/components/Icon/localIcons.ts +0 -68
  323. package/src/components/Icon/solid/arrow-chevron-down.svg +0 -1
  324. package/src/components/Icon/solid/arrow-chevron-left.svg +0 -1
  325. package/src/components/Icon/solid/arrow-chevron-right.svg +0 -1
  326. package/src/components/Icon/solid/arrow-chevron-up.svg +0 -1
  327. package/src/components/Icon/solid/arrow-down.svg +0 -1
  328. package/src/components/Icon/solid/arrow-left.svg +0 -1
  329. package/src/components/Icon/solid/arrow-right.svg +0 -1
  330. package/src/components/Icon/solid/arrow-up.svg +0 -1
  331. package/src/components/Icon/solid/basic-shape-diamond.svg +0 -1
  332. package/src/components/Icon/solid/basic-shape-hexagon.svg +0 -1
  333. package/src/components/Icon/solid/basic-shape-primary-circle-ellipse-round.svg +0 -1
  334. package/src/components/Icon/solid/basic-shape-primary-square-rectangle.svg +0 -1
  335. package/src/components/Icon/solid/basic-shape-shield.svg +0 -1
  336. package/src/components/Icon/solid/computer-device-desktop-monitor.svg +0 -1
  337. package/src/components/Icon/solid/computer-device-desktop.svg +0 -1
  338. package/src/components/Icon/solid/computer-device-laptop.svg +0 -1
  339. package/src/components/Icon/solid/computer-device-mobile-phone-android-samsung-back.svg +0 -1
  340. package/src/components/Icon/solid/computer-device-mobile-phone-android-samsung.svg +0 -1
  341. package/src/components/Icon/solid/computer-device-mobile-phone-iphone-x-back.svg +0 -1
  342. package/src/components/Icon/solid/computer-device-mobile-phone-iphone-x.svg +0 -1
  343. package/src/components/Icon/solid/computer-device-mobile-tablet-touch.svg +0 -1
  344. package/src/components/Icon/solid/computer-device-mobile-tablet.svg +0 -1
  345. package/src/components/Icon/solid/computer-device-network-ethernet-cat6.svg +0 -1
  346. package/src/components/Icon/solid/computer-device-network-lan-www.svg +0 -1
  347. package/src/components/Icon/solid/computer-device-network-wifi-connection.svg +0 -5
  348. package/src/components/Icon/solid/computer-device-network-wifi-router.svg +0 -1
  349. package/src/components/Icon/solid/computer-keyboard-alt.svg +0 -1
  350. package/src/components/Icon/solid/computer-keyboard-command-cmd-control-ctrl.svg +0 -1
  351. package/src/components/Icon/solid/computer-keyboard-option.svg +0 -1
  352. package/src/components/Icon/solid/computer-keyboard-shift.svg +0 -1
  353. package/src/components/Icon/solid/ecology-science-erlenmeyer-flask.svg +0 -1
  354. package/src/components/Icon/solid/entertainment-control-button-circle-left-arrow-rewind.svg +0 -1
  355. package/src/components/Icon/solid/entertainment-control-button-circle-pause.svg +0 -1
  356. package/src/components/Icon/solid/entertainment-control-button-circle-play.svg +0 -5
  357. package/src/components/Icon/solid/entertainment-control-button-circle-right-arrow-fast-forward.svg +0 -1
  358. package/src/components/Icon/solid/entertainment-control-button-circle-stop-square.svg +0 -1
  359. package/src/components/Icon/solid/entertainment-party-popper-confetti.svg +0 -1
  360. package/src/components/Icon/solid/image-flash-lightning.svg +0 -5
  361. package/src/components/Icon/solid/image-photo-frame.svg +0 -11
  362. package/src/components/Icon/solid/image-picture-flower.svg +0 -5
  363. package/src/components/Icon/solid/interface-add-square.svg +0 -5
  364. package/src/components/Icon/solid/interface-alert-error-exclamation-block-square.svg +0 -1
  365. package/src/components/Icon/solid/interface-alert-error-x-block-square.svg +0 -1
  366. package/src/components/Icon/solid/interface-alert-exclamation-diamond.svg +0 -1
  367. package/src/components/Icon/solid/interface-alert-exclamation-triangle-warning.svg +0 -1
  368. package/src/components/Icon/solid/interface-alert-information-circle.svg +0 -5
  369. package/src/components/Icon/solid/interface-award-crown.svg +0 -5
  370. package/src/components/Icon/solid/interface-bookmark-tag.svg +0 -1
  371. package/src/components/Icon/solid/interface-bookmark.svg +0 -5
  372. package/src/components/Icon/solid/interface-calendar-date-one.svg +0 -5
  373. package/src/components/Icon/solid/interface-close.svg +0 -8
  374. package/src/components/Icon/solid/interface-content-book-open-pages.svg +0 -13
  375. package/src/components/Icon/solid/interface-content-book-page.svg +0 -5
  376. package/src/components/Icon/solid/interface-content-file.svg +0 -5
  377. package/src/components/Icon/solid/interface-content-folder.svg +0 -1
  378. package/src/components/Icon/solid/interface-copy-clipboard.svg +0 -5
  379. package/src/components/Icon/solid/interface-delete-bin-trash.svg +0 -1
  380. package/src/components/Icon/solid/interface-dots-horizontal.svg +0 -1
  381. package/src/components/Icon/solid/interface-dots-vertical.svg +0 -1
  382. package/src/components/Icon/solid/interface-edit-attachment.svg +0 -5
  383. package/src/components/Icon/solid/interface-edit-binocular.svg +0 -5
  384. package/src/components/Icon/solid/interface-edit-magic-wand.svg +0 -7
  385. package/src/components/Icon/solid/interface-edit-tool-eraser.svg +0 -1
  386. package/src/components/Icon/solid/interface-edit-tool-paint-brush.svg +0 -1
  387. package/src/components/Icon/solid/interface-edit-tool-paint-roller.svg +0 -5
  388. package/src/components/Icon/solid/interface-edit-tool-pen.svg +0 -5
  389. package/src/components/Icon/solid/interface-edit-tool-pencil.svg +0 -1
  390. package/src/components/Icon/solid/interface-edit-view-eye.svg +0 -7
  391. package/src/components/Icon/solid/interface-favorite-award.svg +0 -5
  392. package/src/components/Icon/solid/interface-favorite-flag.svg +0 -1
  393. package/src/components/Icon/solid/interface-favorite-heart.svg +0 -5
  394. package/src/components/Icon/solid/interface-favorite-star.svg +0 -5
  395. package/src/components/Icon/solid/interface-favorite-stars-shining.svg +0 -1
  396. package/src/components/Icon/solid/interface-favorite-stars-sparkles.svg +0 -1
  397. package/src/components/Icon/solid/interface-hierarchy-flowchart.svg +0 -5
  398. package/src/components/Icon/solid/interface-home-house.svg +0 -5
  399. package/src/components/Icon/solid/interface-hyperlink.svg +0 -5
  400. package/src/components/Icon/solid/interface-lighting-brightness.svg +0 -22
  401. package/src/components/Icon/solid/interface-lock-closed.svg +0 -5
  402. package/src/components/Icon/solid/interface-lock-open-unlock.svg +0 -1
  403. package/src/components/Icon/solid/interface-login-key.svg +0 -5
  404. package/src/components/Icon/solid/interface-search.svg +0 -5
  405. package/src/components/Icon/solid/interface-setting-cog.svg +0 -5
  406. package/src/components/Icon/solid/interface-share-megaphone-bullhorn.svg +0 -5
  407. package/src/components/Icon/solid/interface-share-rocket.svg +0 -1
  408. package/src/components/Icon/solid/interface-share-satellite.svg +0 -8
  409. package/src/components/Icon/solid/interface-share-space-ship.svg +0 -1
  410. package/src/components/Icon/solid/interface-share.svg +0 -5
  411. package/src/components/Icon/solid/interface-signal-square.svg +0 -5
  412. package/src/components/Icon/solid/interface-text-formatting-left-open-quote.svg +0 -1
  413. package/src/components/Icon/solid/interface-text-formatting-right-close-quote.svg +0 -1
  414. package/src/components/Icon/solid/interface-time-clock-circle.svg +0 -5
  415. package/src/components/Icon/solid/interface-time-hour-glass.svg +0 -1
  416. package/src/components/Icon/solid/interface-users-multiple.svg +0 -11
  417. package/src/components/Icon/solid/interface-validation-checkbox-square.svg +0 -5
  418. package/src/components/Icon/solid/interface-weather-moon.svg +0 -5
  419. package/src/components/Icon/solid/legal-justice-hammer-gavel.svg +0 -1
  420. package/src/components/Icon/solid/mail-chat-bubble-square.svg +0 -5
  421. package/src/components/Icon/solid/mail-send-email-paper-airplane.svg +0 -5
  422. package/src/components/Icon/solid/mail-send-envelope.svg +0 -1
  423. package/src/components/Icon/solid/mail-sign-hashtag.svg +0 -5
  424. package/src/components/Icon/solid/money-cashier-receipt.svg +0 -1
  425. package/src/components/Icon/solid/money-currency-dollar-pay.svg +0 -5
  426. package/src/components/Icon/solid/money-graph-arrow-increase.svg +0 -5
  427. package/src/components/Icon/solid/money-graph-bar-chart-increase.svg +0 -1
  428. package/src/components/Icon/solid/nature-ecology-leaf.svg +0 -5
  429. package/src/components/Icon/solid/phone-telephone.svg +0 -5
  430. package/src/components/Icon/solid/programming-bug.svg +0 -5
  431. package/src/components/Icon/solid/programming-cloud.svg +0 -4
  432. package/src/components/Icon/solid/programming-computer-database-server.svg +0 -5
  433. package/src/components/Icon/solid/programming-computer-database.svg +0 -5
  434. package/src/components/Icon/solid/programming-module-four-layout.svg +0 -1
  435. package/src/components/Icon/solid/programming-module-three.svg +0 -1
  436. package/src/components/Icon/solid/programming-module.svg +0 -1
  437. package/src/components/Icon/solid/programming-script-code.svg +0 -5
  438. package/src/components/Icon/solid/shopping-cart.svg +0 -1
  439. package/src/components/Icon/solid/shopping-gift-present.svg +0 -16
  440. package/src/components/Icon/solid/shopping-shipping-box-parcel-package.svg +0 -11
  441. package/src/components/Icon/solid/tag-new-circle.svg +0 -7
  442. package/src/components/Icon/solid/travel-map-earth-globe.svg +0 -5
  443. package/src/components/Sidebar.vue +0 -282
  444. package/src/components/SidebarElement.vue +0 -133
  445. package/src/components/SidebarGroup.vue +0 -12
  446. package/src/declarations/typographic-base.d.ts +0 -1
  447. package/src/helpers/generateAxiosCodeFromRequest.ts +0 -42
  448. package/src/helpers/generateLaravelCodeFromRequest.ts +0 -20
  449. package/src/helpers/index.ts +0 -4
  450. package/src/helpers/objectMerge.ts +0 -19
  451. package/src/helpers/transformToJson.ts +0 -22
  452. package/src/hooks/useSwaggerParser.test.ts +0 -7
  453. package/src/hooks/useSwaggerParser.ts +0 -79
  454. package/src/index.ts +0 -6
  455. package/src/stores/template.ts +0 -66
  456. package/src/stores/utility.ts +0 -23
  457. package/src/types.ts +0 -151
  458. package/tsconfig.build.json +0 -11
  459. package/tsconfig.json +0 -20
  460. package/vite.config.ts +0 -28
@@ -1,365 +0,0 @@
1
- <script setup lang="ts">
2
- import { java } from '@codemirror/lang-java'
3
- import { javascript } from '@codemirror/lang-javascript'
4
- import { python } from '@codemirror/lang-python'
5
- import { type LanguageSupport } from '@codemirror/language'
6
- import { StreamLanguage } from '@codemirror/language'
7
- import {
8
- c,
9
- csharp,
10
- kotlin,
11
- objectiveC,
12
- } from '@codemirror/legacy-modes/mode/clike'
13
- import { clojure } from '@codemirror/legacy-modes/mode/clojure'
14
- import { go } from '@codemirror/legacy-modes/mode/go'
15
- import { http } from '@codemirror/legacy-modes/mode/http'
16
- import { oCaml } from '@codemirror/legacy-modes/mode/mllike'
17
- import { powerShell } from '@codemirror/legacy-modes/mode/powershell'
18
- import { r } from '@codemirror/legacy-modes/mode/r'
19
- import { ruby } from '@codemirror/legacy-modes/mode/ruby'
20
- import { shell } from '@codemirror/legacy-modes/mode/shell'
21
- import { swift } from '@codemirror/legacy-modes/mode/swift'
22
- import { lineNumbers } from '@codemirror/view'
23
- import {
24
- generateRequest,
25
- useApiClientRequestStore,
26
- useApiClientStore,
27
- } from '@scalar/api-client'
28
- import { useOperation } from '@scalar/api-client'
29
- import { useClipboard } from '@scalar/use-clipboard'
30
- import { useCodeMirror } from '@scalar/use-codemirror'
31
- import { EditorView } from 'codemirror'
32
- import {
33
- HTTPSnippet,
34
- type HarRequest,
35
- type TargetId,
36
- availableTargets,
37
- } from 'httpsnippet-lite'
38
- import { computed, onMounted, watch } from 'vue'
39
-
40
- import {
41
- generateAxiosCodeFromRequest,
42
- generateLaravelCodeFromRequest,
43
- } from '../../../helpers'
44
- import { useTemplateStore } from '../../../stores/template'
45
- import type { Operation, Server } from '../../../types'
46
- import { Card, CardContent, CardFooter, CardHeader } from '../../Card'
47
- import { Icon } from '../../Icon'
48
-
49
- const props = defineProps<{ operation: Operation; server: Server }>()
50
-
51
- const { copyToClipboard } = useClipboard()
52
-
53
- const { setActiveRequest } = useApiClientRequestStore()
54
-
55
- const { toggleApiClient } = useApiClientStore()
56
-
57
- const {
58
- state: templateState,
59
- getLanguageTitleByKey,
60
- setItem,
61
- } = useTemplateStore()
62
-
63
- // TODO: Add PHP
64
- const syntaxHighlighting: Record<
65
- Exclude<TargetId, 'php'> | 'axios',
66
- LanguageSupport | StreamLanguage<any>
67
- > = {
68
- c: StreamLanguage.define(c),
69
- clojure: StreamLanguage.define(clojure),
70
- csharp: StreamLanguage.define(csharp),
71
- go: StreamLanguage.define(go),
72
- http: StreamLanguage.define(http),
73
- java: java(),
74
- javascript: javascript(),
75
- kotlin: StreamLanguage.define(kotlin),
76
- node: javascript(),
77
- objc: StreamLanguage.define(objectiveC),
78
- ocaml: StreamLanguage.define(oCaml),
79
- powershell: StreamLanguage.define(powerShell),
80
- python: python(),
81
- r: StreamLanguage.define(r),
82
- ruby: StreamLanguage.define(ruby),
83
- shell: StreamLanguage.define(shell),
84
- swift: StreamLanguage.define(swift),
85
- axios: javascript(),
86
- }
87
-
88
- const editorExtensions = computed(() => {
89
- const extensions = [lineNumbers(), EditorView.editable.of(false)]
90
-
91
- if (
92
- Object.hasOwnProperty.call(
93
- syntaxHighlighting,
94
- templateState.preferredLanguage,
95
- )
96
- ) {
97
- // @ts-ignore
98
- extensions.push(syntaxHighlighting[templateState.preferredLanguage])
99
- }
100
-
101
- return extensions
102
- })
103
-
104
- const { codeMirrorRef, setCodeMirrorContent, reconfigureCodeMirror } =
105
- useCodeMirror({
106
- content: '',
107
- extensions: editorExtensions.value,
108
- forceDarkMode: true,
109
- })
110
-
111
- const { parameterMap } = useOperation(props)
112
-
113
- async function generateSnippet() {
114
- if (templateState.preferredLanguage === 'axios') {
115
- return generateAxiosCodeFromRequest({
116
- method: props.operation.httpVerb.toUpperCase(),
117
- url: `${props.server.url}${props.operation.path}`,
118
- })
119
- } else if (templateState.preferredLanguage === 'laravel') {
120
- return generateLaravelCodeFromRequest({
121
- method: props.operation.httpVerb.toUpperCase(),
122
- url: `${props.server.url}${props.operation.path}`,
123
- })
124
- }
125
-
126
- try {
127
- const snippet = new HTTPSnippet({
128
- method: props.operation.httpVerb.toUpperCase(),
129
- url: `${props.server.url}${props.operation.path}`,
130
- } as HarRequest)
131
- const output = (await snippet.convert(
132
- templateState.preferredLanguage as TargetId,
133
- )) as string
134
- return output
135
- } catch {
136
- const snippet = new HTTPSnippet({
137
- method: props.operation.httpVerb.toUpperCase(),
138
- url: `${window.location.origin}${props.operation.path}`,
139
- } as HarRequest)
140
- const output = (await snippet.convert(
141
- templateState.preferredLanguage as TargetId,
142
- )) as string
143
-
144
- return output
145
- }
146
- }
147
-
148
- onMounted(async () => {
149
- const initialSnippet = await generateSnippet()
150
- setCodeMirrorContent(initialSnippet)
151
- watch(
152
- () => templateState.preferredLanguage,
153
- async () => {
154
- const output = await generateSnippet()
155
- setCodeMirrorContent(output)
156
- reconfigureCodeMirror(editorExtensions.value)
157
- },
158
- )
159
- })
160
-
161
- const copyExampleRequest = async () => {
162
- copyToClipboard(await generateSnippet())
163
- }
164
-
165
- function showItemInClient() {
166
- const item = generateRequest(
167
- props.operation,
168
- parameterMap.value,
169
- props.server,
170
- )
171
- setActiveRequest(item)
172
- toggleApiClient()
173
- }
174
-
175
- // Store selected languages in LocalStorage
176
- const localStorageKey = 'preferredLanguage'
177
- const selectLanguage = (language: TargetId) => {
178
- setItem('preferredLanguage', language)
179
- localStorage.setItem(localStorageKey, language)
180
- }
181
-
182
- const availableLanguages = computed(() => {
183
- return [
184
- ...availableTargets().filter((target) => target.key !== 'http'),
185
- { key: 'axios', title: 'JavaScript (Axios)' },
186
- { key: 'laravel', title: 'PHP (Laravel)' },
187
- ].sort((a, b) => a.title.localeCompare(b.title))
188
- })
189
- </script>
190
- <template>
191
- <Card class="dark-mode">
192
- <CardHeader muted>
193
- <span :class="`request-method request-method--${operation.httpVerb}`">
194
- {{ operation.httpVerb }}
195
- </span>
196
- <span class="request-path">{{ operation.path }}</span>
197
-
198
- <template #actions>
199
- <div class="language-select">
200
- <span>{{
201
- getLanguageTitleByKey(templateState.preferredLanguage)
202
- }}</span>
203
- <select
204
- class="language-select"
205
- :value="templateState.preferredLanguage"
206
- @input="event => selectLanguage((event.target as HTMLSelectElement).value as TargetId)">
207
- <option
208
- v-for="lang in availableLanguages"
209
- :key="lang.key"
210
- :value="lang.key">
211
- {{ lang.title }}
212
- </option>
213
- </select>
214
- </div>
215
-
216
- <button
217
- class="copy-button"
218
- type="button"
219
- @click="copyExampleRequest">
220
- <Icon
221
- src="solid/interface-copy-clipboard"
222
- width="10px" />
223
- </button>
224
- </template>
225
- </CardHeader>
226
- <CardContent
227
- borderless
228
- frameless>
229
- <div ref="codeMirrorRef" />
230
- </CardContent>
231
- <CardFooter muted>
232
- <button
233
- class="show-api-client-button"
234
- type="button"
235
- @click="showItemInClient">
236
- <Icon src="solid/mail-send-email-paper-airplane" />
237
- Test {{ operation.httpVerb }} Request in Client
238
- </button>
239
- </CardFooter>
240
- </Card>
241
- </template>
242
- <style scoped>
243
- .request-method--post {
244
- color: var(--scalar-api-reference-theme-post-color);
245
- }
246
- .request-method--patch {
247
- color: var(--scalar-api-reference-theme-patch-color);
248
- }
249
- .request-method--get {
250
- color: var(--scalar-api-reference-theme-get-color);
251
- }
252
- .request-method--delete {
253
- color: var(--scalar-api-reference-theme-delete-color);
254
- }
255
- .request-method--put {
256
- color: var(--scalar-api-reference-theme-put-color);
257
- }
258
- .request-path {
259
- margin-left: 6px;
260
- color: var(--scalar-api-reference-theme-color-2);
261
- white-space: nowrap;
262
- overflow: hidden;
263
- cursor: default;
264
- text-overflow: ellipsis;
265
- text-transform: none !important;
266
- }
267
-
268
- .language-select {
269
- position: relative;
270
- padding-right: 9px;
271
- border-right: 1px solid var(--scalar-api-reference-border-color);
272
- }
273
- .language-select select {
274
- border: none;
275
- outline: none;
276
- cursor: pointer;
277
- background: var(--scalar-api-reference-theme-background-3);
278
- box-shadow: -2px 0 0 0 var(--scalar-api-reference-theme-background-3);
279
- z-index: 2;
280
- position: absolute;
281
- top: 0;
282
- left: 0;
283
- width: 100%;
284
- height: 100%;
285
- opacity: 0;
286
- appearance: none;
287
- }
288
- .language-select span {
289
- font-size: 12px;
290
- color: var(--scalar-api-reference-theme-color-3);
291
- font-weight: var(--scalar-api-reference-theme-semibold);
292
- display: flex;
293
- align-items: center;
294
- justify-content: center;
295
- }
296
- .language-select span:after {
297
- content: '';
298
- width: 7px;
299
- height: 7px;
300
- transform: rotate(45deg) translate3d(-2px, -2px, 0);
301
- display: block;
302
- margin-left: 6px;
303
- box-shadow: 1px 1px 0 currentColor;
304
- }
305
- .language-select span:hover {
306
- background: var(--scalar-api-reference-theme-background-2);
307
- }
308
-
309
- .copy-button {
310
- appearance: none;
311
- -webkit-appearance: none;
312
- outline: none;
313
- background: transparent;
314
- display: flex;
315
- cursor: pointer;
316
- color: var(--scalar-api-reference-theme-color-3);
317
- margin-left: 6px;
318
- border: none;
319
- border-radius: 3px;
320
- }
321
-
322
- .copy-button:hover {
323
- color: var(--scalar-api-reference-theme-color-1);
324
- }
325
-
326
- .copy-button svg {
327
- width: 13px;
328
- height: 13px;
329
- }
330
-
331
- .show-api-client-button {
332
- width: 100%;
333
- display: block;
334
- appearance: none;
335
- outline: none;
336
- border: none;
337
- border-radius: var(--scalar-api-reference-rounded-lg);
338
- height: 35px;
339
- display: flex;
340
- justify-content: center;
341
- cursor: pointer;
342
- align-items: center;
343
- font-weight: var(--scalar-api-reference-theme-bold);
344
- font-size: var(--scalar-api-reference-theme-micro);
345
- text-transform: uppercase;
346
- border: 1px solid currentColor;
347
- background: var(--scalar-api-reference-theme-button-1);
348
- color: var(--scalar-api-reference-theme-button-1-color);
349
- }
350
- .show-api-client-button:hover {
351
- background: var(--scalar-api-reference-theme-button-1-hover);
352
- }
353
- .show-api-client-button svg {
354
- height: 12px;
355
- width: auto;
356
- margin-right: 6px;
357
- }
358
-
359
- .request-method {
360
- font-family: var(--scalar-api-reference-font-mono);
361
- }
362
- .request-path {
363
- font-family: var(--scalar-api-reference-font-mono);
364
- }
365
- </style>
@@ -1,22 +0,0 @@
1
- <script lang="ts" setup>
2
- import { httpStatusCodes } from '@scalar/api-client'
3
- import { useTooltip } from '@scalar/use-tooltip'
4
- import { computed } from 'vue'
5
-
6
- const props = defineProps<{ title: string }>()
7
-
8
- const statusText = computed(() => {
9
- return httpStatusCodes[props.title]?.name ?? null
10
- })
11
-
12
- const tooltipRef = useTooltip({
13
- content: statusText.value,
14
- })
15
- </script>
16
- <template>
17
- <span
18
- ref="tooltipRef"
19
- class="codemenu-item-key">
20
- {{ title }}
21
- </span>
22
- </template>
@@ -1,134 +0,0 @@
1
- <script lang="ts" setup>
2
- import { json } from '@codemirror/lang-json'
3
- import { useClipboard } from '@scalar/use-clipboard'
4
- import { useCodeMirror } from '@scalar/use-codemirror'
5
- import { EditorView } from 'codemirror'
6
- import { computed, ref, watch } from 'vue'
7
-
8
- import type { TransformedOperation } from '../../../types'
9
- import {
10
- Card,
11
- CardContent,
12
- CardFooter,
13
- CardTab,
14
- CardTabHeader,
15
- } from '../../Card'
16
- import { Icon } from '../../Icon'
17
-
18
- const props = defineProps<{ operation: TransformedOperation }>()
19
-
20
- const { copyToClipboard } = useClipboard()
21
-
22
- // Bring the status codes in the right order.
23
- const orderedStatusCodes = computed(() => {
24
- return Object.keys(props.operation.information.responses).sort((x) => {
25
- if (x === 'default') {
26
- return -1
27
- }
28
-
29
- return 0
30
- })
31
- })
32
-
33
- // Keep track of the current selected tab
34
- const selectedResponseIndex = ref<number>(0)
35
-
36
- // Return the whole response object
37
- const currentResponse = computed(() => {
38
- const currentStatusCode =
39
- orderedStatusCodes.value[selectedResponseIndex.value]
40
-
41
- return props.operation.responses[currentStatusCode]
42
- })
43
-
44
- const currentResponseJsonBody = computed(() => {
45
- return currentResponse.value?.content?.['application/json']?.body
46
- })
47
-
48
- const { codeMirrorRef, setCodeMirrorContent } = useCodeMirror({
49
- content: currentResponseJsonBody.value,
50
- extensions: [json(), EditorView.editable.of(false)],
51
- })
52
-
53
- const changeTab = (index: number) => {
54
- selectedResponseIndex.value = index
55
- }
56
-
57
- watch(selectedResponseIndex, () => {
58
- setCodeMirrorContent(currentResponseJsonBody.value ?? '')
59
- })
60
- </script>
61
- <template>
62
- <Card>
63
- <CardTabHeader
64
- muted
65
- @change="changeTab">
66
- <CardTab
67
- v-for="statusCode in orderedStatusCodes"
68
- :key="statusCode">
69
- {{ statusCode }}
70
- </CardTab>
71
-
72
- <template #actions>
73
- <button
74
- v-if="currentResponseJsonBody"
75
- class="code-copy"
76
- type="button"
77
- @click="() => copyToClipboard(currentResponseJsonBody)">
78
- <Icon
79
- src="solid/interface-copy-clipboard"
80
- width="10px" />
81
- </button>
82
- </template>
83
- </CardTabHeader>
84
- <CardContent muted>
85
- <div
86
- v-show="currentResponseJsonBody"
87
- ref="codeMirrorRef" />
88
- <div
89
- v-if="!currentResponseJsonBody"
90
- class="scalar-api-reference__empty-state">
91
- No Body
92
- </div>
93
- </CardContent>
94
- <CardFooter
95
- v-if="currentResponse.description"
96
- muted>
97
- <div class="description">
98
- {{ currentResponse.description }}
99
- </div>
100
- </CardFooter>
101
- </Card>
102
- </template>
103
-
104
- <style scoped>
105
- .code-copy {
106
- display: flex;
107
- appearance: none;
108
- -webkit-appearance: none;
109
- outline: none;
110
- background: transparent;
111
- cursor: pointer;
112
- color: var(--scalar-api-reference-theme-color-3);
113
- border: none;
114
- }
115
- .code-copy:hover {
116
- color: var(--scalar-api-reference-theme-color-1);
117
- }
118
- .code-copy svg {
119
- width: 13px;
120
- height: 13px;
121
- }
122
- .description {
123
- font-weight: var(--scalar-api-reference-theme-semibold);
124
- font-size: var(--scalar-api-reference-theme-mini);
125
- }
126
- .scalar-api-reference__empty-state {
127
- border: 1px dashed var(--scalar-api-reference-border-color);
128
- width: 100%;
129
- text-align: center;
130
- font-size: var(--scalar-api-reference-theme-mini);
131
- padding: 20px;
132
- color: var(--scalar-api-reference-theme-color-2);
133
- }
134
- </style>
@@ -1,26 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Parameters } from '../../../types'
3
- import MarkdownRenderer from '../MarkdownRenderer.vue'
4
-
5
- defineProps<{ parameter: Parameters }>()
6
- </script>
7
- <template>
8
- <li>
9
- <span class="parameter-name">{{ parameter.name }}</span>
10
- <span
11
- v-if="parameter.required !== undefined"
12
- class="parameter-required"
13
- :class="parameter.required ? 'marc_required' : ''">
14
- {{ parameter.required ? 'required' : 'optional' }}
15
- </span>
16
- <span
17
- v-if="parameter.schema?.type"
18
- class="parameter-type">
19
- {{ parameter.schema?.type }}
20
- </span>
21
- <MarkdownRenderer
22
- v-if="parameter.description"
23
- class="parameter-description"
24
- :value="parameter.description" />
25
- </li>
26
- </template>
@@ -1,23 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Parameters } from '../../../types'
3
- import ParameterItem from './ParameterItem.vue'
4
-
5
- defineProps<{ parameters?: Parameters[]; title: string }>()
6
- </script>
7
- <template>
8
- <div
9
- v-if="parameters?.length"
10
- class="parameters-container">
11
- <div class="endpoint-title">
12
- <h5 class="title">
13
- {{ title }}
14
- </h5>
15
- </div>
16
- <ul class="parameter">
17
- <ParameterItem
18
- v-for="item in parameters"
19
- :key="item.name"
20
- :parameter="item" />
21
- </ul>
22
- </div>
23
- </template>
@@ -1,29 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Server, Tag, TransformedOperation } from '../../../types'
3
- import Copy from './Copy.vue'
4
- import ExampleRequest from './ExampleRequest.vue'
5
- import ExampleResponses from './ExampleResponses.vue'
6
-
7
- defineProps<{
8
- operation: TransformedOperation
9
- server: Server
10
- parentTag: Tag
11
- }>()
12
- </script>
13
- <template>
14
- <div
15
- :id="`endpoint/${operation.operationId}`"
16
- class="reference-container">
17
- <Copy
18
- :operation="operation"
19
- :parentTag="parentTag" />
20
- <div class="example">
21
- <ExampleRequest
22
- :operation="operation"
23
- :server="server" />
24
- </div>
25
- <div class="example">
26
- <ExampleResponses :operation="operation" />
27
- </div>
28
- </div>
29
- </template>