@scalar/api-client 2.15.0 → 2.17.1

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 (271) hide show
  1. package/CHANGELOG.md +166 -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 +84 -45
  12. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -11
  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 +2 -2
  15. package/dist/v2/blocks/operation-block/components/Header.vue2.js +28 -35
  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 +158 -125
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +59 -50
  81. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
  82. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
  85. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
  87. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +1 -0
  88. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +148 -149
  90. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
  91. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  92. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
  94. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
  95. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
  96. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
  97. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
  98. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  99. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
  100. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
  101. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  102. package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
  103. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
  104. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
  105. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
  106. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
  107. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  108. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +0 -2
  109. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  111. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -87
  112. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
  113. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
  114. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
  126. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
  127. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
  128. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
  129. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
  130. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
  132. package/dist/v2/components/code-input/CodeInput.vue.d.ts +7 -6
  133. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  134. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  135. package/dist/v2/components/code-input/CodeInput.vue2.js +61 -59
  136. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
  137. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  138. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
  139. package/dist/v2/components/resize/index.d.ts +0 -1
  140. package/dist/v2/components/resize/index.d.ts.map +1 -1
  141. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -5
  142. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  143. package/dist/v2/components/sidebar/Sidebar.vue.js +49 -47
  144. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  145. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  146. package/dist/v2/features/app/App.vue.d.ts +3 -0
  147. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  148. package/dist/v2/features/app/App.vue.js +128 -139
  149. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
  150. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  151. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  152. package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -105
  153. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
  154. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  155. package/dist/v2/features/app/components/{ItemDecorator.vue.d.ts → SidebarItemMenu.vue.d.ts} +1 -1
  156. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -0
  157. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +129 -0
  158. package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +4 -0
  159. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
  160. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  161. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  162. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  163. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  164. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  165. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  166. package/dist/v2/features/app/helpers/routes.js +25 -16
  167. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  168. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  169. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  170. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  171. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  172. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  173. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  174. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  175. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  176. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  177. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  178. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  179. package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
  180. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  181. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  182. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  183. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  184. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  185. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  186. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  187. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  188. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  189. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  190. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  191. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  192. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  193. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  194. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  195. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  196. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  197. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  198. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  199. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  200. package/dist/v2/features/modal/Modal.vue.js +1 -1
  201. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  202. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  203. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  204. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  205. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  206. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  207. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  208. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  209. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  210. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  211. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  212. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  213. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  214. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  215. package/dist/v2/features/operation/Operation.vue.js +59 -28
  216. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  217. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  218. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  219. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  220. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  221. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  222. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  223. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  224. package/dist/v2/features/operation/index.d.ts +0 -1
  225. package/dist/v2/features/operation/index.d.ts.map +1 -1
  226. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  227. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  228. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  229. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  230. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  231. package/dist/v2/helpers/generate-location-id.js +10 -0
  232. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  233. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  234. package/dist/v2/helpers/get-active-environment.js +22 -0
  235. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  236. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  237. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  238. package/dist/v2/helpers/plugins.d.ts +59 -0
  239. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  240. package/dist/v2/helpers/plugins.js +11 -0
  241. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  242. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  243. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  244. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  245. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  246. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  247. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  248. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  249. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  250. package/package.json +20 -20
  251. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  252. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  254. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  255. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  256. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  257. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +0 -1
  258. package/dist/v2/features/app/components/ItemDecorator.vue.js +0 -138
  259. package/dist/v2/features/app/components/ItemDecorator.vue2.js +0 -4
  260. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  261. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  262. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  263. package/dist/v2/hooks/use-sync-path.js +0 -51
  264. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  265. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  266. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  267. package/dist/v2/plugins.d.ts +0 -44
  268. package/dist/v2/plugins.d.ts.map +0 -1
  269. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  270. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  271. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
@@ -1,29 +1,30 @@
1
- import { defineComponent as W, useAttrs as j, ref as d, computed as s, toRef as r, watch as H, createElementBlock as i, openBlock as o, Fragment as Q, createBlock as m, createCommentVNode as f, normalizeClass as G, createElementVNode as w, toDisplayString as J, mergeProps as X, unref as T, withKeys as b, withModifiers as D, createTextVNode as V, renderSlot as $ } from "vue";
2
- import { useCodeMirror as Y, useDropdown as Z, colorPicker as _ } from "@scalar/use-codemirror";
3
- import { nanoid as ee } from "nanoid";
1
+ import { defineComponent as W, useAttrs as j, ref as d, computed as s, toRef as r, watch as H, createElementBlock as i, openBlock as o, Fragment as Q, createBlock as c, createCommentVNode as f, normalizeClass as G, createElementVNode as w, toDisplayString as J, mergeProps as X, unref as F, withKeys as b, withModifiers as T, createTextVNode as V, renderSlot as $ } from "vue";
2
+ import { isDefined as Y } from "@scalar/helpers/array/is-defined";
3
+ import { useCodeMirror as Z, useDropdown as _, colorPicker as ee } from "@scalar/use-codemirror";
4
+ import { nanoid as te } from "nanoid";
4
5
  import B from "../data-table/DataTableInputSelect.vue.js";
5
- import te from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
6
- import { pillPlugin as le, backspaceCommand as ne } from "./code-variable-widget.js";
7
- const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
6
+ import le from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
7
+ import { pillPlugin as ne, backspaceCommand as oe } from "./code-variable-widget.js";
8
+ const ae = { class: "whitespace-nowrap" }, re = ["id"], ie = {
8
9
  key: 0,
9
10
  class: "z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block",
10
11
  role: "alert"
11
- }, ie = {
12
+ }, ue = {
12
13
  key: 5,
13
14
  class: "centered-y text-orange absolute right-7 text-xs"
14
- }, ue = {
15
+ }, de = {
15
16
  key: 6,
16
17
  class: "centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1"
17
- }, de = {
18
+ }, se = {
18
19
  key: 7,
19
20
  class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
20
- }, se = {
21
+ }, fe = {
21
22
  inheritAttrs: !1
22
- }, pe = /* @__PURE__ */ W({
23
- ...se,
23
+ }, ve = /* @__PURE__ */ W({
24
+ ...fe,
24
25
  __name: "CodeInput",
25
26
  props: {
26
- modelValue: {},
27
+ modelValue: { type: [String, Number, Boolean] },
27
28
  environment: {},
28
29
  type: {},
29
30
  disabled: { type: Boolean, default: !1 },
@@ -31,7 +32,7 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
31
32
  layout: { default: "desktop" },
32
33
  enum: {},
33
34
  examples: {},
34
- default: {},
35
+ default: { type: [String, Number, Boolean] },
35
36
  nullable: { type: Boolean, default: !1 },
36
37
  placeholder: {},
37
38
  required: { type: Boolean },
@@ -53,7 +54,7 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
53
54
  },
54
55
  emits: ["update:modelValue", "submit", "blur", "curl", "redirectToEnvironment"],
55
56
  setup(t, { expose: I, emit: M }) {
56
- const u = M, k = j(), R = k.id || `id-${ee()}`, y = d(!1), q = s(() => t.enum?.length ? !1 : t.type === "boolean" || Array.isArray(t.type) && t.type.includes("boolean")), x = s(() => t.nullable ? ["true", "false", "null"] : ["true", "false"]), A = s(() => Array.isArray(t.type) ? t.type.find((e) => e !== "null") ?? "string" : t.type), C = (e) => {
57
+ const u = M, k = j(), N = k.id || `id-${te()}`, y = d(!1), R = s(() => t.enum?.length ? !1 : t.type === "boolean" || Array.isArray(t.type) && t.type.includes("boolean")), x = s(() => t.nullable ? ["true", "false", "null"] : ["true", "false"]), q = s(() => Array.isArray(t.type) ? t.type.find((e) => e !== "null") ?? "string" : t.type), C = (e) => {
57
58
  if (!(!t.alwaysEmitChange && e === t.modelValue)) {
58
59
  if (t.importCurl && e.trim().toLowerCase().startsWith("curl")) {
59
60
  u("curl", e), n.value && n.value.dispatch({
@@ -69,23 +70,23 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
69
70
  }
70
71
  }, h = (e) => {
71
72
  t.handleFieldSubmit ? t.handleFieldSubmit(e) : u("submit", e);
72
- }, E = (e) => {
73
+ }, S = (e) => {
73
74
  y.value = !1, t.emitOnBlur && t.modelValue && h(e), u("blur", e);
74
- }, p = (e) => {
75
+ }, g = (e) => {
75
76
  u("update:modelValue", e);
76
- }, N = () => {
77
+ }, A = () => {
77
78
  const e = [...t.extensions];
78
- return t.colorPicker && e.push(_), e;
79
+ return t.colorPicker && e.push(ee), e;
79
80
  }, O = s(
80
- () => le({
81
+ () => ne({
81
82
  environment: t.environment,
82
83
  isReadOnly: t.layout === "modal"
83
84
  })
84
85
  ), z = s(() => [
85
- ...N(),
86
+ ...A(),
86
87
  O.value,
87
- ne
88
- ]), S = d(null), { codeMirror: n } = Y({
88
+ oe
89
+ ]), E = d(null), { codeMirror: n } = Z({
89
90
  content: r(() => String(t.modelValue ?? "")),
90
91
  onChange: (e) => {
91
92
  C(e), L();
@@ -93,8 +94,8 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
93
94
  onFocus: () => {
94
95
  y.value = !0;
95
96
  },
96
- onBlur: E,
97
- codeMirrorRef: S,
97
+ onBlur: S,
98
+ codeMirrorRef: E,
98
99
  disableTabIndent: r(() => t.disableTabIndent),
99
100
  disableEnter: r(() => t.disableEnter),
100
101
  disableCloseBrackets: r(() => t.disableCloseBrackets),
@@ -107,13 +108,13 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
107
108
  H(n, () => {
108
109
  n.value && Object.hasOwn(k, "autofocus") && n.value.focus();
109
110
  });
110
- const g = d(!1), F = d(""), P = d({ left: 0, top: 0 }), v = d(null), { handleDropdownSelect: K, updateDropdownVisibility: L } = Z({
111
+ const p = d(!1), P = d(""), D = d({ left: 0, top: 0 }), v = d(null), { handleDropdownSelect: K, updateDropdownVisibility: L } = _({
111
112
  codeMirror: n,
112
- query: F,
113
- showDropdown: g,
114
- dropdownPosition: P
115
- }), U = s(() => g.value && t.withVariables && t.layout !== "modal" && !!t.environment), c = (e, l) => {
116
- if (g.value) {
113
+ query: P,
114
+ showDropdown: p,
115
+ dropdownPosition: D
116
+ }), U = s(() => p.value && t.withVariables && t.layout !== "modal" && !!t.environment), m = (e, l) => {
117
+ if (p.value) {
117
118
  e === "down" || e === "up" ? (l.preventDefault(), v.value?.handleArrowKey(e)) : e === "enter" && (l.preventDefault(), v.value?.handleSelect());
118
119
  return;
119
120
  }
@@ -126,9 +127,9 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
126
127
  * @param cursorAtEnd boolean place the cursor at the end of the input
127
128
  */
128
129
  focus: (e) => {
129
- if (!n.value || (n.value.focus(), !e))
130
+ if (!n.value || (n.value.focus(), !Y(e)))
130
131
  return;
131
- const l = n.value.state.doc.length;
132
+ const l = e === "start" ? 0 : e === "end" ? n.value.state.doc.length : e;
132
133
  n.value.dispatch({
133
134
  selection: { anchor: l },
134
135
  scrollIntoView: !0
@@ -137,81 +138,82 @@ const oe = { class: "whitespace-nowrap" }, ae = ["id"], re = {
137
138
  isFocused: y,
138
139
  handleChange: C,
139
140
  handleSubmit: h,
140
- handleBlur: E,
141
+ handleBlur: S,
141
142
  booleanOptions: x,
142
143
  codeMirror: n,
143
- modelValue: t.modelValue
144
+ modelValue: t.modelValue,
145
+ cursorPosition: () => n.value?.state.selection.main.head
144
146
  }), (e, l) => (o(), i(Q, null, [
145
147
  e.disabled ? (o(), i("div", {
146
148
  key: 0,
147
149
  class: G(["text-c-2 flex cursor-default items-center justify-center", e.layout === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
148
150
  "data-testid": "code-input-disabled"
149
151
  }, [
150
- w("span", oe, J(e.modelValue), 1)
151
- ], 2)) : t.enum?.length ? (o(), m(B, {
152
+ w("span", ae, J(e.modelValue), 1)
153
+ ], 2)) : t.enum?.length ? (o(), c(B, {
152
154
  key: 1,
153
155
  default: t.default,
154
156
  modelValue: e.modelValue,
155
- type: A.value,
157
+ type: q.value,
156
158
  value: t.enum,
157
- "onUpdate:modelValue": p
158
- }, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (o(), m(B, {
159
+ "onUpdate:modelValue": g
160
+ }, null, 8, ["default", "modelValue", "type", "value"])) : R.value ? (o(), c(B, {
159
161
  key: 2,
160
162
  default: t.default,
161
163
  modelValue: e.modelValue,
162
164
  value: x.value,
163
- "onUpdate:modelValue": p
164
- }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (o(), m(B, {
165
+ "onUpdate:modelValue": g
166
+ }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (o(), c(B, {
165
167
  key: 3,
166
168
  default: t.default,
167
169
  modelValue: e.modelValue,
168
170
  value: e.examples,
169
- "onUpdate:modelValue": p
171
+ "onUpdate:modelValue": g
170
172
  }, null, 8, ["default", "modelValue", "value"])) : (o(), i("div", X({
171
173
  key: 4,
172
- id: T(R)
174
+ id: F(N)
173
175
  }, e.$attrs, {
174
176
  ref_key: "codeMirrorRef",
175
- ref: S,
177
+ ref: E,
176
178
  class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
177
179
  "line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1": e.lineWrapping,
178
180
  "flow-code-input--error": e.error
179
181
  }],
180
182
  onKeydown: [
181
- l[0] || (l[0] = b(D((a) => c("down", a), ["stop"]), ["down"])),
182
- l[1] || (l[1] = b((a) => c("enter", a), ["enter"])),
183
- l[2] || (l[2] = b((a) => c("escape", a), ["escape"])),
184
- l[3] || (l[3] = b(D((a) => c("up", a), ["stop"]), ["up"]))
183
+ l[0] || (l[0] = b(T((a) => m("down", a), ["stop"]), ["down"])),
184
+ l[1] || (l[1] = b((a) => m("enter", a), ["enter"])),
185
+ l[2] || (l[2] = b((a) => m("escape", a), ["escape"])),
186
+ l[3] || (l[3] = b(T((a) => m("up", a), ["stop"]), ["up"]))
185
187
  ]
186
188
  }), [
187
- e.disableTabIndent ? f("", !0) : (o(), i("div", re, [...l[5] || (l[5] = [
189
+ e.disableTabIndent ? f("", !0) : (o(), i("div", ie, [...l[5] || (l[5] = [
188
190
  V(" Press ", -1),
189
191
  w("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
190
192
  V(" then ", -1),
191
193
  w("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
192
194
  V(" to exit ", -1)
193
195
  ])]))
194
- ], 16, ae)),
195
- e.$slots.warning ? (o(), i("div", ie, [
196
+ ], 16, re)),
197
+ e.$slots.warning ? (o(), i("div", ue, [
196
198
  $(e.$slots, "warning", {}, void 0, !0)
197
199
  ])) : f("", !0),
198
- e.$slots.icon ? (o(), i("div", ue, [
200
+ e.$slots.icon ? (o(), i("div", de, [
199
201
  $(e.$slots, "icon", {}, void 0, !0)
200
202
  ])) : f("", !0),
201
- e.required ? (o(), i("div", de, " Required ")) : f("", !0),
202
- U.value && e.environment ? (o(), m(te, {
203
+ e.required ? (o(), i("div", se, " Required ")) : f("", !0),
204
+ U.value && e.environment ? (o(), c(le, {
203
205
  key: 8,
204
206
  ref_key: "dropdownRef",
205
207
  ref: v,
206
- dropdownPosition: P.value,
208
+ dropdownPosition: D.value,
207
209
  environment: e.environment,
208
- query: F.value,
210
+ query: P.value,
209
211
  onRedirect: l[4] || (l[4] = (a) => u("redirectToEnvironment")),
210
- onSelect: T(K)
212
+ onSelect: F(K)
211
213
  }, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : f("", !0)
212
214
  ], 64));
213
215
  }
214
216
  });
215
217
  export {
216
- pe as default
218
+ ve as default
217
219
  };
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
- modelValue: string | number;
2
+ modelValue: string | number | boolean;
3
3
  value?: string[];
4
- default?: string | number | undefined;
4
+ default?: string | number | boolean | undefined;
5
5
  canAddCustomValue?: boolean;
6
6
  type?: string | undefined;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInputSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"names":[],"mappings":"AA4LA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAC;;;;;;uBAFoB,OAAO;;AA2Z/B,wBAQG"}
1
+ {"version":3,"file":"DataTableInputSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableInputSelect.vue"],"names":[],"mappings":"AA4LA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACrC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAC;;;;;;uBAFoB,OAAO;;AA2Z/B,wBAQG"}
@@ -1,18 +1,18 @@
1
- import { defineComponent as T, computed as m, ref as V, watch as S, nextTick as E, createElementBlock as f, openBlock as o, createBlock as v, withDirectives as K, unref as a, withCtx as s, createVNode as n, createElementVNode as i, toDisplayString as y, withKeys as M, vModelText as R, createCommentVNode as C, Fragment as _, renderList as U, normalizeClass as $ } from "vue";
2
- import { ScalarComboboxMultiselect as F, ScalarButton as b, ScalarIcon as h, ScalarDropdown as L, ScalarDropdownItem as D, ScalarDropdownDivider as W } from "@scalar/components";
1
+ import { defineComponent as T, computed as m, ref as y, watch as k, nextTick as E, createElementBlock as f, openBlock as o, createBlock as v, withDirectives as K, unref as a, withCtx as n, createVNode as s, createElementVNode as i, toDisplayString as V, withKeys as M, vModelText as R, createCommentVNode as C, Fragment as _, renderList as U, normalizeClass as $ } from "vue";
2
+ import { ScalarComboboxMultiselect as F, ScalarButton as b, ScalarIcon as h, ScalarDropdown as L, ScalarDropdownItem as B, ScalarDropdownDivider as W } from "@scalar/components";
3
3
  const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline" }, G = { class: "text-c-1 whitespace-nowrap" }, H = { class: "text-c-1 overflow-hidden text-ellipsis" }, J = { class: "overflow-hidden text-ellipsis" }, P = { class: "flex h-4 w-4 items-center justify-center" }, Z = /* @__PURE__ */ T({
4
4
  __name: "DataTableInputSelect",
5
5
  props: {
6
- modelValue: {},
6
+ modelValue: { type: [String, Number, Boolean] },
7
7
  value: {},
8
- default: {},
8
+ default: { type: [String, Number, Boolean] },
9
9
  canAddCustomValue: { type: Boolean, default: !0 },
10
10
  type: {}
11
11
  },
12
12
  emits: ["update:modelValue"],
13
- setup(z, { emit: B }) {
14
- const u = z, c = B, p = m(() => u.value ?? []), d = V(!1), r = V(""), x = V(null);
15
- S(r, (e) => {
13
+ setup(D, { emit: z }) {
14
+ const u = D, c = z, p = m(() => u.value ?? []), d = y(!1), r = y(""), x = y(null);
15
+ k(r, (e) => {
16
16
  c("update:modelValue", e);
17
17
  });
18
18
  const g = (e) => {
@@ -21,40 +21,40 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
21
21
  r.value.trim() && g(r.value);
22
22
  }, A = () => {
23
23
  r.value.trim() || c("update:modelValue", ""), d.value = !1;
24
- }, I = (e) => u.modelValue.toString() === e;
25
- S(d, (e) => {
24
+ }, N = (e) => u.modelValue.toString() === e;
25
+ k(d, (e) => {
26
26
  e && E(() => {
27
27
  x.value?.focus();
28
28
  });
29
29
  });
30
- const k = m(() => u.modelValue !== void 0 ? u.modelValue : u.default), w = m(() => {
30
+ const S = m(() => u.modelValue !== void 0 ? u.modelValue : u.default), w = m(() => {
31
31
  const e = new Set(u.modelValue.toString().split(", "));
32
- return p.value.filter((l) => e.has(l)).map((l) => ({ id: l, label: l, value: l }));
33
- }), N = m(
32
+ return p.value.filter((t) => e.has(t)).map((t) => ({ id: t, label: t, value: t }));
33
+ }), I = m(
34
34
  () => p.value.map((e) => ({ id: e, label: e, value: e }))
35
35
  ), O = (e) => {
36
- const l = e.map((t) => t.value);
37
- c("update:modelValue", l.join(", "));
36
+ const t = e.map((l) => l.value);
37
+ c("update:modelValue", t.join(", "));
38
38
  };
39
- return (e, l) => (o(), f("div", q, [
39
+ return (e, t) => (o(), f("div", q, [
40
40
  e.type === "array" ? (o(), v(a(F), {
41
41
  key: 0,
42
42
  modelValue: w.value,
43
- options: N.value,
43
+ options: I.value,
44
44
  "onUpdate:modelValue": O
45
45
  }, {
46
- default: s(() => [
47
- n(a(b), {
46
+ default: n(() => [
47
+ s(a(b), {
48
48
  class: "custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none",
49
49
  fullWidth: "",
50
50
  variant: "ghost"
51
51
  }, {
52
- default: s(() => [
53
- i("span", G, y(w.value.length > 0 ? w.value.map((t) => t.label).join(", ") : "Select a value"), 1),
54
- n(a(h), {
52
+ default: n(() => [
53
+ i("span", G, V(w.value.length > 0 ? w.value.map((l) => l.label).join(", ") : "Select a value"), 1),
54
+ s(a(h), {
55
+ class: "min-w-4",
55
56
  icon: "ChevronDown",
56
- size: "md",
57
- class: "min-w-4"
57
+ size: "md"
58
58
  })
59
59
  ]),
60
60
  _: 1
@@ -65,7 +65,7 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
65
65
  key: 1,
66
66
  ref_key: "inputRef",
67
67
  ref: x,
68
- "onUpdate:modelValue": l[0] || (l[0] = (t) => r.value = t),
68
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => r.value = l),
69
69
  class: "text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none",
70
70
  placeholder: "Value",
71
71
  type: "text",
@@ -76,59 +76,59 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
76
76
  ]) : (o(), v(a(L), {
77
77
  key: 2,
78
78
  resize: "",
79
- value: k.value
79
+ value: S.value
80
80
  }, {
81
- items: s(() => [
82
- (o(!0), f(_, null, U(p.value, (t) => (o(), v(a(D), {
83
- key: t,
81
+ items: n(() => [
82
+ (o(!0), f(_, null, U(p.value, (l) => (o(), v(a(B), {
83
+ key: l,
84
84
  class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
85
- value: t,
86
- onClick: (Q) => g(t)
85
+ value: l,
86
+ onClick: (Q) => g(l)
87
87
  }, {
88
- default: s(() => [
88
+ default: n(() => [
89
89
  i("div", {
90
90
  class: $([
91
91
  "flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
92
- I(t) ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
92
+ N(l) ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
93
93
  ])
94
94
  }, [
95
- n(a(h), {
95
+ s(a(h), {
96
96
  class: "size-2.5",
97
97
  icon: "Checkmark",
98
98
  thickness: "3"
99
99
  })
100
100
  ], 2),
101
- i("span", J, y(t), 1)
101
+ i("span", J, V(l), 1)
102
102
  ]),
103
103
  _: 2
104
104
  }, 1032, ["value", "onClick"]))), 128)),
105
105
  e.canAddCustomValue ? (o(), f(_, { key: 0 }, [
106
106
  p.value.length ? (o(), v(a(W), { key: 0 })) : C("", !0),
107
- n(a(D), {
107
+ s(a(B), {
108
108
  class: "flex items-center gap-1.5",
109
- onClick: l[1] || (l[1] = (t) => d.value = !0)
109
+ onClick: t[1] || (t[1] = (l) => d.value = !0)
110
110
  }, {
111
- default: s(() => [
111
+ default: n(() => [
112
112
  i("div", P, [
113
- n(a(h), {
113
+ s(a(h), {
114
114
  icon: "Add",
115
115
  size: "sm"
116
116
  })
117
117
  ]),
118
- l[2] || (l[2] = i("span", null, "Add value", -1))
118
+ t[2] || (t[2] = i("span", null, "Add value", -1))
119
119
  ]),
120
120
  _: 1
121
121
  })
122
122
  ], 64)) : C("", !0)
123
123
  ]),
124
- default: s(() => [
125
- n(a(b), {
124
+ default: n(() => [
125
+ s(a(b), {
126
126
  class: "size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none",
127
127
  variant: "ghost"
128
128
  }, {
129
- default: s(() => [
130
- i("span", H, y(k.value || "Select a value"), 1),
131
- n(a(h), {
129
+ default: n(() => [
130
+ i("span", H, V(S.value ?? "Select a value"), 1),
131
+ s(a(h), {
132
132
  icon: "ChevronDown",
133
133
  size: "md"
134
134
  })
@@ -1,3 +1,2 @@
1
- /** biome-ignore-all lint/performance/noBarrelFile: Component entry point */
2
1
  export { default as Resize } from './Resize.vue.js';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/resize/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/resize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA"}
@@ -2,7 +2,7 @@ import { type DraggingItem, type HoveredItem, type SidebarState } from '@scalar/
2
2
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
3
  import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
4
4
  import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
5
- import type { Workspace } from '../../../v2/hooks/use-workspace-selector.js';
5
+ import type { Workspace } from '../../../v2/features/app/hooks/use-workspace-selector.js';
6
6
  import type { ClientLayout } from '../../../v2/types/layout';
7
7
  type __VLS_Props = {
8
8
  /** All documents to display sidebar items for */
@@ -33,15 +33,16 @@ type __VLS_Slots = {
33
33
  }): unknown;
34
34
  /** Slot to add additional content to the footer */
35
35
  footer?(): unknown;
36
+ /** Slot to add additional content to the empty folder */
37
+ empty?(props: {
38
+ item: TraversedEntry;
39
+ }): unknown;
36
40
  };
37
41
  type __VLS_PublicProps = __VLS_Props & {
38
- /** Controls the visibility of the sidebar */
39
- 'isSidebarOpen': boolean;
40
42
  /** Controls the width of the sidebar */
41
43
  'sidebarWidth': number;
42
44
  };
43
45
  declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
- "update:isSidebarOpen": (value: boolean) => any;
45
46
  "update:sidebarWidth": (value: number) => any;
46
47
  } & {
47
48
  "create:workspace": () => any;
@@ -53,7 +54,6 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
53
54
  "onSelect:workspace"?: ((id?: string | undefined) => any) | undefined;
54
55
  onSelectItem?: ((id: string) => any) | undefined;
55
56
  onReorder?: ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => any) | undefined;
56
- "onUpdate:isSidebarOpen"?: ((value: boolean) => any) | undefined;
57
57
  "onUpdate:sidebarWidth"?: ((value: number) => any) | undefined;
58
58
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
59
59
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"AAqJA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAKhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,4BAA4B;IAC5B,MAAM,EAAE,YAAY,CAAA;IACpB,qCAAqC;IACrC,eAAe,EAAE,SAAS,CAAA;IAC1B,2CAA2C;IAC3C,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,kEAAkE;IAClE,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,+CAA+C;IAC/C,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EACR,OAAO,GACP,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,CAAA;CACxE,CAAC;AAeF,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,eAAe,CAAC,IAAI,OAAO,CAAA;IAC3B,sDAAsD;IACtD,SAAS,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAA;IACpD,mDAAmD;IACnD,MAAM,CAAC,IAAI,OAAO,CAAA;CACnB,CAAC;AAsBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAmNF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"AAyJA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAIhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,4BAA4B;IAC5B,MAAM,EAAE,YAAY,CAAA;IACpB,qCAAqC;IACrC,eAAe,EAAE,SAAS,CAAA;IAC1B,2CAA2C;IAC3C,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,kEAAkE;IAClE,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,+CAA+C;IAC/C,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EACR,OAAO,GACP,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,CAAA;CACxE,CAAC;AAeF,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,eAAe,CAAC,IAAI,OAAO,CAAA;IAC3B,sDAAsD;IACtD,SAAS,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAA;IACpD,mDAAmD;IACnD,MAAM,CAAC,IAAI,OAAO,CAAA;IAClB,yDAAyD;IACzD,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAA;CACjD,CAAC;AAiBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAqNF,QAAA,MAAM,eAAe;;;;;;;;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,14 +1,13 @@
1
- import { defineComponent as w, mergeModels as f, useModel as b, ref as y, createBlock as r, openBlock as s, unref as a, withCtx as i, createVNode as B, renderSlot as n, normalizeProps as W, guardReactiveProps as $, createElementVNode as k, createCommentVNode as p } from "vue";
2
- import { ScalarIconButton as V } from "@scalar/components";
3
- import { ScalarIconMagnifyingGlass as g } from "@scalar/icons";
4
- import { ScalarSidebar as C } from "@scalar/sidebar";
5
- import I from "./SidebarMenu.vue.js";
6
- import M from "./SidebarToggle.vue.js";
7
- import O from "../resize/Resize.vue.js";
8
- import D from "../../features/search/components/SearchButton.vue.js";
9
- const E = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, z = { class: "flex items-center justify-between" }, G = /* @__PURE__ */ w({
1
+ import { defineComponent as y, mergeModels as u, useSlots as g, ref as B, useModel as W, createBlock as l, openBlock as r, unref as a, withCtx as s, createVNode as $, createSlots as D, renderSlot as d, normalizeProps as c, guardReactiveProps as f, createElementVNode as b, createCommentVNode as p, createElementBlock as C } from "vue";
2
+ import { ScalarIconButton as E } from "@scalar/components";
3
+ import { ScalarIconMagnifyingGlass as I } from "@scalar/icons";
4
+ import { ScalarSidebar as h } from "@scalar/sidebar";
5
+ import M from "./SidebarMenu.vue.js";
6
+ import V from "../resize/Resize.vue.js";
7
+ import z from "../../features/search/components/SearchButton.vue.js";
8
+ const N = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, R = { class: "flex items-center justify-between" }, P = { key: 1 }, J = /* @__PURE__ */ y({
10
9
  __name: "Sidebar",
11
- props: /* @__PURE__ */ f({
10
+ props: /* @__PURE__ */ u({
12
11
  sidebarState: {},
13
12
  layout: {},
14
13
  activeWorkspace: {},
@@ -17,78 +16,81 @@ const E = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, z =
17
16
  documents: {},
18
17
  isDroppable: { type: [Boolean, Function] }
19
18
  }, {
20
- isSidebarOpen: { type: Boolean, required: !0 },
21
- isSidebarOpenModifiers: {},
22
19
  sidebarWidth: {
23
20
  required: !0,
24
21
  default: 288
25
22
  },
26
23
  sidebarWidthModifiers: {}
27
24
  }),
28
- emits: /* @__PURE__ */ f(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:isSidebarOpen", "update:sidebarWidth"]),
29
- setup(u, { emit: S }) {
30
- const l = S, m = b(u, "isSidebarOpen"), d = y(!1), c = b(u, "sidebarWidth");
31
- return (e, o) => (s(), r(a(O), {
32
- width: c.value,
33
- "onUpdate:width": o[6] || (o[6] = (t) => c.value = t),
25
+ emits: /* @__PURE__ */ u(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
26
+ setup(k, { emit: v }) {
27
+ const i = v, w = g(), n = B(!1), m = W(k, "sidebarWidth");
28
+ return (e, o) => (r(), l(a(V), {
29
+ width: m.value,
30
+ "onUpdate:width": o[5] || (o[5] = (t) => m.value = t),
34
31
  class: "flex flex-col"
35
32
  }, {
36
- default: i(() => [
37
- B(a(C), {
33
+ default: s(() => [
34
+ $(a(h), {
38
35
  class: "flex w-auto flex-1 pt-2",
39
36
  indent: 15,
37
+ isDraggable: e.layout !== "modal",
40
38
  isDroppable: e.isDroppable,
41
39
  isExpanded: e.sidebarState.isExpanded,
42
40
  isSelected: e.sidebarState.isSelected,
43
41
  items: e.sidebarState.items.value,
44
42
  layout: "client",
45
- onReorder: o[4] || (o[4] = (t, v) => l("reorder", t, v)),
46
- onSelectItem: o[5] || (o[5] = (t) => l("selectItem", t))
47
- }, {
48
- header: i(() => [
49
- k("div", E, [
50
- k("div", z, [
51
- e.layout === "desktop" ? (s(), r(I, {
43
+ onReorder: o[3] || (o[3] = (t, S) => i("reorder", t, S)),
44
+ onSelectItem: o[4] || (o[4] = (t) => i("selectItem", t))
45
+ }, D({
46
+ header: s(() => [
47
+ b("div", N, [
48
+ b("div", R, [
49
+ e.layout === "desktop" ? (r(), l(M, {
52
50
  key: 0,
53
51
  activeWorkspace: e.activeWorkspace,
54
52
  workspaces: e.workspaces,
55
- "onCreate:workspace": o[0] || (o[0] = (t) => l("create:workspace")),
56
- "onSelect:workspace": o[1] || (o[1] = (t) => l("select:workspace", t))
57
- }, null, 8, ["activeWorkspace", "workspaces"])) : e.layout === "modal" ? (s(), r(M, {
58
- key: 1,
59
- modelValue: m.value,
60
- "onUpdate:modelValue": o[2] || (o[2] = (t) => m.value = t)
61
- }, null, 8, ["modelValue"])) : p("", !0),
62
- e.layout !== "web" ? (s(), r(a(V), {
53
+ "onCreate:workspace": o[0] || (o[0] = (t) => i("create:workspace")),
54
+ "onSelect:workspace": o[1] || (o[1] = (t) => i("select:workspace", t))
55
+ }, null, 8, ["activeWorkspace", "workspaces"])) : e.layout === "modal" ? (r(), C("div", P)) : p("", !0),
56
+ e.layout !== "web" ? (r(), l(a(E), {
63
57
  key: 2,
64
- icon: a(g),
58
+ icon: a(I),
65
59
  label: "Search",
66
- onClick: o[3] || (o[3] = (t) => d.value = !d.value)
60
+ onClick: o[2] || (o[2] = (t) => n.value = !n.value)
67
61
  }, null, 8, ["icon"])) : p("", !0)
68
62
  ]),
69
- d.value || e.layout === "web" ? (s(), r(a(D), {
63
+ n.value || e.layout === "web" ? (r(), l(a(z), {
70
64
  key: 0,
71
65
  documents: e.documents,
72
66
  eventBus: e.eventBus
73
67
  }, null, 8, ["documents", "eventBus"])) : p("", !0)
74
68
  ])
75
69
  ]),
76
- decorator: i((t) => [
77
- n(e.$slots, "decorator", W($(t)))
70
+ decorator: s((t) => [
71
+ d(e.$slots, "decorator", c(f(t)))
78
72
  ]),
79
- before: i(() => [
80
- n(e.$slots, "workspaceButton")
73
+ before: s(() => [
74
+ d(e.$slots, "workspaceButton")
81
75
  ]),
82
- footer: i(() => [
83
- n(e.$slots, "footer")
76
+ footer: s(() => [
77
+ d(e.$slots, "footer")
84
78
  ]),
85
- _: 3
86
- }, 8, ["isDroppable", "isExpanded", "isSelected", "items"])
79
+ _: 2
80
+ }, [
81
+ w.empty ? {
82
+ name: "empty",
83
+ fn: s((t) => [
84
+ d(e.$slots, "empty", c(f(t)))
85
+ ]),
86
+ key: "0"
87
+ } : void 0
88
+ ]), 1032, ["isDraggable", "isDroppable", "isExpanded", "isSelected", "items"])
87
89
  ]),
88
90
  _: 3
89
91
  }, 8, ["width"]));
90
92
  }
91
93
  });
92
94
  export {
93
- G as default
95
+ J as default
94
96
  };