@scalar/api-client 3.19.3 → 3.21.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 (433) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  3. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  4. package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
  5. package/dist/components/HttpMethod/HttpMethod.vue.js.map +1 -1
  6. package/dist/components/HttpMethod/HttpMethod.vue.script.js +15 -7
  7. package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
  8. package/dist/components/SectionFilter.vue.d.ts +2 -0
  9. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  10. package/dist/components/SectionFilter.vue.js +1 -1
  11. package/dist/components/SectionFilter.vue.js.map +1 -1
  12. package/dist/components/SectionFilter.vue.script.js +11 -8
  13. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  14. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
  15. package/dist/components/Server/ServerVariablesSelect.vue.js.map +1 -1
  16. package/dist/components/Server/ServerVariablesSelect.vue.script.js +5 -3
  17. package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
  18. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
  19. package/dist/components/Server/ServerVariablesTextbox.vue.js.map +1 -1
  20. package/dist/components/Server/ServerVariablesTextbox.vue.script.js +6 -3
  21. package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
  22. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  23. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js.map +1 -1
  24. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +4 -2
  25. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
  26. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  27. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js.map +1 -1
  28. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +3 -1
  29. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
  30. package/dist/style.css +164 -141
  31. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +3 -2
  32. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  33. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  34. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +16 -3
  35. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  36. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -2
  37. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  39. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  40. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +10 -6
  41. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  42. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.d.ts.map +1 -1
  43. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
  44. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js.map +1 -1
  45. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +6 -3
  46. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
  47. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +1 -2
  48. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js.map +1 -1
  50. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -2
  51. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  52. package/dist/v2/blocks/operation-block/helpers/send-request.js +4 -3
  53. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  54. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +3 -2
  55. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  56. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  57. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  58. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +59 -26
  59. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  60. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  61. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  62. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  63. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +28 -8
  64. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  65. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  66. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +9 -3
  68. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.d.ts.map +1 -1
  70. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -1
  71. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +6 -4
  72. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  75. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +13 -4
  76. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  77. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -0
  78. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +14 -7
  81. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
  82. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +6 -6
  83. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  84. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  85. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  86. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +40 -7
  87. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  88. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +16 -16
  89. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  90. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  91. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +24 -20
  92. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  94. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  95. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +6 -4
  96. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  97. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
  98. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +14 -6
  99. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  100. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  101. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +5 -4
  102. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  103. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  104. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  105. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  106. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +34 -13
  107. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  108. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts +3 -3
  109. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/response-block/components/Headers.vue.js.map +1 -1
  111. package/dist/v2/blocks/response-block/components/Headers.vue.script.js +5 -3
  112. package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
  113. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
  114. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  115. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  116. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +3 -1
  117. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  118. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.d.ts.map +1 -1
  119. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js.map +1 -1
  120. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +11 -3
  121. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
  122. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
  123. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
  124. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
  125. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +8 -6
  126. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
  127. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts +1 -0
  128. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  129. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js.map +1 -1
  130. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +109 -56
  131. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
  132. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.d.ts.map +1 -1
  133. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js.map +1 -1
  134. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +5 -3
  135. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
  136. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  137. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js.map +1 -1
  138. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +6 -3
  139. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
  140. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  141. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
  142. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +7 -5
  143. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
  144. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
  145. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  146. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  147. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
  148. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +20 -15
  149. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
  150. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  151. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
  152. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
  153. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +4 -2
  154. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
  155. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  156. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js.map +1 -1
  157. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +11 -6
  158. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
  159. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts +4 -0
  160. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts.map +1 -0
  161. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js +100 -0
  162. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js.map +1 -0
  163. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts +13 -0
  164. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts.map +1 -0
  165. package/dist/v2/blocks/response-block/helpers/response-stream.js +97 -0
  166. package/dist/v2/blocks/response-block/helpers/response-stream.js.map +1 -0
  167. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -3
  168. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  169. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  170. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  171. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +41 -29
  172. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  173. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +6 -7
  174. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  175. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  176. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  177. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +7 -4
  178. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  179. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  180. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  181. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +21 -16
  182. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  183. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  184. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  185. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +7 -5
  186. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  187. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  188. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js.map +1 -1
  189. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +7 -5
  190. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
  191. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  192. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  193. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +105 -40
  194. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  195. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  196. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
  197. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +10 -8
  198. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
  199. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  200. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  201. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +20 -14
  202. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  203. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
  204. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  205. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +6 -4
  206. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  207. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  208. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  209. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +3 -1
  210. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  211. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  212. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  213. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +40 -40
  214. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  215. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +108 -7
  216. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  217. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +12 -0
  218. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  219. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  220. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -1
  221. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +8 -5
  222. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  223. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +2 -0
  224. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  225. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +2 -0
  226. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  227. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts +3 -0
  228. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts.map +1 -0
  229. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js +8 -0
  230. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js.map +1 -0
  231. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts +3 -0
  232. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts.map +1 -0
  233. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js +11 -0
  234. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js.map +1 -0
  235. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts +19 -0
  236. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -0
  237. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +117 -0
  238. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -0
  239. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -1
  240. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  241. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +15 -11
  242. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  243. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts +1 -1
  244. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts.map +1 -1
  245. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +8 -1
  246. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js.map +1 -1
  247. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -1
  248. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +6 -0
  249. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  250. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -1
  251. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  252. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +8 -6
  253. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  254. package/dist/v2/components/code-input/CodeInput.vue.d.ts +4 -4
  255. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  256. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  257. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  258. package/dist/v2/components/code-input/CodeInput.vue.script.js +10 -10
  259. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  260. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts +4 -4
  261. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  262. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  263. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  264. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +8 -5
  265. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  266. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts +4 -0
  267. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts.map +1 -1
  268. package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
  269. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +7 -3
  270. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
  271. package/dist/v2/components/code-input/code-variable-widget.d.ts +3 -0
  272. package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -1
  273. package/dist/v2/components/code-input/code-variable-widget.js +6 -3
  274. package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
  275. package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -1
  276. package/dist/v2/components/data-table/DataTable.vue.js.map +1 -1
  277. package/dist/v2/components/data-table/DataTable.vue.script.js +2 -1
  278. package/dist/v2/components/data-table/DataTable.vue.script.js.map +1 -1
  279. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +0 -1
  280. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  281. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  282. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +4 -2
  283. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
  284. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  285. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  286. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  287. package/dist/v2/components/data-table/DataTableInput.vue.script.js +5 -3
  288. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  289. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  290. package/dist/v2/components/data-table/DataTableInputSelect.vue.js.map +1 -1
  291. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +12 -9
  292. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
  293. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  294. package/dist/v2/components/forms/ConfirmationForm.vue.js.map +1 -1
  295. package/dist/v2/components/forms/ConfirmationForm.vue.script.js +5 -3
  296. package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
  297. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
  298. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  299. package/dist/v2/components/layout/CollapsibleSection.vue.script.js +3 -1
  300. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  301. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
  302. package/dist/v2/components/modals/DeleteModal.vue.js.map +1 -1
  303. package/dist/v2/components/modals/DeleteModal.vue.script.js +3 -1
  304. package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
  305. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  306. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  307. package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
  308. package/dist/v2/components/modals/ModalClientContainer.vue.script.js +5 -2
  309. package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
  310. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  311. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  312. package/dist/v2/components/server/ServerDropdown.vue.script.js +9 -5
  313. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  314. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  315. package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
  316. package/dist/v2/components/sidebar/Sidebar.vue.script.js +4 -2
  317. package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
  318. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  319. package/dist/v2/components/sidebar/SidebarMenu.vue.js.map +1 -1
  320. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +4 -2
  321. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
  322. package/dist/v2/components/sidebar/SidebarToggle.vue.d.ts.map +1 -1
  323. package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
  324. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +4 -2
  325. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
  326. package/dist/v2/constants.js +1 -1
  327. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -1
  328. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js.map +1 -1
  329. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +4 -2
  330. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
  331. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +2 -2
  332. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  333. package/dist/v2/features/environments/EnvironmentsList.vue.js.map +1 -1
  334. package/dist/v2/features/environments/EnvironmentsList.vue.script.js +4 -2
  335. package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
  336. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  337. package/dist/v2/features/environments/components/Environment.vue.js.map +1 -1
  338. package/dist/v2/features/environments/components/Environment.vue.script.js +12 -10
  339. package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
  340. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  341. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js.map +1 -1
  342. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +5 -3
  343. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
  344. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  345. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js.map +1 -1
  346. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +9 -6
  347. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
  348. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  349. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  350. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +6 -4
  351. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  352. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  353. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
  354. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
  355. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +22 -10
  356. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
  357. package/dist/v2/features/localization/index.d.ts +18 -0
  358. package/dist/v2/features/localization/index.d.ts.map +1 -0
  359. package/dist/v2/features/localization/index.js +35 -0
  360. package/dist/v2/features/localization/index.js.map +1 -0
  361. package/dist/v2/features/localization/locales/ar.d.ts +389 -0
  362. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -0
  363. package/dist/v2/features/localization/locales/ar.js +351 -0
  364. package/dist/v2/features/localization/locales/ar.js.map +1 -0
  365. package/dist/v2/features/localization/locales/de.d.ts +389 -0
  366. package/dist/v2/features/localization/locales/de.d.ts.map +1 -0
  367. package/dist/v2/features/localization/locales/de.js +351 -0
  368. package/dist/v2/features/localization/locales/de.js.map +1 -0
  369. package/dist/v2/features/localization/locales/es.d.ts +389 -0
  370. package/dist/v2/features/localization/locales/es.d.ts.map +1 -0
  371. package/dist/v2/features/localization/locales/es.js +351 -0
  372. package/dist/v2/features/localization/locales/es.js.map +1 -0
  373. package/dist/v2/features/localization/locales/fr.d.ts +389 -0
  374. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -0
  375. package/dist/v2/features/localization/locales/fr.js +351 -0
  376. package/dist/v2/features/localization/locales/fr.js.map +1 -0
  377. package/dist/v2/features/localization/locales/pt.d.ts +389 -0
  378. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -0
  379. package/dist/v2/features/localization/locales/pt.js +351 -0
  380. package/dist/v2/features/localization/locales/pt.js.map +1 -0
  381. package/dist/v2/features/localization/locales/ru.d.ts +389 -0
  382. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -0
  383. package/dist/v2/features/localization/locales/ru.js +351 -0
  384. package/dist/v2/features/localization/locales/ru.js.map +1 -0
  385. package/dist/v2/features/localization/locales/zh-cn.d.ts +389 -0
  386. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -0
  387. package/dist/v2/features/localization/locales/zh-cn.js +351 -0
  388. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -0
  389. package/dist/v2/features/localization/translations.d.ts +389 -0
  390. package/dist/v2/features/localization/translations.d.ts.map +1 -0
  391. package/dist/v2/features/localization/translations.js +351 -0
  392. package/dist/v2/features/localization/translations.js.map +1 -0
  393. package/dist/v2/features/modal/Modal.vue.d.ts +1 -2
  394. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  395. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  396. package/dist/v2/features/modal/Modal.vue.script.js +15 -4
  397. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  398. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +2 -3
  399. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -1
  400. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +8 -7
  401. package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
  402. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +2 -3
  403. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -1
  404. package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
  405. package/dist/v2/features/modal/use-lazy-api-client.d.ts +11 -0
  406. package/dist/v2/features/modal/use-lazy-api-client.d.ts.map +1 -0
  407. package/dist/v2/features/modal/use-lazy-api-client.js +48 -0
  408. package/dist/v2/features/modal/use-lazy-api-client.js.map +1 -0
  409. package/dist/v2/features/operation/Operation.vue.d.ts +1 -2
  410. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  411. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  412. package/dist/v2/features/operation/Operation.vue.script.js +22 -6
  413. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  414. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
  415. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  416. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  417. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +12 -8
  418. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  419. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
  420. package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -1
  421. package/dist/v2/features/search/components/SearchResult.vue.script.js +14 -10
  422. package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
  423. package/dist/v2/helpers/generate-location-id.d.ts +1 -2
  424. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -1
  425. package/dist/v2/helpers/generate-location-id.js.map +1 -1
  426. package/dist/v2/types/options.d.ts +1 -1
  427. package/dist/v2/types/options.d.ts.map +1 -1
  428. package/dist/v2/workspace-events.d.ts +2 -2
  429. package/dist/v2/workspace-events.d.ts.map +1 -1
  430. package/dist/v2/workspace-events.js +8 -1
  431. package/dist/v2/workspace-events.js.map +1 -1
  432. package/dist/vue-styles.css +128 -129
  433. package/package.json +22 -11
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesAddModal.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n CommandActionForm,\n CommandActionInput,\n} from '@/v2/features/command-palette'\n\nconst {\n state,\n scopes,\n scope = null,\n} = defineProps<{\n state: ModalState\n /** Existing scope names on the flow, used to prevent duplicates */\n scopes: string[]\n /**\n * When provided, the modal switches to \"edit\" mode and is prefilled with this scope.\n * The original name is retained so the consumer can rename it.\n */\n scope?: { name: string; description: string } | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (\n event: 'submit',\n scopeData: {\n name: string\n description: string\n /** The original name on the flow, only set when editing an existing scope */\n oldName?: string\n },\n ): void\n}>()\n\nconst isEditMode = computed(() => scope !== null)\nconst title = computed(() => (isEditMode.value ? 'Edit Scope' : 'Add Scope'))\nconst submitLabel = computed(() => (isEditMode.value ? 'Save' : 'Add Scope'))\n\nconst scopeData = ref({\n name: '',\n description: '',\n})\n\n/**\n * Tracks whether the user has interacted with the name field so we can defer the\n * \"name is required\" hint until after the first edit, rather than on initial render.\n */\nconst hasTouchedName = ref(false)\n\nwatch(\n () => scopeData.value.name,\n () => {\n hasTouchedName.value = true\n },\n)\n\nconst trimmedName = computed(() => scopeData.value.name.trim())\n\n/**\n * Whether the chosen name collides with an existing scope on the flow.\n * In edit mode we allow keeping the original name unchanged.\n */\nconst isDuplicateName = computed(() => {\n if (!trimmedName.value) {\n return false\n }\n if (isEditMode.value && trimmedName.value === scope?.name) {\n return false\n }\n return scopes.includes(trimmedName.value)\n})\n\n/** Human readable validation message rendered inline in the modal */\nconst validationError = computed<string | null>(() => {\n if (isDuplicateName.value) {\n return `A scope named \"${trimmedName.value}\" already exists.`\n }\n if (hasTouchedName.value && !trimmedName.value) {\n return 'Scope name is required.'\n }\n return null\n})\n\nconst isSubmitDisabled = computed(\n () => !trimmedName.value || isDuplicateName.value,\n)\n\nconst handleSubmit = () => {\n if (isSubmitDisabled.value) {\n return\n }\n\n emit('submit', {\n name: trimmedName.value,\n description: scopeData.value.description,\n ...(isEditMode.value && scope ? { oldName: scope.name } : {}),\n })\n state.hide()\n}\n\nwatch(\n () => state.open,\n (isOpen) => {\n if (!isOpen) {\n return\n }\n\n scopeData.value = scope\n ? { name: scope.name, description: scope.description }\n : { name: '', description: '' }\n // Clearing `name` schedules the `scopeData.name` watcher, which sets\n // `hasTouchedName` back to true in the same flush. Defer the reset so it\n // runs after that watcher and reopening add mode does not show a false\n // \"Scope name is required\" error.\n void nextTick(() => {\n hasTouchedName.value = false\n })\n },\n)\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"overflow-y-auto\"\n size=\"xs\"\n :state=\"state\"\n :title=\"title\">\n <CommandActionForm\n :disabled=\"isSubmitDisabled\"\n @cancel=\"emit('cancel')\"\n @submit=\"handleSubmit\">\n <!-- Name -->\n <div class=\"flex min-h-8 items-start gap-2 text-sm\">\n Name:\n <CommandActionInput\n v-model=\"scopeData.name\"\n autofocus\n class=\"field-sizing-content !p-0\"\n placeholder=\"read:user\" />\n </div>\n\n <!-- Description -->\n <div class=\"flex min-h-8 items-start gap-2 text-sm\">\n Description:\n <CommandActionInput\n v-model=\"scopeData.description\"\n :autofocus=\"false\"\n class=\"field-sizing-content !p-0\"\n placeholder=\"Read user data\" />\n </div>\n\n <!-- Inline validation error -->\n <div\n v-if=\"validationError\"\n class=\"text-red text-xs\"\n role=\"alert\">\n {{ validationError }}\n </div>\n\n <template #submit>{{ submitLabel }}</template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,OAAO;EAab,MAAM,aAAa,eAAe,QAAA,UAAU,IAAI;EAChD,MAAM,QAAQ,eAAgB,WAAW,QAAQ,eAAe,WAAY;EAC5E,MAAM,cAAc,eAAgB,WAAW,QAAQ,SAAS,WAAY;EAE5E,MAAM,YAAY,IAAI;GACpB,MAAM;GACN,aAAa;EACf,CAAC;;;;;EAMD,MAAM,iBAAiB,IAAI,KAAK;EAEhC,YACQ,UAAU,MAAM,YAChB;GACJ,eAAe,QAAQ;EACzB,CACF;EAEA,MAAM,cAAc,eAAe,UAAU,MAAM,KAAK,KAAK,CAAC;;;;;EAM9D,MAAM,kBAAkB,eAAe;GACrC,IAAI,CAAC,YAAY,OACf,OAAO;GAET,IAAI,WAAW,SAAS,YAAY,UAAU,QAAA,OAAO,MACnD,OAAO;GAET,OAAO,QAAA,OAAO,SAAS,YAAY,KAAK;EAC1C,CAAC;;EAGD,MAAM,kBAAkB,eAA8B;GACpD,IAAI,gBAAgB,OAClB,OAAO,kBAAkB,YAAY,MAAM;GAE7C,IAAI,eAAe,SAAS,CAAC,YAAY,OACvC,OAAO;GAET,OAAO;EACT,CAAC;EAED,MAAM,mBAAmB,eACjB,CAAC,YAAY,SAAS,gBAAgB,KAC9C;EAEA,MAAM,qBAAqB;GACzB,IAAI,iBAAiB,OACnB;GAGF,KAAK,UAAU;IACb,MAAM,YAAY;IAClB,aAAa,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-selector-block/components/OAuthScopesAddModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n CommandActionForm,\n CommandActionInput,\n} from '@/v2/features/command-palette'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n state,\n scopes,\n scope = null,\n} = defineProps<{\n state: ModalState\n /** Existing scope names on the flow, used to prevent duplicates */\n scopes: string[]\n /**\n * When provided, the modal switches to \"edit\" mode and is prefilled with this scope.\n * The original name is retained so the consumer can rename it.\n */\n scope?: { name: string; description: string } | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (\n event: 'submit',\n scopeData: {\n name: string\n description: string\n /** The original name on the flow, only set when editing an existing scope */\n oldName?: string\n },\n ): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst isEditMode = computed(() => scope !== null)\nconst title = computed(() =>\n isEditMode.value\n ? translate('apiClient.oauthScopesAddModal.edit')\n : translate('apiClient.oauthScopesAddModal.add'),\n)\nconst submitLabel = computed(() =>\n isEditMode.value\n ? translate('apiClient.oauthScopesAddModal.save')\n : translate('apiClient.oauthScopesAddModal.add'),\n)\n\nconst scopeData = ref({\n name: '',\n description: '',\n})\n\n/**\n * Tracks whether the user has interacted with the name field so we can defer the\n * \"name is required\" hint until after the first edit, rather than on initial render.\n */\nconst hasTouchedName = ref(false)\n\nwatch(\n () => scopeData.value.name,\n () => {\n hasTouchedName.value = true\n },\n)\n\nconst trimmedName = computed(() => scopeData.value.name.trim())\n\n/**\n * Whether the chosen name collides with an existing scope on the flow.\n * In edit mode we allow keeping the original name unchanged.\n */\nconst isDuplicateName = computed(() => {\n if (!trimmedName.value) {\n return false\n }\n if (isEditMode.value && trimmedName.value === scope?.name) {\n return false\n }\n return scopes.includes(trimmedName.value)\n})\n\n/** Human readable validation message rendered inline in the modal */\nconst validationError = computed<string | null>(() => {\n if (isDuplicateName.value) {\n return translate('apiClient.oauthScopesAddModal.duplicate', {\n name: trimmedName.value,\n })\n }\n if (hasTouchedName.value && !trimmedName.value) {\n return translate('apiClient.oauthScopesAddModal.required')\n }\n return null\n})\n\nconst isSubmitDisabled = computed(\n () => !trimmedName.value || isDuplicateName.value,\n)\n\nconst handleSubmit = () => {\n if (isSubmitDisabled.value) {\n return\n }\n\n emit('submit', {\n name: trimmedName.value,\n description: scopeData.value.description,\n ...(isEditMode.value && scope ? { oldName: scope.name } : {}),\n })\n state.hide()\n}\n\nwatch(\n () => state.open,\n (isOpen) => {\n if (!isOpen) {\n return\n }\n\n scopeData.value = scope\n ? { name: scope.name, description: scope.description }\n : { name: '', description: '' }\n // Clearing `name` schedules the `scopeData.name` watcher, which sets\n // `hasTouchedName` back to true in the same flush. Defer the reset so it\n // runs after that watcher and reopening add mode does not show a false\n // \"Scope name is required\" error.\n void nextTick(() => {\n hasTouchedName.value = false\n })\n },\n)\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"overflow-y-auto\"\n size=\"xs\"\n :state=\"state\"\n :title=\"title\">\n <CommandActionForm\n :disabled=\"isSubmitDisabled\"\n @cancel=\"emit('cancel')\"\n @submit=\"handleSubmit\">\n <!-- Name -->\n <div class=\"flex min-h-8 items-start gap-2 text-sm\">\n {{ translate('apiClient.oauthScopesAddModal.name')\n }}<CommandActionInput\n v-model=\"scopeData.name\"\n autofocus\n class=\"field-sizing-content !p-0\"\n placeholder=\"read:user\" />\n </div>\n\n <!-- Description -->\n <div class=\"flex min-h-8 items-start gap-2 text-sm\">\n {{ translate('apiClient.oauthScopesAddModal.description')\n }}<CommandActionInput\n v-model=\"scopeData.description\"\n :autofocus=\"false\"\n class=\"field-sizing-content !p-0\"\n :placeholder=\"\n translate('apiClient.oauthScopesAddModal.readUserData')\n \" />\n </div>\n\n <!-- Inline validation error -->\n <div\n v-if=\"validationError\"\n class=\"text-red text-xs\"\n role=\"alert\">\n {{ validationError }}\n </div>\n\n <template #submit>{{ submitLabel }}</template>\n </CommandActionForm>\n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F,UAAU,QAAQ,QAAA,QACd;IAAE,MAAM,QAAA,MAAM;IAAM,aAAa,QAAA,MAAM;GAAY,IACnD;IAAE,MAAM;IAAI,aAAa;GAAG;GAKhC,eAAoB;IAClB,eAAe,QAAQ;GACzB,CAAC;EACH,CACF;;uBAIE,YAyCc,MAAA,WAAA,GAAA;IAxCZ,WAAU;IACV,MAAK;IACJ,OAAO,QAAA;IACP,OAAO,MAAA;;2BAoCY,CAnCpB,YAmCoB,MAAA,yBAAA,GAAA;KAlCjB,UAAU,iBAAA;KACV,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;KACZ,UAAQ;;KA+BE,QAAM,cAAkB,CAAA,gBAAA,gBAAd,YAAA,KAAW,GAAA,CAAA,CAAA,CAAA;4BAtB1B;MAPN,mBAOM,OAPN,YAOM,CAAA,gBAAA,gBAND,MAAA,SAAA,CAAS,CAAA,oCAAA,CAAA,GAAA,CAAA,GACV,YAI0B,MAAA,0BAAA,GAAA;mBAHjB,UAAA,MAAU;8EAAV,MAAU,OAAI;OACvB,WAAA;OACA,OAAM;OACN,aAAY;;MAIhB,mBASM,OATN,YASM,CAAA,gBAAA,gBARD,MAAA,SAAA,CAAS,CAAA,2CAAA,CAAA,GAAA,CAAA,GACV,YAMI,MAAA,0BAAA,GAAA;mBALK,UAAA,MAAU;8EAAV,MAAU,cAAW;OAC7B,WAAW;OACZ,OAAM;OACL,aAA0B,MAAA,SAAA,CAAS,CAAA,4CAAA;;MAOhC,gBAAA,SAAA,UAAA,GADR,mBAKM,OALN,YAKM,gBADD,gBAAA,KAAe,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAiXA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,8DAA8D,CAAA;AAWrE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;IAChC,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;AAstBF,QAAA,MAAM,YAAY;;iBA/sBM,MAAM,EAAE;gBAAU,MAAM;mBAAa,OAAO;;;;;;;;;;;;;;;;;iBAA5C,MAAM,EAAE;gBAAU,MAAM;mBAAa,OAAO;;;;;;;;;;;;;;;kFAktBlE,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AA+YA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,8DAA8D,CAAA;AAYrE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;IAChC,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;AA+vBF,QAAA,MAAM,YAAY;;iBAxvBM,MAAM,EAAE;gBAAU,MAAM;mBAAa,OAAO;;;;;;;;;;;;;;;;;iBAA5C,MAAM,EAAE;gBAAU,MAAM;mBAAa,OAAO;;;;;;;;;;;;;;;kFA2vBlE,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesInput.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarIconPencilSimple, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport type {\n OAuthFlow,\n OAuthFlowsObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nimport OAuthScopesAddModal from './OAuthScopesAddModal.vue'\n\nconst { selectedScopes, flow, flowType } = defineProps<{\n flowType: keyof OAuthFlowsObject\n flow: OAuthFlow\n selectedScopes: string[]\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: { scopes?: string[]; scope?: string; selected?: boolean },\n ): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst searchQuery = ref('')\n\n/**\n * The scope currently being edited, used to switch the shared modal into edit mode.\n * Null means the modal is in \"add\" mode.\n */\nconst editingScope = ref<{ name: string; description: string } | null>(null)\n\n/** List of all available scopes */\nconst scopes = computed(() =>\n Object.entries(flow?.scopes ?? {}).map(([key, val]) => ({\n id: key,\n label: key,\n description: val,\n })),\n)\n\nconst scopeCount = computed(() => Object.keys(flow?.scopes ?? {}).length)\n\n/** Search is only useful once the list is long enough to scan */\nconst showScopeSearch = computed(() => scopeCount.value >= 10)\n\nconst filteredScopes = computed(() => {\n const query = showScopeSearch.value ? searchQuery.value : ''\n if (!query) {\n return scopes.value\n }\n\n const regex = new RegExp(\n query\n .split('')\n .map((c) => c.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('.*'),\n 'i',\n )\n\n return scopes.value.filter(({ label, description }) =>\n regex.test(`${label} ${description}`),\n )\n})\n\nconst hasScopes = computed(() => Object.keys(flow?.scopes ?? {}).length > 0)\n\nconst allScopesSelected = computed(\n () => selectedScopes.length === Object.keys(flow?.scopes ?? {}).length,\n)\n\nconst setScope = (scopeKey: string, checked: boolean) => {\n // Emit a single-scope toggle rather than a freshly computed list. The store applies it\n // against the currently selected scopes, so two quick clicks cannot overwrite each other\n // with a list computed from a prop that has not updated yet.\n emits('update:selectedScopes', { scope: scopeKey, selected: checked })\n}\n\n/** Select all scopes */\nconst selectAllScopes = () =>\n emits('update:selectedScopes', { scopes: Object.keys(flow?.scopes ?? {}) })\n\n/** Deselect all scopes */\nconst deselectAllScopes = () => emits('update:selectedScopes', { scopes: [] })\n\nconst scopeFormModal = useModal()\n\n/**\n * Forces the Disclosure to remount with `defaultOpen` set so the panel auto-expands\n * the moment a brand-new scope is added. Bumping this counter is paired with toggling\n * `expandOnNextMount` so the remount opens the panel, then reverts to the default\n * closed-on-mount behavior for any future unrelated remounts (e.g. collapse on empty).\n *\n * The Disclosure `:key` is only this counter — not a separate `hasScopes` segment — so\n * adding the first scope does not remount twice (empty prefix → with-scopes prefix),\n * which would reopen with `defaultOpen=false` and collapse the panel right when rows appear.\n */\nconst remountKey = ref(0)\nconst expandOnNextMount = ref(false)\n\nwatch(hasScopes, (has, had) => {\n if (had && !has) {\n expandOnNextMount.value = false\n remountKey.value += 1\n }\n})\n\n/** Open the modal in \"add new scope\" mode */\nconst openAddScopeModal = () => {\n editingScope.value = null\n scopeFormModal.show()\n}\n\n/** Open the modal in \"edit scope\" mode prefilled with the chosen row */\nconst openEditScopeModal = (scope: { id: string; description: string }) => {\n editingScope.value = {\n name: scope.id,\n description: scope.description ?? '',\n }\n scopeFormModal.show()\n}\n\n/**\n * Submit handler shared by Add Scope and Edit Scope. For renames, the `upsertScope` mutator on\n * the workspace store rewrites the selection state in place, so the component does not need to\n * emit a follow-up `update:selectedScopes`.\n *\n * When adding a brand-new scope (no `oldName`), the payload sets `enable: true` so the\n * `upsertScope` mutator also adds the new scope to any selection requirement that references\n * this scheme. The Disclosure is then remounted with `defaultOpen=true` so the user\n * immediately sees (and sees selected) the scope they just added.\n */\nconst handleScopeFormSubmit = async (payload: {\n name: string\n description: string\n oldName?: string\n}) => {\n const isAdd = !payload.oldName\n\n emits('upsert:scope', {\n scope: payload.name,\n description: payload.description,\n flowType,\n ...(payload.oldName ? { oldScope: payload.oldName } : {}),\n ...(isAdd ? { enable: true } : {}),\n })\n\n if (!isAdd) {\n return\n }\n\n expandOnNextMount.value = true\n remountKey.value += 1\n // Reset after the remount so subsequent unrelated remounts (e.g. when the last\n // scope is deleted) still default to a closed panel.\n await nextTick()\n expandOnNextMount.value = false\n}\n\n/**\n * Remove the scope from the flow. Selection cleanup (dropping the deleted key from any\n * currently-selected scopes) is handled by the `deleteScope` mutator on the workspace store,\n * so the component does not need to emit a follow-up `update:selectedScopes` here.\n */\nconst handleDeleteScope = (scopeKey: string) => {\n emits('delete:scope', { scope: scopeKey, flowType })\n}\n</script>\n\n<template>\n <DataTableCell class=\"h-auto !max-h-[initial] min-h-8 items-center\">\n <div class=\"flex h-fit w-full\">\n <div class=\"text-c-1 h-full items-center\"></div>\n <Disclosure\n :key=\"remountKey\"\n as=\"div\"\n class=\"bl flex w-full flex-col\"\n :defaultOpen=\"expandOnNextMount\">\n <!--\n Keep Add Scope (and other actions) outside the summary DisclosureButton.\n When there are no scopes the summary control is disabled; a native disabled\n button blocks pointer events for all descendants, which would make Add Scope unusable.\n -->\n <div\n class=\"group/scopes-accordion flex h-auto min-h-8 items-center gap-1.5 pr-2.25 pl-3 text-left\">\n <DisclosureButton\n :class=\"[\n 'min-w-0 flex-1 text-left',\n hasScopes ? 'hover:text-c-1 cursor-pointer' : 'cursor-default',\n (selectedScopes.length || 0) > 0 ? 'text-c-1' : 'text-c-3',\n ]\"\n :disabled=\"!hasScopes\">\n <template v-if=\"hasScopes\">\n Scopes Selected\n {{ selectedScopes.length || 0 }} /\n {{ Object.keys(flow?.scopes ?? {}).length || 0 }}\n </template>\n <template v-else> No Scopes Defined </template>\n </DisclosureButton>\n\n <div class=\"flex shrink-0 items-center gap-1.75\">\n <!-- Add new scope -->\n <ScalarButton\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"openAddScopeModal\">\n Add Scope\n </ScalarButton>\n\n <!-- Deselect All -->\n <ScalarButton\n v-if=\"hasScopes && allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deselectAllScopes\">\n Deselect All\n </ScalarButton>\n\n <!-- Select All -->\n <ScalarButton\n v-if=\"hasScopes && !allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"selectAllScopes\">\n Select All\n </ScalarButton>\n\n <DisclosureButton\n v-if=\"hasScopes\"\n v-slot=\"{ open }\"\n class=\"text-c-3 hover:text-c-2 -m-0.5 flex shrink-0 items-center justify-center rounded p-0.5 focus-visible:outline-offset-2\">\n <ScalarIcon\n class=\"group-hover/scopes-accordion:text-c-2\"\n :icon=\"open ? 'ChevronDown' : 'ChevronRight'\"\n size=\"md\" />\n </DisclosureButton>\n </div>\n </div>\n <!-- Scopes List -->\n <DisclosurePanel as=\"template\">\n <div>\n <ScalarSearchInput\n v-if=\"showScopeSearch\"\n v-model=\"searchQuery\"\n class=\"flex items-center text-xs\" />\n <table\n class=\"grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-auto\"\n :style=\"{ gridTemplateColumns: '1fr auto' }\">\n <DataTableRow\n v-for=\"{ id, label, description } in filteredScopes\"\n :key=\"id\"\n class=\"text-c-2 group/scope-row\"\n @click=\"setScope(id, !selectedScopes.includes(id))\">\n <DataTableCell\n class=\"box-border flex !max-h-[initial] w-full min-w-0 cursor-pointer items-stretch overflow-hidden px-0 py-0\">\n <!-- Text scrolls horizontally; action rail stays fixed -->\n <div\n class=\"no-scrollbar text-c-2 group-hover/scope-row:text-c-1 flex min-h-8 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-3 py-1.5 pr-20 text-xs text-nowrap\">\n <span class=\"font-code shrink-0 text-xs\">{{ label }}</span>\n <template v-if=\"String(description ?? '').trim()\">\n <span class=\"shrink-0\">&ndash;</span>\n <span class=\"whitespace-nowrap\">{{ description }}</span>\n </template>\n </div>\n <div\n class=\"oauth-scope-row-action-rail absolute top-0 right-0 z-[1] flex h-full min-w-[4.5rem] items-center justify-end gap-0.5 py-1 pr-2 pl-4 opacity-0 transition-opacity group-focus-within/scope-row:opacity-100 group-hover/scope-row:opacity-100\"\n @click.stop>\n <ScalarIconButton\n :icon=\"ScalarIconPencilSimple\"\n :label=\"`Edit ${label}`\"\n size=\"sm\"\n @click.stop=\"\n openEditScopeModal({\n id,\n description: description ?? '',\n })\n \" />\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n :label=\"`Delete ${label}`\"\n size=\"sm\"\n @click.stop=\"handleDeleteScope(id)\" />\n </div>\n </DataTableCell>\n <!--\n Stop the click here so it does not also bubble to the row's `@click`\n toggle. The checkbox already drives the change via `@update:modelValue`;\n letting the row fire too would toggle the scope a second time.\n -->\n <DataTableCheckbox\n :ariaLabel=\"`Select ${label} scope`\"\n :modelValue=\"selectedScopes.includes(id)\"\n @click.stop\n @update:modelValue=\"setScope(id, $event)\" />\n </DataTableRow>\n </table>\n </div>\n </DisclosurePanel>\n </Disclosure>\n </div>\n\n <!-- Shared add/edit scope modal -->\n <OAuthScopesAddModal\n :scope=\"editingScope\"\n :scopes=\"Object.keys(flow.scopes ?? {})\"\n :state=\"scopeFormModal\"\n @submit=\"handleScopeFormSubmit\" />\n </DataTableCell>\n</template>\n\n<style>\n/* Matches AddressBar.vue `.address-bar-bg-states` / `.fade-right` (header URL input). */\n.oauth-scope-row-action-rail {\n --oauth-scope-row-rail-bg: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 100%) 0%,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 20%) 30%,\n var(--oauth-scope-row-rail-bg) 100%\n );\n}\n\n.no-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.no-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"OAuthScopesInput.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarIconPencilSimple, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport type {\n OAuthFlow,\n OAuthFlowsObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport OAuthScopesAddModal from './OAuthScopesAddModal.vue'\n\nconst { selectedScopes, flow, flowType } = defineProps<{\n flowType: keyof OAuthFlowsObject\n flow: OAuthFlow\n selectedScopes: string[]\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: { scopes?: string[]; scope?: string; selected?: boolean },\n ): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst searchQuery = ref('')\n\n/**\n * The scope currently being edited, used to switch the shared modal into edit mode.\n * Null means the modal is in \"add\" mode.\n */\nconst editingScope = ref<{ name: string; description: string } | null>(null)\n\n/** List of all available scopes */\nconst scopes = computed(() =>\n Object.entries(flow?.scopes ?? {}).map(([key, val]) => ({\n id: key,\n label: key,\n description: val,\n })),\n)\n\nconst scopeCount = computed(() => Object.keys(flow?.scopes ?? {}).length)\n\n/** Search is only useful once the list is long enough to scan */\nconst showScopeSearch = computed(() => scopeCount.value >= 10)\n\nconst filteredScopes = computed(() => {\n const query = showScopeSearch.value ? searchQuery.value : ''\n if (!query) {\n return scopes.value\n }\n\n const regex = new RegExp(\n query\n .split('')\n .map((c) => c.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('.*'),\n 'i',\n )\n\n return scopes.value.filter(({ label, description }) =>\n regex.test(`${label} ${description}`),\n )\n})\n\nconst hasScopes = computed(() => Object.keys(flow?.scopes ?? {}).length > 0)\n\nconst allScopesSelected = computed(\n () => selectedScopes.length === Object.keys(flow?.scopes ?? {}).length,\n)\n\nconst setScope = (scopeKey: string, checked: boolean) => {\n // Emit a single-scope toggle rather than a freshly computed list. The store applies it\n // against the currently selected scopes, so two quick clicks cannot overwrite each other\n // with a list computed from a prop that has not updated yet.\n emits('update:selectedScopes', { scope: scopeKey, selected: checked })\n}\n\n/** Select all scopes */\nconst selectAllScopes = () =>\n emits('update:selectedScopes', { scopes: Object.keys(flow?.scopes ?? {}) })\n\n/** Deselect all scopes */\nconst deselectAllScopes = () => emits('update:selectedScopes', { scopes: [] })\n\nconst scopeFormModal = useModal()\n\n/**\n * Forces the Disclosure to remount with `defaultOpen` set so the panel auto-expands\n * the moment a brand-new scope is added. Bumping this counter is paired with toggling\n * `expandOnNextMount` so the remount opens the panel, then reverts to the default\n * closed-on-mount behavior for any future unrelated remounts (e.g. collapse on empty).\n *\n * The Disclosure `:key` is only this counter — not a separate `hasScopes` segment — so\n * adding the first scope does not remount twice (empty prefix → with-scopes prefix),\n * which would reopen with `defaultOpen=false` and collapse the panel right when rows appear.\n */\nconst remountKey = ref(0)\nconst expandOnNextMount = ref(false)\n\nwatch(hasScopes, (has, had) => {\n if (had && !has) {\n expandOnNextMount.value = false\n remountKey.value += 1\n }\n})\n\n/** Open the modal in \"add new scope\" mode */\nconst openAddScopeModal = () => {\n editingScope.value = null\n scopeFormModal.show()\n}\n\n/** Open the modal in \"edit scope\" mode prefilled with the chosen row */\nconst openEditScopeModal = (scope: { id: string; description: string }) => {\n editingScope.value = {\n name: scope.id,\n description: scope.description ?? '',\n }\n scopeFormModal.show()\n}\n\n/**\n * Submit handler shared by Add Scope and Edit Scope. For renames, the `upsertScope` mutator on\n * the workspace store rewrites the selection state in place, so the component does not need to\n * emit a follow-up `update:selectedScopes`.\n *\n * When adding a brand-new scope (no `oldName`), the payload sets `enable: true` so the\n * `upsertScope` mutator also adds the new scope to any selection requirement that references\n * this scheme. The Disclosure is then remounted with `defaultOpen=true` so the user\n * immediately sees (and sees selected) the scope they just added.\n */\nconst handleScopeFormSubmit = async (payload: {\n name: string\n description: string\n oldName?: string\n}) => {\n const isAdd = !payload.oldName\n\n emits('upsert:scope', {\n scope: payload.name,\n description: payload.description,\n flowType,\n ...(payload.oldName ? { oldScope: payload.oldName } : {}),\n ...(isAdd ? { enable: true } : {}),\n })\n\n if (!isAdd) {\n return\n }\n\n expandOnNextMount.value = true\n remountKey.value += 1\n // Reset after the remount so subsequent unrelated remounts (e.g. when the last\n // scope is deleted) still default to a closed panel.\n await nextTick()\n expandOnNextMount.value = false\n}\n\n/**\n * Remove the scope from the flow. Selection cleanup (dropping the deleted key from any\n * currently-selected scopes) is handled by the `deleteScope` mutator on the workspace store,\n * so the component does not need to emit a follow-up `update:selectedScopes` here.\n */\nconst handleDeleteScope = (scopeKey: string) => {\n emits('delete:scope', { scope: scopeKey, flowType })\n}\n</script>\n\n<template>\n <DataTableCell class=\"h-auto !max-h-[initial] min-h-8 items-center\">\n <div class=\"flex h-fit w-full\">\n <div class=\"text-c-1 h-full items-center\"></div>\n <Disclosure\n :key=\"remountKey\"\n as=\"div\"\n class=\"bl flex w-full flex-col\"\n :defaultOpen=\"expandOnNextMount\">\n <!--\n Keep Add Scope (and other actions) outside the summary DisclosureButton.\n When there are no scopes the summary control is disabled; a native disabled\n button blocks pointer events for all descendants, which would make Add Scope unusable.\n -->\n <div\n class=\"group/scopes-accordion flex h-auto min-h-8 items-center gap-1.5 pr-2.25 pl-3 text-left\">\n <DisclosureButton\n :class=\"[\n 'min-w-0 flex-1 text-left',\n hasScopes ? 'hover:text-c-1 cursor-pointer' : 'cursor-default',\n (selectedScopes.length || 0) > 0 ? 'text-c-1' : 'text-c-3',\n ]\"\n :disabled=\"!hasScopes\">\n <template v-if=\"hasScopes\">\n {{\n translate('apiClient.oauthScopesInput.selectedScopes', {\n count: selectedScopes.length,\n total: Object.keys(flow?.scopes ?? {}).length,\n })\n }}\n </template>\n <template v-else>\n {{ translate('apiClient.oauthScopesInput.noScopesDefined') }}\n </template>\n </DisclosureButton>\n\n <div class=\"flex shrink-0 items-center gap-1.75\">\n <!-- Add new scope -->\n <ScalarButton\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"openAddScopeModal\">\n {{ translate('apiClient.oauthScopesInput.addScope') }}\n </ScalarButton>\n\n <!-- Deselect All -->\n <ScalarButton\n v-if=\"hasScopes && allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deselectAllScopes\">\n {{ translate('apiClient.oauthScopesInput.deselectAll') }}\n </ScalarButton>\n\n <!-- Select All -->\n <ScalarButton\n v-if=\"hasScopes && !allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"selectAllScopes\">\n {{ translate('apiClient.oauthScopesInput.selectAll') }}\n </ScalarButton>\n\n <DisclosureButton\n v-if=\"hasScopes\"\n v-slot=\"{ open }\"\n class=\"text-c-3 hover:text-c-2 -m-0.5 flex shrink-0 items-center justify-center rounded p-0.5 focus-visible:outline-offset-2\">\n <ScalarIcon\n class=\"group-hover/scopes-accordion:text-c-2\"\n :icon=\"open ? 'ChevronDown' : 'ChevronRight'\"\n size=\"md\" />\n </DisclosureButton>\n </div>\n </div>\n <!-- Scopes List -->\n <DisclosurePanel as=\"template\">\n <div>\n <ScalarSearchInput\n v-if=\"showScopeSearch\"\n v-model=\"searchQuery\"\n class=\"flex items-center text-xs\" />\n <table\n class=\"grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-auto\"\n :style=\"{ gridTemplateColumns: '1fr auto' }\">\n <!--\n The HTML parser inserts a `tbody` around rows that sit directly under a `table`,\n so the rows are wrapped in one here to keep server-rendered markup hydratable.\n `contents` keeps it out of the table's grid, the same way the rows lay\n themselves out.\n -->\n <tbody class=\"contents\">\n <DataTableRow\n v-for=\"{ id, label, description } in filteredScopes\"\n :key=\"id\"\n class=\"text-c-2 group/scope-row\"\n @click=\"setScope(id, !selectedScopes.includes(id))\">\n <DataTableCell\n class=\"box-border flex !max-h-[initial] w-full min-w-0 cursor-pointer items-stretch overflow-hidden px-0 py-0\">\n <!-- Text scrolls horizontally; action rail stays fixed -->\n <div\n class=\"no-scrollbar text-c-2 group-hover/scope-row:text-c-1 flex min-h-8 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-3 py-1.5 pr-20 text-xs text-nowrap\">\n <span class=\"font-code shrink-0 text-xs\">{{\n label\n }}</span>\n <template v-if=\"String(description ?? '').trim()\">\n <span class=\"shrink-0\">&ndash;</span>\n <span class=\"whitespace-nowrap\">{{ description }}</span>\n </template>\n </div>\n <div\n class=\"oauth-scope-row-action-rail absolute top-0 right-0 z-[1] flex h-full min-w-[4.5rem] items-center justify-end gap-0.5 py-1 pr-2 pl-4 opacity-0 transition-opacity group-focus-within/scope-row:opacity-100 group-hover/scope-row:opacity-100\"\n @click.stop>\n <ScalarIconButton\n :icon=\"ScalarIconPencilSimple\"\n :label=\"\n translate('apiClient.oauthScopesInput.editScope', {\n name: label,\n })\n \"\n size=\"sm\"\n @click.stop=\"\n openEditScopeModal({\n id,\n description: description ?? '',\n })\n \" />\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n :label=\"\n translate('apiClient.oauthScopesInput.deleteScope', {\n name: label,\n })\n \"\n size=\"sm\"\n @click.stop=\"handleDeleteScope(id)\" />\n </div>\n </DataTableCell>\n <!--\n Stop the click here so it does not also bubble to the row's `@click`\n toggle. The checkbox already drives the change via `@update:modelValue`;\n letting the row fire too would toggle the scope a second time.\n -->\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.oauthScopesInput.selectScope', {\n name: label,\n })\n \"\n :modelValue=\"selectedScopes.includes(id)\"\n @click.stop\n @update:modelValue=\"setScope(id, $event)\" />\n </DataTableRow>\n </tbody>\n </table>\n </div>\n </DisclosurePanel>\n </Disclosure>\n </div>\n\n <!-- Shared add/edit scope modal -->\n <OAuthScopesAddModal\n :scope=\"editingScope\"\n :scopes=\"Object.keys(flow.scopes ?? {})\"\n :state=\"scopeFormModal\"\n @submit=\"handleScopeFormSubmit\" />\n </DataTableCell>\n</template>\n\n<style>\n/* Matches AddressBar.vue `.address-bar-bg-states` / `.fade-right` (header URL input). */\n.oauth-scope-row-action-rail {\n --oauth-scope-row-rail-bg: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 100%) 0%,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 20%) 30%,\n var(--oauth-scope-row-rail-bg) 100%\n );\n}\n\n.no-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.no-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n</style>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../../features/localization/index.js";
1
2
  import DataTableCell_default from "../../../components/data-table/DataTableCell.vue.js";
2
3
  import DataTableCheckbox_default from "../../../components/data-table/DataTableCheckbox.vue.js";
3
4
  import DataTableRow_default from "../../../components/data-table/DataTableRow.vue.js";
@@ -18,9 +19,10 @@ var _hoisted_4 = {
18
19
  class: "grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-auto",
19
20
  style: { gridTemplateColumns: "1fr auto" }
20
21
  };
21
- var _hoisted_5 = { class: "no-scrollbar text-c-2 group-hover/scope-row:text-c-1 flex min-h-8 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-3 py-1.5 pr-20 text-xs text-nowrap" };
22
- var _hoisted_6 = { class: "font-code shrink-0 text-xs" };
23
- var _hoisted_7 = { class: "whitespace-nowrap" };
22
+ var _hoisted_5 = { class: "contents" };
23
+ var _hoisted_6 = { class: "no-scrollbar text-c-2 group-hover/scope-row:text-c-1 flex min-h-8 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-3 py-1.5 pr-20 text-xs text-nowrap" };
24
+ var _hoisted_7 = { class: "font-code shrink-0 text-xs" };
25
+ var _hoisted_8 = { class: "whitespace-nowrap" };
24
26
  var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
25
27
  __name: "OAuthScopesInput",
26
28
  props: {
@@ -35,6 +37,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
35
37
  ],
36
38
  setup(__props, { emit: __emit }) {
37
39
  const emits = __emit;
40
+ const { translate } = useLocalization();
38
41
  const searchQuery = ref("");
39
42
  /**
40
43
  * The scope currently being edited, used to switch the shared modal into edit mode.
@@ -138,7 +141,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
138
141
  };
139
142
  return (_ctx, _cache) => {
140
143
  return openBlock(), createBlock(unref(DataTableCell_default), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
141
- default: withCtx(() => [createElementVNode("div", _hoisted_1, [_cache[7] || (_cache[7] = createElementVNode("div", { class: "text-c-1 h-full items-center" }, null, -1)), (openBlock(), createBlock(unref(Disclosure), {
144
+ default: withCtx(() => [createElementVNode("div", _hoisted_1, [_cache[4] || (_cache[4] = createElementVNode("div", { class: "text-c-1 h-full items-center" }, null, -1)), (openBlock(), createBlock(unref(Disclosure), {
142
145
  key: remountKey.value,
143
146
  as: "div",
144
147
  class: "bl flex w-full flex-col",
@@ -152,7 +155,10 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
152
155
  ]),
153
156
  disabled: !hasScopes.value
154
157
  }, {
155
- default: withCtx(() => [hasScopes.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Scopes Selected " + toDisplayString(__props.selectedScopes.length || 0) + " / " + toDisplayString(Object.keys(__props.flow?.scopes ?? {}).length || 0), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" No Scopes Defined ")], 64))]),
158
+ default: withCtx(() => [hasScopes.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(unref(translate)("apiClient.oauthScopesInput.selectedScopes", {
159
+ count: __props.selectedScopes.length,
160
+ total: Object.keys(__props.flow?.scopes ?? {}).length
161
+ })), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(unref(translate)("apiClient.oauthScopesInput.noScopesDefined")), 1)], 64))]),
156
162
  _: 1
157
163
  }, 8, ["class", "disabled"]), createElementVNode("div", _hoisted_3, [
158
164
  createVNode(unref(ScalarButton), {
@@ -161,7 +167,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
161
167
  variant: "ghost",
162
168
  onClick: withModifiers(openAddScopeModal, ["stop"])
163
169
  }, {
164
- default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" Add Scope ", -1)])]),
170
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauthScopesInput.addScope")), 1)]),
165
171
  _: 1
166
172
  }),
167
173
  hasScopes.value && allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
@@ -171,7 +177,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
171
177
  variant: "ghost",
172
178
  onClick: withModifiers(deselectAllScopes, ["stop"])
173
179
  }, {
174
- default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" Deselect All ", -1)])]),
180
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauthScopesInput.deselectAll")), 1)]),
175
181
  _: 1
176
182
  })) : createCommentVNode("", true),
177
183
  hasScopes.value && !allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
@@ -181,7 +187,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
181
187
  variant: "ghost",
182
188
  onClick: withModifiers(selectAllScopes, ["stop"])
183
189
  }, {
184
- default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" Select All ", -1)])]),
190
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauthScopesInput.selectAll")), 1)]),
185
191
  _: 1
186
192
  })) : createCommentVNode("", true),
187
193
  hasScopes.value ? (openBlock(), createBlock(unref(DisclosureButton), {
@@ -201,19 +207,19 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
201
207
  modelValue: searchQuery.value,
202
208
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
203
209
  class: "flex items-center text-xs"
204
- }, null, 8, ["modelValue"])) : createCommentVNode("", true), createElementVNode("table", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredScopes.value, ({ id, label, description }) => {
210
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true), createElementVNode("table", _hoisted_4, [createElementVNode("tbody", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredScopes.value, ({ id, label, description }) => {
205
211
  return openBlock(), createBlock(unref(DataTableRow_default), {
206
212
  key: id,
207
213
  class: "text-c-2 group/scope-row",
208
214
  onClick: ($event) => setScope(id, !__props.selectedScopes.includes(id))
209
215
  }, {
210
216
  default: withCtx(() => [createVNode(unref(DataTableCell_default), { class: "box-border flex !max-h-[initial] w-full min-w-0 cursor-pointer items-stretch overflow-hidden px-0 py-0" }, {
211
- default: withCtx(() => [createElementVNode("div", _hoisted_5, [createElementVNode("span", _hoisted_6, toDisplayString(label), 1), String(description ?? "").trim() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[6] || (_cache[6] = createElementVNode("span", { class: "shrink-0" }, "–", -1)), createElementVNode("span", _hoisted_7, toDisplayString(description), 1)], 64)) : createCommentVNode("", true)]), createElementVNode("div", {
217
+ default: withCtx(() => [createElementVNode("div", _hoisted_6, [createElementVNode("span", _hoisted_7, toDisplayString(label), 1), String(description ?? "").trim() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[3] || (_cache[3] = createElementVNode("span", { class: "shrink-0" }, "–", -1)), createElementVNode("span", _hoisted_8, toDisplayString(description), 1)], 64)) : createCommentVNode("", true)]), createElementVNode("div", {
212
218
  class: "oauth-scope-row-action-rail absolute top-0 right-0 z-[1] flex h-full min-w-[4.5rem] items-center justify-end gap-0.5 py-1 pr-2 pl-4 opacity-0 transition-opacity group-focus-within/scope-row:opacity-100 group-hover/scope-row:opacity-100",
213
219
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
214
220
  }, [createVNode(unref(ScalarIconButton), {
215
221
  icon: unref(ScalarIconPencilSimple),
216
- label: `Edit ${label}`,
222
+ label: unref(translate)("apiClient.oauthScopesInput.editScope", { name: label }),
217
223
  size: "sm",
218
224
  onClick: withModifiers(($event) => openEditScopeModal({
219
225
  id,
@@ -225,7 +231,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
225
231
  "onClick"
226
232
  ]), createVNode(unref(ScalarIconButton), {
227
233
  icon: unref(ScalarIconTrash),
228
- label: `Delete ${label}`,
234
+ label: unref(translate)("apiClient.oauthScopesInput.deleteScope", { name: label }),
229
235
  size: "sm",
230
236
  onClick: withModifiers(($event) => handleDeleteScope(id), ["stop"])
231
237
  }, null, 8, [
@@ -235,7 +241,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
235
241
  ])])]),
236
242
  _: 2
237
243
  }, 1024), createVNode(unref(DataTableCheckbox_default), {
238
- ariaLabel: `Select ${label} scope`,
244
+ ariaLabel: unref(translate)("apiClient.oauthScopesInput.selectScope", { name: label }),
239
245
  modelValue: __props.selectedScopes.includes(id),
240
246
  onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
241
247
  "onUpdate:modelValue": ($event) => setScope(id, $event)
@@ -246,7 +252,7 @@ var OAuthScopesInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
246
252
  ])]),
247
253
  _: 2
248
254
  }, 1032, ["onClick"]);
249
- }), 128))])])]),
255
+ }), 128))])])])]),
250
256
  _: 1
251
257
  })]),
252
258
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesInput.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarIconPencilSimple, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport type {\n OAuthFlow,\n OAuthFlowsObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nimport OAuthScopesAddModal from './OAuthScopesAddModal.vue'\n\nconst { selectedScopes, flow, flowType } = defineProps<{\n flowType: keyof OAuthFlowsObject\n flow: OAuthFlow\n selectedScopes: string[]\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: { scopes?: string[]; scope?: string; selected?: boolean },\n ): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst searchQuery = ref('')\n\n/**\n * The scope currently being edited, used to switch the shared modal into edit mode.\n * Null means the modal is in \"add\" mode.\n */\nconst editingScope = ref<{ name: string; description: string } | null>(null)\n\n/** List of all available scopes */\nconst scopes = computed(() =>\n Object.entries(flow?.scopes ?? {}).map(([key, val]) => ({\n id: key,\n label: key,\n description: val,\n })),\n)\n\nconst scopeCount = computed(() => Object.keys(flow?.scopes ?? {}).length)\n\n/** Search is only useful once the list is long enough to scan */\nconst showScopeSearch = computed(() => scopeCount.value >= 10)\n\nconst filteredScopes = computed(() => {\n const query = showScopeSearch.value ? searchQuery.value : ''\n if (!query) {\n return scopes.value\n }\n\n const regex = new RegExp(\n query\n .split('')\n .map((c) => c.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('.*'),\n 'i',\n )\n\n return scopes.value.filter(({ label, description }) =>\n regex.test(`${label} ${description}`),\n )\n})\n\nconst hasScopes = computed(() => Object.keys(flow?.scopes ?? {}).length > 0)\n\nconst allScopesSelected = computed(\n () => selectedScopes.length === Object.keys(flow?.scopes ?? {}).length,\n)\n\nconst setScope = (scopeKey: string, checked: boolean) => {\n // Emit a single-scope toggle rather than a freshly computed list. The store applies it\n // against the currently selected scopes, so two quick clicks cannot overwrite each other\n // with a list computed from a prop that has not updated yet.\n emits('update:selectedScopes', { scope: scopeKey, selected: checked })\n}\n\n/** Select all scopes */\nconst selectAllScopes = () =>\n emits('update:selectedScopes', { scopes: Object.keys(flow?.scopes ?? {}) })\n\n/** Deselect all scopes */\nconst deselectAllScopes = () => emits('update:selectedScopes', { scopes: [] })\n\nconst scopeFormModal = useModal()\n\n/**\n * Forces the Disclosure to remount with `defaultOpen` set so the panel auto-expands\n * the moment a brand-new scope is added. Bumping this counter is paired with toggling\n * `expandOnNextMount` so the remount opens the panel, then reverts to the default\n * closed-on-mount behavior for any future unrelated remounts (e.g. collapse on empty).\n *\n * The Disclosure `:key` is only this counter — not a separate `hasScopes` segment — so\n * adding the first scope does not remount twice (empty prefix → with-scopes prefix),\n * which would reopen with `defaultOpen=false` and collapse the panel right when rows appear.\n */\nconst remountKey = ref(0)\nconst expandOnNextMount = ref(false)\n\nwatch(hasScopes, (has, had) => {\n if (had && !has) {\n expandOnNextMount.value = false\n remountKey.value += 1\n }\n})\n\n/** Open the modal in \"add new scope\" mode */\nconst openAddScopeModal = () => {\n editingScope.value = null\n scopeFormModal.show()\n}\n\n/** Open the modal in \"edit scope\" mode prefilled with the chosen row */\nconst openEditScopeModal = (scope: { id: string; description: string }) => {\n editingScope.value = {\n name: scope.id,\n description: scope.description ?? '',\n }\n scopeFormModal.show()\n}\n\n/**\n * Submit handler shared by Add Scope and Edit Scope. For renames, the `upsertScope` mutator on\n * the workspace store rewrites the selection state in place, so the component does not need to\n * emit a follow-up `update:selectedScopes`.\n *\n * When adding a brand-new scope (no `oldName`), the payload sets `enable: true` so the\n * `upsertScope` mutator also adds the new scope to any selection requirement that references\n * this scheme. The Disclosure is then remounted with `defaultOpen=true` so the user\n * immediately sees (and sees selected) the scope they just added.\n */\nconst handleScopeFormSubmit = async (payload: {\n name: string\n description: string\n oldName?: string\n}) => {\n const isAdd = !payload.oldName\n\n emits('upsert:scope', {\n scope: payload.name,\n description: payload.description,\n flowType,\n ...(payload.oldName ? { oldScope: payload.oldName } : {}),\n ...(isAdd ? { enable: true } : {}),\n })\n\n if (!isAdd) {\n return\n }\n\n expandOnNextMount.value = true\n remountKey.value += 1\n // Reset after the remount so subsequent unrelated remounts (e.g. when the last\n // scope is deleted) still default to a closed panel.\n await nextTick()\n expandOnNextMount.value = false\n}\n\n/**\n * Remove the scope from the flow. Selection cleanup (dropping the deleted key from any\n * currently-selected scopes) is handled by the `deleteScope` mutator on the workspace store,\n * so the component does not need to emit a follow-up `update:selectedScopes` here.\n */\nconst handleDeleteScope = (scopeKey: string) => {\n emits('delete:scope', { scope: scopeKey, flowType })\n}\n</script>\n\n<template>\n <DataTableCell class=\"h-auto !max-h-[initial] min-h-8 items-center\">\n <div class=\"flex h-fit w-full\">\n <div class=\"text-c-1 h-full items-center\"></div>\n <Disclosure\n :key=\"remountKey\"\n as=\"div\"\n class=\"bl flex w-full flex-col\"\n :defaultOpen=\"expandOnNextMount\">\n <!--\n Keep Add Scope (and other actions) outside the summary DisclosureButton.\n When there are no scopes the summary control is disabled; a native disabled\n button blocks pointer events for all descendants, which would make Add Scope unusable.\n -->\n <div\n class=\"group/scopes-accordion flex h-auto min-h-8 items-center gap-1.5 pr-2.25 pl-3 text-left\">\n <DisclosureButton\n :class=\"[\n 'min-w-0 flex-1 text-left',\n hasScopes ? 'hover:text-c-1 cursor-pointer' : 'cursor-default',\n (selectedScopes.length || 0) > 0 ? 'text-c-1' : 'text-c-3',\n ]\"\n :disabled=\"!hasScopes\">\n <template v-if=\"hasScopes\">\n Scopes Selected\n {{ selectedScopes.length || 0 }} /\n {{ Object.keys(flow?.scopes ?? {}).length || 0 }}\n </template>\n <template v-else> No Scopes Defined </template>\n </DisclosureButton>\n\n <div class=\"flex shrink-0 items-center gap-1.75\">\n <!-- Add new scope -->\n <ScalarButton\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"openAddScopeModal\">\n Add Scope\n </ScalarButton>\n\n <!-- Deselect All -->\n <ScalarButton\n v-if=\"hasScopes && allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deselectAllScopes\">\n Deselect All\n </ScalarButton>\n\n <!-- Select All -->\n <ScalarButton\n v-if=\"hasScopes && !allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"selectAllScopes\">\n Select All\n </ScalarButton>\n\n <DisclosureButton\n v-if=\"hasScopes\"\n v-slot=\"{ open }\"\n class=\"text-c-3 hover:text-c-2 -m-0.5 flex shrink-0 items-center justify-center rounded p-0.5 focus-visible:outline-offset-2\">\n <ScalarIcon\n class=\"group-hover/scopes-accordion:text-c-2\"\n :icon=\"open ? 'ChevronDown' : 'ChevronRight'\"\n size=\"md\" />\n </DisclosureButton>\n </div>\n </div>\n <!-- Scopes List -->\n <DisclosurePanel as=\"template\">\n <div>\n <ScalarSearchInput\n v-if=\"showScopeSearch\"\n v-model=\"searchQuery\"\n class=\"flex items-center text-xs\" />\n <table\n class=\"grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-auto\"\n :style=\"{ gridTemplateColumns: '1fr auto' }\">\n <DataTableRow\n v-for=\"{ id, label, description } in filteredScopes\"\n :key=\"id\"\n class=\"text-c-2 group/scope-row\"\n @click=\"setScope(id, !selectedScopes.includes(id))\">\n <DataTableCell\n class=\"box-border flex !max-h-[initial] w-full min-w-0 cursor-pointer items-stretch overflow-hidden px-0 py-0\">\n <!-- Text scrolls horizontally; action rail stays fixed -->\n <div\n class=\"no-scrollbar text-c-2 group-hover/scope-row:text-c-1 flex min-h-8 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-3 py-1.5 pr-20 text-xs text-nowrap\">\n <span class=\"font-code shrink-0 text-xs\">{{ label }}</span>\n <template v-if=\"String(description ?? '').trim()\">\n <span class=\"shrink-0\">&ndash;</span>\n <span class=\"whitespace-nowrap\">{{ description }}</span>\n </template>\n </div>\n <div\n class=\"oauth-scope-row-action-rail absolute top-0 right-0 z-[1] flex h-full min-w-[4.5rem] items-center justify-end gap-0.5 py-1 pr-2 pl-4 opacity-0 transition-opacity group-focus-within/scope-row:opacity-100 group-hover/scope-row:opacity-100\"\n @click.stop>\n <ScalarIconButton\n :icon=\"ScalarIconPencilSimple\"\n :label=\"`Edit ${label}`\"\n size=\"sm\"\n @click.stop=\"\n openEditScopeModal({\n id,\n description: description ?? '',\n })\n \" />\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n :label=\"`Delete ${label}`\"\n size=\"sm\"\n @click.stop=\"handleDeleteScope(id)\" />\n </div>\n </DataTableCell>\n <!--\n Stop the click here so it does not also bubble to the row's `@click`\n toggle. The checkbox already drives the change via `@update:modelValue`;\n letting the row fire too would toggle the scope a second time.\n -->\n <DataTableCheckbox\n :ariaLabel=\"`Select ${label} scope`\"\n :modelValue=\"selectedScopes.includes(id)\"\n @click.stop\n @update:modelValue=\"setScope(id, $event)\" />\n </DataTableRow>\n </table>\n </div>\n </DisclosurePanel>\n </Disclosure>\n </div>\n\n <!-- Shared add/edit scope modal -->\n <OAuthScopesAddModal\n :scope=\"editingScope\"\n :scopes=\"Object.keys(flow.scopes ?? {})\"\n :state=\"scopeFormModal\"\n @submit=\"handleScopeFormSubmit\" />\n </DataTableCell>\n</template>\n\n<style>\n/* Matches AddressBar.vue `.address-bar-bg-states` / `.fade-right` (header URL input). */\n.oauth-scope-row-action-rail {\n --oauth-scope-row-rail-bg: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 100%) 0%,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 20%) 30%,\n var(--oauth-scope-row-rail-bg) 100%\n );\n}\n\n.no-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.no-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAed,MAAM,cAAc,IAA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C,eAAW;;;;;;aAM7I,YAIwC,MAAA,gBAAA,GAAA;UAHrC,MAAM,MAAA,eAAA;UACN,OAAK,UAAY;UAClB,MAAK;UACJ,SAAK,eAAA,WAAO,kBAAkB,EAAE,GAAA,CAAA,MAAA,CAAA;;;;;;;kBAQvC,YAI8C,MAAA,yBAAA,GAAA;SAH3C,WAAS,UAAY,MAAK;SAC1B,YAAY,QAAA,eAAe,SAAS,EAAE;SACtC,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAN,CAAA,GAAW,CAAA,MAAA,CAAA;SACV,wBAAiB,WAAE,SAAS,IAAI,MAAM;;;;;;;;;;;;+BASrD,YAIoC,6BAAA;KAHjC,OAAO,aAAA;KACP,QAAQ,OAAO,KAAK,QAAA,KAAK,UAAM,CAAA,CAAA;KAC/B,OAAO,MAAA,cAAA;KACP,UAAQ"}
1
+ {"version":3,"file":"OAuthScopesInput.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarIconPencilSimple, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport type {\n OAuthFlow,\n OAuthFlowsObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport OAuthScopesAddModal from './OAuthScopesAddModal.vue'\n\nconst { selectedScopes, flow, flowType } = defineProps<{\n flowType: keyof OAuthFlowsObject\n flow: OAuthFlow\n selectedScopes: string[]\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: { scopes?: string[]; scope?: string; selected?: boolean },\n ): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst searchQuery = ref('')\n\n/**\n * The scope currently being edited, used to switch the shared modal into edit mode.\n * Null means the modal is in \"add\" mode.\n */\nconst editingScope = ref<{ name: string; description: string } | null>(null)\n\n/** List of all available scopes */\nconst scopes = computed(() =>\n Object.entries(flow?.scopes ?? {}).map(([key, val]) => ({\n id: key,\n label: key,\n description: val,\n })),\n)\n\nconst scopeCount = computed(() => Object.keys(flow?.scopes ?? {}).length)\n\n/** Search is only useful once the list is long enough to scan */\nconst showScopeSearch = computed(() => scopeCount.value >= 10)\n\nconst filteredScopes = computed(() => {\n const query = showScopeSearch.value ? searchQuery.value : ''\n if (!query) {\n return scopes.value\n }\n\n const regex = new RegExp(\n query\n .split('')\n .map((c) => c.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('.*'),\n 'i',\n )\n\n return scopes.value.filter(({ label, description }) =>\n regex.test(`${label} ${description}`),\n )\n})\n\nconst hasScopes = computed(() => Object.keys(flow?.scopes ?? {}).length > 0)\n\nconst allScopesSelected = computed(\n () => selectedScopes.length === Object.keys(flow?.scopes ?? {}).length,\n)\n\nconst setScope = (scopeKey: string, checked: boolean) => {\n // Emit a single-scope toggle rather than a freshly computed list. The store applies it\n // against the currently selected scopes, so two quick clicks cannot overwrite each other\n // with a list computed from a prop that has not updated yet.\n emits('update:selectedScopes', { scope: scopeKey, selected: checked })\n}\n\n/** Select all scopes */\nconst selectAllScopes = () =>\n emits('update:selectedScopes', { scopes: Object.keys(flow?.scopes ?? {}) })\n\n/** Deselect all scopes */\nconst deselectAllScopes = () => emits('update:selectedScopes', { scopes: [] })\n\nconst scopeFormModal = useModal()\n\n/**\n * Forces the Disclosure to remount with `defaultOpen` set so the panel auto-expands\n * the moment a brand-new scope is added. Bumping this counter is paired with toggling\n * `expandOnNextMount` so the remount opens the panel, then reverts to the default\n * closed-on-mount behavior for any future unrelated remounts (e.g. collapse on empty).\n *\n * The Disclosure `:key` is only this counter — not a separate `hasScopes` segment — so\n * adding the first scope does not remount twice (empty prefix → with-scopes prefix),\n * which would reopen with `defaultOpen=false` and collapse the panel right when rows appear.\n */\nconst remountKey = ref(0)\nconst expandOnNextMount = ref(false)\n\nwatch(hasScopes, (has, had) => {\n if (had && !has) {\n expandOnNextMount.value = false\n remountKey.value += 1\n }\n})\n\n/** Open the modal in \"add new scope\" mode */\nconst openAddScopeModal = () => {\n editingScope.value = null\n scopeFormModal.show()\n}\n\n/** Open the modal in \"edit scope\" mode prefilled with the chosen row */\nconst openEditScopeModal = (scope: { id: string; description: string }) => {\n editingScope.value = {\n name: scope.id,\n description: scope.description ?? '',\n }\n scopeFormModal.show()\n}\n\n/**\n * Submit handler shared by Add Scope and Edit Scope. For renames, the `upsertScope` mutator on\n * the workspace store rewrites the selection state in place, so the component does not need to\n * emit a follow-up `update:selectedScopes`.\n *\n * When adding a brand-new scope (no `oldName`), the payload sets `enable: true` so the\n * `upsertScope` mutator also adds the new scope to any selection requirement that references\n * this scheme. The Disclosure is then remounted with `defaultOpen=true` so the user\n * immediately sees (and sees selected) the scope they just added.\n */\nconst handleScopeFormSubmit = async (payload: {\n name: string\n description: string\n oldName?: string\n}) => {\n const isAdd = !payload.oldName\n\n emits('upsert:scope', {\n scope: payload.name,\n description: payload.description,\n flowType,\n ...(payload.oldName ? { oldScope: payload.oldName } : {}),\n ...(isAdd ? { enable: true } : {}),\n })\n\n if (!isAdd) {\n return\n }\n\n expandOnNextMount.value = true\n remountKey.value += 1\n // Reset after the remount so subsequent unrelated remounts (e.g. when the last\n // scope is deleted) still default to a closed panel.\n await nextTick()\n expandOnNextMount.value = false\n}\n\n/**\n * Remove the scope from the flow. Selection cleanup (dropping the deleted key from any\n * currently-selected scopes) is handled by the `deleteScope` mutator on the workspace store,\n * so the component does not need to emit a follow-up `update:selectedScopes` here.\n */\nconst handleDeleteScope = (scopeKey: string) => {\n emits('delete:scope', { scope: scopeKey, flowType })\n}\n</script>\n\n<template>\n <DataTableCell class=\"h-auto !max-h-[initial] min-h-8 items-center\">\n <div class=\"flex h-fit w-full\">\n <div class=\"text-c-1 h-full items-center\"></div>\n <Disclosure\n :key=\"remountKey\"\n as=\"div\"\n class=\"bl flex w-full flex-col\"\n :defaultOpen=\"expandOnNextMount\">\n <!--\n Keep Add Scope (and other actions) outside the summary DisclosureButton.\n When there are no scopes the summary control is disabled; a native disabled\n button blocks pointer events for all descendants, which would make Add Scope unusable.\n -->\n <div\n class=\"group/scopes-accordion flex h-auto min-h-8 items-center gap-1.5 pr-2.25 pl-3 text-left\">\n <DisclosureButton\n :class=\"[\n 'min-w-0 flex-1 text-left',\n hasScopes ? 'hover:text-c-1 cursor-pointer' : 'cursor-default',\n (selectedScopes.length || 0) > 0 ? 'text-c-1' : 'text-c-3',\n ]\"\n :disabled=\"!hasScopes\">\n <template v-if=\"hasScopes\">\n {{\n translate('apiClient.oauthScopesInput.selectedScopes', {\n count: selectedScopes.length,\n total: Object.keys(flow?.scopes ?? {}).length,\n })\n }}\n </template>\n <template v-else>\n {{ translate('apiClient.oauthScopesInput.noScopesDefined') }}\n </template>\n </DisclosureButton>\n\n <div class=\"flex shrink-0 items-center gap-1.75\">\n <!-- Add new scope -->\n <ScalarButton\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"openAddScopeModal\">\n {{ translate('apiClient.oauthScopesInput.addScope') }}\n </ScalarButton>\n\n <!-- Deselect All -->\n <ScalarButton\n v-if=\"hasScopes && allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deselectAllScopes\">\n {{ translate('apiClient.oauthScopesInput.deselectAll') }}\n </ScalarButton>\n\n <!-- Select All -->\n <ScalarButton\n v-if=\"hasScopes && !allScopesSelected\"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"selectAllScopes\">\n {{ translate('apiClient.oauthScopesInput.selectAll') }}\n </ScalarButton>\n\n <DisclosureButton\n v-if=\"hasScopes\"\n v-slot=\"{ open }\"\n class=\"text-c-3 hover:text-c-2 -m-0.5 flex shrink-0 items-center justify-center rounded p-0.5 focus-visible:outline-offset-2\">\n <ScalarIcon\n class=\"group-hover/scopes-accordion:text-c-2\"\n :icon=\"open ? 'ChevronDown' : 'ChevronRight'\"\n size=\"md\" />\n </DisclosureButton>\n </div>\n </div>\n <!-- Scopes List -->\n <DisclosurePanel as=\"template\">\n <div>\n <ScalarSearchInput\n v-if=\"showScopeSearch\"\n v-model=\"searchQuery\"\n class=\"flex items-center text-xs\" />\n <table\n class=\"grid max-h-40 auto-rows-auto overflow-x-hidden overflow-y-auto\"\n :style=\"{ gridTemplateColumns: '1fr auto' }\">\n <!--\n The HTML parser inserts a `tbody` around rows that sit directly under a `table`,\n so the rows are wrapped in one here to keep server-rendered markup hydratable.\n `contents` keeps it out of the table's grid, the same way the rows lay\n themselves out.\n -->\n <tbody class=\"contents\">\n <DataTableRow\n v-for=\"{ id, label, description } in filteredScopes\"\n :key=\"id\"\n class=\"text-c-2 group/scope-row\"\n @click=\"setScope(id, !selectedScopes.includes(id))\">\n <DataTableCell\n class=\"box-border flex !max-h-[initial] w-full min-w-0 cursor-pointer items-stretch overflow-hidden px-0 py-0\">\n <!-- Text scrolls horizontally; action rail stays fixed -->\n <div\n class=\"no-scrollbar text-c-2 group-hover/scope-row:text-c-1 flex min-h-8 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-3 py-1.5 pr-20 text-xs text-nowrap\">\n <span class=\"font-code shrink-0 text-xs\">{{\n label\n }}</span>\n <template v-if=\"String(description ?? '').trim()\">\n <span class=\"shrink-0\">&ndash;</span>\n <span class=\"whitespace-nowrap\">{{ description }}</span>\n </template>\n </div>\n <div\n class=\"oauth-scope-row-action-rail absolute top-0 right-0 z-[1] flex h-full min-w-[4.5rem] items-center justify-end gap-0.5 py-1 pr-2 pl-4 opacity-0 transition-opacity group-focus-within/scope-row:opacity-100 group-hover/scope-row:opacity-100\"\n @click.stop>\n <ScalarIconButton\n :icon=\"ScalarIconPencilSimple\"\n :label=\"\n translate('apiClient.oauthScopesInput.editScope', {\n name: label,\n })\n \"\n size=\"sm\"\n @click.stop=\"\n openEditScopeModal({\n id,\n description: description ?? '',\n })\n \" />\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n :label=\"\n translate('apiClient.oauthScopesInput.deleteScope', {\n name: label,\n })\n \"\n size=\"sm\"\n @click.stop=\"handleDeleteScope(id)\" />\n </div>\n </DataTableCell>\n <!--\n Stop the click here so it does not also bubble to the row's `@click`\n toggle. The checkbox already drives the change via `@update:modelValue`;\n letting the row fire too would toggle the scope a second time.\n -->\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.oauthScopesInput.selectScope', {\n name: label,\n })\n \"\n :modelValue=\"selectedScopes.includes(id)\"\n @click.stop\n @update:modelValue=\"setScope(id, $event)\" />\n </DataTableRow>\n </tbody>\n </table>\n </div>\n </DisclosurePanel>\n </Disclosure>\n </div>\n\n <!-- Shared add/edit scope modal -->\n <OAuthScopesAddModal\n :scope=\"editingScope\"\n :scopes=\"Object.keys(flow.scopes ?? {})\"\n :state=\"scopeFormModal\"\n @submit=\"handleScopeFormSubmit\" />\n </DataTableCell>\n</template>\n\n<style>\n/* Matches AddressBar.vue `.address-bar-bg-states` / `.fade-right` (header URL input). */\n.oauth-scope-row-action-rail {\n --oauth-scope-row-rail-bg: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n background: linear-gradient(\n 90deg,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 100%) 0%,\n color-mix(in srgb, var(--oauth-scope-row-rail-bg), transparent 20%) 30%,\n var(--oauth-scope-row-rail-bg) 100%\n );\n}\n\n.no-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.no-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,QAAQ;EAed,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,cAAc,IAAI,EAAE;;;;;EAM1B,MAAM,eAAe,IAAkD,IAAI;;EAG3E,MAAM,SAAS,eACb,OAAO,QAAQ,QAAA,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,UAAU;GACtD,IAAI;GACJ,OAAO;GACP,aAAa;EACf,EAAE,CACJ;EAEA,MAAM,aAAa,eAAe,OAAO,KAAK,QAAA,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM;;EAGxE,MAAM,kBAAkB,eAAe,WAAW,SAAS,EAAE;EAE7D,MAAM,iBAAiB,eAAe;GACpC,MAAM,QAAQ,gBAAgB,QAAQ,YAAY,QAAQ;GAC1D,IAAI,CAAC,OACH,OAAO,OAAO;GAGhB,MAAM,QAAQ,IAAI,OAChB,MACG,MAAM,EAAE,CAAA,CACR,KAAK,MAAM,EAAE,QAAQ,uBAAuB,MAAM,CAAC,CAAA,CACnD,KAAK,IAAI,GACZ,GACF;GAEA,OAAO,OAAO,MAAM,QAAQ,EAAE,OAAO,kBACnC,MAAM,KAAK,GAAG,MAAM,GAAG,aAAa,CACtC;EACF,CAAC;EAED,MAAM,YAAY,eAAe,OAAO,KAAK,QAAA,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;EAE3E,MAAM,oBAAoB,eAClB,QAAA,eAAe,WAAW,OAAO,KAAK,QAAA,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,MAClE;EAEA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AAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAEvG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAOnF,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kCAAkC;IAClC,oBAAoB,EAAE,MAAM,MAAM,GAAG,KAAK,CAAA;IAC1C,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,MAAM,EAAE,mBAAmB,CAAA;IAC3B,kFAAkF;IAClF,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAC;AAoLF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"OpenIDConnect.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue"],"names":[],"mappings":"AA6HA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAEvG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAQnF,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kCAAkC;IAClC,oBAAoB,EAAE,MAAM,MAAM,GAAG,KAAK,CAAA;IAC1C,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,MAAM,EAAE,mBAAmB,CAAA;IAC3B,kFAAkF;IAClF,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAC;AA0LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenIDConnect.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { type OpenIdConnectObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\nimport { fetchOpenIDConnectDiscovery } from '@/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery'\nimport { openIDDiscoveryToFlows } from '@/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows'\nimport { DataTableRow } from '@/v2/components/data-table'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n eventBus,\n getStaticBorderClass,\n name,\n scheme,\n proxyUrl,\n customFetch,\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Get the static border class */\n getStaticBorderClass: () => string | false\n /** Name of the security scheme */\n name: string\n /** Proxy URL */\n proxyUrl: string\n /** OpenID Connect scheme */\n scheme: OpenIdConnectObject\n /** Optional fetch override (IPC-backed on desktop) used for discovery requests */\n customFetch?: CustomFetch\n}>()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/**\n * Fetches the OpenID Connect discovery document and triggers authorization\n */\nconst handleOpenIdConnect = async (): Promise<void> => {\n if (loader.isLoading || !scheme.openIdConnectUrl) {\n return\n }\n\n loader.start()\n const [error, _discovery] = await fetchOpenIDConnectDiscovery(\n scheme.openIdConnectUrl,\n proxyUrl,\n customFetch,\n )\n await loader.clear()\n\n // Toast for error\n if (error) {\n console.error(error)\n toast(\n error?.message ?? 'Failed to fetch OpenID Connect configuration',\n 'error',\n )\n return\n }\n\n /** Set the newly discovered params in the secret store */\n const openIdConnect = openIDDiscoveryToFlows(_discovery)\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: openIdConnect,\n name,\n overwrite: true,\n })\n}\n\nconst handleUpdateOpenIdConnectUrl = (value: string): void =>\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: 'openIdConnect',\n openIdConnectUrl: value,\n },\n name,\n })\n</script>\n\n<template>\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme.openIdConnectUrl\"\n placeholder=\"https://example.com/.well-known/openid-configuration\"\n required\n @update:modelValue=\"handleUpdateOpenIdConnectUrl\">\n Discovery URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :disabled=\"!scheme.openIdConnectUrl\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleOpenIdConnect\">\n Fetch Configuration\n </ScalarButton>\n </div>\n </DataTableRow>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"OpenIDConnect.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { type OpenIdConnectObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\nimport { fetchOpenIDConnectDiscovery } from '@/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery'\nimport { openIDDiscoveryToFlows } from '@/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows'\nimport { DataTableRow } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n eventBus,\n getStaticBorderClass,\n name,\n scheme,\n proxyUrl,\n customFetch,\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Get the static border class */\n getStaticBorderClass: () => string | false\n /** Name of the security scheme */\n name: string\n /** Proxy URL */\n proxyUrl: string\n /** OpenID Connect scheme */\n scheme: OpenIdConnectObject\n /** Optional fetch override (IPC-backed on desktop) used for discovery requests */\n customFetch?: CustomFetch\n}>()\n\nconst { translate } = useLocalization()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/**\n * Fetches the OpenID Connect discovery document and triggers authorization\n */\nconst handleOpenIdConnect = async (): Promise<void> => {\n if (loader.isLoading || !scheme.openIdConnectUrl) {\n return\n }\n\n loader.start()\n const [error, _discovery] = await fetchOpenIDConnectDiscovery(\n scheme.openIdConnectUrl,\n proxyUrl,\n customFetch,\n )\n await loader.clear()\n\n // Toast for error\n if (error) {\n console.error(error)\n toast(\n error?.message ??\n translate('apiClient.openIdConnect.failedToFetchConfiguration'),\n 'error',\n )\n return\n }\n\n /** Set the newly discovered params in the secret store */\n const openIdConnect = openIDDiscoveryToFlows(_discovery)\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: openIdConnect,\n name,\n overwrite: true,\n })\n}\n\nconst handleUpdateOpenIdConnectUrl = (value: string): void =>\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: 'openIdConnect',\n openIdConnectUrl: value,\n },\n name,\n })\n</script>\n\n<template>\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme.openIdConnectUrl\"\n placeholder=\"https://example.com/.well-known/openid-configuration\"\n required\n @update:modelValue=\"handleUpdateOpenIdConnectUrl\">\n {{ translate('apiClient.openIdConnect.discoveryUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :disabled=\"!scheme.openIdConnectUrl\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleOpenIdConnect\">\n {{ translate('apiClient.openIdConnect.fetchConfiguration') }}\n </ScalarButton>\n </div>\n </DataTableRow>\n</template>\n"],"mappings":""}
@@ -1,8 +1,9 @@
1
+ import { useLocalization } from "../../../features/localization/index.js";
1
2
  import DataTableRow_default from "../../../components/data-table/DataTableRow.vue.js";
2
3
  import RequestAuthDataTableInput_default from "./RequestAuthDataTableInput.vue.js";
3
4
  import { fetchOpenIDConnectDiscovery } from "../helpers/fetch-openid-connect-discovery.js";
4
5
  import { openIDDiscoveryToFlows } from "../helpers/openid-discovery-to-flows.js";
5
- import { Fragment, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, unref, withCtx } from "vue";
6
+ import { Fragment, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
6
7
  import { ScalarButton } from "@scalar/components/button";
7
8
  import { useToasts } from "@scalar/use-toasts";
8
9
  import { useLoadingState } from "@scalar/components/loading";
@@ -20,6 +21,7 @@ var OpenIDConnect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
20
21
  customFetch: {}
21
22
  },
22
23
  setup(__props) {
24
+ const { translate } = useLocalization();
23
25
  const loader = useLoadingState();
24
26
  const { toast } = useToasts();
25
27
  /**
@@ -32,7 +34,7 @@ var OpenIDConnect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
32
34
  await loader.clear();
33
35
  if (error) {
34
36
  console.error(error);
35
- toast(error?.message ?? "Failed to fetch OpenID Connect configuration", "error");
37
+ toast(error?.message ?? translate("apiClient.openIdConnect.failedToFetchConfiguration"), "error");
36
38
  return;
37
39
  }
38
40
  /** Set the newly discovered params in the secret store */
@@ -60,7 +62,7 @@ var OpenIDConnect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
60
62
  required: "",
61
63
  "onUpdate:modelValue": handleUpdateOpenIdConnectUrl
62
64
  }, {
63
- default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Discovery URL ", -1)])]),
65
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.openIdConnect.discoveryUrl")), 1)]),
64
66
  _: 1
65
67
  }, 8, [
66
68
  "containerClass",
@@ -77,7 +79,7 @@ var OpenIDConnect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
77
79
  variant: "outlined",
78
80
  onClick: handleOpenIdConnect
79
81
  }, {
80
- default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Fetch Configuration ", -1)])]),
82
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.openIdConnect.fetchConfiguration")), 1)]),
81
83
  _: 1
82
84
  }, 8, ["disabled", "loader"])])]),
83
85
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"OpenIDConnect.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { type OpenIdConnectObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\nimport { fetchOpenIDConnectDiscovery } from '@/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery'\nimport { openIDDiscoveryToFlows } from '@/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows'\nimport { DataTableRow } from '@/v2/components/data-table'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n eventBus,\n getStaticBorderClass,\n name,\n scheme,\n proxyUrl,\n customFetch,\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Get the static border class */\n getStaticBorderClass: () => string | false\n /** Name of the security scheme */\n name: string\n /** Proxy URL */\n proxyUrl: string\n /** OpenID Connect scheme */\n scheme: OpenIdConnectObject\n /** Optional fetch override (IPC-backed on desktop) used for discovery requests */\n customFetch?: CustomFetch\n}>()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/**\n * Fetches the OpenID Connect discovery document and triggers authorization\n */\nconst handleOpenIdConnect = async (): Promise<void> => {\n if (loader.isLoading || !scheme.openIdConnectUrl) {\n return\n }\n\n loader.start()\n const [error, _discovery] = await fetchOpenIDConnectDiscovery(\n scheme.openIdConnectUrl,\n proxyUrl,\n customFetch,\n )\n await loader.clear()\n\n // Toast for error\n if (error) {\n console.error(error)\n toast(\n error?.message ?? 'Failed to fetch OpenID Connect configuration',\n 'error',\n )\n return\n }\n\n /** Set the newly discovered params in the secret store */\n const openIdConnect = openIDDiscoveryToFlows(_discovery)\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: openIdConnect,\n name,\n overwrite: true,\n })\n}\n\nconst handleUpdateOpenIdConnectUrl = (value: string): void =>\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: 'openIdConnect',\n openIdConnectUrl: value,\n },\n name,\n })\n</script>\n\n<template>\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme.openIdConnectUrl\"\n placeholder=\"https://example.com/.well-known/openid-configuration\"\n required\n @update:modelValue=\"handleUpdateOpenIdConnectUrl\">\n Discovery URL\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :disabled=\"!scheme.openIdConnectUrl\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleOpenIdConnect\">\n Fetch Configuration\n </ScalarButton>\n </div>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAwCA,MAAM,SAAS,gBAAgB;EAC/B,MAAM,EAAE,UAAU,UAAU;;;;EAK5B,MAAM,sBAAsB,YAA2B;GACrD,IAAI,OAAO,aAAa,CAAC,QAAA,OAAO,kBAC9B;GAGF,OAAO,MAAM;GACb,MAAM,CAAC,OAAO,cAAc,MAAM,4BAChC,QAAA,OAAO,kBACP,QAAA,UACA,QAAA,WACF;GACA,MAAM,OAAO,MAAM;GAGnB,IAAI,OAAO;IACT,QAAQ,MAAM,KAAK;IACnB,MACE,OAAO,WAAW,gDAClB,OACF;IACA;GACF;;GAGA,MAAM,gBAAgB,uBAAuB,UAAU;GACvD,QAAA,SAAS,KAAK,uCAAuC;IACnD,SAAS;IACT,MAAG,QAAA;IACH,WAAW;GACb,CAAC;EACH;EAEA,MAAM,gCAAgC,UACpC,QAAA,SAAS,KAAK,+BAA+B;GAC3C,SAAS;IACP,MAAM;IACN,kBAAkB;GACpB;GACA,MAAG,QAAA;EACL,CAAC;;2DAID,YAUe,MAAA,oBAAA,GAAA,MAAA;2BADe,CAR5B,YAQ4B,mCAAA;KAPzB,gBAAgB,QAAA,qBAAoB;KACpC,aAAA,QAAA;KACA,YAAY,QAAA,OAAO;KACpB,aAAY;KACZ,UAAA;KACC,uBAAmB;;4BAEtB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFoD,mBAEpD,EAAA,CAAA,EAAA,CAAA;;;;;;;;OAGF,YAYe,MAAA,oBAAA,GAAA,EAZD,OAAM,aAAY,GAAA;2BAWxB,CAVN,mBAUM,OAVN,YAUM,CATJ,YAQe,MAAA,YAAA,GAAA;KAPb,OAAM;KACL,UAAQ,CAAG,QAAA,OAAO;KAClB,QAAA,MAAA,MAAA;KACD,MAAK;KACL,SAAQ;KACP,SAAO;;4BAEV,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAF+B,yBAE/B,EAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"OpenIDConnect.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { type OpenIdConnectObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\nimport { fetchOpenIDConnectDiscovery } from '@/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery'\nimport { openIDDiscoveryToFlows } from '@/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows'\nimport { DataTableRow } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n eventBus,\n getStaticBorderClass,\n name,\n scheme,\n proxyUrl,\n customFetch,\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Get the static border class */\n getStaticBorderClass: () => string | false\n /** Name of the security scheme */\n name: string\n /** Proxy URL */\n proxyUrl: string\n /** OpenID Connect scheme */\n scheme: OpenIdConnectObject\n /** Optional fetch override (IPC-backed on desktop) used for discovery requests */\n customFetch?: CustomFetch\n}>()\n\nconst { translate } = useLocalization()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/**\n * Fetches the OpenID Connect discovery document and triggers authorization\n */\nconst handleOpenIdConnect = async (): Promise<void> => {\n if (loader.isLoading || !scheme.openIdConnectUrl) {\n return\n }\n\n loader.start()\n const [error, _discovery] = await fetchOpenIDConnectDiscovery(\n scheme.openIdConnectUrl,\n proxyUrl,\n customFetch,\n )\n await loader.clear()\n\n // Toast for error\n if (error) {\n console.error(error)\n toast(\n error?.message ??\n translate('apiClient.openIdConnect.failedToFetchConfiguration'),\n 'error',\n )\n return\n }\n\n /** Set the newly discovered params in the secret store */\n const openIdConnect = openIDDiscoveryToFlows(_discovery)\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: openIdConnect,\n name,\n overwrite: true,\n })\n}\n\nconst handleUpdateOpenIdConnectUrl = (value: string): void =>\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: 'openIdConnect',\n openIdConnectUrl: value,\n },\n name,\n })\n</script>\n\n<template>\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme.openIdConnectUrl\"\n placeholder=\"https://example.com/.well-known/openid-configuration\"\n required\n @update:modelValue=\"handleUpdateOpenIdConnectUrl\">\n {{ translate('apiClient.openIdConnect.discoveryUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :disabled=\"!scheme.openIdConnectUrl\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleOpenIdConnect\">\n {{ translate('apiClient.openIdConnect.fetchConfiguration') }}\n </ScalarButton>\n </div>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,SAAS,gBAAgB;EAC/B,MAAM,EAAE,UAAU,UAAU;;;;EAK5B,MAAM,sBAAsB,YAA2B;GACrD,IAAI,OAAO,aAAa,CAAC,QAAA,OAAO,kBAC9B;GAGF,OAAO,MAAM;GACb,MAAM,CAAC,OAAO,cAAc,MAAM,4BAChC,QAAA,OAAO,kBACP,QAAA,UACA,QAAA,WACF;GACA,MAAM,OAAO,MAAM;GAGnB,IAAI,OAAO;IACT,QAAQ,MAAM,KAAK;IACnB,MACE,OAAO,WACL,UAAU,oDAAoD,GAChE,OACF;IACA;GACF;;GAGA,MAAM,gBAAgB,uBAAuB,UAAU;GACvD,QAAA,SAAS,KAAK,uCAAuC;IACnD,SAAS;IACT,MAAG,QAAA;IACH,WAAW;GACb,CAAC;EACH;EAEA,MAAM,gCAAgC,UACpC,QAAA,SAAS,KAAK,+BAA+B;GAC3C,SAAS;IACP,MAAM;IACN,kBAAkB;GACpB;GACA,MAAG,QAAA;EACL,CAAC;;2DAID,YAUe,MAAA,oBAAA,GAAA,MAAA;2BADe,CAR5B,YAQ4B,mCAAA;KAPzB,gBAAgB,QAAA,qBAAoB;KACpC,aAAA,QAAA;KACA,YAAY,QAAA,OAAO;KACpB,aAAY;KACZ,UAAA;KACC,uBAAmB;;4BACmC,CAAA,gBAAA,gBAApD,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;;;;;;OAIhB,YAYe,MAAA,oBAAA,GAAA,EAZD,OAAM,aAAY,GAAA;2BAWxB,CAVN,mBAUM,OAVN,YAUM,CATJ,YAQe,MAAA,YAAA,GAAA;KAPb,OAAM;KACL,UAAQ,CAAG,QAAA,OAAO;KAClB,QAAA,MAAA,MAAA;KACD,MAAK;KACL,SAAQ;KACP,SAAO;;4BACqD,CAAA,gBAAA,gBAA1D,MAAA,SAAA,CAAS,CAAA,4CAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAkKA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AACjG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;IACd,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AA6PF,QAAA,MAAM,YAAY;;oPAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAqKA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AACjG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAM1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;IACd,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AAiQF,QAAA,MAAM,YAAY;;oPAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type {\n ApiReferenceEvents,\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport type { SecuritySchemeOption } from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport { DataTable } from '@/v2/components/data-table'\n\nimport RequestAuthTab from './RequestAuthTab.vue'\n\nconst {\n environment,\n isStatic,\n selectedSchemeOptions,\n activeAuthIndex,\n securitySchemes = {},\n server,\n eventBus,\n meta,\n options,\n documentType,\n} = defineProps<{\n /** The current environment configuration */\n environment: XScalarEnvironment\n /** Controls border display for static (non-collapsible) layouts */\n isStatic: boolean\n /** Available authentication scheme options */\n selectedSchemeOptions: SecuritySchemeOption[]\n /** Index of the currently active authentication tab */\n activeAuthIndex: number\n /** Proxy URL */\n proxyUrl: string\n /** OpenAPI security scheme definitions */\n securitySchemes: MergedSecuritySchemes\n /** Current server configuration */\n server: ServerObject | null\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Metadata for authentication context */\n meta: AuthMeta\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /** Type of the document the schemes belong to, forwarded to the auth tab */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\n/** Currently selected authentication scheme based on the active tab index */\nconst activeScheme = computed<SecuritySchemeOption | undefined>(\n () => selectedSchemeOptions[activeAuthIndex],\n)\n\n/**\n * Whether to display multiple authentication tabs.\n * Only shows tabs when there are 2 or more schemes available.\n */\nconst shouldShowTabs = computed<boolean>(() => selectedSchemeOptions.length > 1)\n\n/** Handles authentication tab selection */\nconst handleTabChange = (index: number) =>\n eventBus.emit('auth:update:active-index', {\n index,\n meta,\n })\n\n/** Handles updates to OAuth scope selection */\nconst handleScopesUpdate = (\n params: Omit<ApiReferenceEvents['auth:update:selected-scopes'], 'meta'>,\n): void =>\n eventBus.emit('auth:update:selected-scopes', {\n ...params,\n meta,\n })\n\n/** Handles scope-definition upserts (add / rename / description change) */\nconst handleScopeUpsert = (\n params: ApiReferenceEvents['auth:upsert:scopes'],\n): void => eventBus.emit('auth:upsert:scopes', params)\n\n/** Handles scope-definition deletes */\nconst handleScopeDelete = (\n params: ApiReferenceEvents['auth:delete:scopes'],\n): void => eventBus.emit('auth:delete:scopes', params)\n\n/** Determines if a tab is currently active */\nconst isTabActive = (index: number): boolean => activeAuthIndex === index\n\n/** Expose the active scheme for parent component access */\ndefineExpose({\n activeScheme,\n})\n</script>\n\n<template>\n <form @submit.prevent>\n <!-- Authentication Tabs -->\n <div\n v-if=\"shouldShowTabs\"\n class=\"box-content flex flex-wrap gap-x-2.5 overflow-hidden border-x border-t px-3\"\n :class=\"{ 'border-x-0': !isStatic }\"\n data-testid=\"auth-tabs\">\n <div\n v-for=\"(option, index) in selectedSchemeOptions\"\n :key=\"option.id\"\n class=\"relative z-1 -mb-[var(--scalar-border-width)] flex h-8\">\n <button\n class=\"floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors\"\n :class=\"isTabActive(index) ? 'text-c-1' : 'text-c-3'\"\n type=\"button\"\n @click=\"handleTabChange(index)\">\n <span class=\"relative z-10 font-medium whitespace-nowrap\">\n {{ option.label }}\n </span>\n </button>\n\n <!-- Active Tab Indicator -->\n <div\n v-if=\"isTabActive(index)\"\n class=\"absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current\" />\n </div>\n </div>\n\n <!-- Active Authentication Scheme Content -->\n <DataTable\n v-if=\"activeScheme\"\n class=\"flex-1\"\n :class=\"{ 'bg-b-1 rounded-b-lg border-x border-b': isStatic }\"\n :columns=\"['']\"\n presentational>\n <RequestAuthTab\n :documentType\n :environment\n :eventBus\n :isStatic\n :options\n :proxyUrl\n :securitySchemes\n :selectedSecuritySchemas=\"activeScheme.value\"\n :server\n @delete:scope=\"handleScopeDelete\"\n @update:selectedScopes=\"handleScopesUpdate\"\n @upsert:scope=\"handleScopeUpsert\" />\n </DataTable>\n\n <!-- Empty State -->\n <div\n v-else\n class=\"bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm\"\n :class=\"{ 'min-h-[calc(4rem+0.5px)] rounded-b-lg border': isStatic }\">\n No authentication selected\n </div>\n </form>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type {\n ApiReferenceEvents,\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport type { SecuritySchemeOption } from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport { DataTable } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestAuthTab from './RequestAuthTab.vue'\n\nconst {\n environment,\n isStatic,\n selectedSchemeOptions,\n activeAuthIndex,\n securitySchemes = {},\n server,\n eventBus,\n meta,\n options,\n documentType,\n} = defineProps<{\n /** The current environment configuration */\n environment: XScalarEnvironment\n /** Controls border display for static (non-collapsible) layouts */\n isStatic: boolean\n /** Available authentication scheme options */\n selectedSchemeOptions: SecuritySchemeOption[]\n /** Index of the currently active authentication tab */\n activeAuthIndex: number\n /** Proxy URL */\n proxyUrl: string\n /** OpenAPI security scheme definitions */\n securitySchemes: MergedSecuritySchemes\n /** Current server configuration */\n server: ServerObject | null\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Metadata for authentication context */\n meta: AuthMeta\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /** Type of the document the schemes belong to, forwarded to the auth tab */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\nconst { translate } = useLocalization()\n\n/** Currently selected authentication scheme based on the active tab index */\nconst activeScheme = computed<SecuritySchemeOption | undefined>(\n () => selectedSchemeOptions[activeAuthIndex],\n)\n\n/**\n * Whether to display multiple authentication tabs.\n * Only shows tabs when there are 2 or more schemes available.\n */\nconst shouldShowTabs = computed<boolean>(() => selectedSchemeOptions.length > 1)\n\n/** Handles authentication tab selection */\nconst handleTabChange = (index: number) =>\n eventBus.emit('auth:update:active-index', {\n index,\n meta,\n })\n\n/** Handles updates to OAuth scope selection */\nconst handleScopesUpdate = (\n params: Omit<ApiReferenceEvents['auth:update:selected-scopes'], 'meta'>,\n): void =>\n eventBus.emit('auth:update:selected-scopes', {\n ...params,\n meta,\n })\n\n/** Handles scope-definition upserts (add / rename / description change) */\nconst handleScopeUpsert = (\n params: ApiReferenceEvents['auth:upsert:scopes'],\n): void => eventBus.emit('auth:upsert:scopes', params)\n\n/** Handles scope-definition deletes */\nconst handleScopeDelete = (\n params: ApiReferenceEvents['auth:delete:scopes'],\n): void => eventBus.emit('auth:delete:scopes', params)\n\n/** Determines if a tab is currently active */\nconst isTabActive = (index: number): boolean => activeAuthIndex === index\n\n/** Expose the active scheme for parent component access */\ndefineExpose({\n activeScheme,\n})\n</script>\n\n<template>\n <form @submit.prevent>\n <!-- Authentication Tabs -->\n <div\n v-if=\"shouldShowTabs\"\n class=\"box-content flex flex-wrap gap-x-2.5 overflow-hidden border-x border-t px-3\"\n :class=\"{ 'border-x-0': !isStatic }\"\n data-testid=\"auth-tabs\">\n <div\n v-for=\"(option, index) in selectedSchemeOptions\"\n :key=\"option.id\"\n class=\"relative z-1 -mb-[var(--scalar-border-width)] flex h-8\">\n <button\n class=\"floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors\"\n :class=\"isTabActive(index) ? 'text-c-1' : 'text-c-3'\"\n type=\"button\"\n @click=\"handleTabChange(index)\">\n <span class=\"relative z-10 font-medium whitespace-nowrap\">\n {{ option.label }}\n </span>\n </button>\n\n <!-- Active Tab Indicator -->\n <div\n v-if=\"isTabActive(index)\"\n class=\"absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current\" />\n </div>\n </div>\n\n <!-- Active Authentication Scheme Content -->\n <DataTable\n v-if=\"activeScheme\"\n class=\"flex-1\"\n :class=\"{ 'bg-b-1 rounded-b-lg border-x border-b': isStatic }\"\n :columns=\"['']\"\n presentational>\n <RequestAuthTab\n :documentType\n :environment\n :eventBus\n :isStatic\n :options\n :proxyUrl\n :securitySchemes\n :selectedSecuritySchemas=\"activeScheme.value\"\n :server\n @delete:scope=\"handleScopeDelete\"\n @update:selectedScopes=\"handleScopesUpdate\"\n @upsert:scope=\"handleScopeUpsert\" />\n </DataTable>\n\n <!-- Empty State -->\n <div\n v-else\n class=\"bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm\"\n :class=\"{ 'min-h-[calc(4rem+0.5px)] rounded-b-lg border': isStatic }\">\n {{ translate('apiClient.requestAuthDataTable.noauthenticationSelected') }}\n </div>\n </form>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../../features/localization/index.js";
1
2
  import DataTable_default from "../../../components/data-table/DataTable.vue.js";
2
3
  import RequestAuthTab_default from "./RequestAuthTab.vue.js";
3
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx, withModifiers } from "vue";
@@ -24,6 +25,7 @@ var RequestAuthDataTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE
24
25
  documentType: {}
25
26
  },
26
27
  setup(__props, { expose: __expose }) {
28
+ const { translate } = useLocalization();
27
29
  /** Currently selected authentication scheme based on the active tab index */
28
30
  const activeScheme = computed(() => __props.selectedSchemeOptions[__props.activeAuthIndex]);
29
31
  /**
@@ -97,7 +99,7 @@ var RequestAuthDataTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE
97
99
  }, 8, ["class"])) : (openBlock(), createElementBlock("div", {
98
100
  key: 2,
99
101
  class: normalizeClass(["bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm", { "min-h-[calc(4rem+0.5px)] rounded-b-lg border": __props.isStatic }])
100
- }, " No authentication selected ", 2))], 32);
102
+ }, toDisplayString(unref(translate)("apiClient.requestAuthDataTable.noauthenticationSelected")), 3))], 32);
101
103
  };
102
104
  }
103
105
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type {\n ApiReferenceEvents,\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport type { SecuritySchemeOption } from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport { DataTable } from '@/v2/components/data-table'\n\nimport RequestAuthTab from './RequestAuthTab.vue'\n\nconst {\n environment,\n isStatic,\n selectedSchemeOptions,\n activeAuthIndex,\n securitySchemes = {},\n server,\n eventBus,\n meta,\n options,\n documentType,\n} = defineProps<{\n /** The current environment configuration */\n environment: XScalarEnvironment\n /** Controls border display for static (non-collapsible) layouts */\n isStatic: boolean\n /** Available authentication scheme options */\n selectedSchemeOptions: SecuritySchemeOption[]\n /** Index of the currently active authentication tab */\n activeAuthIndex: number\n /** Proxy URL */\n proxyUrl: string\n /** OpenAPI security scheme definitions */\n securitySchemes: MergedSecuritySchemes\n /** Current server configuration */\n server: ServerObject | null\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Metadata for authentication context */\n meta: AuthMeta\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /** Type of the document the schemes belong to, forwarded to the auth tab */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\n/** Currently selected authentication scheme based on the active tab index */\nconst activeScheme = computed<SecuritySchemeOption | undefined>(\n () => selectedSchemeOptions[activeAuthIndex],\n)\n\n/**\n * Whether to display multiple authentication tabs.\n * Only shows tabs when there are 2 or more schemes available.\n */\nconst shouldShowTabs = computed<boolean>(() => selectedSchemeOptions.length > 1)\n\n/** Handles authentication tab selection */\nconst handleTabChange = (index: number) =>\n eventBus.emit('auth:update:active-index', {\n index,\n meta,\n })\n\n/** Handles updates to OAuth scope selection */\nconst handleScopesUpdate = (\n params: Omit<ApiReferenceEvents['auth:update:selected-scopes'], 'meta'>,\n): void =>\n eventBus.emit('auth:update:selected-scopes', {\n ...params,\n meta,\n })\n\n/** Handles scope-definition upserts (add / rename / description change) */\nconst handleScopeUpsert = (\n params: ApiReferenceEvents['auth:upsert:scopes'],\n): void => eventBus.emit('auth:upsert:scopes', params)\n\n/** Handles scope-definition deletes */\nconst handleScopeDelete = (\n params: ApiReferenceEvents['auth:delete:scopes'],\n): void => eventBus.emit('auth:delete:scopes', params)\n\n/** Determines if a tab is currently active */\nconst isTabActive = (index: number): boolean => activeAuthIndex === index\n\n/** Expose the active scheme for parent component access */\ndefineExpose({\n activeScheme,\n})\n</script>\n\n<template>\n <form @submit.prevent>\n <!-- Authentication Tabs -->\n <div\n v-if=\"shouldShowTabs\"\n class=\"box-content flex flex-wrap gap-x-2.5 overflow-hidden border-x border-t px-3\"\n :class=\"{ 'border-x-0': !isStatic }\"\n data-testid=\"auth-tabs\">\n <div\n v-for=\"(option, index) in selectedSchemeOptions\"\n :key=\"option.id\"\n class=\"relative z-1 -mb-[var(--scalar-border-width)] flex h-8\">\n <button\n class=\"floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors\"\n :class=\"isTabActive(index) ? 'text-c-1' : 'text-c-3'\"\n type=\"button\"\n @click=\"handleTabChange(index)\">\n <span class=\"relative z-10 font-medium whitespace-nowrap\">\n {{ option.label }}\n </span>\n </button>\n\n <!-- Active Tab Indicator -->\n <div\n v-if=\"isTabActive(index)\"\n class=\"absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current\" />\n </div>\n </div>\n\n <!-- Active Authentication Scheme Content -->\n <DataTable\n v-if=\"activeScheme\"\n class=\"flex-1\"\n :class=\"{ 'bg-b-1 rounded-b-lg border-x border-b': isStatic }\"\n :columns=\"['']\"\n presentational>\n <RequestAuthTab\n :documentType\n :environment\n :eventBus\n :isStatic\n :options\n :proxyUrl\n :securitySchemes\n :selectedSecuritySchemas=\"activeScheme.value\"\n :server\n @delete:scope=\"handleScopeDelete\"\n @update:selectedScopes=\"handleScopesUpdate\"\n @upsert:scope=\"handleScopeUpsert\" />\n </DataTable>\n\n <!-- Empty State -->\n <div\n v-else\n class=\"bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm\"\n :class=\"{ 'min-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AAA,IAAA,IAAA,CAAA,CAAA;mDAMpH,aAAA,SAAA,UAAA,GADR,YAmBY,MAAA,iBAAA,GAAA;;IAjBV,OAAK,eAAA,CAAC,UAAQ,EAAA,yCACqC,QAAA,SAAQ,CAAA,CAAA;IAC1D,SAAS,CAAA,EAAA;IACV,gBAAA;;2BAasC,CAZtC,YAYsC,wBAAA;KAXnC,cAAA,QAAA;KACA,aAAA,QAAA;KACA,UAAA,QAAA;KACA,UAAA,QAAA;KACA,SAAA,QAAA;KACA,UAAA,QAAA;KACA,iBAAA,QAAA;KACA,yBAAyB,aAAA,MAAa;KACtC,QAAA,QAAA;KACA,kBAAc;KACd,2BAAuB;KACvB,kBAAc;;;;;;;;;;;;;qCAInB,mBAKM,OAAA;;IAHJ,OAAK,eAAA,CAAC,mFAAiF,EAAA,gDAC7B,QAAA,SAAQ,CAAA,CAAA;MAAI,gCAExE,CAAA,EAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type {\n ApiReferenceEvents,\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport type { SecuritySchemeOption } from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport { DataTable } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestAuthTab from './RequestAuthTab.vue'\n\nconst {\n environment,\n isStatic,\n selectedSchemeOptions,\n activeAuthIndex,\n securitySchemes = {},\n server,\n eventBus,\n meta,\n options,\n documentType,\n} = defineProps<{\n /** The current environment configuration */\n environment: XScalarEnvironment\n /** Controls border display for static (non-collapsible) layouts */\n isStatic: boolean\n /** Available authentication scheme options */\n selectedSchemeOptions: SecuritySchemeOption[]\n /** Index of the currently active authentication tab */\n activeAuthIndex: number\n /** Proxy URL */\n proxyUrl: string\n /** OpenAPI security scheme definitions */\n securitySchemes: MergedSecuritySchemes\n /** Current server configuration */\n server: ServerObject | null\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Metadata for authentication context */\n meta: AuthMeta\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /** Type of the document the schemes belong to, forwarded to the auth tab */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\nconst { translate } = useLocalization()\n\n/** Currently selected authentication scheme based on the active tab index */\nconst activeScheme = computed<SecuritySchemeOption | undefined>(\n () => selectedSchemeOptions[activeAuthIndex],\n)\n\n/**\n * Whether to display multiple authentication tabs.\n * Only shows tabs when there are 2 or more schemes available.\n */\nconst shouldShowTabs = computed<boolean>(() => selectedSchemeOptions.length > 1)\n\n/** Handles authentication tab selection */\nconst handleTabChange = (index: number) =>\n eventBus.emit('auth:update:active-index', {\n index,\n meta,\n })\n\n/** Handles updates to OAuth scope selection */\nconst handleScopesUpdate = (\n params: Omit<ApiReferenceEvents['auth:update:selected-scopes'], 'meta'>,\n): void =>\n eventBus.emit('auth:update:selected-scopes', {\n ...params,\n meta,\n })\n\n/** Handles scope-definition upserts (add / rename / description change) */\nconst handleScopeUpsert = (\n params: ApiReferenceEvents['auth:upsert:scopes'],\n): void => eventBus.emit('auth:upsert:scopes', params)\n\n/** Handles scope-definition deletes */\nconst handleScopeDelete = (\n params: ApiReferenceEvents['auth:delete:scopes'],\n): void => eventBus.emit('auth:delete:scopes', params)\n\n/** Determines if a tab is currently active */\nconst isTabActive = (index: number): boolean => activeAuthIndex === index\n\n/** Expose the active scheme for parent component access */\ndefineExpose({\n activeScheme,\n})\n</script>\n\n<template>\n <form @submit.prevent>\n <!-- Authentication Tabs -->\n <div\n v-if=\"shouldShowTabs\"\n class=\"box-content flex flex-wrap gap-x-2.5 overflow-hidden border-x border-t px-3\"\n :class=\"{ 'border-x-0': !isStatic }\"\n data-testid=\"auth-tabs\">\n <div\n v-for=\"(option, index) in selectedSchemeOptions\"\n :key=\"option.id\"\n class=\"relative z-1 -mb-[var(--scalar-border-width)] flex h-8\">\n <button\n class=\"floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors\"\n :class=\"isTabActive(index) ? 'text-c-1' : 'text-c-3'\"\n type=\"button\"\n @click=\"handleTabChange(index)\">\n <span class=\"relative z-10 font-medium whitespace-nowrap\">\n {{ option.label }}\n </span>\n </button>\n\n <!-- Active Tab Indicator -->\n <div\n v-if=\"isTabActive(index)\"\n class=\"absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current\" />\n </div>\n </div>\n\n <!-- Active Authentication Scheme Content -->\n <DataTable\n v-if=\"activeScheme\"\n class=\"flex-1\"\n :class=\"{ 'bg-b-1 rounded-b-lg border-x border-b': isStatic }\"\n :columns=\"['']\"\n presentational>\n <RequestAuthTab\n :documentType\n :environment\n :eventBus\n :isStatic\n :options\n :proxyUrl\n :securitySchemes\n :selectedSecuritySchemas=\"activeScheme.value\"\n :server\n @delete:scope=\"handleScopeDelete\"\n @update:selectedScopes=\"handleScopesUpdate\"\n @upsert:scope=\"handleScopeUpsert\" />\n </DataTable>\n\n <!-- Empty State -->\n <div\n v-else\n class=\"bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm\"\n :class=\"{ 'min-h-[calc(4rem+0.5px)] rounded-b-lg border': isStatic }\">\n {{ translate('apiClient.requestAuthDataTable.noauthenticationSelected') }}\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDA,MAAM,EAAE,cAAc,gBAAgB;;EAGtC,MAAM,eAAe,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qC,QAAA,SAAQ,CAAA,CAAA;IAC1D,SAAS,CAAA,EAAA;IACV,gBAAA;;2BAasC,CAZtC,YAYsC,wBAAA;KAXnC,cAAA,QAAA;KACA,aAAA,QAAA;KACA,UAAA,QAAA;KACA,UAAA,QAAA;KACA,SAAA,QAAA;KACA,UAAA,QAAA;KACA,iBAAA,QAAA;KACA,yBAAyB,aAAA,MAAa;KACtC,QAAA,QAAA;KACA,kBAAc;KACd,2BAAuB;KACvB,kBAAc;;;;;;;;;;;;;qCAInB,mBAKM,OAAA;;IAHJ,OAAK,eAAA,CAAC,mFAAiF,EAAA,gDAC7B,QAAA,SAAQ,CAAA,CAAA;sBAC/D,MAAA,SAAA,CAAS,CAAA,yDAAA,CAAA,GAAA,CAAA,EAAA,GAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AA0rBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAgBrE,OAAe,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAazD,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,uBAAuB,EAAE,yBAAyB,CAAA;IAClD,oGAAoG;IACpG,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,yFAAyF;IACzF,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AAwtCF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AAqtBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAiBrE,OAAe,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAKzD,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,uBAAuB,EAAE,yBAAyB,CAAA;IAClD,oGAAoG;IACpG,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,yFAAyF;IACzF,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AAgxCF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}