@scalar/api-client 3.26.0 → 3.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.js +1 -2
  3. package/dist/assets/computer.ascii_raw.js +1 -2
  4. package/dist/components/HelpfulLink.vue.js +1 -2
  5. package/dist/components/HelpfulLink.vue.js.map +1 -1
  6. package/dist/components/HelpfulLink.vue_vue_type_script_setup_true_lang.js +1 -2
  7. package/dist/components/HttpMethod/HttpMethod.vue.js +1 -2
  8. package/dist/components/HttpMethod/HttpMethod.vue.js.map +1 -1
  9. package/dist/components/HttpMethod/HttpMethod.vue_vue_type_script_setup_true_lang.js +1 -2
  10. package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +2 -3
  11. package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js.map +1 -1
  12. package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue_vue_type_script_setup_true_lang.js +1 -2
  13. package/dist/components/SectionFilter.vue.js +2 -3
  14. package/dist/components/SectionFilter.vue.js.map +1 -1
  15. package/dist/components/SectionFilter.vue_vue_type_script_setup_true_lang.js +2 -3
  16. package/dist/components/SectionFilterButton.vue.js +1 -2
  17. package/dist/components/SectionFilterButton.vue.js.map +1 -1
  18. package/dist/components/SectionFilterButton.vue_vue_type_script_setup_true_lang.js +1 -2
  19. package/dist/components/Server/ServerVariablesForm.vue.js +1 -2
  20. package/dist/components/Server/ServerVariablesForm.vue.js.map +1 -1
  21. package/dist/components/Server/ServerVariablesForm.vue_vue_type_script_setup_true_lang.js +1 -2
  22. package/dist/components/Server/ServerVariablesForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/Server/ServerVariablesSelect.vue.js +1 -2
  24. package/dist/components/Server/ServerVariablesSelect.vue.js.map +1 -1
  25. package/dist/components/Server/ServerVariablesSelect.vue_vue_type_script_setup_true_lang.js +1 -2
  26. package/dist/components/Server/ServerVariablesSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/components/Server/ServerVariablesTextbox.vue.js +1 -2
  28. package/dist/components/Server/ServerVariablesTextbox.vue.js.map +1 -1
  29. package/dist/components/Server/ServerVariablesTextbox.vue_vue_type_script_setup_true_lang.js +1 -2
  30. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +1 -2
  31. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js.map +1 -1
  32. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue_vue_type_script_setup_true_lang.js +2 -3
  33. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -2
  35. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js.map +1 -1
  36. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue_vue_type_script_setup_true_lang.js +1 -2
  37. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -2
  38. package/dist/components/ViewLayout/ViewLayout.vue.js.map +1 -1
  39. package/dist/components/ViewLayout/ViewLayout.vue_vue_type_script_setup_true_lang.js +1 -2
  40. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -2
  41. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -2
  42. package/dist/components/ViewLayout/ViewLayoutSection.vue.js.map +1 -1
  43. package/dist/components/ViewLayout/ViewLayoutSection.vue_vue_type_script_setup_true_lang.js +1 -2
  44. package/dist/components/ViewLayout/ViewLayoutSection.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/hooks/use-file-dialog.js +1 -2
  46. package/dist/plugins/posthog/index.js +1 -2
  47. package/dist/plugins/posthog/sanitize-event-payload.js +1 -2
  48. package/dist/style.css +514 -456
  49. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  50. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +1 -2
  51. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  52. package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js +11 -7
  53. package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -3
  55. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  56. package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js +3 -4
  57. package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +2 -3
  59. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js.map +1 -1
  60. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue_vue_type_script_setup_true_lang.js +1 -2
  61. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +1 -2
  62. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +1 -2
  63. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +1 -2
  64. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js +1 -2
  65. package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js +1 -2
  66. package/dist/v2/blocks/operation-block/helpers/persist-script-environment.js +1 -2
  67. package/dist/v2/blocks/operation-block/helpers/response-cache.js +1 -2
  68. package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -2
  69. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -2
  70. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
  71. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  72. package/dist/v2/blocks/request-block/RequestBlock.vue.js +3 -4
  73. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  74. package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js +13 -7
  75. package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
  77. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +3 -4
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue_vue_type_script_setup_true_lang.js +17 -13
  81. package/dist/v2/blocks/request-block/components/RequestBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  83. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +1 -2
  84. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
  85. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js +89 -17
  86. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  87. package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.d.ts +3 -0
  88. package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.js +1 -2
  90. package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.js.map +1 -1
  91. package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js +9 -4
  92. package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js +1 -2
  94. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  95. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue_vue_type_script_setup_true_lang.js +2 -3
  96. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js +1 -2
  97. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -1
  98. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js +1 -2
  99. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  101. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +1 -2
  102. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  103. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js +4 -3
  104. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +1 -2
  106. package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
  107. package/dist/v2/blocks/request-block/components/RequestParams.vue_vue_type_script_setup_true_lang.js +2 -3
  108. package/dist/v2/blocks/request-block/components/RequestParams.vue_vue_type_script_setup_true_lang.js.map +1 -1
  109. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +6 -4
  110. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  111. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +3 -4
  112. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  113. package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js +6 -5
  114. package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts +35 -0
  116. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts.map +1 -0
  117. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js +6 -0
  118. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js.map +1 -0
  119. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js +110 -0
  120. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  121. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +9 -4
  122. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  123. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +1 -2
  124. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  125. package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js +70 -23
  126. package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  128. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -2
  129. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  130. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js +24 -20
  131. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  132. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +1 -2
  133. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts +2 -0
  134. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
  135. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +6 -3
  136. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  137. package/dist/v2/blocks/request-block/helpers/files.js +1 -2
  138. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js +1 -2
  139. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -2
  140. package/dist/v2/blocks/request-block/helpers/get-parameter-content.js +1 -2
  141. package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js +1 -2
  142. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js +1 -2
  143. package/dist/v2/blocks/request-block/helpers/group-by.js +1 -2
  144. package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts +9 -0
  145. package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts.map +1 -0
  146. package/dist/v2/blocks/request-block/helpers/group-form-body-files.js +59 -0
  147. package/dist/v2/blocks/request-block/helpers/group-form-body-files.js.map +1 -0
  148. package/dist/v2/blocks/request-block/helpers/group-global-cookies.js +1 -2
  149. package/dist/v2/blocks/request-block/helpers/multipart-body.js +1 -2
  150. package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +1 -2
  151. package/dist/v2/blocks/request-block/helpers/validate-parameter.js +1 -2
  152. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -3
  153. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  154. package/dist/v2/blocks/response-block/ResponseBlock.vue_vue_type_script_setup_true_lang.js +4 -5
  155. package/dist/v2/blocks/response-block/ResponseBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  156. package/dist/v2/blocks/response-block/components/Headers.vue.js +1 -2
  157. package/dist/v2/blocks/response-block/components/Headers.vue.js.map +1 -1
  158. package/dist/v2/blocks/response-block/components/Headers.vue_vue_type_script_setup_true_lang.js +3 -4
  159. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -3
  160. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  161. package/dist/v2/blocks/response-block/components/ResponseBody.vue_vue_type_script_setup_true_lang.js +5 -6
  162. package/dist/v2/blocks/response-block/components/ResponseBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
  163. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js +1 -2
  164. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js.map +1 -1
  165. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue_vue_type_script_setup_true_lang.js +2 -3
  166. package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +1 -2
  167. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +2 -3
  168. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
  169. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js +2 -3
  170. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +2 -3
  171. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js.map +1 -1
  172. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js +1 -2
  173. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +1 -2
  175. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js.map +1 -1
  176. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue_vue_type_script_setup_true_lang.js +2 -3
  177. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue_vue_type_script_setup_true_lang.js.map +1 -1
  178. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js +1 -2
  179. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js.map +1 -1
  180. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js +1 -2
  181. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js +1 -2
  182. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js.map +1 -1
  183. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue_vue_type_script_setup_true_lang.js +3 -4
  184. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -2
  185. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
  186. package/dist/v2/blocks/response-block/components/ResponseCookies.vue_vue_type_script_setup_true_lang.js +2 -3
  187. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +2 -3
  188. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
  189. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue_vue_type_script_setup_true_lang.js +3 -4
  190. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -3
  192. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
  193. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue_vue_type_script_setup_true_lang.js +1 -2
  194. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +1 -2
  196. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js.map +1 -1
  197. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue_vue_type_script_setup_true_lang.js +2 -3
  198. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  199. package/dist/v2/blocks/response-block/helpers/extract-filename.js +1 -2
  200. package/dist/v2/blocks/response-block/helpers/get-content-length.js +1 -2
  201. package/dist/v2/blocks/response-block/helpers/media-types.js +1 -2
  202. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +1 -2
  203. package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js +1 -2
  204. package/dist/v2/blocks/response-block/helpers/prettify-ndjson.js +1 -2
  205. package/dist/v2/blocks/response-block/helpers/process-response-body.js +1 -2
  206. package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js +1 -2
  207. package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +1 -2
  208. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js +1 -2
  209. package/dist/v2/blocks/response-block/helpers/response-stream.js +1 -2
  210. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -3
  211. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  212. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js +3 -4
  213. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -3
  215. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  216. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue_vue_type_script_setup_true_lang.js +2 -3
  217. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
  218. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +1 -2
  219. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  220. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue_vue_type_script_setup_true_lang.js +1 -2
  221. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue_vue_type_script_setup_true_lang.js.map +1 -1
  222. package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +1 -2
  223. package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js +1 -2
  224. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js +1 -2
  225. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +1 -2
  226. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js +1 -2
  227. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -2
  228. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  229. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue_vue_type_script_setup_true_lang.js +3 -4
  230. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +1 -2
  232. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js.map +1 -1
  233. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue_vue_type_script_setup_true_lang.js +1 -2
  234. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +1 -2
  235. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  236. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js +4 -5
  237. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js +1 -2
  239. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js.map +1 -1
  240. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js +3 -4
  241. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  242. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +1 -2
  243. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
  244. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue_vue_type_script_setup_true_lang.js +2 -3
  245. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  246. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +1 -2
  247. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  248. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue_vue_type_script_setup_true_lang.js +2 -3
  249. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  250. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +1 -2
  251. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  252. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js +4 -5
  253. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +1 -2
  255. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  256. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue_vue_type_script_setup_true_lang.js +2 -3
  257. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  258. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +1 -2
  259. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js.map +1 -1
  260. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue_vue_type_script_setup_true_lang.js +2 -3
  261. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  262. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +1 -2
  263. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  264. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js +7 -8
  265. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +1 -2
  267. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +3 -4
  268. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  269. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +8 -8
  270. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  271. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +10 -12
  272. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  273. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js +1 -2
  274. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js +1 -2
  275. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +2 -3
  276. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.js +1 -2
  277. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -2
  278. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +1 -2
  279. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +2 -3
  280. package/dist/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url.js +1 -2
  281. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js +1 -2
  282. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +2 -3
  283. package/dist/v2/components/code-input/CodeInput.vue.js +2 -3
  284. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  285. package/dist/v2/components/code-input/CodeInput.vue_vue_type_script_setup_true_lang.js +2 -3
  286. package/dist/v2/components/code-input/CodeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  287. package/dist/v2/components/code-input/CodeInputLite.vue.js +2 -3
  288. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  289. package/dist/v2/components/code-input/CodeInputLite.vue_vue_type_script_setup_true_lang.js +4 -5
  290. package/dist/v2/components/code-input/CodeInputLite.vue_vue_type_script_setup_true_lang.js.map +1 -1
  291. package/dist/v2/components/code-input/PillTooltipHost.vue.js +1 -2
  292. package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
  293. package/dist/v2/components/code-input/PillTooltipHost.vue_vue_type_script_setup_true_lang.js +1 -2
  294. package/dist/v2/components/code-input/code-variable-widget.js +1 -2
  295. package/dist/v2/components/code-input/helpers/build-pill-context.js +1 -2
  296. package/dist/v2/components/code-input/helpers/lookup-variable-value.js +1 -2
  297. package/dist/v2/components/code-input/helpers/pill-signature.js +1 -2
  298. package/dist/v2/components/code-input/helpers/serialize-value.js +1 -2
  299. package/dist/v2/components/context-menu/ContextMenu.vue.js +1 -2
  300. package/dist/v2/components/context-menu/ContextMenu.vue.js.map +1 -1
  301. package/dist/v2/components/context-menu/ContextMenu.vue_vue_type_script_setup_true_lang.js +1 -2
  302. package/dist/v2/components/data-table/DataTable.vue.js +1 -2
  303. package/dist/v2/components/data-table/DataTable.vue.js.map +1 -1
  304. package/dist/v2/components/data-table/DataTable.vue_vue_type_script_setup_true_lang.js +1 -2
  305. package/dist/v2/components/data-table/DataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  306. package/dist/v2/components/data-table/DataTableCell.vue.js +1 -2
  307. package/dist/v2/components/data-table/DataTableCell.vue.js.map +1 -1
  308. package/dist/v2/components/data-table/DataTableCell.vue_vue_type_script_setup_true_lang.js +1 -2
  309. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +1 -0
  310. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  311. package/dist/v2/components/data-table/DataTableCheckbox.vue.js +1 -2
  312. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  313. package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js +15 -6
  314. package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/dist/v2/components/data-table/DataTableHeader.vue.js +1 -2
  316. package/dist/v2/components/data-table/DataTableHeader.vue.js.map +1 -1
  317. package/dist/v2/components/data-table/DataTableHeader.vue_vue_type_script_setup_true_lang.js +1 -2
  318. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -3
  319. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  320. package/dist/v2/components/data-table/DataTableInput.vue_vue_type_script_setup_true_lang.js +3 -4
  321. package/dist/v2/components/data-table/DataTableInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  322. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +1 -2
  323. package/dist/v2/components/data-table/DataTableInputSelect.vue.js.map +1 -1
  324. package/dist/v2/components/data-table/DataTableInputSelect.vue_vue_type_script_setup_true_lang.js +1 -2
  325. package/dist/v2/components/data-table/DataTableInputSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  326. package/dist/v2/components/data-table/DataTableRow.vue.js +1 -2
  327. package/dist/v2/components/data-table/DataTableText.vue.js +1 -2
  328. package/dist/v2/components/data-table/DataTableText.vue.js.map +1 -1
  329. package/dist/v2/components/data-table/DataTableText.vue_vue_type_script_setup_true_lang.js +1 -2
  330. package/dist/v2/components/data-table/index.js +1 -1
  331. package/dist/v2/components/forms/ConfirmationForm.vue.js +1 -2
  332. package/dist/v2/components/forms/ConfirmationForm.vue.js.map +1 -1
  333. package/dist/v2/components/forms/ConfirmationForm.vue_vue_type_script_setup_true_lang.js +1 -2
  334. package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -2
  335. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  336. package/dist/v2/components/layout/CollapsibleSection.vue_vue_type_script_setup_true_lang.js +1 -2
  337. package/dist/v2/components/layout/CollapsibleSection.vue_vue_type_script_setup_true_lang.js.map +1 -1
  338. package/dist/v2/components/layout/ValueEmitter.vue.js +1 -2
  339. package/dist/v2/components/layout/ValueEmitter.vue.js.map +1 -1
  340. package/dist/v2/components/layout/ValueEmitter.vue_vue_type_script_setup_true_lang.js +0 -1
  341. package/dist/v2/components/layout/collapsible-section-heading-level.js +1 -2
  342. package/dist/v2/components/layout/index.js +1 -1
  343. package/dist/v2/components/modals/DeleteModal.vue.js +1 -2
  344. package/dist/v2/components/modals/DeleteModal.vue.js.map +1 -1
  345. package/dist/v2/components/modals/DeleteModal.vue_vue_type_script_setup_true_lang.js +2 -3
  346. package/dist/v2/components/modals/DeleteModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  347. package/dist/v2/components/modals/ModalClientContainer.vue.js +2 -3
  348. package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
  349. package/dist/v2/components/modals/ModalClientContainer.vue_vue_type_script_setup_true_lang.js +1 -2
  350. package/dist/v2/components/resize/Resize.vue.js +2 -3
  351. package/dist/v2/components/resize/Resize.vue.js.map +1 -1
  352. package/dist/v2/components/resize/Resize.vue_vue_type_script_setup_true_lang.js +1 -2
  353. package/dist/v2/components/resize/use-split-resize.js +1 -2
  354. package/dist/v2/components/server/ServerDropdown.vue.js +1 -2
  355. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  356. package/dist/v2/components/server/ServerDropdown.vue_vue_type_script_setup_true_lang.js +2 -3
  357. package/dist/v2/components/server/ServerDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
  358. package/dist/v2/components/server/ServerDropdownItem.vue.js +2 -3
  359. package/dist/v2/components/server/ServerDropdownItem.vue.js.map +1 -1
  360. package/dist/v2/components/server/ServerDropdownItem.vue_vue_type_script_setup_true_lang.js +1 -2
  361. package/dist/v2/components/server/ServerDropdownItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/dist/v2/components/sidebar/Sidebar.vue.js +1 -2
  363. package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
  364. package/dist/v2/components/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +2 -3
  365. package/dist/v2/components/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  366. package/dist/v2/components/sidebar/SidebarMenu.vue.js +1 -2
  367. package/dist/v2/components/sidebar/SidebarMenu.vue.js.map +1 -1
  368. package/dist/v2/components/sidebar/SidebarMenu.vue_vue_type_script_setup_true_lang.js +1 -2
  369. package/dist/v2/components/sidebar/SidebarToggle.vue.js +2 -3
  370. package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
  371. package/dist/v2/components/sidebar/SidebarToggle.vue_vue_type_script_setup_true_lang.js +1 -2
  372. package/dist/v2/components/sidebar/index.js +1 -1
  373. package/dist/v2/constants.js +2 -3
  374. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +1 -2
  375. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js.map +1 -1
  376. package/dist/v2/features/command-palette/components/CommandActionForm.vue_vue_type_script_setup_true_lang.js +1 -2
  377. package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +1 -2
  378. package/dist/v2/features/command-palette/components/CommandActionInput.vue.js.map +1 -1
  379. package/dist/v2/features/command-palette/components/CommandActionInput.vue_vue_type_script_setup_true_lang.js +1 -2
  380. package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -2
  381. package/dist/v2/features/environments/EnvironmentsList.vue.js.map +1 -1
  382. package/dist/v2/features/environments/EnvironmentsList.vue_vue_type_script_setup_true_lang.js +2 -3
  383. package/dist/v2/features/environments/components/Environment.vue.js +1 -2
  384. package/dist/v2/features/environments/components/Environment.vue.js.map +1 -1
  385. package/dist/v2/features/environments/components/Environment.vue_vue_type_script_setup_true_lang.js +2 -3
  386. package/dist/v2/features/environments/components/Environment.vue_vue_type_script_setup_true_lang.js.map +1 -1
  387. package/dist/v2/features/environments/components/EnvironmentColors.vue.d.ts.map +1 -1
  388. package/dist/v2/features/environments/components/EnvironmentColors.vue.js +1 -2
  389. package/dist/v2/features/environments/components/EnvironmentColors.vue.js.map +1 -1
  390. package/dist/v2/features/environments/components/EnvironmentColors.vue_vue_type_script_setup_true_lang.js +9 -10
  391. package/dist/v2/features/environments/components/EnvironmentColors.vue_vue_type_script_setup_true_lang.js.map +1 -1
  392. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +1 -2
  393. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js.map +1 -1
  394. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js +2 -3
  395. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  396. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +1 -2
  397. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js.map +1 -1
  398. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue_vue_type_script_setup_true_lang.js +1 -2
  399. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +1 -2
  400. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  401. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js +1 -2
  402. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
  403. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +2 -3
  404. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
  405. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js +2 -3
  406. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  407. package/dist/v2/features/localization/index.js +1 -2
  408. package/dist/v2/features/localization/locales/ar.d.ts +4 -0
  409. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -1
  410. package/dist/v2/features/localization/locales/ar.js +5 -2
  411. package/dist/v2/features/localization/locales/ar.js.map +1 -1
  412. package/dist/v2/features/localization/locales/de.d.ts +4 -0
  413. package/dist/v2/features/localization/locales/de.d.ts.map +1 -1
  414. package/dist/v2/features/localization/locales/de.js +5 -2
  415. package/dist/v2/features/localization/locales/de.js.map +1 -1
  416. package/dist/v2/features/localization/locales/es.d.ts +4 -0
  417. package/dist/v2/features/localization/locales/es.d.ts.map +1 -1
  418. package/dist/v2/features/localization/locales/es.js +5 -2
  419. package/dist/v2/features/localization/locales/es.js.map +1 -1
  420. package/dist/v2/features/localization/locales/fr.d.ts +4 -0
  421. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -1
  422. package/dist/v2/features/localization/locales/fr.js +5 -2
  423. package/dist/v2/features/localization/locales/fr.js.map +1 -1
  424. package/dist/v2/features/localization/locales/pt.d.ts +4 -0
  425. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -1
  426. package/dist/v2/features/localization/locales/pt.js +5 -2
  427. package/dist/v2/features/localization/locales/pt.js.map +1 -1
  428. package/dist/v2/features/localization/locales/ru.d.ts +4 -0
  429. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -1
  430. package/dist/v2/features/localization/locales/ru.js +5 -2
  431. package/dist/v2/features/localization/locales/ru.js.map +1 -1
  432. package/dist/v2/features/localization/locales/zh-cn.d.ts +4 -0
  433. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -1
  434. package/dist/v2/features/localization/locales/zh-cn.js +5 -2
  435. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -1
  436. package/dist/v2/features/localization/locales/zh-tw.d.ts +4 -0
  437. package/dist/v2/features/localization/locales/zh-tw.d.ts.map +1 -1
  438. package/dist/v2/features/localization/locales/zh-tw.js +5 -2
  439. package/dist/v2/features/localization/locales/zh-tw.js.map +1 -1
  440. package/dist/v2/features/localization/translations.d.ts +4 -0
  441. package/dist/v2/features/localization/translations.d.ts.map +1 -1
  442. package/dist/v2/features/localization/translations.js +5 -2
  443. package/dist/v2/features/localization/translations.js.map +1 -1
  444. package/dist/v2/features/modal/Modal.vue.js +1 -2
  445. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  446. package/dist/v2/features/modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -5
  447. package/dist/v2/features/modal/helpers/create-api-client-modal.js +1 -2
  448. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -2
  449. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -2
  450. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +1 -2
  451. package/dist/v2/features/modal/index.js +2 -2
  452. package/dist/v2/features/modal/modal-events.js +1 -2
  453. package/dist/v2/features/modal/use-lazy-api-client.js +1 -2
  454. package/dist/v2/features/operation/Operation.vue.js +1 -2
  455. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  456. package/dist/v2/features/operation/Operation.vue_vue_type_script_setup_true_lang.js +2 -3
  457. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +2 -3
  458. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  459. package/dist/v2/features/search/components/DocumentSearchModal.vue_vue_type_script_setup_true_lang.js +1 -2
  460. package/dist/v2/features/search/components/SearchResult.vue.js +1 -2
  461. package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -1
  462. package/dist/v2/features/search/components/SearchResult.vue_vue_type_script_setup_true_lang.js +1 -2
  463. package/dist/v2/features/search/components/SearchResult.vue_vue_type_script_setup_true_lang.js.map +1 -1
  464. package/dist/v2/features/search/helpers/create-fuse-instance.js +1 -2
  465. package/dist/v2/features/search/helpers/create-search-index.js +1 -2
  466. package/dist/v2/features/search/hooks/use-document-search.js +1 -2
  467. package/dist/v2/features/search/hooks/use-search-index.js +1 -2
  468. package/dist/v2/features/search/index.js +1 -1
  469. package/dist/v2/helpers/generate-location-id.js +1 -2
  470. package/dist/v2/helpers/handle-hotkeys.js +1 -2
  471. package/dist/v2/helpers/test-utils.js +1 -2
  472. package/dist/v2/hooks/use-global-hot-keys.js +1 -2
  473. package/dist/v2/hooks/use-scroll-lock.js +1 -2
  474. package/dist/v2/workspace-events.js +1 -2
  475. package/dist/vue-styles.css +130 -130
  476. package/package.json +30 -30
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyForm.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","RequestTable"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ExampleObject,\n MediaTypeObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n getFormBodyRows,\n getFormBodyValue,\n} from '@/v2/blocks/request-block/helpers/get-form-body-rows'\n\nconst {\n example,\n bodySchema,\n encoding,\n selectedContentType,\n environment,\n compositionSelection,\n} = defineProps<{\n example: ExampleObject | undefined | null\n /** Resolved schema for the form body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** Encoding overrides for individual multipart fields. */\n encoding?: MediaTypeObject['encoding']\n /** Selected request-body variants, shared with example generation and serialization. */\n compositionSelection?: Record<string, number>\n selectedContentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'update:formValue',\n payload: ApiReferenceEvents['operation:update:requestBody:formValue']['payload'],\n ): void\n}>()\n\n/** Local state for form body rows */\nconst localFormBodyRows = ref<TableRow[]>([])\n\n/** Sync the local form body rows with the example and schema */\nwatch(\n () =>\n [\n example,\n bodySchema,\n selectedContentType,\n compositionSelection,\n encoding,\n ] as const,\n ([newExample, schema, contentType, selection, fieldEncoding]) => {\n localFormBodyRows.value = getFormBodyRows(\n newExample,\n contentType,\n schema,\n selection,\n fieldEncoding,\n )\n },\n { immediate: true },\n)\n\n/** Undeclared fields follow additionalProperties instead of losing uploads whenever a schema exists. */\nconst allowUnknownFileUploads = computed<boolean>(() => {\n const schema = resolveFormSchema(bodySchema, compositionSelection)\n const additional =\n schema && 'additionalProperties' in schema\n ? schema.additionalProperties\n : undefined\n return typeof additional === 'object'\n ? isFileSchema(resolveFormSchema(additional) ?? { __scalar_: '' })\n : additional !== false\n})\n\nconst handleUpdateFormValue = (rows: TableRow[]) => {\n emit(\n 'update:formValue',\n rows.map((row) => ({\n name: row.name,\n value:\n selectedContentType === 'multipart/form-data'\n ? getFormBodyValue(row)\n : (row.value as string | File),\n isDisabled: row.isDisabled ?? false,\n ...(row.isDisabledByDefault ? { isDisabledByDefault: true } : {}),\n ...(selectedContentType === 'multipart/form-data' && row.isArray\n ? { isArray: true }\n : {}),\n })),\n )\n}\n\n/** Update a row in the table, combines with the previous data so we emit a whole row */\nconst handleUpsertRow = (\n index: number,\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n) => {\n // Add new row\n if (index >= localFormBodyRows.value.length) {\n localFormBodyRows.value = [\n ...localFormBodyRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (i !== index) {\n return row\n }\n\n const valueChanged = 'value' in payload && payload.value !== row.value\n const disabledChanged =\n payload.isDisabled !== undefined && payload.isDisabled !== row.isDisabled\n\n return {\n ...row,\n ...payload,\n // File selection bypasses the text input, but also expresses intent to send a value.\n ...(valueChanged && payload.value !== undefined && row.isDisabledByDefault\n ? { isDisabled: false }\n : {}),\n // Preserve untouched defaults while keeping deliberate checkbox choices explicit.\n isDisabledByDefault:\n row.isDisabledByDefault && !valueChanged && !disabledChanged,\n }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number) => {\n localFormBodyRows.value = localFormBodyRows.value.filter(\n (_, i) => i !== index,\n )\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Handle file upload for a specific row index */\nconst handleFileUpload = (index: number) => {\n const { open } = useFileDialog({\n onChange: (files) => {\n const file = files?.[0]\n\n if (file) {\n const currentRow = localFormBodyRows.value[index]\n handleUpsertRow(index, {\n name: currentRow?.name || file.name,\n value: file,\n })\n }\n },\n multiple: false,\n accept: '*/*',\n })\n void open()\n}\n</script>\n\n<template>\n <!-- Form Data -->\n <template v-if=\"selectedContentType === 'multipart/form-data'\">\n <RequestTable\n :allowUnknownFileUploads=\"allowUnknownFileUploads\"\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n showUploadButton\n @deleteRow=\"handleDeleteRow\"\n @removeFile=\"(index) => handleUpsertRow(index, { value: undefined })\"\n @uploadFile=\"handleFileUpload\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n\n <!-- Form URL Encoded -->\n <template v-else>\n <RequestTable\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAuCA,MAAM,OAAO;;EAQb,MAAM,oBAAoB,IAAgB,CAAC,CAAC;;EAG5C,YAEI;GACE,QAAA;GACA,QAAA;GACA,QAAA;GACA,QAAA;GACA,QAAA;EACF,IACD,CAAC,YAAY,QAAQ,aAAa,WAAW,mBAAmB;GAC/D,kBAAkB,QAAQ,gBACxB,YACA,aACA,QACA,WACA,aACF;EACF,GACA,EAAE,WAAW,KAAK,CACpB;;EA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,kBAAkB,QAAQ,kBAAkB,MAAM,QAC/C,GAAG,MAAM,MAAM,KAClB;GACA,sBAAsB,kBAAkB,KAAK;EAC/C;;EAGA,MAAM,oBAAoB,UAAkB;GAC1C,MAAM,EAAE,SAAS,cAAc;IAC7B,WAAW,UAAU;KACnB,MAAM,OAAO,QAAQ;KAErB,IAAI,MAAM;MACR,MAAM,aAAa,kBAAkB,MAAM;MAC3C,gBAAgB,OAAO;OACrB,MAAM,YAAY,QAAQ,KAAK;OAC/B,OAAO;MACT,CAAC;KACH;IACF;IACA,UAAU;IACV,QAAQ;GACV,CAAC;GACD,KAAU;EACZ;;GAKkB,OAAA,QAAA,wBAAmB,yBACjCA,UAAA,GAAAC,YASiCC,sBAAA;;IAR9B,yBAAyB,wBAAA;IACzB,MAAM,kBAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACd,kBAAA;IACC,aAAW;IACX,cAAU,OAAA,OAAA,OAAA,MAAG,UAAU,gBAAgB,OAAK,EAAA,OAAW,KAAA,EAAS,CAAA;IAChE,cAAY;IACZ,aAAW;;;;;G,OAKdF,UAAA,GAAAC,YAKiCC,sBAAA;;IAJ9B,MAAM,kBAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACb,aAAW;IACX,aAAW"}
1
+ {"version":3,"file":"RequestBodyForm.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","RequestTable"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ExampleObject,\n MediaTypeObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n getFormBodyRows,\n getFormBodyValue,\n} from '@/v2/blocks/request-block/helpers/get-form-body-rows'\nimport { groupFormBodyFiles } from '@/v2/blocks/request-block/helpers/group-form-body-files'\n\nconst {\n example,\n bodySchema,\n encoding,\n selectedContentType,\n environment,\n compositionSelection,\n} = defineProps<{\n example: ExampleObject | undefined | null\n /** Resolved schema for the form body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** Encoding overrides for individual multipart fields. */\n encoding?: MediaTypeObject['encoding']\n /** Selected request-body variants, shared with example generation and serialization. */\n compositionSelection?: Record<string, number>\n selectedContentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'update:formValue',\n payload: ApiReferenceEvents['operation:update:requestBody:formValue']['payload'],\n ): void\n}>()\n\n/** Local state for form body rows */\nconst localFormBodyRows = ref<TableRow[]>([])\n\nconst formFields = computed(() =>\n selectedContentType === 'multipart/form-data'\n ? groupFormBodyFiles(localFormBodyRows.value)\n : localFormBodyRows.value.map((data, index) => ({\n data,\n sourceIndices: [index],\n })),\n)\nconst displayedRows = computed<TableRow[]>(() =>\n formFields.value.map((field) => field.data),\n)\n\n/** Sync the local form body rows with the example and schema */\nwatch(\n () =>\n [\n example,\n bodySchema,\n selectedContentType,\n compositionSelection,\n encoding,\n ] as const,\n ([newExample, schema, contentType, selection, fieldEncoding]) => {\n localFormBodyRows.value = getFormBodyRows(\n newExample,\n contentType,\n schema,\n selection,\n fieldEncoding,\n )\n },\n { immediate: true },\n)\n\n/** Undeclared fields follow additionalProperties instead of losing uploads whenever a schema exists. */\nconst allowUnknownFileUploads = computed<boolean>(() => {\n const schema = resolveFormSchema(bodySchema, compositionSelection)\n const additional =\n schema && 'additionalProperties' in schema\n ? schema.additionalProperties\n : undefined\n return typeof additional === 'object'\n ? isFileSchema(resolveFormSchema(additional) ?? { __scalar_: '' })\n : additional !== false\n})\n\nconst handleUpdateFormValue = (rows: TableRow[]): void => {\n emit(\n 'update:formValue',\n rows.map((row) => ({\n name: row.name,\n value:\n selectedContentType === 'multipart/form-data'\n ? getFormBodyValue(row)\n : (row.value as string | File),\n isDisabled: row.isDisabled ?? false,\n ...(row.isDisabledByDefault ? { isDisabledByDefault: true } : {}),\n ...(selectedContentType === 'multipart/form-data' && row.isArray\n ? { isArray: true }\n : {}),\n })),\n )\n}\n\n/** Update a row in the table, combines with the previous data so we emit a whole row */\nconst handleUpsertRow = (\n index: number | number[],\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n): void => {\n const indices = Array.isArray(index) ? index : [index]\n // Add new row\n if (\n indices[0] !== undefined &&\n indices[0] >= localFormBodyRows.value.length\n ) {\n localFormBodyRows.value = [\n ...localFormBodyRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (!indices.includes(i)) {\n return row\n }\n\n const valueChanged = 'value' in payload && payload.value !== row.value\n const disabledChanged =\n payload.isDisabled !== undefined && payload.isDisabled !== row.isDisabled\n\n return {\n ...row,\n ...payload,\n // File selection bypasses the text input, but also expresses intent to send a value.\n ...(valueChanged && payload.value !== undefined && row.isDisabledByDefault\n ? { isDisabled: false }\n : {}),\n // Preserve untouched defaults while keeping deliberate checkbox choices explicit.\n isDisabledByDefault:\n row.isDisabledByDefault && !valueChanged && !disabledChanged,\n }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Remember individual choices while the whole file field is temporarily disabled. */\nconst disabledFileChoices = new WeakMap<File, boolean>()\n\n/** Apply field edits to all its parts without replacing sibling files with the first file. */\nconst handleFieldUpsert = (\n index: number,\n payload: Parameters<typeof handleUpsertRow>[1],\n): void => {\n const field = formFields.value[index]\n if (\n field?.data.files?.length &&\n payload.isDisabled !== undefined &&\n payload.isDisabled !== field.data.isDisabled\n ) {\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (!field.sourceIndices.includes(i) || !(row.value instanceof File)) {\n return row\n }\n if (payload.isDisabled) {\n disabledFileChoices.set(row.value, row.isDisabled ?? false)\n }\n const isDisabled =\n payload.isDisabled || (disabledFileChoices.get(row.value) ?? false)\n if (!payload.isDisabled) {\n disabledFileChoices.delete(row.value)\n }\n return { ...row, isDisabled, isDisabledByDefault: false }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n handleUpsertRow(\n field?.sourceIndices ?? localFormBodyRows.value.length,\n field?.data.files\n ? {\n ...(payload.name !== undefined ? { name: payload.name } : {}),\n ...(payload.isDisabled !== undefined &&\n payload.isDisabled !== field.data.isDisabled\n ? { isDisabled: payload.isDisabled }\n : {}),\n }\n : payload,\n )\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number): void => {\n const indices = formFields.value[index]?.sourceIndices ?? [index]\n localFormBodyRows.value = localFormBodyRows.value.filter(\n (_, i) => !indices.includes(i),\n )\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Remove a selected file, retaining one empty field after the last file is removed. */\nconst handleRemoveFile = (index: number, fileIndex?: number): void => {\n const field = formFields.value[index]\n const sourceIndex = fileIndex ?? field?.sourceIndices[0] ?? index\n if (field?.data.files) {\n const remaining = localFormBodyRows.value.filter(\n (row, i) =>\n field.sourceIndices.includes(i) &&\n i !== sourceIndex &&\n row.value instanceof File,\n )\n const original = localFormBodyRows.value[sourceIndex]\n if (!original) {\n return\n }\n const replacement = remaining.length\n ? remaining\n : [{ ...original, value: '[]', isArray: true }]\n localFormBodyRows.value = localFormBodyRows.value.flatMap((row, i) => {\n if (i === field.sourceIndices[0]) {\n return replacement\n }\n return field.sourceIndices.includes(i) ? [] : [row]\n })\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n handleUpsertRow(sourceIndex, { value: undefined })\n}\n\n/** Handle file upload for a specific row index */\nconst handleFileUpload = (index: number): void => {\n const field = formFields.value[index]\n const sourceIndices = field?.sourceIndices ?? [localFormBodyRows.value.length]\n const sourceIndex = sourceIndices[0] ?? localFormBodyRows.value.length\n const currentRow = localFormBodyRows.value[sourceIndex]\n // Array fields accept multiple files, serialized as separate multipart parts under the same name.\n const allowMultiple = Boolean(\n currentRow?.schema && isArraySchema(currentRow.schema),\n )\n\n const { open } = useFileDialog({\n onChange: (files) => {\n const selected = files ? Array.from(files) : []\n if (selected.length === 0) {\n return\n }\n\n // Every selected file shares the field key, falling back to the first file name when\n // the row has no name yet (e.g. schema-less requests).\n const fieldName = currentRow?.name || selected[0]?.name || ''\n\n // Keep a selection together beside its field, and emit once so consumers never\n // observe a partially applied selection.\n const selectedRows: TableRow[] = selected.map((file) => ({\n ...currentRow,\n name: fieldName,\n value: file,\n // Selecting files enables untouched optional fields while preserving explicit choices.\n isDisabled: field?.data.isDisabledByDefault\n ? false\n : (field?.data.isDisabled ?? false),\n isDisabledByDefault: false,\n }))\n const existingFiles = field?.data.files\n ? localFormBodyRows.value.filter(\n (row, i) => sourceIndices.includes(i) && row.value instanceof File,\n )\n : []\n const remaining = localFormBodyRows.value.filter(\n (_, i) => !sourceIndices.includes(i),\n )\n localFormBodyRows.value = [\n ...remaining.slice(0, sourceIndex),\n ...existingFiles,\n ...selectedRows,\n ...remaining.slice(sourceIndex),\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n },\n multiple: allowMultiple,\n accept: '*/*',\n })\n void open()\n}\n</script>\n\n<template>\n <!-- Form Data -->\n <template v-if=\"selectedContentType === 'multipart/form-data'\">\n <RequestTable\n :allowUnknownFileUploads=\"allowUnknownFileUploads\"\n :data=\"displayedRows\"\n deferKeyUpdates\n :environment=\"environment\"\n showUploadButton\n @deleteRow=\"handleDeleteRow\"\n @removeFile=\"handleRemoveFile\"\n @updateFile=\"\n (index, disabled) => handleUpsertRow(index, { isDisabled: disabled })\n \"\n @uploadFile=\"handleFileUpload\"\n @upsertRow=\"handleFieldUpsert\" />\n </template>\n\n <!-- Form URL Encoded -->\n <template v-else>\n <RequestTable\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,OAAO;;EAQb,MAAM,oBAAoB,IAAgB,CAAC,CAAC;EAE5C,MAAM,aAAa,eACjB,QAAA,wBAAwB,wBACpB,mBAAmB,kBAAkB,KAAK,IAC1C,kBAAkB,MAAM,KAAK,MAAM,WAAW;GAC5C;GACA,eAAe,CAAC,KAAK;EACvB,EAAE,CACR;EACA,MAAM,gBAAgB,eACpB,WAAW,MAAM,KAAK,UAAU,MAAM,IAAI,CAC5C;;EAGA,YAEI;GACE,QAAA;GACA,QAAA;GACA,QAAA;GACA,QAAA;GACA,QAAA;EACF,IACD,CAAC,YAAY,QAAQ,aAAa,WAAW,mBAAmB;GAC/D,kBAAkB,QAAQ,gBACxB,YACA,aACA,QACA,WACA,aACF;EACF,GACA,EAAE,WAAW,KAAK,CACpB;;EAGA,MAAM,0BAA0B,eAAwB;GACtD,MAAM,SAAS,kBAAkB,QAAA,YAAY,QAAA,oBAAoB;GACjE,MAAM,aACJ,UAAU,0BAA0B,SAChC,OAAO,uBACP,KAAA;GACN,OAAO,OAAO,eAAe,WACzB,aAAa,kBAAkB,UAAU,KAAK,EAAE,WAAW,GAAG,CAAC,IAC/D,eAAe;EACrB,CAAC;EAED,MAAM,yBAAyB,SAA2B;GACxD,KACE,oBACA,KAAK,KAAK,SAAS;IACjB,MAAM,IAAI;IACV,OACE,QAAA,wBAAwB,wBACpB,iBAAiB,GAAG,IACnB,IAAI;IACX,YAAY,IAAI,cAAc;IAC9B,GAAI,IAAI,sBAAsB,EAAE,qBAAqB,KAAK,IAAI,C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AAA;;IAXhC,yBAAyB,wBAAA;IACzB,MAAM,cAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACd,kBAAA;IACC,aAAW;IACX,cAAY;IACZ,cAAU,OAAA,OAAA,OAAA,MAAY,OAAO,aAAa,gBAAgB,OAAK,EAAA,YAAgB,SAAQ,CAAA;IAGvF,cAAY;IACZ,aAAW;;;;;G,OAKdF,UAAA,GAAAC,YAKiCC,sBAAA;;IAJ9B,MAAM,kBAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACb,aAAW;IACX,aAAW"}
@@ -2,6 +2,9 @@ import type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/stric
2
2
  import { type MultipartBodyValue } from '../helpers/multipart-body.js';
3
3
  type __VLS_Props = {
4
4
  value: MultipartBodyValue;
5
+ openapiVersion?: string;
6
+ /** Document-level JSON Schema dialect used when generating array `contains` examples. */
7
+ jsonSchemaDialect?: string;
5
8
  media: MediaTypeObject;
6
9
  compositionSelection?: Record<string, number>;
7
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyMultipart.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyMultipart.vue"],"names":[],"mappings":"AA8NA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAQnG,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,kDAAkD,CAAA;AAGzD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,kBAAkB,CAAA;IACzB,KAAK,EAAE,eAAe,CAAA;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9C,CAAC;AAuVF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestBodyMultipart.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyMultipart.vue"],"names":[],"mappings":"AA6OA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAQnG,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,kDAAkD,CAAA;AAGzD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,kBAAkB,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,EAAE,eAAe,CAAA;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9C,CAAC;AAmWF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,6 @@
1
1
  import RequestBodyMultipart_vue_vue_type_script_setup_true_lang_default from "./RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/v2/blocks/request-block/components/RequestBodyMultipart.vue
2
+ // src/v2/blocks/request-block/components/RequestBodyMultipart.vue
3
3
  var RequestBodyMultipart_default = RequestBodyMultipart_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
4
  export { RequestBodyMultipart_default as default };
6
5
 
7
6
  //# sourceMappingURL=RequestBodyMultipart.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyMultipart.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyMultipart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { isObject } from '@scalar/helpers/object/is-object'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport {\n coerceLeafValueToSchemaType,\n getExampleFromSchema,\n getMultipartItemSchema,\n} from '@scalar/workspace-store/request-example'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport {\n isArraySchema,\n isObjectSchema,\n} from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, shallowRef, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport {\n getMultipartBodyParts,\n updateMultipartBodyPart,\n type MultipartBodyPart,\n type MultipartBodyValue,\n} from '@/v2/blocks/request-block/helpers/multipart-body'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { value, media, compositionSelection } = defineProps<{\n value: MultipartBodyValue\n media: MediaTypeObject\n compositionSelection?: Record<string, number>\n}>()\nconst emit = defineEmits<{\n 'update:value': [value: MultipartBodyValue]\n}>()\nconst { translate } = useLocalization()\nconst localValue = shallowRef<MultipartBodyValue>(value)\nconst drafts = ref<Record<string, string>>({})\nconst errors = ref<Record<string, boolean>>({})\n\nwatch(\n () => value,\n (next) => {\n if (next !== localValue.value) {\n drafts.value = {}\n errors.value = {}\n localValue.value = next\n }\n },\n)\n\nconst parts = computed<\n (MultipartBodyPart & {\n id: string\n label: string\n text: string | undefined\n filename: string | undefined\n })[]\n>(() =>\n getMultipartBodyParts(localValue.value, media, compositionSelection).map(\n (part) => ({\n ...part,\n id: JSON.stringify(part.path),\n label: part.path.every((segment) => typeof segment === 'number')\n ? translate('apiClient.requestBody.part', {\n number: part.path.map((segment) => Number(segment) + 1).join('.'),\n })\n : part.path\n .map((segment) =>\n typeof segment === 'number' ? segment + 1 : segment,\n )\n .join(' / '),\n text:\n typeof part.value === 'string'\n ? part.value\n : part.value == null\n ? ''\n : JSON.stringify(part.value, null, 2),\n filename: part.value instanceof File ? part.value.name : undefined,\n }),\n ),\n)\nconst canAddPart = computed<boolean>(() => {\n const schema = resolveFormSchema(media.schema, compositionSelection)\n return (\n Array.isArray(localValue.value) &&\n !(\n schema &&\n 'maxItems' in schema &&\n schema.maxItems !== undefined &&\n localValue.value.length >= schema.maxItems\n )\n )\n})\n\nconst updatePart = (part: MultipartBodyPart, next: unknown): void => {\n localValue.value = updateMultipartBodyPart(localValue.value, part.path, next)\n emit('update:value', localValue.value)\n}\nconst editPart = (part: MultipartBodyPart, text: string): void => {\n const id = JSON.stringify(part.path)\n drafts.value[id] = text\n try {\n const structured =\n Array.isArray(part.value) ||\n isObject(part.value) ||\n (part.schema &&\n (isObjectSchema(part.schema) || isArraySchema(part.schema)))\n const next = structured\n ? JSON.parse(text)\n : coerceLeafValueToSchemaType(text, part.schema)\n errors.value[id] = false\n updatePart(part, next)\n } catch {\n errors.value[id] = true\n }\n}\nconst uploadFile = (part: MultipartBodyPart): void => {\n const { open } = useFileDialog({\n multiple: false,\n accept: '*/*',\n onChange: (files) => {\n const file = files?.[0]\n if (file) {\n delete drafts.value[JSON.stringify(part.path)]\n delete errors.value[JSON.stringify(part.path)]\n updatePart(part, file)\n }\n },\n })\n void open()\n}\nconst removeFile = (part: MultipartBodyPart): void => {\n delete drafts.value[JSON.stringify(part.path)]\n updatePart(part, '')\n}\nconst addPart = (): void => {\n if (!Array.isArray(localValue.value) || !canAddPart.value) {\n return\n }\n const schema = getMultipartItemSchema(\n resolveFormSchema(media.schema, compositionSelection),\n localValue.value.length,\n media.itemSchema,\n )\n const next = schema ? getExampleFromSchema(schema, { mode: 'write' }) : ''\n localValue.value = [...localValue.value, next ?? '']\n emit('update:value', localValue.value)\n}\n</script>\n\n<template>\n <div class=\"min-w-0 border-t\">\n <div\n v-for=\"part in parts\"\n :key=\"part.id\"\n class=\"flex min-w-0 flex-col gap-2 border-b p-3\">\n <div class=\"text-c-2 flex items-center justify-between gap-2 text-xs\">\n <span>{{ part.label }}</span>\n <span\n v-if=\"part.contentType\"\n class=\"truncate\"\n >{{ part.contentType }}</span\n >\n </div>\n <div\n v-if=\"part.filename !== undefined\"\n class=\"flex items-center justify-between gap-2\">\n <span class=\"text-c-1 truncate text-sm\">{{ part.filename }}</span>\n <ScalarButton\n :aria-label=\"`${translate('apiClient.requestBody.delete')} ${part.label}`\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"removeFile(part)\">\n {{ translate('apiClient.requestBody.delete') }}\n </ScalarButton>\n </div>\n <template v-else>\n <textarea\n :aria-invalid=\"errors[part.id] || undefined\"\n :aria-label=\"part.label\"\n class=\"text-c-1 bg-b-1 font-code min-h-16 w-full resize-y rounded border p-2 text-xs\"\n :value=\"drafts[part.id] ?? part.text\"\n @input=\"\n editPart(part, ($event.target as HTMLTextAreaElement).value)\n \" />\n <div\n v-if=\"errors[part.id]\"\n class=\"text-red text-xs\"\n role=\"alert\">\n {{ translate('apiClient.requestBody.invalidPart') }}\n </div>\n <ScalarButton\n v-if=\"part.canUpload\"\n :aria-label=\"`${translate('apiClient.requestBody.selectFile')} ${part.label}`\"\n class=\"self-start\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"uploadFile(part)\">\n {{ translate('apiClient.requestBody.selectFile') }}\n </ScalarButton>\n </template>\n </div>\n <ScalarButton\n v-if=\"canAddPart\"\n class=\"m-3\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"addPart\">\n {{ translate('apiClient.requestBody.addPart') }}\n </ScalarButton>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestBodyMultipart.vue.js","names":[],"sources":[],"mappings":""}
@@ -1,13 +1,13 @@
1
- import { useLocalization } from "../../../features/localization/index.js";
2
1
  import { useFileDialog } from "../../../../hooks/use-file-dialog.js";
3
2
  import { getMultipartBodyParts, updateMultipartBodyPart } from "../helpers/multipart-body.js";
3
+ import { useLocalization } from "../../../features/localization/index.js";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, shallowRef, toDisplayString, unref, watch, withCtx } from "vue";
5
5
  import { ScalarButton } from "@scalar/components/button";
6
6
  import { coerceLeafValueToSchemaType, getExampleFromSchema, getMultipartItemSchema } from "@scalar/workspace-store/request-example";
7
7
  import { isObject } from "@scalar/helpers/object/is-object";
8
8
  import { isArraySchema, isObjectSchema } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
9
9
  import { resolveFormSchema } from "@scalar/workspace-store/helpers/resolve-form-schema";
10
- //#region src/v2/blocks/request-block/components/RequestBodyMultipart.vue?vue&type=script&setup=true&lang.ts
10
+ // src/v2/blocks/request-block/components/RequestBodyMultipart.vue?vue&type=script&setup=true&lang.ts
11
11
  var _hoisted_1 = { class: "min-w-0 border-t" };
12
12
  var _hoisted_2 = { class: "text-c-2 flex items-center justify-between gap-2 text-xs" };
13
13
  var _hoisted_3 = {
@@ -34,6 +34,8 @@ var RequestBodyMultipart_vue_vue_type_script_setup_true_lang_default = /*@__PURE
34
34
  __name: "RequestBodyMultipart",
35
35
  props: {
36
36
  value: {},
37
+ openapiVersion: {},
38
+ jsonSchemaDialect: {},
37
39
  media: {},
38
40
  compositionSelection: {}
39
41
  },
@@ -99,7 +101,11 @@ var RequestBodyMultipart_vue_vue_type_script_setup_true_lang_default = /*@__PURE
99
101
  const addPart = () => {
100
102
  if (!Array.isArray(localValue.value) || !canAddPart.value) return;
101
103
  const schema = getMultipartItemSchema(resolveFormSchema(__props.media.schema, __props.compositionSelection), localValue.value.length, __props.media.itemSchema);
102
- const next = schema ? getExampleFromSchema(schema, { mode: "write" }) : "";
104
+ const next = schema ? getExampleFromSchema(schema, {
105
+ mode: "write",
106
+ openapiVersion: __props.openapiVersion,
107
+ jsonSchemaDialect: __props.jsonSchemaDialect
108
+ }) : "";
103
109
  localValue.value = [...localValue.value, next ?? ""];
104
110
  emit("update:value", localValue.value);
105
111
  };
@@ -150,7 +156,6 @@ var RequestBodyMultipart_vue_vue_type_script_setup_true_lang_default = /*@__PURE
150
156
  };
151
157
  }
152
158
  });
153
- //#endregion
154
159
  export { RequestBodyMultipart_vue_vue_type_script_setup_true_lang_default as default };
155
160
 
156
161
  //# sourceMappingURL=RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_createCommentVNode","_createVNode","_unref","_withCtx","_createTextVNode","_createBlock"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyMultipart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { isObject } from '@scalar/helpers/object/is-object'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport {\n coerceLeafValueToSchemaType,\n getExampleFromSchema,\n getMultipartItemSchema,\n} from '@scalar/workspace-store/request-example'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport {\n isArraySchema,\n isObjectSchema,\n} from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, shallowRef, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport {\n getMultipartBodyParts,\n updateMultipartBodyPart,\n type MultipartBodyPart,\n type MultipartBodyValue,\n} from '@/v2/blocks/request-block/helpers/multipart-body'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { value, media, compositionSelection } = defineProps<{\n value: MultipartBodyValue\n media: MediaTypeObject\n compositionSelection?: Record<string, number>\n}>()\nconst emit = defineEmits<{\n 'update:value': [value: MultipartBodyValue]\n}>()\nconst { translate } = useLocalization()\nconst localValue = shallowRef<MultipartBodyValue>(value)\nconst drafts = ref<Record<string, string>>({})\nconst errors = ref<Record<string, boolean>>({})\n\nwatch(\n () => value,\n (next) => {\n if (next !== localValue.value) {\n drafts.value = {}\n errors.value = {}\n localValue.value = next\n }\n },\n)\n\nconst parts = computed<\n (MultipartBodyPart & {\n id: string\n label: string\n text: string | undefined\n filename: string | undefined\n })[]\n>(() =>\n getMultipartBodyParts(localValue.value, media, compositionSelection).map(\n (part) => ({\n ...part,\n id: JSON.stringify(part.path),\n label: part.path.every((segment) => typeof segment === 'number')\n ? translate('apiClient.requestBody.part', {\n number: part.path.map((segment) => Number(segment) + 1).join('.'),\n })\n : part.path\n .map((segment) =>\n typeof segment === 'number' ? segment + 1 : segment,\n )\n .join(' / '),\n text:\n typeof part.value === 'string'\n ? part.value\n : part.value == null\n ? ''\n : JSON.stringify(part.value, null, 2),\n filename: part.value instanceof File ? part.value.name : undefined,\n }),\n ),\n)\nconst canAddPart = computed<boolean>(() => {\n const schema = resolveFormSchema(media.schema, compositionSelection)\n return (\n Array.isArray(localValue.value) &&\n !(\n schema &&\n 'maxItems' in schema &&\n schema.maxItems !== undefined &&\n localValue.value.length >= schema.maxItems\n )\n )\n})\n\nconst updatePart = (part: MultipartBodyPart, next: unknown): void => {\n localValue.value = updateMultipartBodyPart(localValue.value, part.path, next)\n emit('update:value', localValue.value)\n}\nconst editPart = (part: MultipartBodyPart, text: string): void => {\n const id = JSON.stringify(part.path)\n drafts.value[id] = text\n try {\n const structured =\n Array.isArray(part.value) ||\n isObject(part.value) ||\n (part.schema &&\n (isObjectSchema(part.schema) || isArraySchema(part.schema)))\n const next = structured\n ? JSON.parse(text)\n : coerceLeafValueToSchemaType(text, part.schema)\n errors.value[id] = false\n updatePart(part, next)\n } catch {\n errors.value[id] = true\n }\n}\nconst uploadFile = (part: MultipartBodyPart): void => {\n const { open } = useFileDialog({\n multiple: false,\n accept: '*/*',\n onChange: (files) => {\n const file = files?.[0]\n if (file) {\n delete drafts.value[JSON.stringify(part.path)]\n delete errors.value[JSON.stringify(part.path)]\n updatePart(part, file)\n }\n },\n })\n void open()\n}\nconst removeFile = (part: MultipartBodyPart): void => {\n delete drafts.value[JSON.stringify(part.path)]\n updatePart(part, '')\n}\nconst addPart = (): void => {\n if (!Array.isArray(localValue.value) || !canAddPart.value) {\n return\n }\n const schema = getMultipartItemSchema(\n resolveFormSchema(media.schema, compositionSelection),\n localValue.value.length,\n media.itemSchema,\n )\n const next = schema ? getExampleFromSchema(schema, { mode: 'write' }) : ''\n localValue.value = [...localValue.value, next ?? '']\n emit('update:value', localValue.value)\n}\n</script>\n\n<template>\n <div class=\"min-w-0 border-t\">\n <div\n v-for=\"part in parts\"\n :key=\"part.id\"\n class=\"flex min-w-0 flex-col gap-2 border-b p-3\">\n <div class=\"text-c-2 flex items-center justify-between gap-2 text-xs\">\n <span>{{ part.label }}</span>\n <span\n v-if=\"part.contentType\"\n class=\"truncate\"\n >{{ part.contentType }}</span\n >\n </div>\n <div\n v-if=\"part.filename !== undefined\"\n class=\"flex items-center justify-between gap-2\">\n <span class=\"text-c-1 truncate text-sm\">{{ part.filename }}</span>\n <ScalarButton\n :aria-label=\"`${translate('apiClient.requestBody.delete')} ${part.label}`\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"removeFile(part)\">\n {{ translate('apiClient.requestBody.delete') }}\n </ScalarButton>\n </div>\n <template v-else>\n <textarea\n :aria-invalid=\"errors[part.id] || undefined\"\n :aria-label=\"part.label\"\n class=\"text-c-1 bg-b-1 font-code min-h-16 w-full resize-y rounded border p-2 text-xs\"\n :value=\"drafts[part.id] ?? part.text\"\n @input=\"\n editPart(part, ($event.target as HTMLTextAreaElement).value)\n \" />\n <div\n v-if=\"errors[part.id]\"\n class=\"text-red text-xs\"\n role=\"alert\">\n {{ translate('apiClient.requestBody.invalidPart') }}\n </div>\n <ScalarButton\n v-if=\"part.canUpload\"\n :aria-label=\"`${translate('apiClient.requestBody.selectFile')} ${part.label}`\"\n class=\"self-start\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"uploadFile(part)\">\n {{ translate('apiClient.requestBody.selectFile') }}\n </ScalarButton>\n </template>\n </div>\n <ScalarButton\n v-if=\"canAddPart\"\n class=\"m-3\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"addPart\">\n {{ translate('apiClient.requestBody.addPart') }}\n </ScalarButton>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,OAAO;EAGb,MAAM,EAAE,cAAc,gBAAgB;EACtC,MAAM,aAAa,WAA+B,QAAA,KAAK;EACvD,MAAM,SAAS,IAA4B,CAAC,CAAC;EAC7C,MAAM,SAAS,IAA6B,CAAC,CAAC;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GAAA;;IALb,OAAM;IACN,MAAK;IACL,SAAQ;IACP,SAAO;;IACR,SAAAC,cAAgD,CAA7CC,gBAAAL,gBAAAG,MAAA,SAAA,CAAS,CAAA,+BAAA,CAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_createVNode","_unref","_withCtx","_createTextVNode","_createBlock"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyMultipart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { isObject } from '@scalar/helpers/object/is-object'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport {\n coerceLeafValueToSchemaType,\n getExampleFromSchema,\n getMultipartItemSchema,\n} from '@scalar/workspace-store/request-example'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport {\n isArraySchema,\n isObjectSchema,\n} from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, shallowRef, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport {\n getMultipartBodyParts,\n updateMultipartBodyPart,\n type MultipartBodyPart,\n type MultipartBodyValue,\n} from '@/v2/blocks/request-block/helpers/multipart-body'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n value,\n media,\n compositionSelection,\n openapiVersion,\n jsonSchemaDialect,\n} = defineProps<{\n value: MultipartBodyValue\n openapiVersion?: string\n /** Document-level JSON Schema dialect used when generating array `contains` examples. */\n jsonSchemaDialect?: string\n media: MediaTypeObject\n compositionSelection?: Record<string, number>\n}>()\nconst emit = defineEmits<{\n 'update:value': [value: MultipartBodyValue]\n}>()\nconst { translate } = useLocalization()\nconst localValue = shallowRef<MultipartBodyValue>(value)\nconst drafts = ref<Record<string, string>>({})\nconst errors = ref<Record<string, boolean>>({})\n\nwatch(\n () => value,\n (next) => {\n if (next !== localValue.value) {\n drafts.value = {}\n errors.value = {}\n localValue.value = next\n }\n },\n)\n\nconst parts = computed<\n (MultipartBodyPart & {\n id: string\n label: string\n text: string | undefined\n filename: string | undefined\n })[]\n>(() =>\n getMultipartBodyParts(localValue.value, media, compositionSelection).map(\n (part) => ({\n ...part,\n id: JSON.stringify(part.path),\n label: part.path.every((segment) => typeof segment === 'number')\n ? translate('apiClient.requestBody.part', {\n number: part.path.map((segment) => Number(segment) + 1).join('.'),\n })\n : part.path\n .map((segment) =>\n typeof segment === 'number' ? segment + 1 : segment,\n )\n .join(' / '),\n text:\n typeof part.value === 'string'\n ? part.value\n : part.value == null\n ? ''\n : JSON.stringify(part.value, null, 2),\n filename: part.value instanceof File ? part.value.name : undefined,\n }),\n ),\n)\nconst canAddPart = computed<boolean>(() => {\n const schema = resolveFormSchema(media.schema, compositionSelection)\n return (\n Array.isArray(localValue.value) &&\n !(\n schema &&\n 'maxItems' in schema &&\n schema.maxItems !== undefined &&\n localValue.value.length >= schema.maxItems\n )\n )\n})\n\nconst updatePart = (part: MultipartBodyPart, next: unknown): void => {\n localValue.value = updateMultipartBodyPart(localValue.value, part.path, next)\n emit('update:value', localValue.value)\n}\nconst editPart = (part: MultipartBodyPart, text: string): void => {\n const id = JSON.stringify(part.path)\n drafts.value[id] = text\n try {\n const structured =\n Array.isArray(part.value) ||\n isObject(part.value) ||\n (part.schema &&\n (isObjectSchema(part.schema) || isArraySchema(part.schema)))\n const next = structured\n ? JSON.parse(text)\n : coerceLeafValueToSchemaType(text, part.schema)\n errors.value[id] = false\n updatePart(part, next)\n } catch {\n errors.value[id] = true\n }\n}\nconst uploadFile = (part: MultipartBodyPart): void => {\n const { open } = useFileDialog({\n multiple: false,\n accept: '*/*',\n onChange: (files) => {\n const file = files?.[0]\n if (file) {\n delete drafts.value[JSON.stringify(part.path)]\n delete errors.value[JSON.stringify(part.path)]\n updatePart(part, file)\n }\n },\n })\n void open()\n}\nconst removeFile = (part: MultipartBodyPart): void => {\n delete drafts.value[JSON.stringify(part.path)]\n updatePart(part, '')\n}\nconst addPart = (): void => {\n if (!Array.isArray(localValue.value) || !canAddPart.value) {\n return\n }\n const schema = getMultipartItemSchema(\n resolveFormSchema(media.schema, compositionSelection),\n localValue.value.length,\n media.itemSchema,\n )\n const next = schema\n ? getExampleFromSchema(schema, {\n mode: 'write',\n openapiVersion,\n jsonSchemaDialect,\n })\n : ''\n localValue.value = [...localValue.value, next ?? '']\n emit('update:value', localValue.value)\n}\n</script>\n\n<template>\n <div class=\"min-w-0 border-t\">\n <div\n v-for=\"part in parts\"\n :key=\"part.id\"\n class=\"flex min-w-0 flex-col gap-2 border-b p-3\">\n <div class=\"text-c-2 flex items-center justify-between gap-2 text-xs\">\n <span>{{ part.label }}</span>\n <span\n v-if=\"part.contentType\"\n class=\"truncate\"\n >{{ part.contentType }}</span\n >\n </div>\n <div\n v-if=\"part.filename !== undefined\"\n class=\"flex items-center justify-between gap-2\">\n <span class=\"text-c-1 truncate text-sm\">{{ part.filename }}</span>\n <ScalarButton\n :aria-label=\"`${translate('apiClient.requestBody.delete')} ${part.label}`\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"removeFile(part)\">\n {{ translate('apiClient.requestBody.delete') }}\n </ScalarButton>\n </div>\n <template v-else>\n <textarea\n :aria-invalid=\"errors[part.id] || undefined\"\n :aria-label=\"part.label\"\n class=\"text-c-1 bg-b-1 font-code min-h-16 w-full resize-y rounded border p-2 text-xs\"\n :value=\"drafts[part.id] ?? part.text\"\n @input=\"\n editPart(part, ($event.target as HTMLTextAreaElement).value)\n \" />\n <div\n v-if=\"errors[part.id]\"\n class=\"text-red text-xs\"\n role=\"alert\">\n {{ translate('apiClient.requestBody.invalidPart') }}\n </div>\n <ScalarButton\n v-if=\"part.canUpload\"\n :aria-label=\"`${translate('apiClient.requestBody.selectFile')} ${part.label}`\"\n class=\"self-start\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"uploadFile(part)\">\n {{ translate('apiClient.requestBody.selectFile') }}\n </ScalarButton>\n </template>\n </div>\n <ScalarButton\n v-if=\"canAddPart\"\n class=\"m-3\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"addPart\">\n {{ translate('apiClient.requestBody.addPart') }}\n </ScalarButton>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA,MAAM,OAAO;EAGb,MAAM,EAAE,cAAc,gBAAgB;EACtC,MAAM,aAAa,WAA+B,QAAA,KAAK;EACvD,MAAM,SAAS,IAA4B,CAAC,CAAC;EAC7C,MAAM,SAAS,IAA6B,CAAC,CAAC;EAE9C,YACQ,QAAA,QACL,SAAS;GACR,IAAI,SAAS,WAAW,OAAO;IAC7B,OAAO,QAAQ,CAAC;IAChB,OAAO,QAAQ,CAAC;IAChB,WAAW,QAAQ;GACrB;EACF,CACF;EAEA,MAAM,QAAQ,eAQZ,sBAAsB,WAAW,OAAO,QAAA,OAAO,QAAA,oBAAoB,CAAC,CAAC,KAClE,UAAU;GACT,GAAG;GACH,IAAI,KAAK,UAAU,KAAK,IAAI;GAC5B,OAAO,KAAK,KAAK,OAAO,YAAY,OAAO,YAAY,QAAQ,IAC3D,UAAU,8BAA8B,EACtC,QAAQ,KAAK,KAAK,KAAK,YAAY,OAAO,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAClE,CAAC,IACD,KAAK,KACF,KAAK,YACJ,OAAO,YAAY,WAAW,UAAU,IAAI,OAC9C,CAAA,CACC,KAAK,KAAK;GACjB,MACE,OAAO,KAAK,UAAU,WAClB,KAAK,QACL,KAAK,SAAS,OACZ,KACA,KAAK,UAAU,KAAK,OAAO,MAAM,CAAC;GAC1C,UAAU,KAAK,iBAAiB,OAAO,KAAK,MAAM,OAAO,KAAA;EAC3D,EACF,CACF;EACA,MAAM,aAAa,eAAwB;GACzC,MAAM,SAAS,kBAAkB,QAAA,MAAM,QAAQ,QAAA,oBAAoB;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KAAK,OADpBJ,UAAA,GAAAC,mBAKM,OALN,YAKMI,gBADDE,MAAA,SAAA,CAAS,CAAA,mCAAA,CAAA,GAAA,CAAA,K;KAGN,KAAK,aADbP,UAAA,GAAAU,YAQeH,MAAA,YAAA,GAAA;;MANZ,cAAU,GAAKA,MAAA,SAAA,CAAS,CAAA,kCAAA,EAAA,GAAwC,KAAK;MACtE,OAAM;MACN,MAAK;MACL,SAAQ;MACP,UAAK,WAAE,WAAW,IAAI;;MACvB,SAAAC,cAAmD,CAAhDC,gBAAAJ,gBAAAE,MAAA,SAAA,CAAS,CAAA,kCAAA,CAAA,GAAA,CAAA,C;;;;G,WAKV,WAAA,SADRP,UAAA,GAAAU,YAOeH,MAAA,YAAA,GAAA;;IALb,OAAM;IACN,MAAK;IACL,SAAQ;IACP,SAAO;;IACR,SAAAC,cAAgD,CAA7CC,gBAAAJ,gBAAAE,MAAA,SAAA,CAAS,CAAA,+BAAA,CAAA,GAAA,CAAA,C"}
@@ -1,7 +1,6 @@
1
1
  import RequestBodyStructured_vue_vue_type_script_setup_true_lang_default from "./RequestBodyStructured.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/v2/blocks/request-block/components/RequestBodyStructured.vue
2
+ // src/v2/blocks/request-block/components/RequestBodyStructured.vue
3
3
  var RequestBodyStructured_default = RequestBodyStructured_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
4
  export { RequestBodyStructured_default as default };
6
5
 
7
6
  //# sourceMappingURL=RequestBodyStructured.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyStructured.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyStructured.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport { foldStructuredBodyRows } from '@/v2/blocks/request-block/helpers/fold-structured-body-rows'\nimport { getStructuredBodyRows } from '@/v2/blocks/request-block/helpers/get-structured-body-rows'\nimport { getStructuredBodyCodec } from '@/v2/blocks/request-block/helpers/structured-body-codec'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { parsedValue, bodySchema, contentType, environment } = defineProps<{\n /** The parsed (object) value of the structured body */\n parsedValue: unknown\n /** Resolved schema for the body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** The selected content type, decides how the folded body is serialized (JSON/YAML) */\n contentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n /** Serialized body text for the current content type */\n (e: 'update:value', payload: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst codec = computed(() => getStructuredBodyCodec(contentType))\n\n/** Local state for the body rows */\nconst localRows = ref<TableRow[]>([])\n\n/**\n * The serialized string we last emitted. Store updates triggered by our own emit come\n * back through the `parsedValue` prop — skip the row rebuild for those so typing does\n * not churn focus and a just-cleared row does not vanish mid-edit.\n */\nlet lastEmitted: string | undefined\n\nwatch(\n () => [parsedValue, bodySchema, contentType] as const,\n ([newValue, schema]) => {\n if (lastEmitted !== undefined && codec.value) {\n try {\n if (codec.value.stringify(newValue) === lastEmitted) {\n return\n }\n } catch {\n // Not serializable — treat as an external change and rebuild.\n }\n }\n lastEmitted = undefined\n localRows.value = getStructuredBodyRows(newValue, schema)\n },\n { immediate: true },\n)\n\nconst emitRows = () => {\n if (!codec.value) {\n return\n }\n const serialized = codec.value.stringify(\n foldStructuredBodyRows(localRows.value, bodySchema),\n )\n lastEmitted = serialized\n emit('update:value', serialized)\n}\n\n/** Update a row in the table, combines with the previous data so we emit the whole body */\nconst handleUpsertRow = (\n index: number,\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n) => {\n // Add new row\n if (index >= localRows.value.length) {\n localRows.value = [\n ...localRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n emitRows()\n return\n }\n\n localRows.value = localRows.value.map((row, i) =>\n i === index ? { ...row, ...payload } : row,\n )\n emitRows()\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number) => {\n localRows.value = localRows.value.filter((_, i) => i !== index)\n emitRows()\n}\n</script>\n\n<template>\n <RequestTable\n :data=\"localRows\"\n deferKeyUpdates\n :environment=\"environment\"\n :label=\"translate('apiClient.requestBodyStructured.body')\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestBodyStructured.vue.js","names":[],"sources":[],"mappings":""}
@@ -1,10 +1,10 @@
1
- import { useLocalization } from "../../../features/localization/index.js";
2
1
  import RequestTable_default from "./RequestTable.vue.js";
3
2
  import { foldStructuredBodyRows } from "../helpers/fold-structured-body-rows.js";
4
3
  import { getStructuredBodyRows } from "../helpers/get-structured-body-rows.js";
5
4
  import { getStructuredBodyCodec } from "../helpers/structured-body-codec.js";
5
+ import { useLocalization } from "../../../features/localization/index.js";
6
6
  import { computed, createBlock, defineComponent, openBlock, ref, unref, watch } from "vue";
7
- //#region src/v2/blocks/request-block/components/RequestBodyStructured.vue?vue&type=script&setup=true&lang.ts
7
+ // src/v2/blocks/request-block/components/RequestBodyStructured.vue?vue&type=script&setup=true&lang.ts
8
8
  var RequestBodyStructured_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
9
9
  __name: "RequestBodyStructured",
10
10
  props: {
@@ -82,7 +82,6 @@ var RequestBodyStructured_vue_vue_type_script_setup_true_lang_default = /*@__PUR
82
82
  };
83
83
  }
84
84
  });
85
- //#endregion
86
85
  export { RequestBodyStructured_vue_vue_type_script_setup_true_lang_default as default };
87
86
 
88
87
  //# sourceMappingURL=RequestBodyStructured.vue_vue_type_script_setup_true_lang.js.map
@@ -1,7 +1,6 @@
1
1
  import RequestBodyViewToggle_vue_vue_type_script_setup_true_lang_default from "./RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/v2/blocks/request-block/components/RequestBodyViewToggle.vue
2
+ // src/v2/blocks/request-block/components/RequestBodyViewToggle.vue
3
3
  var RequestBodyViewToggle_default = RequestBodyViewToggle_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
4
  export { RequestBodyViewToggle_default as default };
6
5
 
7
6
  //# sourceMappingURL=RequestBodyViewToggle.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyViewToggle.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyViewToggle.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { showForm = true, showSchema = false } = defineProps<{\n modelValue: 'form' | 'raw' | 'schema'\n /** Offer the structured form editor when the body supports it. */\n showForm?: boolean\n /** Offer read-only schema inspection when a schema exists. */\n showSchema?: boolean\n /** Non-text editors use Body instead of Raw. */\n rawLabel?: string\n /** Disable switching to the form view (e.g. while the raw body is not parseable) */\n disabled?: boolean\n}>()\n\ndefineEmits<{\n (e: 'update:modelValue', v: 'form' | 'raw' | 'schema'): void\n}>()\n\nconst { translate } = useLocalization()\n</script>\n<template>\n <div\n class=\"text-c-3 text-xxs -my-1 mr-2 flex justify-center gap-0.5 rounded p-0.5\">\n <button\n v-if=\"showForm\"\n :aria-pressed=\"modelValue === 'form'\"\n class=\"rounded px-1\"\n :class=\"\n disabled\n ? 'cursor-not-allowed opacity-50'\n : {\n 'bg-b-3 text-c-1 cursor-default': modelValue === 'form',\n 'hover:bg-b-3': modelValue !== 'form',\n }\n \"\n :disabled=\"disabled\"\n :title=\"\n disabled\n ? translate('apiClient.requestBodyViewToggle.fixBody')\n : undefined\n \"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'form')\">\n {{ translate('apiClient.requestBodyViewToggle.form') }}\n </button>\n <button\n :aria-pressed=\"modelValue === 'raw'\"\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'raw' }\"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'raw')\">\n {{ rawLabel ?? translate('apiClient.requestBodyViewToggle.raw') }}\n </button>\n <button\n v-if=\"showSchema\"\n :aria-pressed=\"modelValue === 'schema'\"\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'schema' }\"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'schema')\">\n {{ translate('apiClient.requestBodyViewToggle.schema') }}\n </button>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestBodyViewToggle.vue.js","names":[],"sources":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { useLocalization } from "../../../features/localization/index.js";
2
2
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withModifiers } from "vue";
3
- //#region src/v2/blocks/request-block/components/RequestBodyViewToggle.vue?vue&type=script&setup=true&lang.ts
3
+ // src/v2/blocks/request-block/components/RequestBodyViewToggle.vue?vue&type=script&setup=true&lang.ts
4
4
  var _hoisted_1 = { class: "text-c-3 text-xxs -my-1 mr-2 flex justify-center gap-0.5 rounded p-0.5" };
5
5
  var _hoisted_2 = [
6
6
  "aria-pressed",
@@ -58,7 +58,6 @@ var RequestBodyViewToggle_vue_vue_type_script_setup_true_lang_default = /*@__PUR
58
58
  };
59
59
  }
60
60
  });
61
- //#endregion
62
61
  export { RequestBodyViewToggle_vue_vue_type_script_setup_true_lang_default as default };
63
62
 
64
63
  //# sourceMappingURL=RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js","names":["$emit","_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_toDisplayString","_createCommentVNode","_createElementVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyViewToggle.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { showForm = true, showSchema = false } = defineProps<{\n modelValue: 'form' | 'raw' | 'schema'\n /** Offer the structured form editor when the body supports it. */\n showForm?: boolean\n /** Offer read-only schema inspection when a schema exists. */\n showSchema?: boolean\n /** Non-text editors use Body instead of Raw. */\n rawLabel?: string\n /** Disable switching to the form view (e.g. while the raw body is not parseable) */\n disabled?: boolean\n}>()\n\ndefineEmits<{\n (e: 'update:modelValue', v: 'form' | 'raw' | 'schema'): void\n}>()\n\nconst { translate } = useLocalization()\n</script>\n<template>\n <div\n class=\"text-c-3 text-xxs -my-1 mr-2 flex justify-center gap-0.5 rounded p-0.5\">\n <button\n v-if=\"showForm\"\n :aria-pressed=\"modelValue === 'form'\"\n class=\"rounded px-1\"\n :class=\"\n disabled\n ? 'cursor-not-allowed opacity-50'\n : {\n 'bg-b-3 text-c-1 cursor-default': modelValue === 'form',\n 'hover:bg-b-3': modelValue !== 'form',\n }\n \"\n :disabled=\"disabled\"\n :title=\"\n disabled\n ? translate('apiClient.requestBodyViewToggle.fixBody')\n : undefined\n \"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'form')\">\n {{ translate('apiClient.requestBodyViewToggle.form') }}\n </button>\n <button\n :aria-pressed=\"modelValue === 'raw'\"\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'raw' }\"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'raw')\">\n {{ rawLabel ?? translate('apiClient.requestBodyViewToggle.raw') }}\n </button>\n <button\n v-if=\"showSchema\"\n :aria-pressed=\"modelValue === 'schema'\"\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'schema' }\"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue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AAM,gBAAAF,MAAA,SAAA,CAAS,CAAA,wCAAA,CAAA,GAAA,IAAA,UAAA,K"}
1
+ {"version":3,"file":"RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js","names":["$emit","_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_toDisplayString","_createElementVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyViewToggle.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { showForm = true, showSchema = false } = defineProps<{\n modelValue: 'form' | 'raw' | 'schema'\n /** Offer the structured form editor when the body supports it. */\n showForm?: boolean\n /** Offer read-only schema inspection when a schema exists. */\n showSchema?: boolean\n /** Non-text editors use Body instead of Raw. */\n rawLabel?: string\n /** Disable switching to the form view (e.g. while the raw body is not parseable) */\n disabled?: boolean\n}>()\n\ndefineEmits<{\n (e: 'update:modelValue', v: 'form' | 'raw' | 'schema'): void\n}>()\n\nconst { translate } = useLocalization()\n</script>\n<template>\n <div\n class=\"text-c-3 text-xxs -my-1 mr-2 flex justify-center gap-0.5 rounded p-0.5\">\n <button\n v-if=\"showForm\"\n :aria-pressed=\"modelValue === 'form'\"\n class=\"rounded px-1\"\n :class=\"\n disabled\n ? 'cursor-not-allowed opacity-50'\n : {\n 'bg-b-3 text-c-1 cursor-default': modelValue === 'form',\n 'hover:bg-b-3': modelValue !== 'form',\n }\n \"\n :disabled=\"disabled\"\n :title=\"\n disabled\n ? translate('apiClient.requestBodyViewToggle.fixBody')\n : undefined\n \"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'form')\">\n {{ translate('apiClient.requestBodyViewToggle.form') }}\n </button>\n <button\n :aria-pressed=\"modelValue === 'raw'\"\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'raw' }\"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'raw')\">\n {{ rawLabel ?? translate('apiClient.requestBodyViewToggle.raw') }}\n </button>\n <button\n v-if=\"showSchema\"\n :aria-pressed=\"modelValue === 'schema'\"\n class=\"hover:bg-b-3 rounded px-1\"\n :class=\"{ 'bg-b-3 text-c-1 cursor-default': modelValue === 'schema' }\"\n type=\"button\"\n @click.stop=\"$emit('update:modelValue', 'schema')\">\n {{ translate('apiClient.requestBodyViewToggle.schema') }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,EAAE,cAAc,gBAAgB;;GAGpC,OAAAC,UAAA,GAAAC,mBAyCM,OAzCN,YAyCM;IAtCI,QAAA,YADRD,UAAA,GAAAC,mBAqBS,UAAA;;KAnBN,gBAAc,QAAA,eAAU;KACzB,OAAKC,eAAA,CAAC,gBACW,QAAA,W;MAAmH,kCAAA,QAAA,eAAU;MAA2C,gBAAA,QAAA,eAAU;;KAQlM,UAAU,QAAA;KACV,OAAgB,QAAA,WAAqBC,MAAA,SAAA,CAAS,CAAA,yCAAA,IAAwD,KAAA;KAKvG,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAAC,eAAA,WAAOL,KAAAA,MAAK,qBAAA,MAAA,GAAA,CAAA,MAAA,CAAA;IACf,GAAAM,gBAAAF,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,IAAA,UAAA,K;IAEdG,mBAOS,UAAA;KANN,gBAAc,QAAA,eAAU;KACzB,OAAKJ,eAAA,CAAC,6BAA2B,EAAA,kCACW,QAAA,eAAU,MAAA,CAAA,CAAA;KACtD,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAAE,eAAA,WAAOL,KAAAA,MAAK,qBAAA,KAAA,GAAA,CAAA,MAAA,CAAA;IACf,GAAAM,gBAAA,QAAA,YAAYF,MAAA,SAAA,CAAS,CAAA,qCAAA,CAAA,GAAA,IAAA,UAAA;IAGlB,QAAA,cADRH,UAAA,GAAAC,mBAQS,UAAA;;KANN,gBAAc,QAAA,eAAU;KACzB,OAAKC,eAAA,CAAC,6BAA2B,EAAA,kCACW,QAAA,eAAU,SAAA,CAAA,CAAA;KACtD,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAAE,eAAA,WAAOL,KAAAA,MAAK,qBAAA,QAAA,GAAA,CAAA,MAAA,CAAA;IACf,GAAAM,gBAAAF,MAAA,SAAA,CAAS,CAAA,wCAAA,CAAA,GAAA,IAAA,UAAA,K"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestCodeSnippet.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"names":[],"mappings":"AAmLA,OAAO,EAOL,KAAK,gBAAgB,EAEtB,MAAM,6BAA6B,CAAA;AAMpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAOvE,KAAK,WAAW,GAAG,gBAAgB,GAAG;IAAE,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAkUtE,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestCodeSnippet.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"names":[],"mappings":"AAqLA,OAAO,EAOL,KAAK,gBAAgB,EAEtB,MAAM,6BAA6B,CAAA;AAMpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAOvE,KAAK,WAAW,GAAG,gBAAgB,GAAG;IAAE,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAoUtE,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,6 @@
1
1
  import RequestCodeSnippet_vue_vue_type_script_setup_true_lang_default from "./RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/v2/blocks/request-block/components/RequestCodeSnippet.vue
2
+ // src/v2/blocks/request-block/components/RequestCodeSnippet.vue
3
3
  var RequestCodeSnippet_default = RequestCodeSnippet_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
4
  export { RequestCodeSnippet_default as default };
6
5
 
7
6
  //# sourceMappingURL=RequestCodeSnippet.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestCodeSnippet.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n findClient,\n generateCodeSnippet,\n getClients,\n getCustomCodeSamples,\n getSecrets,\n type ClientOption,\n type CodeExampleProps,\n type CustomClientOption,\n} from '@scalar/blocks/code-example'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed, ref, watch } from 'vue'\n\nimport { DataTable, DataTableRow } from '@/v2/components/data-table'\nimport { CollapsibleSection } from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n clientOptions,\n eventBus,\n operation,\n method,\n path,\n selectedContentType,\n selectedServer = null,\n selectedExample,\n securitySchemes,\n selectedClient,\n globalCookies,\n openapiVersion,\n requestBodyCompositionSelection,\n integration,\n} = defineProps<CodeExampleProps & { eventBus: WorkspaceEventBus }>()\n\nconst { translate } = useLocalization()\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(\n customCodeSamples.value.samples,\n clientOptions,\n customCodeSamples.value.label,\n ),\n)\n\n/**\n * The locally selected client which would include code samples from this operation only\n * Must be local state because it contains custom code samples from this operation only\n */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/**\n * Re-resolve the local client whenever the global selection or the available\n * clients change. Watching `clients` matters when navigating between operations:\n * the stored id stays the same, but the matching option (e.g. a custom sample)\n * differs per operation, so without this the snippet could go stale.\n */\nwatch([() => selectedClient, clients], ([newClient]) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes ?? []))\n\n/** Handle client change */\nconst handleClientChange = (option: ClientOption | undefined) => {\n localSelectedClient.value = option\n\n // Sync the selection globally (built-in client or custom sample keyed by language)\n if (option) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string | null>(() =>\n generateCodeSnippet({\n defaultDisabledParameters: true,\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value.samples,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExample,\n globalCookies,\n openapiVersion,\n requestBodyCompositionSelection,\n includeDefaultHeaders: integration === 'client',\n }),\n)\n\n/** Check if there are any clients available (built-in or custom code samples) */\nconst hasClients = computed(() =>\n clients.value.some((group) => group.options.length > 0),\n)\n</script>\n\n<template>\n <CollapsibleSection\n v-if=\"hasClients\"\n class=\"group/preview w-full border-t\"\n :defaultOpen=\"false\">\n <template #title>\n {{ translate('apiClient.requestCodeSnippet.codeSnippet') }}\n </template>\n\n <!-- Client selector -->\n <template #actions>\n <div class=\"flex flex-1\">\n <ScalarCombobox\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n @update:modelValue=\"\n (ev) => handleClientChange(ev as ClientOption | undefined)\n \">\n <template #default=\"{ open }\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"open && 'rotate-180'\"\n weight=\"bold\" />\n </ScalarButton>\n </template>\n </ScalarCombobox>\n </div>\n </template>\n\n <!-- Code snippet -->\n <ScalarErrorBoundary>\n <DataTable\n :columns=\"['']\"\n presentational>\n <DataTableRow>\n <div class=\"overflow-hidden\">\n <div\n v-if=\"generatedCode === null\"\n class=\"text-c-2 p-4\"\n role=\"status\">\n {{ translate('apiClient.requestCodeSnippet.unavailable') }}\n </div>\n <ScalarCodeBlock\n v-else\n class=\"text-base\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :label=\"translate('apiClient.requestCodeSnippet.codeSnippet')\"\n :lang=\"localSelectedClient?.lang ?? 'plaintext'\"\n lineNumbers />\n </div>\n </DataTableRow>\n </DataTable>\n </ScalarErrorBoundary>\n </CollapsibleSection>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestCodeSnippet.vue.js","names":[],"sources":[],"mappings":""}
@@ -1,7 +1,7 @@
1
- import { useLocalization } from "../../../features/localization/index.js";
2
1
  import DataTable_default from "../../../components/data-table/DataTable.vue.js";
3
2
  import DataTableRow_default from "../../../components/data-table/DataTableRow.vue.js";
4
3
  import CollapsibleSection_default from "../../../components/layout/CollapsibleSection.vue.js";
4
+ import { useLocalization } from "../../../features/localization/index.js";
5
5
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
6
6
  import { ScalarButton } from "@scalar/components/button";
7
7
  import { ScalarIconCaretDown } from "@scalar/icons";
@@ -9,7 +9,7 @@ import { ScalarCombobox } from "@scalar/components/combobox";
9
9
  import { findClient, generateCodeSnippet, getClients, getCustomCodeSamples, getSecrets } from "@scalar/blocks/code-example";
10
10
  import { ScalarErrorBoundary } from "@scalar/components/error-boundary";
11
11
  import { ScalarCodeBlock } from "@scalar/components/code-block";
12
- //#region src/v2/blocks/request-block/components/RequestCodeSnippet.vue?vue&type=script&setup=true&lang.ts
12
+ // src/v2/blocks/request-block/components/RequestCodeSnippet.vue?vue&type=script&setup=true&lang.ts
13
13
  var _hoisted_1 = { class: "flex flex-1" };
14
14
  var _hoisted_2 = { class: "overflow-hidden" };
15
15
  var _hoisted_3 = {
@@ -40,6 +40,7 @@ var RequestCodeSnippet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
40
40
  isWebhook: { type: Boolean },
41
41
  globalCookies: {},
42
42
  openapiVersion: {},
43
+ jsonSchemaDialect: {},
43
44
  requestBodyCompositionSelection: {}
44
45
  },
45
46
  setup(__props) {
@@ -84,6 +85,7 @@ var RequestCodeSnippet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
84
85
  example: __props.selectedExample,
85
86
  globalCookies: __props.globalCookies,
86
87
  openapiVersion: __props.openapiVersion,
88
+ jsonSchemaDialect: __props.jsonSchemaDialect,
87
89
  requestBodyCompositionSelection: __props.requestBodyCompositionSelection,
88
90
  includeDefaultHeaders: __props.integration === "client"
89
91
  }));
@@ -146,7 +148,6 @@ var RequestCodeSnippet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
146
148
  };
147
149
  }
148
150
  });
149
- //#endregion
150
151
  export { RequestCodeSnippet_vue_vue_type_script_setup_true_lang_default as default };
151
152
 
152
153
  //# sourceMappingURL=RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","CollapsibleSection","_withCtx","_createTextVNode","_toDisplayString","_createElementVNode","_createVNode","_normalizeClass","DataTable","DataTableRow","_createElementBlock","_createCommentVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n findClient,\n generateCodeSnippet,\n getClients,\n getCustomCodeSamples,\n getSecrets,\n type ClientOption,\n type CodeExampleProps,\n type CustomClientOption,\n} from '@scalar/blocks/code-example'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed, ref, watch } from 'vue'\n\nimport { DataTable, DataTableRow } from '@/v2/components/data-table'\nimport { CollapsibleSection } from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n clientOptions,\n eventBus,\n operation,\n method,\n path,\n selectedContentType,\n selectedServer = null,\n selectedExample,\n securitySchemes,\n selectedClient,\n globalCookies,\n openapiVersion,\n requestBodyCompositionSelection,\n integration,\n} = defineProps<CodeExampleProps & { eventBus: WorkspaceEventBus }>()\n\nconst { translate } = useLocalization()\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(\n customCodeSamples.value.samples,\n clientOptions,\n customCodeSamples.value.label,\n ),\n)\n\n/**\n * The locally selected client which would include code samples from this operation only\n * Must be local state because it contains custom code samples from this operation only\n */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/**\n * Re-resolve the local client whenever the global selection or the available\n * clients change. Watching `clients` matters when navigating between operations:\n * the stored id stays the same, but the matching option (e.g. a custom sample)\n * differs per operation, so without this the snippet could go stale.\n */\nwatch([() => selectedClient, clients], ([newClient]) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes ?? []))\n\n/** Handle client change */\nconst handleClientChange = (option: ClientOption | undefined) => {\n localSelectedClient.value = option\n\n // Sync the selection globally (built-in client or custom sample keyed by language)\n if (option) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string | null>(() =>\n generateCodeSnippet({\n defaultDisabledParameters: true,\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value.samples,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExample,\n globalCookies,\n openapiVersion,\n requestBodyCompositionSelection,\n includeDefaultHeaders: integration === 'client',\n }),\n)\n\n/** Check if there are any clients available (built-in or custom code samples) */\nconst hasClients = computed(() =>\n clients.value.some((group) => group.options.length > 0),\n)\n</script>\n\n<template>\n <CollapsibleSection\n v-if=\"hasClients\"\n class=\"group/preview w-full border-t\"\n :defaultOpen=\"false\">\n <template #title>\n {{ translate('apiClient.requestCodeSnippet.codeSnippet') }}\n </template>\n\n <!-- Client selector -->\n <template #actions>\n <div class=\"flex flex-1\">\n <ScalarCombobox\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n @update:modelValue=\"\n (ev) => handleClientChange(ev as ClientOption | undefined)\n \">\n <template #default=\"{ open }\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"open && 'rotate-180'\"\n weight=\"bold\" />\n </ScalarButton>\n </template>\n </ScalarCombobox>\n </div>\n </template>\n\n <!-- Code snippet -->\n <ScalarErrorBoundary>\n <DataTable\n :columns=\"['']\"\n presentational>\n <DataTableRow>\n <div class=\"overflow-hidden\">\n <div\n v-if=\"generatedCode === null\"\n class=\"text-c-2 p-4\"\n role=\"status\">\n {{ translate('apiClient.requestCodeSnippet.unavailable') }}\n </div>\n <ScalarCodeBlock\n v-else\n class=\"text-base\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :label=\"translate('apiClient.requestCodeSnippet.codeSnippet')\"\n :lang=\"localSelectedClient?.lang ?? 'plaintext'\"\n lineNumbers />\n </div>\n </DataTableRow>\n </DataTable>\n </ScalarErrorBoundary>\n </CollapsibleSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCA,MAAM,EAAE,cAAc,gBAAgB;;EAGtC,MAAM,oBAAoB,eAAe,qBAAqB,QAAA,SAAS,CAAC;;EAGxE,MAAM,UAAU,eACd,WACE,kBAAkB,MAAM,SACxB,QAAA,eACA,kBAAkB,MAAM,KAC1B,CACF;;;;;EAMA,MAAM,sBAAsB,IAC1B,WAAW,QAAQ,OAAO,QAAA,cAAc,CAC1C;;;;;;;EAQA,MAAM,OAAO,QAAA,gBAAgB,OAAO,IAAI,CAAC,eAAe;GACtD,MAAM,SAAS,WAAW,QAAQ,OAAO,SAAS;GAClD,IAAI,QACF,oBAAoB,QAAQ;EAEhC,CAAC;;EAGD,MAAM,oBAAoB,eAAe,WAAW,QAAA,mBAAmB,CAAC,CAAC,CAAC;;EAG1E,MAAM,sBAAsB,WAAqC;GAC/D,oBAAoB,QAAQ;GAG5B,IAAI,QACF,QAAA,SAAS,KAAK,oCAAoC,OAAO,EAAE;EAE/D;;EAGA,MAAM,gBAAgB,eACpB,oBAAoB;GAClB,2BAA2B;GAC3B,UAAU,oBAAoB,OAAO;GACrC,mBAAmB,kBAAkB,MAAM;GAC3C,WAAQ,QAAA;GACR,QAAK,QAAA;GACL,MAAG,QAAA;GACH,aAAa,QAAA;GACb,QAAQ,QAAA;GACR,iBAAc,QAAA;GACd,SAAS,QAAA;GACT,eAAY,QAAA;GACZ,gBAAa,QAAA;GACb,iCAA8B,QAAA;GAC9B,uBAAuB,QAAA,gBAAgB;EACzC,CAAC,CACH;;EAGA,MAAM,aAAa,eACjB,QAAQ,MAAM,MAAM,UAAU,MAAM,QAAQ,SAAS,CAAC,CACxD;;GAKU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ChC,aAAA"}
1
+ {"version":3,"file":"RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","CollapsibleSection","_withCtx","_createTextVNode","_toDisplayString","_createElementVNode","_createVNode","_normalizeClass","DataTable","DataTableRow","_createElementBlock"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n findClient,\n generateCodeSnippet,\n getClients,\n getCustomCodeSamples,\n getSecrets,\n type ClientOption,\n type CodeExampleProps,\n type CustomClientOption,\n} from '@scalar/blocks/code-example'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed, ref, watch } from 'vue'\n\nimport { DataTable, DataTableRow } from '@/v2/components/data-table'\nimport { CollapsibleSection } from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n clientOptions,\n eventBus,\n operation,\n method,\n path,\n selectedContentType,\n selectedServer = null,\n selectedExample,\n securitySchemes,\n selectedClient,\n globalCookies,\n openapiVersion,\n jsonSchemaDialect,\n requestBodyCompositionSelection,\n integration,\n} = defineProps<CodeExampleProps & { eventBus: WorkspaceEventBus }>()\n\nconst { translate } = useLocalization()\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(\n customCodeSamples.value.samples,\n clientOptions,\n customCodeSamples.value.label,\n ),\n)\n\n/**\n * The locally selected client which would include code samples from this operation only\n * Must be local state because it contains custom code samples from this operation only\n */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/**\n * Re-resolve the local client whenever the global selection or the available\n * clients change. Watching `clients` matters when navigating between operations:\n * the stored id stays the same, but the matching option (e.g. a custom sample)\n * differs per operation, so without this the snippet could go stale.\n */\nwatch([() => selectedClient, clients], ([newClient]) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes ?? []))\n\n/** Handle client change */\nconst handleClientChange = (option: ClientOption | undefined) => {\n localSelectedClient.value = option\n\n // Sync the selection globally (built-in client or custom sample keyed by language)\n if (option) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string | null>(() =>\n generateCodeSnippet({\n defaultDisabledParameters: true,\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value.samples,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExample,\n globalCookies,\n openapiVersion,\n jsonSchemaDialect,\n requestBodyCompositionSelection,\n includeDefaultHeaders: integration === 'client',\n }),\n)\n\n/** Check if there are any clients available (built-in or custom code samples) */\nconst hasClients = computed(() =>\n clients.value.some((group) => group.options.length > 0),\n)\n</script>\n\n<template>\n <CollapsibleSection\n v-if=\"hasClients\"\n class=\"group/preview w-full border-t\"\n :defaultOpen=\"false\">\n <template #title>\n {{ translate('apiClient.requestCodeSnippet.codeSnippet') }}\n </template>\n\n <!-- Client selector -->\n <template #actions>\n <div class=\"flex flex-1\">\n <ScalarCombobox\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n @update:modelValue=\"\n (ev) => handleClientChange(ev as ClientOption | undefined)\n \">\n <template #default=\"{ open }\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"open && 'rotate-180'\"\n weight=\"bold\" />\n </ScalarButton>\n </template>\n </ScalarCombobox>\n </div>\n </template>\n\n <!-- Code snippet -->\n <ScalarErrorBoundary>\n <DataTable\n :columns=\"['']\"\n presentational>\n <DataTableRow>\n <div class=\"overflow-hidden\">\n <div\n v-if=\"generatedCode === null\"\n class=\"text-c-2 p-4\"\n role=\"status\">\n {{ translate('apiClient.requestCodeSnippet.unavailable') }}\n </div>\n <ScalarCodeBlock\n v-else\n class=\"text-base\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :label=\"translate('apiClient.requestCodeSnippet.codeSnippet')\"\n :lang=\"localSelectedClient?.lang ?? 'plaintext'\"\n lineNumbers />\n </div>\n </DataTableRow>\n </DataTable>\n </ScalarErrorBoundary>\n </CollapsibleSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,EAAE,cAAc,gBAAgB;;EAGtC,MAAM,oBAAoB,eAAe,qBAAqB,QAAA,SAAS,CAAC;;EAGxE,MAAM,UAAU,eACd,WACE,kBAAkB,MAAM,SACxB,QAAA,eACA,kBAAkB,MAAM,KAC1B,CACF;;;;;EAMA,MAAM,sBAAsB,IAC1B,WAAW,QAAQ,OAAO,QAAA,cAAc,CAC1C;;;;;;;EAQA,MAAM,OAAO,QAAA,gBAAgB,OAAO,IAAI,CAAC,eAAe;GACtD,MAAM,SAAS,WAAW,QAAQ,OAAO,SAAS;GAClD,IAAI,QACF,oBAAoB,QAAQ;EAEhC,CAAC;;EAGD,MAAM,oBAAoB,eAAe,WAAW,QAAA,mBAAmB,CAAC,CAAC,CAAC;;EAG1E,MAAM,sBAAsB,WAAqC;GAC/D,oBAAoB,QAAQ;GAG5B,IAAI,QACF,QAAA,SAAS,KAAK,oCAAoC,OAAO,EAAE;EAE/D;;EAGA,MAAM,gBAAgB,eACpB,oBAAoB;GAClB,2BAA2B;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N,cAiBe,CAjBfI,YAiBeN,MAAAS,oBAAA,GAAA,MAAA;OAhBb,SAAAP,cAeM,CAfNG,mBAeM,OAfN,YAeM,CAbI,cAAA,UAAa,QADrBP,UAAA,GAAAY,mBAKM,OALN,YAKMN,gBADDJ,MAAA,SAAA,CAAS,CAAA,0CAAA,CAAA,GAAA,CAAA,MAEdF,UAAA,GAAAC,YAOgBC,MAAA,eAAA,GAAA;;QALd,OAAM;QACL,SAAS,cAAA;QACT,iBAAiB,kBAAA;QACjB,OAAOA,MAAA,SAAA,CAAS,CAAA,0CAAA;QAChB,MAAM,oBAAA,OAAqB,QAAI;QAChC,aAAA"}
@@ -1,7 +1,6 @@
1
1
  import RequestParams_vue_vue_type_script_setup_true_lang_default from "./RequestParams.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/v2/blocks/request-block/components/RequestParams.vue
2
+ // src/v2/blocks/request-block/components/RequestParams.vue
3
3
  var RequestParams_default = RequestParams_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
4
  export { RequestParams_default as default };
6
5
 
7
6
  //# sourceMappingURL=RequestParams.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestParams.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarTooltip } from '@scalar/components/tooltip'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nimport { CollapsibleSection } from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTable from './RequestTable.vue'\nimport type { TableRow, TableRowUpsertPayload } from './RequestTableRow.vue'\n\nconst {\n rows,\n exampleKey,\n environment,\n title,\n globalRoute,\n showAddRowPlaceholder = true,\n eventBus,\n selectExpandedParameters = false,\n} = defineProps<{\n rows: TableRow[]\n exampleKey: string\n title: string\n label?: string\n /** Explain restrictions on parameter editing when needed. */\n description?: string\n invalidParams?: Set<string>\n globalRoute?: string\n showAddRowPlaceholder?: boolean\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n /** Offer empty object query fields on demand without changing the complete editing context. */\n selectExpandedParameters?: boolean\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'upsert',\n index: number,\n payload: ApiReferenceEvents['operation:upsert:parameter']['payload'] & {\n shouldRenameExpandedRow?: boolean\n },\n ): void\n (e: 'delete', payload: { index: number }): void\n (e: 'deleteAll'): void\n /** Select a value for a grouped global cookie preset at the given row index. */\n (e: 'selectPreset', index: number, value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst showTooltip = computed(() => rows.length > 1)\nconst table = useTemplateRef('table')\nconst pickerContainer = useTemplateRef('pickerContainer')\nconst selectedFields = ref<Set<string>>(new Set())\n\ntype IndexedRow = { row: TableRow; index: number }\ntype AvailableField = {\n id: string\n label: string\n description: TableRow['description']\n index: number\n}\n\nconst getFieldKey = (row: TableRow, name = row.name): string =>\n JSON.stringify([row.originalParameter?.in, row.originalParameter?.name, name])\n\n/** Single-field objects and ordinary parameters keep their existing presentation. */\nconst expandedParameters = computed<Set<TableRow['originalParameter']>>(() => {\n const counts = new Map<TableRow['originalParameter'], number>()\n for (const row of rows) {\n if (row.originalParameter?.in === 'query' && row.sourceParameterValuePath) {\n counts.set(\n row.originalParameter,\n (counts.get(row.originalParameter) ?? 0) + 1,\n )\n }\n }\n return new Set(\n [...counts]\n .filter(([, count]) => count > 1)\n .map(([parameter]) => parameter),\n )\n})\n\nconst isSelectable = (row: TableRow): boolean =>\n selectExpandedParameters &&\n Boolean(row.sourceParameterValuePath) &&\n expandedParameters.value.has(row.originalParameter)\n\n/** Keep original indexes: handlers rebuild object values from all rows, including hidden fields. */\nconst indexedRows = computed<IndexedRow[]>(() =>\n rows.map((row, index) => ({ row, index })),\n)\nconst visibleRows = computed<IndexedRow[]>(() =>\n indexedRows.value.filter(\n ({ row }) =>\n !isSelectable(row) ||\n row.isRequired ||\n (row.value !== '' && row.value !== null) ||\n selectedFields.value.has(getFieldKey(row)),\n ),\n)\nconst tableRows = computed<TableRow[]>(() =>\n visibleRows.value.map(({ row }) => row),\n)\nconst availableFields = computed<AvailableField[]>(() =>\n indexedRows.value\n .filter(\n (entry) => !visibleRows.value.some(({ index }) => index === entry.index),\n )\n .map(({ row, index }) => ({\n id: getFieldKey(row),\n label: row.name,\n description: row.description,\n index,\n })),\n)\n\nconst selectField = async (\n option: { id: string; index: number } | undefined,\n): Promise<void> => {\n if (!option) {\n return\n }\n selectedFields.value.add(option.id)\n await nextTick()\n table.value?.focusValue(\n visibleRows.value.findIndex(({ index }) => index === option.index),\n )\n}\n\n/** The appended placeholder belongs after all stored rows, including hidden fields. */\nconst getOriginalIndex = (index: number): number =>\n visibleRows.value[index]?.index ??\n rows.length + index - visibleRows.value.length\n\nconst deleteRow = (index: number): void => {\n const originalIndex = getOriginalIndex(index)\n const entry = visibleRows.value[index]\n if (entry) {\n selectedFields.value.delete(getFieldKey(entry.row))\n }\n emit('delete', {\n index: originalIndex,\n })\n}\n\nconst deleteAll = (): void => {\n selectedFields.value.clear()\n emit('deleteAll')\n}\n\n/** Needed for type guard */\nconst handleUpserRow = (\n index: number,\n payload: TableRowUpsertPayload,\n): void => {\n const { value, ...rest } = payload\n\n // Type guard here as we cannot add files to params\n if (value instanceof File) {\n return\n }\n\n const entry = visibleRows.value[index]\n if (entry && isSelectable(entry.row)) {\n // Editing a populated field keeps it visible even after its value is cleared.\n selectedFields.value.add(\n getFieldKey(\n entry.row,\n payload.shouldRenameExpandedRow ? payload.name : entry.row.name,\n ),\n )\n }\n emit('upsert', getOriginalIndex(index), { ...rest, value: value ?? '' })\n}\n</script>\n<template>\n <CollapsibleSection\n class=\"group/params\"\n :itemCount=\"tableRows.length\">\n <template #title>{{ title }}</template>\n <template #actions>\n <div\n class=\"text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100\">\n <ScalarTooltip\n v-if=\"showTooltip\"\n :content=\"\n translate('apiClient.requestParams.clearOptionalParameters')\n \"\n placement=\"left\">\n <ScalarButton\n :aria-label=\"\n translate('apiClient.requestParams.clearAll', { title })\n \"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deleteAll\">\n {{ translate('apiClient.requestParams.clear') }}\n </ScalarButton>\n </ScalarTooltip>\n </div>\n </template>\n <p\n v-if=\"description\"\n class=\"text-c-2 px-3 py-2 text-sm\">\n {{ description }}\n </p>\n <RequestTable\n ref=\"table\"\n class=\"flex-1\"\n :columns=\"['32px', '', '']\"\n :data=\"tableRows\"\n :environment=\"environment\"\n :exampleKey=\"exampleKey\"\n :globalRoute=\"globalRoute\"\n :invalidParams=\"invalidParams\"\n :label=\"label\"\n :showAddRowPlaceholder=\"showAddRowPlaceholder\"\n @deleteRow=\"deleteRow\"\n @navigate=\"(route) => eventBus.emit('ui:navigate', route)\"\n @selectPreset=\"(index, value) => emit('selectPreset', index, value)\"\n @upsertRow=\"handleUpserRow\" />\n <div\n v-if=\"availableFields.length\"\n class=\"border-t py-1\">\n <div\n ref=\"pickerContainer\"\n class=\"mx-2\">\n <ScalarCombobox\n :inputLabel=\"translate('apiClient.requestParams.searchParameters')\"\n :noResults=\"translate('apiClient.requestParams.noParametersFound')\"\n :options=\"availableFields\"\n :placeholder=\"translate('apiClient.requestParams.searchParameters')\"\n placement=\"bottom-start\"\n resize\n :target=\"pickerContainer ?? undefined\"\n @update:modelValue=\"selectField\">\n <ScalarButton\n class=\"gap-1.5\"\n size=\"sm\"\n variant=\"ghost\">\n <ScalarIconPlus class=\"size-3.5\" />\n {{ translate('apiClient.requestParams.addParameter') }}\n </ScalarButton>\n <template #option=\"{ option }\">\n <span class=\"min-w-0\">\n <span class=\"block break-all\">{{ option.label }}</span>\n <span\n v-if=\"option.description\"\n class=\"text-c-2 block text-xs\"\n >{{ option.description }}</span\n >\n </span>\n </template>\n </ScalarCombobox>\n </div>\n </div>\n </CollapsibleSection>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestParams.vue.js","names":[],"sources":[],"mappings":""}
@@ -1,12 +1,12 @@
1
+ import CollapsibleSection_default from "../../../components/layout/CollapsibleSection.vue.js";
1
2
  import { useLocalization } from "../../../features/localization/index.js";
2
3
  import RequestTable_default from "./RequestTable.vue.js";
3
- import CollapsibleSection_default from "../../../components/layout/CollapsibleSection.vue.js";
4
4
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, openBlock, ref, toDisplayString, unref, useTemplateRef, withCtx, withModifiers } from "vue";
5
5
  import { ScalarButton } from "@scalar/components/button";
6
6
  import { ScalarIconPlus } from "@scalar/icons";
7
7
  import { ScalarCombobox } from "@scalar/components/combobox";
8
8
  import { ScalarTooltip } from "@scalar/components/tooltip";
9
- //#region src/v2/blocks/request-block/components/RequestParams.vue?vue&type=script&setup=true&lang.ts
9
+ // src/v2/blocks/request-block/components/RequestParams.vue?vue&type=script&setup=true&lang.ts
10
10
  var _hoisted_1 = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" };
11
11
  var _hoisted_2 = {
12
12
  key: 0,
@@ -201,7 +201,6 @@ var RequestParams_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
201
201
  };
202
202
  }
203
203
  });
204
- //#endregion
205
204
  export { RequestParams_vue_vue_type_script_setup_true_lang_default as default };
206
205
 
207
206
  //# sourceMappingURL=RequestParams.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","CollapsibleSection","_withCtx","_createTextVNode","_toDisplayString","_createElementVNode","_createVNode","_withModifiers","_createCommentVNode","_createElementBlock","RequestTable"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestParams.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarTooltip } from '@scalar/components/tooltip'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nimport { CollapsibleSection } from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTable from './RequestTable.vue'\nimport type { TableRow, TableRowUpsertPayload } from './RequestTableRow.vue'\n\nconst {\n rows,\n exampleKey,\n environment,\n title,\n globalRoute,\n showAddRowPlaceholder = true,\n eventBus,\n selectExpandedParameters = false,\n} = defineProps<{\n rows: TableRow[]\n exampleKey: string\n title: string\n label?: string\n /** Explain restrictions on parameter editing when needed. */\n description?: string\n invalidParams?: Set<string>\n globalRoute?: string\n showAddRowPlaceholder?: boolean\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n /** Offer empty object query fields on demand without changing the complete editing context. */\n selectExpandedParameters?: boolean\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'upsert',\n index: number,\n payload: ApiReferenceEvents['operation:upsert:parameter']['payload'] & {\n shouldRenameExpandedRow?: boolean\n },\n ): void\n (e: 'delete', payload: { index: number }): void\n (e: 'deleteAll'): void\n /** Select a value for a grouped global cookie preset at the given row index. */\n (e: 'selectPreset', index: number, value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst showTooltip = computed(() => rows.length > 1)\nconst table = useTemplateRef('table')\nconst pickerContainer = useTemplateRef('pickerContainer')\nconst selectedFields = ref<Set<string>>(new Set())\n\ntype IndexedRow = { row: TableRow; index: number }\ntype AvailableField = {\n id: string\n label: string\n description: TableRow['description']\n index: number\n}\n\nconst getFieldKey = (row: TableRow, name = row.name): string =>\n JSON.stringify([row.originalParameter?.in, row.originalParameter?.name, name])\n\n/** Single-field objects and ordinary parameters keep their existing presentation. */\nconst expandedParameters = computed<Set<TableRow['originalParameter']>>(() => {\n const counts = new Map<TableRow['originalParameter'], number>()\n for (const row of rows) {\n if (row.originalParameter?.in === 'query' && row.sourceParameterValuePath) {\n counts.set(\n row.originalParameter,\n (counts.get(row.originalParameter) ?? 0) + 1,\n )\n }\n }\n return new Set(\n [...counts]\n .filter(([, count]) => count > 1)\n .map(([parameter]) => parameter),\n )\n})\n\nconst isSelectable = (row: TableRow): boolean =>\n selectExpandedParameters &&\n Boolean(row.sourceParameterValuePath) &&\n expandedParameters.value.has(row.originalParameter)\n\n/** Keep original indexes: handlers rebuild object values from all rows, including hidden fields. */\nconst indexedRows = computed<IndexedRow[]>(() =>\n rows.map((row, index) => ({ row, index })),\n)\nconst visibleRows = computed<IndexedRow[]>(() =>\n indexedRows.value.filter(\n ({ row }) =>\n !isSelectable(row) ||\n row.isRequired ||\n (row.value !== '' && row.value !== null) ||\n selectedFields.value.has(getFieldKey(row)),\n ),\n)\nconst tableRows = computed<TableRow[]>(() =>\n visibleRows.value.map(({ row }) => row),\n)\nconst availableFields = computed<AvailableField[]>(() =>\n indexedRows.value\n .filter(\n (entry) => !visibleRows.value.some(({ index }) => index === entry.index),\n )\n .map(({ row, index }) => ({\n id: getFieldKey(row),\n label: row.name,\n description: row.description,\n index,\n })),\n)\n\nconst selectField = async (\n option: { id: string; index: number } | undefined,\n): Promise<void> => {\n if (!option) {\n return\n }\n selectedFields.value.add(option.id)\n await nextTick()\n table.value?.focusValue(\n visibleRows.value.findIndex(({ index }) => index === option.index),\n )\n}\n\n/** The appended placeholder belongs after all stored rows, including hidden fields. */\nconst getOriginalIndex = (index: number): number =>\n visibleRows.value[index]?.index ??\n rows.length + index - visibleRows.value.length\n\nconst deleteRow = (index: number): void => {\n const originalIndex = getOriginalIndex(index)\n const entry = visibleRows.value[index]\n if (entry) {\n selectedFields.value.delete(getFieldKey(entry.row))\n }\n emit('delete', {\n index: originalIndex,\n })\n}\n\nconst deleteAll = (): void => {\n selectedFields.value.clear()\n emit('deleteAll')\n}\n\n/** Needed for type guard */\nconst handleUpserRow = (\n index: number,\n payload: TableRowUpsertPayload,\n): void => {\n const { value, ...rest } = payload\n\n // Type guard here as we cannot add files to params\n if (value instanceof File) {\n return\n }\n\n const entry = visibleRows.value[index]\n if (entry && isSelectable(entry.row)) {\n // Editing a populated field keeps it visible even after its value is cleared.\n selectedFields.value.add(\n getFieldKey(\n entry.row,\n payload.shouldRenameExpandedRow ? payload.name : entry.row.name,\n ),\n )\n }\n emit('upsert', getOriginalIndex(index), { ...rest, value: value ?? '' })\n}\n</script>\n<template>\n <CollapsibleSection\n class=\"group/params\"\n :itemCount=\"tableRows.length\">\n <template #title>{{ title }}</template>\n <template #actions>\n <div\n class=\"text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100\">\n <ScalarTooltip\n v-if=\"showTooltip\"\n :content=\"\n translate('apiClient.requestParams.clearOptionalParameters')\n \"\n placement=\"left\">\n <ScalarButton\n :aria-label=\"\n translate('apiClient.requestParams.clearAll', { title })\n \"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deleteAll\">\n {{ translate('apiClient.requestParams.clear') }}\n </ScalarButton>\n </ScalarTooltip>\n </div>\n </template>\n <p\n v-if=\"description\"\n class=\"text-c-2 px-3 py-2 text-sm\">\n {{ description }}\n </p>\n <RequestTable\n ref=\"table\"\n class=\"flex-1\"\n :columns=\"['32px', '', '']\"\n :data=\"tableRows\"\n :environment=\"environment\"\n :exampleKey=\"exampleKey\"\n :globalRoute=\"globalRoute\"\n :invalidParams=\"invalidParams\"\n :label=\"label\"\n :showAddRowPlaceholder=\"showAddRowPlaceholder\"\n @deleteRow=\"deleteRow\"\n @navigate=\"(route) => eventBus.emit('ui:navigate', route)\"\n @selectPreset=\"(index, value) => emit('selectPreset', index, value)\"\n @upsertRow=\"handleUpserRow\" />\n <div\n v-if=\"availableFields.length\"\n class=\"border-t py-1\">\n <div\n ref=\"pickerContainer\"\n class=\"mx-2\">\n <ScalarCombobox\n :inputLabel=\"translate('apiClient.requestParams.searchParameters')\"\n :noResults=\"translate('apiClient.requestParams.noParametersFound')\"\n :options=\"availableFields\"\n :placeholder=\"translate('apiClient.requestParams.searchParameters')\"\n placement=\"bottom-start\"\n resize\n :target=\"pickerContainer ?? undefined\"\n @update:modelValue=\"selectField\">\n <ScalarButton\n class=\"gap-1.5\"\n size=\"sm\"\n variant=\"ghost\">\n <ScalarIconPlus class=\"size-3.5\" />\n {{ translate('apiClient.requestParams.addParameter') }}\n </ScalarButton>\n <template #option=\"{ option }\">\n <span class=\"min-w-0\">\n <span class=\"block break-all\">{{ option.label }}</span>\n <span\n v-if=\"option.description\"\n class=\"text-c-2 block text-xs\"\n >{{ option.description }}</span\n >\n </span>\n </template>\n </ScalarCombobox>\n </div>\n </div>\n </CollapsibleSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,OAAO;EAcb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,cAAc,eAAe,QAAA,KAAK,SAAS,CAAC;EAClD,MAAM,QAAQ,eAAe,OAAO;EACpC,MAAM,kBAAkB,eAAe,iBAAiB;EACxD,MAAM,iBAAiB,oBAAiB,IAAI,IAAI,CAAC;EAUjD,MAAM,eAAe,KAAe,OAAO,IAAI,SAC7C,KAAK,UAAU;GAAC,IAAI,mBAAmB;GAAI,IAAI,mBAAmB;GAAM;EAAI,CAAC;;EAG/E,MAAM,qBAAqB,eAAmD;GAC5E,MAAM,yBAAS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I,YAAmCN,MAAA,cAAA,GAAA,EAAnB,OAAM,WAAU,CAAA,GAAGG,gBAAA,MACnCC,gBAAGJ,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"RequestParams.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","CollapsibleSection","_withCtx","_createTextVNode","_toDisplayString","_createElementVNode","_createVNode","_withModifiers","_createElementBlock","RequestTable"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestParams.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarTooltip } from '@scalar/components/tooltip'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nimport { CollapsibleSection } from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTable from './RequestTable.vue'\nimport type { TableRow, TableRowUpsertPayload } from './RequestTableRow.vue'\n\nconst {\n rows,\n exampleKey,\n environment,\n title,\n globalRoute,\n showAddRowPlaceholder = true,\n eventBus,\n selectExpandedParameters = false,\n} = defineProps<{\n rows: TableRow[]\n exampleKey: string\n title: string\n label?: string\n /** Explain restrictions on parameter editing when needed. */\n description?: string\n invalidParams?: Set<string>\n globalRoute?: string\n showAddRowPlaceholder?: boolean\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n /** Offer empty object query fields on demand without changing the complete editing context. */\n selectExpandedParameters?: boolean\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'upsert',\n index: number,\n payload: ApiReferenceEvents['operation:upsert:parameter']['payload'] & {\n shouldRenameExpandedRow?: boolean\n },\n ): void\n (e: 'delete', payload: { index: number }): void\n (e: 'deleteAll'): void\n /** Select a value for a grouped global cookie preset at the given row index. */\n (e: 'selectPreset', index: number, value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst showTooltip = computed(() => rows.length > 1)\nconst table = useTemplateRef('table')\nconst pickerContainer = useTemplateRef('pickerContainer')\nconst selectedFields = ref<Set<string>>(new Set())\n\ntype IndexedRow = { row: TableRow; index: number }\ntype AvailableField = {\n id: string\n label: string\n description: TableRow['description']\n index: number\n}\n\nconst getFieldKey = (row: TableRow, name = row.name): string =>\n JSON.stringify([row.originalParameter?.in, row.originalParameter?.name, name])\n\n/** Single-field objects and ordinary parameters keep their existing presentation. */\nconst expandedParameters = computed<Set<TableRow['originalParameter']>>(() => {\n const counts = new Map<TableRow['originalParameter'], number>()\n for (const row of rows) {\n if (row.originalParameter?.in === 'query' && row.sourceParameterValuePath) {\n counts.set(\n row.originalParameter,\n (counts.get(row.originalParameter) ?? 0) + 1,\n )\n }\n }\n return new Set(\n [...counts]\n .filter(([, count]) => count > 1)\n .map(([parameter]) => parameter),\n )\n})\n\nconst isSelectable = (row: TableRow): boolean =>\n selectExpandedParameters &&\n Boolean(row.sourceParameterValuePath) &&\n expandedParameters.value.has(row.originalParameter)\n\n/** Keep original indexes: handlers rebuild object values from all rows, including hidden fields. */\nconst indexedRows = computed<IndexedRow[]>(() =>\n rows.map((row, index) => ({ row, index })),\n)\nconst visibleRows = computed<IndexedRow[]>(() =>\n indexedRows.value.filter(\n ({ row }) =>\n !isSelectable(row) ||\n row.isRequired ||\n (row.value !== '' && row.value !== null) ||\n selectedFields.value.has(getFieldKey(row)),\n ),\n)\nconst tableRows = computed<TableRow[]>(() =>\n visibleRows.value.map(({ row }) => row),\n)\nconst availableFields = computed<AvailableField[]>(() =>\n indexedRows.value\n .filter(\n (entry) => !visibleRows.value.some(({ index }) => index === entry.index),\n )\n .map(({ row, index }) => ({\n id: getFieldKey(row),\n label: row.name,\n description: row.description,\n index,\n })),\n)\n\nconst selectField = async (\n option: { id: string; index: number } | undefined,\n): Promise<void> => {\n if (!option) {\n return\n }\n selectedFields.value.add(option.id)\n await nextTick()\n table.value?.focusValue(\n visibleRows.value.findIndex(({ index }) => index === option.index),\n )\n}\n\n/** The appended placeholder belongs after all stored rows, including hidden fields. */\nconst getOriginalIndex = (index: number): number =>\n visibleRows.value[index]?.index ??\n rows.length + index - visibleRows.value.length\n\nconst deleteRow = (index: number): void => {\n const originalIndex = getOriginalIndex(index)\n const entry = visibleRows.value[index]\n if (entry) {\n selectedFields.value.delete(getFieldKey(entry.row))\n }\n emit('delete', {\n index: originalIndex,\n })\n}\n\nconst deleteAll = (): void => {\n selectedFields.value.clear()\n emit('deleteAll')\n}\n\n/** Needed for type guard */\nconst handleUpserRow = (\n index: number,\n payload: TableRowUpsertPayload,\n): void => {\n const { value, ...rest } = payload\n\n // Type guard here as we cannot add files to params\n if (value instanceof File) {\n return\n }\n\n const entry = visibleRows.value[index]\n if (entry && isSelectable(entry.row)) {\n // Editing a populated field keeps it visible even after its value is cleared.\n selectedFields.value.add(\n getFieldKey(\n entry.row,\n payload.shouldRenameExpandedRow ? payload.name : entry.row.name,\n ),\n )\n }\n emit('upsert', getOriginalIndex(index), { ...rest, value: value ?? '' })\n}\n</script>\n<template>\n <CollapsibleSection\n class=\"group/params\"\n :itemCount=\"tableRows.length\">\n <template #title>{{ title }}</template>\n <template #actions>\n <div\n class=\"text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100\">\n <ScalarTooltip\n v-if=\"showTooltip\"\n :content=\"\n translate('apiClient.requestParams.clearOptionalParameters')\n \"\n placement=\"left\">\n <ScalarButton\n :aria-label=\"\n translate('apiClient.requestParams.clearAll', { title })\n \"\n class=\"pr-0.75 pl-1 transition-none\"\n size=\"sm\"\n variant=\"ghost\"\n @click.stop=\"deleteAll\">\n {{ translate('apiClient.requestParams.clear') }}\n </ScalarButton>\n </ScalarTooltip>\n </div>\n </template>\n <p\n v-if=\"description\"\n class=\"text-c-2 px-3 py-2 text-sm\">\n {{ description }}\n </p>\n <RequestTable\n ref=\"table\"\n class=\"flex-1\"\n :columns=\"['32px', '', '']\"\n :data=\"tableRows\"\n :environment=\"environment\"\n :exampleKey=\"exampleKey\"\n :globalRoute=\"globalRoute\"\n :invalidParams=\"invalidParams\"\n :label=\"label\"\n :showAddRowPlaceholder=\"showAddRowPlaceholder\"\n @deleteRow=\"deleteRow\"\n @navigate=\"(route) => eventBus.emit('ui:navigate', route)\"\n @selectPreset=\"(index, value) => emit('selectPreset', index, value)\"\n @upsertRow=\"handleUpserRow\" />\n <div\n v-if=\"availableFields.length\"\n class=\"border-t py-1\">\n <div\n ref=\"pickerContainer\"\n class=\"mx-2\">\n <ScalarCombobox\n :inputLabel=\"translate('apiClient.requestParams.searchParameters')\"\n :noResults=\"translate('apiClient.requestParams.noParametersFound')\"\n :options=\"availableFields\"\n :placeholder=\"translate('apiClient.requestParams.searchParameters')\"\n placement=\"bottom-start\"\n resize\n :target=\"pickerContainer ?? undefined\"\n @update:modelValue=\"selectField\">\n <ScalarButton\n class=\"gap-1.5\"\n size=\"sm\"\n variant=\"ghost\">\n <ScalarIconPlus class=\"size-3.5\" />\n {{ translate('apiClient.requestParams.addParameter') }}\n </ScalarButton>\n <template #option=\"{ option }\">\n <span class=\"min-w-0\">\n <span class=\"block break-all\">{{ option.label }}</span>\n <span\n v-if=\"option.description\"\n class=\"text-c-2 block text-xs\"\n >{{ option.description }}</span\n >\n </span>\n </template>\n </ScalarCombobox>\n </div>\n </div>\n </CollapsibleSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,OAAO;EAcb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,cAAc,eAAe,QAAA,KAAK,SAAS,CAAC;EAClD,MAAM,QAAQ,eAAe,OAAO;EACpC,MAAM,kBAAkB,eAAe,iBAAiB;EACxD,MAAM,iBAAiB,o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