@scalar/api-client 2.39.4 → 2.41.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 (337) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js.map +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue.script.js +2 -2
  6. package/dist/components/AddressBar/AddressBarHistory.vue.script.js.map +1 -1
  7. package/dist/hooks/useClientConfig.d.ts +12 -0
  8. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  9. package/dist/hooks/useClientConfig.js +14 -1
  10. package/dist/hooks/useClientConfig.js.map +1 -1
  11. package/dist/libs/index.d.ts +0 -1
  12. package/dist/libs/index.d.ts.map +1 -1
  13. package/dist/libs/index.js +1 -2
  14. package/dist/style.css +207 -248
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +14 -10
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  18. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +57 -35
  19. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  20. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -5
  21. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  22. package/dist/v2/blocks/operation-block/helpers/send-request.js +18 -33
  23. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
  26. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  27. package/dist/v2/blocks/operation-block/index.d.ts +0 -3
  28. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  29. package/dist/v2/blocks/operation-block/index.js +1 -4
  30. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +1 -1
  31. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  33. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  34. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +3 -1
  35. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  36. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -2
  37. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +3 -2
  39. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js.map +1 -1
  40. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +1 -1
  41. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
  42. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  43. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +7 -2
  45. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  46. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +4 -3
  47. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js.map +1 -1
  48. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +2 -3
  50. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts +3 -1
  52. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  53. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +5 -8
  54. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js.map +1 -1
  55. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
  56. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  57. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  58. package/dist/v2/blocks/operation-code-sample/index.d.ts +0 -1
  59. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  60. package/dist/v2/blocks/operation-code-sample/index.js +2 -3
  61. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +7 -9
  62. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  63. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  64. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  65. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +49 -42
  66. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  68. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  70. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +2 -3
  71. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -0
  75. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  77. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  80. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -1
  81. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +1 -1
  82. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -1
  83. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +2 -1
  84. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js.map +1 -1
  85. package/dist/v2/blocks/response-block/helpers/get-content-length.d.ts.map +1 -1
  86. package/dist/v2/blocks/response-block/helpers/get-content-length.js +2 -2
  87. package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
  88. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  90. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  91. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +76 -25
  92. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  93. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  94. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  95. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  96. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +2 -2
  97. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  98. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -1
  99. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  100. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  101. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
  102. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  103. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  104. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  106. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +8 -4
  107. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  108. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -1
  109. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  111. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  112. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
  113. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  114. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +6 -2
  122. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  123. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +0 -3
  124. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/index.js +1 -3
  126. package/dist/v2/components/code-input/CodeInput.vue.d.ts +8 -6
  127. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  128. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  129. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  130. package/dist/v2/components/code-input/CodeInput.vue.script.js +11 -9
  131. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  132. package/dist/v2/constants.js +1 -1
  133. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  134. package/dist/v2/features/app/App.vue.js.map +1 -1
  135. package/dist/v2/features/app/App.vue.script.js +1 -5
  136. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  137. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  138. package/dist/v2/features/app/app-events.js +1 -1
  139. package/dist/v2/features/app/app-events.js.map +1 -1
  140. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  141. package/dist/v2/features/app/app-state.js +2 -2
  142. package/dist/v2/features/app/app-state.js.map +1 -1
  143. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  144. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  145. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  146. package/dist/v2/features/app/components/AppSidebar.vue.script.js +1 -1
  147. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  148. package/dist/v2/features/app/helpers/routes.d.ts +0 -3
  149. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  150. package/dist/v2/features/app/helpers/routes.js +1 -1
  151. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  152. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  153. package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
  154. package/dist/v2/features/collection/DocumentCollection.vue.script.js +30 -52
  155. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  156. package/dist/v2/features/collection/OperationCollection.vue.script.js +0 -1
  157. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  158. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +0 -1
  159. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  160. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  161. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  162. package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
  163. package/dist/v2/features/collection/components/Authentication.vue.script.js +6 -8
  164. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  165. package/dist/v2/features/collection/components/Cookies.vue.script.js +0 -1
  166. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  167. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +0 -1
  168. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  169. package/dist/v2/features/collection/components/Environment.vue.script.js +0 -1
  170. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  171. package/dist/v2/features/collection/components/Overview.vue.script.js +0 -1
  172. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  173. package/dist/v2/features/collection/components/Servers.vue.script.js +0 -1
  174. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  175. package/dist/v2/features/collection/components/Settings.vue.js.map +1 -1
  176. package/dist/v2/features/collection/components/Settings.vue.script.js +2 -3
  177. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  178. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +1 -1
  179. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  180. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  181. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
  182. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  183. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  184. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  185. package/dist/v2/features/modal/Modal.vue.script.js +4 -9
  186. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  187. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  188. package/dist/v2/features/modal/helpers/create-api-client-modal.js +1 -17
  189. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  190. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -1
  191. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  192. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  193. package/dist/v2/features/operation/Operation.vue.script.js +51 -84
  194. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  195. package/dist/v2/features/operation/index.d.ts +0 -4
  196. package/dist/v2/features/operation/index.d.ts.map +1 -1
  197. package/dist/v2/features/operation/index.js +1 -5
  198. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  199. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js.map +1 -1
  200. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js +11 -1
  201. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js.map +1 -1
  202. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  203. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  204. package/dist/views/Request/RequestSection/RequestTable.vue.js.map +1 -1
  205. package/dist/views/Request/RequestSection/RequestTable.vue.script.js +1 -1
  206. package/dist/views/Request/RequestSection/RequestTable.vue.script.js.map +1 -1
  207. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
  208. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  209. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js.map +1 -1
  210. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js +2 -2
  211. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js.map +1 -1
  212. package/dist/views/Request/libs/oauth2.js +1 -1
  213. package/dist/views/Request/libs/oauth2.js.map +1 -1
  214. package/package.json +24 -30
  215. package/dist/libs/formatters.d.ts +0 -12
  216. package/dist/libs/formatters.d.ts.map +0 -1
  217. package/dist/libs/formatters.js +0 -36
  218. package/dist/libs/formatters.js.map +0 -1
  219. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +0 -6
  220. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +0 -1
  221. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js +0 -58
  222. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js.map +0 -1
  223. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +0 -12
  224. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +0 -1
  225. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -65
  226. package/dist/v2/blocks/operation-block/helpers/build-request-body.js.map +0 -1
  227. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +0 -31
  228. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +0 -1
  229. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -55
  230. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js.map +0 -1
  231. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +0 -27
  232. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +0 -1
  233. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -159
  234. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js.map +0 -1
  235. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +0 -25
  236. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +0 -1
  237. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -53
  238. package/dist/v2/blocks/operation-block/helpers/build-request-security.js.map +0 -1
  239. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +0 -46
  240. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +0 -1
  241. package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -102
  242. package/dist/v2/blocks/operation-block/helpers/build-request.js.map +0 -1
  243. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +0 -4
  244. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +0 -1
  245. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -41
  246. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js.map +0 -1
  247. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +0 -14
  248. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +0 -1
  249. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -20
  250. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js.map +0 -1
  251. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +0 -8
  252. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +0 -9
  254. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +0 -1
  255. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -17
  256. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js.map +0 -1
  257. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +0 -10
  258. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +0 -1
  259. package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -41
  260. package/dist/v2/blocks/operation-block/helpers/get-example.js.map +0 -1
  261. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +0 -26
  262. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +0 -1
  263. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -32
  264. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js.map +0 -1
  265. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +0 -10
  266. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +0 -1
  267. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -15
  268. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js.map +0 -1
  269. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +0 -3
  270. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +0 -1
  271. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -18
  272. package/dist/v2/blocks/operation-block/helpers/get-server-url.js.map +0 -1
  273. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts +0 -96
  274. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts.map +0 -1
  275. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -160
  276. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js.map +0 -1
  277. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +0 -40
  278. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +0 -1
  279. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -437
  280. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js.map +0 -1
  281. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +0 -6
  282. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +0 -1
  283. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -25
  284. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js.map +0 -1
  285. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -141
  286. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js.map +0 -1
  287. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +0 -4
  288. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +0 -1
  289. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -10
  290. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js.map +0 -1
  291. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +0 -9
  292. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +0 -1
  293. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -27
  294. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js.map +0 -1
  295. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +0 -25
  296. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +0 -1
  297. package/dist/v2/components/callout/Callout.vue.js +0 -9
  298. package/dist/v2/components/callout/Callout.vue.js.map +0 -1
  299. package/dist/v2/components/callout/Callout.vue.script.js +0 -35
  300. package/dist/v2/components/callout/Callout.vue.script.js.map +0 -1
  301. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts +0 -18
  302. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts.map +0 -1
  303. package/dist/v2/features/modal/helpers/restore-workspace-state.js +0 -51
  304. package/dist/v2/features/modal/helpers/restore-workspace-state.js.map +0 -1
  305. package/dist/v2/features/operation/helpers/combine-params.d.ts +0 -4
  306. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +0 -1
  307. package/dist/v2/features/operation/helpers/combine-params.js +0 -20
  308. package/dist/v2/features/operation/helpers/combine-params.js.map +0 -1
  309. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +0 -17
  310. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +0 -1
  311. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +0 -12
  312. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +0 -1
  313. package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -17
  314. package/dist/v2/features/operation/helpers/get-security-requirements.js.map +0 -1
  315. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +0 -15
  316. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +0 -1
  317. package/dist/v2/features/operation/helpers/get-selected-security.js +0 -41
  318. package/dist/v2/features/operation/helpers/get-selected-security.js.map +0 -1
  319. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +0 -13
  320. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +0 -1
  321. package/dist/v2/features/operation/helpers/get-selected-server.js +0 -21
  322. package/dist/v2/features/operation/helpers/get-selected-server.js.map +0 -1
  323. package/dist/v2/helpers/get-active-environment.d.ts +0 -5
  324. package/dist/v2/helpers/get-active-environment.d.ts.map +0 -1
  325. package/dist/v2/helpers/get-active-environment.js +0 -19
  326. package/dist/v2/helpers/get-active-environment.js.map +0 -1
  327. package/dist/v2/helpers/get-active-proxy-url.d.ts +0 -18
  328. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +0 -1
  329. package/dist/v2/helpers/get-active-proxy-url.js +0 -26
  330. package/dist/v2/helpers/get-active-proxy-url.js.map +0 -1
  331. package/dist/v2/helpers/get-servers.d.ts +0 -23
  332. package/dist/v2/helpers/get-servers.d.ts.map +0 -1
  333. package/dist/v2/helpers/get-servers.js +0 -106
  334. package/dist/v2/helpers/get-servers.js.map +0 -1
  335. package/dist/v2/helpers/index.d.ts +0 -3
  336. package/dist/v2/helpers/index.d.ts.map +0 -1
  337. package/dist/v2/helpers/index.js +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.script.js","names":["$attrs","$slots"],"sources":["../../../../src/v2/components/code-input/CodeInput.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type CodeInputModelValue =\n | string\n | number\n | boolean\n | Array<string | number | boolean>\n | Record<string, unknown>\n\n/**\n * CodeInput\n *\n * A versatile input component that adapts its rendering based on props:\n * - Disabled mode: Read-only text display\n * - Select mode: Dropdown for enums, booleans, or examples\n * - Editor mode: CodeMirror with environment variable support\n *\n * Type `{{` to trigger environment variable autocomplete when an environment is provided.\n * It takes in any data but always will emit a string value,\n * this string should then be parsed in accordance to the schema or content type.\n *\n * @example\n * ```vue\n * <!-- Basic input with environment variables -->\n * <CodeInput v-model=\"value\" :environment=\"env\" />\n *\n * <!-- Boolean select -->\n * <CodeInput v-model=\"flag\" type=\"boolean\" />\n *\n * <!-- JSON editor with linting -->\n * <CodeInput v-model=\"data\" language=\"json\" :lint=\"true\" />\n * ```\n */\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport {\n colorPicker as colorPickerExtension,\n useCodeMirror,\n useDropdown,\n type CodeMirrorLanguage,\n type Extension,\n} from '@scalar/use-codemirror'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, toRef, useAttrs, watch, type Ref } from 'vue'\n\nimport DataTableInputSelect from '@/v2/components/data-table/DataTableInputSelect.vue'\nimport EnvironmentVariableDropdown from '@/v2/features/environments/components/EnvironmentVariablesDropdown.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport { backspaceCommand, pillPlugin } from './code-variable-widget'\n\ntype Props = {\n modelValue: CodeInputModelValue\n /** Environment for variable substitution. Pass undefined to disable environment variables */\n environment: XScalarEnvironment | undefined\n /** Type of the input value, affects rendering mode for booleans */\n type?: string | string[]\n /** Render as disabled text display */\n disabled?: boolean\n /** Show error styling */\n error?: boolean\n /** Layout context affects styling and behavior */\n layout?: ClientLayout\n /** Predefined enum values, triggers select mode */\n enum?: string[]\n /** Example values, triggers select mode */\n examples?: string[]\n /** Default value to show in select mode */\n default?: Props['modelValue']\n /** Allow null in boolean select options */\n nullable?: boolean\n /** Placeholder text for empty input */\n placeholder?: string\n /** Show required indicator */\n required?: boolean\n /** Enable color picker extension */\n colorPicker?: boolean\n /** Show line numbers in editor */\n lineNumbers?: boolean\n /** Enable linting */\n lint?: boolean\n /** Enable line wrapping */\n lineWrapping?: boolean\n /** CodeMirror language mode */\n language?: CodeMirrorLanguage\n /** Additional CodeMirror extensions */\n extensions?: Extension[]\n /** Disable tab key for indentation */\n disableTabIndent?: boolean\n /** Disable enter key */\n disableEnter?: boolean\n /** Disable automatic bracket closing */\n disableCloseBrackets?: boolean\n /** Emit submit event on blur */\n emitOnBlur?: boolean\n /** Enable environment variable pills */\n withVariables?: boolean\n /** Emit change event even if the value is the same */\n alwaysEmitChange?: boolean\n /** Custom change handler, prevents default emit */\n handleFieldChange?: (value: string) => void\n /** Custom submit handler, prevents default emit */\n handleFieldSubmit?: (value: string) => void\n /** Put a linethrough on the input text */\n linethrough?: boolean\n}\n\nconst {\n modelValue,\n environment,\n type,\n disabled = false,\n error = false,\n layout = 'desktop',\n enum: enumProp,\n examples,\n default: defaultProp,\n nullable = false,\n placeholder,\n required,\n colorPicker = false,\n lineNumbers = false,\n lint = false,\n lineWrapping = false,\n language,\n extensions = [],\n disableTabIndent = false,\n disableEnter = false,\n disableCloseBrackets = false,\n emitOnBlur = true,\n alwaysEmitChange = false,\n withVariables = true,\n handleFieldChange,\n handleFieldSubmit,\n} = defineProps<Props>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'submit': [value: string]\n 'blur': [value: string]\n 'navigate': [route: { page: 'document'; path: 'environment' }]\n}>()\n\n// ---------------------------------------------------------------------------\n// Component identity and focus state\n\nconst attrs = useAttrs() as { id?: string }\nconst componentId = attrs.id || `id-${nanoid()}`\nconst isFocused = ref(false)\n\n// ---------------------------------------------------------------------------\n// Rendering mode detection\n\n/**\n * Determines if we should render a select dropdown for boolean types.\n */\nconst isBooleanMode = computed((): boolean => {\n if (enumProp?.length) {\n return false\n }\n return type === 'boolean' || (Array.isArray(type) && type.includes('boolean'))\n})\n\n/**\n * Options for boolean select mode.\n */\nconst booleanOptions = computed((): string[] =>\n nullable ? ['true', 'false', 'null'] : ['true', 'false'],\n)\n\n/**\n * Default type when dealing with type arrays.\n * Finds the first non-null type.\n */\nconst defaultType = computed((): string | undefined => {\n if (Array.isArray(type)) {\n return type.find((t) => t !== 'null') ?? 'string'\n }\n return type\n})\n\n// ---------------------------------------------------------------------------\n// Event handlers\n\n/**\n * Handles value changes during typing.\n */\nconst handleChange = (value: string): void => {\n if (!alwaysEmitChange && value === serializeValue(modelValue)) {\n return\n }\n\n // Use custom handler or emit update\n if (handleFieldChange) {\n handleFieldChange(value)\n } else {\n emit('update:modelValue', value)\n }\n}\n\n/**\n * Handles form submission (enter key or blur with emitOnBlur).\n */\nconst handleSubmit = (value: string): void => {\n if (handleFieldSubmit) {\n handleFieldSubmit(value)\n } else {\n emit('submit', value)\n }\n}\n\n/**\n * Handles input blur event.\n */\nconst handleBlur = (value: string): void => {\n isFocused.value = false\n\n if (emitOnBlur && modelValue) {\n handleSubmit(value)\n }\n\n emit('blur', value)\n}\n\n/**\n * Handles model value updates from select components.\n */\nconst handleSelectChange = (value: string): void =>\n emit('update:modelValue', value)\n\n// ---------------------------------------------------------------------------\n// CodeMirror setup\n\n/**\n * Build extensions array.\n * Note: Extensions are not reactive after initialization.\n */\nconst buildExtensions = (): Extension[] => {\n const extensionsList: Extension[] = [...extensions]\n\n if (colorPicker) {\n extensionsList.push(colorPickerExtension)\n }\n\n return extensionsList\n}\n\n/**\n * Reactive pill plugin for environment variable visualization.\n */\nconst pillPluginExtension = computed(() =>\n pillPlugin({\n environment,\n isReadOnly: layout === 'modal',\n }),\n)\n\n/**\n * Combined extensions for CodeMirror.\n */\nconst codeMirrorExtensions = computed((): Extension[] => [\n ...buildExtensions(),\n pillPluginExtension.value,\n backspaceCommand,\n])\n\nconst codeMirrorRef: Ref<HTMLDivElement | null> = ref(null)\n\n/** Converts the model value to a string for CodeMirror */\nconst serializeValue = (value: CodeInputModelValue): string => {\n if (typeof value === 'string') {\n return value\n }\n return JSON.stringify(value)\n}\n\nconst { codeMirror } = useCodeMirror({\n content: toRef(() => serializeValue(modelValue)),\n onChange: (value) => {\n handleChange(value)\n updateDropdownVisibility()\n },\n onFocus: () => {\n isFocused.value = true\n },\n onBlur: handleBlur,\n codeMirrorRef,\n disableTabIndent: toRef(() => disableTabIndent),\n disableEnter: toRef(() => disableEnter),\n disableCloseBrackets: toRef(() => disableCloseBrackets),\n lineNumbers: toRef(() => lineNumbers),\n language: toRef(() => language),\n lint: toRef(() => lint),\n extensions: codeMirrorExtensions,\n placeholder: toRef(() => placeholder),\n})\n\n/**\n * Handle autofocus attribute.\n */\nwatch(codeMirror, () => {\n if (codeMirror.value && Object.hasOwn(attrs, 'autofocus')) {\n codeMirror.value.focus()\n }\n})\n\n// ---------------------------------------------------------------------------\n// Environment variable dropdown\n\nconst showDropdown = ref(false)\nconst dropdownQuery = ref('')\nconst dropdownPosition = ref({ left: 0, top: 0 })\nconst dropdownRef = ref<InstanceType<\n typeof EnvironmentVariableDropdown\n> | null>(null)\n\nconst { handleDropdownSelect, updateDropdownVisibility } = useDropdown({\n codeMirror,\n query: dropdownQuery,\n showDropdown,\n dropdownPosition,\n})\n\n/**\n * Determines if the environment variable dropdown should be visible.\n */\nconst displayVariablesDropdown = computed((): boolean => {\n return (\n showDropdown.value &&\n withVariables &&\n layout !== 'modal' &&\n Boolean(environment)\n )\n})\n\n// ---------------------------------------------------------------------------\n// Keyboard event handling\n\n/**\n * Handles keyboard navigation for dropdown and form submission.\n */\nconst handleKeyDown = (key: string, event: KeyboardEvent): void => {\n if (showDropdown.value) {\n if (key === 'down' || key === 'up') {\n event.preventDefault()\n dropdownRef.value?.handleArrowKey(key)\n } else if (key === 'enter') {\n event.preventDefault()\n dropdownRef.value?.handleSelect()\n }\n return\n }\n\n if (key === 'escape' && !disableTabIndent) {\n event.stopPropagation()\n }\n\n if (key === 'enter' && event.target instanceof HTMLDivElement) {\n handleSubmit(event.target.textContent ?? '')\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n\ndefineExpose({\n /**\n * Focus the codemirror element\n *\n * @param cursorAtEnd boolean place the cursor at the end of the input\n */\n focus: (position?: 'start' | 'end' | number) => {\n if (!codeMirror.value) {\n return\n }\n codeMirror.value.focus()\n\n if (!isDefined(position)) {\n return\n }\n\n const anchor = (() => {\n if (position === 'start') {\n return 0\n }\n if (position === 'end') {\n return codeMirror.value.state.doc.length\n }\n return position\n })()\n\n // Move the cursor to the specified position\n codeMirror.value.dispatch({\n selection: { anchor },\n scrollIntoView: true,\n })\n },\n isFocused,\n handleChange,\n handleSubmit,\n handleBlur,\n booleanOptions,\n codeMirror,\n modelValue,\n cursorPosition: () => codeMirror.value?.state.selection.main.head,\n serializeValue,\n})\n</script>\n\n<template>\n <!-- Disabled mode: read-only text display -->\n <div\n v-if=\"disabled\"\n class=\"text-c-2 flex cursor-default items-center justify-center\"\n :class=\"{\n 'font-code pr-2 pl-1 text-base': layout === 'modal',\n 'px-2': layout !== 'modal',\n 'line-through': linethrough,\n }\"\n data-testid=\"code-input-disabled\">\n <span class=\"whitespace-nowrap\">{{ modelValue }}</span>\n </div>\n\n <!-- Enum mode: select dropdown with predefined values -->\n <DataTableInputSelect\n v-else-if=\"enumProp?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :type=\"defaultType\"\n :value=\"enumProp\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Boolean mode: select dropdown with true/false (and optionally null) -->\n <DataTableInputSelect\n v-else-if=\"isBooleanMode\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"booleanOptions\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Examples mode: select dropdown with example values -->\n <DataTableInputSelect\n v-else-if=\"examples?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"examples\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Editor mode: CodeMirror with environment variable support -->\n <div\n v-else\n :id=\"componentId\"\n v-bind=\"$attrs\"\n ref=\"codeMirrorRef\"\n class=\"group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\"\n :class=\"{\n 'line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1':\n lineWrapping,\n 'flow-code-input--error': error,\n 'line-through': linethrough,\n }\"\n @keydown.down.stop=\"handleKeyDown('down', $event)\"\n @keydown.enter=\"handleKeyDown('enter', $event)\"\n @keydown.escape=\"handleKeyDown('escape', $event)\"\n @keydown.up.stop=\"handleKeyDown('up', $event)\">\n <!-- Tab exit hint (shown when focused) -->\n <div\n v-if=\"!disableTabIndent\"\n class=\"z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block\"\n role=\"alert\">\n Press\n <kbd class=\"-mx-0.25 rounded border px-0.5 font-mono\">Esc</kbd> then\n <kbd class=\"-mx-0.25 rounded border px-0.5 font-mono\">Tab</kbd> to exit\n </div>\n </div>\n\n <!-- Warning slot (positioned absolutely) -->\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n\n <!-- Icon slot (positioned absolutely) -->\n <div\n v-if=\"$slots.icon\"\n class=\"centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1\">\n <slot name=\"icon\" />\n </div>\n\n <!-- Required indicator -->\n <div\n v-if=\"required\"\n class=\"required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0\">\n Required\n </div>\n\n <!-- Environment variable autocomplete dropdown -->\n <EnvironmentVariableDropdown\n v-if=\"displayVariablesDropdown && environment\"\n ref=\"dropdownRef\"\n :dropdownPosition=\"dropdownPosition\"\n :environment=\"environment\"\n :query=\"dropdownQuery\"\n @redirect=\"emit('navigate', { page: 'document', path: 'environment' })\"\n @select=\"handleDropdownSelect\" />\n</template>\n<style scoped>\n/*\n Deep styling for customizing Codemirror\n */\n:deep(.cm-editor) {\n height: 100%;\n outline: none;\n padding: 0;\n background: transparent;\n}\n:deep(.cm-placeholder) {\n color: var(--scalar-color-3);\n}\n:deep(.cm-content) {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-small);\n max-height: 20px;\n padding: 8px 0;\n}\n/* Tooltip helper */\n:deep(.cm-tooltip) {\n background: transparent !important;\n filter: brightness(var(--scalar-lifted-brightness));\n border-radius: var(--scalar-radius);\n box-shadow: var(--scalar-shadow-2);\n border: none !important;\n outline: none !important;\n overflow: hidden !important;\n}\n:deep(.cm-tooltip-autocomplete ul li) {\n padding: 3px 6px !important;\n}\n:deep(.cm-completionIcon-type:after) {\n color: var(--scalar-color-3) !important;\n}\n:deep(.cm-tooltip-autocomplete ul li[aria-selected]) {\n background: var(--scalar-background-2) !important;\n color: var(--scalar-color-1) !important;\n}\n:deep(.cm-tooltip-autocomplete ul) {\n padding: 6px !important;\n position: relative;\n}\n:deep(.cm-tooltip-autocomplete ul li:hover) {\n border-radius: 3px;\n color: var(--scalar-color-1) !important;\n background: var(--scalar-background-3) !important;\n}\n/* Disable active line highlighting */\n:deep(.cm-activeLine),\n:deep(.cm-activeLineGutter) {\n background-color: transparent;\n}\n/* Color selection matching */\n:deep(.cm-selectionMatch),\n:deep(.cm-matchingBracket) {\n border-radius: var(--scalar-radius);\n background: var(--scalar-background-4) !important;\n}\n/* Color Picker Swatches */\n:deep(.cm-css-color-picker-wrapper) {\n display: inline-flex;\n outline: 1px solid var(--scalar-background-3);\n border-radius: 3px;\n overflow: hidden;\n}\n/* Number gutter */\n:deep(.cm-gutters) {\n background-color: transparent;\n border-right: none;\n color: var(--scalar-color-3);\n font-size: var(--scalar-small);\n line-height: 22px;\n border-radius: 0 0 0 3px;\n}\n:deep(.cm-gutters:before) {\n content: '';\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(100% - 2px);\n height: calc(100% - 4px);\n border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);\n background-color: var(--scalar-background-1);\n}\n:deep(.cm-gutterElement) {\n font-family: var(--scalar-font-code) !important;\n padding-left: 0px !important;\n padding-right: 6px !important;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n position: relative;\n}\n:deep(.cm-lineNumbers .cm-gutterElement) {\n min-width: fit-content;\n}\n:deep(.cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement) {\n padding-left: 0 !important;\n}\n:deep(.cm-scroller) {\n overflow: auto;\n}\n.line-wrapping:focus-within :deep(.cm-content) {\n display: inline-table;\n min-height: fit-content;\n padding: 3px 6px;\n white-space: break-spaces;\n word-break: break-all;\n}\n</style>\n<style>\n.cm-pill {\n color: var(--scalar-color-1) !important;\n padding: 0px 9px;\n border-radius: 3px;\n display: inline-block;\n border-radius: 30px;\n font-size: var(--scalar-small);\n}\n.light-mode .cm-pill {\n background: var(--scalar-background-3) !important;\n}\n.dark-mode .cm-pill {\n background: color-mix(in srgb, var(--tw-bg-base), transparent 90%) !important;\n}\n.cm-pill:first-of-type {\n margin-left: 0;\n}\n.cm-editor .cm-widgetBuffer {\n display: none;\n}\n.cm-foldPlaceholder:hover {\n color: var(--scalar-color-1);\n}\n.cm-foldGutter .cm-gutterElement {\n font-size: var(--scalar-heading-4);\n padding: 2px !important;\n}\n.cm-foldGutter .cm-gutterElement:first-of-type {\n display: none;\n}\n.cm-foldGutter .cm-gutterElement .cm-foldMarker {\n padding: 2px;\n padding-top: 2px;\n}\n.cm-foldGutter .cm-gutterElement:hover .cm-foldMarker {\n background: var(--scalar-background-2);\n border-radius: var(--scalar-radius);\n color: var(--scalar-color-1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4GhB,MAAM,OAAO;EAUb,MAAM,QAAQ,UAAU;EACxB,MAAM,cAAc,MAAM,MAAM,MAAM,QAAQ;EAC9C,MAAM,YAAY,IAAI,MAAK;;;;EAQ3B,MAAM,gBAAgB,eAAwB;AAC5C,OAAI,QAAA,MAAU,OACZ,QAAO;AAET,UAAO,QAAA,SAAS,aAAc,MAAM,QAAQ,QAAA,KAAK,IAAI,QAAA,KAAK,SAAS,UAAU;IAC9E;;;;EAKD,MAAM,iBAAiB,eACrB,QAAA,WAAW;GAAC;GAAQ;GAAS;GAAO,GAAG,CAAC,QAAQ,QAAQ,CAC1D;;;;;EAMA,MAAM,cAAc,eAAmC;AACrD,OAAI,MAAM,QAAQ,QAAA,KAAK,CACrB,QAAO,QAAA,KAAK,MAAM,MAAM,MAAM,OAAO,IAAI;AAE3C,UAAO,QAAA;IACR;;;;EAQD,MAAM,gBAAgB,UAAwB;AAC5C,OAAI,CAAC,QAAA,oBAAoB,UAAU,eAAe,QAAA,WAAW,CAC3D;AAIF,OAAI,QAAA,kBACF,SAAA,kBAAkB,MAAK;OAEvB,MAAK,qB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;IAKMC,KAAAA,OAAO,WAAA,WAAA,EADf,mBAIM,OAJN,YAIM,CADJ,WAAuB,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;IAKjBA,KAAAA,OAAO,QAAA,WAAA,EADf,mBAIM,OAJN,YAIM,CADJ,WAAoB,KAAA,QAAA,QAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;IAKd,QAAA,YAAA,WAAA,EADR,mBAIM,OAJN,YAEoX,aAEpX,IAAA,mBAAA,IAAA,KAAA;IAIQ,yBAAA,SAA4B,QAAA,eAAA,WAAA,EADpC,YAOmC,sCAAA;;cAL7B;KAAJ,KAAI;KACH,kBAAkB,iBAAA;KAClB,aAAa,QAAA;KACb,OAAO,cAAA;KACP,YAAQ,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;MAAA,MAAA;MAAA,MAAA;MAAA,CAAA;KACd,UAAQ,MAAA,qBAAoB"}
1
+ {"version":3,"file":"CodeInput.vue.script.js","names":["$attrs","$slots"],"sources":["../../../../src/v2/components/code-input/CodeInput.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type CodeInputModelValue =\n | string\n | number\n | boolean\n | Array<string | number | boolean>\n | Record<string, unknown>\n\n/**\n * CodeInput\n *\n * A versatile input component that adapts its rendering based on props:\n * - Disabled mode: Read-only text display\n * - Select mode: Dropdown for enums, booleans, or examples\n * - Editor mode: CodeMirror with environment variable support\n *\n * Type `{{` to trigger environment variable autocomplete when an environment is provided.\n * It takes in any data but always will emit a string value,\n * this string should then be parsed in accordance to the schema or content type.\n *\n * @example\n * ```vue\n * <!-- Basic input with environment variables -->\n * <CodeInput v-model=\"value\" :environment=\"env\" />\n *\n * <!-- Boolean select -->\n * <CodeInput v-model=\"flag\" type=\"boolean\" />\n *\n * <!-- JSON editor with linting -->\n * <CodeInput v-model=\"data\" language=\"json\" :lint=\"true\" />\n * ```\n */\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport {\n colorPicker as colorPickerExtension,\n useCodeMirror,\n useDropdown,\n type CodeMirrorLanguage,\n type Extension,\n} from '@scalar/use-codemirror'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, toRef, useAttrs, watch, type Ref } from 'vue'\n\nimport DataTableInputSelect from '@/v2/components/data-table/DataTableInputSelect.vue'\nimport EnvironmentVariableDropdown from '@/v2/features/environments/components/EnvironmentVariablesDropdown.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport { backspaceCommand, pillPlugin } from './code-variable-widget'\n\ntype Props = {\n modelValue: CodeInputModelValue\n /** Environment for variable substitution. Pass undefined to disable environment variables */\n environment: XScalarEnvironment | undefined\n /** Type of the input value, affects rendering mode for booleans */\n type?: string | string[]\n /** Render as disabled text display */\n disabled?: boolean\n /** Show error styling */\n error?: boolean\n /** Layout context affects styling and behavior */\n layout?: ClientLayout\n /** Predefined enum values, triggers select mode */\n enum?: string[]\n /** Example values, triggers select mode */\n examples?: string[]\n /** Default value to show in select mode */\n default?: Props['modelValue']\n /** Allow null in boolean select options */\n nullable?: boolean\n /** Placeholder text for empty input */\n placeholder?: string\n /** Show required indicator */\n required?: boolean\n /** Enable color picker extension */\n colorPicker?: boolean\n /** Show line numbers in editor */\n lineNumbers?: boolean\n /** Enable linting */\n lint?: boolean\n /** Enable line wrapping */\n lineWrapping?: boolean\n /** CodeMirror language mode */\n language?: CodeMirrorLanguage\n /** Additional CodeMirror extensions */\n extensions?: Extension[]\n /** Disable tab key for indentation */\n disableTabIndent?: boolean\n /** Disable enter key */\n disableEnter?: boolean\n /** Disable automatic bracket closing */\n disableCloseBrackets?: boolean\n /** Emit submit event on blur */\n emitOnBlur?: boolean\n /** Enable environment variable pills */\n withVariables?: boolean\n /** Emit change event even if the value is the same */\n alwaysEmitChange?: boolean\n /** Custom change handler, prevents default emit */\n handleFieldChange?: (value: string) => void\n /** Custom submit handler, prevents default emit */\n handleFieldSubmit?: (value: string) => void\n /** Put a linethrough on the input text */\n linethrough?: boolean\n}\n\nconst {\n modelValue,\n environment,\n type,\n disabled = false,\n error = false,\n layout = 'desktop',\n enum: enumProp,\n examples,\n default: defaultProp,\n nullable = false,\n placeholder,\n required,\n colorPicker = false,\n lineNumbers = false,\n lint = false,\n lineWrapping = false,\n language,\n extensions = [],\n disableTabIndent = false,\n disableEnter = false,\n disableCloseBrackets = false,\n emitOnBlur = true,\n alwaysEmitChange = false,\n withVariables = true,\n handleFieldChange,\n handleFieldSubmit,\n} = defineProps<Props>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'submit': [value: string, event: KeyboardEvent | FocusEvent]\n 'navigate': [route: { page: 'document'; path: 'environment' }]\n 'blur': [value: string, event: FocusEvent]\n}>()\n\n// ---------------------------------------------------------------------------\n// Component identity and focus state\n\nconst attrs = useAttrs() as { id?: string }\nconst componentId = attrs.id || `id-${nanoid()}`\nconst isFocused = ref(false)\n\n// ---------------------------------------------------------------------------\n// Rendering mode detection\n\n/**\n * Determines if we should render a select dropdown for boolean types.\n */\nconst isBooleanMode = computed((): boolean => {\n if (enumProp?.length) {\n return false\n }\n return type === 'boolean' || (Array.isArray(type) && type.includes('boolean'))\n})\n\n/**\n * Options for boolean select mode.\n */\nconst booleanOptions = computed((): string[] =>\n nullable ? ['true', 'false', 'null'] : ['true', 'false'],\n)\n\n/**\n * Default type when dealing with type arrays.\n * Finds the first non-null type.\n */\nconst defaultType = computed((): string | undefined => {\n if (Array.isArray(type)) {\n return type.find((t) => t !== 'null') ?? 'string'\n }\n return type\n})\n\n// ---------------------------------------------------------------------------\n// Event handlers\n\n/**\n * Handles value changes during typing.\n */\nconst handleChange = (value: string): void => {\n if (!alwaysEmitChange && value === serializeValue(modelValue)) {\n return\n }\n\n // Use custom handler or emit update\n if (handleFieldChange) {\n handleFieldChange(value)\n } else {\n emit('update:modelValue', value)\n }\n}\n\n/**\n * Handles form submission (enter key or blur with emitOnBlur).\n */\nconst handleSubmit = (\n value: string,\n event: KeyboardEvent | FocusEvent,\n): void => {\n if (handleFieldSubmit) {\n handleFieldSubmit(value)\n } else {\n emit('submit', value, event)\n }\n}\n\n/**\n * Handles input blur event.\n */\nconst handleBlur = (value: string, event: FocusEvent): void => {\n isFocused.value = false\n\n if (emitOnBlur && modelValue) {\n handleSubmit(value, event)\n }\n\n emit('blur', value, event)\n}\n\n/**\n * Handles model value updates from select components.\n */\nconst handleSelectChange = (value: string): void =>\n emit('update:modelValue', value)\n\n// ---------------------------------------------------------------------------\n// CodeMirror setup\n\n/**\n * Build extensions array.\n * Note: Extensions are not reactive after initialization.\n */\nconst buildExtensions = (): Extension[] => {\n const extensionsList: Extension[] = [...extensions]\n\n if (colorPicker) {\n extensionsList.push(colorPickerExtension)\n }\n\n return extensionsList\n}\n\n/**\n * Reactive pill plugin for environment variable visualization.\n */\nconst pillPluginExtension = computed(() =>\n pillPlugin({\n environment,\n isReadOnly: layout === 'modal',\n }),\n)\n\n/**\n * Combined extensions for CodeMirror.\n */\nconst codeMirrorExtensions = computed((): Extension[] => [\n ...buildExtensions(),\n pillPluginExtension.value,\n backspaceCommand,\n])\n\nconst codeMirrorRef: Ref<HTMLDivElement | null> = ref(null)\n\n/** Converts the model value to a string for CodeMirror */\nconst serializeValue = (value: CodeInputModelValue): string => {\n if (typeof value === 'string') {\n return value\n }\n return JSON.stringify(value)\n}\n\nconst { codeMirror, setCodeMirrorContent } = useCodeMirror({\n content: toRef(() => serializeValue(modelValue)),\n onChange: (value) => {\n handleChange(value)\n updateDropdownVisibility()\n },\n onFocus: () => {\n isFocused.value = true\n },\n onBlur: handleBlur,\n codeMirrorRef,\n disableTabIndent: toRef(() => disableTabIndent),\n disableEnter: toRef(() => disableEnter),\n disableCloseBrackets: toRef(() => disableCloseBrackets),\n lineNumbers: toRef(() => lineNumbers),\n language: toRef(() => language),\n lint: toRef(() => lint),\n extensions: codeMirrorExtensions,\n placeholder: toRef(() => placeholder),\n})\n\n/**\n * Handle autofocus attribute.\n */\nwatch(codeMirror, () => {\n if (codeMirror.value && Object.hasOwn(attrs, 'autofocus')) {\n codeMirror.value.focus()\n }\n})\n\n// ---------------------------------------------------------------------------\n// Environment variable dropdown\n\nconst showDropdown = ref(false)\nconst dropdownQuery = ref('')\nconst dropdownPosition = ref({ left: 0, top: 0 })\nconst dropdownRef = ref<InstanceType<\n typeof EnvironmentVariableDropdown\n> | null>(null)\n\nconst { handleDropdownSelect, updateDropdownVisibility } = useDropdown({\n codeMirror,\n query: dropdownQuery,\n showDropdown,\n dropdownPosition,\n})\n\n/**\n * Determines if the environment variable dropdown should be visible.\n */\nconst displayVariablesDropdown = computed((): boolean => {\n return (\n showDropdown.value &&\n withVariables &&\n layout !== 'modal' &&\n Boolean(environment)\n )\n})\n\n// ---------------------------------------------------------------------------\n// Keyboard event handling\n\n/**\n * Handles keyboard navigation for dropdown and form submission.\n */\nconst handleKeyDown = (key: string, event: KeyboardEvent): void => {\n if (showDropdown.value) {\n if (key === 'down' || key === 'up') {\n event.preventDefault()\n dropdownRef.value?.handleArrowKey(key)\n } else if (key === 'enter') {\n event.preventDefault()\n dropdownRef.value?.handleSelect()\n }\n return\n }\n\n if (key === 'escape' && !disableTabIndent) {\n event.stopPropagation()\n }\n\n if (key === 'enter' && event.target instanceof HTMLDivElement) {\n handleSubmit(event.target.textContent ?? '', event)\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n\ndefineExpose({\n /**\n * Focus the codemirror element\n *\n * @param cursorAtEnd boolean place the cursor at the end of the input\n */\n focus: (position?: 'start' | 'end' | number) => {\n if (!codeMirror.value) {\n return\n }\n codeMirror.value.focus()\n\n if (!isDefined(position)) {\n return\n }\n\n const anchor = (() => {\n if (position === 'start') {\n return 0\n }\n if (position === 'end') {\n return codeMirror.value.state.doc.length\n }\n return position\n })()\n\n // Move the cursor to the specified position\n codeMirror.value.dispatch({\n selection: { anchor },\n scrollIntoView: true,\n })\n },\n isFocused,\n handleChange,\n handleSubmit,\n handleBlur,\n booleanOptions,\n codeMirror,\n codeMirrorRef,\n modelValue,\n setCodeMirrorContent,\n cursorPosition: () => codeMirror.value?.state.selection.main.head,\n serializeValue,\n})\n</script>\n\n<template>\n <!-- Disabled mode: read-only text display -->\n <div\n v-if=\"disabled\"\n class=\"text-c-2 flex cursor-default items-center justify-center\"\n :class=\"{\n 'font-code pr-2 pl-1 text-base': layout === 'modal',\n 'px-2': layout !== 'modal',\n 'line-through': linethrough,\n }\"\n data-testid=\"code-input-disabled\">\n <span class=\"whitespace-nowrap\">{{ modelValue }}</span>\n </div>\n\n <!-- Enum mode: select dropdown with predefined values -->\n <DataTableInputSelect\n v-else-if=\"enumProp?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :type=\"defaultType\"\n :value=\"enumProp\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Boolean mode: select dropdown with true/false (and optionally null) -->\n <DataTableInputSelect\n v-else-if=\"isBooleanMode\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"booleanOptions\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Examples mode: select dropdown with example values -->\n <DataTableInputSelect\n v-else-if=\"examples?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"examples\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Editor mode: CodeMirror with environment variable support -->\n <div\n v-else\n :id=\"componentId\"\n v-bind=\"$attrs\"\n ref=\"codeMirrorRef\"\n class=\"group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\"\n :class=\"{\n 'line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1':\n lineWrapping,\n 'flow-code-input--error': error,\n 'line-through': linethrough,\n }\"\n @keydown.down.stop=\"handleKeyDown('down', $event)\"\n @keydown.enter=\"handleKeyDown('enter', $event)\"\n @keydown.escape=\"handleKeyDown('escape', $event)\"\n @keydown.up.stop=\"handleKeyDown('up', $event)\">\n <!-- Tab exit hint (shown when focused) -->\n <div\n v-if=\"!disableTabIndent\"\n class=\"z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block\"\n role=\"alert\">\n Press\n <kbd class=\"-mx-0.25 rounded border px-0.5 font-mono\">Esc</kbd> then\n <kbd class=\"-mx-0.25 rounded border px-0.5 font-mono\">Tab</kbd> to exit\n </div>\n </div>\n\n <!-- Warning slot (positioned absolutely) -->\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n\n <!-- Icon slot (positioned absolutely) -->\n <div\n v-if=\"$slots.icon\"\n class=\"centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1\">\n <slot name=\"icon\" />\n </div>\n\n <!-- Required indicator -->\n <div\n v-if=\"required\"\n class=\"required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0\">\n Required\n </div>\n\n <!-- Environment variable autocomplete dropdown -->\n <EnvironmentVariableDropdown\n v-if=\"displayVariablesDropdown && environment\"\n ref=\"dropdownRef\"\n :dropdownPosition=\"dropdownPosition\"\n :environment=\"environment\"\n :query=\"dropdownQuery\"\n @redirect=\"emit('navigate', { page: 'document', path: 'environment' })\"\n @select=\"handleDropdownSelect\" />\n</template>\n<style scoped>\n/*\n Deep styling for customizing Codemirror\n */\n:deep(.cm-editor) {\n height: 100%;\n outline: none;\n padding: 0;\n background: transparent;\n}\n:deep(.cm-placeholder) {\n color: var(--scalar-color-3);\n}\n:deep(.cm-content) {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-small);\n max-height: 20px;\n padding: 8px 0;\n}\n/* Tooltip helper */\n:deep(.cm-tooltip) {\n background: transparent !important;\n filter: brightness(var(--scalar-lifted-brightness));\n border-radius: var(--scalar-radius);\n box-shadow: var(--scalar-shadow-2);\n border: none !important;\n outline: none !important;\n overflow: hidden !important;\n}\n:deep(.cm-tooltip-autocomplete ul li) {\n padding: 3px 6px !important;\n}\n:deep(.cm-completionIcon-type:after) {\n color: var(--scalar-color-3) !important;\n}\n:deep(.cm-tooltip-autocomplete ul li[aria-selected]) {\n background: var(--scalar-background-2) !important;\n color: var(--scalar-color-1) !important;\n}\n:deep(.cm-tooltip-autocomplete ul) {\n padding: 6px !important;\n position: relative;\n}\n:deep(.cm-tooltip-autocomplete ul li:hover) {\n border-radius: 3px;\n color: var(--scalar-color-1) !important;\n background: var(--scalar-background-3) !important;\n}\n/* Disable active line highlighting */\n:deep(.cm-activeLine),\n:deep(.cm-activeLineGutter) {\n background-color: transparent;\n}\n/* Color selection matching */\n:deep(.cm-selectionMatch),\n:deep(.cm-matchingBracket) {\n border-radius: var(--scalar-radius);\n background: var(--scalar-background-4) !important;\n}\n/* Color Picker Swatches */\n:deep(.cm-css-color-picker-wrapper) {\n display: inline-flex;\n outline: 1px solid var(--scalar-background-3);\n border-radius: 3px;\n overflow: hidden;\n}\n/* Number gutter */\n:deep(.cm-gutters) {\n background-color: transparent;\n border-right: none;\n color: var(--scalar-color-3);\n font-size: var(--scalar-small);\n line-height: 22px;\n border-radius: 0 0 0 3px;\n}\n:deep(.cm-gutters:before) {\n content: '';\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(100% - 2px);\n height: calc(100% - 4px);\n border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);\n background-color: var(--scalar-background-1);\n}\n:deep(.cm-gutterElement) {\n font-family: var(--scalar-font-code) !important;\n padding-left: 0px !important;\n padding-right: 6px !important;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n position: relative;\n}\n:deep(.cm-lineNumbers .cm-gutterElement) {\n min-width: fit-content;\n}\n:deep(.cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement) {\n padding-left: 0 !important;\n}\n:deep(.cm-scroller) {\n overflow: auto;\n}\n.line-wrapping:focus-within :deep(.cm-content) {\n display: inline-table;\n min-height: fit-content;\n padding: 3px 6px;\n white-space: break-spaces;\n word-break: break-all;\n}\n</style>\n<style>\n.cm-pill {\n color: var(--scalar-color-1) !important;\n padding: 0px 9px;\n border-radius: 3px;\n display: inline-block;\n border-radius: 30px;\n font-size: var(--scalar-small);\n}\n.light-mode .cm-pill {\n background: var(--scalar-background-3) !important;\n}\n.dark-mode .cm-pill {\n background: color-mix(in srgb, var(--tw-bg-base), transparent 90%) !important;\n}\n.cm-pill:first-of-type {\n margin-left: 0;\n}\n.cm-editor .cm-widgetBuffer {\n display: none;\n}\n.cm-foldPlaceholder:hover {\n color: var(--scalar-color-1);\n}\n.cm-foldGutter .cm-gutterElement {\n font-size: var(--scalar-heading-4);\n padding: 2px !important;\n}\n.cm-foldGutter .cm-gutterElement:first-of-type {\n display: none;\n}\n.cm-foldGutter .cm-gutterElement .cm-foldMarker {\n padding: 2px;\n padding-top: 2px;\n}\n.cm-foldGutter .cm-gutterElement:hover .cm-foldMarker {\n background: var(--scalar-background-2);\n border-radius: var(--scalar-radius);\n color: var(--scalar-color-1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4GhB,MAAM,OAAO;EAUb,MAAM,QAAQ,UAAU;EACxB,MAAM,cAAc,MAAM,MAAM,MAAM,QAAQ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AAA,MAAA;MAAA,MAAA;MAAA,CAAA;KACd,UAAQ,MAAA,qBAAoB"}
@@ -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 : "2.39.4";
3
+ var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "2.41.0";
4
4
  //#endregion
5
5
  export { APP_VERSION };
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AAsQA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAY7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAA;AAMxG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK3C;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;YAER,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;IACjD,+FAA+F;4BACvE,0BAA0B;;;;YAL1C,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;IACjD,+FAA+F;4BACvE,0BAA0B;;IAYlD;;;OAGG;4BACqB,MAAM,OAAO;IACrC;;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V,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.js","names":[],"sources":["../../../../src/v2/features/app/App.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Main entry point for the API client for electron and web.\n *\n * This component handles all events and store business logic for the application.\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarTeleportRoot,\n useModal,\n type ModalState,\n} from '@scalar/components'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport { extensions } from '@scalar/workspace-store/schemas/extensions'\nimport { computed, toValue } from 'vue'\nimport { RouterView } from 'vue-router'\n\nimport { mergeSecurity } from '@/v2/blocks/scalar-auth-selector-block'\nimport { SidebarToggle } from '@/v2/components/sidebar'\nimport CreateWorkspaceModal from '@/v2/features/app/components/CreateWorkspaceModal.vue'\nimport SplashScreen from '@/v2/features/app/components/SplashScreen.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { useDocumentWatcher } from '@/v2/features/app/hooks/use-document-watcher'\nimport type { CommandPaletteState } from '@/v2/features/command-palette/hooks/use-command-palette-state'\nimport TheCommandPalette from '@/v2/features/command-palette/TheCommandPalette.vue'\nimport { useMonacoEditorConfiguration } from '@/v2/features/editor'\nimport { useColorMode } from '@/v2/hooks/use-color-mode'\nimport { useGlobalHotKeys } from '@/v2/hooks/use-global-hot-keys'\nimport { usePosthog } from '@/v2/posthog'\nimport type { ImportDocumentFromRegistry } from '@/v2/types/configuration'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport { type AppState } from './app-state'\nimport AppSidebar from './components/AppSidebar.vue'\nimport DesktopTabs from './components/DesktopTabs.vue'\n\nconst {\n layout,\n plugins = [],\n getAppState,\n getCommandPaletteState,\n fetchRegistryDocument,\n} = defineProps<{\n layout: Exclude<ClientLayout, 'modal'>\n plugins?: ClientPlugin[]\n getAppState: () => AppState\n getCommandPaletteState: () => CommandPaletteState\n /** Fetches the full document from registry by meta. Passed through to route props for sync. */\n fetchRegistryDocument?: ImportDocumentFromRegistry\n}>()\n\ndefineSlots<{\n /**\n * Slot for customizing the actions section of the sidebar menu.\n * This slot is used to render custom actions or components within the actions section.\n */\n 'sidebar-menu-actions': () => unknown\n /**\n * Slot for customizing the create workspace modal.\n * This slot is used to render custom actions or components within the create workspace modal.\n */\n 'create-workspace'?: (payload: { state: ModalState }) => unknown\n}>()\n\ndefineExpose({\n openCreateWorkspace: () => createWorkspaceModalState.show(),\n})\n\nconst app = getAppState()\nconst paletteState = getCommandPaletteState()\n\n/** Expose workspace store to window for debugging purposes. */\nif (typeof window !== 'undefined') {\n window.dataDumpWorkspace = () => app.store.value\n window.dumpAppState = () => app\n}\n\nusePosthog(app.telemetry)\n\n/** Register global hotkeys for the app, passing the workspace event bus and layout state */\nuseGlobalHotKeys(app.eventBus, layout)\n\nconst DEFAULT_DOCUMENT_WATCH_TIMEOUT = 5000\n\n/** Watch the active document for changes and rebase it with its remote source */\nuseDocumentWatcher({\n documentName: () =>\n app.store.value?.workspace[extensions.workspace.activeDocument],\n store: app.store,\n initialTimeout: DEFAULT_DOCUMENT_WATCH_TIMEOUT,\n})\n\n/** Color mode */\nuseColorMode({ workspaceStore: app.store })\n\nconst currentTheme = computed(() => app.theme.styles.value.themeStyles)\nconst isDarkMode = computed(() => app.isDarkMode.value)\n\n/** Setup monaco editor configuration */\nuseMonacoEditorConfiguration({\n theme: currentTheme,\n darkMode: isDarkMode,\n})\n\nconst navigateToWorkspaceOverview = (namespace?: string, slug?: string) => {\n app.eventBus.emit('ui:navigate', {\n page: 'workspace',\n path: 'environment',\n namespace,\n workspaceSlug: slug,\n })\n}\n\n/** Sets the active workspace by ID: finds the workspace in the list and updates app state & navigation. */\nconst setActiveWorkspace = (id?: string) => {\n if (!id) {\n return\n }\n const workspace = app.workspace.workspaceList.value?.find(\n (workspace) => workspace.id === id,\n )\n if (!workspace) {\n return\n }\n\n navigateToWorkspaceOverview(workspace.namespace, workspace.slug)\n}\n\nconst createWorkspaceModalState = useModal()\n\n/** Props to pass to the RouterView component. */\nconst routerViewProps = computed<RouteProps>(() => {\n /** Ensure we have the auth store */\n const securitySchemes = app.store.value?.auth\n ? mergeSecurity(\n app.document.value?.components?.securitySchemes ?? {},\n {},\n app.store.value.auth,\n app.activeEntities.documentSlug.value ?? '',\n )\n : {}\n\n return {\n documentSlug: app.activeEntities.documentSlug.value ?? '',\n document: app.store.value?.workspace.activeDocument ?? null,\n environment: app.environment.value,\n eventBus: app.eventBus,\n exampleName: app.activeEntities.exampleName.value,\n fetchRegistryDocument,\n layout,\n method: app.activeEntities.method.value,\n path: app.activeEntities.path.value,\n workspaceStore: app.store.value!,\n activeWorkspace: app.workspace.activeWorkspace.value!,\n plugins,\n securitySchemes,\n isDarkMode: app.isDarkMode.value,\n currentTheme: app.theme.styles.value.themeStyles,\n customThemes: toValue(app.theme.customThemes),\n telemetry: app.telemetry.value,\n onUpdateTelemetry: (value: boolean) => {\n app.telemetry.value = value\n },\n }\n})\n</script>\n\n<template>\n <ScalarTeleportRoot>\n <!-- Theme style tag -->\n <div v-html=\"app.theme.themeStyleTag.value\" />\n\n <!-- Toasts -->\n <ScalarToasts />\n\n <!-- Main content -->\n <main\n v-if=\"\n app.store.value !== null &&\n app.workspace.activeWorkspace.value !== null &&\n !app.loading.value\n \">\n <div class=\"relative flex h-dvh w-dvw flex-1 flex-col\">\n <SidebarToggle\n v-model=\"app.sidebar.isOpen.value\"\n class=\"absolute top-4 left-3 z-[60] md:hidden\" />\n <div class=\"flex min-h-0 flex-1 flex-row\">\n <!-- App sidebar -->\n <AppSidebar\n v-model:isSidebarOpen=\"app.sidebar.isOpen.value\"\n :activeWorkspace=\"app.workspace.activeWorkspace.value\"\n :eventBus=\"app.eventBus\"\n :isWorkspaceOpen=\"app.workspace.isOpen.value\"\n :layout\n :sidebarState=\"app.sidebar.state\"\n :sidebarWidth=\"app.sidebar.width.value\"\n :store=\"app.store.value!\"\n :workspaces=\"app.workspace.workspaceGroups.value\"\n @click:workspace=\"navigateToWorkspaceOverview\"\n @create:workspace=\"createWorkspaceModalState.show()\"\n @select:workspace=\"setActiveWorkspace\"\n @selectItem=\"app.sidebar.handleSelectItem\"\n @update:sidebarWidth=\"app.sidebar.handleSidebarWidthUpdate\">\n <template #sidebarMenuActions>\n <slot name=\"sidebar-menu-actions\" />\n </template>\n </AppSidebar>\n\n <div class=\"flex flex-1 flex-col\">\n <!-- App Tabs -->\n <DesktopTabs\n v-if=\"layout === 'desktop'\"\n :activeTabIndex=\"app.tabs.activeTabIndex.value\"\n :eventBus=\"app.eventBus\"\n :tabs=\"app.tabs.state.value\" />\n\n <!-- Router view min-h-0 is required for scrolling, do not remove it -->\n <div class=\"bg-b-1 min-h-0 flex-1\">\n <RouterView v-bind=\"routerViewProps\" />\n </div>\n </div>\n </div>\n </div>\n\n <slot\n name=\"create-workspace\"\n :state=\"createWorkspaceModalState\">\n <!-- Create workspace modal -->\n <CreateWorkspaceModal\n :state=\"createWorkspaceModalState\"\n @create:workspace=\"(payload) => app.workspace.create(payload)\" />\n </slot>\n\n <!-- Popup command palette to add resources from anywhere -->\n <TheCommandPalette\n :eventBus=\"app.eventBus\"\n :paletteState=\"paletteState\"\n :workspaceStore=\"app.store.value!\" />\n </main>\n <!-- Splash screen -->\n <main v-else>\n <SplashScreen />\n </main>\n </ScalarTeleportRoot>\n</template>\n\n<style>\n#scalar-client {\n position: relative;\n background-color: var(--scalar-background-2);\n}\n.dark-mode #scalar-client {\n background-color: color-mix(in srgb, var(--scalar-background-1) 65%, black);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"App.vue.js","names":[],"sources":["../../../../src/v2/features/app/App.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Main entry point for the API client for electron and web.\n *\n * This component handles all events and store business logic for the application.\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarTeleportRoot,\n useModal,\n type ModalState,\n} from '@scalar/components'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport { extensions } from '@scalar/workspace-store/schemas/extensions'\nimport { computed, toValue } from 'vue'\nimport { RouterView } from 'vue-router'\n\nimport { SidebarToggle } from '@/v2/components/sidebar'\nimport CreateWorkspaceModal from '@/v2/features/app/components/CreateWorkspaceModal.vue'\nimport SplashScreen from '@/v2/features/app/components/SplashScreen.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { useDocumentWatcher } from '@/v2/features/app/hooks/use-document-watcher'\nimport type { CommandPaletteState } from '@/v2/features/command-palette/hooks/use-command-palette-state'\nimport TheCommandPalette from '@/v2/features/command-palette/TheCommandPalette.vue'\nimport { useMonacoEditorConfiguration } from '@/v2/features/editor'\nimport { useColorMode } from '@/v2/hooks/use-color-mode'\nimport { useGlobalHotKeys } from '@/v2/hooks/use-global-hot-keys'\nimport { usePosthog } from '@/v2/posthog'\nimport type { ImportDocumentFromRegistry } from '@/v2/types/configuration'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport { type AppState } from './app-state'\nimport AppSidebar from './components/AppSidebar.vue'\nimport DesktopTabs from './components/DesktopTabs.vue'\n\nconst {\n layout,\n plugins = [],\n getAppState,\n getCommandPaletteState,\n fetchRegistryDocument,\n} = defineProps<{\n layout: Exclude<ClientLayout, 'modal'>\n plugins?: ClientPlugin[]\n getAppState: () => AppState\n getCommandPaletteState: () => CommandPaletteState\n /** Fetches the full document from registry by meta. Passed through to route props for sync. */\n fetchRegistryDocument?: ImportDocumentFromRegistry\n}>()\n\ndefineSlots<{\n /**\n * Slot for customizing the actions section of the sidebar menu.\n * This slot is used to render custom actions or components within the actions section.\n */\n 'sidebar-menu-actions': () => unknown\n /**\n * Slot for customizing the create workspace modal.\n * This slot is used to render custom actions or components within the create workspace modal.\n */\n 'create-workspace'?: (payload: { state: ModalState }) => unknown\n}>()\n\ndefineExpose({\n openCreateWorkspace: () => createWorkspaceModalState.show(),\n})\n\nconst app = getAppState()\nconst paletteState = getCommandPaletteState()\n\n/** Expose workspace store to window for debugging purposes. */\nif (typeof window !== 'undefined') {\n window.dataDumpWorkspace = () => app.store.value\n window.dumpAppState = () => app\n}\n\nusePosthog(app.telemetry)\n\n/** Register global hotkeys for the app, passing the workspace event bus and layout state */\nuseGlobalHotKeys(app.eventBus, layout)\n\nconst DEFAULT_DOCUMENT_WATCH_TIMEOUT = 5000\n\n/** Watch the active document for changes and rebase it with its remote source */\nuseDocumentWatcher({\n documentName: () =>\n app.store.value?.workspace[extensions.workspace.activeDocument],\n store: app.store,\n initialTimeout: DEFAULT_DOCUMENT_WATCH_TIMEOUT,\n})\n\n/** Color mode */\nuseColorMode({ workspaceStore: app.store })\n\nconst currentTheme = computed(() => app.theme.styles.value.themeStyles)\nconst isDarkMode = computed(() => app.isDarkMode.value)\n\n/** Setup monaco editor configuration */\nuseMonacoEditorConfiguration({\n theme: currentTheme,\n darkMode: isDarkMode,\n})\n\nconst navigateToWorkspaceOverview = (namespace?: string, slug?: string) => {\n app.eventBus.emit('ui:navigate', {\n page: 'workspace',\n path: 'environment',\n namespace,\n workspaceSlug: slug,\n })\n}\n\n/** Sets the active workspace by ID: finds the workspace in the list and updates app state & navigation. */\nconst setActiveWorkspace = (id?: string) => {\n if (!id) {\n return\n }\n const workspace = app.workspace.workspaceList.value?.find(\n (workspace) => workspace.id === id,\n )\n if (!workspace) {\n return\n }\n\n navigateToWorkspaceOverview(workspace.namespace, workspace.slug)\n}\n\nconst createWorkspaceModalState = useModal()\n\n/** Props to pass to the RouterView component. */\nconst routerViewProps = computed<RouteProps>(() => {\n return {\n documentSlug: app.activeEntities.documentSlug.value ?? '',\n document: app.store.value?.workspace.activeDocument ?? null,\n environment: app.environment.value,\n eventBus: app.eventBus,\n exampleName: app.activeEntities.exampleName.value,\n fetchRegistryDocument,\n layout,\n method: app.activeEntities.method.value,\n path: app.activeEntities.path.value,\n workspaceStore: app.store.value!,\n activeWorkspace: app.workspace.activeWorkspace.value!,\n plugins,\n isDarkMode: app.isDarkMode.value,\n currentTheme: app.theme.styles.value.themeStyles,\n customThemes: toValue(app.theme.customThemes),\n telemetry: app.telemetry.value,\n onUpdateTelemetry: (value: boolean) => {\n app.telemetry.value = value\n },\n }\n})\n</script>\n\n<template>\n <ScalarTeleportRoot>\n <!-- Theme style tag -->\n <div v-html=\"app.theme.themeStyleTag.value\" />\n\n <!-- Toasts -->\n <ScalarToasts />\n\n <!-- Main content -->\n <main\n v-if=\"\n app.store.value !== null &&\n app.workspace.activeWorkspace.value !== null &&\n !app.loading.value\n \">\n <div class=\"relative flex h-dvh w-dvw flex-1 flex-col\">\n <SidebarToggle\n v-model=\"app.sidebar.isOpen.value\"\n class=\"absolute top-4 left-3 z-[60] md:hidden\" />\n <div class=\"flex min-h-0 flex-1 flex-row\">\n <!-- App sidebar -->\n <AppSidebar\n v-model:isSidebarOpen=\"app.sidebar.isOpen.value\"\n :activeWorkspace=\"app.workspace.activeWorkspace.value\"\n :eventBus=\"app.eventBus\"\n :isWorkspaceOpen=\"app.workspace.isOpen.value\"\n :layout\n :sidebarState=\"app.sidebar.state\"\n :sidebarWidth=\"app.sidebar.width.value\"\n :store=\"app.store.value!\"\n :workspaces=\"app.workspace.workspaceGroups.value\"\n @click:workspace=\"navigateToWorkspaceOverview\"\n @create:workspace=\"createWorkspaceModalState.show()\"\n @select:workspace=\"setActiveWorkspace\"\n @selectItem=\"app.sidebar.handleSelectItem\"\n @update:sidebarWidth=\"app.sidebar.handleSidebarWidthUpdate\">\n <template #sidebarMenuActions>\n <slot name=\"sidebar-menu-actions\" />\n </template>\n </AppSidebar>\n\n <div class=\"flex flex-1 flex-col\">\n <!-- App Tabs -->\n <DesktopTabs\n v-if=\"layout === 'desktop'\"\n :activeTabIndex=\"app.tabs.activeTabIndex.value\"\n :eventBus=\"app.eventBus\"\n :tabs=\"app.tabs.state.value\" />\n\n <!-- Router view min-h-0 is required for scrolling, do not remove it -->\n <div class=\"bg-b-1 relative min-h-0 flex-1\">\n <RouterView v-bind=\"routerViewProps\" />\n </div>\n </div>\n </div>\n </div>\n\n <slot\n name=\"create-workspace\"\n :state=\"createWorkspaceModalState\">\n <!-- Create workspace modal -->\n <CreateWorkspaceModal\n :state=\"createWorkspaceModalState\"\n @create:workspace=\"(payload) => app.workspace.create(payload)\" />\n </slot>\n\n <!-- Popup command palette to add resources from anywhere -->\n <TheCommandPalette\n :eventBus=\"app.eventBus\"\n :paletteState=\"paletteState\"\n :workspaceStore=\"app.store.value!\" />\n </main>\n <!-- Splash screen -->\n <main v-else>\n <SplashScreen />\n </main>\n </ScalarTeleportRoot>\n</template>\n\n<style>\n#scalar-client {\n position: relative;\n background-color: var(--scalar-background-2);\n}\n.dark-mode #scalar-client {\n background-color: color-mix(in srgb, var(--scalar-background-1) 65%, black);\n}\n</style>\n"],"mappings":""}
@@ -1,4 +1,3 @@
1
- import { mergeSecurity } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
2
1
  import SidebarToggle_default from "../../components/sidebar/SidebarToggle.vue.js";
3
2
  import CreateWorkspaceModal_default from "./components/CreateWorkspaceModal.vue.js";
4
3
  import SplashScreen_default from "./components/SplashScreen.vue.js";
@@ -21,7 +20,7 @@ var _hoisted_2 = { key: 0 };
21
20
  var _hoisted_3 = { class: "relative flex h-dvh w-dvw flex-1 flex-col" };
22
21
  var _hoisted_4 = { class: "flex min-h-0 flex-1 flex-row" };
23
22
  var _hoisted_5 = { class: "flex flex-1 flex-col" };
24
- var _hoisted_6 = { class: "bg-b-1 min-h-0 flex-1" };
23
+ var _hoisted_6 = { class: "bg-b-1 relative min-h-0 flex-1" };
25
24
  var _hoisted_7 = { key: 1 };
26
25
  var App_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
27
26
  __name: "App",
@@ -75,8 +74,6 @@ var App_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
75
74
  const createWorkspaceModalState = useModal();
76
75
  /** Props to pass to the RouterView component. */
77
76
  const routerViewProps = computed(() => {
78
- /** Ensure we have the auth store */
79
- const securitySchemes = app.store.value?.auth ? mergeSecurity(app.document.value?.components?.securitySchemes ?? {}, {}, app.store.value.auth, app.activeEntities.documentSlug.value ?? "") : {};
80
77
  return {
81
78
  documentSlug: app.activeEntities.documentSlug.value ?? "",
82
79
  document: app.store.value?.workspace.activeDocument ?? null,
@@ -90,7 +87,6 @@ var App_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
90
87
  workspaceStore: app.store.value,
91
88
  activeWorkspace: app.workspace.activeWorkspace.value,
92
89
  plugins: __props.plugins,
93
- securitySchemes,
94
90
  isDarkMode: app.isDarkMode.value,
95
91
  currentTheme: app.theme.styles.value.themeStyles,
96
92
  customThemes: toValue(app.theme.customThemes),
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.script.js","names":[],"sources":["../../../../src/v2/features/app/App.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Main entry point for the API client for electron and web.\n *\n * This component handles all events and store business logic for the application.\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarTeleportRoot,\n useModal,\n type ModalState,\n} from '@scalar/components'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport { extensions } from '@scalar/workspace-store/schemas/extensions'\nimport { computed, toValue } from 'vue'\nimport { RouterView } from 'vue-router'\n\nimport { mergeSecurity } from '@/v2/blocks/scalar-auth-selector-block'\nimport { SidebarToggle } from '@/v2/components/sidebar'\nimport CreateWorkspaceModal from '@/v2/features/app/components/CreateWorkspaceModal.vue'\nimport SplashScreen from '@/v2/features/app/components/SplashScreen.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { useDocumentWatcher } from '@/v2/features/app/hooks/use-document-watcher'\nimport type { CommandPaletteState } from '@/v2/features/command-palette/hooks/use-command-palette-state'\nimport TheCommandPalette from '@/v2/features/command-palette/TheCommandPalette.vue'\nimport { useMonacoEditorConfiguration } from '@/v2/features/editor'\nimport { useColorMode } from '@/v2/hooks/use-color-mode'\nimport { useGlobalHotKeys } from '@/v2/hooks/use-global-hot-keys'\nimport { usePosthog } from '@/v2/posthog'\nimport type { ImportDocumentFromRegistry } from '@/v2/types/configuration'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport { type AppState } from './app-state'\nimport AppSidebar from './components/AppSidebar.vue'\nimport DesktopTabs from './components/DesktopTabs.vue'\n\nconst {\n layout,\n plugins = [],\n getAppState,\n getCommandPaletteState,\n fetchRegistryDocument,\n} = defineProps<{\n layout: Exclude<ClientLayout, 'modal'>\n plugins?: ClientPlugin[]\n getAppState: () => AppState\n getCommandPaletteState: () => CommandPaletteState\n /** Fetches the full document from registry by meta. Passed through to route props for sync. */\n fetchRegistryDocument?: ImportDocumentFromRegistry\n}>()\n\ndefineSlots<{\n /**\n * Slot for customizing the actions section of the sidebar menu.\n * This slot is used to render custom actions or components within the actions section.\n */\n 'sidebar-menu-actions': () => unknown\n /**\n * Slot for customizing the create workspace modal.\n * This slot is used to render custom actions or components within the create workspace modal.\n */\n 'create-workspace'?: (payload: { state: ModalState }) => unknown\n}>()\n\ndefineExpose({\n openCreateWorkspace: () => createWorkspaceModalState.show(),\n})\n\nconst app = getAppState()\nconst paletteState = getCommandPaletteState()\n\n/** Expose workspace store to window for debugging purposes. */\nif (typeof window !== 'undefined') {\n window.dataDumpWorkspace = () => app.store.value\n window.dumpAppState = () => app\n}\n\nusePosthog(app.telemetry)\n\n/** Register global hotkeys for the app, passing the workspace event bus and layout state */\nuseGlobalHotKeys(app.eventBus, layout)\n\nconst DEFAULT_DOCUMENT_WATCH_TIMEOUT = 5000\n\n/** Watch the active document for changes and rebase it with its remote source */\nuseDocumentWatcher({\n documentName: () =>\n app.store.value?.workspace[extensions.workspace.activeDocument],\n store: app.store,\n initialTimeout: DEFAULT_DOCUMENT_WATCH_TIMEOUT,\n})\n\n/** Color mode */\nuseColorMode({ workspaceStore: app.store })\n\nconst currentTheme = computed(() => app.theme.styles.value.themeStyles)\nconst isDarkMode = computed(() => app.isDarkMode.value)\n\n/** Setup monaco editor configuration */\nuseMonacoEditorConfiguration({\n theme: currentTheme,\n darkMode: isDarkMode,\n})\n\nconst navigateToWorkspaceOverview = (namespace?: string, slug?: string) => {\n app.eventBus.emit('ui:navigate', {\n page: 'workspace',\n path: 'environment',\n namespace,\n workspaceSlug: slug,\n })\n}\n\n/** Sets the active workspace by ID: finds the workspace in the list and updates app state & navigation. */\nconst setActiveWorkspace = (id?: string) => {\n if (!id) {\n return\n }\n const workspace = app.workspace.workspaceList.value?.find(\n (workspace) => workspace.id === id,\n )\n if (!workspace) {\n return\n }\n\n navigateToWorkspaceOverview(workspace.namespace, workspace.slug)\n}\n\nconst createWorkspaceModalState = useModal()\n\n/** Props to pass to the RouterView component. */\nconst routerViewProps = computed<RouteProps>(() => {\n /** Ensure we have the auth store */\n const securitySchemes = app.store.value?.auth\n ? mergeSecurity(\n app.document.value?.components?.securitySchemes ?? {},\n {},\n app.store.value.auth,\n app.activeEntities.documentSlug.value ?? '',\n )\n : {}\n\n return {\n documentSlug: app.activeEntities.documentSlug.value ?? '',\n document: app.store.value?.workspace.activeDocument ?? null,\n environment: app.environment.value,\n eventBus: app.eventBus,\n exampleName: app.activeEntities.exampleName.value,\n fetchRegistryDocument,\n layout,\n method: app.activeEntities.method.value,\n path: app.activeEntities.path.value,\n workspaceStore: app.store.value!,\n activeWorkspace: app.workspace.activeWorkspace.value!,\n plugins,\n securitySchemes,\n isDarkMode: app.isDarkMode.value,\n currentTheme: app.theme.styles.value.themeStyles,\n customThemes: toValue(app.theme.customThemes),\n telemetry: app.telemetry.value,\n onUpdateTelemetry: (value: boolean) => {\n app.telemetry.value = value\n },\n }\n})\n</script>\n\n<template>\n <ScalarTeleportRoot>\n <!-- Theme style tag -->\n <div v-html=\"app.theme.themeStyleTag.value\" />\n\n <!-- Toasts -->\n <ScalarToasts />\n\n <!-- Main content -->\n <main\n v-if=\"\n app.store.value !== null &&\n app.workspace.activeWorkspace.value !== null &&\n !app.loading.value\n \">\n <div class=\"relative flex h-dvh w-dvw flex-1 flex-col\">\n <SidebarToggle\n v-model=\"app.sidebar.isOpen.value\"\n class=\"absolute top-4 left-3 z-[60] md:hidden\" />\n <div class=\"flex min-h-0 flex-1 flex-row\">\n <!-- App sidebar -->\n <AppSidebar\n v-model:isSidebarOpen=\"app.sidebar.isOpen.value\"\n :activeWorkspace=\"app.workspace.activeWorkspace.value\"\n :eventBus=\"app.eventBus\"\n :isWorkspaceOpen=\"app.workspace.isOpen.value\"\n :layout\n :sidebarState=\"app.sidebar.state\"\n :sidebarWidth=\"app.sidebar.width.value\"\n :store=\"app.store.value!\"\n :workspaces=\"app.workspace.workspaceGroups.value\"\n @click:workspace=\"navigateToWorkspaceOverview\"\n @create:workspace=\"createWorkspaceModalState.show()\"\n @select:workspace=\"setActiveWorkspace\"\n @selectItem=\"app.sidebar.handleSelectItem\"\n @update:sidebarWidth=\"app.sidebar.handleSidebarWidthUpdate\">\n <template #sidebarMenuActions>\n <slot name=\"sidebar-menu-actions\" />\n </template>\n </AppSidebar>\n\n <div class=\"flex flex-1 flex-col\">\n <!-- App Tabs -->\n <DesktopTabs\n v-if=\"layout === 'desktop'\"\n :activeTabIndex=\"app.tabs.activeTabIndex.value\"\n :eventBus=\"app.eventBus\"\n :tabs=\"app.tabs.state.value\" />\n\n <!-- Router view min-h-0 is required for scrolling, do not remove it -->\n <div class=\"bg-b-1 min-h-0 flex-1\">\n <RouterView v-bind=\"routerViewProps\" />\n </div>\n </div>\n </div>\n </div>\n\n <slot\n name=\"create-workspace\"\n :state=\"createWorkspaceModalState\">\n <!-- Create workspace modal -->\n <CreateWorkspaceModal\n :state=\"createWorkspaceModalState\"\n @create:workspace=\"(payload) => app.workspace.create(payload)\" />\n </slot>\n\n <!-- Popup command palette to add resources from anywhere -->\n <TheCommandPalette\n :eventBus=\"app.eventBus\"\n :paletteState=\"paletteState\"\n :workspaceStore=\"app.store.value!\" />\n </main>\n <!-- Splash screen -->\n <main v-else>\n <SplashScreen />\n </main>\n </ScalarTeleportRoot>\n</template>\n\n<style>\n#scalar-client {\n position: relative;\n background-color: var(--scalar-background-2);\n}\n.dark-mode #scalar-client {\n background-color: color-mix(in srgb, var(--scalar-background-1) 65%, black);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,WAAa,EACX,2BAA2B,0BAA0B,MAAM,EAC5D,CAAA;EAED,MAAM,MAAM,QAAA,aAAY;EACxB,MAAM,eAAe,QAAA,wBAAuB;;AAG5C,MAAI,OAAO,WAAW,aAAa;AACjC,UAAO,0BAA0B,IAAI,MAAM;AAC3C,UAAO,qBAAqB;;AAG9B,aAAW,IAAI,UAAS;;AAGxB,mBAAiB,IAAI,UAAU,QAAA,OAAM;;AAKrC,qBAAmB;GACjB,oBACE,IAAI,MAAM,OAAO,UAAU,WAAW,UAAU;GAClD,OAAO,IAAI;GACX,gBAPqC;GAQtC,CAAA;;AAGD,eAAa,EAAE,gBAAgB,IAAI,OAAO,CAAA;;AAM1C,+BAA6B;GAC3B,OALmB,eAAe,IAAI,MAAM,OAAO,MAAM,YAAW;GAMpE,UALiB,eAAe,IAAI,WAAW,MAAK;GAMrD,CAAA;EAED,MAAM,+BAA+B,WAAoB,SAAkB;AACzE,OAAI,SAAS,KAAK,eAAe;IAC/B,MAAM;IACN,MAAM;IACN;IACA,eAAe;IAChB,CAAA;;;EAIH,MAAM,sBAAsB,OAAgB;AAC1C,OAAI,CAAC,GACH;GAEF,MAAM,YAAY,IAAI,UAAU,cAAc,OAAO,MAClD,cAAc,UAAU,OAAO,GAClC;AACA,OAAI,CAAC,UACH;AAGF,+BAA4B,UAAU,WAAW,UAAU,KAAI;;EAGjE,MAAM,4BAA4B,UAAS;;EAG3C,MAAM,kBAAkB,eAA2B;;GAEjD,MAAM,kBAAkB,IAAI,MAAM,OAAO,OACrC,cACE,IAAI,SAAS,OAAO,YAAY,mBAAmB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,MAAA,IAAG,CAAC,MAAM;;;;;;yBAG/B,mBAEO,QAAA,YAAA,CADL,YAAgB,qBAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"App.vue.script.js","names":[],"sources":["../../../../src/v2/features/app/App.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Main entry point for the API client for electron and web.\n *\n * This component handles all events and store business logic for the application.\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarTeleportRoot,\n useModal,\n type ModalState,\n} from '@scalar/components'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport { extensions } from '@scalar/workspace-store/schemas/extensions'\nimport { computed, toValue } from 'vue'\nimport { RouterView } from 'vue-router'\n\nimport { SidebarToggle } from '@/v2/components/sidebar'\nimport CreateWorkspaceModal from '@/v2/features/app/components/CreateWorkspaceModal.vue'\nimport SplashScreen from '@/v2/features/app/components/SplashScreen.vue'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { useDocumentWatcher } from '@/v2/features/app/hooks/use-document-watcher'\nimport type { CommandPaletteState } from '@/v2/features/command-palette/hooks/use-command-palette-state'\nimport TheCommandPalette from '@/v2/features/command-palette/TheCommandPalette.vue'\nimport { useMonacoEditorConfiguration } from '@/v2/features/editor'\nimport { useColorMode } from '@/v2/hooks/use-color-mode'\nimport { useGlobalHotKeys } from '@/v2/hooks/use-global-hot-keys'\nimport { usePosthog } from '@/v2/posthog'\nimport type { ImportDocumentFromRegistry } from '@/v2/types/configuration'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport { type AppState } from './app-state'\nimport AppSidebar from './components/AppSidebar.vue'\nimport DesktopTabs from './components/DesktopTabs.vue'\n\nconst {\n layout,\n plugins = [],\n getAppState,\n getCommandPaletteState,\n fetchRegistryDocument,\n} = defineProps<{\n layout: Exclude<ClientLayout, 'modal'>\n plugins?: ClientPlugin[]\n getAppState: () => AppState\n getCommandPaletteState: () => CommandPaletteState\n /** Fetches the full document from registry by meta. Passed through to route props for sync. */\n fetchRegistryDocument?: ImportDocumentFromRegistry\n}>()\n\ndefineSlots<{\n /**\n * Slot for customizing the actions section of the sidebar menu.\n * This slot is used to render custom actions or components within the actions section.\n */\n 'sidebar-menu-actions': () => unknown\n /**\n * Slot for customizing the create workspace modal.\n * This slot is used to render custom actions or components within the create workspace modal.\n */\n 'create-workspace'?: (payload: { state: ModalState }) => unknown\n}>()\n\ndefineExpose({\n openCreateWorkspace: () => createWorkspaceModalState.show(),\n})\n\nconst app = getAppState()\nconst paletteState = getCommandPaletteState()\n\n/** Expose workspace store to window for debugging purposes. */\nif (typeof window !== 'undefined') {\n window.dataDumpWorkspace = () => app.store.value\n window.dumpAppState = () => app\n}\n\nusePosthog(app.telemetry)\n\n/** Register global hotkeys for the app, passing the workspace event bus and layout state */\nuseGlobalHotKeys(app.eventBus, layout)\n\nconst DEFAULT_DOCUMENT_WATCH_TIMEOUT = 5000\n\n/** Watch the active document for changes and rebase it with its remote source */\nuseDocumentWatcher({\n documentName: () =>\n app.store.value?.workspace[extensions.workspace.activeDocument],\n store: app.store,\n initialTimeout: DEFAULT_DOCUMENT_WATCH_TIMEOUT,\n})\n\n/** Color mode */\nuseColorMode({ workspaceStore: app.store })\n\nconst currentTheme = computed(() => app.theme.styles.value.themeStyles)\nconst isDarkMode = computed(() => app.isDarkMode.value)\n\n/** Setup monaco editor configuration */\nuseMonacoEditorConfiguration({\n theme: currentTheme,\n darkMode: isDarkMode,\n})\n\nconst navigateToWorkspaceOverview = (namespace?: string, slug?: string) => {\n app.eventBus.emit('ui:navigate', {\n page: 'workspace',\n path: 'environment',\n namespace,\n workspaceSlug: slug,\n })\n}\n\n/** Sets the active workspace by ID: finds the workspace in the list and updates app state & navigation. */\nconst setActiveWorkspace = (id?: string) => {\n if (!id) {\n return\n }\n const workspace = app.workspace.workspaceList.value?.find(\n (workspace) => workspace.id === id,\n )\n if (!workspace) {\n return\n }\n\n navigateToWorkspaceOverview(workspace.namespace, workspace.slug)\n}\n\nconst createWorkspaceModalState = useModal()\n\n/** Props to pass to the RouterView component. */\nconst routerViewProps = computed<RouteProps>(() => {\n return {\n documentSlug: app.activeEntities.documentSlug.value ?? '',\n document: app.store.value?.workspace.activeDocument ?? null,\n environment: app.environment.value,\n eventBus: app.eventBus,\n exampleName: app.activeEntities.exampleName.value,\n fetchRegistryDocument,\n layout,\n method: app.activeEntities.method.value,\n path: app.activeEntities.path.value,\n workspaceStore: app.store.value!,\n activeWorkspace: app.workspace.activeWorkspace.value!,\n plugins,\n isDarkMode: app.isDarkMode.value,\n currentTheme: app.theme.styles.value.themeStyles,\n customThemes: toValue(app.theme.customThemes),\n telemetry: app.telemetry.value,\n onUpdateTelemetry: (value: boolean) => {\n app.telemetry.value = value\n },\n }\n})\n</script>\n\n<template>\n <ScalarTeleportRoot>\n <!-- Theme style tag -->\n <div v-html=\"app.theme.themeStyleTag.value\" />\n\n <!-- Toasts -->\n <ScalarToasts />\n\n <!-- Main content -->\n <main\n v-if=\"\n app.store.value !== null &&\n app.workspace.activeWorkspace.value !== null &&\n !app.loading.value\n \">\n <div class=\"relative flex h-dvh w-dvw flex-1 flex-col\">\n <SidebarToggle\n v-model=\"app.sidebar.isOpen.value\"\n class=\"absolute top-4 left-3 z-[60] md:hidden\" />\n <div class=\"flex min-h-0 flex-1 flex-row\">\n <!-- App sidebar -->\n <AppSidebar\n v-model:isSidebarOpen=\"app.sidebar.isOpen.value\"\n :activeWorkspace=\"app.workspace.activeWorkspace.value\"\n :eventBus=\"app.eventBus\"\n :isWorkspaceOpen=\"app.workspace.isOpen.value\"\n :layout\n :sidebarState=\"app.sidebar.state\"\n :sidebarWidth=\"app.sidebar.width.value\"\n :store=\"app.store.value!\"\n :workspaces=\"app.workspace.workspaceGroups.value\"\n @click:workspace=\"navigateToWorkspaceOverview\"\n @create:workspace=\"createWorkspaceModalState.show()\"\n @select:workspace=\"setActiveWorkspace\"\n @selectItem=\"app.sidebar.handleSelectItem\"\n @update:sidebarWidth=\"app.sidebar.handleSidebarWidthUpdate\">\n <template #sidebarMenuActions>\n <slot name=\"sidebar-menu-actions\" />\n </template>\n </AppSidebar>\n\n <div class=\"flex flex-1 flex-col\">\n <!-- App Tabs -->\n <DesktopTabs\n v-if=\"layout === 'desktop'\"\n :activeTabIndex=\"app.tabs.activeTabIndex.value\"\n :eventBus=\"app.eventBus\"\n :tabs=\"app.tabs.state.value\" />\n\n <!-- Router view min-h-0 is required for scrolling, do not remove it -->\n <div class=\"bg-b-1 relative min-h-0 flex-1\">\n <RouterView v-bind=\"routerViewProps\" />\n </div>\n </div>\n </div>\n </div>\n\n <slot\n name=\"create-workspace\"\n :state=\"createWorkspaceModalState\">\n <!-- Create workspace modal -->\n <CreateWorkspaceModal\n :state=\"createWorkspaceModalState\"\n @create:workspace=\"(payload) => app.workspace.create(payload)\" />\n </slot>\n\n <!-- Popup command palette to add resources from anywhere -->\n <TheCommandPalette\n :eventBus=\"app.eventBus\"\n :paletteState=\"paletteState\"\n :workspaceStore=\"app.store.value!\" />\n </main>\n <!-- Splash screen -->\n <main v-else>\n <SplashScreen />\n </main>\n </ScalarTeleportRoot>\n</template>\n\n<style>\n#scalar-client {\n position: relative;\n background-color: var(--scalar-background-2);\n}\n.dark-mode #scalar-client {\n background-color: color-mix(in srgb, var(--scalar-background-1) 65%, black);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,WAAa,EACX,2BAA2B,0BAA0B,MAAM,EAC5D,CAAA;EAED,MAAM,MAAM,QAAA,aAAY;EACxB,MAAM,eAAe,QAAA,wBAAuB;;AAG5C,MAAI,OAAO,WAAW,aAAa;AACjC,UAAO,0BAA0B,IAAI,MAAM;AAC3C,UAAO,qBAAqB;;AAG9B,aAAW,IAAI,UAAS;;AAGxB,mBAAiB,IAAI,UAAU,QAAA,OAAM;;AAKrC,qBAAmB;GACjB,oBACE,IAAI,MAAM,OAAO,UAAU,WAAW,UAAU;GACl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,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACrF,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD,QAwWA"}
@@ -38,7 +38,7 @@ function initializeAppEventHandlers({ eventBus, store, router, rebuildSidebar, n
38
38
  }
39
39
  });
40
40
  }
41
- payload.callback(status);
41
+ payload.callback(status, payload.blurTargetSelector);
42
42
  }
43
43
  }) },
44
44
  "operation:upsert:parameter": { onAfterExecute: (payload) => onAfterExampleCreation(payload.meta) },
@@ -1 +1 @@
1
- {"version":3,"file":"app-events.js","names":[],"sources":["../../../../src/v2/features/app/app-events.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { OperationExampleMeta, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { type ShallowRef, computed } from 'vue'\nimport { type NavigationFailure, NavigationFailureType, type Router } from 'vue-router'\n\nimport type { ScalarClientAppRouteParams } from '@/v2/features/app/helpers/routes'\nimport { initializeWorkspaceEventHandlers } from '@/v2/workspace-events'\n\nexport function initializeAppEventHandlers({\n eventBus,\n store,\n router,\n rebuildSidebar,\n navigateToCurrentTab,\n onSelectSidebarItem,\n onAfterExampleCreation,\n onCopyTabUrl,\n onToggleSidebar,\n closeSidebar,\n renameWorkspace,\n}: {\n eventBus: WorkspaceEventBus\n store: ShallowRef<WorkspaceStore | null>\n router: Router\n rebuildSidebar: (documentName?: string) => void\n navigateToCurrentTab: () => Promise<void>\n onSelectSidebarItem: (id: string) => void\n onAfterExampleCreation: (o: OperationExampleMeta & { documentName?: string }) => void\n onCopyTabUrl: (tabIndex: number) => void\n onToggleSidebar: () => void\n closeSidebar: () => void\n renameWorkspace: (name: string) => Promise<void>\n}) {\n const currentRoute = computed(() => router.currentRoute?.value)\n\n /**\n * Checks if the current route params match the specified operation meta.\n * Useful for determining if the sidebar or UI needs to be updated after changes to operations/examples.\n *\n * NOTE: It may be beneficial to compare to the active state instead of the router\n */\n const isRouteParamsMatch = ({\n documentName,\n path,\n method,\n exampleName,\n }: {\n documentName: string\n path?: string\n method?: HttpMethod\n exampleName?: string\n }) => {\n if (documentName !== undefined && documentName !== currentRoute.value?.params.documentSlug) {\n return false\n }\n if (path !== undefined && encodeURIComponent(path) !== currentRoute.value?.params.pathEncoded) {\n return false\n }\n if (method !== undefined && method !== currentRoute.value?.params.method) {\n return false\n }\n if (exampleName !== undefined && exampleName !== currentRoute.value?.params.exampleName) {\n return false\n }\n return true\n }\n\n initializeWorkspaceEventHandlers({\n eventBus,\n store,\n hooks: {\n //------------------------------------------------------------------------------------\n // Document Related Hooks\n //------------------------------------------------------------------------------------\n 'document:delete:document': {\n onAfterExecute: async (payload) => {\n // Redirect to the workspace environment page if the document was deleted\n if (currentRoute?.value?.params.documentSlug === payload.name) {\n await router.push({\n name: 'workspace.environment',\n })\n }\n },\n },\n //------------------------------------------------------------------------------------\n // Operation Related Hooks\n //------------------------------------------------------------------------------------\n 'operation:update:pathMethod': {\n onBeforeExecute: (payload) => ({\n ...payload,\n callback: async (status) => {\n // Redirect to the new example if the mutation was successful\n if (status === 'success') {\n // Rebuild the sidebar with the updated order\n rebuildSidebar(store.value?.workspace.activeDocument?.['x-scalar-navigation']?.name)\n\n await router.replace({\n name: 'example',\n params: {\n method: payload.payload.method,\n pathEncoded: encodeURIComponent(payload.payload.path),\n exampleName: currentRoute.value?.params.exampleName,\n },\n })\n }\n payload.callback(status)\n },\n }),\n },\n 'operation:upsert:parameter': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n 'operation:update:extra-parameters': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n 'operation:reload:history': {\n onAfterExecute: (payload) => onAfterExampleCreation({ ...payload.meta, exampleKey: 'draft' }),\n },\n 'operation:delete:operation': {\n onAfterExecute: async (payload) => {\n rebuildSidebar(payload.documentName)\n const {\n documentName,\n meta: { path, method },\n } = payload\n // Navigate to the document overview page if the operation was deleted\n if (\n isRouteParamsMatch({\n documentName,\n path,\n method,\n })\n ) {\n await router.replace({\n name: 'document.overview',\n params: {\n documentSlug: documentName,\n },\n })\n }\n },\n },\n 'operation:create:draft-example': {\n onAfterExecute: async (payload) => {\n onAfterExampleCreation({ ...payload.meta, exampleKey: payload.exampleName })\n await router.push({\n name: 'example',\n params: {\n documentSlug: payload.documentName,\n pathEncoded: encodeURIComponent(payload.meta.path),\n method: payload.meta.method,\n exampleName: payload.exampleName,\n },\n })\n },\n },\n 'operation:delete:example': {\n onAfterExecute: async (payload) => {\n rebuildSidebar(payload.documentName)\n\n const {\n documentName,\n meta: { path, method, exampleKey },\n } = payload\n // Navigate to the default example if the example was deleted\n if (\n isRouteParamsMatch({\n documentName,\n path,\n method,\n exampleName: exampleKey,\n })\n ) {\n await router.replace({\n name: 'example',\n params: {\n pathEncoded: encodeURIComponent(path),\n method,\n documentSlug: documentName,\n exampleName: 'default',\n },\n })\n }\n },\n },\n 'operation:rename:example': {\n onAfterExecute: async ({ meta, payload, documentName }) => {\n // Refresh sidebar\n onAfterExampleCreation({ ...meta, exampleKey: payload.name, documentName })\n\n // Redirect to the new example if the mutation was successful and we are currently on the example\n if (\n isRouteParamsMatch({ documentName, path: meta.path, method: meta.method, exampleName: meta.exampleKey })\n ) {\n await router.replace({\n name: 'example',\n params: {\n documentSlug: documentName,\n pathEncoded: encodeURIComponent(meta.path),\n method: meta.method,\n exampleName: payload.name,\n },\n })\n }\n },\n },\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Hooks\n //------------------------------------------------------------------------------------\n 'operation:update:requestBody:value': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n 'operation:update:requestBody:formValue': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n //------------------------------------------------------------------------------------\n // Tag Related Event Hooks\n //------------------------------------------------------------------------------------\n 'tag:create:tag': {\n onAfterExecute: (payload) => rebuildSidebar(payload.documentName),\n },\n 'tag:edit:tag': {\n onAfterExecute: async (payload) => {\n rebuildSidebar(payload.documentName)\n\n /**\n * If the currently viewed operation is a child of the renamed tag, redirect to\n * the same route so the sidebar and breadcrumbs reflect the new tag name\n */\n const isNestedUnderTag = payload.tag.children?.some(\n (child) =>\n child.type === 'operation' &&\n isRouteParamsMatch({\n documentName: payload.documentName,\n path: child.path,\n method: child.method,\n }),\n )\n\n if (isNestedUnderTag) {\n await router.replace({ ...currentRoute.value })\n }\n },\n },\n 'tag:delete:tag': {\n onAfterExecute: (payload) => rebuildSidebar(payload.documentName),\n },\n //------------------------------------------------------------------------------------\n // Tabs Related Event Hooks\n //------------------------------------------------------------------------------------\n 'tabs:add:tab': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:close:tab': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:focus:tab': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:focus:tab-last': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:navigate:previous': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:navigate:next': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:update:tabs': {\n onAfterExecute: navigateToCurrentTab,\n },\n },\n })\n\n // Worksapce rename event handler\n eventBus.on('workspace:update:name', (payload) => renameWorkspace(payload))\n\n //------------------------------------------------------------------------------------\n // Navigation Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('scroll-to:nav-item', ({ id }) => onSelectSidebarItem(id))\n\n //------------------------------------------------------------------------------------\n // UI Related Event Handlers\n //------------------------------------------------------------------------------------\n // Note: Command palette handler is colocated with the command palette component\n\n eventBus.on('ui:toggle:sidebar', onToggleSidebar)\n\n /**\n * Bind the inernal navigation to a public api\n */\n eventBus.on('ui:navigate', async (payload) => {\n const { replace = false } = payload\n const fn = replace ? router.replace : router.push\n\n const execCallback = (result: NavigationFailure | void | undefined) => {\n if (!result) {\n // Close the sidebar if it is open\n closeSidebar()\n return payload.callback?.('success')\n }\n\n const navigationFailure: 16 = NavigationFailureType.duplicated\n\n if (result.type !== navigationFailure) {\n return payload.callback?.('error')\n }\n\n return payload.callback?.('success')\n }\n\n type ValidParams = Partial<Record<ScalarClientAppRouteParams, string>>\n\n if (payload.page === 'document') {\n const params = {\n documentSlug: payload.documentSlug,\n workspaceSlug: payload.workspaceSlug,\n namespace: payload.namespace,\n } satisfies ValidParams\n\n if (payload.path === 'overview') {\n return execCallback(await fn({ name: 'document.overview', params }))\n }\n if (payload.path === 'servers') {\n return execCallback(await fn({ name: 'document.servers', params }))\n }\n if (payload.path === 'environment') {\n return execCallback(await fn({ name: 'document.environment', params }))\n }\n if (payload.path === 'authentication') {\n return execCallback(await fn({ name: 'document.authentication', params }))\n }\n if (payload.path === 'cookies') {\n return execCallback(await fn({ name: 'document.cookies', params }))\n }\n if (payload.path === 'settings') {\n return execCallback(await fn({ name: 'document.settings', params }))\n }\n }\n\n if (payload.page === 'workspace') {\n const params = { workspaceSlug: payload.workspaceSlug, namespace: payload.namespace } satisfies ValidParams\n if (payload.path === 'environment') {\n return execCallback(await fn({ name: 'workspace.environment', params }))\n }\n if (payload.path === 'cookies') {\n return execCallback(await fn({ name: 'workspace.cookies', params }))\n }\n if (payload.path === 'settings') {\n return execCallback(await fn({ name: 'workspace.settings', params }))\n }\n }\n\n if (payload.page === 'example') {\n const params = {\n namespace: payload.namespace,\n workspaceSlug: payload.workspaceSlug,\n documentSlug: payload.documentSlug,\n pathEncoded: encodeURIComponent(payload.path),\n method: payload.method,\n exampleName: payload.exampleName,\n } satisfies ValidParams\n return execCallback(await fn({ name: 'example', params }))\n }\n\n if (payload.page === 'operation') {\n const params = {\n namespace: payload.namespace,\n workspaceSlug: payload.workspaceSlug,\n documentSlug: payload.documentSlug,\n pathEncoded: encodeURIComponent(payload.operationPath),\n method: payload.method,\n } satisfies ValidParams\n if (payload.path === 'overview') {\n return execCallback(await fn({ name: 'operation.overview', params }))\n }\n if (payload.path === 'servers') {\n return execCallback(await fn({ name: 'operation.servers', params }))\n }\n if (payload.path === 'authentication') {\n return execCallback(await fn({ name: 'operation.authentication', params }))\n }\n }\n })\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:copy:url', (payload) => onCopyTabUrl(payload.index))\n}\n"],"mappings":";;;;AASA,SAAgB,2BAA2B,EACzC,UACA,OACA,QACA,gBACA,sBACA,qBACA,wBACA,cACA,iBACA,cACA,mBAaC;CACD,MAAM,eAAe,eAAe,OAAO,cAAc,MAAM;;;;;;;CAQ/D,MAAM,sBAAsB,EAC1B,cACA,MACA,QACA,kBAMI;AACJ,MAAI,iBAAiB,KAAA,KAAa,iBAAiB,aAAa,OAAO,OAAO,aAC5E,QAAO;AAET,MAAI,SAAS,KAAA,KAAa,mBAAmB,KAAK,KAAK,aAAa,OAAO,OAAO,YAChF,QAAO;AAET,MAAI,WAAW,KAAA,KAAa,WAAW,aAAa,OAAO,OAAO,OAChE,QAAO;AAET,MAAI,gBAAgB,KAAA,KAAa,gBAAgB,aAAa,OAAO,OAAO,YAC1E,QAAO;AAET,SAAO;;AAGT,kCAAiC;EAC/B;EACA;EACA,OAAO;GAIL,4BAA4B,EAC1B,gBAAgB,OAAO,YAAY;AAEjC,QAAI,cAAc,OAAO,OAAO,iBAAiB,QAAQ,KACvD,OAAM,OAAO,KAAK,EAChB,MAAM,yBACP,CAAC;MAGP;GAID,+BAA+B,EAC7B,kBAAkB,aAAa;IAC7B,GAAG;IACH,UAAU,OAAO,WAAW;AAE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AE,eAAe,QAAQ;IAAe,WAAW,QAAQ;IAAW;AACrF,OAAI,QAAQ,SAAS,cACnB,QAAO,aAAa,MAAM,GAAG;IAAE,MAAM;IAAyB;IAAQ,CAAC,CAAC;AAE1E,OAAI,QAAQ,SAAS,UACnB,QAAO,aAAa,MAAM,GAAG;IAAE,MAAM;IAAqB;IAAQ,CAAC,CAAC;AAEtE,OAAI,QAAQ,SAAS,WACnB,QAAO,aAAa,MAAM,GAAG;IAAE,MAAM;IAAsB;IAAQ,CAAC,CAAC;;AAIzE,MAAI,QAAQ,SAAS,UASnB,QAAO,aAAa,MAAM,GAAG;GAAE,MAAM;GAAW,QARjC;IACb,WAAW,QAAQ;IACnB,eAAe,QAAQ;IACvB,cAAc,QAAQ;IACtB,aAAa,mBAAmB,QAAQ,KAAK;IAC7C,QAAQ,QAAQ;IAChB,aAAa,QAAQ;IACtB;GACuD,CAAC,CAAC;AAG5D,MAAI,QAAQ,SAAS,aAAa;GAChC,MAAM,SAAS;IACb,WAAW,QAAQ;IACnB,eAAe,QAAQ;IACvB,cAAc,QAAQ;IACtB,aAAa,mBAAmB,QAAQ,cAAc;IACtD,QAAQ,QAAQ;IACjB;AACD,OAAI,QAAQ,SAAS,WACnB,QAAO,aAAa,MAAM,GAAG;IAAE,MAAM;IAAsB;IAAQ,CAAC,CAAC;AAEvE,OAAI,QAAQ,SAAS,UACnB,QAAO,aAAa,MAAM,GAAG;IAAE,MAAM;IAAqB;IAAQ,CAAC,CAAC;AAEtE,OAAI,QAAQ,SAAS,iBACnB,QAAO,aAAa,MAAM,GAAG;IAAE,MAAM;IAA4B;IAAQ,CAAC,CAAC;;GAG/E;AAKF,UAAS,GAAG,kBAAkB,YAAY,aAAa,QAAQ,MAAM,CAAC"}
1
+ {"version":3,"file":"app-events.js","names":[],"sources":["../../../../src/v2/features/app/app-events.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { OperationExampleMeta, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { type ShallowRef, computed } from 'vue'\nimport { type NavigationFailure, NavigationFailureType, type Router } from 'vue-router'\n\nimport type { ScalarClientAppRouteParams } from '@/v2/features/app/helpers/routes'\nimport { initializeWorkspaceEventHandlers } from '@/v2/workspace-events'\n\nexport function initializeAppEventHandlers({\n eventBus,\n store,\n router,\n rebuildSidebar,\n navigateToCurrentTab,\n onSelectSidebarItem,\n onAfterExampleCreation,\n onCopyTabUrl,\n onToggleSidebar,\n closeSidebar,\n renameWorkspace,\n}: {\n eventBus: WorkspaceEventBus\n store: ShallowRef<WorkspaceStore | null>\n router: Router\n rebuildSidebar: (documentName?: string) => void\n navigateToCurrentTab: () => Promise<void>\n onSelectSidebarItem: (id: string) => void\n onAfterExampleCreation: (o: OperationExampleMeta & { documentName?: string }) => void\n onCopyTabUrl: (tabIndex: number) => void\n onToggleSidebar: () => void\n closeSidebar: () => void\n renameWorkspace: (name: string) => Promise<void>\n}) {\n const currentRoute = computed(() => router.currentRoute?.value)\n\n /**\n * Checks if the current route params match the specified operation meta.\n * Useful for determining if the sidebar or UI needs to be updated after changes to operations/examples.\n *\n * NOTE: It may be beneficial to compare to the active state instead of the router\n */\n const isRouteParamsMatch = ({\n documentName,\n path,\n method,\n exampleName,\n }: {\n documentName: string\n path?: string\n method?: HttpMethod\n exampleName?: string\n }) => {\n if (documentName !== undefined && documentName !== currentRoute.value?.params.documentSlug) {\n return false\n }\n if (path !== undefined && encodeURIComponent(path) !== currentRoute.value?.params.pathEncoded) {\n return false\n }\n if (method !== undefined && method !== currentRoute.value?.params.method) {\n return false\n }\n if (exampleName !== undefined && exampleName !== currentRoute.value?.params.exampleName) {\n return false\n }\n return true\n }\n\n initializeWorkspaceEventHandlers({\n eventBus,\n store,\n hooks: {\n //------------------------------------------------------------------------------------\n // Document Related Hooks\n //------------------------------------------------------------------------------------\n 'document:delete:document': {\n onAfterExecute: async (payload) => {\n // Redirect to the workspace environment page if the document was deleted\n if (currentRoute?.value?.params.documentSlug === payload.name) {\n await router.push({\n name: 'workspace.environment',\n })\n }\n },\n },\n //------------------------------------------------------------------------------------\n // Operation Related Hooks\n //------------------------------------------------------------------------------------\n 'operation:update:pathMethod': {\n onBeforeExecute: (payload) => ({\n ...payload,\n callback: async (status) => {\n // Redirect to the new example if the mutation was successful\n if (status === 'success') {\n // Rebuild the sidebar with the updated order\n rebuildSidebar(store.value?.workspace.activeDocument?.['x-scalar-navigation']?.name)\n\n // Now this redirect works for any example\n await router.replace({\n name: 'example',\n params: {\n method: payload.payload.method,\n pathEncoded: encodeURIComponent(payload.payload.path),\n exampleName: currentRoute.value?.params.exampleName,\n },\n })\n }\n\n payload.callback(status, payload.blurTargetSelector)\n },\n }),\n },\n 'operation:upsert:parameter': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n 'operation:update:extra-parameters': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n 'operation:reload:history': {\n onAfterExecute: (payload) => onAfterExampleCreation({ ...payload.meta, exampleKey: 'draft' }),\n },\n 'operation:delete:operation': {\n onAfterExecute: async (payload) => {\n rebuildSidebar(payload.documentName)\n const {\n documentName,\n meta: { path, method },\n } = payload\n // Navigate to the document overview page if the operation was deleted\n if (\n isRouteParamsMatch({\n documentName,\n path,\n method,\n })\n ) {\n await router.replace({\n name: 'document.overview',\n params: {\n documentSlug: documentName,\n },\n })\n }\n },\n },\n 'operation:create:draft-example': {\n onAfterExecute: async (payload) => {\n onAfterExampleCreation({ ...payload.meta, exampleKey: payload.exampleName })\n await router.push({\n name: 'example',\n params: {\n documentSlug: payload.documentName,\n pathEncoded: encodeURIComponent(payload.meta.path),\n method: payload.meta.method,\n exampleName: payload.exampleName,\n },\n })\n },\n },\n 'operation:delete:example': {\n onAfterExecute: async (payload) => {\n rebuildSidebar(payload.documentName)\n\n const {\n documentName,\n meta: { path, method, exampleKey },\n } = payload\n // Navigate to the default example if the example was deleted\n if (\n isRouteParamsMatch({\n documentName,\n path,\n method,\n exampleName: exampleKey,\n })\n ) {\n await router.replace({\n name: 'example',\n params: {\n pathEncoded: encodeURIComponent(path),\n method,\n documentSlug: documentName,\n exampleName: 'default',\n },\n })\n }\n },\n },\n 'operation:rename:example': {\n onAfterExecute: async ({ meta, payload, documentName }) => {\n // Refresh sidebar\n onAfterExampleCreation({ ...meta, exampleKey: payload.name, documentName })\n\n // Redirect to the new example if the mutation was successful and we are currently on the example\n if (\n isRouteParamsMatch({ documentName, path: meta.path, method: meta.method, exampleName: meta.exampleKey })\n ) {\n await router.replace({\n name: 'example',\n params: {\n documentSlug: documentName,\n pathEncoded: encodeURIComponent(meta.path),\n method: meta.method,\n exampleName: payload.name,\n },\n })\n }\n },\n },\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Hooks\n //------------------------------------------------------------------------------------\n 'operation:update:requestBody:value': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n 'operation:update:requestBody:formValue': {\n onAfterExecute: (payload) => onAfterExampleCreation(payload.meta),\n },\n //------------------------------------------------------------------------------------\n // Tag Related Event Hooks\n //------------------------------------------------------------------------------------\n 'tag:create:tag': {\n onAfterExecute: (payload) => rebuildSidebar(payload.documentName),\n },\n 'tag:edit:tag': {\n onAfterExecute: async (payload) => {\n rebuildSidebar(payload.documentName)\n\n /**\n * If the currently viewed operation is a child of the renamed tag, redirect to\n * the same route so the sidebar and breadcrumbs reflect the new tag name\n */\n const isNestedUnderTag = payload.tag.children?.some(\n (child) =>\n child.type === 'operation' &&\n isRouteParamsMatch({\n documentName: payload.documentName,\n path: child.path,\n method: child.method,\n }),\n )\n\n if (isNestedUnderTag) {\n await router.replace({ ...currentRoute.value })\n }\n },\n },\n 'tag:delete:tag': {\n onAfterExecute: (payload) => rebuildSidebar(payload.documentName),\n },\n //------------------------------------------------------------------------------------\n // Tabs Related Event Hooks\n //------------------------------------------------------------------------------------\n 'tabs:add:tab': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:close:tab': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:focus:tab': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:focus:tab-last': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:navigate:previous': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:navigate:next': {\n onAfterExecute: navigateToCurrentTab,\n },\n 'tabs:update:tabs': {\n onAfterExecute: navigateToCurrentTab,\n },\n },\n })\n\n // Worksapce rename event handler\n eventBus.on('workspace:update:name', (payload) => renameWorkspace(payload))\n\n //------------------------------------------------------------------------------------\n // Navigation Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('scroll-to:nav-item', ({ id }) => onSelectSidebarItem(id))\n\n //------------------------------------------------------------------------------------\n // UI Related Event Handlers\n //------------------------------------------------------------------------------------\n // Note: Command palette handler is colocated with the command palette component\n\n eventBus.on('ui:toggle:sidebar', onToggleSidebar)\n\n /**\n * Bind the inernal navigation to a public api\n */\n eventBus.on('ui:navigate', async (payload) => {\n const { replace = false } = payload\n const fn = replace ? router.replace : router.push\n\n const execCallback = (result: NavigationFailure | void | undefined) => {\n if (!result) {\n // Close the sidebar if it is open\n closeSidebar()\n return payload.callback?.('success')\n }\n\n const navigationFailure: 16 = NavigationFailureType.duplicated\n\n if (result.type !== navigationFailure) {\n return payload.callback?.('error')\n }\n\n return payload.callback?.('success')\n }\n\n type ValidParams = Partial<Record<ScalarClientAppRouteParams, string>>\n\n if (payload.page === 'document') {\n const params = {\n documentSlug: payload.documentSlug,\n workspaceSlug: payload.workspaceSlug,\n namespace: payload.namespace,\n } satisfies ValidParams\n\n if (payload.path === 'overview') {\n return execCallback(await fn({ name: 'document.overview', params }))\n }\n if (payload.path === 'servers') {\n return execCallback(await fn({ name: 'document.servers', params }))\n }\n if (payload.path === 'environment') {\n return execCallback(await fn({ name: 'document.environment', params }))\n }\n if (payload.path === 'authentication') {\n return execCallback(await fn({ name: 'document.authentication', params }))\n }\n if (payload.path === 'cookies') {\n return execCallback(await fn({ name: 'document.cookies', params }))\n }\n if (payload.path === 'settings') {\n return execCallback(await fn({ name: 'document.settings', params }))\n }\n }\n\n if (payload.page === 'workspace') {\n const params = { workspaceSlug: payload.workspaceSlug, namespace: payload.namespace } satisfies ValidParams\n if (payload.path === 'environment') {\n return execCallback(await fn({ name: 'workspace.environment', params }))\n }\n if (payload.path === 'cookies') {\n return execCallback(await fn({ name: 'workspace.cookies', params }))\n }\n if (payload.path === 'settings') {\n return execCallback(await fn({ name: 'workspace.settings', params }))\n }\n }\n\n if (payload.page === 'example') {\n const params = {\n namespace: payload.namespace,\n workspaceSlug: payload.workspaceSlug,\n documentSlug: payload.documentSlug,\n pathEncoded: encodeURIComponent(payload.path),\n method: payload.method,\n exampleName: payload.exampleName,\n } satisfies ValidParams\n return execCallback(await fn({ name: 'example', params }))\n }\n\n if (payload.page === 'operation') {\n const params = {\n namespace: payload.namespace,\n workspaceSlug: payload.workspaceSlug,\n documentSlug: payload.documentSlug,\n pathEncoded: encodeURIComponent(payload.operationPath),\n method: payload.method,\n } satisfies ValidParams\n if (payload.path === 'overview') {\n return execCallback(await fn({ name: 'operation.overview', params }))\n }\n if (payload.path === 'servers') {\n return execCallback(await fn({ name: 'operation.servers', params }))\n }\n if (payload.path === 'authentication') {\n return execCallback(await fn({ name: 'operation.authentication', params }))\n }\n }\n })\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:copy:url', (payload) => onCopyTabUrl(payload.index))\n}\n"],"mappings":";;;;AASA,SAAgB,2BAA2B,EACzC,UACA,OACA,QACA,gBACA,sBACA,qBACA,wBACA,cACA,iBACA,cACA,mBAaC;CACD,MAAM,eAAe,eAAe,OAAO,cAAc,MAAM;;;;;;;CAQ/D,MAAM,sBAAsB,EAC1B,cACA,MACA,QACA,kBAMI;AACJ,MAAI,iBAAiB,KAAA,KAAa,iBAAiB,aAAa,OAAO,OAAO,aAC5E,QAAO;A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,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACxB,CAAA;AAaD,eAAO,MAAM,cAAc,GAAU,4EAMlC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAA;IACxC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,KAAG,OAAO,CAAC,QAAQ,CAw2BnB,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { getRouteParam } from "./helpers/get-route-param.js";
2
2
  import { groupWorkspacesByTeam } from "./helpers/group-workspaces.js";
3
3
  import { useTheme } from "./hooks/use-theme.js";
4
- import { getActiveEnvironment } from "../../helpers/get-active-environment.js";
5
4
  import { getTabDetails } from "../../helpers/get-tab-details.js";
6
5
  import { slugify } from "../../helpers/slugify.js";
7
6
  import { workspaceStorage } from "../../helpers/storage.js";
@@ -11,6 +10,7 @@ import { computed, readonly, ref, shallowRef, watch } from "vue";
11
10
  import { migrateLocalStorageToIndexDb } from "@scalar/oas-utils/migrations";
12
11
  import { isDefined } from "@scalar/helpers/array/is-defined";
13
12
  import { createWorkspaceEventBus } from "@scalar/workspace-store/events";
13
+ import { getActiveEnvironment } from "@scalar/workspace-store/request-example";
14
14
  import { createSidebarState, generateReverseIndex } from "@scalar/sidebar";
15
15
  import { sortByOrder } from "@scalar/helpers/array/sort-by-order";
16
16
  import { createWorkspaceStore } from "@scalar/workspace-store/client";
@@ -59,7 +59,7 @@ var createAppState = async ({ router, fileLoader, fallbackThemeSlug = () => "def
59
59
  * Variables from both sources are combined, with document variables
60
60
  * taking precedence in case of naming conflicts.
61
61
  */
62
- const environment = computed(() => getActiveEnvironment(store.value, activeDocument.value));
62
+ const environment = computed(() => getActiveEnvironment(store.value, activeDocument.value).environment);
63
63
  /** Update the workspace list when the component is mounted */
64
64
  workspaces.value = await persistence.getAll().then((w) => w.map(({ teamUid, namespace, slug, name }) => ({
65
65
  id: getWorkspaceId(namespace, slug),