@scalar/api-client 3.14.0 → 3.16.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 (369) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/assets/computer.ascii.virtual.js.map +1 -1
  3. package/dist/components/HelpfulLink.vue.script.js +1 -1
  4. package/dist/components/HelpfulLink.vue.script.js.map +1 -1
  5. package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
  6. package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
  7. package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
  8. package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +1 -1
  9. package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js +1 -1
  10. package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -1
  11. package/dist/components/SectionFilter.vue.d.ts +1 -1
  12. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  13. package/dist/components/SectionFilter.vue.js +1 -1
  14. package/dist/components/SectionFilter.vue.script.js +2 -2
  15. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  16. package/dist/components/SectionFilterButton.vue.script.js +1 -1
  17. package/dist/components/SectionFilterButton.vue.script.js.map +1 -1
  18. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
  19. package/dist/components/Server/ServerVariablesForm.vue.script.js +1 -1
  20. package/dist/components/Server/ServerVariablesForm.vue.script.js.map +1 -1
  21. package/dist/components/Server/ServerVariablesSelect.vue.script.js +1 -1
  22. package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
  23. package/dist/components/Server/ServerVariablesTextbox.vue.script.js +1 -1
  24. package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
  25. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  26. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +1 -1
  27. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
  28. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  29. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +1 -1
  30. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
  31. package/dist/components/ViewLayout/ViewLayout.vue.script.js +1 -1
  32. package/dist/components/ViewLayout/ViewLayout.vue.script.js.map +1 -1
  33. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
  34. package/dist/components/ViewLayout/ViewLayoutContent.vue.js.map +1 -1
  35. package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js +1 -1
  36. package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js.map +1 -1
  37. package/dist/hooks/use-file-dialog.js +2 -1
  38. package/dist/hooks/use-file-dialog.js.map +1 -1
  39. package/dist/plugins/posthog/index.js.map +1 -1
  40. package/dist/plugins/posthog/sanitize-event-payload.js +1 -1
  41. package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -1
  42. package/dist/style.css +298 -275
  43. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  45. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +38 -6
  46. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  47. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  48. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  49. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +1 -1
  50. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  51. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
  52. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +1 -1
  53. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
  54. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
  55. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js.map +1 -1
  56. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
  57. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js.map +1 -1
  58. package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js.map +1 -1
  59. package/dist/v2/blocks/operation-block/helpers/persist-script-environment.d.ts +53 -0
  60. package/dist/v2/blocks/operation-block/helpers/persist-script-environment.d.ts.map +1 -0
  61. package/dist/v2/blocks/operation-block/helpers/persist-script-environment.js +91 -0
  62. package/dist/v2/blocks/operation-block/helpers/persist-script-environment.js.map +1 -0
  63. package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
  64. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  65. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  66. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  67. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  68. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  69. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +58 -29
  70. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  71. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  72. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  75. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +1 -1
  77. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  81. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +1 -1
  82. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -1
  85. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -0
  87. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  88. package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
  89. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +5 -3
  90. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
  91. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
  92. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  94. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  95. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +6 -3
  96. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  97. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +8 -0
  98. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  99. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  100. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +29 -16
  101. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  102. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +1 -1
  103. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  104. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js.map +1 -1
  105. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +1 -1
  106. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  107. package/dist/v2/blocks/request-block/helpers/files.js.map +1 -1
  108. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -1
  109. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +10 -5
  110. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  111. package/dist/v2/blocks/request-block/helpers/get-parameter-content.js.map +1 -1
  112. package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js.map +1 -1
  113. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -1
  114. package/dist/v2/blocks/request-block/helpers/group-by.js.map +1 -1
  115. package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts +54 -0
  116. package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts.map +1 -0
  117. package/dist/v2/blocks/request-block/helpers/group-global-cookies.js +56 -0
  118. package/dist/v2/blocks/request-block/helpers/group-global-cookies.js.map +1 -0
  119. package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +1 -1
  120. package/dist/v2/blocks/request-block/helpers/structured-body-codec.js.map +1 -1
  121. package/dist/v2/blocks/request-block/helpers/validate-parameter.js.map +1 -1
  122. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  123. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  124. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +1 -1
  125. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  126. package/dist/v2/blocks/response-block/components/Headers.vue.script.js +1 -1
  127. package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
  128. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  129. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +1 -1
  130. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  131. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +1 -1
  132. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
  133. package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +1 -1
  134. package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js.map +1 -1
  135. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
  136. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
  137. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
  138. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +10 -3
  139. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
  140. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
  141. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +1 -1
  142. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
  143. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  144. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +1 -1
  145. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
  146. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +1 -1
  147. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
  148. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +1 -1
  149. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
  150. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +1 -1
  151. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
  152. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  153. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +1 -1
  154. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
  155. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  156. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
  157. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +1 -1
  158. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
  159. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +1 -1
  160. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
  161. package/dist/v2/blocks/response-block/helpers/extract-filename.js.map +1 -1
  162. package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
  163. package/dist/v2/blocks/response-block/helpers/media-types.d.ts +1 -1
  164. package/dist/v2/blocks/response-block/helpers/media-types.d.ts.map +1 -1
  165. package/dist/v2/blocks/response-block/helpers/media-types.js +12 -0
  166. package/dist/v2/blocks/response-block/helpers/media-types.js.map +1 -1
  167. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js.map +1 -1
  168. package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js.map +1 -1
  169. package/dist/v2/blocks/response-block/helpers/prettify-ndjson.d.ts +12 -0
  170. package/dist/v2/blocks/response-block/helpers/prettify-ndjson.d.ts.map +1 -0
  171. package/dist/v2/blocks/response-block/helpers/prettify-ndjson.js +19 -0
  172. package/dist/v2/blocks/response-block/helpers/prettify-ndjson.js.map +1 -0
  173. package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
  174. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -1
  175. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +7 -1
  176. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -1
  177. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  178. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  179. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +1 -1
  180. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  181. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  182. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  183. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +1 -1
  184. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  185. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  186. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +1 -1
  187. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  188. package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +3 -1
  189. package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js.map +1 -1
  190. package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js.map +1 -1
  191. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -1
  192. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js.map +1 -1
  193. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js.map +1 -1
  194. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  195. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
  196. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  197. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  198. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +1 -1
  199. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
  200. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  201. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +1 -1
  202. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  203. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  204. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +1 -1
  205. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
  206. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  207. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +1 -1
  208. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  209. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
  210. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +1 -1
  211. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  212. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  213. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +1 -1
  214. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  215. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  216. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +3 -3
  217. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
  218. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  219. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  220. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +24 -17
  221. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  222. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  223. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +5 -0
  224. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  225. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js +1 -1
  226. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js.map +1 -1
  227. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.d.ts +20 -0
  228. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.d.ts.map +1 -0
  229. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.js +27 -0
  230. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.js.map +1 -0
  231. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +2 -2
  232. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  233. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  234. package/dist/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url.js.map +1 -1
  235. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -1
  236. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  237. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +15 -6
  238. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  239. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  240. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  241. package/dist/v2/components/code-input/CodeInput.vue.script.js +6 -1
  242. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  243. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  244. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  245. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +5 -1
  246. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  247. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +1 -1
  248. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
  249. package/dist/v2/components/code-input/code-variable-widget.js +1 -0
  250. package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
  251. package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -1
  252. package/dist/v2/components/code-input/helpers/lookup-variable-value.js.map +1 -1
  253. package/dist/v2/components/code-input/helpers/pill-signature.js.map +1 -1
  254. package/dist/v2/components/code-input/helpers/serialize-value.js.map +1 -1
  255. package/dist/v2/components/context-menu/ContextMenu.vue.script.js +1 -1
  256. package/dist/v2/components/context-menu/ContextMenu.vue.script.js.map +1 -1
  257. package/dist/v2/components/data-table/DataTable.vue.script.js +1 -1
  258. package/dist/v2/components/data-table/DataTable.vue.script.js.map +1 -1
  259. package/dist/v2/components/data-table/DataTableCell.vue.script.js +1 -1
  260. package/dist/v2/components/data-table/DataTableCell.vue.script.js.map +1 -1
  261. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +1 -1
  262. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
  263. package/dist/v2/components/data-table/DataTableHeader.vue.script.js +1 -1
  264. package/dist/v2/components/data-table/DataTableHeader.vue.script.js.map +1 -1
  265. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  266. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  267. package/dist/v2/components/data-table/DataTableInput.vue.script.js +1 -1
  268. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  269. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  270. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +3 -2
  271. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
  272. package/dist/v2/components/data-table/DataTableRow.vue.js +1 -1
  273. package/dist/v2/components/data-table/DataTableRow.vue.js.map +1 -1
  274. package/dist/v2/components/data-table/DataTableText.vue.script.js +1 -1
  275. package/dist/v2/components/data-table/DataTableText.vue.script.js.map +1 -1
  276. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  277. package/dist/v2/components/forms/ConfirmationForm.vue.script.js +1 -1
  278. package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
  279. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
  280. package/dist/v2/components/layout/CollapsibleSection.vue.script.js +1 -1
  281. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  282. package/dist/v2/components/layout/ValueEmitter.vue.d.ts +1 -1
  283. package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
  284. package/dist/v2/components/layout/ValueEmitter.vue.script.js +1 -1
  285. package/dist/v2/components/layout/ValueEmitter.vue.script.js.map +1 -1
  286. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
  287. package/dist/v2/components/modals/DeleteModal.vue.script.js +1 -1
  288. package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
  289. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  290. package/dist/v2/components/modals/ModalClientContainer.vue.script.js +1 -1
  291. package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
  292. package/dist/v2/components/resize/Resize.vue.js +1 -1
  293. package/dist/v2/components/resize/Resize.vue.script.js +1 -1
  294. package/dist/v2/components/resize/Resize.vue.script.js.map +1 -1
  295. package/dist/v2/components/resize/use-split-resize.js +4 -2
  296. package/dist/v2/components/resize/use-split-resize.js.map +1 -1
  297. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  298. package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
  299. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  300. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
  301. package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
  302. package/dist/v2/components/server/ServerDropdownItem.vue.script.js +1 -1
  303. package/dist/v2/components/server/ServerDropdownItem.vue.script.js.map +1 -1
  304. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  305. package/dist/v2/components/sidebar/Sidebar.vue.script.js +3 -3
  306. package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
  307. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  308. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +1 -1
  309. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
  310. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +1 -1
  311. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
  312. package/dist/v2/constants.js +1 -1
  313. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +1 -1
  314. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
  315. package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js +1 -1
  316. package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js.map +1 -1
  317. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  318. package/dist/v2/features/environments/EnvironmentsList.vue.script.js +1 -1
  319. package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
  320. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  321. package/dist/v2/features/environments/components/Environment.vue.script.js +1 -1
  322. package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
  323. package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js +3 -2
  324. package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js.map +1 -1
  325. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  326. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +1 -1
  327. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
  328. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  329. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +1 -1
  330. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
  331. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  332. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
  333. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  334. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  335. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
  336. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +1 -1
  337. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
  338. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  339. package/dist/v2/features/modal/Modal.vue.script.js +1 -1
  340. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  341. package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
  342. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  343. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js.map +1 -1
  344. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -1
  345. package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
  346. package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
  347. package/dist/v2/features/modal/modal-events.js.map +1 -1
  348. package/dist/v2/features/operation/Operation.vue.script.js +1 -1
  349. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  350. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
  351. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  352. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +1 -1
  353. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  354. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
  355. package/dist/v2/features/search/components/SearchResult.vue.script.js +1 -1
  356. package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
  357. package/dist/v2/features/search/helpers/create-fuse-instance.js.map +1 -1
  358. package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
  359. package/dist/v2/features/search/hooks/use-document-search.js.map +1 -1
  360. package/dist/v2/features/search/hooks/use-search-index.js.map +1 -1
  361. package/dist/v2/helpers/generate-location-id.js.map +1 -1
  362. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  363. package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
  364. package/dist/v2/helpers/test-utils.js.map +1 -1
  365. package/dist/v2/hooks/use-global-hot-keys.js.map +1 -1
  366. package/dist/v2/hooks/use-scroll-lock.js.map +1 -1
  367. package/dist/v2/workspace-events.js.map +1 -1
  368. package/dist/vue-styles.css +229 -236
  369. package/package.json +20 -20
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport type { WorkspaceGroup } from '@scalar/components/menu'\nimport { ScalarSidebarSearchInput } from '@scalar/components/sidebar'\nimport { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n ScalarSidebar,\n type DraggingItem,\n type HoveredItem,\n type SidebarState,\n} from '@scalar/sidebar'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { Resize } from '@/v2/components/resize'\nimport { useSearchIndex } from '@/v2/features/search'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport SidebarMenu from './SidebarMenu.vue'\n\nconst { documents, sidebarState, layout } = defineProps<{\n /** All documents to display sidebar items for */\n sidebarState: SidebarState<TraversedEntry>\n /** Layout for the client */\n layout: ClientLayout\n /** The currently active workspace */\n activeWorkspace: { id: string }\n /** The list of all available workspaces */\n workspaces: WorkspaceGroup[]\n /** The documents belonging to the workspace */\n documents: WorkspaceDocument[]\n /**\n * Prevents sidebar items from being hovered and dropped into. Can be either a function or a boolean\n *\n * @default true\n */\n isDroppable?:\n | boolean\n | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean)\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an item is selected */\n (e: 'selectItem', id: string): void\n /** Emitted when a workspace is selected by optional ID */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when sidebar items are reordered via drag and drop */\n (e: 'reorder', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst slots = defineSlots<{\n /** Slot to add the workspace button */\n workspaceButton?(): unknown\n /** Slot to add additional content to the decorator */\n decorator?(props: { item: TraversedEntry }): unknown\n /** Slot to add additional content to the footer */\n footer?(): unknown\n /** Slot to add additional content to the empty folder */\n empty?(props: { item: TraversedEntry }): unknown\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n /** Slot to add additional content to the icon */\n icon?(props: { item: TraversedEntry; open: boolean }): unknown\n}>()\n\n/** Controls the visibility of the search input */\nconst isSearchVisible = ref(false)\n\n/** Controls the width of the sidebar */\nconst sidebarWidth = defineModel<number>('sidebarWidth', {\n required: true,\n default: 288,\n})\n\nconst isDraft = (item: TraversedEntry) => {\n return item.type === 'example' && item.title === 'draft'\n}\n\n/** We handle search results out here so we can show them in the sidebar */\nconst { query, results } = useSearchIndex(() =>\n documents.filter(isOpenApiDocument),\n)\n\n/** We show either the search results or the sidebar items */\nconst items = computed(() => results.value ?? sidebarState.items.value)\n\n/** Select an item and clear the search query */\nconst handleSelectItem = (id: string) => {\n emit('selectItem', id)\n query.value = ''\n isSearchVisible.value = false\n}\n</script>\n<template>\n <Resize\n v-model:width=\"sidebarWidth\"\n class=\"flex flex-col\">\n <template #default>\n <ScalarSidebar\n class=\"flex w-auto flex-1\"\n :indent=\"20\"\n :isDraggable=\"layout !== 'modal'\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items\n layout=\"client\"\n :options=\"{ hideOperationDefaultExamples: layout === 'modal' }\"\n @reorder=\"\n (draggingItem, hoveredItem) =>\n emit('reorder', draggingItem, hoveredItem)\n \"\n @selectItem=\"handleSelectItem\">\n <template #header>\n <!-- drag region (macos) -->\n <div class=\"mac:h-12 mac:app-drag-region h-2\"></div>\n <div\n class=\"bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5\"\n :class=\"{\n 'max-md:pt-12': layout === 'desktop',\n 'max-md:pt-2 max-md:pl-4!': layout === 'modal',\n 'pt-1 max-md:pt-2 max-md:pl-14': layout === 'web',\n }\">\n <div\n v-if=\"layout !== 'web'\"\n class=\"flex items-center justify-between\"\n :class=\"{ 'max-md:pl-10': layout === 'desktop' }\">\n <!-- Desktop gets the workspace menu here -->\n <SidebarMenu\n v-if=\"layout !== 'modal'\"\n :activeWorkspace=\"activeWorkspace\"\n :workspaces=\"workspaces\"\n @create:workspace=\"emit('create:workspace')\"\n @navigate:to:settings=\"emit('navigate:to:settings')\"\n @select:workspace=\"(id) => emit('select:workspace', id)\">\n <template #sidebarMenuActions>\n <slot name=\"sidebarMenuActions\" />\n </template>\n </SidebarMenu>\n\n <!-- Placeholder for the sidebar toggle in modal layout -->\n <div v-else-if=\"layout === 'modal'\"></div>\n\n <!-- Toggle search, always visible on web -->\n <ScalarIconButton\n class=\"hover:bg-b-2 active:text-c-1 size-8 rounded p-2\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n size=\"sm\"\n @click=\"isSearchVisible = !isSearchVisible\" />\n </div>\n\n <ScalarSidebarSearchInput\n v-if=\"isSearchVisible || layout === 'web'\"\n v-model=\"query\"\n :autofocus=\"layout !== 'web'\" />\n </div>\n </template>\n\n <template #spacer>\n <div class=\"flex-1\"></div>\n </template>\n\n <template\n v-if=\"slots.decorator\"\n #decorator=\"decoratorProps\">\n <slot\n v-bind=\"decoratorProps\"\n name=\"decorator\" />\n </template>\n\n <template #icon=\"iconProps\">\n <template v-if=\"slots.icon || isDraft(iconProps.item)\">\n <ScalarIconFileDashed v-if=\"isDraft(iconProps.item)\" />\n <slot\n v-bind=\"iconProps\"\n name=\"icon\" />\n </template>\n </template>\n\n <!-- Empty folder slot -->\n <template\n v-if=\"slots.empty\"\n #empty=\"emptyProps\">\n <slot\n v-bind=\"emptyProps\"\n name=\"empty\" />\n </template>\n\n <template #before>\n <slot name=\"workspaceButton\" />\n </template>\n\n <template #footer>\n <slot name=\"footer\" />\n </template>\n </ScalarSidebar>\n </template>\n </Resize>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,OAAO;EAab,MAAM,QAAQ,UAAA;;EAgBd,MAAM,kBAAkB,IAAI,MAAK;;EAGjC,MAAM,eAAe,SAAmB,SAAC,eAGxC;EAED,MAAM,WAAW,SAAyB;AACxC,UAAO,KAAK,SAAS,aAAa,KAAK,UAAU;;;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,CAClB,WAEiB,KAAA,QAAA,SAAA,eAAA,mBADP,WAAU,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Sidebar.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport type { WorkspaceGroup } from '@scalar/components/menu'\nimport { ScalarSidebarSearchInput } from '@scalar/components/sidebar'\nimport { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n ScalarSidebar,\n type DraggingItem,\n type HoveredItem,\n type SidebarState,\n} from '@scalar/sidebar'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { Resize } from '@/v2/components/resize'\nimport { useSearchIndex } from '@/v2/features/search'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport SidebarMenu from './SidebarMenu.vue'\n\nconst { documents, sidebarState, layout } = defineProps<{\n /** All documents to display sidebar items for */\n sidebarState: SidebarState<TraversedEntry>\n /** Layout for the client */\n layout: ClientLayout\n /** The currently active workspace */\n activeWorkspace: { id: string }\n /** The list of all available workspaces */\n workspaces: WorkspaceGroup[]\n /** The documents belonging to the workspace */\n documents: WorkspaceDocument[]\n /**\n * Prevents sidebar items from being hovered and dropped into. Can be either a function or a boolean\n *\n * @default true\n */\n isDroppable?:\n | boolean\n | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean)\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an item is selected */\n (e: 'selectItem', id: string): void\n /** Emitted when a workspace is selected by optional ID */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when sidebar items are reordered via drag and drop */\n (e: 'reorder', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\nconst slots = defineSlots<{\n /** Slot to add the workspace button */\n workspaceButton?(): unknown\n /** Slot to add additional content to the decorator */\n decorator?(props: { item: TraversedEntry }): unknown\n /** Slot to add additional content to the footer */\n footer?(): unknown\n /** Slot to add additional content to the empty folder */\n empty?(props: { item: TraversedEntry }): unknown\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n /** Slot to add additional content to the icon */\n icon?(props: { item: TraversedEntry; open: boolean }): unknown\n}>()\n\n/** Controls the visibility of the search input */\nconst isSearchVisible = ref(false)\n\n/** Controls the width of the sidebar */\nconst sidebarWidth = defineModel<number>('sidebarWidth', {\n required: true,\n default: 288,\n})\n\nconst isDraft = (item: TraversedEntry) => {\n return item.type === 'example' && item.title === 'draft'\n}\n\n/** We handle search results out here so we can show them in the sidebar */\nconst { query, results } = useSearchIndex(() =>\n documents.filter(isOpenApiDocument),\n)\n\n/** We show either the search results or the sidebar items */\nconst items = computed(() => results.value ?? sidebarState.items.value)\n\n/** Select an item and clear the search query */\nconst handleSelectItem = (id: string) => {\n emit('selectItem', id)\n query.value = ''\n isSearchVisible.value = false\n}\n</script>\n<template>\n <Resize\n v-model:width=\"sidebarWidth\"\n class=\"flex flex-col\">\n <template #default>\n <ScalarSidebar\n class=\"flex w-auto flex-1\"\n :indent=\"20\"\n :isDraggable=\"layout !== 'modal'\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items\n layout=\"client\"\n :options=\"{ hideOperationDefaultExamples: layout === 'modal' }\"\n @reorder=\"\n (draggingItem, hoveredItem) =>\n emit('reorder', draggingItem, hoveredItem)\n \"\n @selectItem=\"handleSelectItem\">\n <template #header>\n <!-- drag region (macos) -->\n <div class=\"mac:h-12 mac:app-drag-region h-2\"></div>\n <div\n class=\"bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5\"\n :class=\"{\n 'max-md:pt-12': layout === 'desktop',\n 'max-md:pt-2 max-md:pl-4!': layout === 'modal',\n 'pt-1 max-md:pt-2 max-md:pl-14': layout === 'web',\n }\">\n <div\n v-if=\"layout !== 'web'\"\n class=\"flex items-center justify-between\"\n :class=\"{ 'max-md:pl-10': layout === 'desktop' }\">\n <!-- Desktop gets the workspace menu here -->\n <SidebarMenu\n v-if=\"layout !== 'modal'\"\n :activeWorkspace=\"activeWorkspace\"\n :workspaces=\"workspaces\"\n @create:workspace=\"emit('create:workspace')\"\n @navigate:to:settings=\"emit('navigate:to:settings')\"\n @select:workspace=\"(id) => emit('select:workspace', id)\">\n <template #sidebarMenuActions>\n <slot name=\"sidebarMenuActions\" />\n </template>\n </SidebarMenu>\n\n <!-- Placeholder for the sidebar toggle in modal layout -->\n <div v-else-if=\"layout === 'modal'\"></div>\n\n <!-- Toggle search, always visible on web -->\n <ScalarIconButton\n class=\"hover:bg-b-2 active:text-c-1 size-8 rounded p-2\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n size=\"sm\"\n @click=\"isSearchVisible = !isSearchVisible\" />\n </div>\n\n <ScalarSidebarSearchInput\n v-if=\"isSearchVisible || layout === 'web'\"\n v-model=\"query\"\n :autofocus=\"layout !== 'web'\" />\n </div>\n </template>\n\n <template #spacer>\n <div class=\"flex-1\"></div>\n </template>\n\n <template\n v-if=\"slots.decorator\"\n #decorator=\"decoratorProps\">\n <slot\n v-bind=\"decoratorProps\"\n name=\"decorator\" />\n </template>\n\n <template #icon=\"iconProps\">\n <template v-if=\"slots.icon || isDraft(iconProps.item)\">\n <ScalarIconFileDashed v-if=\"isDraft(iconProps.item)\" />\n <slot\n v-bind=\"iconProps\"\n name=\"icon\" />\n </template>\n </template>\n\n <!-- Empty folder slot -->\n <template\n v-if=\"slots.empty\"\n #empty=\"emptyProps\">\n <slot\n v-bind=\"emptyProps\"\n name=\"empty\" />\n </template>\n\n <template #before>\n <slot name=\"workspaceButton\" />\n </template>\n\n <template #footer>\n <slot name=\"footer\" />\n </template>\n </ScalarSidebar>\n </template>\n </Resize>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,OAAO;EAab,MAAM,QAAQ,SAAA;;EAgBd,MAAM,kBAAkB,IAAI,KAAK;;EAGjC,MAAM,eAAe,SAAmB,SAAC,cAGxC;EAED,MAAM,WAAW,SAAyB;GACxC,OAAO,KAAK,SAAS,aAAa,KAAK,UAAU;EACnD;;EAGA,MAAM,EAAE,OAAO,YAAY,qBACzB,QAAA,UAAU,OAAO,iBAAiB,CACpC;;EAGA,MAAM,QAAQ,eAAe,QAAQ,SAAS,QAAA,aAAa,MAAM,KAAK;;EAGtE,MAAM,oBAAoB,OAAe;GACvC,KAAK,cAAc,EAAE;GACrB,MAAM,QAAQ;GACd,gBAAgB,QAAQ;EAC1B;;uBAGE,YAwGS,MAAA,cAAA,GAAA;IAvGC,OAAO,aAAA;yEAAY,QAAA;IAC3B,OAAM;;IACK,SAAO,cAmGA,CAlGhB,YAkGgB,MAAA,aAAA,GAAA;KAjGd,OAAM;KACL,QAAQ;KACR,aAAa,QAAA,WAAM;KACnB,aAAa,QAAA;KACb,YAAY,QAAA,aAAa;KACzB,YAAY,QAAA,aAAa;KACzB,OAAA,MAAA;KACD,QAAO;KACN,SAAO,EAAA,8BAAkC,QAAA,WAAM,QAAA;KAC/C,WAAO,OAAA,OAAA,OAAA,MAAc,cAAc,gBAA4B,KAAI,WAAY,cAAc,WAAW;KAIxG,cAAY;;KACF,QAAM,cAEqC,CAAA,OAAA,OAAA,OAAA,KAApD,mBAAoD,OAAA,EAA/C,OAAM,mCAAkC,GAAA,MAAA,EAAA,IAC7C,mBAwCM,OAAA,EAvCJ,OAAK,eAAA,CAAC,wDAAsD;sBACpB,QAAA,WAAM;kCAA0D,QAAA,WAAM;uCAA6D,QAAA,WAAM;aAMzK,QAAA,WAAM,SAAA,UAAA,GADd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A,CAAA,GAAA,EAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;KAcZ,QAAM,cACgB,CAA/B,WAA+B,KAAA,QAAA,iBAAA,CAAA,CAAA;KAGtB,QAAM,cACO,CAAtB,WAAsB,KAAA,QAAA,QAAA,CAAA,CAAA;;QA9BhB,MAAM,YAAA;WACX;kBAAW,mBAAc,CAC1B,WAEqB,KAAA,QAAA,aAAA,eAAA,mBADX,cAAc,CAAA,CAAA,CAAA,CAAA;;gBAelB,MAAM,QAAA;WACX;kBAAO,eAAU,CAClB,WAEiB,KAAA,QAAA,SAAA,eAAA,mBADP,UAAU,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AA2EA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;AAGhC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B,CAAC;AAcF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAyJF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AA2EA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;AAGhC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B,CAAC;AAcF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AA4JF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import { createBlock, createTextVNode, createVNode, defineComponent, openBlock,
2
2
  import { ScalarIconGear } from "@scalar/icons";
3
3
  import { ScalarMenu, ScalarMenuLink, ScalarMenuProducts, ScalarMenuResources, ScalarMenuSection, ScalarMenuSupport, ScalarMenuWorkspacePicker } from "@scalar/components/menu";
4
4
  //#region src/v2/components/sidebar/SidebarMenu.vue?vue&type=script&setup=true&lang.ts
5
- var SidebarMenu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
5
+ var SidebarMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
6
6
  __name: "SidebarMenu",
7
7
  props: {
8
8
  activeWorkspace: {},
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarMenu.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarMenu,\n ScalarMenuLink,\n ScalarMenuProducts,\n ScalarMenuResources,\n ScalarMenuSection,\n ScalarMenuSupport,\n ScalarMenuWorkspacePicker,\n type WorkspaceGroup,\n} from '@scalar/components/menu'\nimport { ScalarIconGear } from '@scalar/icons'\n\nconst { activeWorkspace, workspaces } = defineProps<{\n /**\n * The currently active workspace.\n * This represents the workspace that the user is currently working in.\n */\n activeWorkspace: { id: string }\n /**\n * The list of all available workspaces.\n * Used to render options for workspace switching and selection.\n */\n workspaces: WorkspaceGroup[]\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when the user selects a workspace */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\ndefineSlots<{\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n}>()\n</script>\n<template>\n <!-- Desktop app menu -->\n <ScalarMenu>\n <template #products>\n <ScalarMenuProducts selected=\"client\" />\n </template>\n <template #sections=\"{ close }\">\n <ScalarMenuSection>\n <slot name=\"sidebarMenuActions\">\n <ScalarMenuWorkspacePicker\n :modelValue=\"activeWorkspace.id\"\n :workspaceOptions=\"workspaces\"\n @createWorkspace=\"emit('create:workspace')\"\n @update:modelValue=\"(value) => emit('select:workspace', value)\" />\n <ScalarMenuLink\n is=\"button\"\n :icon=\"ScalarIconGear\"\n @click=\"\n () => {\n close()\n emit('navigate:to:settings')\n }\n \">\n Settings\n </ScalarMenuLink>\n </slot>\n </ScalarMenuSection>\n <ScalarMenuResources />\n <ScalarMenuSupport />\n </template>\n </ScalarMenu>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EA0BA,MAAM,OAAO;;uBAgBX,YA4Ba,MAAA,WAAA,EAAA,MAAA;IA3BA,UAAQ,cACuB,CAAxC,YAAwC,MAAA,mBAAA,EAAA,EAApB,UAAS,UAAQ,CAAA,CAAA,CAAA;IAE5B,UAAQ,SAoBG,EApBC,YAAK;KAC1B,YAmBoB,MAAA,kBAAA,EAAA,MAAA;6BADX,CAjBP,WAiBO,KAAA,QAAA,sBAAA,EAAA,QAAA,CAhBL,YAIoE,MAAA,0BAAA,EAAA;OAHjE,YAAY,QAAA,gBAAgB;OAC5B,kBAAkB,QAAA;OAClB,mBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,mBAAA;OACrB,uBAAiB,OAAA,OAAA,OAAA,MAAG,UAAU,KAAI,oBAAqB,MAAK;uDAC/D,YAUiB,MAAA,eAAA,EAAA;OATf,IAAG;OACF,MAAM,MAAA,eAAc;OACpB,eAAA;AAA8C,eAAK;AAAmB,aAAI,uBAAA;;;8BAO7E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,cAEJ,GAAA,CAAA,EAAA,CAAA;;;;;KAGJ,YAAuB,MAAA,oBAAA,CAAA;KACvB,YAAqB,MAAA,kBAAA,CAAA"}
1
+ {"version":3,"file":"SidebarMenu.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarMenu,\n ScalarMenuLink,\n ScalarMenuProducts,\n ScalarMenuResources,\n ScalarMenuSection,\n ScalarMenuSupport,\n ScalarMenuWorkspacePicker,\n type WorkspaceGroup,\n} from '@scalar/components/menu'\nimport { ScalarIconGear } from '@scalar/icons'\n\nconst { activeWorkspace, workspaces } = defineProps<{\n /**\n * The currently active workspace.\n * This represents the workspace that the user is currently working in.\n */\n activeWorkspace: { id: string }\n /**\n * The list of all available workspaces.\n * Used to render options for workspace switching and selection.\n */\n workspaces: WorkspaceGroup[]\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user wants to create a new workspace */\n (e: 'create:workspace'): void\n /** Emitted when the user selects a workspace */\n (e: 'select:workspace', id?: string): void\n /** Emitted when the user wants to open the settings */\n (e: 'navigate:to:settings'): void\n}>()\n\ndefineSlots<{\n /** Slot for customizing the actions section of the sidebar menu. */\n sidebarMenuActions?(): unknown\n}>()\n</script>\n<template>\n <!-- Desktop app menu -->\n <ScalarMenu>\n <template #products>\n <ScalarMenuProducts selected=\"client\" />\n </template>\n <template #sections=\"{ close }\">\n <ScalarMenuSection>\n <slot name=\"sidebarMenuActions\">\n <ScalarMenuWorkspacePicker\n :modelValue=\"activeWorkspace.id\"\n :workspaceOptions=\"workspaces\"\n @createWorkspace=\"emit('create:workspace')\"\n @update:modelValue=\"(value) => emit('select:workspace', value)\" />\n <ScalarMenuLink\n is=\"button\"\n :icon=\"ScalarIconGear\"\n @click=\"\n () => {\n close()\n emit('navigate:to:settings')\n }\n \">\n Settings\n </ScalarMenuLink>\n </slot>\n </ScalarMenuSection>\n <ScalarMenuResources />\n <ScalarMenuSupport />\n </template>\n </ScalarMenu>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EA0BA,MAAM,OAAO;;uBAgBX,YA4Ba,MAAA,UAAA,GAAA,MAAA;IA3BA,UAAQ,cACuB,CAAxC,YAAwC,MAAA,kBAAA,GAAA,EAApB,UAAS,SAAQ,CAAA,CAAA,CAAA;IAE5B,UAAQ,SAoBG,EApBC,YAAK;KAC1B,YAmBoB,MAAA,iBAAA,GAAA,MAAA;6BADX,CAjBP,WAiBO,KAAA,QAAA,sBAAA,CAAA,SAAA,CAhBL,YAIoE,MAAA,yBAAA,GAAA;OAHjE,YAAY,QAAA,gBAAgB;OAC5B,kBAAkB,QAAA;OAClB,mBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,kBAAA;OACrB,uBAAiB,OAAA,OAAA,OAAA,MAAG,UAAU,KAAI,oBAAqB,KAAK;uDAC/D,YAUiB,MAAA,cAAA,GAAA;OATf,IAAG;OACF,MAAM,MAAA,cAAA;OACN,eAAA;QAA8C,MAAK;QAAmB,KAAI,sBAAA;;;8BAO7E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,cAEJ,EAAA,CAAA,EAAA,CAAA;;;;;KAGJ,YAAuB,MAAA,mBAAA,CAAA;KACvB,YAAqB,MAAA,iBAAA,CAAA"}
@@ -9,7 +9,7 @@ var _hoisted_3 = {
9
9
  xmlns: "http://www.w3.org/2000/svg"
10
10
  };
11
11
  var _hoisted_4 = { "clip-path": "url(#mask)" };
12
- var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
12
+ var SidebarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
13
13
  __name: "SidebarToggle",
14
14
  props: {
15
15
  "modelValue": {
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarToggle.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{ isSidebarOpen ? 'Hide' : 'Show' }} sidebar</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EACA,MAAM,gBAAgB,SAAoB,SAAA,aAEzC;;uBAGC,mBAgCS,UAAA;IA/BN,gBAAc,cAAA;IACf,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,cAAA,QAAa,CAAI,cAAA;OACzB,mBAA0E,QAA1E,YAA0E,gBAAjD,cAAA,QAAa,SAAA,OAAA,GAAqB,YAAQ,EAAA,GAAA,WAAA,EACnE,mBAyBM,OAzBN,YAyBM;8BApBJ,mBAMO,QAAA,MAAA,CALL,mBAIW,YAAA,EAJD,IAAG,QAAM,EAAA,CACjB,mBAE8D,QAAA;KAD5D,aAAU;KACV,GAAE;;IAGR,mBAMI,KANJ,YAMI,CALF,mBAIwB,QAAA;KAHtB,OAAK,eAAA,CAAC,qCACE,cAAA,QAAa,kBAAA,mBAAA,CAAA;KACrB,GAAE;KACF,MAAK;;8BAET,mBAKqB,QAAA;KAJnB,GAAE;KACF,QAAO;KACP,kBAAe;KACf,mBAAgB;KAChB,gBAAa"}
1
+ {"version":3,"file":"SidebarToggle.vue.script.js","names":[],"sources":["../../../../src/v2/components/sidebar/SidebarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst isSidebarOpen = defineModel<boolean>({\n required: true,\n})\n</script>\n<template>\n <button\n :aria-pressed=\"isSidebarOpen\"\n class=\"scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded p-2\"\n type=\"button\"\n @click=\"isSidebarOpen = !isSidebarOpen\">\n <span class=\"sr-only\">{{ isSidebarOpen ? 'Hide' : 'Show' }} sidebar</span>\n <svg\n class=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"mask\">\n <path\n clip-rule=\"evenodd\"\n d=\"M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z\" />\n </clipPath>\n </defs>\n <g clip-path=\"url(#mask)\">\n <path\n class=\"transition-transform duration-300\"\n :class=\"isSidebarOpen ? 'translate-x-0' : '-translate-x-1/2'\"\n d=\"M1 3.2h8v17.5H1z\"\n fill=\"currentColor\" />\n </g>\n <path\n d=\"M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </svg>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EACA,MAAM,gBAAgB,SAAoB,SAAA,YAEzC;;uBAGC,mBAgCS,UAAA;IA/BN,gBAAc,cAAA;IACf,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,cAAA,QAAa,CAAI,cAAA;OACzB,mBAA0E,QAA1E,YAA0E,gBAAjD,cAAA,QAAa,SAAA,MAAA,IAAqB,YAAQ,CAAA,IAAA,UAAA,GACnE,mBAyBM,OAzBN,YAyBM;8BApBJ,mBAMO,QAAA,MAAA,CALL,mBAIW,YAAA,EAJD,IAAG,OAAM,GAAA,CACjB,mBAE8D,QAAA;KAD5D,aAAU;KACV,GAAE;;IAGR,mBAMI,KANJ,YAMI,CALF,mBAIwB,QAAA;KAHtB,OAAK,eAAA,CAAC,qCACE,cAAA,QAAa,kBAAA,kBAAA,CAAA;KACrB,GAAE;KACF,MAAK;;8BAET,mBAKqB,QAAA;KAJnB,GAAE;KACF,QAAO;KACP,kBAAe;KACf,mBAAgB;KAChB,gBAAa"}
@@ -1,6 +1,6 @@
1
1
  //#region src/v2/constants.ts
2
2
  /** The version number taken from the package.json. Consumers can override at build time via define (e.g. OVERRIDE_PACKAGE_VERSION: JSON.stringify('1.2.3')). */
3
- var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.14.0";
3
+ var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.16.0";
4
4
  //#endregion
5
5
  export { APP_VERSION };
6
6
 
@@ -4,7 +4,7 @@ import { useBindCx } from "@scalar/use-hooks/useBindCx";
4
4
  //#region src/v2/features/command-palette/components/CommandActionForm.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = { class: "flex gap-2" };
6
6
  var _hoisted_2 = { class: "flex max-h-8 flex-1" };
7
- var CommandActionForm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
7
+ var CommandActionForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
8
8
  name: "CommandActionForm",
9
9
  props: {
10
10
  loader: {},
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionForm.vue.script.js","names":[],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Form Component\n *\n * A reusable form wrapper for command palette actions.\n * Provides a consistent layout with a main content area, optional controls,\n * and a submit button. Prevents form submission when disabled.\n *\n * @example\n * <CommandActionForm\n * :loader\n * :disabled=\"isDisabled\"\n * @submit=\"handleSubmit\"\n * @cancel=\"handleCancel\"\n * @back=\"handleBack\"\n * >\n * <!-- Main content goes in default slot -->\n * <CommandActionInput v-model=\"value\" />\n *\n * <!-- Optional controls in options slot -->\n * <template #options>\n * <ScalarCheckbox v-model=\"option\" />\n * </template>\n *\n * <!-- Custom submit button text -->\n * <template #submit>Create</template>\n * </CommandActionForm>\n */\nexport default {\n name: 'CommandActionForm',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport type { LoadingState } from '@scalar/components/loading'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nconst { loader, disabled = false } = defineProps<{\n /** Loading state from useLoadingState composable to show spinner on submit button */\n loader?: LoadingState\n /** Whether the form and submit button are disabled */\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the form is submitted (if not disabled) */\n (event: 'submit'): void\n /** Emitted when the action is cancelled */\n (event: 'cancel'): void\n /** Emitted when user presses back (e.g., Escape key) */\n (event: 'back', e: KeyboardEvent): void\n}>()\n\ndefineSlots<{\n /** Main content area for form inputs */\n default(): void\n /** Optional controls displayed before the submit button (e.g., checkboxes, toggles, dropdowns) */\n options(): void\n /** Custom text or content for the submit button (defaults to \"Continue\") */\n submit(): void\n}>()\n\nconst { cx } = useBindCx()\n\n/** Handle form submission, only emit if not disabled */\nconst handleSubmit = (): void => {\n if (!disabled) {\n emit('submit')\n }\n}\n</script>\n\n<template>\n <form\n class=\"flex w-full flex-col gap-3\"\n @keydown.enter.stop\n @submit.prevent.stop=\"handleSubmit\">\n <!-- Main content area with minimum height and rounded corners -->\n <div v-bind=\"cx('relative flex min-h-20 flex-col rounded')\">\n <slot />\n </div>\n\n <!-- Action bar with optional controls and submit button -->\n <div class=\"flex gap-2\">\n <!-- Optional controls slot (e.g., checkboxes, toggles) -->\n <div class=\"flex max-h-8 flex-1\">\n <slot name=\"options\" />\n </div>\n\n <!-- Submit button with customizable text -->\n <ScalarButton\n class=\"max-h-8 px-3 text-xs\"\n :disabled=\"disabled\"\n :loader\n type=\"submit\">\n <slot name=\"submit\">Continue</slot>\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;CA6BE,MAAM;;;;;;;;;;;;;;EAgBR,MAAM,OAAO;EAkBb,MAAM,EAAE,OAAO,WAAU;;EAGzB,MAAM,qBAA2B;AAC/B,OAAI,CAAC,QAAA,SACH,MAAK,SAAQ;;;uBAMf,mBAyBO,QAAA;IAxBL,OAAM;IACL,WAAO,OAAA,OAAA,OAAA,KAAA,SAAA,oBAAR,IAAmB,CAAA,OAAA,CAAA,EAAA,CAAA,QAAA,CAAA;IAClB,UAAM,cAAe,cAAY,CAAA,WAAA,OAAA,CAAA;OAElC,mBAEM,OAAA,eAAA,mBAFO,MAAA,GAAE,CAAA,0CAAA,CAAA,CAAA,EAAA,CACb,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,GAAA,EAIV,mBAcM,OAdN,YAcM,CAZJ,mBAEM,OAFN,YAEM,CADJ,WAAuB,KAAA,QAAA,UAAA,CAAA,CAAA,EAIzB,YAMe,MAAA,aAAA,EAAA;IALb,OAAM;IACL,UAAU,QAAA;IACV,QAAA,QAAA;IACD,MAAK;;2BAC8B,CAAnC,WAAmC,KAAA,QAAA,UAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAf,YAAQ,GAAA,EAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"CommandActionForm.vue.script.js","names":[],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionForm.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Form Component\n *\n * A reusable form wrapper for command palette actions.\n * Provides a consistent layout with a main content area, optional controls,\n * and a submit button. Prevents form submission when disabled.\n *\n * @example\n * <CommandActionForm\n * :loader\n * :disabled=\"isDisabled\"\n * @submit=\"handleSubmit\"\n * @cancel=\"handleCancel\"\n * @back=\"handleBack\"\n * >\n * <!-- Main content goes in default slot -->\n * <CommandActionInput v-model=\"value\" />\n *\n * <!-- Optional controls in options slot -->\n * <template #options>\n * <ScalarCheckbox v-model=\"option\" />\n * </template>\n *\n * <!-- Custom submit button text -->\n * <template #submit>Create</template>\n * </CommandActionForm>\n */\nexport default {\n name: 'CommandActionForm',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport type { LoadingState } from '@scalar/components/loading'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nconst { loader, disabled = false } = defineProps<{\n /** Loading state from useLoadingState composable to show spinner on submit button */\n loader?: LoadingState\n /** Whether the form and submit button are disabled */\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the form is submitted (if not disabled) */\n (event: 'submit'): void\n /** Emitted when the action is cancelled */\n (event: 'cancel'): void\n /** Emitted when user presses back (e.g., Escape key) */\n (event: 'back', e: KeyboardEvent): void\n}>()\n\ndefineSlots<{\n /** Main content area for form inputs */\n default(): void\n /** Optional controls displayed before the submit button (e.g., checkboxes, toggles, dropdowns) */\n options(): void\n /** Custom text or content for the submit button (defaults to \"Continue\") */\n submit(): void\n}>()\n\nconst { cx } = useBindCx()\n\n/** Handle form submission, only emit if not disabled */\nconst handleSubmit = (): void => {\n if (!disabled) {\n emit('submit')\n }\n}\n</script>\n\n<template>\n <form\n class=\"flex w-full flex-col gap-3\"\n @keydown.enter.stop\n @submit.prevent.stop=\"handleSubmit\">\n <!-- Main content area with minimum height and rounded corners -->\n <div v-bind=\"cx('relative flex min-h-20 flex-col rounded')\">\n <slot />\n </div>\n\n <!-- Action bar with optional controls and submit button -->\n <div class=\"flex gap-2\">\n <!-- Optional controls slot (e.g., checkboxes, toggles) -->\n <div class=\"flex max-h-8 flex-1\">\n <slot name=\"options\" />\n </div>\n\n <!-- Submit button with customizable text -->\n <ScalarButton\n class=\"max-h-8 px-3 text-xs\"\n :disabled=\"disabled\"\n :loader\n type=\"submit\">\n <slot name=\"submit\">Continue</slot>\n </ScalarButton>\n </div>\n </form>\n</template>\n"],"mappings":";;;;;;;CA6BE,MAAM;;;;;;;;;;;;;;EAgBR,MAAM,OAAO;EAkBb,MAAM,EAAE,OAAO,UAAU;;EAGzB,MAAM,qBAA2B;GAC/B,IAAI,CAAC,QAAA,UACH,KAAK,QAAQ;EAEjB;;uBAIE,mBAyBO,QAAA;IAxBL,OAAM;IACL,WAAO,OAAA,OAAA,OAAA,KAAA,SAAA,oBAAR,CAAA,GAAmB,CAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;IAClB,UAAM,cAAe,cAAY,CAAA,WAAA,MAAA,CAAA;OAElC,mBAEM,OAAA,eAAA,mBAFO,MAAA,EAAA,CAAE,CAAA,yCAAA,CAAA,CAAA,GAAA,CACb,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,GAIV,mBAcM,OAdN,YAcM,CAZJ,mBAEM,OAFN,YAEM,CADJ,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA,GAIzB,YAMe,MAAA,YAAA,GAAA;IALb,OAAM;IACL,UAAU,QAAA;IACV,QAAA,QAAA;IACD,MAAK;;2BAC8B,CAAnC,WAAmC,KAAA,QAAA,UAAA,CAAA,SAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAf,YAAQ,EAAA,EAAA,CAAA,CAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { computed, createElementBlock, defineComponent, mergeProps, nextTick, onMounted, openBlock, ref, vModelText, withDirectives, withKeys } from "vue";
2
2
  //#region src/v2/features/command-palette/components/CommandActionInput.vue?vue&type=script&setup=true&lang.ts
3
3
  var _hoisted_1 = ["placeholder"];
4
- var CommandActionInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4
+ var CommandActionInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
5
5
  name: "CommandActionInput",
6
6
  inheritAttrs: false,
7
7
  props: {
@@ -1 +1 @@
1
- {"version":3,"file":"CommandActionInput.vue.script.js","names":["$attrs"],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Input Component\n *\n * A textarea input component for command palette actions.\n * Supports v-model binding, auto-focus, and special keyboard handling:\n * - Enter submits the parent form (unless Shift is held)\n * - Backspace emits delete event when input is empty (for navigation back)\n *\n * @example\n * <CommandActionInput\n * v-model=\"inputValue\"\n * placeholder=\"Enter name...\"\n * :autofocus=\"true\"\n * @delete=\"handleBack\"\n * />\n */\nexport default {\n name: 'CommandActionInput',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref } from 'vue'\n\nconst {\n modelValue,\n placeholder,\n autofocus = true,\n} = defineProps<{\n /** Current value of the input */\n modelValue?: string\n /** Placeholder text shown when input is empty */\n placeholder?: string\n /** Whether to automatically focus the input when mounted */\n autofocus?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the input value changes (v-model support) */\n (event: 'update:modelValue', value: string): void\n /** Emitted when backspace is pressed on empty input for navigation back */\n (event: 'delete', keyboardEvent: KeyboardEvent): void\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst input = ref<HTMLTextAreaElement | null>(null)\n\n/**\n * Two-way binding computed property for v-model support.\n * Ensures we always have a string value even if modelValue is undefined.\n */\nconst model = computed<string>({\n get: () => modelValue ?? '',\n set: (value) => emit('update:modelValue', value),\n})\n\n/**\n * Auto-focus the input after mounting if autofocus prop is true.\n * Uses nextTick to ensure the DOM is ready before focusing.\n */\nonMounted(() => {\n nextTick(() => {\n if (autofocus) {\n input.value?.focus()\n }\n })\n})\n\n/**\n * Handles Enter key to submit the parent form.\n * Shift+Enter is ignored to allow multi-line input if needed.\n */\nconst handleEnter = (event: KeyboardEvent): void => {\n if (event.shiftKey || !event.target) {\n return\n }\n\n event.preventDefault()\n\n const target = event.target as HTMLTextAreaElement\n const submitEvent = new Event('submit', { cancelable: true })\n target.form?.dispatchEvent(submitEvent)\n}\n\n/**\n * Handles Backspace key when input is empty.\n * Emits delete event to allow parent to navigate back or undo the last action.\n */\nconst handleDelete = (event: KeyboardEvent): void => {\n if (model.value !== '') {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n emit('delete', event)\n}\n</script>\n\n<template>\n <textarea\n id=\"command-action-input\"\n ref=\"input\"\n v-model=\"model\"\n class=\"min-h-8 w-full flex-1 resize-none border border-transparent py-1.5 pl-8.5 text-sm outline-none focus:border-b-1\"\n :placeholder=\"placeholder ?? ''\"\n wrap=\"hard\"\n v-bind=\"$attrs\"\n @keydown.delete=\"handleDelete\"\n @keydown.enter=\"handleEnter\" />\n</template>\n"],"mappings":";;;;CAkBE,MAAM;;;;;;;;;;;;EAoBR,MAAM,OAAO;EASb,MAAM,QAAQ,IAAgC,KAAI;;;;;EAMlD,MAAM,QAAQ,SAAiB;GAC7B,WAAW,QAAA,cAAc;GACzB,MAAM,UAAU,KAAK,qBAAqB,MAAM;GACjD,CAAA;;;;;AAMD,kBAAgB;AACd,kBAAe;AACb,QAAI,QAAA,UACF,OAAM,OAAO,OAAM;KAEtB;IACF;;;;;EAMD,MAAM,eAAe,UAA+B;AAClD,OAAI,MAAM,YAAY,CAAC,MAAM,OAC3B;AAGF,SAAM,gBAAe;GAErB,MAAM,SAAS,MAAM;GACrB,MAAM,cAAc,IAAI,MAAM,UAAU,EAAE,YAAY,MAAM,CAAA;AAC5D,UAAO,MAAM,cAAc,YAAW;;;;;;EAOxC,MAAM,gBAAgB,UAA+B;AACnD,OAAI,MAAM,UAAU,GAClB;AAGF,SAAM,gBAAe;AACrB,SAAM,iBAAgB;AACtB,QAAK,UAAU,MAAK;;;uCAKpB,mBASiC,YATjC,WASiC;IAR/B,IAAG;aACC;IAAJ,KAAI;uEACU,QAAA;IACd,OAAM;IACL,aAAa,QAAA,eAAW;IACzB,MAAK;MACGA,KAAAA,QAAM,EACb,WAAO,CAAA,SAAS,cAAY,CAAA,SAAA,CAAA,EAAA,SACb,aAAW,CAAA,QAAA,CAAA,CAAA,EAAA,CAAA,EAAA,MAAA,IAAA,WAAA,GAAA,CAAA,CAAA,YANlB,MAAA,MAAK,CAAA,CAAA"}
1
+ {"version":3,"file":"CommandActionInput.vue.script.js","names":["$attrs"],"sources":["../../../../../src/v2/features/command-palette/components/CommandActionInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Command Action Input Component\n *\n * A textarea input component for command palette actions.\n * Supports v-model binding, auto-focus, and special keyboard handling:\n * - Enter submits the parent form (unless Shift is held)\n * - Backspace emits delete event when input is empty (for navigation back)\n *\n * @example\n * <CommandActionInput\n * v-model=\"inputValue\"\n * placeholder=\"Enter name...\"\n * :autofocus=\"true\"\n * @delete=\"handleBack\"\n * />\n */\nexport default {\n name: 'CommandActionInput',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref } from 'vue'\n\nconst {\n modelValue,\n placeholder,\n autofocus = true,\n} = defineProps<{\n /** Current value of the input */\n modelValue?: string\n /** Placeholder text shown when input is empty */\n placeholder?: string\n /** Whether to automatically focus the input when mounted */\n autofocus?: boolean\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the input value changes (v-model support) */\n (event: 'update:modelValue', value: string): void\n /** Emitted when backspace is pressed on empty input for navigation back */\n (event: 'delete', keyboardEvent: KeyboardEvent): void\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst input = ref<HTMLTextAreaElement | null>(null)\n\n/**\n * Two-way binding computed property for v-model support.\n * Ensures we always have a string value even if modelValue is undefined.\n */\nconst model = computed<string>({\n get: () => modelValue ?? '',\n set: (value) => emit('update:modelValue', value),\n})\n\n/**\n * Auto-focus the input after mounting if autofocus prop is true.\n * Uses nextTick to ensure the DOM is ready before focusing.\n */\nonMounted(() => {\n nextTick(() => {\n if (autofocus) {\n input.value?.focus()\n }\n })\n})\n\n/**\n * Handles Enter key to submit the parent form.\n * Shift+Enter is ignored to allow multi-line input if needed.\n */\nconst handleEnter = (event: KeyboardEvent): void => {\n if (event.shiftKey || !event.target) {\n return\n }\n\n event.preventDefault()\n\n const target = event.target as HTMLTextAreaElement\n const submitEvent = new Event('submit', { cancelable: true })\n target.form?.dispatchEvent(submitEvent)\n}\n\n/**\n * Handles Backspace key when input is empty.\n * Emits delete event to allow parent to navigate back or undo the last action.\n */\nconst handleDelete = (event: KeyboardEvent): void => {\n if (model.value !== '') {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n emit('delete', event)\n}\n</script>\n\n<template>\n <textarea\n id=\"command-action-input\"\n ref=\"input\"\n v-model=\"model\"\n class=\"min-h-8 w-full flex-1 resize-none border border-transparent py-1.5 pl-8.5 text-sm outline-none focus:border-b-1\"\n :placeholder=\"placeholder ?? ''\"\n wrap=\"hard\"\n v-bind=\"$attrs\"\n @keydown.delete=\"handleDelete\"\n @keydown.enter=\"handleEnter\" />\n</template>\n"],"mappings":";;;;CAkBE,MAAM;;;;;;;;;;;;EAoBR,MAAM,OAAO;EASb,MAAM,QAAQ,IAAgC,IAAI;;;;;EAMlD,MAAM,QAAQ,SAAiB;GAC7B,WAAW,QAAA,cAAc;GACzB,MAAM,UAAU,KAAK,qBAAqB,KAAK;EACjD,CAAC;;;;;EAMD,gBAAgB;GACd,eAAe;IACb,IAAI,QAAA,WACF,MAAM,OAAO,MAAM;GAEvB,CAAC;EACH,CAAC;;;;;EAMD,MAAM,eAAe,UAA+B;GAClD,IAAI,MAAM,YAAY,CAAC,MAAM,QAC3B;GAGF,MAAM,eAAe;GAErB,MAAM,SAAS,MAAM;GACrB,MAAM,cAAc,IAAI,MAAM,UAAU,EAAE,YAAY,KAAK,CAAC;GAC5D,OAAO,MAAM,cAAc,WAAW;EACxC;;;;;EAMA,MAAM,gBAAgB,UAA+B;GACnD,IAAI,MAAM,UAAU,IAClB;GAGF,MAAM,eAAe;GACrB,MAAM,gBAAgB;GACtB,KAAK,UAAU,KAAK;EACtB;;uCAIE,mBASiC,YATjC,WASiC;IAR/B,IAAG;aACC;IAAJ,KAAI;uEACU,QAAA;IACd,OAAM;IACL,aAAa,QAAA,eAAW;IACzB,MAAK;MACGA,KAAAA,QAAM,EACb,WAAO,CAAA,SAAS,cAAY,CAAA,QAAA,CAAA,GAAA,SACb,aAAW,CAAA,OAAA,CAAA,CAAA,EAAA,CAAA,GAAA,MAAA,IAAA,UAAA,IAAA,CAAA,CAAA,YANlB,MAAA,KAAK,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAQpH,KAAK,WAAW,GAAG;IACb,kEAAkE;IAClE,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,mDAAmD;IACnD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,cAAc,CAAC;AAoLvB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAQpH,KAAK,WAAW,GAAG;IACb,kEAAkE;IAClE,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,mDAAmD;IACnD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,cAAc,CAAC;AAwLvB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -7,7 +7,7 @@ import { ScalarIconPlus } from "@scalar/icons";
7
7
  import { useModal } from "@scalar/components/modal";
8
8
  //#region src/v2/features/environments/EnvironmentsList.vue?vue&type=script&setup=true&lang.ts
9
9
  var _hoisted_1 = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" };
10
- var EnvironmentsList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
10
+ var EnvironmentsList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
11
11
  __name: "EnvironmentsList",
12
12
  props: {
13
13
  environments: {},
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentsList.vue.script.js","names":[],"sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { ref } from 'vue'\n\nimport EnvironmentCreateModal from '@/v2/features/environments/components/EnvironmentCreateModal.vue'\nimport EnvironmentDeleteModal from '@/v2/features/environments/components/EnvironmentDeleteModal.vue'\n\nimport EnvironmentComponent from './components/Environment.vue'\n\nconst { environments, eventBus, collectionType, activeEnvironment } =\n defineProps<\n {\n /** List of environments, ensured to be non-nullable for safety */\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n /** Event bus to handle workspace-related events */\n eventBus: WorkspaceEventBus\n /** The currently active environment name */\n activeEnvironment?: string\n } & CollectionType\n >()\n\nconst createEnvironmentModalState = useModal()\nconst deleteEnvironmentModalState = useModal()\n\n/** Track the currently selected environment for editing or deleting */\nconst selectedEnvironmentName = ref<string | null>(null)\n\n/** Opens the delete modal */\nconst openDeleteModal = (name: string) => {\n selectedEnvironmentName.value = name\n deleteEnvironmentModalState.show()\n}\n\n/** Deletes the selected environment */\nconst deleteEnvironment = () => {\n if (!selectedEnvironmentName.value) {\n return\n }\n eventBus.emit('environment:delete:environment', {\n environmentName: selectedEnvironmentName.value,\n collectionType,\n })\n}\n\n/** Opens the upsert modal, leave name empty for add */\nconst openUpsertModal = (name?: string) => {\n selectedEnvironmentName.value = name ?? null\n createEnvironmentModalState.show()\n}\n</script>\n\n<template>\n <EnvironmentComponent\n v-for=\"[environmentName, environment] in Object.entries(environments)\"\n :key=\"environmentName\"\n :collectionType=\"collectionType\"\n :environment\n :environmentName\n :eventBus=\"eventBus\"\n :isActive=\"activeEnvironment === environmentName\"\n @delete=\"() => openDeleteModal(environmentName)\"\n @edit=\"() => openUpsertModal(environmentName)\" />\n\n <!-- Add Environment CTA -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"() => openUpsertModal()\">\n <ScalarIconPlus />\n Add Environment\n </ScalarButton>\n </div>\n\n <!-- Upsert Modal -->\n <EnvironmentCreateModal\n :collectionType=\"collectionType\"\n :environments\n :eventBus\n :selectedEnvironmentName\n :state=\"createEnvironmentModalState\" />\n\n <!-- Delete Modal -->\n <EnvironmentDeleteModal\n :name=\"selectedEnvironmentName\"\n :state=\"deleteEnvironmentModalState\"\n @submit=\"deleteEnvironment\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA4BA,MAAM,8BAA8B,UAAS;EAC7C,MAAM,8BAA8B,UAAS;;EAG7C,MAAM,0BAA0B,IAAmB,KAAI;;EAGvD,MAAM,mBAAmB,SAAiB;AACxC,2BAAwB,QAAQ;AAChC,+BAA4B,MAAK;;;EAInC,MAAM,0BAA0B;AAC9B,OAAI,CAAC,wBAAwB,MAC3B;AAEF,WAAA,SAAS,KAAK,kCAAkC;IAC9C,iBAAiB,wBAAwB;IACzC,gBAAa,QAAA;IACd,CAAA;;;EAIH,MAAM,mBAAmB,SAAkB;AACzC,2BAAwB,QAAQ,QAAQ;AACxC,+BAA4B,MAAK;;;;sBAKjC,mBASmD,UAAA,MAAA,WARR,OAAO,QAAQ,QAAA,aAAY,GAAA,CAA5D,iBAAiB,iBAAW;yBADtC,YASmD,qBAAA;MAPhD,KAAK;MACL,gBAAgB,QAAA;MAChB;MACA;MACA,UAAU,QAAA;MACV,UAAU,QAAA,sBAAsB;MAChC,gBAAc,gBAAgB,gBAAe;MAC7C,cAAY,gBAAgB,gBAAe;;;;;;;;;;;IAG9C,mBAUM,OAVN,YAUM,CARJ,YAOe,MAAA,aAAA,EAAA;KANb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAQ,iBAAe;;4BACX,CAAlB,YAAkB,MAAA,eAAA,CAAA,EAAA,OAAA,OAAA,OAAA,KAAA,gBAAA,qBAEpB,GAAA,EAAA,CAAA;;;IAIF,YAKyC,gCAAA;KAJtC,gBAAgB,QAAA;KAChB,cAAA,QAAA;KACA,UAAA,QAAA;KACA,yBAAA,wBAAA;KACA,OAAO,MAAA,4BAA2B;;;;;;;;IAGrC,YAGgC,gCAAA;KAF7B,MAAM,wBAAA;KACN,OAAO,MAAA,4BAA2B;KAClC,UAAQ"}
1
+ {"version":3,"file":"EnvironmentsList.vue.script.js","names":[],"sources":["../../../../src/v2/features/environments/EnvironmentsList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { ref } from 'vue'\n\nimport EnvironmentCreateModal from '@/v2/features/environments/components/EnvironmentCreateModal.vue'\nimport EnvironmentDeleteModal from '@/v2/features/environments/components/EnvironmentDeleteModal.vue'\n\nimport EnvironmentComponent from './components/Environment.vue'\n\nconst { environments, eventBus, collectionType, activeEnvironment } =\n defineProps<\n {\n /** List of environments, ensured to be non-nullable for safety */\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n /** Event bus to handle workspace-related events */\n eventBus: WorkspaceEventBus\n /** The currently active environment name */\n activeEnvironment?: string\n } & CollectionType\n >()\n\nconst createEnvironmentModalState = useModal()\nconst deleteEnvironmentModalState = useModal()\n\n/** Track the currently selected environment for editing or deleting */\nconst selectedEnvironmentName = ref<string | null>(null)\n\n/** Opens the delete modal */\nconst openDeleteModal = (name: string) => {\n selectedEnvironmentName.value = name\n deleteEnvironmentModalState.show()\n}\n\n/** Deletes the selected environment */\nconst deleteEnvironment = () => {\n if (!selectedEnvironmentName.value) {\n return\n }\n eventBus.emit('environment:delete:environment', {\n environmentName: selectedEnvironmentName.value,\n collectionType,\n })\n}\n\n/** Opens the upsert modal, leave name empty for add */\nconst openUpsertModal = (name?: string) => {\n selectedEnvironmentName.value = name ?? null\n createEnvironmentModalState.show()\n}\n</script>\n\n<template>\n <EnvironmentComponent\n v-for=\"[environmentName, environment] in Object.entries(environments)\"\n :key=\"environmentName\"\n :collectionType=\"collectionType\"\n :environment\n :environmentName\n :eventBus=\"eventBus\"\n :isActive=\"activeEnvironment === environmentName\"\n @delete=\"() => openDeleteModal(environmentName)\"\n @edit=\"() => openUpsertModal(environmentName)\" />\n\n <!-- Add Environment CTA -->\n <div\n class=\"text-c-3 flex h-full items-center justify-center rounded-lg border p-4\">\n <ScalarButton\n class=\"hover:bg-b-2 hover:text-c-1 flex items-center gap-2\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"() => openUpsertModal()\">\n <ScalarIconPlus />\n Add Environment\n </ScalarButton>\n </div>\n\n <!-- Upsert Modal -->\n <EnvironmentCreateModal\n :collectionType=\"collectionType\"\n :environments\n :eventBus\n :selectedEnvironmentName\n :state=\"createEnvironmentModalState\" />\n\n <!-- Delete Modal -->\n <EnvironmentDeleteModal\n :name=\"selectedEnvironmentName\"\n :state=\"deleteEnvironmentModalState\"\n @submit=\"deleteEnvironment\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA4BA,MAAM,8BAA8B,SAAS;EAC7C,MAAM,8BAA8B,SAAS;;EAG7C,MAAM,0BAA0B,IAAmB,IAAI;;EAGvD,MAAM,mBAAmB,SAAiB;GACxC,wBAAwB,QAAQ;GAChC,4BAA4B,KAAK;EACnC;;EAGA,MAAM,0BAA0B;GAC9B,IAAI,CAAC,wBAAwB,OAC3B;GAEF,QAAA,SAAS,KAAK,kCAAkC;IAC9C,iBAAiB,wBAAwB;IACzC,gBAAa,QAAA;GACf,CAAC;EACH;;EAGA,MAAM,mBAAmB,SAAkB;GACzC,wBAAwB,QAAQ,QAAQ;GACxC,4BAA4B,KAAK;EACnC;;;sBAIE,mBASmD,UAAA,MAAA,WARR,OAAO,QAAQ,QAAA,YAAY,IAAA,CAA5D,iBAAiB,iBAAW;yBADtC,YASmD,qBAAA;MAPhD,KAAK;MACL,gBAAgB,QAAA;MAChB;MACA;MACA,UAAU,QAAA;MACV,UAAU,QAAA,sBAAsB;MAChC,gBAAc,gBAAgB,eAAe;MAC7C,cAAY,gBAAgB,eAAe;;;;;;;;;;;IAG9C,mBAUM,OAVN,YAUM,CARJ,YAOe,MAAA,YAAA,GAAA;KANb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAQ,gBAAe;;4BACX,CAAlB,YAAkB,MAAA,cAAA,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,gBAAA,qBAEpB,EAAA,EAAA,CAAA;;;IAIF,YAKyC,gCAAA;KAJtC,gBAAgB,QAAA;KAChB,cAAA,QAAA;KACA,UAAA,QAAA;KACA,yBAAA,wBAAA;KACA,OAAO,MAAA,2BAAA;;;;;;;;IAGV,YAGgC,gCAAA;KAF7B,MAAM,wBAAA;KACN,OAAO,MAAA,2BAAA;KACP,UAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"names":[],"mappings":"AAuFA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAInH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,cAAc,CAAC;AA6LrB,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"names":[],"mappings":"AAuFA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAInH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,cAAc,CAAC;AA+LrB,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -12,7 +12,7 @@ var _hoisted_4 = {
12
12
  title: "This is the active environment"
13
13
  };
14
14
  var _hoisted_5 = { class: "hidden flex-row items-center gap-1 group-hover:flex" };
15
- var Environment_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
15
+ var Environment_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
16
16
  __name: "Environment",
17
17
  props: {
18
18
  environment: {},
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconNotePencil, ScalarIconTrash } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\nimport EnvironmentVariablesTable from '@/v2/features/environments/components/EnvironmentVariablesTable.vue'\n\nconst {\n environmentName,\n environment,\n eventBus,\n collectionType,\n isActive = false,\n} = defineProps<\n {\n environment: XScalarEnvironment\n environmentName: string\n eventBus: WorkspaceEventBus\n isActive?: boolean\n } & CollectionType\n>()\n\nconst emit = defineEmits<{\n (e: 'edit'): void\n (e: 'delete'): void\n}>()\n</script>\n<template>\n <div\n class=\"group relative rounded-lg border transition-colors\"\n :class=\"isActive ? 'border-c-accent bg-c-accent/5' : ''\">\n <!-- Info -->\n <div\n class=\"flex justify-between rounded-t-lg px-1 py-1 text-sm\"\n :class=\"isActive ? 'bg-c-accent/10' : 'bg-b-2'\">\n <div class=\"flex items-center gap-1.5\">\n <div class=\"flex h-6 w-6 items-center justify-center p-1\">\n <span\n class=\"h-2.5 w-2.5 rounded-full\"\n :style=\"{ backgroundColor: environment.color }\"></span>\n </div>\n <span class=\"px-1 py-0.5 text-sm font-medium\">\n {{ environmentName }}\n </span>\n <!-- Active badge -->\n <span\n v-if=\"isActive\"\n class=\"bg-c-accent text-b-1 flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium\"\n title=\"This is the active environment\">\n <span class=\"size-1.5 rounded-full bg-current\"></span>\n Active\n </span>\n </div>\n\n <!-- Actions -->\n <div class=\"hidden flex-row items-center gap-1 group-hover:flex\">\n <ScalarIconButton\n :icon=\"ScalarIconNotePencil\"\n label=\"Edit Environment\"\n size=\"sm\"\n @click=\"emit('edit')\" />\n\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n label=\"Delete Environment\"\n size=\"sm\"\n @click=\"emit('delete')\" />\n </div>\n </div>\n\n <!-- Variables Table -->\n <EnvironmentVariablesTable\n :collectionType\n :environment\n :environmentName\n :eventBus />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,OAAO;;uBAMX,mBAgDM,OAAA,EA/CJ,OAAK,eAAA,CAAC,sDACE,QAAA,WAAQ,kCAAA,GAAA,CAAA,EAAA,EAAA,CAEhB,mBAoCM,OAAA,EAnCJ,OAAK,eAAA,CAAC,uDACE,QAAA,WAAQ,mBAAA,SAAA,CAAA,EAAA,EAAA,CAChB,mBAiBM,OAjBN,YAiBM;IAhBJ,mBAIM,OAJN,YAIM,CAHJ,mBAEyD,QAAA;KADvD,OAAM;KACL,OAAK,eAAA,EAAA,iBAAqB,QAAA,YAAY,OAAK,CAAA;;IAEhD,mBAEO,QAFP,YAEO,gBADF,QAAA,gBAAe,EAAA,EAAA;IAIZ,QAAA,YAAA,WAAA,EADR,mBAMO,QANP,YAMO,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAFL,mBAAsD,QAAA,EAAhD,OAAM,oCAAkC,EAAA,MAAA,GAAA,EAAA,gBAAQ,YAExD,GAAA,CAAA,EAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;OAIF,mBAYM,OAZN,YAYM,CAXJ,YAI0B,MAAA,iBAAA,EAAA;IAHvB,MAAM,MAAA,qBAAoB;IAC3B,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,OAAA;0BAEd,YAI4B,MAAA,iBAAA,EAAA;IAHzB,MAAM,MAAA,gBAAe;IACtB,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,SAAA;iCAKlB,YAIc,mCAAA;IAHX,gBAAA,QAAA;IACA,aAAA,QAAA;IACA,iBAAA,QAAA;IACA,UAAA,QAAA"}
1
+ {"version":3,"file":"Environment.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconNotePencil, ScalarIconTrash } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\nimport EnvironmentVariablesTable from '@/v2/features/environments/components/EnvironmentVariablesTable.vue'\n\nconst {\n environmentName,\n environment,\n eventBus,\n collectionType,\n isActive = false,\n} = defineProps<\n {\n environment: XScalarEnvironment\n environmentName: string\n eventBus: WorkspaceEventBus\n isActive?: boolean\n } & CollectionType\n>()\n\nconst emit = defineEmits<{\n (e: 'edit'): void\n (e: 'delete'): void\n}>()\n</script>\n<template>\n <div\n class=\"group relative rounded-lg border transition-colors\"\n :class=\"isActive ? 'border-c-accent bg-c-accent/5' : ''\">\n <!-- Info -->\n <div\n class=\"flex justify-between rounded-t-lg px-1 py-1 text-sm\"\n :class=\"isActive ? 'bg-c-accent/10' : 'bg-b-2'\">\n <div class=\"flex items-center gap-1.5\">\n <div class=\"flex h-6 w-6 items-center justify-center p-1\">\n <span\n class=\"h-2.5 w-2.5 rounded-full\"\n :style=\"{ backgroundColor: environment.color }\"></span>\n </div>\n <span class=\"px-1 py-0.5 text-sm font-medium\">\n {{ environmentName }}\n </span>\n <!-- Active badge -->\n <span\n v-if=\"isActive\"\n class=\"bg-c-accent text-b-1 flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium\"\n title=\"This is the active environment\">\n <span class=\"size-1.5 rounded-full bg-current\"></span>\n Active\n </span>\n </div>\n\n <!-- Actions -->\n <div class=\"hidden flex-row items-center gap-1 group-hover:flex\">\n <ScalarIconButton\n :icon=\"ScalarIconNotePencil\"\n label=\"Edit Environment\"\n size=\"sm\"\n @click=\"emit('edit')\" />\n\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n label=\"Delete Environment\"\n size=\"sm\"\n @click=\"emit('delete')\" />\n </div>\n </div>\n\n <!-- Variables Table -->\n <EnvironmentVariablesTable\n :collectionType\n :environment\n :environmentName\n :eventBus />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,OAAO;;uBAMX,mBAgDM,OAAA,EA/CJ,OAAK,eAAA,CAAC,sDACE,QAAA,WAAQ,kCAAA,EAAA,CAAA,EAAA,GAAA,CAEhB,mBAoCM,OAAA,EAnCJ,OAAK,eAAA,CAAC,uDACE,QAAA,WAAQ,mBAAA,QAAA,CAAA,EAAA,GAAA,CAChB,mBAiBM,OAjBN,YAiBM;IAhBJ,mBAIM,OAJN,YAIM,CAHJ,mBAEyD,QAAA;KADvD,OAAM;KACL,OAAK,eAAA,EAAA,iBAAqB,QAAA,YAAY,MAAK,CAAA;;IAEhD,mBAEO,QAFP,YAEO,gBADF,QAAA,eAAe,GAAA,CAAA;IAIZ,QAAA,YAAA,UAAA,GADR,mBAMO,QANP,YAMO,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAFL,mBAAsD,QAAA,EAAhD,OAAM,mCAAkC,GAAA,MAAA,EAAA,GAAA,gBAAQ,YAExD,EAAA,CAAA,EAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;OAIF,mBAYM,OAZN,YAYM,CAXJ,YAI0B,MAAA,gBAAA,GAAA;IAHvB,MAAM,MAAA,oBAAA;IACP,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,MAAA;0BAEd,YAI4B,MAAA,gBAAA,GAAA;IAHzB,MAAM,MAAA,eAAA;IACP,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA;iCAKlB,YAIc,mCAAA;IAHX,gBAAA,QAAA;IACA,aAAA,QAAA;IACA,iBAAA,QAAA;IACA,UAAA,QAAA"}
@@ -13,7 +13,7 @@ var _hoisted_3 = {
13
13
  var _hoisted_4 = ["placeholder"];
14
14
  var DEFAULT_GRADIENT = "linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122))";
15
15
  /** Check if the active color is one of the preset options. */
16
- var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
16
+ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
17
17
  __name: "EnvironmentColors",
18
18
  props: { activeColor: {} },
19
19
  emits: ["select"],
@@ -71,7 +71,8 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
71
71
  * Ensures the color value has a # prefix for hex colors.
72
72
  */
73
73
  const selectColor = (color) => {
74
- emit("select", color && !color.startsWith("#") ? `#${color}` : color);
74
+ const formattedColor = color && !color.startsWith("#") ? `#${color}` : color;
75
+ emit("select", formattedColor);
75
76
  showSelector.value = false;
76
77
  };
77
78
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentColors.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref } from 'vue'\n\nconst { activeColor } = defineProps<{\n activeColor: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', color: string): void\n}>()\n\nconst customColor = ref('')\nconst customColorInputRef = ref<HTMLInputElement | null>(null)\nconst showCustomInput = ref(false)\nconst showSelector = ref(false)\n\n/**\n * Predefined color options available in the color picker.\n * Each option provides a standard color choice for the environment.\n */\nconst colorOptions = [\n '#FFFFFF',\n '#EF0006',\n '#EDBE20',\n '#069061',\n '#FB892C',\n '#0082D0',\n '#5203D1',\n '#FFC0CB',\n] as const\n\n/** Default gradient shown when no custom color is selected. */\nconst DEFAULT_GRADIENT =\n 'linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122))'\n\n/** Check if the active color is one of the preset options. */\nconst isPresetColor = computed(() =>\n colorOptions.includes(activeColor as (typeof colorOptions)[number]),\n)\n\n/** Check if a custom color is being used (not in the preset list). */\nconst isCustomColor = computed(\n () => activeColor && !isPresetColor.value && !showCustomInput.value,\n)\n\n/** Check if the given color matches the currently active color. */\nconst isActiveColor = (color: string): boolean => activeColor === color\n\n/**\n * Style for the custom color button.\n * Shows the actual color if custom, otherwise shows a gradient.\n */\nconst customButtonStyle = computed(() => {\n const displayColor = customColor.value || activeColor\n return isCustomColor.value || customColor.value\n ? `background-color: ${displayColor};`\n : `background: ${DEFAULT_GRADIENT};`\n})\n\n/**\n * Toggle the custom color input visibility.\n * Focuses the input after it becomes visible.\n */\nconst toggleCustomInput = async () => {\n showCustomInput.value = !showCustomInput.value\n showSelector.value = false\n\n if (!showCustomInput.value) {\n return\n }\n\n await nextTick()\n customColorInputRef.value?.focus()\n}\n\n/** Toggle the color selector visibility. */\nconst toggleSelector = (): void => {\n showSelector.value = !showSelector.value\n}\n\n/**\n * Select a color and emit the selection event.\n * Ensures the color value has a # prefix for hex colors.\n */\nconst selectColor = (color: string): void => {\n const formattedColor = color && !color.startsWith('#') ? `#${color}` : color\n emit('select', formattedColor)\n showSelector.value = false\n}\n\n/**\n * Handle custom color input changes.\n * Formats the color and emits the selection.\n */\nconst handleCustomColorInput = (): void => {\n if (!customColor.value) {\n return\n }\n\n const formattedColor = customColor.value.startsWith('#')\n ? customColor.value\n : `#${customColor.value}`\n\n customColor.value = formattedColor\n selectColor(formattedColor)\n}\n</script>\n<template>\n <div>\n <!-- Collapsed view: single color dot -->\n <div\n v-if=\"!showCustomInput && !showSelector\"\n class=\"flex h-4 w-4 cursor-pointer items-center justify-center rounded-full\"\n :style=\"{ backgroundColor: activeColor }\"\n @click=\"toggleSelector\">\n <ScalarIcon\n v-if=\"activeColor\"\n class=\"text-c-btn p-0.5\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </div>\n\n <!-- Expanded view: color palette selector -->\n <div\n v-if=\"!showCustomInput && showSelector\"\n class=\"color-selector flex h-4 flex-row items-center justify-between gap-1.5 space-x-1\">\n <!-- Preset color options -->\n <div\n v-for=\"option in colorOptions\"\n :key=\"option\"\n class=\"flex h-4 w-4 cursor-pointer items-center justify-center rounded-full\"\n :style=\"{ backgroundColor: option }\"\n @click=\"selectColor(option)\">\n <ScalarIcon\n v-if=\"isActiveColor(option)\"\n class=\"text-c-btn p-0.5\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </div>\n\n <!-- Divider -->\n <hr class=\"border-ghost h-5 w-0.5 border-l\" />\n\n <!-- Custom color button -->\n <button\n class=\"z-10 flex h-4 w-4 cursor-pointer flex-row items-center justify-center gap-2 rounded-full\"\n :style=\"customButtonStyle\"\n type=\"button\"\n @click=\"toggleCustomInput\">\n <ScalarIcon\n v-if=\"isCustomColor\"\n class=\"text-c-btn\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </button>\n </div>\n\n <!-- Custom color input view -->\n <div\n v-if=\"showCustomInput\"\n class=\"color-selector flex h-4 flex-1 items-center gap-2 rounded\">\n <span class=\"absolute h-4 w-4 rounded-full border border-dashed\" />\n <span\n class=\"z-[1] h-4 w-4 rounded-full\"\n :style=\"customButtonStyle\" />\n <input\n ref=\"customColorInputRef\"\n v-model=\"customColor\"\n class=\"w-full flex-1 border-transparent text-sm outline-none\"\n :placeholder=\"activeColor || '#000000'\"\n type=\"text\"\n @input=\"handleCustomColorInput\" />\n <button\n class=\"text-c-3 hover:bg-b-2 rounded-lg p-1.5\"\n type=\"button\"\n @click=\"toggleCustomInput\">\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;AAiCA,IAAM,mBACJ;;;;;;;EA1BF,MAAM,OAAO;EAIb,MAAM,cAAc,IAAI,GAAE;EAC1B,MAAM,sBAAsB,IAA6B,KAAI;EAC7D,MAAM,kBAAkB,IAAI,MAAK;EACjC,MAAM,eAAe,IAAI,MAAK;;;;;EAM9B,MAAM,eAAe;GACnB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;;EAOD,MAAM,gBAAgB,eACpB,aAAa,SAAS,QAAA,YAA6C,CACrE;;EAGA,MAAM,gBAAgB,eACd,QAAA,eAAe,CAAC,cAAc,SAAS,CAAC,gBAAgB,MAChE;;EAGA,MAAM,iBAAiB,UAA2B,QAAA,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OAAM;OACN,MAAK;OACL,MAAK;;;+BAIT,mBAA8C,MAAA,EAA1C,OAAM,mCAAiC,EAAA,MAAA,GAAA;KAG3C,mBAUS,UAAA;MATP,OAAM;MACL,OAAK,eAAE,kBAAA,MAAiB;MACzB,MAAK;MACJ,SAAO;SAEA,cAAA,SAAA,WAAA,EADR,YAIc,MAAA,WAAA,EAAA;;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;;;IAMH,gBAAA,SAAA,WAAA,EADR,mBAsBM,OAtBN,YAsBM;+BAnBJ,mBAAmE,QAAA,EAA7D,OAAM,sDAAoD,EAAA,MAAA,GAAA;KAChE,mBAE+B,QAAA;MAD7B,OAAM;MACL,OAAK,eAAE,kBAAA,MAAiB;;oBAC3B,mBAMoC,SAAA;eAL9B;MAAJ,KAAI;+EACgB,QAAA;MACpB,OAAM;MACL,aAAa,QAAA,eAAW;MACzB,MAAK;MACJ,SAAO;6CAJC,YAAA,MAAW,CAAA,CAAA;KAKtB,mBAOS,UAAA;MANP,OAAM;MACN,MAAK;MACJ,SAAO;SACR,YAEc,MAAA,WAAA,EAAA;MADZ,MAAK;MACL,MAAK"}
1
+ {"version":3,"file":"EnvironmentColors.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref } from 'vue'\n\nconst { activeColor } = defineProps<{\n activeColor: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', color: string): void\n}>()\n\nconst customColor = ref('')\nconst customColorInputRef = ref<HTMLInputElement | null>(null)\nconst showCustomInput = ref(false)\nconst showSelector = ref(false)\n\n/**\n * Predefined color options available in the color picker.\n * Each option provides a standard color choice for the environment.\n */\nconst colorOptions = [\n '#FFFFFF',\n '#EF0006',\n '#EDBE20',\n '#069061',\n '#FB892C',\n '#0082D0',\n '#5203D1',\n '#FFC0CB',\n] as const\n\n/** Default gradient shown when no custom color is selected. */\nconst DEFAULT_GRADIENT =\n 'linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122))'\n\n/** Check if the active color is one of the preset options. */\nconst isPresetColor = computed(() =>\n colorOptions.includes(activeColor as (typeof colorOptions)[number]),\n)\n\n/** Check if a custom color is being used (not in the preset list). */\nconst isCustomColor = computed(\n () => activeColor && !isPresetColor.value && !showCustomInput.value,\n)\n\n/** Check if the given color matches the currently active color. */\nconst isActiveColor = (color: string): boolean => activeColor === color\n\n/**\n * Style for the custom color button.\n * Shows the actual color if custom, otherwise shows a gradient.\n */\nconst customButtonStyle = computed(() => {\n const displayColor = customColor.value || activeColor\n return isCustomColor.value || customColor.value\n ? `background-color: ${displayColor};`\n : `background: ${DEFAULT_GRADIENT};`\n})\n\n/**\n * Toggle the custom color input visibility.\n * Focuses the input after it becomes visible.\n */\nconst toggleCustomInput = async () => {\n showCustomInput.value = !showCustomInput.value\n showSelector.value = false\n\n if (!showCustomInput.value) {\n return\n }\n\n await nextTick()\n customColorInputRef.value?.focus()\n}\n\n/** Toggle the color selector visibility. */\nconst toggleSelector = (): void => {\n showSelector.value = !showSelector.value\n}\n\n/**\n * Select a color and emit the selection event.\n * Ensures the color value has a # prefix for hex colors.\n */\nconst selectColor = (color: string): void => {\n const formattedColor = color && !color.startsWith('#') ? `#${color}` : color\n emit('select', formattedColor)\n showSelector.value = false\n}\n\n/**\n * Handle custom color input changes.\n * Formats the color and emits the selection.\n */\nconst handleCustomColorInput = (): void => {\n if (!customColor.value) {\n return\n }\n\n const formattedColor = customColor.value.startsWith('#')\n ? customColor.value\n : `#${customColor.value}`\n\n customColor.value = formattedColor\n selectColor(formattedColor)\n}\n</script>\n<template>\n <div>\n <!-- Collapsed view: single color dot -->\n <div\n v-if=\"!showCustomInput && !showSelector\"\n class=\"flex h-4 w-4 cursor-pointer items-center justify-center rounded-full\"\n :style=\"{ backgroundColor: activeColor }\"\n @click=\"toggleSelector\">\n <ScalarIcon\n v-if=\"activeColor\"\n class=\"text-c-btn p-0.5\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </div>\n\n <!-- Expanded view: color palette selector -->\n <div\n v-if=\"!showCustomInput && showSelector\"\n class=\"color-selector flex h-4 flex-row items-center justify-between gap-1.5 space-x-1\">\n <!-- Preset color options -->\n <div\n v-for=\"option in colorOptions\"\n :key=\"option\"\n class=\"flex h-4 w-4 cursor-pointer items-center justify-center rounded-full\"\n :style=\"{ backgroundColor: option }\"\n @click=\"selectColor(option)\">\n <ScalarIcon\n v-if=\"isActiveColor(option)\"\n class=\"text-c-btn p-0.5\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </div>\n\n <!-- Divider -->\n <hr class=\"border-ghost h-5 w-0.5 border-l\" />\n\n <!-- Custom color button -->\n <button\n class=\"z-10 flex h-4 w-4 cursor-pointer flex-row items-center justify-center gap-2 rounded-full\"\n :style=\"customButtonStyle\"\n type=\"button\"\n @click=\"toggleCustomInput\">\n <ScalarIcon\n v-if=\"isCustomColor\"\n class=\"text-c-btn\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </button>\n </div>\n\n <!-- Custom color input view -->\n <div\n v-if=\"showCustomInput\"\n class=\"color-selector flex h-4 flex-1 items-center gap-2 rounded\">\n <span class=\"absolute h-4 w-4 rounded-full border border-dashed\" />\n <span\n class=\"z-[1] h-4 w-4 rounded-full\"\n :style=\"customButtonStyle\" />\n <input\n ref=\"customColorInputRef\"\n v-model=\"customColor\"\n class=\"w-full flex-1 border-transparent text-sm outline-none\"\n :placeholder=\"activeColor || '#000000'\"\n type=\"text\"\n @input=\"handleCustomColorInput\" />\n <button\n class=\"text-c-3 hover:bg-b-2 rounded-lg p-1.5\"\n type=\"button\"\n @click=\"toggleCustomInput\">\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;AAiCA,IAAM,mBACJ;;;;;;;EA1BF,MAAM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,YAAW,CAAA;KACrC,SAAO;QAEA,QAAA,eAAA,UAAA,GADR,YAIc,MAAA,UAAA,GAAA;;KAFZ,OAAM;KACN,MAAK;KACL,MAAK;;KAKA,gBAAA,SAAmB,aAAA,SAAA,UAAA,GAD5B,mBAgCM,OAhCN,YAgCM;mBA5BJ,mBAWM,UAAA,MAAA,WAVa,eAAV,WAAM;aADf,mBAWM,OAAA;OATH,KAAK;OACN,OAAM;OACL,OAAK,eAAA,EAAA,iBAAqB,OAAM,CAAA;OAChC,UAAK,WAAE,YAAY,MAAM;UAElB,cAAc,MAAM,KAAA,UAAA,GAD5B,YAIc,MAAA,UAAA,GAAA;;OAFZ,OAAM;OACN,MAAK;OACL,MAAK;;;+BAIT,mBAA8C,MAAA,EAA1C,OAAM,kCAAiC,GAAA,MAAA,EAAA;KAG3C,mBAUS,UAAA;MATP,OAAM;MACL,OAAK,eAAE,kBAAA,KAAiB;MACzB,MAAK;MACJ,SAAO;SAEA,cAAA,SAAA,UAAA,GADR,YAIc,MAAA,UAAA,GAAA;;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;;;IAMH,gBAAA,SAAA,UAAA,GADR,mBAsBM,OAtBN,YAsBM;+BAnBJ,mBAAmE,QAAA,EAA7D,OAAM,qDAAoD,GAAA,MAAA,EAAA;KAChE,mBAE+B,QAAA;MAD7B,OAAM;MACL,OAAK,eAAE,kBAAA,KAAiB;;oBAC3B,mBAMoC,SAAA;eAL9B;MAAJ,KAAI;+EACgB,QAAA;MACpB,OAAM;MACL,aAAa,QAAA,eAAW;MACzB,MAAK;MACJ,SAAO;6CAJC,YAAA,KAAW,CAAA,CAAA;KAKtB,mBAOS,UAAA;MANP,OAAM;MACN,MAAK;MACJ,SAAO;SACR,YAEc,MAAA,UAAA,GAAA;MADZ,MAAK;MACL,MAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentCreateModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"names":[],"mappings":"AAkJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAUpH,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;AAkNrB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentCreateModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"names":[],"mappings":"AAkJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAUpH,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;AAoNrB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -10,7 +10,7 @@ var _hoisted_2 = {
10
10
  class: "text-red text-xs"
11
11
  };
12
12
  var DEFAULT_COLOR = "#FFFFFF";
13
- var EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
13
+ var EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
14
14
  __name: "EnvironmentCreateModal",
15
15
  props: {
16
16
  environments: {},
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentCreateModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, watch } from 'vue'\n\nimport {\n CommandActionForm,\n CommandActionInput,\n} from '@/v2/features/command-palette'\n\nimport EnvironmentColors from './EnvironmentColors.vue'\n\nconst {\n state,\n eventBus,\n collectionType,\n environments,\n selectedEnvironmentName,\n} = defineProps<\n {\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n selectedEnvironmentName: string | null\n state: ModalState\n eventBus: WorkspaceEventBus\n } & CollectionType\n>()\n\n/** Default color for new environments. */\nconst DEFAULT_COLOR = '#FFFFFF'\n\nconst name = ref('')\nconst selectedColor = ref(DEFAULT_COLOR)\n\n/** Ensure [re]set the form on open */\nwatch(\n () => state.open,\n (isOpen) => {\n if (isOpen) {\n const environment = environments[selectedEnvironmentName ?? '']\n\n // We are editing so lets fill in the form with the existing data\n if (selectedEnvironmentName && environment) {\n name.value = selectedEnvironmentName\n selectedColor.value = environment.color\n }\n\n // We are adding a new environment so lets clear the form\n else {\n name.value = ''\n selectedColor.value = DEFAULT_COLOR\n }\n }\n },\n)\n\n/**\n * Handle color selection from the color picker.\n * Updates the selected color for the new environment.\n */\nconst handleColorSelect = (color: string): void => {\n selectedColor.value = color\n}\n\n/** Emits an event to create the environment with the provided name and color. */\nconst handleSubmit = (): void => {\n // Editing an existing environment\n if (selectedEnvironmentName) {\n eventBus.emit('environment:upsert:environment', {\n oldEnvironmentName: selectedEnvironmentName,\n payload: {\n color: selectedColor.value,\n },\n environmentName: name.value.trim(),\n collectionType,\n })\n }\n // Adding a new environment\n else {\n eventBus.emit('environment:upsert:environment', {\n environmentName: name.value.trim(),\n payload: {\n color: selectedColor.value,\n },\n collectionType,\n })\n }\n\n state.hide()\n}\n\n/** Check if the environment name is a duplicate */\nconst isDuplicateName = computed(() => {\n if (selectedEnvironmentName) {\n return (\n name.value !== selectedEnvironmentName &&\n Object.keys(environments).includes(name.value)\n )\n }\n\n return Object.keys(environments).includes(name.value)\n})\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg\"\n size=\"xs\"\n :state=\"state\">\n <CommandActionForm\n :disabled=\"!name.trim() || isDuplicateName\"\n @submit=\"handleSubmit\">\n <div class=\"flex items-start gap-2\">\n <!-- Color picker for environment -->\n <EnvironmentColors\n :activeColor=\"selectedColor\"\n class=\"peer\"\n @select=\"handleColorSelect\" />\n\n <!-- Environment name input, hidden when color selector is expanded -->\n <CommandActionInput\n v-model=\"name\"\n class=\"-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden\"\n placeholder=\"Environment name\" />\n </div>\n\n <!-- Error message -->\n <div\n v-if=\"isDuplicateName\"\n class=\"text-red text-xs\">\n This environment name is already in use.\n </div>\n\n <!-- Submit button -->\n <template #submit>\n {{ selectedEnvironmentName ? 'Update' : 'Add' }} Environment\n </template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;AAgCA,IAAM,gBAAgB;;;;;;;;;;;;EAEtB,MAAM,OAAO,IAAI,GAAE;EACnB,MAAM,gBAAgB,IAAI,cAAa;;AAGvC,cACQ,QAAA,MAAM,OACX,WAAW;AACV,OAAI,QAAQ;IACV,MAAM,cAAc,QAAA,aAAa,QAAA,2BAA2B;AAG5D,QAAI,QAAA,2BAA2B,aAAa;AAC1C,UAAK,QAAQ,QAAA;AACb,mBAAc,Q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
1
+ {"version":3,"file":"EnvironmentCreateModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, watch } from 'vue'\n\nimport {\n CommandActionForm,\n CommandActionInput,\n} from '@/v2/features/command-palette'\n\nimport EnvironmentColors from './EnvironmentColors.vue'\n\nconst {\n state,\n eventBus,\n collectionType,\n environments,\n selectedEnvironmentName,\n} = defineProps<\n {\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n selectedEnvironmentName: string | null\n state: ModalState\n eventBus: WorkspaceEventBus\n } & CollectionType\n>()\n\n/** Default color for new environments. */\nconst DEFAULT_COLOR = '#FFFFFF'\n\nconst name = ref('')\nconst selectedColor = ref(DEFAULT_COLOR)\n\n/** Ensure [re]set the form on open */\nwatch(\n () => state.open,\n (isOpen) => {\n if (isOpen) {\n const environment = environments[selectedEnvironmentName ?? '']\n\n // We are editing so lets fill in the form with the existing data\n if (selectedEnvironmentName && environment) {\n name.value = selectedEnvironmentName\n selectedColor.value = environment.color\n }\n\n // We are adding a new environment so lets clear the form\n else {\n name.value = ''\n selectedColor.value = DEFAULT_COLOR\n }\n }\n },\n)\n\n/**\n * Handle color selection from the color picker.\n * Updates the selected color for the new environment.\n */\nconst handleColorSelect = (color: string): void => {\n selectedColor.value = color\n}\n\n/** Emits an event to create the environment with the provided name and color. */\nconst handleSubmit = (): void => {\n // Editing an existing environment\n if (selectedEnvironmentName) {\n eventBus.emit('environment:upsert:environment', {\n oldEnvironmentName: selectedEnvironmentName,\n payload: {\n color: selectedColor.value,\n },\n environmentName: name.value.trim(),\n collectionType,\n })\n }\n // Adding a new environment\n else {\n eventBus.emit('environment:upsert:environment', {\n environmentName: name.value.trim(),\n payload: {\n color: selectedColor.value,\n },\n collectionType,\n })\n }\n\n state.hide()\n}\n\n/** Check if the environment name is a duplicate */\nconst isDuplicateName = computed(() => {\n if (selectedEnvironmentName) {\n return (\n name.value !== selectedEnvironmentName &&\n Object.keys(environments).includes(name.value)\n )\n }\n\n return Object.keys(environments).includes(name.value)\n})\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg\"\n size=\"xs\"\n :state=\"state\">\n <CommandActionForm\n :disabled=\"!name.trim() || isDuplicateName\"\n @submit=\"handleSubmit\">\n <div class=\"flex items-start gap-2\">\n <!-- Color picker for environment -->\n <EnvironmentColors\n :activeColor=\"selectedColor\"\n class=\"peer\"\n @select=\"handleColorSelect\" />\n\n <!-- Environment name input, hidden when color selector is expanded -->\n <CommandActionInput\n v-model=\"name\"\n class=\"-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden\"\n placeholder=\"Environment name\" />\n </div>\n\n <!-- Error message -->\n <div\n v-if=\"isDuplicateName\"\n class=\"text-red text-xs\">\n This environment name is already in use.\n </div>\n\n <!-- Submit button -->\n <template #submit>\n {{ selectedEnvironmentName ? 'Update' : 'Add' }} Environment\n </template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;AAgCA,IAAM,gBAAgB;;;;;;;;;;;;EAEtB,MAAM,OAAO,IAAI,EAAE;EACnB,MAAM,gBAAgB,IAAI,aAAa;;EAGvC,YACQ,QAAA,MAAM,OACX,WAAW;GACV,IAAI,QAAQ;IACV,MAAM,cAAc,QAAA,aAAa,QAAA,2BAA2B;IAG5D,IAAI,QAAA,2BAA2B,aAAa;KAC1C,KAAK,QAAQ,QAAA;KACb,cAAc,QAAQ,YAAY;IACpC,OAGK;KACH,KAAK,QAAQ;KACb,cAAc,QAAQ;IACxB;GACF;EACF,CACF;;;;;EAMA,MAAM,qBAAqB,UAAwB;GACjD,cAAc,QAAQ;EACxB;;EAGA,MAAM,qBAA2B;GAE/B,IAAI,QAAA,yBACF,QAAA,SAAS,KAAK,kCAAkC;IAC9C,oBAAoB,QAAA;IACpB,SAAS,EACP,OAAO,cAAc,MACvB;IACA,iBAAiB,KAAK,MAAM,KAAK;IACjC,gBAAa,QAAA;GACf,CAAC;QAID,QAAA,SAAS,KAAK,kCAAkC;IAC9C,iBAAiB,KAAK,MAAM,KAAK;IACjC,SAAS,EACP,OAAO,cAAc,MACvB;IACA,gBAAa,QAAA;GACf,CAAC;GAGH,QAAA,MAAM,KAAK;EACb;;EAGA,MAAM,kBAAkB,eAAe;GACrC,IAAI,QAAA,yBACF,OACE,KAAK,UAAU,QAAA,2BACf,OAAO,KAAK,QAAA,YAAY,CAAC,CAAC,SAAS,KAAK,KAAK;GAIjD,OAAO,OAAO,KAAK,QAAA,YAAY,CAAC,CAAC,SAAS,KAAK,KAAK;EACtD,CAAC;;uBAIC,YAiCc,MAAA,WAAA,GAAA;IAhCZ,WAAU;IACV,MAAK;IACJ,OAAO,QAAA;;2BA6BY,CA5BpB,YA4BoB,MAAA,yBAAA,GAAA;KA3BjB,UAAQ,CAAG,KAAA,MAAK,KAAI,KAAM,gBAAA;KAC1B,UAAQ;;KAuBE,QAAM,cACiC,CAAA,gBAAA,gBAA7C,QAAA,0BAAuB,WAAA,KAAA,IAAsB,iBAClD,CAAA,CAAA,CAAA;4BAZM,CAZN,mBAYM,OAZN,YAYM,CAVJ,YAGgC,2BAAA;MAF7B,aAAa,cAAA;MACd,OAAM;MACL,UAAQ;mCAGX,YAGmC,MAAA,0BAAA,GAAA;kBAFxB,KAAA;wEAAI,QAAA;MACb,OAAM;MACN,aAAY;oCAKR,gBAAA,SAAA,UAAA,GADR,mBAIM,OAJN,YAE2B,4CAE3B,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"names":[],"mappings":"AAuDA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB,CAAC;AA4HF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"names":[],"mappings":"AAuDA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB,CAAC;AA8HF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -3,7 +3,7 @@ import { ScalarButton } from "@scalar/components/button";
3
3
  import { ScalarModal } from "@scalar/components/modal";
4
4
  //#region src/v2/features/environments/components/EnvironmentDeleteModal.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = { class: "flex justify-between" };
6
- var EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
6
+ var EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
7
7
  __name: "EnvironmentDeleteModal",
8
8
  props: {
9
9
  state: {},
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentDeleteModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\n\nconst { state, name = 'unknown' } = defineProps<{\n state: ModalState\n name: string | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (event: 'submit'): void\n}>()\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg flex flex-col gap-4\"\n size=\"xxs\"\n :state=\"state\"\n :title=\"`Delete ${name}`\">\n <p class=\"text-c-2 text-sm leading-normal text-pretty\">\n Are you sure you want to delete this environment? This action cannot be\n undone.\n </p>\n <div class=\"flex justify-between\">\n <ScalarButton\n size=\"sm\"\n variant=\"outlined\"\n @click=\"\n () => {\n emit('cancel')\n state.hide()\n }\n \">\n Cancel\n </ScalarButton>\n <ScalarButton\n size=\"sm\"\n variant=\"danger\"\n @click=\"\n () => {\n emit('submit')\n state.hide()\n }\n \">\n Delete Environment\n </ScalarButton>\n </div>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,OAAO;;uBAOX,YAiCc,MAAA,YAAA,EAAA;IAhCZ,WAAU;IACV,MAAK;IACJ,OAAO,QAAA;IACP,OAAK,UAAY,QAAA;;2BAId,CAAA,OAAA,OAAA,OAAA,KAHJ,mBAGI,KAAA,EAHD,OAAM,+CAA6C,EAAC,qFAGvD,GAAA,GACA,mBAuBM,OAvBN,YAuBM,CAtBJ,YAUe,MAAA,aAAA,EAAA;KATb,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAA;AAAiC,WAAI,SAAA;AAAuB,cAAA,MAAM,MAAI;;;4BAO9E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,YAEJ,GAAA,CAAA,EAAA,CAAA;;QACA,YAUe,MAAA,aAAA,EAAA;KATb,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAA;AAAiC,WAAI,SAAA;AAAuB,cAAA,MAAM,MAAI;;;4BAO9E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,wBAEJ,GAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"EnvironmentDeleteModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\n\nconst { state, name = 'unknown' } = defineProps<{\n state: ModalState\n name: string | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (event: 'submit'): void\n}>()\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg flex flex-col gap-4\"\n size=\"xxs\"\n :state=\"state\"\n :title=\"`Delete ${name}`\">\n <p class=\"text-c-2 text-sm leading-normal text-pretty\">\n Are you sure you want to delete this environment? This action cannot be\n undone.\n </p>\n <div class=\"flex justify-between\">\n <ScalarButton\n size=\"sm\"\n variant=\"outlined\"\n @click=\"\n () => {\n emit('cancel')\n state.hide()\n }\n \">\n Cancel\n </ScalarButton>\n <ScalarButton\n size=\"sm\"\n variant=\"danger\"\n @click=\"\n () => {\n emit('submit')\n state.hide()\n }\n \">\n Delete Environment\n </ScalarButton>\n </div>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,OAAO;;uBAOX,YAiCc,MAAA,WAAA,GAAA;IAhCZ,WAAU;IACV,MAAK;IACJ,OAAO,QAAA;IACP,OAAK,UAAY,QAAA;;2BAId,CAAA,OAAA,OAAA,OAAA,KAHJ,mBAGI,KAAA,EAHD,OAAM,8CAA6C,GAAC,qFAGvD,EAAA,IACA,mBAuBM,OAvBN,YAuBM,CAtBJ,YAUe,MAAA,YAAA,GAAA;KATb,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAA;MAAiC,KAAI,QAAA;MAAuB,QAAA,MAAM,KAAI;;;4BAO9E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,YAEJ,EAAA,CAAA,EAAA,CAAA;;QACA,YAUe,MAAA,YAAA,GAAA;KATb,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAA;MAAiC,KAAI,QAAA;MAAuB,QAAA,MAAM,KAAI;;;4BAO9E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,wBAEJ,EAAA,CAAA,EAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariablesDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"names":[],"mappings":"AAmTA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AASnH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,iFAAiF;IACjF,oBAAoB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC7D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AA8aF,QAAA,MAAM,YAAY;gCA1QiB,IAAI,GAAG,MAAM;;;;;;;;;;;kFA8Q9C,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentVariablesDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"names":[],"mappings":"AAmTA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AASnH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,iFAAiF;IACjF,oBAAoB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC7D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAibF,QAAA,MAAM,YAAY;gCA7QiB,IAAI,GAAG,MAAM;;;;;;;;;;;kFAiR9C,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -19,7 +19,7 @@ var _hoisted_4 = {
19
19
  };
20
20
  var _hoisted_5 = { class: "max-w-[9rem] overflow-hidden text-right text-ellipsis whitespace-nowrap" };
21
21
  var DROPDOWN_LIMIT = 12;
22
- var EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
22
+ var EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
23
23
  __name: "EnvironmentVariablesDropdown",
24
24
  props: {
25
25
  query: {},
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariablesDropdown.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarTeleport } from '@scalar/components/teleport'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { POPULAR_CONTEXT_FUNCTION_KEYS } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { onClickOutside } from '@vueuse/core'\nimport Fuse from 'fuse.js'\nimport { computed, onMounted, ref, watch, type CSSProperties } from 'vue'\n\ntype DropdownRow =\n | { kind: 'env'; key: string; secondary: string }\n | { kind: 'context'; key: string; secondary: string }\n\nconst {\n query,\n environment,\n dropdownPosition,\n contextFunctionItems = [],\n listboxId,\n} = defineProps<{\n query: string\n environment?: XScalarEnvironment\n dropdownPosition?: { left: number; top: number }\n /** Runtime placeholders such as `{{$guid}}`, shown with environment variables */\n contextFunctionItems?: { key: string; description: string }[]\n /**\n * Id for the `role=\"listbox\"` element. When set, each option also receives a\n * stable id so the owning combobox input can reference the active option via\n * `aria-activedescendant` (W3C combobox pattern).\n */\n listboxId?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', variable: string): void\n (e: 'redirect'): void\n /**\n * Fired when the user dismisses the panel by clicking outside. The owning\n * combobox needs this to clear its `aria-expanded`/`aria-controls` state,\n * which would otherwise keep pointing at a listbox that is no longer mounted.\n */\n (e: 'close'): void\n}>()\n\nconst isOpen = ref(true)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst selectedVariableIndex = ref(0)\n\nconst redirectToEnvironment = () => {\n emit('redirect')\n isOpen.value = false\n // The panel is gone, so tell the combobox to drop its aria-expanded /\n // aria-controls — otherwise they keep pointing at a dismissed listbox.\n emit('close')\n}\n\n/** Normalize the variables to have a name and value */\nconst normalizedVariables = computed(() =>\n (environment?.variables ?? []).map((v) => ({\n key: v.name,\n value: typeof v.value === 'string' ? v.value : v.value.default,\n })),\n)\n\nconst contextRows = computed((): DropdownRow[] =>\n contextFunctionItems.map((item) => ({\n kind: 'context',\n key: item.key,\n secondary: item.description,\n })),\n)\n\nconst envRows = computed((): DropdownRow[] =>\n normalizedVariables.value\n .filter(({ key, value }) => key !== '' || value !== '')\n .map(({ key, value }) => ({\n kind: 'env' as const,\n key,\n secondary: value,\n })),\n)\n\ntype FuseRow = DropdownRow & { fuseText: string }\n\nconst envFuseSource = computed((): FuseRow[] =>\n envRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst contextFuseSource = computed((): FuseRow[] =>\n contextRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst fuseEnv = computed(\n () =>\n new Fuse(envFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst fuseContext = computed(\n () =>\n new Fuse(contextFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst popularContextRows = computed((): DropdownRow[] => {\n const byKey = new Map(contextFunctionItems.map((c) => [c.key, c]))\n return POPULAR_CONTEXT_FUNCTION_KEYS.flatMap((key) => {\n const item = byKey.get(key)\n return item\n ? [\n {\n kind: 'context' as const,\n key: item.key,\n secondary: item.description,\n },\n ]\n : []\n })\n})\n\nconst DROPDOWN_LIMIT = 12\n\nconst filteredVariables = computed((): DropdownRow[] => {\n if (!query.trim()) {\n const envSlice = envRows.value.slice(-4)\n return [...envSlice, ...popularContextRows.value]\n }\n\n const q = query.trim()\n const envMatches = fuseEnv.value\n .search(q, { limit: DROPDOWN_LIMIT })\n .map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n\n const remaining = DROPDOWN_LIMIT - envMatches.length\n const contextMatches =\n remaining > 0\n ? fuseContext.value.search(q, { limit: remaining }).map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n : []\n\n return [...envMatches, ...contextMatches]\n})\n\nconst optionId = (index: number): string | undefined =>\n listboxId ? `${listboxId}-option-${index}` : undefined\n\n/**\n * Id of the currently highlighted option, for the combobox's\n * `aria-activedescendant`. Undefined when there is no list to point at.\n */\nconst activeOptionId = computed((): string | undefined =>\n filteredVariables.value.length\n ? optionId(selectedVariableIndex.value)\n : undefined,\n)\n\nconst selectVariable = (variableKey: string): void => {\n emit('select', variableKey)\n}\n\n// Narrowing the query shrinks the list; keep the highlight in range so both the\n// visible selection and `aria-activedescendant` never reference a dropped option.\nwatch(\n () => filteredVariables.value.length,\n (length) => {\n if (selectedVariableIndex.value > length - 1) {\n selectedVariableIndex.value = Math.max(0, length - 1)\n }\n },\n)\n\nconst handleArrowKey = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = filteredVariables.value.length\n\n if (length === 0) {\n return\n }\n\n selectedVariableIndex.value =\n (selectedVariableIndex.value + offset + length) % length\n}\n\nconst handleSelect = () => {\n if (selectedVariableIndex.value >= 0) {\n const selectedVariable =\n filteredVariables.value[selectedVariableIndex.value]\n if (selectedVariable) {\n selectVariable(selectedVariable.key)\n }\n }\n}\n\ndefineExpose({\n handleArrowKey,\n handleSelect,\n activeOptionId,\n})\n\nonMounted(() => {\n // Reset selected index to the first item when dropdown opens\n selectedVariableIndex.value = 0\n})\n\nconst dropdownStyle = computed<CSSProperties>(() => {\n return {\n left: (dropdownPosition?.left ?? 0) + 'px',\n // Add a 5px offset from the editor\n top: (dropdownPosition?.top ?? 0) + 5 + 'px',\n }\n})\n\nonClickOutside(\n dropdownRef,\n () => {\n isOpen.value = false\n emit('close')\n },\n { ignore: [dropdownRef] },\n)\n</script>\n<template>\n <ScalarTeleport\n v-if=\"isOpen\"\n class=\"scalar-client\">\n <div\n ref=\"dropdownRef\"\n class=\"custom-scroll z-context fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75\"\n :style=\"dropdownStyle\"\n @mousedown.prevent>\n <!--\n Always rendered (even with no matches) so the combobox's `aria-controls`\n always resolves to a real listbox; an empty list simply has no options.\n -->\n <ul\n :id=\"listboxId\"\n aria-label=\"Variable suggestions\"\n class=\"gap-1/2 flex flex-col\"\n role=\"listbox\">\n <template\n v-for=\"(item, index) in filteredVariables\"\n :key=\"`${item.kind}-${item.key}`\">\n <li\n :id=\"optionId(index)\"\n :aria-selected=\"index === selectedVariableIndex\"\n class=\"font-code text-xxs hover:bg-b-3 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150\"\n :class=\"{ 'bg-b-3': index === selectedVariableIndex }\"\n role=\"option\"\n @click=\"selectVariable(item.key)\">\n <div class=\"flex items-center gap-2 whitespace-nowrap\">\n <span\n v-if=\"item.kind === 'env'\"\n class=\"h-2.25 w-2.25 min-w-2.25 rounded-full\"\n :style=\"{\n backgroundColor: environment?.color,\n }\" />\n <span\n v-else\n class=\"text-c-3 bg-b-3 flex h-4.5 min-w-4.5 items-center justify-center rounded px-0.5 font-sans text-[9px] font-semibold\">\n fn\n </span>\n {{ item.key }}\n </div>\n <span\n class=\"max-w-[9rem] overflow-hidden text-right text-ellipsis whitespace-nowrap\">\n {{ item.secondary }}\n </span>\n </li>\n </template>\n </ul>\n <ScalarButton\n v-if=\"!filteredVariables.length\"\n class=\"font-code text-xxs bg-b-inherit hover:bg-b-3 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150\"\n variant=\"outlined\"\n @click=\"redirectToEnvironment\">\n <ScalarIconPlus class=\"size-3\" />\n Add Variable\n </ScalarButton>\n <!-- Backdrop for the dropdown -->\n <div\n class=\"bg-b-1 brightness-lifted absolute inset-0 -z-1 rounded shadow-lg\" />\n </div>\n </ScalarTeleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmIA,IAAM,iBAAiB;;;;;;;;;;;;;;;;EAjGvB,MAAM,OAAO;EAWb,MAAM,SAAS,IAAI,KAAI;EACvB,MAAM,cAAc,IAAwB,KAAI;EAChD,MAAM,wBAAwB,IAAI,EAAC;EAEnC,MAAM,8BAA8B;AAClC,QAAK,WAAU;AACf,UAAO,QAAQ;AAGf,QAAK,QAAO;;;EAId,MAAM,sBAAsB,gBACzB,QAAA,aAAa,aAAa,EAAE,EAAE,KAAK,OAAO;GACzC,KAAK,EAAE;GACP,OAAO,OAAO,EAAE,UAAU,WAAW,EAAE,QAAQ,EAAE,MAAM;GACxD,EAAE,CACL;EAEA,MAAM,cAAc,eAClB,QAAA,qBAAqB,KAAK,UAAU;GAClC,MAAM;GACN,KAAK,KAAK;GACV,WAAW,KAAK;GACjB,EAAE,CACL;EAEA,MAAM,UAAU,eACd,oBAAoB,MACjB,QAAQ,EAAE,KAAK,YAAY,QAAQ,MAAM,UAAU,GAAE,CACrD,KAAK,EAAE,KAAK,aAAa;GACxB,MAAM;GACN;GACA,WAAW;GACZ,EAAE,CACP;EAIA,MAAM,gBAAgB,eACpB,QAAQ,MAAM,KA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B,aAAS,OAAA,OAAA,OAAA,KAAA,oBAAV,IAAkB,CAAA,UAAA,CAAA;;KAKlB,mBAmCK,MAAA;MAlCF,IAAI,QAAA;MACL,cAAW;MACX,OAAM;MACN,MAAK;2BACL,mBA6BW,UAAA,MAAA,WA5Be,kBAAA,QAAhB,MAAM,UAAK;0BAEnB,mBAyBK,MAAA;eA1BI,KAAK,KAAI,GAAI,KAAK;OAExB,IAAI,SAAS,MAAK;OAClB,iBAAe,UAAU,sBAAA;OAC1B,OAAK,eAAA,CAAC,6IAA2I,EAAA,UAC7H,UAAU,sBAAA,OAAqB,CAAA,CAAA;OACnD,MAAK;OACJ,UAAK,WAAE,eAAe,KAAK,IAAG;UAC/B,mBAaM,OAbN,YAaM,CAXI,KAAK,SAAI,SAAA,WAAA,EADjB,mBAKO,QAAA;;OAHL,OAAM;OACL,OAAK,eAAA,EAAA,iBAAuC,QAAA,aAAa,OAAA,CAAA;mCAG5D,mBAIO,QAJP,YAE6H,OAE7H,GAAA,gBAAO,MACP,gBAAG,KAAK,IAAG,EAAA,EAAA,CAAA,CAAA,EAEb,mBAGO,QAHP,YAGO,gBADF,KAAK,UAAS,EAAA,EAAA,CAAA,EAAA,IAAA,WAAA;;MAMhB,kBAAA,MAAkB,UAAA,WAAA,EAD3B,YAOe,MAAA,aAAA,EAAA;;MALb,OAAM;MACN,SAAQ;MACP,SAAO;;6BACyB,CAAjC,YAAiC,MAAA,eAAA,EAAA,EAAjB,OAAM,UAAQ,CAAA,EAAA,OAAA,OAAA,OAAA,KAAA,gBAAG,kBAEnC,GAAA,EAAA,CAAA;;;+BAEA,mBAC6E,OAAA,EAA3E,OAAM,oEAAkE,EAAA,MAAA,GAAA"}
1
+ {"version":3,"file":"EnvironmentVariablesDropdown.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarTeleport } from '@scalar/components/teleport'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { POPULAR_CONTEXT_FUNCTION_KEYS } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { onClickOutside } from '@vueuse/core'\nimport Fuse from 'fuse.js'\nimport { computed, onMounted, ref, watch, type CSSProperties } from 'vue'\n\ntype DropdownRow =\n | { kind: 'env'; key: string; secondary: string }\n | { kind: 'context'; key: string; secondary: string }\n\nconst {\n query,\n environment,\n dropdownPosition,\n contextFunctionItems = [],\n listboxId,\n} = defineProps<{\n query: string\n environment?: XScalarEnvironment\n dropdownPosition?: { left: number; top: number }\n /** Runtime placeholders such as `{{$guid}}`, shown with environment variables */\n contextFunctionItems?: { key: string; description: string }[]\n /**\n * Id for the `role=\"listbox\"` element. When set, each option also receives a\n * stable id so the owning combobox input can reference the active option via\n * `aria-activedescendant` (W3C combobox pattern).\n */\n listboxId?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', variable: string): void\n (e: 'redirect'): void\n /**\n * Fired when the user dismisses the panel by clicking outside. The owning\n * combobox needs this to clear its `aria-expanded`/`aria-controls` state,\n * which would otherwise keep pointing at a listbox that is no longer mounted.\n */\n (e: 'close'): void\n}>()\n\nconst isOpen = ref(true)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst selectedVariableIndex = ref(0)\n\nconst redirectToEnvironment = () => {\n emit('redirect')\n isOpen.value = false\n // The panel is gone, so tell the combobox to drop its aria-expanded /\n // aria-controls — otherwise they keep pointing at a dismissed listbox.\n emit('close')\n}\n\n/** Normalize the variables to have a name and value */\nconst normalizedVariables = computed(() =>\n (environment?.variables ?? []).map((v) => ({\n key: v.name,\n value: typeof v.value === 'string' ? v.value : v.value.default,\n })),\n)\n\nconst contextRows = computed((): DropdownRow[] =>\n contextFunctionItems.map((item) => ({\n kind: 'context',\n key: item.key,\n secondary: item.description,\n })),\n)\n\nconst envRows = computed((): DropdownRow[] =>\n normalizedVariables.value\n .filter(({ key, value }) => key !== '' || value !== '')\n .map(({ key, value }) => ({\n kind: 'env' as const,\n key,\n secondary: value,\n })),\n)\n\ntype FuseRow = DropdownRow & { fuseText: string }\n\nconst envFuseSource = computed((): FuseRow[] =>\n envRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst contextFuseSource = computed((): FuseRow[] =>\n contextRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst fuseEnv = computed(\n () =>\n new Fuse(envFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst fuseContext = computed(\n () =>\n new Fuse(contextFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst popularContextRows = computed((): DropdownRow[] => {\n const byKey = new Map(contextFunctionItems.map((c) => [c.key, c]))\n return POPULAR_CONTEXT_FUNCTION_KEYS.flatMap((key) => {\n const item = byKey.get(key)\n return item\n ? [\n {\n kind: 'context' as const,\n key: item.key,\n secondary: item.description,\n },\n ]\n : []\n })\n})\n\nconst DROPDOWN_LIMIT = 12\n\nconst filteredVariables = computed((): DropdownRow[] => {\n if (!query.trim()) {\n const envSlice = envRows.value.slice(-4)\n return [...envSlice, ...popularContextRows.value]\n }\n\n const q = query.trim()\n const envMatches = fuseEnv.value\n .search(q, { limit: DROPDOWN_LIMIT })\n .map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n\n const remaining = DROPDOWN_LIMIT - envMatches.length\n const contextMatches =\n remaining > 0\n ? fuseContext.value.search(q, { limit: remaining }).map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n : []\n\n return [...envMatches, ...contextMatches]\n})\n\nconst optionId = (index: number): string | undefined =>\n listboxId ? `${listboxId}-option-${index}` : undefined\n\n/**\n * Id of the currently highlighted option, for the combobox's\n * `aria-activedescendant`. Undefined when there is no list to point at.\n */\nconst activeOptionId = computed((): string | undefined =>\n filteredVariables.value.length\n ? optionId(selectedVariableIndex.value)\n : undefined,\n)\n\nconst selectVariable = (variableKey: string): void => {\n emit('select', variableKey)\n}\n\n// Narrowing the query shrinks the list; keep the highlight in range so both the\n// visible selection and `aria-activedescendant` never reference a dropped option.\nwatch(\n () => filteredVariables.value.length,\n (length) => {\n if (selectedVariableIndex.value > length - 1) {\n selectedVariableIndex.value = Math.max(0, length - 1)\n }\n },\n)\n\nconst handleArrowKey = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = filteredVariables.value.length\n\n if (length === 0) {\n return\n }\n\n selectedVariableIndex.value =\n (selectedVariableIndex.value + offset + length) % length\n}\n\nconst handleSelect = () => {\n if (selectedVariableIndex.value >= 0) {\n const selectedVariable =\n filteredVariables.value[selectedVariableIndex.value]\n if (selectedVariable) {\n selectVariable(selectedVariable.key)\n }\n }\n}\n\ndefineExpose({\n handleArrowKey,\n handleSelect,\n activeOptionId,\n})\n\nonMounted(() => {\n // Reset selected index to the first item when dropdown opens\n selectedVariableIndex.value = 0\n})\n\nconst dropdownStyle = computed<CSSProperties>(() => {\n return {\n left: (dropdownPosition?.left ?? 0) + 'px',\n // Add a 5px offset from the editor\n top: (dropdownPosition?.top ?? 0) + 5 + 'px',\n }\n})\n\nonClickOutside(\n dropdownRef,\n () => {\n isOpen.value = false\n emit('close')\n },\n { ignore: [dropdownRef] },\n)\n</script>\n<template>\n <ScalarTeleport\n v-if=\"isOpen\"\n class=\"scalar-client\">\n <div\n ref=\"dropdownRef\"\n class=\"custom-scroll z-context fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75\"\n :style=\"dropdownStyle\"\n @mousedown.prevent>\n <!--\n Always rendered (even with no matches) so the combobox's `aria-controls`\n always resolves to a real listbox; an empty list simply has no options.\n -->\n <ul\n :id=\"listboxId\"\n aria-label=\"Variable suggestions\"\n class=\"gap-1/2 flex flex-col\"\n role=\"listbox\">\n <template\n v-for=\"(item, index) in filteredVariables\"\n :key=\"`${item.kind}-${item.key}`\">\n <li\n :id=\"optionId(index)\"\n :aria-selected=\"index === selectedVariableIndex\"\n class=\"font-code text-xxs hover:bg-b-3 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150\"\n :class=\"{ 'bg-b-3': index === selectedVariableIndex }\"\n role=\"option\"\n @click=\"selectVariable(item.key)\">\n <div class=\"flex items-center gap-2 whitespace-nowrap\">\n <span\n v-if=\"item.kind === 'env'\"\n class=\"h-2.25 w-2.25 min-w-2.25 rounded-full\"\n :style=\"{\n backgroundColor: environment?.color,\n }\" />\n <span\n v-else\n class=\"text-c-3 bg-b-3 flex h-4.5 min-w-4.5 items-center justify-center rounded px-0.5 font-sans text-[9px] font-semibold\">\n fn\n </span>\n {{ item.key }}\n </div>\n <span\n class=\"max-w-[9rem] overflow-hidden text-right text-ellipsis whitespace-nowrap\">\n {{ item.secondary }}\n </span>\n </li>\n </template>\n </ul>\n <ScalarButton\n v-if=\"!filteredVariables.length\"\n class=\"font-code text-xxs bg-b-inherit hover:bg-b-3 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150\"\n variant=\"outlined\"\n @click=\"redirectToEnvironment\">\n <ScalarIconPlus class=\"size-3\" />\n Add Variable\n </ScalarButton>\n <!-- Backdrop for the dropdown -->\n <div\n class=\"bg-b-1 brightness-lifted absolute inset-0 -z-1 rounded shadow-lg\" />\n </div>\n </ScalarTeleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmIA,IAAM,iBAAiB;;;;;;;;;;;;;;;;EAjGvB,MAAM,OAAO;EAWb,MAAM,SAAS,IAAI,IAAI;EACvB,MAAM,cAAc,IAAwB,IAAI;EAChD,MAAM,wBAAwB,IAAI,CAAC;EAEnC,MAAM,8BAA8B;GAClC,KAAK,UAAU;GACf,OAAO,QAAQ;GAGf,KAAK,OAAO;EACd;;EAGA,MAAM,sBAAsB,gBACzB,QAAA,aAAa,aAAa,CAAC,EAAA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S,GAAA,CAAA,CAAA,GAAA,IAAA,UAAA;;MAMhB,kBAAA,MAAkB,UAAA,UAAA,GAD3B,YAOe,MAAA,YAAA,GAAA;;MALb,OAAM;MACN,SAAQ;MACP,SAAO;;6BACyB,CAAjC,YAAiC,MAAA,cAAA,GAAA,EAAjB,OAAM,SAAQ,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,gBAAG,kBAEnC,EAAA,EAAA,CAAA;;;+BAEA,mBAC6E,OAAA,EAA3E,OAAM,mEAAkE,GAAA,MAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariablesTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAWnH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;AAgWrB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentVariablesTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAWnH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;AAmWrB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
2
2
  import EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default from "./EnvironmentVariablesTable.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/v2/features/environments/components/EnvironmentVariablesTable.vue
5
- var EnvironmentVariablesTable_default = /* @__PURE__ */ _plugin_vue_export_helper_default(EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5b336842"]]);
5
+ var EnvironmentVariablesTable_default = /*#__PURE__*/ _plugin_vue_export_helper_default(EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5b336842"]]);
6
6
  //#endregion
7
7
  export { EnvironmentVariablesTable_default as default };
8
8
 
@@ -7,7 +7,7 @@ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock
7
7
  import { ScalarButton } from "@scalar/components/button";
8
8
  import { ScalarIconTrash } from "@scalar/icons";
9
9
  //#region src/v2/features/environments/components/EnvironmentVariablesTable.vue?vue&type=script&setup=true&lang.ts
10
- var EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
10
+ var EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
11
11
  __name: "EnvironmentVariablesTable",
12
12
  props: {
13
13
  environment: {},