@scalar/api-client 3.19.2 → 3.20.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 (409) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  3. package/dist/components/SectionFilter.vue.d.ts +2 -0
  4. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  5. package/dist/components/SectionFilter.vue.js +1 -1
  6. package/dist/components/SectionFilter.vue.js.map +1 -1
  7. package/dist/components/SectionFilter.vue.script.js +11 -8
  8. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  9. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
  10. package/dist/components/Server/ServerVariablesSelect.vue.js.map +1 -1
  11. package/dist/components/Server/ServerVariablesSelect.vue.script.js +5 -3
  12. package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
  13. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
  14. package/dist/components/Server/ServerVariablesTextbox.vue.js.map +1 -1
  15. package/dist/components/Server/ServerVariablesTextbox.vue.script.js +6 -3
  16. package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
  17. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  18. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js.map +1 -1
  19. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +4 -2
  20. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
  21. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js.map +1 -1
  23. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +3 -1
  24. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
  25. package/dist/style.css +159 -135
  26. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +10 -1
  27. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  29. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +46 -5
  30. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  31. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -0
  32. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  33. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  34. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  35. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +15 -8
  36. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  37. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
  39. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js.map +1 -1
  40. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +4 -2
  41. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
  42. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  43. package/dist/v2/blocks/operation-block/helpers/send-request.js +4 -3
  44. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  45. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
  46. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  48. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  49. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +51 -26
  50. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  51. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  52. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  53. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  54. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +28 -8
  55. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  56. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  57. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  58. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +9 -3
  59. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  60. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.d.ts.map +1 -1
  61. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -1
  62. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +6 -4
  63. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
  64. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  65. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  66. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +3 -1
  67. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  68. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
  70. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +7 -5
  71. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
  73. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  75. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +40 -7
  77. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +12 -12
  79. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  81. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +24 -20
  82. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  83. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  84. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  85. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +6 -4
  86. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  87. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
  88. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +1 -1
  89. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  90. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  91. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +5 -4
  92. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  93. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -0
  94. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  95. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  96. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  97. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +37 -13
  98. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  99. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts +3 -3
  100. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  101. package/dist/v2/blocks/response-block/components/Headers.vue.js.map +1 -1
  102. package/dist/v2/blocks/response-block/components/Headers.vue.script.js +5 -3
  103. package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
  104. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  106. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  107. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +3 -1
  108. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  109. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js.map +1 -1
  111. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +11 -3
  112. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
  113. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
  114. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
  115. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
  116. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +8 -6
  117. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
  118. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts +1 -0
  119. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  120. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js.map +1 -1
  121. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +109 -56
  122. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
  123. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.d.ts.map +1 -1
  124. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js.map +1 -1
  125. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +5 -3
  126. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
  127. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  128. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js.map +1 -1
  129. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +6 -3
  130. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
  131. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  132. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
  133. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +7 -5
  134. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
  135. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +4 -2
  136. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  137. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  138. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
  139. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +22 -14
  140. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
  141. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  142. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
  143. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
  144. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +4 -2
  145. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
  146. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  147. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js.map +1 -1
  148. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +11 -6
  149. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
  150. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts +4 -0
  151. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts.map +1 -0
  152. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js +100 -0
  153. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js.map +1 -0
  154. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts +13 -0
  155. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts.map +1 -0
  156. package/dist/v2/blocks/response-block/helpers/response-stream.js +97 -0
  157. package/dist/v2/blocks/response-block/helpers/response-stream.js.map +1 -0
  158. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +3 -1
  159. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  160. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  161. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  162. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +42 -29
  163. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  164. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +6 -6
  165. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  166. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  167. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  168. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +7 -4
  169. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  170. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  171. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  172. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +21 -16
  173. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  174. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  175. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  176. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +7 -5
  177. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  178. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  179. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js.map +1 -1
  180. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +7 -5
  181. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
  182. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  183. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  184. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +105 -40
  185. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  186. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  187. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
  188. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +10 -8
  189. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
  190. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  191. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  192. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +14 -9
  193. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  194. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
  195. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  196. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +6 -4
  197. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  198. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  199. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  200. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +3 -1
  201. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  202. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  203. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  204. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +40 -40
  205. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  206. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +108 -7
  207. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  208. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +12 -0
  209. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  210. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  211. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -1
  212. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +8 -5
  213. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  214. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +2 -0
  215. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  216. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +2 -0
  217. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  218. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts +3 -0
  219. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts.map +1 -0
  220. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js +8 -0
  221. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js.map +1 -0
  222. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts +3 -0
  223. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts.map +1 -0
  224. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js +11 -0
  225. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js.map +1 -0
  226. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts +19 -0
  227. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -0
  228. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +117 -0
  229. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -0
  230. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -1
  231. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  232. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +15 -11
  233. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  234. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts +1 -1
  235. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts.map +1 -1
  236. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +8 -1
  237. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js.map +1 -1
  238. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -1
  239. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +6 -0
  240. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  241. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -1
  242. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  243. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +8 -6
  244. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  245. package/dist/v2/components/code-input/CodeInput.vue.d.ts +4 -4
  246. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  247. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  248. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  249. package/dist/v2/components/code-input/CodeInput.vue.script.js +10 -10
  250. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  251. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts +4 -4
  252. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  253. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  254. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  255. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +8 -5
  256. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  257. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts +4 -0
  258. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts.map +1 -1
  259. package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
  260. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +7 -3
  261. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
  262. package/dist/v2/components/code-input/code-variable-widget.d.ts +3 -0
  263. package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -1
  264. package/dist/v2/components/code-input/code-variable-widget.js +6 -3
  265. package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
  266. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +0 -1
  267. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  268. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  269. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +4 -2
  270. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
  271. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  272. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  273. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  274. package/dist/v2/components/data-table/DataTableInput.vue.script.js +5 -3
  275. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  276. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  277. package/dist/v2/components/data-table/DataTableInputSelect.vue.js.map +1 -1
  278. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +12 -9
  279. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
  280. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  281. package/dist/v2/components/forms/ConfirmationForm.vue.js.map +1 -1
  282. package/dist/v2/components/forms/ConfirmationForm.vue.script.js +5 -3
  283. package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
  284. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
  285. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  286. package/dist/v2/components/layout/CollapsibleSection.vue.script.js +3 -1
  287. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  288. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
  289. package/dist/v2/components/modals/DeleteModal.vue.js.map +1 -1
  290. package/dist/v2/components/modals/DeleteModal.vue.script.js +3 -1
  291. package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
  292. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  293. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  294. package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
  295. package/dist/v2/components/modals/ModalClientContainer.vue.script.js +5 -2
  296. package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
  297. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  298. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  299. package/dist/v2/components/server/ServerDropdown.vue.script.js +9 -5
  300. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  301. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  302. package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
  303. package/dist/v2/components/sidebar/Sidebar.vue.script.js +4 -2
  304. package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
  305. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  306. package/dist/v2/components/sidebar/SidebarMenu.vue.js.map +1 -1
  307. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +4 -2
  308. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
  309. package/dist/v2/components/sidebar/SidebarToggle.vue.d.ts.map +1 -1
  310. package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
  311. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +4 -2
  312. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
  313. package/dist/v2/constants.js +1 -1
  314. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -1
  315. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js.map +1 -1
  316. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +4 -2
  317. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
  318. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +2 -2
  319. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  320. package/dist/v2/features/environments/EnvironmentsList.vue.js.map +1 -1
  321. package/dist/v2/features/environments/EnvironmentsList.vue.script.js +4 -2
  322. package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
  323. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  324. package/dist/v2/features/environments/components/Environment.vue.js.map +1 -1
  325. package/dist/v2/features/environments/components/Environment.vue.script.js +12 -10
  326. package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
  327. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  328. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js.map +1 -1
  329. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +5 -3
  330. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
  331. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  332. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js.map +1 -1
  333. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +9 -6
  334. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
  335. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  336. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  337. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +6 -4
  338. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  339. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  340. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
  341. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
  342. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +22 -10
  343. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
  344. package/dist/v2/features/localization/index.d.ts +18 -0
  345. package/dist/v2/features/localization/index.d.ts.map +1 -0
  346. package/dist/v2/features/localization/index.js +35 -0
  347. package/dist/v2/features/localization/index.js.map +1 -0
  348. package/dist/v2/features/localization/locales/ar.d.ts +385 -0
  349. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -0
  350. package/dist/v2/features/localization/locales/ar.js +345 -0
  351. package/dist/v2/features/localization/locales/ar.js.map +1 -0
  352. package/dist/v2/features/localization/locales/de.d.ts +385 -0
  353. package/dist/v2/features/localization/locales/de.d.ts.map +1 -0
  354. package/dist/v2/features/localization/locales/de.js +345 -0
  355. package/dist/v2/features/localization/locales/de.js.map +1 -0
  356. package/dist/v2/features/localization/locales/es.d.ts +385 -0
  357. package/dist/v2/features/localization/locales/es.d.ts.map +1 -0
  358. package/dist/v2/features/localization/locales/es.js +345 -0
  359. package/dist/v2/features/localization/locales/es.js.map +1 -0
  360. package/dist/v2/features/localization/locales/fr.d.ts +385 -0
  361. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -0
  362. package/dist/v2/features/localization/locales/fr.js +345 -0
  363. package/dist/v2/features/localization/locales/fr.js.map +1 -0
  364. package/dist/v2/features/localization/locales/pt.d.ts +385 -0
  365. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -0
  366. package/dist/v2/features/localization/locales/pt.js +345 -0
  367. package/dist/v2/features/localization/locales/pt.js.map +1 -0
  368. package/dist/v2/features/localization/locales/ru.d.ts +385 -0
  369. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -0
  370. package/dist/v2/features/localization/locales/ru.js +345 -0
  371. package/dist/v2/features/localization/locales/ru.js.map +1 -0
  372. package/dist/v2/features/localization/locales/zh-cn.d.ts +385 -0
  373. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -0
  374. package/dist/v2/features/localization/locales/zh-cn.js +345 -0
  375. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -0
  376. package/dist/v2/features/localization/translations.d.ts +385 -0
  377. package/dist/v2/features/localization/translations.d.ts.map +1 -0
  378. package/dist/v2/features/localization/translations.js +345 -0
  379. package/dist/v2/features/localization/translations.js.map +1 -0
  380. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  381. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  382. package/dist/v2/features/modal/Modal.vue.script.js +17 -4
  383. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  384. package/dist/v2/features/modal/use-lazy-api-client.d.ts +11 -0
  385. package/dist/v2/features/modal/use-lazy-api-client.d.ts.map +1 -0
  386. package/dist/v2/features/modal/use-lazy-api-client.js +48 -0
  387. package/dist/v2/features/modal/use-lazy-api-client.js.map +1 -0
  388. package/dist/v2/features/operation/Operation.vue.d.ts +2 -0
  389. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  390. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  391. package/dist/v2/features/operation/Operation.vue.script.js +50 -12
  392. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  393. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
  394. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  395. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  396. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +12 -8
  397. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  398. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
  399. package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -1
  400. package/dist/v2/features/search/components/SearchResult.vue.script.js +14 -10
  401. package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
  402. package/dist/v2/types/options.d.ts +1 -1
  403. package/dist/v2/types/options.d.ts.map +1 -1
  404. package/dist/v2/workspace-events.d.ts +2 -2
  405. package/dist/v2/workspace-events.d.ts.map +1 -1
  406. package/dist/v2/workspace-events.js +8 -1
  407. package/dist/v2/workspace-events.js.map +1 -1
  408. package/dist/vue-styles.css +124 -125
  409. package/package.json +22 -11
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContainer.vue.script.js","names":["$attrs"],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nconst props = defineProps<{ modalState: ModalState }>()\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n aria-label=\"API Client\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":";;;;;;;;;;;EAOA,MAAM,QAAQ;EACd,MAAM,OAAO;EAKb,MAAM,SAAS,IAAwB,IAAI;EAE3C,MAAM,EAAE,UAAU,mBAAmB,YAAY,wBAC/C,aAAa,QAAQ;GACnB,mBAAmB;GACnB,qBAAqB,OAAO;EAC9B,CAAC;EAGH,oBAAoB,2BAA2B,CAAC;EAGhD,YACQ,MAAM,WAAW,MACvB,OAAO,SAAS;GACd,IAAI,MAAM;IACR,MAAM,SAAS;IACf,kBAAkB;IAClB,KAAK,MAAM;GACb,OAAO;IACL,oBAAoB;IACpB,KAAK,OAAO;GACd;EACF,GACA,EAAE,WAAW,MAAM,CACrB;EAGA,sBAAsB;GACpB,oBAAoB;EACtB,CAAC;;uBAIC,mBAsBM,OAtBN,YAsBM,CArBJ,mBAoBM,OAAA,EAnBJ,OAAK,eAAA,CAAC,oBAAkB,EAAA,uBACS,QAAA,WAAW,KAAI,CAAA,CAAA,EAAA,GAAA,CAChD,mBAWM,OAXN,WAWM;aAVA;IAAJ,KAAI;IACJ,cAAW;IACX,cAAW;MACHA,KAAAA,QAAM;IACd,OAAM;IACN,MAAK;IACL,UAAS;QACT,YAEqB,MAAA,kBAAA,GAAA,MAAA;2BADX,CAAR,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA;;aAKZ,mBAE+B,OAAA;IAD7B,OAAM;IACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,WAAW,KAAI"}
1
+ {"version":3,"file":"ModalClientContainer.vue.script.js","names":["$attrs"],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport type { ModalState } from '@scalar/components/modal'\nimport { ScalarTeleportRoot } from '@scalar/components/teleport'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst props = defineProps<{ modalState: ModalState }>()\n\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n :aria-label=\"translate('apiClient.modalClientContainer.label')\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAKb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,SAAS,IAAwB,IAAI;EAE3C,MAAM,EAAE,UAAU,mBAAmB,YAAY,wBAC/C,aAAa,QAAQ;GACnB,mBAAmB;GACnB,qBAAqB,OAAO;EAC9B,CAAC;EAGH,oBAAoB,2BAA2B,CAAC;EAGhD,YACQ,MAAM,WAAW,MACvB,OAAO,SAAS;GACd,IAAI,MAAM;IACR,MAAM,SAAS;IACf,kBAAkB;IAClB,KAAK,MAAM;GACb,OAAO;IACL,oBAAoB;IACpB,KAAK,OAAO;GACd;EACF,GACA,EAAE,WAAW,MAAM,CACrB;EAGA,sBAAsB;GACpB,oBAAoB;EACtB,CAAC;;uBAIC,mBAsBM,OAtBN,YAsBM,CArBJ,mBAoBM,OAAA,EAnBJ,OAAK,eAAA,CAAC,oBAAkB,EAAA,uBACS,QAAA,WAAW,KAAI,CAAA,CAAA,EAAA,GAAA,CAChD,mBAWM,OAXN,WAWM;aAVA;IAAJ,KAAI;IACH,cAAY,MAAA,SAAA,CAAS,CAAA,sCAAA;IACtB,cAAW;MACHA,KAAAA,QAAM;IACd,OAAM;IACN,MAAK;IACL,UAAS;QACT,YAEqB,MAAA,kBAAA,GAAA,MAAA;2BADX,CAAR,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA;;yBAKZ,mBAE+B,OAAA;IAD7B,OAAM;IACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,WAAW,KAAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"names":[],"mappings":"AA+IA,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD;;;GAGG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAMzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,0CAA0C;IAC1C,IAAI,EAAE,UAAU,CAAA;IAChB,0EAA0E;IAC1E,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;CACrB,CAAA;AACD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;kFAqSd,CAAC"}
1
+ {"version":3,"file":"ServerDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD;;;GAGG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAMzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,0CAA0C;IAC1C,IAAI,EAAE,UAAU,CAAA;IAChB,0EAA0E;IAC1E,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;CACrB,CAAA;AACD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;kFAkTd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDropdown.vue.js","names":[],"sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * ServerDropdown component\n * This component is used to display the server dropdown for the operation block\n */\nexport default {\n name: 'ServerDropdown',\n}\n\nexport type ServerDropdownProps = {\n /** The meta information for the server */\n meta: ServerMeta\n /** List of servers that are available for the operation/document level */\n servers: ServerObject[]\n /** Currently selected server */\n server: ServerObject | null\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n /** Client layout */\n layout: ClientLayout\n}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarFloatingBackdrop } from '@scalar/components/floating'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconPencilSimple, ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n ServerMeta,\n} from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ValueEmitter from '@/v2/components/layout/ValueEmitter.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport ServerDropdownItem from './ServerDropdownItem.vue'\n\nconst { target, server, servers, meta } = defineProps<ServerDropdownProps>()\n\nconst emit = defineEmits<{\n /** Update a server variable for the selected server */\n (\n e: 'update:selectedServer',\n payload: ApiReferenceEvents['server:update:selected'],\n ): void\n (\n e: 'update:variable',\n payload: ApiReferenceEvents['server:update:variables'],\n ): void\n (e: 'update:servers'): void\n /** Update the open state of the server dropdown */\n (e: 'update:open', value: boolean): void\n}>()\n\nconst requestServerOptions = computed(() =>\n servers.map((s) => ({\n id: s.url,\n // Prefer the server name (OpenAPI 3.2) as a friendly label, falling back to the URL\n label: s.name || s.url || 'Unknown server',\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(() => {\n if (server?.url?.endsWith('/')) {\n return server.url.slice(0, -1)\n }\n return server?.url || ''\n})\n</script>\n<template>\n <ScalarPopover\n class=\"max-h-[inherit] p-0 text-base\"\n focus\n :offset=\"0\"\n placement=\"bottom\"\n resize\n :target=\"target\"\n :teleport=\"`#${target}`\">\n <ScalarButton\n class=\"hover:bg-b-2 font-code text-c-2 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap @3xl:ml-0.75\"\n variant=\"ghost\">\n <template v-if=\"server\">\n <span class=\"sr-only\">Server:</span>\n {{ serverUrlWithoutTrailingSlash }}\n </template>\n <template v-else>\n <span class=\"sr-only\">Add Server</span>\n <ScalarIconPlus class=\"size-3\" />\n </template>\n </ScalarButton>\n\n <template #popover=\"{ close }\">\n <div\n class=\"custom-scroll flex max-h-[inherit] flex-col gap-1 p-1\"\n @click=\"close\">\n <!-- Request -->\n <ServerDropdownItem\n v-for=\"(serverOption, index) in requestServerOptions\"\n :key=\"serverOption.id\"\n :server=\"server\"\n :serverOption=\"serverOption\"\n type=\"request\"\n @update:selectedServer=\"\n emit('update:selectedServer', { url: serverOption.id, meta })\n \"\n @update:variable=\"\n (key, value) => emit('update:variable', { index, key, value, meta })\n \" />\n\n <!-- Add Server -->\n <template v-if=\"layout !== 'modal'\">\n <button\n class=\"text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75\"\n type=\"button\"\n @click=\"emit('update:servers')\">\n <div class=\"flex items-center justify-center\">\n <ScalarIconPencilSimple class=\"size-4\" />\n </div>\n <span>Update Servers</span>\n </button>\n </template>\n </div>\n </template>\n <template #backdrop=\"{ open }\">\n <!-- Emit the slot value back out the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:open', value)\"\n @unmount=\"emit('update:open', false)\" />\n\n <ScalarFloatingBackdrop class=\"inset-x-px rounded-none rounded-b-lg\" />\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ServerDropdown.vue.js","names":[],"sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * ServerDropdown component\n * This component is used to display the server dropdown for the operation block\n */\nexport default {\n name: 'ServerDropdown',\n}\n\nexport type ServerDropdownProps = {\n /** The meta information for the server */\n meta: ServerMeta\n /** List of servers that are available for the operation/document level */\n servers: ServerObject[]\n /** Currently selected server */\n server: ServerObject | null\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n /** Client layout */\n layout: ClientLayout\n}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarFloatingBackdrop } from '@scalar/components/floating'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconPencilSimple, ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n ServerMeta,\n} from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ValueEmitter from '@/v2/components/layout/ValueEmitter.vue'\nimport { useLocalization } from '@/v2/features/localization'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport ServerDropdownItem from './ServerDropdownItem.vue'\n\nconst { target, server, servers, meta } = defineProps<ServerDropdownProps>()\n\nconst emit = defineEmits<{\n /** Update a server variable for the selected server */\n (\n e: 'update:selectedServer',\n payload: ApiReferenceEvents['server:update:selected'],\n ): void\n (\n e: 'update:variable',\n payload: ApiReferenceEvents['server:update:variables'],\n ): void\n (e: 'update:servers'): void\n /** Update the open state of the server dropdown */\n (e: 'update:open', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst requestServerOptions = computed(() =>\n servers.map((s) => ({\n id: s.url,\n // Prefer the server name (OpenAPI 3.2) as a friendly label, falling back to the URL\n label:\n s.name || s.url || translate('apiClient.serverDropdown.unknownServer'),\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(() => {\n if (server?.url?.endsWith('/')) {\n return server.url.slice(0, -1)\n }\n return server?.url || ''\n})\n</script>\n<template>\n <ScalarPopover\n class=\"max-h-[inherit] p-0 text-base\"\n focus\n :offset=\"0\"\n placement=\"bottom\"\n resize\n :target=\"target\"\n :teleport=\"`#${target}`\">\n <ScalarButton\n class=\"hover:bg-b-2 font-code text-c-2 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap @3xl:ml-0.75\"\n variant=\"ghost\">\n <template v-if=\"server\">\n <span class=\"sr-only\">{{\n translate('apiClient.serverDropdown.server')\n }}</span>\n {{ serverUrlWithoutTrailingSlash }}\n </template>\n <template v-else>\n <span class=\"sr-only\">{{\n translate('apiClient.serverDropdown.addServer')\n }}</span>\n <ScalarIconPlus class=\"size-3\" />\n </template>\n </ScalarButton>\n\n <template #popover=\"{ close }\">\n <div\n class=\"custom-scroll flex max-h-[inherit] flex-col gap-1 p-1\"\n @click=\"close\">\n <!-- Request -->\n <ServerDropdownItem\n v-for=\"(serverOption, index) in requestServerOptions\"\n :key=\"serverOption.id\"\n :server=\"server\"\n :serverOption=\"serverOption\"\n type=\"request\"\n @update:selectedServer=\"\n emit('update:selectedServer', { url: serverOption.id, meta })\n \"\n @update:variable=\"\n (key, value) => emit('update:variable', { index, key, value, meta })\n \" />\n\n <!-- Add Server -->\n <template v-if=\"layout !== 'modal'\">\n <button\n class=\"text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75\"\n type=\"button\"\n @click=\"emit('update:servers')\">\n <div class=\"flex items-center justify-center\">\n <ScalarIconPencilSimple class=\"size-4\" />\n </div>\n <span>{{\n translate('apiClient.serverDropdown.updateServers')\n }}</span>\n </button>\n </template>\n </div>\n </template>\n <template #backdrop=\"{ open }\">\n <!-- Emit the slot value back out the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:open', value)\"\n @unmount=\"emit('update:open', false)\" />\n\n <ScalarFloatingBackdrop class=\"inset-x-px rounded-none rounded-b-lg\" />\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import ValueEmitter_default from "../layout/ValueEmitter.vue.js";
2
3
  import ServerDropdownItem_default from "./ServerDropdownItem.vue.js";
3
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
@@ -6,8 +7,10 @@ import { ScalarIconPencilSimple, ScalarIconPlus } from "@scalar/icons";
6
7
  import { ScalarPopover } from "@scalar/components/popover";
7
8
  import { ScalarFloatingBackdrop } from "@scalar/components/floating";
8
9
  //#region src/v2/components/server/ServerDropdown.vue?vue&type=script&setup=true&lang.ts
9
- var _hoisted_1 = ["onClick"];
10
- var _hoisted_2 = { class: "flex items-center justify-center" };
10
+ var _hoisted_1 = { class: "sr-only" };
11
+ var _hoisted_2 = { class: "sr-only" };
12
+ var _hoisted_3 = ["onClick"];
13
+ var _hoisted_4 = { class: "flex items-center justify-center" };
11
14
  var ServerDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
12
15
  name: "ServerDropdown",
13
16
  props: {
@@ -25,9 +28,10 @@ var ServerDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
25
28
  ],
26
29
  setup(__props, { emit: __emit }) {
27
30
  const emit = __emit;
31
+ const { translate } = useLocalization();
28
32
  const requestServerOptions = computed(() => __props.servers.map((s) => ({
29
33
  id: s.url,
30
- label: s.name || s.url || "Unknown server"
34
+ label: s.name || s.url || translate("apiClient.serverDropdown.unknownServer")
31
35
  })));
32
36
  const serverUrlWithoutTrailingSlash = computed(() => {
33
37
  if (__props.server?.url?.endsWith("/")) return __props.server.url.slice(0, -1);
@@ -73,7 +77,7 @@ var ServerDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
73
77
  class: "text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75",
74
78
  type: "button",
75
79
  onClick: _cache[0] || (_cache[0] = ($event) => emit("update:servers"))
76
- }, [createElementVNode("div", _hoisted_2, [createVNode(unref(ScalarIconPencilSimple), { class: "size-4" })]), _cache[5] || (_cache[5] = createElementVNode("span", null, "Update Servers", -1))])) : createCommentVNode("", true)], 8, _hoisted_1)]),
80
+ }, [createElementVNode("div", _hoisted_4, [createVNode(unref(ScalarIconPencilSimple), { class: "size-4" })]), createElementVNode("span", null, toDisplayString(unref(translate)("apiClient.serverDropdown.updateServers")), 1)])) : createCommentVNode("", true)], 8, _hoisted_3)]),
77
81
  backdrop: withCtx(({ open }) => [createVNode(ValueEmitter_default, {
78
82
  value: open,
79
83
  onChange: _cache[1] || (_cache[1] = (value) => emit("update:open", value)),
@@ -83,7 +87,7 @@ var ServerDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
83
87
  class: "hover:bg-b-2 font-code text-c-2 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap @3xl:ml-0.75",
84
88
  variant: "ghost"
85
89
  }, {
86
- default: withCtx(() => [__props.server ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[3] || (_cache[3] = createElementVNode("span", { class: "sr-only" }, "Server:", -1)), createTextVNode(" " + toDisplayString(serverUrlWithoutTrailingSlash.value), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[4] || (_cache[4] = createElementVNode("span", { class: "sr-only" }, "Add Server", -1)), createVNode(unref(ScalarIconPlus), { class: "size-3" })], 64))]),
90
+ default: withCtx(() => [__props.server ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_1, toDisplayString(unref(translate)("apiClient.serverDropdown.server")), 1), createTextVNode(" " + toDisplayString(serverUrlWithoutTrailingSlash.value), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_2, toDisplayString(unref(translate)("apiClient.serverDropdown.addServer")), 1), createVNode(unref(ScalarIconPlus), { class: "size-3" })], 64))]),
87
91
  _: 1
88
92
  })]),
89
93
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDropdown.vue.script.js","names":[],"sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * ServerDropdown component\n * This component is used to display the server dropdown for the operation block\n */\nexport default {\n name: 'ServerDropdown',\n}\n\nexport type ServerDropdownProps = {\n /** The meta information for the server */\n meta: ServerMeta\n /** List of servers that are available for the operation/document level */\n servers: ServerObject[]\n /** Currently selected server */\n server: ServerObject | null\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n /** Client layout */\n layout: ClientLayout\n}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarFloatingBackdrop } from '@scalar/components/floating'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconPencilSimple, ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n ServerMeta,\n} from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ValueEmitter from '@/v2/components/layout/ValueEmitter.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport ServerDropdownItem from './ServerDropdownItem.vue'\n\nconst { target, server, servers, meta } = defineProps<ServerDropdownProps>()\n\nconst emit = defineEmits<{\n /** Update a server variable for the selected server */\n (\n e: 'update:selectedServer',\n payload: ApiReferenceEvents['server:update:selected'],\n ): void\n (\n e: 'update:variable',\n payload: ApiReferenceEvents['server:update:variables'],\n ): void\n (e: 'update:servers'): void\n /** Update the open state of the server dropdown */\n (e: 'update:open', value: boolean): void\n}>()\n\nconst requestServerOptions = computed(() =>\n servers.map((s) => ({\n id: s.url,\n // Prefer the server name (OpenAPI 3.2) as a friendly label, falling back to the URL\n label: s.name || s.url || 'Unknown server',\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(() => {\n if (server?.url?.endsWith('/')) {\n return server.url.slice(0, -1)\n }\n return server?.url || ''\n})\n</script>\n<template>\n <ScalarPopover\n class=\"max-h-[inherit] p-0 text-base\"\n focus\n :offset=\"0\"\n placement=\"bottom\"\n resize\n :target=\"target\"\n :teleport=\"`#${target}`\">\n <ScalarButton\n class=\"hover:bg-b-2 font-code text-c-2 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap @3xl:ml-0.75\"\n variant=\"ghost\">\n <template v-if=\"server\">\n <span class=\"sr-only\">Server:</span>\n {{ serverUrlWithoutTrailingSlash }}\n </template>\n <template v-else>\n <span class=\"sr-only\">Add Server</span>\n <ScalarIconPlus class=\"size-3\" />\n </template>\n </ScalarButton>\n\n <template #popover=\"{ close }\">\n <div\n class=\"custom-scroll flex max-h-[inherit] flex-col gap-1 p-1\"\n @click=\"close\">\n <!-- Request -->\n <ServerDropdownItem\n v-for=\"(serverOption, index) in requestServerOptions\"\n :key=\"serverOption.id\"\n :server=\"server\"\n :serverOption=\"serverOption\"\n type=\"request\"\n @update:selectedServer=\"\n emit('update:selectedServer', { url: serverOption.id, meta })\n \"\n @update:variable=\"\n (key, value) => emit('update:variable', { index, key, value, meta })\n \" />\n\n <!-- Add Server -->\n <template v-if=\"layout !== 'modal'\">\n <button\n class=\"text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75\"\n type=\"button\"\n @click=\"emit('update:servers')\">\n <div class=\"flex items-center justify-center\">\n <ScalarIconPencilSimple class=\"size-4\" />\n </div>\n <span>Update Servers</span>\n </button>\n </template>\n </div>\n </template>\n <template #backdrop=\"{ open }\">\n <!-- Emit the slot value back out the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:open', value)\"\n @unmount=\"emit('update:open', false)\" />\n\n <ScalarFloatingBackdrop class=\"inset-x-px rounded-none rounded-b-lg\" />\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":";;;;;;;;;;;CAME,MAAM;;;;;;;;;;;;;;;EAmCR,MAAM,OAAO;EAeb,MAAM,uBAAuB,eAC3B,QAAA,QAAQ,KAAK,OAAO;GAClB,IAAI,EAAE;GAEN,OAAO,EAAE,QAAQ,EAAE,OAAO;EAC5B,EAAE,CACJ;EAEA,MAAM,gCAAgC,eAAe;GACnD,IAAI,QAAA,QAAQ,KAAK,SAAS,GAAG,GAC3B,OAAO,QAAA,OAAO,IAAI,MAAM,GAAG,EAAE;GAE/B,OAAO,QAAA,QAAQ,OAAO;EACxB,CAAC;;uBAGC,YA8DgB,MAAA,aAAA,GAAA;IA7Dd,OAAM;IACN,OAAA;IACC,QAAQ;IACT,WAAU;IACV,QAAA;IACC,QAAQ,QAAA;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EAA9B,OAAM,UAAS,GAAC,WAAO,EAAA,IAAA,gBAAO,MACpC,gBAAG,8BAAA,KAA6B,GAAA,CAAA,CAAA,GAAA,EAAA,MAAA,UAAA,GAElC,mBAGW,UAAA,EAAA,KAAA,EAAA,GAAA,CAAA,OAAA,OAAA,OAAA,KAFT,mBAAuC,QAAA,EAAjC,OAAM,UAAS,GAAC,cAAU,EAAA,IAChC,YAAiC,MAAA,cAAA,GAAA,EAAjB,OAAM,SAAQ,CAAA,CAAA,GAAA,EAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"ServerDropdown.vue.script.js","names":[],"sources":["../../../../src/v2/components/server/ServerDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * ServerDropdown component\n * This component is used to display the server dropdown for the operation block\n */\nexport default {\n name: 'ServerDropdown',\n}\n\nexport type ServerDropdownProps = {\n /** The meta information for the server */\n meta: ServerMeta\n /** List of servers that are available for the operation/document level */\n servers: ServerObject[]\n /** Currently selected server */\n server: ServerObject | null\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n /** Client layout */\n layout: ClientLayout\n}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarFloatingBackdrop } from '@scalar/components/floating'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconPencilSimple, ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n ServerMeta,\n} from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ValueEmitter from '@/v2/components/layout/ValueEmitter.vue'\nimport { useLocalization } from '@/v2/features/localization'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport ServerDropdownItem from './ServerDropdownItem.vue'\n\nconst { target, server, servers, meta } = defineProps<ServerDropdownProps>()\n\nconst emit = defineEmits<{\n /** Update a server variable for the selected server */\n (\n e: 'update:selectedServer',\n payload: ApiReferenceEvents['server:update:selected'],\n ): void\n (\n e: 'update:variable',\n payload: ApiReferenceEvents['server:update:variables'],\n ): void\n (e: 'update:servers'): void\n /** Update the open state of the server dropdown */\n (e: 'update:open', value: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst requestServerOptions = computed(() =>\n servers.map((s) => ({\n id: s.url,\n // Prefer the server name (OpenAPI 3.2) as a friendly label, falling back to the URL\n label:\n s.name || s.url || translate('apiClient.serverDropdown.unknownServer'),\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(() => {\n if (server?.url?.endsWith('/')) {\n return server.url.slice(0, -1)\n }\n return server?.url || ''\n})\n</script>\n<template>\n <ScalarPopover\n class=\"max-h-[inherit] p-0 text-base\"\n focus\n :offset=\"0\"\n placement=\"bottom\"\n resize\n :target=\"target\"\n :teleport=\"`#${target}`\">\n <ScalarButton\n class=\"hover:bg-b-2 font-code text-c-2 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap @3xl:ml-0.75\"\n variant=\"ghost\">\n <template v-if=\"server\">\n <span class=\"sr-only\">{{\n translate('apiClient.serverDropdown.server')\n }}</span>\n {{ serverUrlWithoutTrailingSlash }}\n </template>\n <template v-else>\n <span class=\"sr-only\">{{\n translate('apiClient.serverDropdown.addServer')\n }}</span>\n <ScalarIconPlus class=\"size-3\" />\n </template>\n </ScalarButton>\n\n <template #popover=\"{ close }\">\n <div\n class=\"custom-scroll flex max-h-[inherit] flex-col gap-1 p-1\"\n @click=\"close\">\n <!-- Request -->\n <ServerDropdownItem\n v-for=\"(serverOption, index) in requestServerOptions\"\n :key=\"serverOption.id\"\n :server=\"server\"\n :serverOption=\"serverOption\"\n type=\"request\"\n @update:selectedServer=\"\n emit('update:selectedServer', { url: serverOption.id, meta })\n \"\n @update:variable=\"\n (key, value) => emit('update:variable', { index, key, value, meta })\n \" />\n\n <!-- Add Server -->\n <template v-if=\"layout !== 'modal'\">\n <button\n class=\"text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75\"\n type=\"button\"\n @click=\"emit('update:servers')\">\n <div class=\"flex items-center justify-center\">\n <ScalarIconPencilSimple class=\"size-4\" />\n </div>\n <span>{{\n translate('apiClient.serverDropdown.updateServers')\n }}</span>\n </button>\n </template>\n </div>\n </template>\n <template #backdrop=\"{ open }\">\n <!-- Emit the slot value back out the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emit('update:open', value)\"\n @unmount=\"emit('update:open', false)\" />\n\n <ScalarFloatingBackdrop class=\"inset-x-px rounded-none rounded-b-lg\" />\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":";;;;;;;;;;;;;;CAME,MAAM;;;;;;;;;;;;;;;EAoCR,MAAM,OAAO;EAeb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,uBAAuB,eAC3B,QAAA,QAAQ,KAAK,OAAO;GAClB,IAAI,EAAE;GAEN,OACE,EAAE,QAAQ,EAAE,OAAO,UAAU,wCAAwC;EACzE,EAAE,CACJ;EAEA,MAAM,gCAAgC,eAAe;GACnD,IAAI,QAAA,QAAQ,KAAK,SAAS,GAAG,GAC3B,OAAO,QAAA,OAAO,IAAI,MAAM,GAAG,EAAE;GAE/B,OAAO,QAAA,QAAQ,OAAO;EACxB,CAAC;;uBAGC,YAoEgB,MAAA,aAAA,GAAA;IAnEd,OAAM;IACN,OAAA;IACC,QAAQ;IACT,WAAU;IACV,QAAA;IACC,QAAQ,QAAA;IACR,UAAQ,IAAM,QAAA;;IAkBJ,SAAO,SAgCV,EAhCc,YAAK,CACzB,mBA+BM,OAAA;KA9BJ,OAAM;KACL,SAAO;0BAER,mBAWM,UAAA,MAAA,WAV4B,qBAAA,QAAxB,cAAc,UAAK;yBAD7B,YAWM,4BAAA;MATH,KAAK,aAAa;MAClB,QAAQ,QAAA;MACM;MACf,MAAK;MACJ,4BAAqB,WAAe,KAAI,yBAAA;OAAA,KAAiC,aAAa;OAAE,MAAE,QAAA;MAAI,CAAA;MAG9F,sBAA+B,KAAK,UA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@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport type { WorkspaceGroup } from '@scalar/components/menu'\nimport { ScalarSidebarSearchInput } from '@scalar/components/sidebar'\nimport { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n ScalarSidebar,\n type DraggingItem,\n type HoveredItem,\n type SidebarState,\n} from '@scalar/sidebar'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { Resize } from '@/v2/components/resize'\nimport { useSearchIndex } from '@/v2/features/search'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport SidebarMenu from './SidebarMenu.vue'\n\nconst { documents, sidebarState, layout } = defineProps<{\n /** All documents to display sidebar items for */\n sidebarState: SidebarState<TraversedEntry>\n /** Layout for the client */\n layout: ClientLayout\n /** The currently active workspace */\n activeWorkspace: { id: string }\n /** The list of all available workspaces */\n workspaces: WorkspaceGroup[]\n /** The documents belonging to the workspace */\n documents: WorkspaceDocument[]\n /**\n * Prevents sidebar items from being hovered and dropped into. Can be either a function or a boolean\n *\n * @default true\n */\n isDroppable?:\n | boolean\n | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean)\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an item is selected */\n (e: 'selectItem', id: string): void\n /** Emitted when a workspace is selected by optional ID */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when sidebar items are reordered via drag and drop */\n (e: 'reorder', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst slots = defineSlots<{\n /** Slot to add the workspace button */\n workspaceButton?(): unknown\n /** Slot to add additional content to the decorator */\n decorator?(props: { item: TraversedEntry }): unknown\n /** Slot to add additional content to the footer */\n footer?(): unknown\n /** Slot to add additional content to the empty folder */\n empty?(props: { item: TraversedEntry }): unknown\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n /** Slot to add additional content to the icon */\n icon?(props: { item: TraversedEntry; open: boolean }): unknown\n}>()\n\n/** Controls the visibility of the search input */\nconst isSearchVisible = ref(false)\n\n/** Controls the width of the sidebar */\nconst sidebarWidth = defineModel<number>('sidebarWidth', {\n required: true,\n default: 288,\n})\n\nconst isDraft = (item: TraversedEntry) => {\n return item.type === 'example' && item.title === 'draft'\n}\n\n/** We handle search results out here so we can show them in the sidebar */\nconst { query, results } = useSearchIndex(() =>\n documents.filter(isOpenApiDocument),\n)\n\n/** We show either the search results or the sidebar items */\nconst items = computed(() => results.value ?? sidebarState.items.value)\n\n/** Select an item and clear the search query */\nconst handleSelectItem = (id: string) => {\n emit('selectItem', id)\n query.value = ''\n isSearchVisible.value = false\n}\n</script>\n<template>\n <Resize\n v-model:width=\"sidebarWidth\"\n class=\"flex flex-col\">\n <template #default>\n <ScalarSidebar\n class=\"flex w-auto flex-1\"\n :indent=\"20\"\n :isDraggable=\"layout !== 'modal'\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items\n layout=\"client\"\n :options=\"{ hideOperationDefaultExamples: layout === 'modal' }\"\n @reorder=\"\n (draggingItem, hoveredItem) =>\n emit('reorder', draggingItem, hoveredItem)\n \"\n @selectItem=\"handleSelectItem\">\n <template #header>\n <!-- drag region (macos) -->\n <div class=\"mac:h-12 mac:app-drag-region h-2\"></div>\n <div\n class=\"bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5\"\n :class=\"{\n 'max-md:pt-12': layout === 'desktop',\n 'max-md:pt-2 max-md:pl-4!': layout === 'modal',\n 'pt-1 max-md:pt-2 max-md:pl-14': layout === 'web',\n }\">\n <div\n v-if=\"layout !== 'web'\"\n class=\"flex items-center justify-between\"\n :class=\"{ 'max-md:pl-10': layout === 'desktop' }\">\n <!-- Desktop gets the workspace menu here -->\n <SidebarMenu\n v-if=\"layout !== 'modal'\"\n :activeWorkspace=\"activeWorkspace\"\n :workspaces=\"workspaces\"\n @create:workspace=\"emit('create:workspace')\"\n @navigate:to:settings=\"emit('navigate:to:settings')\"\n @select:workspace=\"(id) => emit('select:workspace', id)\">\n <template #sidebarMenuActions>\n <slot name=\"sidebarMenuActions\" />\n </template>\n </SidebarMenu>\n\n <!-- Placeholder for the sidebar toggle in modal layout -->\n <div v-else-if=\"layout === 'modal'\"></div>\n\n <!-- Toggle search, always visible on web -->\n <ScalarIconButton\n class=\"hover:bg-b-2 active:text-c-1 size-8 rounded p-2\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n size=\"sm\"\n @click=\"isSearchVisible = !isSearchVisible\" />\n </div>\n\n <ScalarSidebarSearchInput\n v-if=\"isSearchVisible || layout === 'web'\"\n v-model=\"query\"\n :autofocus=\"layout !== 'web'\" />\n </div>\n </template>\n\n <template #spacer>\n <div class=\"flex-1\"></div>\n </template>\n\n <template\n v-if=\"slots.decorator\"\n #decorator=\"decoratorProps\">\n <slot\n v-bind=\"decoratorProps\"\n name=\"decorator\" />\n </template>\n\n <template #icon=\"iconProps\">\n <template v-if=\"slots.icon || isDraft(iconProps.item)\">\n <ScalarIconFileDashed v-if=\"isDraft(iconProps.item)\" />\n <slot\n v-bind=\"iconProps\"\n name=\"icon\" />\n </template>\n </template>\n\n <!-- Empty folder slot -->\n <template\n v-if=\"slots.empty\"\n #empty=\"emptyProps\">\n <slot\n v-bind=\"emptyProps\"\n name=\"empty\" />\n </template>\n\n <template #before>\n <slot name=\"workspaceButton\" />\n </template>\n\n <template #footer>\n <slot name=\"footer\" />\n </template>\n </ScalarSidebar>\n </template>\n </Resize>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Sidebar.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport type { WorkspaceGroup } from '@scalar/components/menu'\nimport { ScalarSidebarSearchInput } from '@scalar/components/sidebar'\nimport { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n ScalarSidebar,\n type DraggingItem,\n type HoveredItem,\n type SidebarState,\n} from '@scalar/sidebar'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { Resize } from '@/v2/components/resize'\nimport { useLocalization } from '@/v2/features/localization'\nimport { useSearchIndex } from '@/v2/features/search'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport SidebarMenu from './SidebarMenu.vue'\n\nconst { documents, sidebarState, layout } = defineProps<{\n /** All documents to display sidebar items for */\n sidebarState: SidebarState<TraversedEntry>\n /** Layout for the client */\n layout: ClientLayout\n /** The currently active workspace */\n activeWorkspace: { id: string }\n /** The list of all available workspaces */\n workspaces: WorkspaceGroup[]\n /** The documents belonging to the workspace */\n documents: WorkspaceDocument[]\n /**\n * Prevents sidebar items from being hovered and dropped into. Can be either a function or a boolean\n *\n * @default true\n */\n isDroppable?:\n | boolean\n | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean)\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an item is selected */\n (e: 'selectItem', id: string): void\n /** Emitted when a workspace is selected by optional ID */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when sidebar items are reordered via drag and drop */\n (e: 'reorder', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst slots = defineSlots<{\n /** Slot to add the workspace button */\n workspaceButton?(): unknown\n /** Slot to add additional content to the decorator */\n decorator?(props: { item: TraversedEntry }): unknown\n /** Slot to add additional content to the footer */\n footer?(): unknown\n /** Slot to add additional content to the empty folder */\n empty?(props: { item: TraversedEntry }): unknown\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n /** Slot to add additional content to the icon */\n icon?(props: { item: TraversedEntry; open: boolean }): unknown\n}>()\n\n/** Controls the visibility of the search input */\nconst isSearchVisible = ref(false)\n\n/** Controls the width of the sidebar */\nconst sidebarWidth = defineModel<number>('sidebarWidth', {\n required: true,\n default: 288,\n})\n\nconst isDraft = (item: TraversedEntry) => {\n return item.type === 'example' && item.title === 'draft'\n}\n\n/** We handle search results out here so we can show them in the sidebar */\nconst { query, results } = useSearchIndex(() =>\n documents.filter(isOpenApiDocument),\n)\n\n/** We show either the search results or the sidebar items */\nconst items = computed(() => results.value ?? sidebarState.items.value)\n\n/** Select an item and clear the search query */\nconst handleSelectItem = (id: string) => {\n emit('selectItem', id)\n query.value = ''\n isSearchVisible.value = false\n}\n</script>\n<template>\n <Resize\n v-model:width=\"sidebarWidth\"\n class=\"flex flex-col\">\n <template #default>\n <ScalarSidebar\n class=\"flex w-auto flex-1\"\n :indent=\"20\"\n :isDraggable=\"layout !== 'modal'\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items\n layout=\"client\"\n :options=\"{ hideOperationDefaultExamples: layout === 'modal' }\"\n @reorder=\"\n (draggingItem, hoveredItem) =>\n emit('reorder', draggingItem, hoveredItem)\n \"\n @selectItem=\"handleSelectItem\">\n <template #header>\n <!-- drag region (macos) -->\n <div class=\"mac:h-12 mac:app-drag-region h-2\"></div>\n <div\n class=\"bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5\"\n :class=\"{\n 'max-md:pt-12': layout === 'desktop',\n 'max-md:pt-2 max-md:pl-4!': layout === 'modal',\n 'pt-1 max-md:pt-2 max-md:pl-14': layout === 'web',\n }\">\n <div\n v-if=\"layout !== 'web'\"\n class=\"flex items-center justify-between\"\n :class=\"{ 'max-md:pl-10': layout === 'desktop' }\">\n <!-- Desktop gets the workspace menu here -->\n <SidebarMenu\n v-if=\"layout !== 'modal'\"\n :activeWorkspace=\"activeWorkspace\"\n :workspaces=\"workspaces\"\n @create:workspace=\"emit('create:workspace')\"\n @navigate:to:settings=\"emit('navigate:to:settings')\"\n @select:workspace=\"(id) => emit('select:workspace', id)\">\n <template #sidebarMenuActions>\n <slot name=\"sidebarMenuActions\" />\n </template>\n </SidebarMenu>\n\n <!-- Placeholder for the sidebar toggle in modal layout -->\n <div v-else-if=\"layout === 'modal'\"></div>\n\n <!-- Toggle search, always visible on web -->\n <ScalarIconButton\n class=\"hover:bg-b-2 active:text-c-1 size-8 rounded p-2\"\n :icon=\"ScalarIconMagnifyingGlass\"\n :label=\"translate('apiClient.sidebar.search')\"\n size=\"sm\"\n @click=\"isSearchVisible = !isSearchVisible\" />\n </div>\n\n <ScalarSidebarSearchInput\n v-if=\"isSearchVisible || layout === 'web'\"\n v-model=\"query\"\n :autofocus=\"layout !== 'web'\" />\n </div>\n </template>\n\n <template #spacer>\n <div class=\"flex-1\"></div>\n </template>\n\n <template\n v-if=\"slots.decorator\"\n #decorator=\"decoratorProps\">\n <slot\n v-bind=\"decoratorProps\"\n name=\"decorator\" />\n </template>\n\n <template #icon=\"iconProps\">\n <template v-if=\"slots.icon || isDraft(iconProps.item)\">\n <ScalarIconFileDashed v-if=\"isDraft(iconProps.item)\" />\n <slot\n v-bind=\"iconProps\"\n name=\"icon\" />\n </template>\n </template>\n\n <!-- Empty folder slot -->\n <template\n v-if=\"slots.empty\"\n #empty=\"emptyProps\">\n <slot\n v-bind=\"emptyProps\"\n name=\"empty\" />\n </template>\n\n <template #before>\n <slot name=\"workspaceButton\" />\n </template>\n\n <template #footer>\n <slot name=\"footer\" />\n </template>\n </ScalarSidebar>\n </template>\n </Resize>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../features/localization/index.js";
1
2
  import Resize_default from "../resize/Resize.vue.js";
2
3
  import { useSearchIndex } from "../../features/search/hooks/use-search-index.js";
3
4
  import SidebarMenu_default from "./SidebarMenu.vue.js";
@@ -34,6 +35,7 @@ var Sidebar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
34
35
  ], ["update:sidebarWidth"]),
35
36
  setup(__props, { emit: __emit }) {
36
37
  const emit = __emit;
38
+ const { translate } = useLocalization();
37
39
  const slots = useSlots();
38
40
  /** Controls the visibility of the search input */
39
41
  const isSearchVisible = ref(false);
@@ -91,10 +93,10 @@ var Sidebar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
91
93
  }, 8, ["activeWorkspace", "workspaces"])) : __props.layout === "modal" ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true), createVNode(unref(ScalarIconButton), {
92
94
  class: "hover:bg-b-2 active:text-c-1 size-8 rounded p-2",
93
95
  icon: unref(ScalarIconMagnifyingGlass),
94
- label: "Search",
96
+ label: unref(translate)("apiClient.sidebar.search"),
95
97
  size: "sm",
96
98
  onClick: _cache[3] || (_cache[3] = ($event) => isSearchVisible.value = !isSearchVisible.value)
97
- }, null, 8, ["icon"])], 2)) : createCommentVNode("", true), isSearchVisible.value || __props.layout === "web" ? (openBlock(), createBlock(unref(ScalarSidebarSearchInput), {
99
+ }, null, 8, ["icon", "label"])], 2)) : createCommentVNode("", true), isSearchVisible.value || __props.layout === "web" ? (openBlock(), createBlock(unref(ScalarSidebarSearchInput), {
98
100
  key: 1,
99
101
  modelValue: unref(query),
100
102
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(query) ? query.value = $event : null),
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport type { WorkspaceGroup } from '@scalar/components/menu'\nimport { ScalarSidebarSearchInput } from '@scalar/components/sidebar'\nimport { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n ScalarSidebar,\n type DraggingItem,\n type HoveredItem,\n type SidebarState,\n} from '@scalar/sidebar'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { Resize } from '@/v2/components/resize'\nimport { useSearchIndex } from '@/v2/features/search'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport SidebarMenu from './SidebarMenu.vue'\n\nconst { documents, sidebarState, layout } = defineProps<{\n /** All documents to display sidebar items for */\n sidebarState: SidebarState<TraversedEntry>\n /** Layout for the client */\n layout: ClientLayout\n /** The currently active workspace */\n activeWorkspace: { id: string }\n /** The list of all available workspaces */\n workspaces: WorkspaceGroup[]\n /** The documents belonging to the workspace */\n documents: WorkspaceDocument[]\n /**\n * Prevents sidebar items from being hovered and dropped into. Can be either a function or a boolean\n *\n * @default true\n */\n isDroppable?:\n | boolean\n | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean)\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an item is selected */\n (e: 'selectItem', id: string): void\n /** Emitted when a workspace is selected by optional ID */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when sidebar items are reordered via drag and drop */\n (e: 'reorder', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst slots = defineSlots<{\n /** Slot to add the workspace button */\n workspaceButton?(): unknown\n /** Slot to add additional content to the decorator */\n decorator?(props: { item: TraversedEntry }): unknown\n /** Slot to add additional content to the footer */\n footer?(): unknown\n /** Slot to add additional content to the empty folder */\n empty?(props: { item: TraversedEntry }): unknown\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n /** Slot to add additional content to the icon */\n icon?(props: { item: TraversedEntry; open: boolean }): unknown\n}>()\n\n/** Controls the visibility of the search input */\nconst isSearchVisible = ref(false)\n\n/** Controls the width of the sidebar */\nconst sidebarWidth = defineModel<number>('sidebarWidth', {\n required: true,\n default: 288,\n})\n\nconst isDraft = (item: TraversedEntry) => {\n return item.type === 'example' && item.title === 'draft'\n}\n\n/** We handle search results out here so we can show them in the sidebar */\nconst { query, results } = useSearchIndex(() =>\n documents.filter(isOpenApiDocument),\n)\n\n/** We show either the search results or the sidebar items */\nconst items = computed(() => results.value ?? sidebarState.items.value)\n\n/** Select an item and clear the search query */\nconst handleSelectItem = (id: string) => {\n emit('selectItem', id)\n query.value = ''\n isSearchVisible.value = false\n}\n</script>\n<template>\n <Resize\n v-model:width=\"sidebarWidth\"\n class=\"flex flex-col\">\n <template #default>\n <ScalarSidebar\n class=\"flex w-auto flex-1\"\n :indent=\"20\"\n :isDraggable=\"layout !== 'modal'\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items\n layout=\"client\"\n :options=\"{ hideOperationDefaultExamples: layout === 'modal' }\"\n @reorder=\"\n (draggingItem, hoveredItem) =>\n emit('reorder', draggingItem, hoveredItem)\n \"\n @selectItem=\"handleSelectItem\">\n <template #header>\n <!-- drag region (macos) -->\n <div class=\"mac:h-12 mac:app-drag-region h-2\"></div>\n <div\n class=\"bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5\"\n :class=\"{\n 'max-md:pt-12': layout === 'desktop',\n 'max-md:pt-2 max-md:pl-4!': layout === 'modal',\n 'pt-1 max-md:pt-2 max-md:pl-14': layout === 'web',\n }\">\n <div\n v-if=\"layout !== 'web'\"\n class=\"flex items-center justify-between\"\n :class=\"{ 'max-md:pl-10': layout === 'desktop' }\">\n <!-- Desktop gets the workspace menu here -->\n <SidebarMenu\n v-if=\"layout !== 'modal'\"\n :activeWorkspace=\"activeWorkspace\"\n :workspaces=\"workspaces\"\n @create:workspace=\"emit('create:workspace')\"\n @navigate:to:settings=\"emit('navigate:to:settings')\"\n @select:workspace=\"(id) => emit('select:workspace', id)\">\n <template #sidebarMenuActions>\n <slot name=\"sidebarMenuActions\" />\n </template>\n </SidebarMenu>\n\n <!-- Placeholder for the sidebar toggle in modal layout -->\n <div v-else-if=\"layout === 'modal'\"></div>\n\n <!-- Toggle search, always visible on web -->\n <ScalarIconButton\n class=\"hover:bg-b-2 active:text-c-1 size-8 rounded p-2\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n size=\"sm\"\n @click=\"isSearchVisible = !isSearchVisible\" />\n </div>\n\n <ScalarSidebarSearchInput\n v-if=\"isSearchVisible || layout === 'web'\"\n v-model=\"query\"\n :autofocus=\"layout !== 'web'\" />\n </div>\n </template>\n\n <template #spacer>\n <div class=\"flex-1\"></div>\n </template>\n\n <template\n v-if=\"slots.decorator\"\n #decorator=\"decoratorProps\">\n <slot\n v-bind=\"decoratorProps\"\n name=\"decorator\" />\n </template>\n\n <template #icon=\"iconProps\">\n <template v-if=\"slots.icon || isDraft(iconProps.item)\">\n <ScalarIconFileDashed v-if=\"isDraft(iconProps.item)\" />\n <slot\n v-bind=\"iconProps\"\n name=\"icon\" />\n </template>\n </template>\n\n <!-- Empty folder slot -->\n <template\n v-if=\"slots.empty\"\n #empty=\"emptyProps\">\n <slot\n v-bind=\"emptyProps\"\n name=\"empty\" />\n </template>\n\n <template #before>\n <slot name=\"workspaceButton\" />\n </template>\n\n <template #footer>\n <slot name=\"footer\" />\n </template>\n </ScalarSidebar>\n </template>\n </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/B,WAA+B,KAAA,QAAA,iBAAA,CAAA,CAAA;KAGtB,QAAM,cACO,CAAtB,WAAsB,KAAA,QAAA,QAAA,CAAA,CAAA;;QA9BhB,MAAM,YAAA;WACX;kBAAW,mBAAc,CAC1B,WAEqB,KAAA,QAAA,aAAA,eAAA,mBADX,cAAc,CAAA,CAAA,CAAA,CAAA;;gBAelB,MAAM,QAAA;WACX;kBAAO,eAAU,CAClB,WAEiB,KAAA,QAAA,SAAA,eAAA,mBADP,UAAU,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Sidebar.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport type { WorkspaceGroup } from '@scalar/components/menu'\nimport { ScalarSidebarSearchInput } from '@scalar/components/sidebar'\nimport { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n ScalarSidebar,\n type DraggingItem,\n type HoveredItem,\n type SidebarState,\n} from '@scalar/sidebar'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { Resize } from '@/v2/components/resize'\nimport { useLocalization } from '@/v2/features/localization'\nimport { useSearchIndex } from '@/v2/features/search'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport SidebarMenu from './SidebarMenu.vue'\n\nconst { documents, sidebarState, layout } = defineProps<{\n /** All documents to display sidebar items for */\n sidebarState: SidebarState<TraversedEntry>\n /** Layout for the client */\n layout: ClientLayout\n /** The currently active workspace */\n activeWorkspace: { id: string }\n /** The list of all available workspaces */\n workspaces: WorkspaceGroup[]\n /** The documents belonging to the workspace */\n documents: WorkspaceDocument[]\n /**\n * Prevents sidebar items from being hovered and dropped into. Can be either a function or a boolean\n *\n * @default true\n */\n isDroppable?:\n | boolean\n | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean)\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an item is selected */\n (e: 'selectItem', id: string): void\n /** Emitted when a workspace is selected by optional ID */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when sidebar items are reordered via drag and drop */\n (e: 'reorder', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst slots = defineSlots<{\n /** Slot to add the workspace button */\n workspaceButton?(): unknown\n /** Slot to add additional content to the decorator */\n decorator?(props: { item: TraversedEntry }): unknown\n /** Slot to add additional content to the footer */\n footer?(): unknown\n /** Slot to add additional content to the empty folder */\n empty?(props: { item: TraversedEntry }): unknown\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n /** Slot to add additional content to the icon */\n icon?(props: { item: TraversedEntry; open: boolean }): unknown\n}>()\n\n/** Controls the visibility of the search input */\nconst isSearchVisible = ref(false)\n\n/** Controls the width of the sidebar */\nconst sidebarWidth = defineModel<number>('sidebarWidth', {\n required: true,\n default: 288,\n})\n\nconst isDraft = (item: TraversedEntry) => {\n return item.type === 'example' && item.title === 'draft'\n}\n\n/** We handle search results out here so we can show them in the sidebar */\nconst { query, results } = useSearchIndex(() =>\n documents.filter(isOpenApiDocument),\n)\n\n/** We show either the search results or the sidebar items */\nconst items = computed(() => results.value ?? sidebarState.items.value)\n\n/** Select an item and clear the search query */\nconst handleSelectItem = (id: string) => {\n emit('selectItem', id)\n query.value = ''\n isSearchVisible.value = false\n}\n</script>\n<template>\n <Resize\n v-model:width=\"sidebarWidth\"\n class=\"flex flex-col\">\n <template #default>\n <ScalarSidebar\n class=\"flex w-auto flex-1\"\n :indent=\"20\"\n :isDraggable=\"layout !== 'modal'\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items\n layout=\"client\"\n :options=\"{ hideOperationDefaultExamples: layout === 'modal' }\"\n @reorder=\"\n (draggingItem, hoveredItem) =>\n emit('reorder', draggingItem, hoveredItem)\n \"\n @selectItem=\"handleSelectItem\">\n <template #header>\n <!-- drag region (macos) -->\n <div class=\"mac:h-12 mac:app-drag-region h-2\"></div>\n <div\n class=\"bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5\"\n :class=\"{\n 'max-md:pt-12': layout === 'desktop',\n 'max-md:pt-2 max-md:pl-4!': layout === 'modal',\n 'pt-1 max-md:pt-2 max-md:pl-14': layout === 'web',\n }\">\n <div\n v-if=\"layout !== 'web'\"\n class=\"flex items-center justify-between\"\n :class=\"{ 'max-md:pl-10': layout === 'desktop' }\">\n <!-- Desktop gets the workspace menu here -->\n <SidebarMenu\n v-if=\"layout !== 'modal'\"\n :activeWorkspace=\"activeWorkspace\"\n :workspaces=\"workspaces\"\n @create:workspace=\"emit('create:workspace')\"\n @navigate:to:settings=\"emit('navigate:to:settings')\"\n @select:workspace=\"(id) => emit('select:workspace', id)\">\n <template #sidebarMenuActions>\n <slot name=\"sidebarMenuActions\" />\n </template>\n </SidebarMenu>\n\n <!-- Placeholder for the sidebar toggle in modal layout -->\n <div v-else-if=\"layout === 'modal'\"></div>\n\n <!-- Toggle search, always visible on web -->\n <ScalarIconButton\n class=\"hover:bg-b-2 active:text-c-1 size-8 rounded p-2\"\n :icon=\"ScalarIconMagnifyingGlass\"\n :label=\"translate('apiClient.sidebar.search')\"\n size=\"sm\"\n @click=\"isSearchVisible = !isSearchVisible\" />\n </div>\n\n <ScalarSidebarSearchInput\n v-if=\"isSearchVisible || layout === 'web'\"\n v-model=\"query\"\n :autofocus=\"layout !== 'web'\" />\n </div>\n </template>\n\n <template #spacer>\n <div class=\"flex-1\"></div>\n </template>\n\n <template\n v-if=\"slots.decorator\"\n #decorator=\"decoratorProps\">\n <slot\n v-bind=\"decoratorProps\"\n name=\"decorator\" />\n </template>\n\n <template #icon=\"iconProps\">\n <template v-if=\"slots.icon || isDraft(iconProps.item)\">\n <ScalarIconFileDashed v-if=\"isDraft(iconProps.item)\" />\n <slot\n v-bind=\"iconProps\"\n name=\"icon\" />\n </template>\n </template>\n\n <!-- Empty folder slot -->\n <template\n v-if=\"slots.empty\"\n #empty=\"emptyProps\">\n <slot\n v-bind=\"emptyProps\"\n name=\"empty\" />\n </template>\n\n <template #before>\n <slot name=\"workspaceButton\" />\n </template>\n\n <template #footer>\n <slot name=\"footer\" />\n </template>\n </ScalarSidebar>\n </template>\n </Resize>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,OAAO;EAab,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,QAAQ,SAAA;;EAgBd,MAAM,kBAAkB,IAAI,KAAK;;EAGjC,MAAM,eAAe,SAAmB,SAAC,cAGxC;EAED,MAAM,WAAW,SAAyB;GACxC,OAAO,KAAK,SAAS,aAAa,KAAK,UAAU;EACnD;;EAGA,MAAM,EAAE,OAAO,YAAY,qBACzB,QAAA,UAAU,OAAO,iBAAiB,CACpC;;EAGA,MAAM,QAAQ,eAAe,QAAQ,SAAS,QAAA,aAAa,MAAM,KAAK;;EAGtE,MAAM,oBAAoB,OAAe;GACvC,KAAK,cAAc,EAAE;GACrB,MAAM,QAAQ;GACd,gBAAgB,QAAQ;EAC1B;;uBAGE,YAwGS,MAAA,cAAA,GAAA;IAvGC,OAAO,aAAA;yEAAY,QAAA;IAC3B,OAAM;;IACK,SAAO,cAmGA,CAlGhB,YAkGgB,MAAA,aAAA,GAAA;KAjGd,OAAM;KACL,QAAQ;KACR,aAAa,QAAA,WAAM;KACnB,aAAa,QAAA;KACb,YAAY,QAAA,aAAa;KACzB,YAAY,QAAA,aAAa;KACzB,OAAA,MAAA;KACD,QAAO;KACN,SAAO,EAAA,8BAAkC,QAAA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F,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AA+EA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;AAKhC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B,CAAC;AAgBF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AA8JF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarMenu.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarMenu,\n ScalarMenuLink,\n ScalarMenuProducts,\n ScalarMenuResources,\n ScalarMenuSection,\n ScalarMenuSupport,\n ScalarMenuWorkspacePicker,\n type WorkspaceGroup,\n} from '@scalar/components/menu'\nimport { ScalarIconGear } from '@scalar/icons'\n\nconst { activeWorkspace, workspaces } = defineProps<{\n /**\n * The currently active workspace.\n * This represents the workspace that the user is currently working in.\n */\n activeWorkspace: { id: string }\n /**\n * The list of all available workspaces.\n * Used to render options for workspace switching and selection.\n */\n workspaces: WorkspaceGroup[]\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when the user selects a workspace */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\ndefineSlots<{\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n}>()\n</script>\n<template>\n <!-- Desktop app menu -->\n <ScalarMenu>\n <template #products>\n <ScalarMenuProducts selected=\"client\" />\n </template>\n <template #sections=\"{ close }\">\n <ScalarMenuSection>\n <slot name=\"sidebarMenuActions\">\n <ScalarMenuWorkspacePicker\n :modelValue=\"activeWorkspace.id\"\n :workspaceOptions=\"workspaces\"\n @createWorkspace=\"emit('create:workspace')\"\n @update:modelValue=\"(value) => emit('select:workspace', value)\" />\n <ScalarMenuLink\n is=\"button\"\n :icon=\"ScalarIconGear\"\n @click=\"\n () => {\n close()\n emit('navigate:to:settings')\n }\n \">\n Settings\n </ScalarMenuLink>\n </slot>\n </ScalarMenuSection>\n <ScalarMenuResources />\n <ScalarMenuSupport />\n </template>\n </ScalarMenu>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SidebarMenu.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarMenu,\n ScalarMenuLink,\n ScalarMenuProducts,\n ScalarMenuResources,\n ScalarMenuSection,\n ScalarMenuSupport,\n ScalarMenuWorkspacePicker,\n type WorkspaceGroup,\n} from '@scalar/components/menu'\nimport { ScalarIconGear } from '@scalar/icons'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { activeWorkspace, workspaces } = defineProps<{\n /**\n * The currently active workspace.\n * This represents the workspace that the user is currently working in.\n */\n activeWorkspace: { id: string }\n /**\n * The list of all available workspaces.\n * Used to render options for workspace switching and selection.\n */\n workspaces: WorkspaceGroup[]\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when the user selects a workspace */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineSlots<{\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n}>()\n</script>\n<template>\n <!-- Desktop app menu -->\n <ScalarMenu>\n <template #products>\n <ScalarMenuProducts selected=\"client\" />\n </template>\n <template #sections=\"{ close }\">\n <ScalarMenuSection>\n <slot name=\"sidebarMenuActions\">\n <ScalarMenuWorkspacePicker\n :modelValue=\"activeWorkspace.id\"\n :workspaceOptions=\"workspaces\"\n @createWorkspace=\"emit('create:workspace')\"\n @update:modelValue=\"(value) => emit('select:workspace', value)\" />\n <ScalarMenuLink\n is=\"button\"\n :icon=\"ScalarIconGear\"\n @click=\"\n () => {\n close()\n emit('navigate:to:settings')\n }\n \">\n {{ translate('apiClient.sidebarMenu.settings') }}\n </ScalarMenuLink>\n </slot>\n </ScalarMenuSection>\n <ScalarMenuResources />\n <ScalarMenuSupport />\n </template>\n </ScalarMenu>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { createBlock, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
1
+ import { useLocalization } from "../../features/localization/index.js";
2
+ import { createBlock, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
2
3
  import { ScalarIconGear } from "@scalar/icons";
3
4
  import { ScalarMenu, ScalarMenuLink, ScalarMenuProducts, ScalarMenuResources, ScalarMenuSection, ScalarMenuSupport, ScalarMenuWorkspacePicker } from "@scalar/components/menu";
4
5
  //#region src/v2/components/sidebar/SidebarMenu.vue?vue&type=script&setup=true&lang.ts
@@ -15,6 +16,7 @@ var SidebarMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
15
16
  ],
16
17
  setup(__props, { emit: __emit }) {
17
18
  const emit = __emit;
19
+ const { translate } = useLocalization();
18
20
  return (_ctx, _cache) => {
19
21
  return openBlock(), createBlock(unref(ScalarMenu), null, {
20
22
  products: withCtx(() => [createVNode(unref(ScalarMenuProducts), { selected: "client" })]),
@@ -33,7 +35,7 @@ var SidebarMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
33
35
  emit("navigate:to:settings");
34
36
  }
35
37
  }, {
36
- default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Settings ", -1)])]),
38
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.sidebarMenu.settings")), 1)]),
37
39
  _: 1
38
40
  }, 8, ["icon", "onClick"])])]),
39
41
  _: 2
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarMenu.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarMenu,\n ScalarMenuLink,\n ScalarMenuProducts,\n ScalarMenuResources,\n ScalarMenuSection,\n ScalarMenuSupport,\n ScalarMenuWorkspacePicker,\n type WorkspaceGroup,\n} from '@scalar/components/menu'\nimport { ScalarIconGear } from '@scalar/icons'\n\nconst { activeWorkspace, workspaces } = defineProps<{\n /**\n * The currently active workspace.\n * This represents the workspace that the user is currently working in.\n */\n activeWorkspace: { id: string }\n /**\n * The list of all available workspaces.\n * Used to render options for workspace switching and selection.\n */\n workspaces: WorkspaceGroup[]\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when the user selects a workspace */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\ndefineSlots<{\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n}>()\n</script>\n<template>\n <!-- Desktop app menu -->\n <ScalarMenu>\n <template #products>\n <ScalarMenuProducts selected=\"client\" />\n </template>\n <template #sections=\"{ close }\">\n <ScalarMenuSection>\n <slot name=\"sidebarMenuActions\">\n <ScalarMenuWorkspacePicker\n :modelValue=\"activeWorkspace.id\"\n :workspaceOptions=\"workspaces\"\n @createWorkspace=\"emit('create:workspace')\"\n @update:modelValue=\"(value) => emit('select:workspace', value)\" />\n <ScalarMenuLink\n is=\"button\"\n :icon=\"ScalarIconGear\"\n @click=\"\n () => {\n close()\n emit('navigate:to:settings')\n }\n \">\n Settings\n </ScalarMenuLink>\n </slot>\n </ScalarMenuSection>\n <ScalarMenuResources />\n <ScalarMenuSupport />\n </template>\n </ScalarMenu>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EA0BA,MAAM,OAAO;;uBAgBX,YA4Ba,MAAA,UAAA,GAAA,MAAA;IA3BA,UAAQ,cACuB,CAAxC,YAAwC,MAAA,kBAAA,GAAA,EAApB,UAAS,SAAQ,CAAA,CAAA,CAAA;IAE5B,UAAQ,SAoBG,EApBC,YAAK;KAC1B,YAmBoB,MAAA,iBAAA,GAAA,MAAA;6BADX,CAjBP,WAiBO,KAAA,QAAA,sBAAA,CAAA,SAAA,CAhBL,YAIoE,MAAA,yBAAA,GAAA;OAHjE,YAAY,QAAA,gBAAgB;OAC5B,kBAAkB,QAAA;OAClB,mBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,kBAAA;OACrB,uBAAiB,OAAA,OAAA,OAAA,MAAG,UAAU,KAAI,oBAAqB,KAAK;uDAC/D,YAUiB,MAAA,cAAA,GAAA;OATf,IAAG;OACF,MAAM,MAAA,cAAA;OACN,eAAA;QAA8C,MAAK;QAAmB,KAAI,sBAAA;;;8BAO7E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,cAEJ,EAAA,CAAA,EAAA,CAAA;;;;;KAGJ,YAAuB,MAAA,mBAAA,CAAA;KACvB,YAAqB,MAAA,iBAAA,CAAA"}
1
+ {"version":3,"file":"SidebarMenu.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarMenu,\n ScalarMenuLink,\n ScalarMenuProducts,\n ScalarMenuResources,\n ScalarMenuSection,\n ScalarMenuSupport,\n ScalarMenuWorkspacePicker,\n type WorkspaceGroup,\n} from '@scalar/components/menu'\nimport { ScalarIconGear } from '@scalar/icons'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { activeWorkspace, workspaces } = defineProps<{\n /**\n * The currently active workspace.\n * This represents the workspace that the user is currently working in.\n */\n activeWorkspace: { id: string }\n /**\n * The list of all available workspaces.\n * Used to render options for workspace switching and selection.\n */\n workspaces: WorkspaceGroup[]\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when the user selects a workspace */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineSlots<{\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n}>()\n</script>\n<template>\n <!-- Desktop app menu -->\n <ScalarMenu>\n <template #products>\n <ScalarMenuProducts selected=\"client\" />\n </template>\n <template #sections=\"{ close }\">\n <ScalarMenuSection>\n <slot name=\"sidebarMenuActions\">\n <ScalarMenuWorkspacePicker\n :modelValue=\"activeWorkspace.id\"\n :workspaceOptions=\"workspaces\"\n @createWorkspace=\"emit('create:workspace')\"\n @update:modelValue=\"(value) => emit('select:workspace', value)\" />\n <ScalarMenuLink\n is=\"button\"\n :icon=\"ScalarIconGear\"\n @click=\"\n () => {\n close()\n emit('navigate:to:settings')\n }\n \">\n {{ translate('apiClient.sidebarMenu.settings') }}\n </ScalarMenuLink>\n </slot>\n </ScalarMenuSection>\n <ScalarMenuResources />\n <ScalarMenuSupport />\n </template>\n </ScalarMenu>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EA4BA,MAAM,OAAO;EASb,MAAM,EAAE,cAAc,gBAAgB;;uBASpC,YA4Ba,MAAA,UAAA,GAAA,MAAA;IA3BA,UAAQ,cACuB,CAAxC,YAAwC,MAAA,kBAAA,GAAA,EAApB,UAAS,SAAQ,CAAA,CAAA,CAAA;IAE5B,UAAQ,SAoBG,EApBC,YAAK;KAC1B,YAmBoB,MAAA,iBAAA,GAAA,MAAA;6BADX,CAjBP,WAiBO,KAAA,QAAA,sBAAA,CAAA,SAAA,CAhBL,YAIoE,MAAA,yBAAA,GAAA;OAHjE,YAAY,QAAA,gBAAgB;OAC5B,kBAAkB,QAAA;OAClB,mBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,kBAAA;OACrB,uBAAiB,OAAA,OAAA,OAAA,MAAG,UAAU,KAAI,oBAAqB,KAAK;uDAC/D,YAUiB,MAAA,cAAA,GAAA;OATf,IAAG;OACF,MAAM,MAAA,cAAA;OACN,eAAA;QAA8C,MAAK;QAAmB,KAAI,sBAAA;;;8BAM1B,CAAA,gBAAA,gBAA9C,MAAA,SAAA,CAAS,CAAA,gCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;;;KAIlB,YAAuB,MAAA,mBAAA,CAAA;KACvB,YAAqB,MAAA,iBAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"names":[],"mappings":"AAgDA,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,OAAO,CAAC;CACnB,CAAC;AAkFF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"names":[],"mappings":"AA4DA,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,OAAO,CAAC;CACnB,CAAC;AAuFF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarToggle.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{ isSidebarOpen ? 'Hide' : 'Show' }} sidebar</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SidebarToggle.vue.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { translate } = useLocalization()\n\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{\n isSidebarOpen\n ? translate('apiClient.sidebarToggle.hide')\n : translate('apiClient.sidebarToggle.show')\n }}</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, toDisplayString, useModel } from "vue";
1
+ import { useLocalization } from "../../features/localization/index.js";
2
+ import { createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useModel } from "vue";
2
3
  //#region src/v2/components/sidebar/SidebarToggle.vue?vue&type=script&setup=true&lang.ts
3
4
  var _hoisted_1 = ["aria-pressed"];
4
5
  var _hoisted_2 = { class: "sr-only" };
@@ -20,6 +21,7 @@ var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
20
21
  },
21
22
  emits: ["update:modelValue"],
22
23
  setup(__props) {
24
+ const { translate } = useLocalization();
23
25
  const isSidebarOpen = useModel(__props, "modelValue");
24
26
  return (_ctx, _cache) => {
25
27
  return openBlock(), createElementBlock("button", {
@@ -27,7 +29,7 @@ var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
27
29
  class: "scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2",
28
30
  type: "button",
29
31
  onClick: _cache[0] || (_cache[0] = ($event) => isSidebarOpen.value = !isSidebarOpen.value)
30
- }, [createElementVNode("span", _hoisted_2, toDisplayString(isSidebarOpen.value ? "Hide" : "Show") + " sidebar", 1), (openBlock(), createElementBlock("svg", _hoisted_3, [
32
+ }, [createElementVNode("span", _hoisted_2, toDisplayString(isSidebarOpen.value ? unref(translate)("apiClient.sidebarToggle.hide") : unref(translate)("apiClient.sidebarToggle.show")), 1), (openBlock(), createElementBlock("svg", _hoisted_3, [
31
33
  _cache[1] || (_cache[1] = createElementVNode("defs", null, [createElementVNode("clipPath", { id: "mask" }, [createElementVNode("path", {
32
34
  "clip-rule": "evenodd",
33
35
  d: "M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z"
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarToggle.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{ isSidebarOpen ? 'Hide' : 'Show' }} sidebar</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EACA,MAAM,gBAAgB,SAAoB,SAAA,YAEzC;;uBAGC,mBAgCS,UAAA;IA/BN,gBAAc,cAAA;IACf,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,cAAA,QAAa,CAAI,cAAA;OACzB,mBAA0E,QAA1E,YAA0E,gBAAjD,cAAA,QAAa,SAAA,MAAA,IAAqB,YAAQ,CAAA,IAAA,UAAA,GACnE,mBAyBM,OAzBN,YAyBM;8BApBJ,mBAMO,QAAA,MAAA,CALL,mBAIW,YAAA,EAJD,IAAG,OAAM,GAAA,CACjB,mBAE8D,QAAA;KAD5D,aAAU;KACV,GAAE;;IAGR,mBAMI,KANJ,YAMI,CALF,mBAIwB,QAAA;KAHtB,OAAK,eAAA,CAAC,qCACE,cAAA,QAAa,kBAAA,kBAAA,CAAA;KACrB,GAAE;KACF,MAAK;;8BAET,mBAKqB,QAAA;KAJnB,GAAE;KACF,QAAO;KACP,kBAAe;KACf,mBAAgB;KAChB,gBAAa"}
1
+ {"version":3,"file":"SidebarToggle.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { translate } = useLocalization()\n\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{\n isSidebarOpen\n ? translate('apiClient.sidebarToggle.hide')\n : translate('apiClient.sidebarToggle.show')\n }}</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAGA,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,gBAAgB,SAAoB,SAAA,YAEzC;;uBAGC,mBAoCS,UAAA;IAnCN,gBAAc,cAAA;IACf,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,cAAA,QAAa,CAAI,cAAA;OACzB,mBAIS,QAJT,YAIS,gBAHP,cAAA,QAAwB,MAAA,SAAA,CAAS,CAAA,8BAAA,IAA2C,MAAA,SAAA,CAAS,CAAA,8BAAA,CAAA,GAAA,CAAA,IAAA,UAAA,GAIvF,mBAyBM,OAzBN,YAyBM;8BApBJ,mBAMO,QAAA,MAAA,CALL,mBAIW,YAAA,EAJD,IAAG,OAAM,GAAA,CACjB,mBAE8D,QAAA;KAD5D,aAAU;KACV,GAAE;;IAGR,mBAMI,KANJ,YAMI,CALF,mBAIwB,QAAA;KAHtB,OAAK,eAAA,CAAC,qCACE,cAAA,QAAa,kBAAA,kBAAA,CAAA;KACrB,GAAE;KACF,MAAK;;8BAET,mBAKqB,QAAA;KAJnB,GAAE;KACF,QAAO;KACP,kBAAe;KACf,mBAAgB;KAChB,gBAAa"}
@@ -1,6 +1,6 @@
1
1
  //#region src/v2/constants.ts
2
2
  /** The version number taken from the package.json. Consumers can override at build time via define (e.g. OVERRIDE_PACKAGE_VERSION: JSON.stringify('1.2.3')). */
3
- var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.19.2";
3
+ var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.20.0";
4
4
  //#endregion
5
5
  export { APP_VERSION };
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionForm.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"names":[],"mappings":"AAyGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAI9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,qFAAqF;aAC5E,YAAY;IACrB,sDAAsD;eAC3C,OAAO;;;;;;IAHlB,qFAAqF;aAC5E,YAAY;IACrB,sDAAsD;eAC3C,OAAO;;;;;;IAgBlB,wCAAwC;eAC7B,IAAI;IACf,kGAAkG;eACvF,IAAI;IACf,4EAA4E;cAClE,IAAI;EA+FZ,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CommandActionForm.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"names":[],"mappings":"AA+GA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAM9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,qFAAqF;aAC5E,YAAY;IACrB,sDAAsD;eAC3C,OAAO;;;;;;IAHlB,qFAAqF;aAC5E,YAAY;IACrB,sDAAsD;eAC3C,OAAO;;;;;;IAkBlB,wCAAwC;eAC7B,IAAI;IACf,kGAAkG;eACvF,IAAI;IACf,4EAA4E;cAClE,IAAI;EAiGZ,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionForm.vue.js","names":[],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Form Component\n *\n * A reusable form wrapper for command palette actions.\n * Provides a consistent layout with a main content area, optional controls,\n * and a submit button. Prevents form submission when disabled.\n *\n * @example\n * <CommandActionForm\n * :loader\n * :disabled=\"isDisabled\"\n * @submit=\"handleSubmit\"\n * @cancel=\"handleCancel\"\n * @back=\"handleBack\"\n * >\n * <!-- Main content goes in default slot -->\n * <CommandActionInput v-model=\"value\" />\n *\n * <!-- Optional controls in options slot -->\n * <template #options>\n * <ScalarCheckbox v-model=\"option\" />\n * </template>\n *\n * <!-- Custom submit button text -->\n * <template #submit>Create</template>\n * </CommandActionForm>\n */\nexport default {\n name: 'CommandActionForm',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport type { LoadingState } from '@scalar/components/loading'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nconst { loader, disabled = false } = defineProps<{\n /** Loading state from useLoadingState composable to show spinner on submit button */\n loader?: LoadingState\n /** Whether the form and submit button are disabled */\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the form is submitted (if not disabled) */\n (event: 'submit'): void\n /** Emitted when the action is cancelled */\n (event: 'cancel'): void\n /** Emitted when user presses back (e.g., Escape key) */\n (event: 'back', e: KeyboardEvent): void\n}>()\n\ndefineSlots<{\n /** Main content area for form inputs */\n default(): void\n /** Optional controls displayed before the submit button (e.g., checkboxes, toggles, dropdowns) */\n options(): void\n /** Custom text or content for the submit button (defaults to \"Continue\") */\n submit(): void\n}>()\n\nconst { cx } = useBindCx()\n\n/** Handle form submission, only emit if not disabled */\nconst handleSubmit = (): void => {\n if (!disabled) {\n emit('submit')\n }\n}\n</script>\n\n<template>\n <form\n class=\"flex w-full flex-col gap-3\"\n @keydown.enter.stop\n @submit.prevent.stop=\"handleSubmit\">\n <!-- Main content area with minimum height and rounded corners -->\n <div v-bind=\"cx('relative flex min-h-20 flex-col rounded')\">\n <slot />\n </div>\n\n <!-- Action bar with optional controls and submit button -->\n <div class=\"flex gap-2\">\n <!-- Optional controls slot (e.g., checkboxes, toggles) -->\n <div class=\"flex max-h-8 flex-1\">\n <slot name=\"options\" />\n </div>\n\n <!-- Submit button with customizable text -->\n <ScalarButton\n class=\"max-h-8 px-3 text-xs\"\n :disabled=\"disabled\"\n :loader\n type=\"submit\">\n <slot name=\"submit\">Continue</slot>\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"CommandActionForm.vue.js","names":[],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Form Component\n *\n * A reusable form wrapper for command palette actions.\n * Provides a consistent layout with a main content area, optional controls,\n * and a submit button. Prevents form submission when disabled.\n *\n * @example\n * <CommandActionForm\n * :loader\n * :disabled=\"isDisabled\"\n * @submit=\"handleSubmit\"\n * @cancel=\"handleCancel\"\n * @back=\"handleBack\"\n * >\n * <!-- Main content goes in default slot -->\n * <CommandActionInput v-model=\"value\" />\n *\n * <!-- Optional controls in options slot -->\n * <template #options>\n * <ScalarCheckbox v-model=\"option\" />\n * </template>\n *\n * <!-- Custom submit button text -->\n * <template #submit>Create</template>\n * </CommandActionForm>\n */\nexport default {\n name: 'CommandActionForm',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport type { LoadingState } from '@scalar/components/loading'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { loader, disabled = false } = defineProps<{\n /** Loading state from useLoadingState composable to show spinner on submit button */\n loader?: LoadingState\n /** Whether the form and submit button are disabled */\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the form is submitted (if not disabled) */\n (event: 'submit'): void\n /** Emitted when the action is cancelled */\n (event: 'cancel'): void\n /** Emitted when user presses back (e.g., Escape key) */\n (event: 'back', e: KeyboardEvent): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineSlots<{\n /** Main content area for form inputs */\n default(): void\n /** Optional controls displayed before the submit button (e.g., checkboxes, toggles, dropdowns) */\n options(): void\n /** Custom text or content for the submit button (defaults to \"Continue\") */\n submit(): void\n}>()\n\nconst { cx } = useBindCx()\n\n/** Handle form submission, only emit if not disabled */\nconst handleSubmit = (): void => {\n if (!disabled) {\n emit('submit')\n }\n}\n</script>\n\n<template>\n <form\n class=\"flex w-full flex-col gap-3\"\n @keydown.enter.stop\n @submit.prevent.stop=\"handleSubmit\">\n <!-- Main content area with minimum height and rounded corners -->\n <div v-bind=\"cx('relative flex min-h-20 flex-col rounded')\">\n <slot />\n </div>\n\n <!-- Action bar with optional controls and submit button -->\n <div class=\"flex gap-2\">\n <!-- Optional controls slot (e.g., checkboxes, toggles) -->\n <div class=\"flex max-h-8 flex-1\">\n <slot name=\"options\" />\n </div>\n\n <!-- Submit button with customizable text -->\n <ScalarButton\n class=\"max-h-8 px-3 text-xs\"\n :disabled=\"disabled\"\n :loader\n type=\"submit\">\n <slot name=\"submit\">\n {{ translate('apiClient.commandActionForm.continue') }}\n </slot>\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderSlot, unref, withCtx, withKeys, withModifiers } from "vue";
1
+ import { useLocalization } from "../../localization/index.js";
2
+ import { createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, withCtx, withKeys, withModifiers } from "vue";
2
3
  import { ScalarButton } from "@scalar/components/button";
3
4
  import { useBindCx } from "@scalar/use-hooks/useBindCx";
4
5
  //#region src/v2/features/command-palette/components/CommandActionForm.vue?vue&type=script&setup=true&lang.ts
@@ -20,6 +21,7 @@ var CommandActionForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
20
21
  ],
21
22
  setup(__props, { emit: __emit }) {
22
23
  const emit = __emit;
24
+ const { translate } = useLocalization();
23
25
  const { cx } = useBindCx();
24
26
  /** Handle form submission, only emit if not disabled */
25
27
  const handleSubmit = () => {
@@ -36,7 +38,7 @@ var CommandActionForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
36
38
  loader: __props.loader,
37
39
  type: "submit"
38
40
  }, {
39
- default: withCtx(() => [renderSlot(_ctx.$slots, "submit", {}, () => [_cache[1] || (_cache[1] = createTextVNode("Continue", -1))])]),
41
+ default: withCtx(() => [renderSlot(_ctx.$slots, "submit", {}, () => [createTextVNode(toDisplayString(unref(translate)("apiClient.commandActionForm.continue")), 1)])]),
40
42
  _: 3
41
43
  }, 8, ["disabled", "loader"])])], 32);
42
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionForm.vue.script.js","names":[],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Form Component\n *\n * A reusable form wrapper for command palette actions.\n * Provides a consistent layout with a main content area, optional controls,\n * and a submit button. Prevents form submission when disabled.\n *\n * @example\n * <CommandActionForm\n * :loader\n * :disabled=\"isDisabled\"\n * @submit=\"handleSubmit\"\n * @cancel=\"handleCancel\"\n * @back=\"handleBack\"\n * >\n * <!-- Main content goes in default slot -->\n * <CommandActionInput v-model=\"value\" />\n *\n * <!-- Optional controls in options slot -->\n * <template #options>\n * <ScalarCheckbox v-model=\"option\" />\n * </template>\n *\n * <!-- Custom submit button text -->\n * <template #submit>Create</template>\n * </CommandActionForm>\n */\nexport default {\n name: 'CommandActionForm',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport type { LoadingState } from '@scalar/components/loading'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nconst { loader, disabled = false } = defineProps<{\n /** Loading state from useLoadingState composable to show spinner on submit button */\n loader?: LoadingState\n /** Whether the form and submit button are disabled */\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the form is submitted (if not disabled) */\n (event: 'submit'): void\n /** Emitted when the action is cancelled */\n (event: 'cancel'): void\n /** Emitted when user presses back (e.g., Escape key) */\n (event: 'back', e: KeyboardEvent): void\n}>()\n\ndefineSlots<{\n /** Main content area for form inputs */\n default(): void\n /** Optional controls displayed before the submit button (e.g., checkboxes, toggles, dropdowns) */\n options(): void\n /** Custom text or content for the submit button (defaults to \"Continue\") */\n submit(): void\n}>()\n\nconst { cx } = useBindCx()\n\n/** Handle form submission, only emit if not disabled */\nconst handleSubmit = (): void => {\n if (!disabled) {\n emit('submit')\n }\n}\n</script>\n\n<template>\n <form\n class=\"flex w-full flex-col gap-3\"\n @keydown.enter.stop\n @submit.prevent.stop=\"handleSubmit\">\n <!-- Main content area with minimum height and rounded corners -->\n <div v-bind=\"cx('relative flex min-h-20 flex-col rounded')\">\n <slot />\n </div>\n\n <!-- Action bar with optional controls and submit button -->\n <div class=\"flex gap-2\">\n <!-- Optional controls slot (e.g., checkboxes, toggles) -->\n <div class=\"flex max-h-8 flex-1\">\n <slot name=\"options\" />\n </div>\n\n <!-- Submit button with customizable text -->\n <ScalarButton\n class=\"max-h-8 px-3 text-xs\"\n :disabled=\"disabled\"\n :loader\n type=\"submit\">\n <slot name=\"submit\">Continue</slot>\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;CA6BE,MAAM;;;;;;;;;;;;;;EAgBR,MAAM,OAAO;EAkBb,MAAM,EAAE,OAAO,UAAU;;EAGzB,MAAM,qBAA2B;GAC/B,IAAI,CAAC,QAAA,UACH,KAAK,QAAQ;EAEjB;;uBAIE,mBAyBO,QAAA;IAxBL,OAAM;IACL,WAAO,OAAA,OAAA,OAAA,KAAA,SAAA,oBAAR,CAAA,GAAmB,CAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;IAClB,UAAM,cAAe,cAAY,CAAA,WAAA,MAAA,CAAA;OAElC,mBAEM,OAAA,eAAA,mBAFO,MAAA,EAAA,CAAE,CAAA,yCAAA,CAAA,CAAA,GAAA,CACb,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,GAIV,mBAcM,OAdN,YAcM,CAZJ,mBAEM,OAFN,YAEM,CADJ,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA,GAIzB,YAMe,MAAA,YAAA,GAAA;IALb,OAAM;IACL,UAAU,QAAA;IACV,QAAA,QAAA;IACD,MAAK;;2BAC8B,CAAnC,WAAmC,KAAA,QAAA,UAAA,CAAA,SAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAf,YAAQ,EAAA,EAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"CommandActionForm.vue.script.js","names":[],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Form Component\n *\n * A reusable form wrapper for command palette actions.\n * Provides a consistent layout with a main content area, optional controls,\n * and a submit button. Prevents form submission when disabled.\n *\n * @example\n * <CommandActionForm\n * :loader\n * :disabled=\"isDisabled\"\n * @submit=\"handleSubmit\"\n * @cancel=\"handleCancel\"\n * @back=\"handleBack\"\n * >\n * <!-- Main content goes in default slot -->\n * <CommandActionInput v-model=\"value\" />\n *\n * <!-- Optional controls in options slot -->\n * <template #options>\n * <ScalarCheckbox v-model=\"option\" />\n * </template>\n *\n * <!-- Custom submit button text -->\n * <template #submit>Create</template>\n * </CommandActionForm>\n */\nexport default {\n name: 'CommandActionForm',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport type { LoadingState } from '@scalar/components/loading'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { loader, disabled = false } = defineProps<{\n /** Loading state from useLoadingState composable to show spinner on submit button */\n loader?: LoadingState\n /** Whether the form and submit button are disabled */\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the form is submitted (if not disabled) */\n (event: 'submit'): void\n /** Emitted when the action is cancelled */\n (event: 'cancel'): void\n /** Emitted when user presses back (e.g., Escape key) */\n (event: 'back', e: KeyboardEvent): void\n}>()\n\nconst { translate } = useLocalization()\n\ndefineSlots<{\n /** Main content area for form inputs */\n default(): void\n /** Optional controls displayed before the submit button (e.g., checkboxes, toggles, dropdowns) */\n options(): void\n /** Custom text or content for the submit button (defaults to \"Continue\") */\n submit(): void\n}>()\n\nconst { cx } = useBindCx()\n\n/** Handle form submission, only emit if not disabled */\nconst handleSubmit = (): void => {\n if (!disabled) {\n emit('submit')\n }\n}\n</script>\n\n<template>\n <form\n class=\"flex w-full flex-col gap-3\"\n @keydown.enter.stop\n @submit.prevent.stop=\"handleSubmit\">\n <!-- Main content area with minimum height and rounded corners -->\n <div v-bind=\"cx('relative flex min-h-20 flex-col rounded')\">\n <slot />\n </div>\n\n <!-- Action bar with optional controls and submit button -->\n <div class=\"flex gap-2\">\n <!-- Optional controls slot (e.g., checkboxes, toggles) -->\n <div class=\"flex max-h-8 flex-1\">\n <slot name=\"options\" />\n </div>\n\n <!-- Submit button with customizable text -->\n <ScalarButton\n class=\"max-h-8 px-3 text-xs\"\n :disabled=\"disabled\"\n :loader\n type=\"submit\">\n <slot name=\"submit\">\n {{ translate('apiClient.commandActionForm.continue') }}\n </slot>\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;;CA6BE,MAAM;;;;;;;;;;;;;;EAkBR,MAAM,OAAO;EASb,MAAM,EAAE,cAAc,gBAAgB;EAWtC,MAAM,EAAE,OAAO,UAAU;;EAGzB,MAAM,qBAA2B;GAC/B,IAAI,CAAC,QAAA,UACH,KAAK,QAAQ;EAEjB;;uBAIE,mBA2BO,QAAA;IA1BL,OAAM;IACL,WAAO,OAAA,OAAA,OAAA,KAAA,SAAA,oBAAR,CAAA,GAAmB,CAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;IAClB,UAAM,cAAe,cAAY,CAAA,WAAA,MAAA,CAAA;OAElC,mBAEM,OAAA,eAAA,mBAFO,MAAA,EAAA,CAAE,CAAA,yCAAA,CAAA,CAAA,GAAA,CACb,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,GAIV,mBAgBM,OAhBN,YAgBM,CAdJ,mBAEM,OAFN,YAEM,CADJ,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA,GAIzB,YAQe,MAAA,YAAA,GAAA;IAPb,OAAM;IACL,UAAU,QAAA;IACV,QAAA,QAAA;IACD,MAAK;;2BAGE,CAFP,WAEO,KAAA,QAAA,UAAA,CAAA,SAAA,CAAA,gBAAA,gBADF,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
24
24
  /** Whether to automatically focus the input when mounted */
25
25
  autofocus?: boolean;
26
26
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
- "update:modelValue": (value: string) => any;
28
27
  delete: (keyboardEvent: KeyboardEvent) => any;
28
+ "update:modelValue": (value: string) => any;
29
29
  }, string, import("vue").PublicProps, Readonly<{
30
30
  /** Current value of the input */
31
31
  modelValue?: string;
@@ -34,7 +34,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
34
34
  /** Whether to automatically focus the input when mounted */
35
35
  autofocus?: boolean;
36
36
  }> & Readonly<{
37
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
38
37
  onDelete?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
38
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
39
39
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
40
  //# sourceMappingURL=CommandActionInput.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAQpH,KAAK,WAAW,GAAG;IACb,kEAAkE;IAClE,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,mDAAmD;IACnD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,cAAc,CAAC;AAwLvB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"names":[],"mappings":"AA2GA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AASpH,KAAK,WAAW,GAAG;IACb,kEAAkE;IAClE,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,mDAAmD;IACnD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,cAAc,CAAC;AA8LvB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentsList.vue.js","names":[],"sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { ref } from 'vue'\n\nimport EnvironmentCreateModal from '@/v2/features/environments/components/EnvironmentCreateModal.vue'\nimport EnvironmentDeleteModal from '@/v2/features/environments/components/EnvironmentDeleteModal.vue'\n\nimport EnvironmentComponent from './components/Environment.vue'\n\nconst { environments, eventBus, collectionType, activeEnvironment } =\n defineProps<\n {\n /** List of environments, ensured to be non-nullable for safety */\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n /** Event bus to handle workspace-related events */\n eventBus: WorkspaceEventBus\n /** The currently active environment name */\n activeEnvironment?: string\n } & CollectionType\n >()\n\nconst createEnvironmentModalState = useModal()\nconst deleteEnvironmentModalState = useModal()\n\n/** Track the currently selected environment for editing or deleting */\nconst selectedEnvironmentName = ref<string | null>(null)\n\n/** Opens the delete modal */\nconst openDeleteModal = (name: string) => {\n selectedEnvironmentName.value = name\n deleteEnvironmentModalState.show()\n}\n\n/** Deletes the selected environment */\nconst deleteEnvironment = () => {\n if (!selectedEnvironmentName.value) {\n return\n }\n eventBus.emit('environment:delete:environment', {\n environmentName: selectedEnvironmentName.value,\n collectionType,\n })\n}\n\n/** Opens the upsert modal, leave name empty for add */\nconst openUpsertModal = (name?: string) => {\n selectedEnvironmentName.value = name ?? null\n createEnvironmentModalState.show()\n}\n</script>\n\n<template>\n <EnvironmentComponent\n v-for=\"[environmentName, environment] in Object.entries(environments)\"\n :key=\"environmentName\"\n :collectionType=\"collectionType\"\n :environment\n :environmentName\n :eventBus=\"eventBus\"\n :isActive=\"activeEnvironment === environmentName\"\n @delete=\"() => openDeleteModal(environmentName)\"\n @edit=\"() => openUpsertModal(environmentName)\" />\n\n <!-- Add Environment CTA -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"() => openUpsertModal()\">\n <ScalarIconPlus />\n Add Environment\n </ScalarButton>\n </div>\n\n <!-- Upsert Modal -->\n <EnvironmentCreateModal\n :collectionType=\"collectionType\"\n :environments\n :eventBus\n :selectedEnvironmentName\n :state=\"createEnvironmentModalState\" />\n\n <!-- Delete Modal -->\n <EnvironmentDeleteModal\n :name=\"selectedEnvironmentName\"\n :state=\"deleteEnvironmentModalState\"\n @submit=\"deleteEnvironment\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"EnvironmentsList.vue.js","names":[],"sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { ref } from 'vue'\n\nimport EnvironmentCreateModal from '@/v2/features/environments/components/EnvironmentCreateModal.vue'\nimport EnvironmentDeleteModal from '@/v2/features/environments/components/EnvironmentDeleteModal.vue'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport EnvironmentComponent from './components/Environment.vue'\n\nconst { environments, eventBus, collectionType, activeEnvironment } =\n defineProps<\n {\n /** List of environments, ensured to be non-nullable for safety */\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n /** Event bus to handle workspace-related events */\n eventBus: WorkspaceEventBus\n /** The currently active environment name */\n activeEnvironment?: string\n } & CollectionType\n >()\n\nconst { translate } = useLocalization()\n\nconst createEnvironmentModalState = useModal()\nconst deleteEnvironmentModalState = useModal()\n\n/** Track the currently selected environment for editing or deleting */\nconst selectedEnvironmentName = ref<string | null>(null)\n\n/** Opens the delete modal */\nconst openDeleteModal = (name: string) => {\n selectedEnvironmentName.value = name\n deleteEnvironmentModalState.show()\n}\n\n/** Deletes the selected environment */\nconst deleteEnvironment = () => {\n if (!selectedEnvironmentName.value) {\n return\n }\n eventBus.emit('environment:delete:environment', {\n environmentName: selectedEnvironmentName.value,\n collectionType,\n })\n}\n\n/** Opens the upsert modal, leave name empty for add */\nconst openUpsertModal = (name?: string) => {\n selectedEnvironmentName.value = name ?? null\n createEnvironmentModalState.show()\n}\n</script>\n\n<template>\n <EnvironmentComponent\n v-for=\"[environmentName, environment] in Object.entries(environments)\"\n :key=\"environmentName\"\n :collectionType=\"collectionType\"\n :environment\n :environmentName\n :eventBus=\"eventBus\"\n :isActive=\"activeEnvironment === environmentName\"\n @delete=\"() => openDeleteModal(environmentName)\"\n @edit=\"() => openUpsertModal(environmentName)\" />\n\n <!-- Add Environment CTA -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"() => openUpsertModal()\">\n <ScalarIconPlus />{{\n translate('apiClient.environmentsList.addEnvironment')\n }}\n </ScalarButton>\n </div>\n\n <!-- Upsert Modal -->\n <EnvironmentCreateModal\n :collectionType=\"collectionType\"\n :environments\n :eventBus\n :selectedEnvironmentName\n :state=\"createEnvironmentModalState\" />\n\n <!-- Delete Modal -->\n <EnvironmentDeleteModal\n :name=\"selectedEnvironmentName\"\n :state=\"deleteEnvironmentModalState\"\n @submit=\"deleteEnvironment\" />\n</template>\n"],"mappings":""}