@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,17 +1,20 @@
1
- import { defineComponent as A, mergeModels as k, computed as p, capitalize as D, useModel as f, createBlock as S, openBlock as m, unref as o, createSlots as $, withCtx as i, createVNode as l, createTextVNode as u, toDisplayString as z, createElementVNode as s, normalizeClass as E, createElementBlock as M, createCommentVNode as w } from "vue";
2
- import { ScalarSidebarItem as N, ScalarButton as y } from "@scalar/components";
3
- import { ScalarIconGlobe as V } from "@scalar/icons";
4
- import q from "../../../../assets/rabbit.ascii.js";
5
- import G from "../../../../assets/rabbitjump.ascii.js";
6
- import W from "../../../../components/ScalarAsciiArt.vue.js";
7
- import { dragHandleFactory as R } from "../../../helpers/drag-handle-factory.js";
8
- import j from "../../../components/sidebar/Sidebar.vue.js";
9
- const H = {
1
+ import { defineComponent as q, mergeModels as B, computed as c, capitalize as x, useModel as C, ref as V, createElementBlock as I, openBlock as m, createVNode as l, createBlock as S, createCommentVNode as v, unref as o, createSlots as G, withCtx as r, createTextVNode as b, toDisplayString as R, createElementVNode as d, normalizeClass as j } from "vue";
2
+ import { useModal as F, ScalarSidebarItem as W, ScalarIconButton as H, ScalarButton as O, ScalarModal as K } from "@scalar/components";
3
+ import { ScalarIconPlus as L, ScalarIconDotsThree as U, ScalarIconGlobe as J } from "@scalar/icons";
4
+ import { getParentEntry as f } from "@scalar/workspace-store/navigation";
5
+ import Y from "../../../../assets/rabbit.ascii.js";
6
+ import Q from "../../../../assets/rabbitjump.ascii.js";
7
+ import M from "../../../../components/ScalarAsciiArt.vue.js";
8
+ import X from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
9
+ import Z from "./ItemDecorator.vue.js";
10
+ import { dragHandleFactory as _ } from "../../../helpers/drag-handle-factory.js";
11
+ import ee from "../../../components/sidebar/Sidebar.vue.js";
12
+ const te = { class: "flex" }, ae = {
10
13
  key: 0,
11
14
  class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
12
- }, L = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, P = { class: "gap-1.5 p-2" }, Y = /* @__PURE__ */ A({
15
+ }, oe = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, ne = { class: "gap-1.5 p-2" }, fe = /* @__PURE__ */ q({
13
16
  __name: "AppSidebar",
14
- props: /* @__PURE__ */ k({
17
+ props: /* @__PURE__ */ B({
15
18
  layout: {},
16
19
  sidebarState: {},
17
20
  isWorkspaceOpen: { type: Boolean },
@@ -28,105 +31,212 @@ const H = {
28
31
  },
29
32
  sidebarWidthModifiers: {}
30
33
  }),
31
- emits: /* @__PURE__ */ k(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
32
- setup(r, { emit: B }) {
33
- const n = B, g = p(() => D(r.activeWorkspace.name)), b = f(r, "isSidebarOpen"), c = f(r, "sidebarWidth"), d = p(() => r.sidebarState.items.value.length <= 1), v = p(
34
- () => R({
35
- store: r.store,
36
- sidebarState: r.sidebarState
34
+ emits: /* @__PURE__ */ B(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
35
+ setup(n, { emit: h }) {
36
+ const u = h, $ = c(() => x(n.activeWorkspace.name)), y = C(n, "isSidebarOpen"), g = C(n, "sidebarWidth"), k = c(() => n.sidebarState.items.value.length <= 1), w = c(
37
+ () => _({
38
+ store: n.store,
39
+ sidebarState: n.sidebarState
37
40
  })
38
- ), O = (t, e) => v.value.handleDragEnd(t, e), C = (t, e) => v.value.isDroppable(t, e);
39
- return (t, e) => (m(), S(o(j), {
40
- isSidebarOpen: b.value,
41
- "onUpdate:isSidebarOpen": e[3] || (e[3] = (a) => b.value = a),
42
- sidebarWidth: c.value,
43
- "onUpdate:sidebarWidth": e[4] || (e[4] = (a) => c.value = a),
44
- activeWorkspace: t.activeWorkspace,
45
- documents: Object.values(t.store.workspace.documents),
46
- eventBus: t.eventBus,
47
- isDroppable: C,
48
- layout: t.layout,
49
- sidebarState: t.sidebarState,
50
- workspaces: t.workspaces,
51
- "onCreate:workspace": e[5] || (e[5] = (a) => n("create:workspace")),
52
- onReorder: e[6] || (e[6] = (a, I) => O(a, I)),
53
- "onSelect:workspace": e[7] || (e[7] = (a) => n("select:workspace", a)),
54
- onSelectItem: e[8] || (e[8] = (a) => n("selectItem", a))
55
- }, $({
56
- workspaceButton: i(() => [
57
- l(o(N), {
58
- is: "button",
59
- active: t.isWorkspaceOpen,
60
- icon: o(V),
61
- onClick: e[0] || (e[0] = (a) => n("click:workspace"))
62
- }, {
63
- default: i(() => [
64
- u(z(g.value), 1)
65
- ]),
66
- _: 1
67
- }, 8, ["active", "icon"])
68
- ]),
69
- _: 2
70
- }, [
71
- t.layout !== "modal" ? {
72
- name: "footer",
73
- fn: i(() => [
74
- s("div", {
75
- class: E({
76
- "empty-sidebar-item border-t": d.value
77
- })
78
- }, [
79
- d.value ? (m(), M("div", H, [
80
- s("div", L, [
81
- l(W, {
82
- art: o(q),
83
- class: "rabbitsit font-bold"
84
- }, null, 8, ["art"]),
85
- l(W, {
86
- art: o(G),
87
- class: "rabbitjump absolute top-0 left-0 font-bold"
88
- }, null, 8, ["art"])
89
- ]),
90
- e[9] || (e[9] = s("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
91
- s("b", { class: "font-medium" }, "Let's Get Started"),
92
- s("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
93
- ], -1))
94
- ])) : w("", !0),
95
- s("div", P, [
96
- d.value ? (m(), S(o(y), {
97
- key: 0,
98
- class: "w-full",
99
- size: "sm",
100
- onClick: e[1] || (e[1] = (a) => t.eventBus.emit("ui:open:command-palette", {
101
- action: "import-from-openapi-swagger-postman-curl",
102
- payload: void 0
103
- }))
104
- }, {
105
- default: i(() => [...e[10] || (e[10] = [
106
- u(" Import Collection ", -1)
107
- ])]),
108
- _: 1
109
- })) : w("", !0),
110
- l(o(y), {
111
- class: "w-full",
112
- hotkey: "K",
113
- size: "sm",
114
- variant: "outlined",
115
- onClick: e[2] || (e[2] = (a) => t.eventBus.emit("ui:open:command-palette"))
116
- }, {
117
- default: i(() => [...e[11] || (e[11] = [
118
- u(" Add Item ", -1)
119
- ])]),
120
- _: 1
41
+ ), D = (t, e) => w.value.handleDragEnd(t, e), N = (t, e) => w.value.isDroppable(t, e), i = V(null), p = F(), A = c(() => {
42
+ const t = i.value?.item;
43
+ return t?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${t?.type ?? "item"}? This action cannot be undone.`;
44
+ }), E = () => {
45
+ const t = i.value?.item;
46
+ if (!t)
47
+ return;
48
+ const e = n.sidebarState.getEntryById(t.id), a = f("document", e), s = f("operation", e);
49
+ if (a) {
50
+ if (t.type === "document")
51
+ n.eventBus.emit("document:delete:document", { name: a.name });
52
+ else if (t.type === "tag")
53
+ n.eventBus.emit("tag:delete:tag", {
54
+ documentName: a.name,
55
+ name: t.name
56
+ });
57
+ else if (t.type === "operation") {
58
+ if (!s)
59
+ return;
60
+ n.eventBus.emit("operation:delete:operation", {
61
+ meta: {
62
+ method: s.method,
63
+ path: s.path
64
+ },
65
+ documentName: a.name
66
+ });
67
+ } else if (t.type === "example") {
68
+ if (!s)
69
+ return;
70
+ n.eventBus.emit("operation:delete:example", {
71
+ meta: {
72
+ method: s.method,
73
+ path: s.path,
74
+ exampleKey: t.name
75
+ },
76
+ documentName: a.name
77
+ });
78
+ }
79
+ p.hide(), i.value = null;
80
+ }
81
+ }, z = (t, e) => {
82
+ t.preventDefault(), t.stopPropagation(), i.value = {
83
+ item: e,
84
+ target: t.currentTarget,
85
+ isOpen: !0
86
+ };
87
+ }, P = () => {
88
+ i.value && (i.value.isOpen = !1);
89
+ }, T = (t) => {
90
+ const e = n.sidebarState.getEntryById(t.id), a = f("document", e), s = f("tag", e);
91
+ n.eventBus.emit("ui:open:command-palette", {
92
+ action: "create-request",
93
+ payload: {
94
+ documentId: a?.id,
95
+ tagId: s?.name
96
+ }
97
+ });
98
+ };
99
+ return (t, e) => (m(), I("div", te, [
100
+ l(o(ee), {
101
+ isSidebarOpen: y.value,
102
+ "onUpdate:isSidebarOpen": e[3] || (e[3] = (a) => y.value = a),
103
+ sidebarWidth: g.value,
104
+ "onUpdate:sidebarWidth": e[4] || (e[4] = (a) => g.value = a),
105
+ activeWorkspace: t.activeWorkspace,
106
+ documents: Object.values(t.store.workspace.documents),
107
+ eventBus: t.eventBus,
108
+ isDroppable: N,
109
+ layout: t.layout,
110
+ sidebarState: t.sidebarState,
111
+ workspaces: t.workspaces,
112
+ "onCreate:workspace": e[5] || (e[5] = (a) => u("create:workspace")),
113
+ onReorder: e[6] || (e[6] = (a, s) => D(a, s)),
114
+ "onSelect:workspace": e[7] || (e[7] = (a) => u("select:workspace", a)),
115
+ onSelectItem: e[8] || (e[8] = (a) => u("selectItem", a))
116
+ }, G({
117
+ workspaceButton: r(() => [
118
+ l(o(W), {
119
+ is: "button",
120
+ active: t.isWorkspaceOpen,
121
+ icon: o(J),
122
+ onClick: e[0] || (e[0] = (a) => u("click:workspace"))
123
+ }, {
124
+ default: r(() => [
125
+ b(R($.value), 1)
126
+ ]),
127
+ _: 1
128
+ }, 8, ["active", "icon"])
129
+ ]),
130
+ decorator: r(({ item: a }) => [
131
+ l(o(H), {
132
+ icon: o(U),
133
+ label: "More options",
134
+ size: "sm",
135
+ weight: "bold",
136
+ onClick: (s) => z(s, a)
137
+ }, null, 8, ["icon", "onClick"])
138
+ ]),
139
+ empty: r(({ item: a }) => [
140
+ l(o(W), {
141
+ is: "button",
142
+ onClick: (s) => T(a)
143
+ }, {
144
+ icon: r(() => [
145
+ l(o(L))
146
+ ]),
147
+ default: r(() => [...e[11] || (e[11] = [
148
+ b("Add operation", -1)
149
+ ])]),
150
+ _: 1
151
+ }, 8, ["onClick"])
152
+ ]),
153
+ _: 2
154
+ }, [
155
+ t.layout !== "modal" ? {
156
+ name: "footer",
157
+ fn: r(() => [
158
+ d("div", {
159
+ class: j({
160
+ "empty-sidebar-item border-t": k.value
121
161
  })
122
- ])
123
- ], 2)
162
+ }, [
163
+ k.value ? (m(), I("div", ae, [
164
+ d("div", oe, [
165
+ l(M, {
166
+ art: o(Y),
167
+ class: "rabbitsit font-bold"
168
+ }, null, 8, ["art"]),
169
+ l(M, {
170
+ art: o(Q),
171
+ class: "rabbitjump absolute top-0 left-0 font-bold"
172
+ }, null, 8, ["art"])
173
+ ]),
174
+ e[12] || (e[12] = d("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
175
+ d("b", { class: "font-medium" }, "Let's Get Started"),
176
+ d("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
177
+ ], -1))
178
+ ])) : v("", !0),
179
+ d("div", ne, [
180
+ k.value ? (m(), S(o(O), {
181
+ key: 0,
182
+ class: "w-full",
183
+ size: "sm",
184
+ onClick: e[1] || (e[1] = (a) => t.eventBus.emit("ui:open:command-palette", {
185
+ action: "import-from-openapi-swagger-postman-curl",
186
+ payload: void 0
187
+ }))
188
+ }, {
189
+ default: r(() => [...e[13] || (e[13] = [
190
+ b(" Import Collection ", -1)
191
+ ])]),
192
+ _: 1
193
+ })) : v("", !0),
194
+ l(o(O), {
195
+ class: "w-full",
196
+ hotkey: "K",
197
+ size: "sm",
198
+ variant: "outlined",
199
+ onClick: e[2] || (e[2] = (a) => t.eventBus.emit("ui:open:command-palette"))
200
+ }, {
201
+ default: r(() => [...e[14] || (e[14] = [
202
+ b(" Add Item ", -1)
203
+ ])]),
204
+ _: 1
205
+ })
206
+ ])
207
+ ], 2)
208
+ ]),
209
+ key: "0"
210
+ } : void 0
211
+ ]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]),
212
+ i.value && i.value.isOpen ? (m(), S(Z, {
213
+ key: 0,
214
+ eventBus: t.eventBus,
215
+ item: i.value.item,
216
+ sidebarState: t.sidebarState,
217
+ target: i.value.target,
218
+ onCloseMenu: P,
219
+ onShowDeleteModal: e[9] || (e[9] = (a) => o(p).show())
220
+ }, null, 8, ["eventBus", "item", "sidebarState", "target"])) : v("", !0),
221
+ i.value ? (m(), S(o(K), {
222
+ key: 1,
223
+ size: "xxs",
224
+ state: o(p),
225
+ title: `Delete ${i.value.item.title}`
226
+ }, {
227
+ default: r(() => [
228
+ l(X, {
229
+ variableName: i.value.item.title,
230
+ warningMessage: A.value,
231
+ onClose: e[10] || (e[10] = (a) => o(p).hide()),
232
+ onDelete: E
233
+ }, null, 8, ["variableName", "warningMessage"])
124
234
  ]),
125
- key: "0"
126
- } : void 0
127
- ]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]));
235
+ _: 1
236
+ }, 8, ["state", "title"])) : v("", !0)
237
+ ]));
128
238
  }
129
239
  });
130
240
  export {
131
- Y as default
241
+ fe as default
132
242
  };
@@ -1,5 +1,5 @@
1
1
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
- import type { UseTabsReturn } from '../../../../v2/hooks/use-tabs.js';
2
+ import type { UseTabsReturn } from '../../../../v2/features/app/hooks/use-tabs.js';
3
3
  type __VLS_Props = {
4
4
  /** Tabs state */
5
5
  tabsState: UseTabsReturn;
@@ -1 +1 @@
1
- {"version":3,"file":"DesktopTabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTabs.vue"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,KAAK,WAAW,GAAG;IACjB,iBAAiB;IACjB,SAAS,EAAE,aAAa,CAAA;IACxB,0DAA0D;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AA6IF,wBAMG"}
1
+ {"version":3,"file":"DesktopTabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTabs.vue"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAErE,KAAK,WAAW,GAAG;IACjB,iBAAiB;IACjB,SAAS,EAAE,aAAa,CAAA;IACxB,0DAA0D;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AA6IF,wBAMG"}
@@ -0,0 +1,22 @@
1
+ import type { SidebarState } from '@scalar/sidebar';
2
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
4
+ type __VLS_Props = {
5
+ /** The item to display the decorator for */
6
+ item: TraversedEntry;
7
+ /** The event bus to emit events to */
8
+ eventBus: WorkspaceEventBus;
9
+ /** The sidebar state to get the parent entry from */
10
+ sidebarState: SidebarState<TraversedEntry>;
11
+ /** The target to position the dropdown relative to */
12
+ target: HTMLElement;
13
+ };
14
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
+ closeMenu: () => any;
16
+ showDeleteModal: () => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onCloseMenu?: (() => any) | undefined;
19
+ onShowDeleteModal?: (() => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
22
+ //# sourceMappingURL=ItemDecorator.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemDecorator.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/ItemDecorator.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAIhF,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,IAAI,EAAE,cAAc,CAAA;IACpB,sCAAsC;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qDAAqD;IACrD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,sDAAsD;IACtD,MAAM,EAAE,WAAW,CAAA;CACpB,CAAC;;;;;;;;AAsVF,wBAOG"}
@@ -0,0 +1,138 @@
1
+ import { defineComponent as M, ref as p, createBlock as d, openBlock as i, unref as n, withCtx as o, createVNode as l, withKeys as S, createCommentVNode as r, createElementVNode as c, createTextVNode as s } from "vue";
2
+ import { ScalarFloating as E, ScalarDropdownMenu as $, ScalarDropdownButton as y, ScalarIcon as f, ScalarDropdownDivider as b } from "@scalar/components";
3
+ import { getParentEntry as w } from "@scalar/workspace-store/navigation";
4
+ import { onClickOutside as z } from "@vueuse/core";
5
+ const N = { class: "flex items-center gap-2" }, O = { class: "flex items-center gap-2" }, T = { class: "flex items-center gap-2" }, V = { class: "text-red flex items-center gap-2" }, W = /* @__PURE__ */ M({
6
+ __name: "ItemDecorator",
7
+ props: {
8
+ item: {},
9
+ eventBus: {},
10
+ sidebarState: {},
11
+ target: {}
12
+ },
13
+ emits: ["closeMenu", "showDeleteModal"],
14
+ setup(e, { emit: B }) {
15
+ const u = B, g = p(null);
16
+ z(e.target, () => u("closeMenu"), {
17
+ ignore: [g]
18
+ });
19
+ const v = () => e.item.type === "document" || e.item.type === "tag", k = () => e.item.type === "document", x = () => e.item.type === "operation", A = () => e.item.type === "document" && e.item.id !== "drafts" || e.item.type === "tag" || e.item.type === "operation" || e.item.type === "example", D = () => {
20
+ if (e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
21
+ action: "create-request",
22
+ payload: {
23
+ documentId: e.item.id
24
+ }
25
+ }), e.item.type === "tag") {
26
+ const a = e.sidebarState.getEntryById(e.item.id);
27
+ e.eventBus.emit("ui:open:command-palette", {
28
+ action: "create-request",
29
+ payload: {
30
+ documentId: w("document", a)?.id,
31
+ tagId: e.item.name
32
+ }
33
+ });
34
+ }
35
+ }, I = () => {
36
+ e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
37
+ action: "add-tag",
38
+ payload: {
39
+ documentId: e.item.id
40
+ }
41
+ });
42
+ }, C = () => {
43
+ if (e.item.type === "operation") {
44
+ const a = e.sidebarState.getEntryById(e.item.id);
45
+ e.eventBus.emit("ui:open:command-palette", {
46
+ action: "add-example",
47
+ payload: {
48
+ documentId: w("document", a)?.id,
49
+ operationId: e.item.id
50
+ }
51
+ });
52
+ }
53
+ };
54
+ return (a, t) => (i(), d(n(E), {
55
+ placement: "bottom-end",
56
+ target: a.target,
57
+ teleport: ""
58
+ }, {
59
+ floating: o(() => [
60
+ l(n($), {
61
+ ref_key: "dropdownMenuRef",
62
+ ref: g,
63
+ onClick: t[4] || (t[4] = (m) => u("closeMenu")),
64
+ onKeydown: t[5] || (t[5] = S((m) => u("closeMenu"), ["escape"]))
65
+ }, {
66
+ default: o(() => [
67
+ v() ? (i(), d(n(y), {
68
+ key: 0,
69
+ onClick: t[0] || (t[0] = (m) => D())
70
+ }, {
71
+ default: o(() => [
72
+ c("div", N, [
73
+ l(n(f), {
74
+ icon: "Add",
75
+ size: "sm"
76
+ }),
77
+ t[6] || (t[6] = s(" Add Operation ", -1))
78
+ ])
79
+ ]),
80
+ _: 1
81
+ })) : r("", !0),
82
+ k() ? (i(), d(n(y), {
83
+ key: 1,
84
+ onClick: t[1] || (t[1] = (m) => I())
85
+ }, {
86
+ default: o(() => [
87
+ c("div", O, [
88
+ l(n(f), {
89
+ icon: "Add",
90
+ size: "sm"
91
+ }),
92
+ t[7] || (t[7] = s(" Add Tag ", -1))
93
+ ])
94
+ ]),
95
+ _: 1
96
+ })) : r("", !0),
97
+ x() ? (i(), d(n(y), {
98
+ key: 2,
99
+ onClick: t[2] || (t[2] = (m) => C())
100
+ }, {
101
+ default: o(() => [
102
+ c("div", T, [
103
+ l(n(f), {
104
+ icon: "Add",
105
+ size: "sm"
106
+ }),
107
+ t[8] || (t[8] = s(" Add Example ", -1))
108
+ ])
109
+ ]),
110
+ _: 1
111
+ })) : r("", !0),
112
+ (x() || v() || k()) && A() ? (i(), d(n(b), { key: 3 })) : r("", !0),
113
+ A() ? (i(), d(n(y), {
114
+ key: 4,
115
+ onClick: t[3] || (t[3] = (m) => u("showDeleteModal"))
116
+ }, {
117
+ default: o(() => [
118
+ c("div", V, [
119
+ l(n(f), {
120
+ icon: "Delete",
121
+ size: "sm"
122
+ }),
123
+ t[9] || (t[9] = s(" Delete ", -1))
124
+ ])
125
+ ]),
126
+ _: 1
127
+ })) : r("", !0)
128
+ ]),
129
+ _: 1
130
+ }, 512)
131
+ ]),
132
+ _: 1
133
+ }, 8, ["target"]));
134
+ }
135
+ });
136
+ export {
137
+ W as default
138
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ItemDecorator.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,4 +1,4 @@
1
- import type { Workspace } from '../../../../v2/hooks/use-workspace-selector.js';
1
+ import type { Workspace } from '../../../../v2/features/app/hooks/use-workspace-selector.js';
2
2
  /**
3
3
  * The top nav on the web
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"WebTopNav.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/WebTopNav.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAKlE;;;;GAIG;;IAGD;;;OAGG;qBACc,SAAS;IAC1B;;;OAGG;gBACS,SAAS,EAAE;;;;;IATvB;;;OAGG;qBACc,SAAS;IAC1B;;;OAGG;gBACS,SAAS,EAAE;;;;;AAXzB,wBAuGC"}
1
+ {"version":3,"file":"WebTopNav.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/WebTopNav.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAK/E;;;;GAIG;;IAGD;;;OAGG;qBACc,SAAS;IAC1B;;;OAGG;gBACS,SAAS,EAAE;;;;;IATvB;;;OAGG;qBACc,SAAS;IAC1B;;;OAGG;gBACS,SAAS,EAAE;;;;;AAXzB,wBAuGC"}
@@ -1,4 +1,4 @@
1
- import type { ClientPlugin } from '../../../../v2/plugins';
1
+ import type { ClientPlugin } from '../../../../v2/helpers/plugins.js';
2
2
  import type { ClientLayout } from '../../../../v2/types/layout';
3
3
  export type CreateApiClientOptions = {
4
4
  /**
@@ -20,5 +20,5 @@ export declare const createAppRouter: (layout: CreateApiClientOptions["layout"])
20
20
  /**
21
21
  * Create the API Client with router and passes in the workspace store as a prop
22
22
  */
23
- export declare const createApiClientApp: (el: HTMLElement | null, { layout }: CreateApiClientOptions) => void;
23
+ export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins }: CreateApiClientOptions) => void;
24
24
  //# sourceMappingURL=create-api-client-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,YAAwB,sBAAsB,SAkBxG,CAAA"}
1
+ {"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,qBAAiC,sBAAsB,SAkBjH,CAAA"}
@@ -1,11 +1,11 @@
1
- import { createApp as i } from "vue";
2
- import { createRouter as o, createWebHistory as p, createWebHashHistory as c } from "vue-router";
3
- import s from "../App.vue.js";
1
+ import { createApp as p } from "vue";
2
+ import { createRouter as o, createWebHistory as c, createWebHashHistory as s } from "vue-router";
3
+ import n from "../App.vue.js";
4
4
  /* empty css */
5
5
  import { ROUTES as a } from "./routes.js";
6
- const n = (e) => e === "web" ? o({ history: p(), routes: a }) : o({ history: c(), routes: a }), h = (e, { layout: r = "desktop" }) => {
7
- const t = i(s, { layout: r });
8
- if (t.use(n(r)), !e) {
6
+ const m = (e) => e === "web" ? o({ history: c(), routes: a }) : o({ history: s(), routes: a }), A = (e, { layout: r = "desktop", plugins: i }) => {
7
+ const t = p(n, { layout: r, plugins: i });
8
+ if (t.use(m(r)), !e) {
9
9
  console.error(
10
10
  "[@scalar/api-client-modal] Could not create the API client.",
11
11
  "Invalid HTML element provided.",
@@ -16,6 +16,6 @@ const n = (e) => e === "web" ? o({ history: p(), routes: a }) : o({ history: c()
16
16
  t.mount(e);
17
17
  };
18
18
  export {
19
- h as createApiClientApp,
20
- n as createAppRouter
19
+ A as createApiClientApp,
20
+ m as createAppRouter
21
21
  };