@scalar/api-reference 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) hide show
  1. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  2. package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
  3. package/dist/components/Content/ReferenceEndpoint/ExampleResponses.vue.d.ts.map +1 -1
  4. package/dist/components/HelpfulLink.vue.d.ts +20 -0
  5. package/dist/components/HelpfulLink.vue.d.ts.map +1 -0
  6. package/dist/components/SearchModal.vue.d.ts.map +1 -1
  7. package/dist/components/SimpleTable/SimpleCell.vue.d.ts +40 -0
  8. package/dist/components/SimpleTable/SimpleCell.vue.d.ts.map +1 -0
  9. package/dist/components/SimpleTable/SimpleHeader.vue.d.ts +10 -0
  10. package/dist/components/SimpleTable/SimpleHeader.vue.d.ts.map +1 -0
  11. package/dist/components/SimpleTable/SimpleRow.vue.d.ts +10 -0
  12. package/dist/components/SimpleTable/SimpleRow.vue.d.ts.map +1 -0
  13. package/dist/components/SimpleTable/SimpleTable.vue.d.ts +10 -0
  14. package/dist/components/SimpleTable/SimpleTable.vue.d.ts.map +1 -0
  15. package/dist/components/SimpleTable/index.d.ts +5 -0
  16. package/dist/components/SimpleTable/index.d.ts.map +1 -0
  17. package/dist/index.js +32962 -37640
  18. package/package.json +11 -11
  19. package/src/components/ApiClientModal.vue +205 -0
  20. package/src/components/ApiReference.vue +754 -0
  21. package/src/components/Card/Card.vue +12 -0
  22. package/src/components/Card/CardContent.vue +45 -0
  23. package/src/components/Card/CardFooter.vue +13 -0
  24. package/src/components/Card/CardHeader.vue +37 -0
  25. package/src/components/Card/CardTab.vue +32 -0
  26. package/src/components/Card/CardTabHeader.vue +32 -0
  27. package/src/components/Card/index.ts +6 -0
  28. package/src/components/Content/Content.vue +145 -0
  29. package/src/components/Content/Introduction/BaseUrl.vue +32 -0
  30. package/src/components/Content/Introduction/Introduction.vue +141 -0
  31. package/src/components/Content/Introduction/LanguageSelector.vue +361 -0
  32. package/src/components/Content/Introduction/index.ts +1 -0
  33. package/src/components/Content/MarkdownRenderer.vue +174 -0
  34. package/src/components/Content/ReferenceEndpoint/Copy.vue +100 -0
  35. package/src/components/Content/ReferenceEndpoint/ExampleRequest.vue +317 -0
  36. package/src/components/Content/ReferenceEndpoint/ExampleResponseTab.vue +22 -0
  37. package/src/components/Content/ReferenceEndpoint/ExampleResponses.vue +168 -0
  38. package/src/components/Content/ReferenceEndpoint/ParameterItem.vue +26 -0
  39. package/src/components/Content/ReferenceEndpoint/Parameters.vue +23 -0
  40. package/src/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue +29 -0
  41. package/src/components/Content/ReferenceEndpoint/RequestBody.vue +125 -0
  42. package/src/components/Content/ReferenceEndpoint/RequestBodyProperties.vue +54 -0
  43. package/src/components/Content/ReferenceEndpoint/RequestBodyPropertiesChild.vue +39 -0
  44. package/src/components/Content/ReferenceEndpoint/index.ts +1 -0
  45. package/src/components/Content/ReferenceTag.vue +99 -0
  46. package/src/components/Content/Spinner.vue +51 -0
  47. package/src/components/Content/index.ts +1 -0
  48. package/src/components/FindAnythingButton.vue +76 -0
  49. package/src/components/FlowButton.vue +184 -0
  50. package/src/components/FlowIconButton.vue +25 -0
  51. package/src/components/FlowLoader.vue +207 -0
  52. package/src/components/FlowModal.vue +133 -0
  53. package/src/components/HelpfulLink.vue +19 -0
  54. package/src/components/Icon/FlowIcon.vue +19 -0
  55. package/src/components/Icon/Icon.vue +23 -0
  56. package/src/components/Icon/SvgRenderer.ts +66 -0
  57. package/src/components/Icon/brand/brand-adobe.svg +1 -0
  58. package/src/components/Icon/brand/brand-amazon.svg +1 -0
  59. package/src/components/Icon/brand/brand-browser-firefox.svg +5 -0
  60. package/src/components/Icon/brand/brand-browser-googlechrome.svg +5 -0
  61. package/src/components/Icon/brand/brand-creative-commons.svg +1 -0
  62. package/src/components/Icon/brand/brand-ecommerce-etsy.svg +1 -0
  63. package/src/components/Icon/brand/brand-ecommerce-patreon.svg +1 -0
  64. package/src/components/Icon/brand/brand-ecommerce-shopify.svg +5 -0
  65. package/src/components/Icon/brand/brand-ecommerce-wordpress.svg +1 -0
  66. package/src/components/Icon/brand/brand-gaming-nintendo-switch.svg +5 -0
  67. package/src/components/Icon/brand/brand-gaming-playstation.svg +1 -0
  68. package/src/components/Icon/brand/brand-gaming-xbox-live.svg +5 -0
  69. package/src/components/Icon/brand/brand-google-drive.svg +5 -0
  70. package/src/components/Icon/brand/brand-google-gmail.svg +5 -0
  71. package/src/components/Icon/brand/brand-google.svg +1 -0
  72. package/src/components/Icon/brand/brand-music-itunes.svg +1 -0
  73. package/src/components/Icon/brand/brand-music-soundcloud.svg +1 -0
  74. package/src/components/Icon/brand/brand-music-spotify.svg +1 -0
  75. package/src/components/Icon/brand/brand-office-dropbox.svg +5 -0
  76. package/src/components/Icon/brand/brand-office-slack.svg +5 -0
  77. package/src/components/Icon/brand/brand-office-zoom.svg +1 -0
  78. package/src/components/Icon/brand/brand-payments-alipay.svg +1 -0
  79. package/src/components/Icon/brand/brand-payments-paypal.svg +1 -0
  80. package/src/components/Icon/brand/brand-payments-stripe.svg +1 -0
  81. package/src/components/Icon/brand/brand-platform-android.svg +1 -0
  82. package/src/components/Icon/brand/brand-platform-apple.svg +5 -0
  83. package/src/components/Icon/brand/brand-platform-linux.svg +5 -0
  84. package/src/components/Icon/brand/brand-platform-microsoft-windows.svg +4 -0
  85. package/src/components/Icon/brand/brand-social-chat-discord.svg +5 -0
  86. package/src/components/Icon/brand/brand-social-chat-kuaishou.svg +5 -0
  87. package/src/components/Icon/brand/brand-social-chat-line.svg +5 -0
  88. package/src/components/Icon/brand/brand-social-chat-messenger.svg +5 -0
  89. package/src/components/Icon/brand/brand-social-chat-signal.svg +5 -0
  90. package/src/components/Icon/brand/brand-social-chat-snapchat.svg +5 -0
  91. package/src/components/Icon/brand/brand-social-chat-telegram.svg +5 -0
  92. package/src/components/Icon/brand/brand-social-chat-wechat.svg +5 -0
  93. package/src/components/Icon/brand/brand-social-chat-whatsapp.svg +5 -0
  94. package/src/components/Icon/brand/brand-social-media-deviantart.svg +5 -0
  95. package/src/components/Icon/brand/brand-social-media-dribbble.svg +1 -0
  96. package/src/components/Icon/brand/brand-social-media-facebook.svg +1 -0
  97. package/src/components/Icon/brand/brand-social-media-instagram.svg +5 -0
  98. package/src/components/Icon/brand/brand-social-media-linkedin.svg +5 -0
  99. package/src/components/Icon/brand/brand-social-media-pinterest.svg +5 -0
  100. package/src/components/Icon/brand/brand-social-media-reddit.svg +1 -0
  101. package/src/components/Icon/brand/brand-social-media-sina-weibo.svg +5 -0
  102. package/src/components/Icon/brand/brand-social-media-threads.svg +1 -0
  103. package/src/components/Icon/brand/brand-social-media-tiktok.svg +5 -0
  104. package/src/components/Icon/brand/brand-social-media-tinder.svg +1 -0
  105. package/src/components/Icon/brand/brand-social-media-tumblr.svg +5 -0
  106. package/src/components/Icon/brand/brand-social-media-twitter.svg +5 -0
  107. package/src/components/Icon/brand/brand-software-design-figma.svg +1 -0
  108. package/src/components/Icon/brand/brand-software-development-authy.svg +1 -0
  109. package/src/components/Icon/brand/brand-software-development-digital-ocean.svg +1 -0
  110. package/src/components/Icon/brand/brand-software-development-docker.svg +5 -0
  111. package/src/components/Icon/brand/brand-software-development-github.svg +5 -0
  112. package/src/components/Icon/brand/brand-software-development-jira.svg +1 -0
  113. package/src/components/Icon/brand/brand-software-development-openai.svg +1 -0
  114. package/src/components/Icon/brand/brand-software-development-stackexchange.svg +5 -0
  115. package/src/components/Icon/brand/brand-software-development-stackoverflow.svg +1 -0
  116. package/src/components/Icon/brand/brand-video-netflix.svg +5 -0
  117. package/src/components/Icon/brand/brand-video-twitch.svg +1 -0
  118. package/src/components/Icon/brand/brand-video-vimeo.svg +5 -0
  119. package/src/components/Icon/brand/brand-video-youtube.svg +5 -0
  120. package/src/components/Icon/brand/programming-framework-angular.svg +5 -0
  121. package/src/components/Icon/brand/programming-framework-astro.svg +5 -0
  122. package/src/components/Icon/brand/programming-framework-laravel.svg +1 -0
  123. package/src/components/Icon/brand/programming-framework-nextdotjs.svg +5 -0
  124. package/src/components/Icon/brand/programming-framework-react.svg +5 -0
  125. package/src/components/Icon/brand/programming-framework-vuedotjs.svg +1 -0
  126. package/src/components/Icon/brand/programming-language-c.svg +5 -0
  127. package/src/components/Icon/brand/programming-language-clojure.svg +5 -0
  128. package/src/components/Icon/brand/programming-language-csharp.svg +4 -0
  129. package/src/components/Icon/brand/programming-language-css3.svg +4 -0
  130. package/src/components/Icon/brand/programming-language-go.svg +4 -0
  131. package/src/components/Icon/brand/programming-language-html5.svg +4 -0
  132. package/src/components/Icon/brand/programming-language-java.svg +21 -0
  133. package/src/components/Icon/brand/programming-language-javascript-js.svg +4 -0
  134. package/src/components/Icon/brand/programming-language-json.svg +8 -0
  135. package/src/components/Icon/brand/programming-language-kotlin.svg +3 -0
  136. package/src/components/Icon/brand/programming-language-node.svg +10 -0
  137. package/src/components/Icon/brand/programming-language-objc.svg +6 -0
  138. package/src/components/Icon/brand/programming-language-ocaml.svg +4 -0
  139. package/src/components/Icon/brand/programming-language-php.svg +4 -0
  140. package/src/components/Icon/brand/programming-language-powershell.svg +10 -0
  141. package/src/components/Icon/brand/programming-language-python.svg +4 -0
  142. package/src/components/Icon/brand/programming-language-r.svg +7 -0
  143. package/src/components/Icon/brand/programming-language-ruby.svg +5 -0
  144. package/src/components/Icon/brand/programming-language-scala.svg +5 -0
  145. package/src/components/Icon/brand/programming-language-shell.svg +5 -0
  146. package/src/components/Icon/brand/programming-language-swift.svg +4 -0
  147. package/src/components/Icon/brand/programming-language-typescript.svg +5 -0
  148. package/src/components/Icon/brand/programming-tool-git.svg +1 -0
  149. package/src/components/Icon/brand/programming-tool-tailwindcss.svg +5 -0
  150. package/src/components/Icon/icons/Add.svg +4 -0
  151. package/src/components/Icon/icons/ArrowDown.svg +3 -0
  152. package/src/components/Icon/icons/ArrowLeft.svg +3 -0
  153. package/src/components/Icon/icons/ArrowRight.svg +3 -0
  154. package/src/components/Icon/icons/ArrowUp.svg +3 -0
  155. package/src/components/Icon/icons/Background.svg +8 -0
  156. package/src/components/Icon/icons/CallToAction.svg +5 -0
  157. package/src/components/Icon/icons/CheckMark.svg +3 -0
  158. package/src/components/Icon/icons/ChevronDown.svg +3 -0
  159. package/src/components/Icon/icons/ChevronLeft.svg +3 -0
  160. package/src/components/Icon/icons/ChevronRight.svg +3 -0
  161. package/src/components/Icon/icons/ChevronUp.svg +3 -0
  162. package/src/components/Icon/icons/Close.svg +3 -0
  163. package/src/components/Icon/icons/DarkMode.svg +4 -0
  164. package/src/components/Icon/icons/Delete.svg +5 -0
  165. package/src/components/Icon/icons/Discord.svg +5 -0
  166. package/src/components/Icon/icons/Duplicate.svg +6 -0
  167. package/src/components/Icon/icons/Edit.svg +4 -0
  168. package/src/components/Icon/icons/EditorBold.svg +4 -0
  169. package/src/components/Icon/icons/EditorCode.svg +6 -0
  170. package/src/components/Icon/icons/EditorHighlight.svg +12 -0
  171. package/src/components/Icon/icons/EditorItalic.svg +4 -0
  172. package/src/components/Icon/icons/EditorLink.svg +8 -0
  173. package/src/components/Icon/icons/EditorStrike.svg +4 -0
  174. package/src/components/Icon/icons/EditorUnderline.svg +6 -0
  175. package/src/components/Icon/icons/Ellipses.svg +4 -0
  176. package/src/components/Icon/icons/Error.svg +4 -0
  177. package/src/components/Icon/icons/ExternalLink.svg +7 -0
  178. package/src/components/Icon/icons/Folder.svg +4 -0
  179. package/src/components/Icon/icons/GitHub.svg +4 -0
  180. package/src/components/Icon/icons/Google.svg +4 -0
  181. package/src/components/Icon/icons/Hide.svg +5 -0
  182. package/src/components/Icon/icons/Key.svg +5 -0
  183. package/src/components/Icon/icons/Leave.svg +5 -0
  184. package/src/components/Icon/icons/LightMode.svg +6 -0
  185. package/src/components/Icon/icons/Link.svg +5 -0
  186. package/src/components/Icon/icons/Lock.svg +4 -0
  187. package/src/components/Icon/icons/Logo.svg +4 -0
  188. package/src/components/Icon/icons/LogoAPI.svg +4 -0
  189. package/src/components/Icon/icons/LogoClient.svg +4 -0
  190. package/src/components/Icon/icons/LogoMarket.svg +4 -0
  191. package/src/components/Icon/icons/LogoSwagger.svg +4 -0
  192. package/src/components/Icon/icons/Magic.svg +5 -0
  193. package/src/components/Icon/icons/Menu.svg +3 -0
  194. package/src/components/Icon/icons/Page.svg +8 -0
  195. package/src/components/Icon/icons/Payment.svg +5 -0
  196. package/src/components/Icon/icons/Refresh.svg +4 -0
  197. package/src/components/Icon/icons/Search.svg +4 -0
  198. package/src/components/Icon/icons/Show.svg +5 -0
  199. package/src/components/Icon/icons/Sigma.svg +4 -0
  200. package/src/components/Icon/icons/Trash.svg +5 -0
  201. package/src/components/Icon/icons/index.ts +65 -0
  202. package/src/components/Icon/index.ts +2 -0
  203. package/src/components/Icon/line/arrow-chevron-down.svg +1 -0
  204. package/src/components/Icon/line/arrow-chevron-left.svg +1 -0
  205. package/src/components/Icon/line/arrow-chevron-right.svg +1 -0
  206. package/src/components/Icon/line/arrow-chevron-up.svg +1 -0
  207. package/src/components/Icon/line/arrow-down.svg +1 -0
  208. package/src/components/Icon/line/arrow-left.svg +1 -0
  209. package/src/components/Icon/line/arrow-right.svg +1 -0
  210. package/src/components/Icon/line/arrow-up.svg +1 -0
  211. package/src/components/Icon/line/basic-shape-diamond.svg +1 -0
  212. package/src/components/Icon/line/basic-shape-hexagon.svg +1 -0
  213. package/src/components/Icon/line/basic-shape-primary-circle-ellipse-round.svg +1 -0
  214. package/src/components/Icon/line/basic-shape-primary-square-rectangle.svg +1 -0
  215. package/src/components/Icon/line/basic-shape-shield.svg +1 -0
  216. package/src/components/Icon/line/computer-device-desktop-monitor.svg +1 -0
  217. package/src/components/Icon/line/computer-device-desktop.svg +1 -0
  218. package/src/components/Icon/line/computer-device-laptop.svg +1 -0
  219. package/src/components/Icon/line/computer-device-mobile-phone-android-samsung-back.svg +1 -0
  220. package/src/components/Icon/line/computer-device-mobile-phone-android-samsung.svg +1 -0
  221. package/src/components/Icon/line/computer-device-mobile-phone-iphone-x-back.svg +1 -0
  222. package/src/components/Icon/line/computer-device-mobile-phone-iphone-x.svg +1 -0
  223. package/src/components/Icon/line/computer-device-mobile-tablet-touch.svg +1 -0
  224. package/src/components/Icon/line/computer-device-mobile-tablet.svg +1 -0
  225. package/src/components/Icon/line/computer-device-network-ethernet-cat6.svg +1 -0
  226. package/src/components/Icon/line/computer-device-network-lan-www.svg +1 -0
  227. package/src/components/Icon/line/computer-device-network-wifi-connection.svg +1 -0
  228. package/src/components/Icon/line/computer-device-network-wifi-router.svg +1 -0
  229. package/src/components/Icon/line/computer-keyboard-alt.svg +1 -0
  230. package/src/components/Icon/line/computer-keyboard-command-cmd-control-ctrl.svg +1 -0
  231. package/src/components/Icon/line/computer-keyboard-option.svg +1 -0
  232. package/src/components/Icon/line/computer-keyboard-shift.svg +1 -0
  233. package/src/components/Icon/line/ecology-science-erlenmeyer-flask.svg +1 -0
  234. package/src/components/Icon/line/entertainment-control-button-circle-left-arrow-rewind.svg +1 -0
  235. package/src/components/Icon/line/entertainment-control-button-circle-pause.svg +1 -0
  236. package/src/components/Icon/line/entertainment-control-button-circle-right-arrow-fast-forward.svg +1 -0
  237. package/src/components/Icon/line/entertainment-control-button-circle-stop-square.svg +1 -0
  238. package/src/components/Icon/line/entertainment-control-button-play-circle.svg +1 -0
  239. package/src/components/Icon/line/entertainment-party-popper-confetti.svg +1 -0
  240. package/src/components/Icon/line/image-flash-lightning.svg +1 -0
  241. package/src/components/Icon/line/image-photo-frame.svg +1 -0
  242. package/src/components/Icon/line/image-picture-flower.svg +1 -0
  243. package/src/components/Icon/line/interface-add.svg +1 -0
  244. package/src/components/Icon/line/interface-alert-error-exclamation-block-square.svg +1 -0
  245. package/src/components/Icon/line/interface-alert-error-x-block-square.svg +1 -0
  246. package/src/components/Icon/line/interface-alert-exclamation-diamond.svg +1 -0
  247. package/src/components/Icon/line/interface-alert-exclamation-triangle-warning.svg +1 -0
  248. package/src/components/Icon/line/interface-alert-information-circle.svg +1 -0
  249. package/src/components/Icon/line/interface-award-crown.svg +1 -0
  250. package/src/components/Icon/line/interface-bookmark-tag.svg +1 -0
  251. package/src/components/Icon/line/interface-bookmark.svg +1 -0
  252. package/src/components/Icon/line/interface-calendar-date-one.svg +1 -0
  253. package/src/components/Icon/line/interface-close.svg +1 -0
  254. package/src/components/Icon/line/interface-content-book-open-pages.svg +1 -0
  255. package/src/components/Icon/line/interface-content-book-page.svg +1 -0
  256. package/src/components/Icon/line/interface-content-file.svg +8 -0
  257. package/src/components/Icon/line/interface-content-folder.svg +1 -0
  258. package/src/components/Icon/line/interface-copy-clipboard.svg +1 -0
  259. package/src/components/Icon/line/interface-delete-bin-trash.svg +1 -0
  260. package/src/components/Icon/line/interface-dots-horizontal.svg +1 -0
  261. package/src/components/Icon/line/interface-dots-vertical.svg +1 -0
  262. package/src/components/Icon/line/interface-edit-attachment.svg +1 -0
  263. package/src/components/Icon/line/interface-edit-binocular.svg +1 -0
  264. package/src/components/Icon/line/interface-edit-magic-wand.svg +1 -0
  265. package/src/components/Icon/line/interface-edit-tool-eraser.svg +1 -0
  266. package/src/components/Icon/line/interface-edit-tool-paint-brush.svg +1 -0
  267. package/src/components/Icon/line/interface-edit-tool-paint-roller.svg +1 -0
  268. package/src/components/Icon/line/interface-edit-tool-pen.svg +1 -0
  269. package/src/components/Icon/line/interface-edit-tool-pencil.svg +1 -0
  270. package/src/components/Icon/line/interface-edit-view-eye.svg +1 -0
  271. package/src/components/Icon/line/interface-favorite-award.svg +1 -0
  272. package/src/components/Icon/line/interface-favorite-flag.svg +1 -0
  273. package/src/components/Icon/line/interface-favorite-heart.svg +1 -0
  274. package/src/components/Icon/line/interface-favorite-star.svg +1 -0
  275. package/src/components/Icon/line/interface-favorite-stars-shining.svg +1 -0
  276. package/src/components/Icon/line/interface-favorite-stars-sparkles.svg +1 -0
  277. package/src/components/Icon/line/interface-hierarchy-flowchart.svg +1 -0
  278. package/src/components/Icon/line/interface-home-house.svg +1 -0
  279. package/src/components/Icon/line/interface-hyperlink.svg +1 -0
  280. package/src/components/Icon/line/interface-lighting-brightness.svg +1 -0
  281. package/src/components/Icon/line/interface-lock-closed.svg +1 -0
  282. package/src/components/Icon/line/interface-lock-open-unlock.svg +1 -0
  283. package/src/components/Icon/line/interface-login-key.svg +1 -0
  284. package/src/components/Icon/line/interface-search.svg +1 -0
  285. package/src/components/Icon/line/interface-setting-cog.svg +1 -0
  286. package/src/components/Icon/line/interface-share-megaphone-bullhorn.svg +1 -0
  287. package/src/components/Icon/line/interface-share-rocket.svg +1 -0
  288. package/src/components/Icon/line/interface-share-satellite.svg +1 -0
  289. package/src/components/Icon/line/interface-share-space-ship.svg +1 -0
  290. package/src/components/Icon/line/interface-share.svg +1 -0
  291. package/src/components/Icon/line/interface-signal-square.svg +1 -0
  292. package/src/components/Icon/line/interface-text-formatting-left-open-quote.svg +1 -0
  293. package/src/components/Icon/line/interface-text-formatting-right-close-quote.svg +1 -0
  294. package/src/components/Icon/line/interface-time-clock-circle.svg +1 -0
  295. package/src/components/Icon/line/interface-time-hour-glass.svg +1 -0
  296. package/src/components/Icon/line/interface-users-multiple.svg +1 -0
  297. package/src/components/Icon/line/interface-validation-checkbox-square.svg +1 -0
  298. package/src/components/Icon/line/interface-weather-moon.svg +1 -0
  299. package/src/components/Icon/line/legal-justice-hammer-gavel.svg +1 -0
  300. package/src/components/Icon/line/mail-chat-bubble-square.svg +1 -0
  301. package/src/components/Icon/line/mail-send-email-paper-airplane.svg +1 -0
  302. package/src/components/Icon/line/mail-send-envelope.svg +1 -0
  303. package/src/components/Icon/line/mail-sign-hashtag.svg +1 -0
  304. package/src/components/Icon/line/money-cashier-receipt.svg +1 -0
  305. package/src/components/Icon/line/money-currency-dollar-pay.svg +1 -0
  306. package/src/components/Icon/line/money-graph-arrow-increase.svg +1 -0
  307. package/src/components/Icon/line/money-graph-bar-chart-increase.svg +1 -0
  308. package/src/components/Icon/line/nature-ecology-leaf.svg +1 -0
  309. package/src/components/Icon/line/phone-telephone.svg +1 -0
  310. package/src/components/Icon/line/programming-bug.svg +1 -0
  311. package/src/components/Icon/line/programming-cloud.svg +1 -0
  312. package/src/components/Icon/line/programming-computer-database-server.svg +1 -0
  313. package/src/components/Icon/line/programming-computer-database.svg +1 -0
  314. package/src/components/Icon/line/programming-module-four-layout.svg +1 -0
  315. package/src/components/Icon/line/programming-module-three.svg +1 -0
  316. package/src/components/Icon/line/programming-module.svg +1 -0
  317. package/src/components/Icon/line/programming-script-code.svg +1 -0
  318. package/src/components/Icon/line/shopping-cart.svg +8 -0
  319. package/src/components/Icon/line/shopping-gift-present.svg +1 -0
  320. package/src/components/Icon/line/shopping-shipping-box-parcel-package.svg +1 -0
  321. package/src/components/Icon/line/tag-new-circle.svg +1 -0
  322. package/src/components/Icon/line/travel-map-earth-globe.svg +1 -0
  323. package/src/components/Icon/localIcons.ts +68 -0
  324. package/src/components/Icon/solid/arrow-chevron-down.svg +1 -0
  325. package/src/components/Icon/solid/arrow-chevron-left.svg +1 -0
  326. package/src/components/Icon/solid/arrow-chevron-right.svg +1 -0
  327. package/src/components/Icon/solid/arrow-chevron-up.svg +1 -0
  328. package/src/components/Icon/solid/arrow-down.svg +1 -0
  329. package/src/components/Icon/solid/arrow-left.svg +1 -0
  330. package/src/components/Icon/solid/arrow-right.svg +1 -0
  331. package/src/components/Icon/solid/arrow-up.svg +1 -0
  332. package/src/components/Icon/solid/basic-shape-diamond.svg +1 -0
  333. package/src/components/Icon/solid/basic-shape-hexagon.svg +1 -0
  334. package/src/components/Icon/solid/basic-shape-primary-circle-ellipse-round.svg +1 -0
  335. package/src/components/Icon/solid/basic-shape-primary-square-rectangle.svg +1 -0
  336. package/src/components/Icon/solid/basic-shape-shield.svg +1 -0
  337. package/src/components/Icon/solid/computer-device-desktop-monitor.svg +1 -0
  338. package/src/components/Icon/solid/computer-device-desktop.svg +1 -0
  339. package/src/components/Icon/solid/computer-device-laptop.svg +1 -0
  340. package/src/components/Icon/solid/computer-device-mobile-phone-android-samsung-back.svg +1 -0
  341. package/src/components/Icon/solid/computer-device-mobile-phone-android-samsung.svg +1 -0
  342. package/src/components/Icon/solid/computer-device-mobile-phone-iphone-x-back.svg +1 -0
  343. package/src/components/Icon/solid/computer-device-mobile-phone-iphone-x.svg +1 -0
  344. package/src/components/Icon/solid/computer-device-mobile-tablet-touch.svg +1 -0
  345. package/src/components/Icon/solid/computer-device-mobile-tablet.svg +1 -0
  346. package/src/components/Icon/solid/computer-device-network-ethernet-cat6.svg +1 -0
  347. package/src/components/Icon/solid/computer-device-network-lan-www.svg +1 -0
  348. package/src/components/Icon/solid/computer-device-network-wifi-connection.svg +5 -0
  349. package/src/components/Icon/solid/computer-device-network-wifi-router.svg +1 -0
  350. package/src/components/Icon/solid/computer-keyboard-alt.svg +1 -0
  351. package/src/components/Icon/solid/computer-keyboard-command-cmd-control-ctrl.svg +1 -0
  352. package/src/components/Icon/solid/computer-keyboard-option.svg +1 -0
  353. package/src/components/Icon/solid/computer-keyboard-shift.svg +1 -0
  354. package/src/components/Icon/solid/ecology-science-erlenmeyer-flask.svg +1 -0
  355. package/src/components/Icon/solid/entertainment-control-button-circle-left-arrow-rewind.svg +1 -0
  356. package/src/components/Icon/solid/entertainment-control-button-circle-pause.svg +1 -0
  357. package/src/components/Icon/solid/entertainment-control-button-circle-play.svg +5 -0
  358. package/src/components/Icon/solid/entertainment-control-button-circle-right-arrow-fast-forward.svg +1 -0
  359. package/src/components/Icon/solid/entertainment-control-button-circle-stop-square.svg +1 -0
  360. package/src/components/Icon/solid/entertainment-party-popper-confetti.svg +1 -0
  361. package/src/components/Icon/solid/image-flash-lightning.svg +5 -0
  362. package/src/components/Icon/solid/image-photo-frame.svg +11 -0
  363. package/src/components/Icon/solid/image-picture-flower.svg +5 -0
  364. package/src/components/Icon/solid/interface-add-square.svg +5 -0
  365. package/src/components/Icon/solid/interface-alert-error-exclamation-block-square.svg +1 -0
  366. package/src/components/Icon/solid/interface-alert-error-x-block-square.svg +1 -0
  367. package/src/components/Icon/solid/interface-alert-exclamation-diamond.svg +1 -0
  368. package/src/components/Icon/solid/interface-alert-exclamation-triangle-warning.svg +1 -0
  369. package/src/components/Icon/solid/interface-alert-information-circle.svg +5 -0
  370. package/src/components/Icon/solid/interface-award-crown.svg +5 -0
  371. package/src/components/Icon/solid/interface-bookmark-tag.svg +1 -0
  372. package/src/components/Icon/solid/interface-bookmark.svg +5 -0
  373. package/src/components/Icon/solid/interface-calendar-date-one.svg +5 -0
  374. package/src/components/Icon/solid/interface-close.svg +8 -0
  375. package/src/components/Icon/solid/interface-content-book-open-pages.svg +13 -0
  376. package/src/components/Icon/solid/interface-content-book-page.svg +5 -0
  377. package/src/components/Icon/solid/interface-content-file.svg +5 -0
  378. package/src/components/Icon/solid/interface-content-folder.svg +1 -0
  379. package/src/components/Icon/solid/interface-copy-clipboard.svg +5 -0
  380. package/src/components/Icon/solid/interface-delete-bin-trash.svg +1 -0
  381. package/src/components/Icon/solid/interface-dots-horizontal.svg +1 -0
  382. package/src/components/Icon/solid/interface-dots-vertical.svg +1 -0
  383. package/src/components/Icon/solid/interface-edit-attachment.svg +5 -0
  384. package/src/components/Icon/solid/interface-edit-binocular.svg +5 -0
  385. package/src/components/Icon/solid/interface-edit-magic-wand.svg +7 -0
  386. package/src/components/Icon/solid/interface-edit-tool-eraser.svg +1 -0
  387. package/src/components/Icon/solid/interface-edit-tool-paint-brush.svg +1 -0
  388. package/src/components/Icon/solid/interface-edit-tool-paint-roller.svg +5 -0
  389. package/src/components/Icon/solid/interface-edit-tool-pen.svg +5 -0
  390. package/src/components/Icon/solid/interface-edit-tool-pencil.svg +1 -0
  391. package/src/components/Icon/solid/interface-edit-view-eye.svg +7 -0
  392. package/src/components/Icon/solid/interface-favorite-award.svg +5 -0
  393. package/src/components/Icon/solid/interface-favorite-flag.svg +1 -0
  394. package/src/components/Icon/solid/interface-favorite-heart.svg +5 -0
  395. package/src/components/Icon/solid/interface-favorite-star.svg +5 -0
  396. package/src/components/Icon/solid/interface-favorite-stars-shining.svg +1 -0
  397. package/src/components/Icon/solid/interface-favorite-stars-sparkles.svg +1 -0
  398. package/src/components/Icon/solid/interface-hierarchy-flowchart.svg +5 -0
  399. package/src/components/Icon/solid/interface-home-house.svg +5 -0
  400. package/src/components/Icon/solid/interface-hyperlink.svg +5 -0
  401. package/src/components/Icon/solid/interface-lighting-brightness.svg +22 -0
  402. package/src/components/Icon/solid/interface-lock-closed.svg +5 -0
  403. package/src/components/Icon/solid/interface-lock-open-unlock.svg +1 -0
  404. package/src/components/Icon/solid/interface-login-key.svg +5 -0
  405. package/src/components/Icon/solid/interface-search.svg +5 -0
  406. package/src/components/Icon/solid/interface-setting-cog.svg +5 -0
  407. package/src/components/Icon/solid/interface-share-megaphone-bullhorn.svg +5 -0
  408. package/src/components/Icon/solid/interface-share-rocket.svg +1 -0
  409. package/src/components/Icon/solid/interface-share-satellite.svg +8 -0
  410. package/src/components/Icon/solid/interface-share-space-ship.svg +1 -0
  411. package/src/components/Icon/solid/interface-share.svg +5 -0
  412. package/src/components/Icon/solid/interface-signal-square.svg +5 -0
  413. package/src/components/Icon/solid/interface-text-formatting-left-open-quote.svg +1 -0
  414. package/src/components/Icon/solid/interface-text-formatting-right-close-quote.svg +1 -0
  415. package/src/components/Icon/solid/interface-time-clock-circle.svg +5 -0
  416. package/src/components/Icon/solid/interface-time-hour-glass.svg +1 -0
  417. package/src/components/Icon/solid/interface-users-multiple.svg +11 -0
  418. package/src/components/Icon/solid/interface-validation-checkbox-square.svg +5 -0
  419. package/src/components/Icon/solid/interface-weather-moon.svg +5 -0
  420. package/src/components/Icon/solid/legal-justice-hammer-gavel.svg +1 -0
  421. package/src/components/Icon/solid/mail-chat-bubble-square.svg +5 -0
  422. package/src/components/Icon/solid/mail-send-email-paper-airplane.svg +5 -0
  423. package/src/components/Icon/solid/mail-send-envelope.svg +1 -0
  424. package/src/components/Icon/solid/mail-sign-hashtag.svg +5 -0
  425. package/src/components/Icon/solid/money-cashier-receipt.svg +1 -0
  426. package/src/components/Icon/solid/money-currency-dollar-pay.svg +5 -0
  427. package/src/components/Icon/solid/money-graph-arrow-increase.svg +5 -0
  428. package/src/components/Icon/solid/money-graph-bar-chart-increase.svg +1 -0
  429. package/src/components/Icon/solid/nature-ecology-leaf.svg +5 -0
  430. package/src/components/Icon/solid/phone-telephone.svg +5 -0
  431. package/src/components/Icon/solid/programming-bug.svg +5 -0
  432. package/src/components/Icon/solid/programming-cloud.svg +4 -0
  433. package/src/components/Icon/solid/programming-computer-database-server.svg +5 -0
  434. package/src/components/Icon/solid/programming-computer-database.svg +5 -0
  435. package/src/components/Icon/solid/programming-module-four-layout.svg +1 -0
  436. package/src/components/Icon/solid/programming-module-three.svg +1 -0
  437. package/src/components/Icon/solid/programming-module.svg +1 -0
  438. package/src/components/Icon/solid/programming-script-code.svg +5 -0
  439. package/src/components/Icon/solid/shopping-cart.svg +1 -0
  440. package/src/components/Icon/solid/shopping-gift-present.svg +16 -0
  441. package/src/components/Icon/solid/shopping-shipping-box-parcel-package.svg +11 -0
  442. package/src/components/Icon/solid/tag-new-circle.svg +7 -0
  443. package/src/components/Icon/solid/travel-map-earth-globe.svg +5 -0
  444. package/src/components/SearchModal.vue +305 -0
  445. package/src/components/Sidebar.vue +289 -0
  446. package/src/components/SidebarElement.vue +133 -0
  447. package/src/components/SidebarGroup.vue +12 -0
  448. package/src/components/SimpleTable/SimpleCell.vue +46 -0
  449. package/src/components/SimpleTable/SimpleHeader.vue +17 -0
  450. package/src/components/SimpleTable/SimpleRow.vue +5 -0
  451. package/src/components/SimpleTable/SimpleTable.vue +13 -0
  452. package/src/components/SimpleTable/index.ts +4 -0
  453. package/src/declarations/typographic-base.d.ts +1 -0
  454. package/src/helpers/generateAxiosCodeFromRequest.ts +42 -0
  455. package/src/helpers/generateLaravelCodeFromRequest.ts +20 -0
  456. package/src/helpers/index.ts +4 -0
  457. package/src/helpers/objectMerge.ts +19 -0
  458. package/src/helpers/specHelpers.ts +62 -0
  459. package/src/helpers/transformToJson.test.ts +7 -0
  460. package/src/helpers/transformToJson.ts +22 -0
  461. package/src/hooks/useRefOnMount.ts +12 -0
  462. package/src/index.ts +11 -0
  463. package/src/standalone.ts +28 -0
  464. package/src/stores/template.ts +66 -0
  465. package/src/stores/utility.ts +23 -0
  466. package/src/types.ts +154 -0
@@ -0,0 +1,361 @@
1
+ <script setup lang="ts">
2
+ import { useMediaQuery } from '@vueuse/core'
3
+ import { type TargetId, availableTargets } from 'httpsnippet-lite'
4
+ import { ref } from 'vue'
5
+
6
+ import { useTemplateStore } from '../../../stores/template'
7
+ import { Icon } from '../../Icon'
8
+
9
+ type Language = {
10
+ title: string | undefined
11
+ key: Exclude<TargetId, 'http'>
12
+ }
13
+
14
+ // Use the template store to keep it accessible globally
15
+ const { state, setItem, getLanguageTitleByKey } = useTemplateStore()
16
+
17
+ // Check if the given language key is a valid target.
18
+ const isValidTargetId = (language: TargetId) =>
19
+ availableTargets()
20
+ .map((target) => target.key)
21
+ .includes(language)
22
+
23
+ const defaultLanguage = isValidTargetId(state.preferredLanguage as TargetId)
24
+ ? state.preferredLanguage
25
+ : 'shell'
26
+
27
+ // Overwrite default setting for preferred language
28
+ setItem('preferredLanguage', defaultLanguage)
29
+
30
+ const selectLanguage = (language: TargetId) => {
31
+ setItem('preferredLanguage', language)
32
+
33
+ // Check if selected language is featured already (icon + text)
34
+ const preferedLanguageIsIncluded = !!featuredLanguages.value.filter(
35
+ (preferedLanguage) => {
36
+ return preferedLanguage.key === state.preferredLanguage
37
+ },
38
+ ).length
39
+
40
+ // Exit early if the language is already featured
41
+ if (preferedLanguageIsIncluded) {
42
+ return
43
+ }
44
+
45
+ // Remove first item and add the preferred language to the end of the list
46
+ featuredLanguages.value = [
47
+ // @ts-ignore
48
+ ...featuredLanguages.value.slice(1),
49
+ {
50
+ title: getLanguageTitleByKey(language),
51
+ // @ts-ignore
52
+ key: language,
53
+ },
54
+ ]
55
+ }
56
+
57
+ const isMobile = useMediaQuery('(max-width: 1000px)')
58
+
59
+ // Show popular languages with an icon, not just in a select.
60
+ const featuredLanguages = ref<Language[]>(
61
+ isMobile.value
62
+ ? // Mobile
63
+ [
64
+ {
65
+ title: 'Shell',
66
+ key: 'shell',
67
+ },
68
+ {
69
+ title: 'Ruby',
70
+ key: 'ruby',
71
+ },
72
+ {
73
+ title: 'Node',
74
+ key: 'node',
75
+ },
76
+ {
77
+ title: 'Python',
78
+ key: 'python',
79
+ },
80
+ ]
81
+ : // Desktop
82
+ [
83
+ {
84
+ title: 'Shell',
85
+ key: 'shell',
86
+ },
87
+ {
88
+ title: 'Ruby',
89
+ key: 'ruby',
90
+ },
91
+ {
92
+ title: 'Node',
93
+ key: 'node',
94
+ },
95
+ {
96
+ title: 'PHP',
97
+ key: 'php',
98
+ },
99
+ {
100
+ title: 'Python',
101
+ key: 'python',
102
+ },
103
+ {
104
+ title: 'C',
105
+ key: 'c',
106
+ },
107
+ ],
108
+ )
109
+
110
+ /**
111
+ * Icons have longer names to appear in icon searches, e.g. "javascript-js" instead of just "javascript". This function
112
+ * maps the language key to the icon name.
113
+ */
114
+ const getIconByLanguageKey = (languageKey: TargetId) => {
115
+ const languageKeyMap: Partial<Record<TargetId, string>> = {
116
+ javascript: 'javascript-js',
117
+ }
118
+
119
+ const icon = languageKeyMap[languageKey] ?? languageKey
120
+
121
+ return `brand/programming-language-${icon}`
122
+ }
123
+ </script>
124
+ <template>
125
+ <div class="client-libraries-content">
126
+ <div
127
+ v-for="language in featuredLanguages"
128
+ :key="language.key"
129
+ class="code-languages rendered-code-sdks"
130
+ :class="{
131
+ 'code-languages__active': state.preferredLanguage === language.key,
132
+ }"
133
+ @click="() => selectLanguage(language.key)">
134
+ <div
135
+ class="code-languages-background"
136
+ :class="`code-languages-icon__${language.key}`">
137
+ <Icon
138
+ class="code-languages-icon"
139
+ :src="getIconByLanguageKey(language.key)" />
140
+ </div>
141
+ <span>{{ language.title }}</span>
142
+ </div>
143
+
144
+ <div class="code-languages code-languages__select">
145
+ <select
146
+ :value="state.preferredLanguage"
147
+ @input="
148
+ selectLanguage(($event.target as HTMLSelectElement).value as TargetId)
149
+ ">
150
+ <option disabled>Select language:</option>
151
+ <option
152
+ v-for="target in availableTargets()
153
+ .filter((target) => target.key !== 'http')
154
+ .filter(
155
+ (target) =>
156
+ !featuredLanguages.find(
157
+ (language) => language.key === target.key,
158
+ ),
159
+ )"
160
+ :key="target.key"
161
+ :value="target.key">
162
+ {{ target.title }}
163
+ </option>
164
+ </select>
165
+ <div class="code-languages-background code-languages-icon__more">
166
+ <svg
167
+ class="code-languages-icon code-languages-icon__more"
168
+ height="50"
169
+ viewBox="0 0 50 50"
170
+ width="50"
171
+ xmlns="http://www.w3.org/2000/svg">
172
+ <g
173
+ fill="currentColor"
174
+ fill-rule="nonzero">
175
+ <path
176
+ d="M10.71 25.3a3.87 3.87 0 1 0 7.74 0 3.87 3.87 0 0 0-7.74 0M21.13 25.3a3.87 3.87 0 1 0 7.74 0 3.87 3.87 0 0 0-7.74 0M31.55 25.3a3.87 3.87 0 1 0 7.74 0 3.87 3.87 0 0 0-7.74 0" />
177
+ </g>
178
+ </svg>
179
+ </div>
180
+ <span>More</span>
181
+ </div>
182
+ </div>
183
+ </template>
184
+ <style scoped>
185
+ .client-libraries-content {
186
+ display: flex;
187
+ justify-content: center;
188
+ gap: 6px;
189
+ padding: 0 12px;
190
+ }
191
+ .code-languages {
192
+ display: flex;
193
+ align-items: center;
194
+ justify-content: center;
195
+ flex-direction: column;
196
+ max-width: 68px;
197
+ width: 100%;
198
+ padding: 12px 0;
199
+ position: relative;
200
+ cursor: pointer;
201
+ white-space: nowrap;
202
+ }
203
+ /* remove php and c on mobile */
204
+ @media screen and (max-width: 450px) {
205
+ .code-languages:nth-of-type(4),
206
+ .code-languages:nth-of-type(6) {
207
+ display: none;
208
+ }
209
+ }
210
+ .code-languages-icon {
211
+ max-width: 48px;
212
+ width: 100%;
213
+ max-height: 48px;
214
+ aspect-ratio: 1;
215
+ padding: 7px;
216
+ display: flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ position: relative;
220
+ color: var(--theme-code-language-color-supersede, #fff);
221
+ }
222
+ .code-languages-background {
223
+ border-radius: 12px;
224
+ position: relative;
225
+ overflow: hidden;
226
+ box-shadow: 0 0 0 1px var(--theme-code-languages-border-color);
227
+ }
228
+ .code-languages-background:before {
229
+ content: '';
230
+ width: 100%;
231
+ height: 100%;
232
+ position: absolute;
233
+ top: 0;
234
+ left: 0;
235
+ pointer-events: none;
236
+ background: var(--theme-code-languages-background-supersede);
237
+ }
238
+ .code-languages-icon__shell {
239
+ background: #000;
240
+ }
241
+ .code-languages-icon__ruby {
242
+ background: #d91404;
243
+ }
244
+ .code-languages-icon__php {
245
+ background: #6181b6;
246
+ }
247
+ .code-languages-icon__python {
248
+ background: #306998;
249
+ }
250
+ .code-languages-icon__more {
251
+ background: var(--theme-background-3);
252
+ }
253
+ .code-languages-icon__node {
254
+ background: #83cd29;
255
+ }
256
+ .code-languages-icon__c {
257
+ background: #03599c;
258
+ }
259
+ .code-languages-icon__csharp {
260
+ background: #68217a;
261
+ }
262
+ .code-languages-icon__cplusplus {
263
+ background: #9c033a;
264
+ }
265
+ .code-languages-icon__clojure {
266
+ background: #5881d8;
267
+ }
268
+ .code-languages-icon__go {
269
+ background: #00acd7;
270
+ }
271
+ .code-languages-icon__http {
272
+ background: #005b9b;
273
+ }
274
+ .code-languages-icon__java {
275
+ background: #ea2d2e;
276
+ }
277
+ .code-languages-icon__javascript {
278
+ background: #f0db4f;
279
+ }
280
+ .code-languages-icon__kotlin {
281
+ background: #7f6cb1;
282
+ }
283
+ .code-languages-icon__objc {
284
+ background: #0b5a9d;
285
+ }
286
+ .code-languages-icon__ocaml {
287
+ background: #f29100;
288
+ }
289
+ .code-languages-icon__powershell {
290
+ background: #2671be;
291
+ }
292
+ .code-languages-icon__r {
293
+ background: #cbced0;
294
+ }
295
+ .code-languages-icon__swift {
296
+ background: #f05138;
297
+ }
298
+ .code-languages__loading .code-languages-icon:before {
299
+ border: 1px solid rgba(255, 255, 255, 0.44);
300
+ border-top: 1px solid white;
301
+ animation: codeloader 0.45s linear infinite;
302
+ background: transparent;
303
+ width: 18px;
304
+ height: 18px;
305
+ content: '';
306
+ border-radius: 50%;
307
+ }
308
+ .code-languages__loading .code-languages-icon svg {
309
+ display: none;
310
+ }
311
+ .code-languages__active:after {
312
+ content: '';
313
+ position: absolute;
314
+ bottom: 0;
315
+ height: 2px;
316
+ width: 100%;
317
+ background: var(--theme-color-1);
318
+ }
319
+ @keyframes codeloader {
320
+ 0% {
321
+ transform: rotate(0deg);
322
+ }
323
+ to {
324
+ transform: rotate(1turn);
325
+ }
326
+ }
327
+ .code-languages span {
328
+ margin-top: 3px;
329
+ color: var(--theme-color-2);
330
+ font-size: var(--theme-micro);
331
+ }
332
+ .code-languages__active span {
333
+ color: var(--theme-color-1);
334
+ }
335
+ .code-languages__select select {
336
+ opacity: 0;
337
+ width: 100%;
338
+ height: 100%;
339
+ position: absolute;
340
+ top: 0;
341
+ left: 0;
342
+ cursor: pointer;
343
+ z-index: 1;
344
+ }
345
+ .code-languages__select span {
346
+ position: relative;
347
+ display: flex;
348
+ align-items: center;
349
+ }
350
+ .code-languages__select span:after {
351
+ content: '';
352
+ width: 8px;
353
+ height: 8px;
354
+ background: var(--theme-background-1);
355
+ box-shadow: 1px 1px 0 currentColor;
356
+ display: block;
357
+ transform: rotate(45deg);
358
+ margin-left: 5px;
359
+ margin-top: -7px;
360
+ }
361
+ </style>
@@ -0,0 +1 @@
1
+ export { default as default } from './Introduction.vue'
@@ -0,0 +1,174 @@
1
+ <script setup lang="ts">
2
+ import rehypeDocument from 'rehype-document'
3
+ import rehypeFormat from 'rehype-format'
4
+ import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'
5
+ import rehypeStringify from 'rehype-stringify'
6
+ import remarkGfm from 'remark-gfm'
7
+ import remarkParse from 'remark-parse'
8
+ import remarkRehype from 'remark-rehype'
9
+ import remarkTextr from 'remark-textr'
10
+ import typographicBase from 'typographic-base'
11
+ import { unified } from 'unified'
12
+ import { ref, watch } from 'vue'
13
+
14
+ const props = defineProps<{ value: string }>()
15
+
16
+ const html = ref<string>('')
17
+
18
+ watch(
19
+ () => props.value,
20
+ () => {
21
+ unified()
22
+ .use(remarkParse)
23
+ .use(remarkGfm)
24
+ .use(remarkRehype)
25
+ .use(remarkTextr, { plugins: [typographicBase] })
26
+ .use(rehypeDocument)
27
+ .use(rehypeFormat)
28
+ .use(rehypeSanitize, {
29
+ ...defaultSchema,
30
+ tagNames: defaultSchema.tagNames?.filter(
31
+ (tag) => !['img'].includes(tag),
32
+ ),
33
+ })
34
+ .use(rehypeStringify)
35
+ .process(props.value)
36
+ .then((result) => {
37
+ html.value = String(result)
38
+ })
39
+ },
40
+ { immediate: true },
41
+ )
42
+ </script>
43
+
44
+ <template>
45
+ <div
46
+ class="markdown"
47
+ v-html="html" />
48
+ </template>
49
+
50
+ <style scoped>
51
+ .markdown :deep(*) {
52
+ margin-top: 12px;
53
+ }
54
+ .markdown :deep(h1),
55
+ .markdown :deep(h2),
56
+ .markdown :deep(h3),
57
+ .markdown :deep(h4),
58
+ .markdown :deep(h5),
59
+ .markdown :deep(h6) {
60
+ font-size: var(--font-size);
61
+ margin: 12px 0 6px;
62
+ }
63
+
64
+ .markdown :deep(p) {
65
+ font-size: var(--font-size, var(--theme-paragraph));
66
+ /* prettier-ignore */
67
+ color: var(--theme-color-1);
68
+ font-weight: var(--font-weight, var(--theme-small));
69
+ line-height: 1.5;
70
+ }
71
+
72
+ .markdown :deep(ul),
73
+ .markdown :deep(ol) {
74
+ padding-left: 24px;
75
+ line-height: 1.5;
76
+ margin: 12px 0;
77
+ }
78
+
79
+ .markdown :deep(ul) {
80
+ list-style: disc;
81
+ }
82
+
83
+ .markdown :deep(ol) {
84
+ list-style: decimal;
85
+ }
86
+
87
+ .markdown :deep(ul.contains-task-list) {
88
+ list-style: none;
89
+ padding-left: 0;
90
+ }
91
+
92
+ .markdown :deep(li) {
93
+ margin: 6px 0;
94
+ }
95
+
96
+ .markdown :deep(code) {
97
+ font-family: var(--theme-font-code);
98
+ background-color: var(--theme-background-2);
99
+ box-shadow: 0 0 0 1px var(--theme-border-color);
100
+ font-size: var(--theme-micro);
101
+ border-radius: 2px;
102
+ padding: 0 3px;
103
+ }
104
+
105
+ .markdown :deep(pre code) {
106
+ display: block;
107
+ white-space: pre;
108
+ padding: 3px;
109
+ margin: 12px 0;
110
+ -webkit-overflow-scrolling: touch;
111
+ overflow-x: scroll;
112
+ max-width: 100%;
113
+ min-width: 100px;
114
+ }
115
+
116
+ .markdown :deep(blockquote) {
117
+ border-left: 3px solid var(--theme-border-color);
118
+ padding-left: 12px;
119
+ }
120
+
121
+ .markdown :deep(table) {
122
+ position: relative;
123
+ border-collapse: collapse;
124
+ table-layout: fixed;
125
+ width: 100%;
126
+ margin: 0;
127
+ overflow: hidden;
128
+ box-shadow: 0 0 0 1px var(--theme-border-color);
129
+ border-radius: var(--theme-radius-lg);
130
+ }
131
+
132
+ .markdown :deep(td),
133
+ .markdown :deep(th) {
134
+ min-width: 1em;
135
+ padding: 6px;
136
+ vertical-align: top;
137
+ box-sizing: border-box;
138
+ position: relative;
139
+ word-break: break-all;
140
+ border-right: 1px solid var(--theme-border-color);
141
+ border-bottom: 1px solid var(--theme-border-color);
142
+ }
143
+
144
+ .markdown :deep(td > *),
145
+ .markdown :deep(th > *) {
146
+ margin-bottom: 0;
147
+ }
148
+ .markdown.parameter-description :deep(p) {
149
+ margin-top: 4px;
150
+ font-size: var(--theme-small);
151
+ color: var(--theme-color-2);
152
+ line-height: initial;
153
+ }
154
+ .markdown :deep(td:first-of-type),
155
+ .markdown :deep(th:first-of-type) {
156
+ border-left: none;
157
+ }
158
+
159
+ .markdown :deep(td:last-of-type),
160
+ .markdown :deep(th:last-of-type) {
161
+ border-right: none;
162
+ }
163
+
164
+ .markdown :deep(tr:last-of-type td) {
165
+ border-bottom: none;
166
+ }
167
+
168
+ .markdown :deep(th) {
169
+ font-weight: bold !important;
170
+ text-align: left;
171
+ border-left-color: transparent;
172
+ background: var(--theme-background-2);
173
+ }
174
+ </style>
@@ -0,0 +1,100 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ type Operation,
4
+ useApiClientStore,
5
+ useOperation,
6
+ } from '@scalar/api-client'
7
+ import { useIntersectionObserver } from '@vueuse/core'
8
+ import { computed, onMounted, ref } from 'vue'
9
+
10
+ import { useTemplateStore } from '../../../stores/template'
11
+ import type { Tag } from '../../../types'
12
+ import Parameters from './Parameters.vue'
13
+ import RequestBody from './RequestBody.vue'
14
+
15
+ const props = defineProps<{ operation: Operation; parentTag: Tag }>()
16
+
17
+ const { setActiveSidebar } = useApiClientStore()
18
+
19
+ const { parameterMap } = useOperation(props)
20
+
21
+ const { setCollapsedSidebarItem } = useTemplateStore()
22
+
23
+ const responseArray = computed(() => {
24
+ const { responses } = props.operation.information
25
+
26
+ const res: { name: string; description: string }[] = []
27
+
28
+ Object.keys(responses).forEach((statusCode: string) => {
29
+ res.push({
30
+ name: statusCode,
31
+ description: responses[statusCode].description,
32
+ })
33
+ })
34
+
35
+ return res
36
+ })
37
+
38
+ const refHeader = ref<HTMLElement>()
39
+
40
+ onMounted(() => {
41
+ const root = document.getElementById('tippy')
42
+
43
+ useIntersectionObserver(
44
+ refHeader,
45
+ ([{ isIntersecting }]) => {
46
+ if (isIntersecting) {
47
+ const slug = props.operation.name.toLowerCase().split(' ').join('-')
48
+ const newUrl = `${window.location.origin}${window.location.pathname}#${
49
+ props.parentTag.name
50
+ }/${encodeURI(slug)}`
51
+ window.history.replaceState({}, '', newUrl)
52
+ setActiveSidebar(props.operation.operationId)
53
+ setCollapsedSidebarItem(props.parentTag.name, true)
54
+ }
55
+ },
56
+ {
57
+ root,
58
+ rootMargin: '0px 0px 0px 0px', // Trigger when the header touches the top of the viewport
59
+ threshold: 0,
60
+ },
61
+ )
62
+ })
63
+ </script>
64
+ <template>
65
+ <div class="copy">
66
+ <div class="editor-heading">
67
+ <h1
68
+ ref="refHeader"
69
+ class="heading">
70
+ {{ operation.name }}
71
+ </h1>
72
+ </div>
73
+ <div>
74
+ <p class="tag-description">
75
+ {{ operation.description }}
76
+ </p>
77
+ </div>
78
+ <Parameters
79
+ :parameters="parameterMap.path"
80
+ title="Path Parameters" />
81
+ <Parameters
82
+ :parameters="parameterMap.query"
83
+ title="Query Parameters" />
84
+ <Parameters
85
+ :parameters="parameterMap.header"
86
+ title="Headers" />
87
+ <RequestBody :requestBody="operation.information?.requestBody" />
88
+ <Parameters
89
+ :parameters="responseArray"
90
+ title="Responses" />
91
+ </div>
92
+ </template>
93
+ <style scoped>
94
+ .heading {
95
+ margin-top: 0px !important;
96
+ }
97
+ .tag-description {
98
+ margin-top: 12px;
99
+ }
100
+ </style>