@scalar/api-reference 0.5.1 → 0.5.3

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