@scalar/api-client 2.14.1 → 2.17.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 (293) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/dist/hooks/useResponseBody.js +6 -6
  3. package/dist/libs/errors.d.ts +1 -0
  4. package/dist/libs/errors.d.ts.map +1 -1
  5. package/dist/libs/errors.js +1 -0
  6. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  7. package/dist/libs/send-request/create-request-operation.js +41 -35
  8. package/dist/style.css +1 -1
  9. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
  10. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +81 -65
  12. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -23
  13. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
  15. package/dist/v2/blocks/operation-block/components/Header.vue2.js +29 -38
  16. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
  17. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
  18. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
  19. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
  20. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
  21. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
  22. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
  23. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
  25. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
  26. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
  28. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
  29. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
  30. package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
  31. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
  32. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
  33. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
  34. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
  35. package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
  36. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
  37. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
  39. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
  40. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
  41. package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
  42. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
  43. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  45. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  46. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
  47. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
  48. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
  50. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
  52. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
  53. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  54. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
  55. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
  56. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
  57. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
  58. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
  59. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
  60. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
  61. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
  62. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  63. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
  64. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  65. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +10 -10
  66. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -1
  67. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  68. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +15 -19
  69. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
  70. package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
  71. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  72. package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
  73. package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
  75. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  77. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +202 -160
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  81. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +60 -51
  82. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
  85. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -2
  87. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  88. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
  89. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -4
  90. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  91. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  92. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -2
  93. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  94. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +146 -147
  95. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
  96. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  97. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
  98. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
  99. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
  100. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  101. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +21 -15
  102. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
  103. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
  104. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
  105. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
  106. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  107. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
  108. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
  109. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
  111. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
  112. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
  113. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
  114. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
  115. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  116. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -15
  117. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  118. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  119. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +117 -71
  120. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
  121. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
  122. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
  126. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  127. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  128. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
  129. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  130. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
  131. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
  132. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  133. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
  134. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
  135. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
  136. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
  137. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
  138. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  139. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
  140. package/dist/v2/components/code-input/CodeInput.vue.d.ts +16 -6
  141. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  142. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  143. package/dist/v2/components/code-input/CodeInput.vue2.js +81 -65
  144. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
  145. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  146. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
  147. package/dist/v2/components/resize/index.d.ts +0 -1
  148. package/dist/v2/components/resize/index.d.ts.map +1 -1
  149. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +9 -5
  150. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  151. package/dist/v2/components/sidebar/Sidebar.vue.js +51 -46
  152. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  153. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  154. package/dist/v2/features/app/App.vue.d.ts +3 -0
  155. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  156. package/dist/v2/features/app/App.vue.js +130 -143
  157. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
  158. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  159. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  160. package/dist/v2/features/app/components/AppSidebar.vue2.js +216 -106
  161. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
  162. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  163. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts +22 -0
  164. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +1 -0
  165. package/dist/v2/features/app/components/ItemDecorator.vue.js +138 -0
  166. package/dist/v2/features/app/components/ItemDecorator.vue2.js +4 -0
  167. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
  168. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  169. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  170. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  171. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  172. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  173. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  174. package/dist/v2/features/app/helpers/routes.js +25 -16
  175. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  176. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  177. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  178. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  179. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  180. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  181. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  182. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  183. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  184. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  185. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  186. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  187. package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +156 -0
  188. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  189. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  190. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  191. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  192. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  193. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  194. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  195. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  196. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  197. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  198. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  199. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  200. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  201. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  202. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  203. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  204. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  205. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  206. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +8 -0
  207. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  208. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +76 -68
  209. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +8 -0
  210. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
  211. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +83 -75
  212. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +4 -0
  213. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
  214. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +32 -34
  215. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +16 -0
  216. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  217. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +24 -21
  218. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  219. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  220. package/dist/v2/features/modal/Modal.vue.js +1 -1
  221. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  222. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  223. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  224. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  225. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  226. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  227. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  228. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  229. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  230. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  231. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  232. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  233. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  234. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  235. package/dist/v2/features/operation/Operation.vue.js +59 -28
  236. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  237. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  238. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  239. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  240. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  241. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  242. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  243. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  244. package/dist/v2/features/operation/index.d.ts +0 -1
  245. package/dist/v2/features/operation/index.d.ts.map +1 -1
  246. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  247. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  248. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  249. package/dist/v2/features/settings/DocumentSettings.vue.js +2 -2
  250. package/dist/v2/features/settings/DocumentSettings.vue2.js +1 -1
  251. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  252. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  253. package/dist/v2/helpers/generate-location-id.js +10 -0
  254. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  255. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  256. package/dist/v2/helpers/get-active-environment.js +22 -0
  257. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  258. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  259. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  260. package/dist/v2/helpers/plugins.d.ts +59 -0
  261. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  262. package/dist/v2/helpers/plugins.js +11 -0
  263. package/dist/v2/helpers/storage.d.ts.map +1 -1
  264. package/dist/v2/helpers/storage.js +5 -5
  265. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  266. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  267. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  268. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  269. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  270. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  271. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  272. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  273. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  274. package/package.json +19 -19
  275. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  276. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  277. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  278. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  279. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  280. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  281. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  282. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  283. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  284. package/dist/v2/hooks/use-sync-path.js +0 -51
  285. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  286. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  287. package/dist/v2/hooks/use-workspace-client-events.js +0 -112
  288. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  289. package/dist/v2/plugins.d.ts +0 -44
  290. package/dist/v2/plugins.d.ts.map +0 -1
  291. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  292. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  293. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
@@ -1,4 +1,144 @@
1
- import f from "./Servers.vue2.js";
1
+ import { defineComponent as M, ref as A, computed as x, createElementBlock as u, openBlock as c, Fragment as S, createElementVNode as s, createVNode as l, createTextVNode as g, renderList as I, createBlock as y, unref as r, toDisplayString as T, withCtx as f, createCommentVNode as V } from "vue";
2
+ import { useModal as P, ScalarMarkdown as z, ScalarButton as k, ScalarModal as L } from "@scalar/components";
3
+ import { debounce as O } from "@scalar/helpers/general/debounce";
4
+ import { ScalarIconTrash as R, ScalarIconPlus as j } from "@scalar/icons";
5
+ import E from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
6
+ import F from "./Form.vue.js";
7
+ import W from "../../../../components/Server/ServerVariablesForm.vue.js";
8
+ const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm" }, H = {
9
+ key: 1,
10
+ class: "self-center"
11
+ }, J = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, K = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, re = /* @__PURE__ */ M({
12
+ __name: "Servers",
13
+ props: {
14
+ documentSlug: {},
15
+ document: {},
16
+ eventBus: {},
17
+ layout: {},
18
+ path: {},
19
+ method: {},
20
+ exampleName: {},
21
+ environment: {},
22
+ workspaceStore: {},
23
+ activeWorkspace: {},
24
+ plugins: {},
25
+ collectionType: {}
26
+ },
27
+ setup(o) {
28
+ const v = P(), n = A(-1), _ = x(
29
+ () => o.document?.servers?.[n.value]
30
+ ), $ = x(() => o.document?.servers ?? []), B = [
31
+ {
32
+ label: "URL",
33
+ key: "url",
34
+ placeholder: "https://void.scalar.com"
35
+ },
36
+ {
37
+ label: "Description",
38
+ key: "description",
39
+ placeholder: "Production"
40
+ }
41
+ ], w = (t) => {
42
+ n.value = t, v.show();
43
+ }, p = () => {
44
+ v.hide(), n.value = -1;
45
+ }, N = () => {
46
+ n.value < 0 || (o.eventBus.emit("server:delete:server", { index: n.value }), p());
47
+ }, { execute: b } = O({ delay: 328, maxWait: 1e3 }), U = (t, e, a) => b(
48
+ `${t}-${e}`,
49
+ () => o.eventBus.emit("server:update:server", {
50
+ index: t,
51
+ server: { [e]: a }
52
+ })
53
+ ), C = (t, e, a) => b(
54
+ `${t}-${e}`,
55
+ () => o.eventBus.emit("server:update:variables", {
56
+ index: t,
57
+ key: e,
58
+ value: a
59
+ })
60
+ ), D = () => o.eventBus.emit("server:add:server"), h = (t, e = 0) => t?.description || `Server ${e + 1}`;
61
+ return (t, e) => (c(), u(S, null, [
62
+ s("div", Y, [
63
+ e[1] || (e[1] = s("div", { class: "flex flex-col gap-2" }, [
64
+ s("h3", { class: "font-bold" }, "Servers"),
65
+ s("p", { class: "text-sm" }, [
66
+ g(" Add different base URLs for your API. You can use "),
67
+ s("code", { class: "font-code text-c-2" }, "{variables}"),
68
+ g(" for dynamic parts. ")
69
+ ])
70
+ ], -1)),
71
+ s("div", q, [
72
+ (c(!0), u(S, null, I($.value, (a, d) => (c(), u("div", {
73
+ key: d,
74
+ class: "rounded-lg border"
75
+ }, [
76
+ s("div", G, [
77
+ a.description ? (c(), y(r(z), {
78
+ key: 0,
79
+ class: "self-center",
80
+ value: a.description
81
+ }, null, 8, ["value"])) : (c(), u("span", H, T(h(a, d)), 1)),
82
+ l(r(k), {
83
+ class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
84
+ "data-testid": "delete-server-button",
85
+ variant: "ghost",
86
+ onClick: (i) => w(d)
87
+ }, {
88
+ default: f(() => [
89
+ l(r(R), { class: "size-3.5" })
90
+ ]),
91
+ _: 1
92
+ }, 8, ["onClick"])
93
+ ]),
94
+ s("div", J, [
95
+ l(F, {
96
+ data: a,
97
+ environment: t.environment,
98
+ onUpdate: (i, m) => U(d, i, m),
99
+ options: B
100
+ }, null, 8, ["data", "environment", "onUpdate"]),
101
+ a.variables ? (c(), y(r(W), {
102
+ key: 0,
103
+ variables: a.variables,
104
+ "onUpdate:variable": (i, m) => C(d, i, m)
105
+ }, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
106
+ ])
107
+ ]))), 128))
108
+ ]),
109
+ s("div", K, [
110
+ l(r(k), {
111
+ class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
112
+ size: "sm",
113
+ variant: "ghost",
114
+ onClick: D
115
+ }, {
116
+ default: f(() => [
117
+ l(r(j)),
118
+ e[0] || (e[0] = s("span", null, "Add Server", -1))
119
+ ]),
120
+ _: 1
121
+ })
122
+ ])
123
+ ]),
124
+ l(r(L), {
125
+ size: "xxs",
126
+ state: r(v),
127
+ title: `Delete ${h(_.value, n.value)}`
128
+ }, {
129
+ default: f(() => [
130
+ l(E, {
131
+ variableName: "Server",
132
+ warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
133
+ onClose: p,
134
+ onDelete: N
135
+ })
136
+ ]),
137
+ _: 1
138
+ }, 8, ["state", "title"])
139
+ ], 64));
140
+ }
141
+ });
2
142
  export {
3
- f as default
143
+ re as default
4
144
  };
@@ -1,143 +1,4 @@
1
- import { defineComponent as M, ref as A, computed as x, createElementBlock as u, openBlock as c, Fragment as S, createElementVNode as r, createVNode as o, createTextVNode as g, renderList as I, createBlock as y, unref as s, toDisplayString as T, withCtx as f, createCommentVNode as V } from "vue";
2
- import { useModal as P, ScalarMarkdown as z, ScalarButton as k, ScalarModal as L } from "@scalar/components";
3
- import { debounce as O } from "@scalar/helpers/general/debounce";
4
- import { ScalarIconTrash as R, ScalarIconPlus as j } from "@scalar/icons";
5
- import E from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
6
- import F from "./Form.vue.js";
7
- import W from "../../../../components/Server/ServerVariablesForm.vue.js";
8
- const Y = { class: "flex flex-col gap-4" }, q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm" }, H = {
9
- key: 1,
10
- class: "self-center"
11
- }, J = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, K = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, se = /* @__PURE__ */ M({
12
- __name: "Servers",
13
- props: {
14
- documentSlug: {},
15
- document: {},
16
- eventBus: {},
17
- layout: {},
18
- path: {},
19
- method: {},
20
- exampleName: {},
21
- environment: {},
22
- workspaceStore: {},
23
- activeWorkspace: {},
24
- collectionType: {}
25
- },
26
- setup(l) {
27
- const v = P(), n = A(-1), _ = x(
28
- () => l.document?.servers?.[n.value]
29
- ), $ = x(() => l.document?.servers ?? []), B = [
30
- {
31
- label: "URL",
32
- key: "url",
33
- placeholder: "https://void.scalar.com"
34
- },
35
- {
36
- label: "Description",
37
- key: "description",
38
- placeholder: "Production"
39
- }
40
- ], w = (t) => {
41
- n.value = t, v.show();
42
- }, p = () => {
43
- v.hide(), n.value = -1;
44
- }, N = () => {
45
- n.value < 0 || (l.eventBus.emit("server:delete:server", { index: n.value }), p());
46
- }, { execute: b } = O({ delay: 328, maxWait: 1e3 }), U = (t, e, a) => b(
47
- `${t}-${e}`,
48
- () => l.eventBus.emit("server:update:server", {
49
- index: t,
50
- server: { [e]: a }
51
- })
52
- ), C = (t, e, a) => b(
53
- `${t}-${e}`,
54
- () => l.eventBus.emit("server:update:variables", {
55
- index: t,
56
- key: e,
57
- value: a
58
- })
59
- ), D = () => l.eventBus.emit("server:add:server"), h = (t, e = 0) => t?.description || `Server ${e + 1}`;
60
- return (t, e) => (c(), u(S, null, [
61
- r("div", Y, [
62
- e[1] || (e[1] = r("div", { class: "flex flex-col gap-2" }, [
63
- r("h3", { class: "font-bold" }, "Servers"),
64
- r("p", { class: "text-sm" }, [
65
- g(" Add different base URLs for your API. You can use "),
66
- r("code", { class: "font-code text-c-2" }, "{variables}"),
67
- g(" for dynamic parts. ")
68
- ])
69
- ], -1)),
70
- r("div", q, [
71
- (c(!0), u(S, null, I($.value, (a, d) => (c(), u("div", {
72
- key: d,
73
- class: "rounded-lg border"
74
- }, [
75
- r("div", G, [
76
- a.description ? (c(), y(s(z), {
77
- key: 0,
78
- class: "self-center",
79
- value: a.description
80
- }, null, 8, ["value"])) : (c(), u("span", H, T(h(a, d)), 1)),
81
- o(s(k), {
82
- class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
83
- "data-testid": "delete-server-button",
84
- variant: "ghost",
85
- onClick: (i) => w(d)
86
- }, {
87
- default: f(() => [
88
- o(s(R), { class: "size-3.5" })
89
- ]),
90
- _: 1
91
- }, 8, ["onClick"])
92
- ]),
93
- r("div", J, [
94
- o(F, {
95
- data: a,
96
- environment: t.environment,
97
- onUpdate: (i, m) => U(d, i, m),
98
- options: B
99
- }, null, 8, ["data", "environment", "onUpdate"]),
100
- a.variables ? (c(), y(s(W), {
101
- key: 0,
102
- variables: a.variables,
103
- "onUpdate:variable": (i, m) => C(d, i, m)
104
- }, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
105
- ])
106
- ]))), 128))
107
- ]),
108
- r("div", K, [
109
- o(s(k), {
110
- class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
111
- size: "sm",
112
- variant: "ghost",
113
- onClick: D
114
- }, {
115
- default: f(() => [
116
- o(s(j)),
117
- e[0] || (e[0] = r("span", null, "Add Server", -1))
118
- ]),
119
- _: 1
120
- })
121
- ])
122
- ]),
123
- o(s(L), {
124
- size: "xxs",
125
- state: s(v),
126
- title: `Delete ${h(_.value, n.value)}`
127
- }, {
128
- default: f(() => [
129
- o(E, {
130
- variableName: "Server",
131
- warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
132
- onClose: p,
133
- onDelete: N
134
- })
135
- ]),
136
- _: 1
137
- }, 8, ["state", "title"])
138
- ], 64));
139
- }
140
- });
1
+ import f from "./Servers.vue.js";
141
2
  export {
142
- se as default
3
+ f as default
143
4
  };
@@ -1,4 +1,60 @@
1
- import f from "./Settings.vue2.js";
1
+ import { defineComponent as u, createBlock as t, openBlock as a, unref as r } from "vue";
2
+ import { useRouter as i } from "vue-router";
3
+ import p from "../../settings/DocumentSettings.vue.js";
4
+ import h from "../../settings/CollectionSettings.vue.js";
5
+ const y = /* @__PURE__ */ u({
6
+ __name: "Settings",
7
+ props: {
8
+ documentSlug: {},
9
+ document: {},
10
+ eventBus: {},
11
+ layout: {},
12
+ path: {},
13
+ method: {},
14
+ exampleName: {},
15
+ environment: {},
16
+ workspaceStore: {},
17
+ activeWorkspace: {},
18
+ plugins: {},
19
+ collectionType: {}
20
+ },
21
+ setup(o) {
22
+ const c = (e) => {
23
+ o.eventBus.emit("document:update:watch-mode", e);
24
+ }, n = (e) => {
25
+ o.eventBus.emit("workspace:update:theme", e);
26
+ }, m = (e) => {
27
+ o.eventBus.emit("workspace:update:active-proxy", e);
28
+ }, d = (e) => {
29
+ o.eventBus.emit("workspace:update:color-mode", e);
30
+ }, l = i(), s = () => {
31
+ o.workspaceStore.deleteDocument(o.documentSlug), l.push({
32
+ name: "workspace.environment",
33
+ params: {
34
+ workspaceSlug: o.activeWorkspace.id
35
+ }
36
+ });
37
+ };
38
+ return (e, k) => e.collectionType === "document" ? (a(), t(r(p), {
39
+ key: 0,
40
+ documentUrl: e.document?.["x-scalar-original-source-url"],
41
+ isDraftDocument: e.documentSlug === "drafts",
42
+ title: e.document?.info.title ?? "",
43
+ watchMode: e.document?.["x-scalar-watch-mode"] ?? !0,
44
+ "onDelete:document": s,
45
+ "onUpdate:watchMode": c
46
+ }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), t(r(h), {
47
+ key: 1,
48
+ activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
49
+ activeThemeId: e.workspaceStore.workspace["x-scalar-theme"] ?? "default",
50
+ colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
51
+ customProxyUrl: e.workspaceStore.config["x-scalar-reference-config"].settings.proxyUrl,
52
+ "onUpdate:colorMode": d,
53
+ "onUpdate:proxyUrl": m,
54
+ "onUpdate:themeId": n
55
+ }, null, 8, ["activeProxyUrl", "activeThemeId", "colorMode", "customProxyUrl"]));
56
+ }
57
+ });
2
58
  export {
3
- f as default
59
+ y as default
4
60
  };
@@ -1,59 +1,4 @@
1
- import { defineComponent as u, createBlock as t, openBlock as a, unref as r } from "vue";
2
- import { useRouter as i } from "vue-router";
3
- import p from "../../settings/DocumentSettings.vue.js";
4
- import h from "../../settings/CollectionSettings.vue.js";
5
- const y = /* @__PURE__ */ u({
6
- __name: "Settings",
7
- props: {
8
- documentSlug: {},
9
- document: {},
10
- eventBus: {},
11
- layout: {},
12
- path: {},
13
- method: {},
14
- exampleName: {},
15
- environment: {},
16
- workspaceStore: {},
17
- activeWorkspace: {},
18
- collectionType: {}
19
- },
20
- setup(o) {
21
- const c = (e) => {
22
- o.eventBus.emit("document:update:watch-mode", e);
23
- }, n = (e) => {
24
- o.eventBus.emit("workspace:update:theme", e);
25
- }, m = (e) => {
26
- o.eventBus.emit("workspace:update:active-proxy", e);
27
- }, d = (e) => {
28
- o.eventBus.emit("workspace:update:color-mode", e);
29
- }, l = i(), s = () => {
30
- o.workspaceStore.deleteDocument(o.documentSlug), l.push({
31
- name: "workspace.environment",
32
- params: {
33
- workspaceSlug: o.activeWorkspace.id
34
- }
35
- });
36
- };
37
- return (e, k) => e.collectionType === "document" ? (a(), t(r(p), {
38
- key: 0,
39
- documentUrl: e.document?.["x-scalar-original-source-url"],
40
- isDraftDocument: e.documentSlug === "drafts",
41
- title: e.document?.info.title ?? "",
42
- watchMode: e.document?.["x-scalar-watch-mode"] ?? !0,
43
- "onDelete:document": s,
44
- "onUpdate:watchMode": c
45
- }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), t(r(h), {
46
- key: 1,
47
- activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
48
- activeThemeId: e.workspaceStore.workspace["x-scalar-theme"] ?? "default",
49
- colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
50
- customProxyUrl: e.workspaceStore.config["x-scalar-reference-config"].settings.proxyUrl,
51
- "onUpdate:colorMode": d,
52
- "onUpdate:proxyUrl": m,
53
- "onUpdate:themeId": n
54
- }, null, 8, ["activeProxyUrl", "activeThemeId", "colorMode", "customProxyUrl"]));
55
- }
56
- });
1
+ import f from "./Settings.vue.js";
57
2
  export {
58
- y as default
3
+ f as default
59
4
  };
@@ -16,12 +16,20 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
16
16
  declare const _default: import("vue").DefineComponent<{
17
17
  /** The workspace store for accessing documents and operations */
18
18
  workspaceStore: WorkspaceStore;
19
+ /** Document id to create the example for */
20
+ documentId?: string;
21
+ /** Preselected path and method to create the example for */
22
+ operationId?: string;
19
23
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
20
24
  close: () => any;
21
25
  back: (keyboardEvent: KeyboardEvent) => any;
22
26
  }, string, import("vue").PublicProps, Readonly<{
23
27
  /** The workspace store for accessing documents and operations */
24
28
  workspaceStore: WorkspaceStore;
29
+ /** Document id to create the example for */
30
+ documentId?: string;
31
+ /** Preselected path and method to create the example for */
32
+ operationId?: string;
25
33
  }> & Readonly<{
26
34
  onClose?: (() => any) | undefined;
27
35
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAoRA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAcpE;;;;;;;;;;;;;GAaG;;IAGD,iEAAiE;oBACjD,cAAc;;;;;IAD9B,iEAAiE;oBACjD,cAAc;;;;;AAHhC,wBAubC"}
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAoSA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAcpE;;;;;;;;;;;;;GAaG;;IAGD,iEAAiE;oBACjD,cAAc;IAC9B,4CAA4C;iBAC/B,MAAM;IACnB,4DAA4D;kBAC9C,MAAM;;;;;IALpB,iEAAiE;oBACjD,cAAc;IAC9B,4CAA4C;iBAC/B,MAAM;IACnB,4DAA4D;kBAC9C,MAAM;;;;;AAPtB,wBAucC"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as O, ref as v, computed as m, watch as j, createBlock as f, openBlock as u, withCtx as n, createVNode as s, createTextVNode as z, createElementVNode as i, unref as c, normalizeClass as U, toDisplayString as h, createElementBlock as x, createCommentVNode as I, Fragment as L, renderList as R } from "vue";
2
- import { ScalarListbox as T, ScalarButton as C, ScalarIcon as y, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
1
+ import { defineComponent as B, ref as h, computed as p, watch as O, createBlock as x, openBlock as u, withCtx as n, createVNode as i, createTextVNode as j, createElementVNode as m, unref as c, normalizeClass as z, toDisplayString as b, createElementBlock as w, createCommentVNode as U, Fragment as L, renderList as R } from "vue";
2
+ import { ScalarListbox as T, ScalarButton as _, ScalarIcon as I, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
3
3
  import { useRouter as P } from "vue-router";
4
- import D from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
4
+ import y from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
5
5
  import q from "./CommandActionForm.vue.js";
6
6
  import G from "./CommandActionInput.vue.js";
7
7
  const H = { class: "flex flex-1 gap-1" }, J = {
@@ -12,84 +12,92 @@ const H = { class: "flex flex-1 gap-1" }, J = {
12
12
  class: "text-c-3"
13
13
  }, M = { class: "flex items-center gap-2" }, Q = { class: "custom-scroll max-h-40" }, W = { class: "truncate" }, X = {
14
14
  name: "CommandPaletteExample"
15
- }, oe = /* @__PURE__ */ O({
15
+ }, oe = /* @__PURE__ */ B({
16
16
  ...X,
17
17
  props: {
18
- workspaceStore: {}
18
+ workspaceStore: {},
19
+ documentId: {},
20
+ operationId: {}
19
21
  },
20
22
  emits: ["close", "back"],
21
- setup(b, { emit: V }) {
22
- const _ = V, N = P(), d = v(""), w = m(() => d.value.trim()), k = m(
23
- () => Object.entries(b.workspaceStore.workspace.documents).map(
24
- ([t, a]) => ({
25
- id: t,
26
- label: a.info.title || t
23
+ setup(s, { emit: D }) {
24
+ const k = D, V = P(), v = h(""), g = p(() => v.value.trim()), f = p(
25
+ () => Object.entries(s.workspaceStore.workspace.documents).map(
26
+ ([e, a]) => ({
27
+ id: e,
28
+ label: a.info.title || e
27
29
  })
28
30
  )
29
- ), l = v(
30
- k.value[0] ?? void 0
31
- ), o = v(void 0), g = (t) => {
31
+ ), l = h(
32
+ s.documentId ? f.value.find((e) => e.id === s.documentId) : f.value[0] ?? void 0
33
+ ), S = (e) => {
32
34
  const a = [];
33
- for (const e of t)
34
- e.type === "operation" && a.push(e), "children" in e && e.children && a.push(...g(e.children));
35
+ for (const t of e)
36
+ t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...S(t.children));
35
37
  return a;
36
- }, p = m(() => {
38
+ }, r = p(() => {
37
39
  if (!l.value)
38
40
  return [];
39
- const t = b.workspaceStore.workspace.documents[l.value.id];
40
- if (!t || !t["x-scalar-navigation"])
41
+ const e = s.workspaceStore.workspace.documents[l.value.id];
42
+ if (!e || !e["x-scalar-navigation"])
41
43
  return [];
42
- const a = t["x-scalar-navigation"];
43
- return g(a.children ?? []).map((r) => ({
44
- id: r.id,
45
- label: `${r.method.toUpperCase()} ${r.path}`,
46
- path: r.path,
47
- method: r.method
44
+ const a = e["x-scalar-navigation"];
45
+ return S(a.children ?? []).map((d) => ({
46
+ id: d.id,
47
+ label: `${d.method.toUpperCase()} ${d.path}`,
48
+ path: d.path,
49
+ method: d.method
48
50
  }));
49
- });
50
- j(
51
+ }), o = h(
52
+ s.operationId ? r.value.find(
53
+ (e) => e.id === s.operationId
54
+ ) : void 0
55
+ );
56
+ O(
51
57
  l,
52
58
  () => {
53
- o.value = p.value[0] ?? void 0;
59
+ o.value = s.operationId ? r.value.find(
60
+ (e) => e.id === s.operationId
61
+ ) : r.value[0] ?? void 0;
54
62
  },
55
63
  { immediate: !0 }
56
64
  );
57
- const E = (t) => {
58
- t && (o.value = t);
59
- }, S = m(() => !w.value || !l.value || !o.value), $ = () => {
60
- S.value || !l.value || !o.value || (N.push({
65
+ const N = (e) => {
66
+ e && (o.value = e);
67
+ }, C = p(() => !g.value || !l.value || !o.value), E = () => {
68
+ C.value || !l.value || !o.value || (V.push({
61
69
  name: "example",
62
70
  params: {
63
71
  documentSlug: l.value.id,
64
72
  pathEncoded: encodeURIComponent(o.value.path),
65
73
  method: o.value.method,
66
- exampleName: w.value
74
+ exampleName: g.value
67
75
  }
68
- }), _("close"));
69
- }, B = (t) => {
70
- _("back", t);
76
+ }), k("close"));
77
+ }, $ = (e) => {
78
+ k("back", e);
71
79
  };
72
- return (t, a) => (u(), f(q, {
73
- disabled: S.value,
74
- onSubmit: $
80
+ return (e, a) => (u(), x(q, {
81
+ disabled: C.value,
82
+ onSubmit: E
75
83
  }, {
76
84
  options: n(() => [
77
- i("div", H, [
78
- s(c(T), {
85
+ m("div", H, [
86
+ i(c(T), {
79
87
  modelValue: l.value,
80
- "onUpdate:modelValue": a[1] || (a[1] = (e) => l.value = e),
81
- options: k.value
88
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
89
+ options: f.value
82
90
  }, {
83
91
  default: n(() => [
84
- s(c(C), {
92
+ i(c(_), {
85
93
  class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
86
94
  variant: "outlined"
87
95
  }, {
88
96
  default: n(() => [
89
- i("span", {
90
- class: U(l.value ? "text-c-1 truncate" : "text-c-3")
91
- }, h(l.value ? l.value.label : "Select Document"), 3),
92
- s(c(y), {
97
+ m("span", {
98
+ class: z(l.value ? "text-c-1 truncate" : "text-c-3")
99
+ }, b(l.value ? l.value.label : "Select Document"), 3),
100
+ i(c(I), {
93
101
  class: "text-c-3",
94
102
  icon: "ChevronDown",
95
103
  size: "md"
@@ -100,21 +108,21 @@ const H = { class: "flex flex-1 gap-1" }, J = {
100
108
  ]),
101
109
  _: 1
102
110
  }, 8, ["modelValue", "options"]),
103
- s(c(A), {
111
+ i(c(A), {
104
112
  placement: "bottom",
105
113
  resize: ""
106
114
  }, {
107
115
  items: n(() => [
108
- i("div", Q, [
109
- (u(!0), x(L, null, R(p.value, (e) => (u(), f(c(F), {
110
- key: e.id,
116
+ m("div", Q, [
117
+ (u(!0), w(L, null, R(r.value, (t) => (u(), x(c(F), {
118
+ key: t.id,
111
119
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
112
- onClick: (r) => E(e)
120
+ onClick: (d) => N(t)
113
121
  }, {
114
122
  default: n(() => [
115
- i("span", W, h(e.path), 1),
116
- s(D, {
117
- method: e.method
123
+ m("span", W, b(t.path), 1),
124
+ i(y, {
125
+ method: t.method
118
126
  }, null, 8, ["method"])
119
127
  ]),
120
128
  _: 2
@@ -122,19 +130,19 @@ const H = { class: "flex flex-1 gap-1" }, J = {
122
130
  ])
123
131
  ]),
124
132
  default: n(() => [
125
- s(c(C), {
133
+ i(c(_), {
126
134
  class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
127
- disabled: !p.value.length,
135
+ disabled: !r.value.length,
128
136
  variant: "outlined"
129
137
  }, {
130
138
  default: n(() => [
131
- o.value ? (u(), x("span", J, h(o.value.path), 1)) : (u(), x("span", K, " Select Operation ")),
132
- i("div", M, [
133
- o.value ? (u(), f(D, {
139
+ o.value ? (u(), w("span", J, b(o.value.path), 1)) : (u(), w("span", K, " Select Operation ")),
140
+ m("div", M, [
141
+ o.value ? (u(), x(y, {
134
142
  key: 0,
135
143
  method: o.value.method
136
- }, null, 8, ["method"])) : I("", !0),
137
- s(c(y), {
144
+ }, null, 8, ["method"])) : U("", !0),
145
+ i(c(I), {
138
146
  class: "text-c-3",
139
147
  icon: "ChevronDown",
140
148
  size: "md"
@@ -149,15 +157,15 @@ const H = { class: "flex flex-1 gap-1" }, J = {
149
157
  ])
150
158
  ]),
151
159
  submit: n(() => [...a[2] || (a[2] = [
152
- z("Create Example", -1)
160
+ j("Create Example", -1)
153
161
  ])]),
154
162
  default: n(() => [
155
- s(G, {
156
- modelValue: d.value,
157
- "onUpdate:modelValue": a[0] || (a[0] = (e) => d.value = e),
163
+ i(G, {
164
+ modelValue: v.value,
165
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
158
166
  label: "Example Name",
159
167
  placeholder: "Example Name",
160
- onDelete: B
168
+ onDelete: $
161
169
  }, null, 8, ["modelValue"])
162
170
  ]),
163
171
  _: 1