@scalar/api-client 3.19.3 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  3. package/dist/components/SectionFilter.vue.d.ts +2 -0
  4. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  5. package/dist/components/SectionFilter.vue.js +1 -1
  6. package/dist/components/SectionFilter.vue.js.map +1 -1
  7. package/dist/components/SectionFilter.vue.script.js +11 -8
  8. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  9. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
  10. package/dist/components/Server/ServerVariablesSelect.vue.js.map +1 -1
  11. package/dist/components/Server/ServerVariablesSelect.vue.script.js +5 -3
  12. package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
  13. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
  14. package/dist/components/Server/ServerVariablesTextbox.vue.js.map +1 -1
  15. package/dist/components/Server/ServerVariablesTextbox.vue.script.js +6 -3
  16. package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
  17. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  18. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js.map +1 -1
  19. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +4 -2
  20. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
  21. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js.map +1 -1
  23. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +3 -1
  24. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
  25. package/dist/style.css +159 -135
  26. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -0
  27. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  29. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +9 -3
  30. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  31. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  33. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  34. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +10 -6
  35. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  36. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.d.ts.map +1 -1
  37. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
  38. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js.map +1 -1
  39. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +4 -2
  40. package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
  41. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  42. package/dist/v2/blocks/operation-block/helpers/send-request.js +4 -3
  43. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  44. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
  45. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  46. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  47. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  48. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +51 -26
  49. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  50. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  51. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  52. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  53. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +28 -8
  54. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  55. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  56. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  57. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +9 -3
  58. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  59. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.d.ts.map +1 -1
  60. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -1
  61. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +6 -4
  62. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
  63. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  64. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  65. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +3 -1
  66. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  68. package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +7 -5
  70. package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
  71. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
  72. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  75. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +40 -7
  76. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  77. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +12 -12
  78. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +24 -20
  81. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  82. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  83. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  84. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +6 -4
  85. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  86. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  87. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +5 -4
  88. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  89. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  90. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  91. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  92. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +34 -13
  93. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  94. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts +3 -3
  95. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  96. package/dist/v2/blocks/response-block/components/Headers.vue.js.map +1 -1
  97. package/dist/v2/blocks/response-block/components/Headers.vue.script.js +5 -3
  98. package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
  99. package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
  100. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
  101. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
  102. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +3 -1
  103. package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
  104. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js.map +1 -1
  106. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +11 -3
  107. package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
  108. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
  109. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
  110. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
  111. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +8 -6
  112. package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
  113. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts +1 -0
  114. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  115. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js.map +1 -1
  116. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +109 -56
  117. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
  118. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.d.ts.map +1 -1
  119. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js.map +1 -1
  120. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +5 -3
  121. package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
  122. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  123. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js.map +1 -1
  124. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +6 -3
  125. package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
  126. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  127. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
  128. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +7 -5
  129. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
  130. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
  131. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  132. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  133. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
  134. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +20 -15
  135. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
  136. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  137. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
  138. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
  139. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +4 -2
  140. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
  141. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  142. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js.map +1 -1
  143. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +11 -6
  144. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
  145. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts +4 -0
  146. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.d.ts.map +1 -0
  147. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js +100 -0
  148. package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js.map +1 -0
  149. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts +13 -0
  150. package/dist/v2/blocks/response-block/helpers/response-stream.d.ts.map +1 -0
  151. package/dist/v2/blocks/response-block/helpers/response-stream.js +97 -0
  152. package/dist/v2/blocks/response-block/helpers/response-stream.js.map +1 -0
  153. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +1 -1
  154. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  155. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  156. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  157. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +39 -27
  158. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  159. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +6 -6
  160. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  161. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  162. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  163. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +7 -4
  164. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  165. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  166. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
  167. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +21 -16
  168. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
  169. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  170. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  171. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +7 -5
  172. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  173. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  174. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js.map +1 -1
  175. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +7 -5
  176. package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
  177. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  178. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  179. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +105 -40
  180. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  181. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
  182. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
  183. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +10 -8
  184. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
  185. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  186. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  187. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +14 -9
  188. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  189. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
  190. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  191. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +6 -4
  192. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  193. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  194. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  195. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +3 -1
  196. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  197. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  198. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  199. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +40 -40
  200. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  201. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +108 -7
  202. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  203. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +12 -0
  204. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  205. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  206. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -1
  207. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +8 -5
  208. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  209. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +2 -0
  210. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  211. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +2 -0
  212. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  213. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts +3 -0
  214. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts.map +1 -0
  215. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js +8 -0
  216. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js.map +1 -0
  217. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts +3 -0
  218. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.d.ts.map +1 -0
  219. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js +11 -0
  220. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js.map +1 -0
  221. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts +19 -0
  222. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -0
  223. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +117 -0
  224. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -0
  225. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -1
  226. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  227. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +15 -11
  228. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  229. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts +1 -1
  230. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts.map +1 -1
  231. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +8 -1
  232. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js.map +1 -1
  233. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -1
  234. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +6 -0
  235. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  236. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -1
  237. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  238. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +8 -6
  239. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  240. package/dist/v2/components/code-input/CodeInput.vue.d.ts +4 -4
  241. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  242. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  243. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  244. package/dist/v2/components/code-input/CodeInput.vue.script.js +10 -10
  245. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  246. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts +4 -4
  247. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  248. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  249. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  250. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +8 -5
  251. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  252. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts +4 -0
  253. package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts.map +1 -1
  254. package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
  255. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +7 -3
  256. package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
  257. package/dist/v2/components/code-input/code-variable-widget.d.ts +3 -0
  258. package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -1
  259. package/dist/v2/components/code-input/code-variable-widget.js +6 -3
  260. package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
  261. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +0 -1
  262. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  263. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  264. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +4 -2
  265. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
  266. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  267. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  268. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  269. package/dist/v2/components/data-table/DataTableInput.vue.script.js +5 -3
  270. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  271. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  272. package/dist/v2/components/data-table/DataTableInputSelect.vue.js.map +1 -1
  273. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +12 -9
  274. package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
  275. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  276. package/dist/v2/components/forms/ConfirmationForm.vue.js.map +1 -1
  277. package/dist/v2/components/forms/ConfirmationForm.vue.script.js +5 -3
  278. package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
  279. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
  280. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  281. package/dist/v2/components/layout/CollapsibleSection.vue.script.js +3 -1
  282. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  283. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
  284. package/dist/v2/components/modals/DeleteModal.vue.js.map +1 -1
  285. package/dist/v2/components/modals/DeleteModal.vue.script.js +3 -1
  286. package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
  287. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  288. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  289. package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
  290. package/dist/v2/components/modals/ModalClientContainer.vue.script.js +5 -2
  291. package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
  292. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  293. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  294. package/dist/v2/components/server/ServerDropdown.vue.script.js +9 -5
  295. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  296. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  297. package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
  298. package/dist/v2/components/sidebar/Sidebar.vue.script.js +4 -2
  299. package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
  300. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  301. package/dist/v2/components/sidebar/SidebarMenu.vue.js.map +1 -1
  302. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +4 -2
  303. package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
  304. package/dist/v2/components/sidebar/SidebarToggle.vue.d.ts.map +1 -1
  305. package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
  306. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +4 -2
  307. package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
  308. package/dist/v2/constants.js +1 -1
  309. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -1
  310. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js.map +1 -1
  311. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +4 -2
  312. package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
  313. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +2 -2
  314. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  315. package/dist/v2/features/environments/EnvironmentsList.vue.js.map +1 -1
  316. package/dist/v2/features/environments/EnvironmentsList.vue.script.js +4 -2
  317. package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
  318. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  319. package/dist/v2/features/environments/components/Environment.vue.js.map +1 -1
  320. package/dist/v2/features/environments/components/Environment.vue.script.js +12 -10
  321. package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
  322. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
  323. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js.map +1 -1
  324. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +5 -3
  325. package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
  326. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
  327. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js.map +1 -1
  328. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +9 -6
  329. package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
  330. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  331. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  332. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +6 -4
  333. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  334. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  335. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
  336. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
  337. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +22 -10
  338. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
  339. package/dist/v2/features/localization/index.d.ts +18 -0
  340. package/dist/v2/features/localization/index.d.ts.map +1 -0
  341. package/dist/v2/features/localization/index.js +35 -0
  342. package/dist/v2/features/localization/index.js.map +1 -0
  343. package/dist/v2/features/localization/locales/ar.d.ts +385 -0
  344. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -0
  345. package/dist/v2/features/localization/locales/ar.js +345 -0
  346. package/dist/v2/features/localization/locales/ar.js.map +1 -0
  347. package/dist/v2/features/localization/locales/de.d.ts +385 -0
  348. package/dist/v2/features/localization/locales/de.d.ts.map +1 -0
  349. package/dist/v2/features/localization/locales/de.js +345 -0
  350. package/dist/v2/features/localization/locales/de.js.map +1 -0
  351. package/dist/v2/features/localization/locales/es.d.ts +385 -0
  352. package/dist/v2/features/localization/locales/es.d.ts.map +1 -0
  353. package/dist/v2/features/localization/locales/es.js +345 -0
  354. package/dist/v2/features/localization/locales/es.js.map +1 -0
  355. package/dist/v2/features/localization/locales/fr.d.ts +385 -0
  356. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -0
  357. package/dist/v2/features/localization/locales/fr.js +345 -0
  358. package/dist/v2/features/localization/locales/fr.js.map +1 -0
  359. package/dist/v2/features/localization/locales/pt.d.ts +385 -0
  360. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -0
  361. package/dist/v2/features/localization/locales/pt.js +345 -0
  362. package/dist/v2/features/localization/locales/pt.js.map +1 -0
  363. package/dist/v2/features/localization/locales/ru.d.ts +385 -0
  364. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -0
  365. package/dist/v2/features/localization/locales/ru.js +345 -0
  366. package/dist/v2/features/localization/locales/ru.js.map +1 -0
  367. package/dist/v2/features/localization/locales/zh-cn.d.ts +385 -0
  368. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -0
  369. package/dist/v2/features/localization/locales/zh-cn.js +345 -0
  370. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -0
  371. package/dist/v2/features/localization/translations.d.ts +385 -0
  372. package/dist/v2/features/localization/translations.d.ts.map +1 -0
  373. package/dist/v2/features/localization/translations.js +345 -0
  374. package/dist/v2/features/localization/translations.js.map +1 -0
  375. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  376. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  377. package/dist/v2/features/modal/Modal.vue.script.js +15 -4
  378. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  379. package/dist/v2/features/modal/use-lazy-api-client.d.ts +11 -0
  380. package/dist/v2/features/modal/use-lazy-api-client.d.ts.map +1 -0
  381. package/dist/v2/features/modal/use-lazy-api-client.js +48 -0
  382. package/dist/v2/features/modal/use-lazy-api-client.js.map +1 -0
  383. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  384. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  385. package/dist/v2/features/operation/Operation.vue.script.js +22 -6
  386. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  387. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
  388. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  389. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  390. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +12 -8
  391. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  392. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
  393. package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -1
  394. package/dist/v2/features/search/components/SearchResult.vue.script.js +14 -10
  395. package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
  396. package/dist/v2/types/options.d.ts +1 -1
  397. package/dist/v2/types/options.d.ts.map +1 -1
  398. package/dist/v2/workspace-events.d.ts +2 -2
  399. package/dist/v2/workspace-events.d.ts.map +1 -1
  400. package/dist/v2/workspace-events.js +8 -1
  401. package/dist/v2/workspace-events.js.map +1 -1
  402. package/dist/vue-styles.css +124 -125
  403. package/package.json +22 -11
@@ -1,6 +1,16 @@
1
1
  import type { ApiReferenceEvents } from '@scalar/workspace-store/events';
2
2
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
3
3
  import type { ParameterObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
4
+ type __VLS_Props = {
5
+ data: TableRow;
6
+ /** Keep key edits local until blur when the row identity depends on its name. */
7
+ deferKeyUpdates?: boolean;
8
+ hasCheckboxDisabled?: boolean;
9
+ invalidParams?: Set<string>;
10
+ label?: string;
11
+ environment: XScalarEnvironment;
12
+ showUploadButton?: boolean;
13
+ };
4
14
  export type TableRow = {
5
15
  /** The parameter or field name/key */
6
16
  name: string;
@@ -44,17 +54,8 @@ export type TableRowUpsertPayload = {
44
54
  isDisabled: boolean;
45
55
  shouldRenameExpandedRow?: boolean;
46
56
  };
47
- type __VLS_Props = {
48
- data: TableRow;
49
- /** Keep key edits local until blur when the row identity depends on its name. */
50
- deferKeyUpdates?: boolean;
51
- hasCheckboxDisabled?: boolean;
52
- invalidParams?: Set<string>;
53
- label?: string;
54
- environment: XScalarEnvironment;
55
- showUploadButton?: boolean;
56
- };
57
57
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
58
+ deleteRow: () => any;
58
59
  navigate: (route: NonNullable<({
59
60
  replace?: boolean;
60
61
  teamSlug?: string;
@@ -81,11 +82,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
81
82
  documentSlug?: string;
82
83
  })) | undefined>) => any;
83
84
  upsertRow: (payload: TableRowUpsertPayload) => any;
84
- deleteRow: () => any;
85
85
  uploadFile: () => any;
86
86
  removeFile: () => any;
87
87
  selectPreset: (value: string) => any;
88
88
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
89
+ onDeleteRow?: (() => any) | undefined;
89
90
  onNavigate?: ((route: NonNullable<({
90
91
  replace?: boolean;
91
92
  teamSlug?: string;
@@ -112,7 +113,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
112
113
  documentSlug?: string;
113
114
  })) | undefined>) => any) | undefined;
114
115
  onUpsertRow?: ((payload: TableRowUpsertPayload) => any) | undefined;
115
- onDeleteRow?: (() => any) | undefined;
116
116
  onUploadFile?: (() => any) | undefined;
117
117
  onRemoveFile?: (() => any) | undefined;
118
118
  onSelectPreset?: ((value: string) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableRow.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"names":[],"mappings":"AA4YA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAGxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAerE,MAAM,MAAM,QAAQ,GAAG;IACrB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mFAAmF;IACnF,WAAW,CAAC,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;I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B,CAAC,EAAE,eAAe,CAAA;IACnC,2FAA2F;IAC3F,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC,CAAA;AAusBD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableRow.vue.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile'): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value) return\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<string[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"`Include ${data.name || 'row'} in request`\"\n class=\"!border-r\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"`${label} Key`\"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n placeholder=\"Key\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n :aria-label=\"`${label} Value`\"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n placeholder=\"Value\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"`Delete ${data.name || 'row'}`\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n label=\"Global cookies are shared across the whole workspace. Click to navigate.\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n description=\"This is a readonly property and you can not modify it! If you want to change it you have to override it or disable it using the checkbox\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n Delete\n </button>\n </template>\n <template v-else>\n <div class=\"p-0.5\">\n <ScalarButton\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>Select File</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestTableRow.vue.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile'): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value) return\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<string[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.requestTableRow.include', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"!border-r\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"\n translate('apiClient.requestTableRow.keyLabel', { name: label ?? '' })\n \"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n :placeholder=\"translate('apiClient.requestTableRow.key')\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n :aria-label=\"\n translate('apiClient.requestTableRow.valueLabel', {\n name: label ?? '',\n })\n \"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n :placeholder=\"translate('apiClient.requestTableRow.value')\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"\n translate('apiClient.requestTableRow.deleteRow', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n :label=\"translate('apiClient.requestTableRow.globalCookieHint')\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n :description=\"translate('apiClient.requestTableRow.readOnlyHint')\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n {{ translate('apiClient.requestTableRow.delete') }}\n </button>\n </template>\n <template v-else>\n <div class=\"p-0.5\">\n <ScalarButton\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>{{ translate('apiClient.requestTableRow.selectFile') }}</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../../features/localization/index.js";
1
2
  import DataTableInputSelect_default from "../../../components/data-table/DataTableInputSelect.vue.js";
2
3
  import CodeInputLite_default from "../../../components/code-input/CodeInputLite.vue.js";
3
4
  import DataTableCell_default from "../../../components/data-table/DataTableCell.vue.js";
@@ -20,6 +21,14 @@ var _hoisted_3 = {
20
21
  key: 1,
21
22
  class: "p-0.5"
22
23
  };
24
+ /**
25
+ * Track local state for the row
26
+ *
27
+ * Now this is required because of the way we get default values from the schema.
28
+ * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now
29
+ * we have an example where value: ''. This is why we need to track the local state and update all of the params at the
30
+ * same time.
31
+ */
23
32
  var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
24
33
  __name: "RequestTableRow",
25
34
  props: {
@@ -41,14 +50,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
41
50
  ],
42
51
  setup(__props, { emit: __emit }) {
43
52
  const emit = __emit;
44
- /**
45
- * Track local state for the row
46
- *
47
- * Now this is required because of the way we get default values from the schema.
48
- * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now
49
- * we have an example where value: ''. This is why we need to track the local state and update all of the params at the
50
- * same time.
51
- */
53
+ const { translate } = useLocalization();
52
54
  const name = ref(__props.data.name ?? "");
53
55
  const value = ref(unpackProxyObject(__props.data.value) ?? "");
54
56
  const isDisabled = ref(__props.data.isDisabled ?? false);
@@ -122,7 +124,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
122
124
  }, {
123
125
  default: withCtx(() => [
124
126
  createVNode(unref(DataTableCheckbox_default), {
125
- ariaLabel: `Include ${__props.data.name || "row"} in request`,
127
+ ariaLabel: unref(translate)("apiClient.requestTableRow.include", { name: __props.data.name || unref(translate)("apiClient.requestTableRow.row") }),
126
128
  class: "!border-r",
127
129
  disabled: __props.hasCheckboxDisabled ?? false,
128
130
  modelValue: !isDisabled.value,
@@ -134,11 +136,11 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
134
136
  ]),
135
137
  createVNode(unref(DataTableCell_default), null, {
136
138
  default: withCtx(() => [createVNode(unref(CodeInputLite_default), {
137
- "aria-label": `${__props.label} Key`,
139
+ "aria-label": unref(translate)("apiClient.requestTableRow.keyLabel", { name: __props.label ?? "" }),
138
140
  disabled: __props.data.isReadonly,
139
141
  environment: __props.environment,
140
142
  modelValue: name.value,
141
- placeholder: "Key",
143
+ placeholder: unref(translate)("apiClient.requestTableRow.key"),
142
144
  required: Boolean(__props.data.isRequired),
143
145
  onBlur: _cache[1] || (_cache[1] = (v) => handleKeyBlur(v)),
144
146
  onKeydownCapture: handleKeydown,
@@ -149,6 +151,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
149
151
  "disabled",
150
152
  "environment",
151
153
  "modelValue",
154
+ "placeholder",
152
155
  "required"
153
156
  ])]),
154
157
  _: 1
@@ -162,7 +165,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
162
165
  "onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => emit("selectPreset", v))
163
166
  }, null, 8, ["modelValue", "value"])) : (openBlock(), createBlock(unref(CodeInputLite_default), {
164
167
  key: 1,
165
- "aria-label": `${__props.label} Value`,
168
+ "aria-label": unref(translate)("apiClient.requestTableRow.valueLabel", { name: __props.label ?? "" }),
166
169
  class: "pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10",
167
170
  default: defaultValue.value,
168
171
  disabled: __props.data.isReadonly,
@@ -171,7 +174,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
171
174
  examples: __props.data.schema?.examples?.map((example) => String(example)) ?? [],
172
175
  linethrough: __props.data.isOverridden,
173
176
  modelValue: displayValue.value,
174
- placeholder: "Value",
177
+ placeholder: unref(translate)("apiClient.requestTableRow.value"),
175
178
  type: typeValue.value,
176
179
  withFakeData: "",
177
180
  onNavigate: _cache[7] || (_cache[7] = (route) => emit("navigate", route)),
@@ -180,7 +183,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
180
183
  icon: withCtx(() => [
181
184
  Boolean(__props.data.name || value.value) && !__props.data.isRequired && __props.data.isReadonly !== true ? (openBlock(), createBlock(unref(ScalarButton), {
182
185
  key: 0,
183
- "aria-label": `Delete ${__props.data.name || "row"}`,
186
+ "aria-label": unref(translate)("apiClient.requestTableRow.deleteRow", { name: __props.data.name || unref(translate)("apiClient.requestTableRow.row") }),
184
187
  class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex",
185
188
  size: "sm",
186
189
  variant: "ghost",
@@ -193,17 +196,17 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
193
196
  key: 1,
194
197
  class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit",
195
198
  icon: unref(ScalarIconGlobe),
196
- label: "Global cookies are shared across the whole workspace. Click to navigate.",
199
+ label: unref(translate)("apiClient.requestTableRow.globalCookieHint"),
197
200
  size: "xs",
198
201
  tooltip: "top",
199
202
  variant: "ghost",
200
203
  onClick: _cache[6] || (_cache[6] = ($event) => emit("navigate", __props.data.globalRoute))
201
- }, null, 8, ["icon"])) : createCommentVNode("", true),
204
+ }, null, 8, ["icon", "label"])) : createCommentVNode("", true),
202
205
  __props.data.isReadonly ? (openBlock(), createBlock(RequestTableTooltip_default, {
203
206
  key: 2,
204
- description: "This is a readonly property and you can not modify it! If you want to change it you have to override it or disable it using the checkbox",
207
+ description: unref(translate)("apiClient.requestTableRow.readOnlyHint"),
205
208
  value: null
206
- })) : __props.data.schema ? (openBlock(), createBlock(RequestTableTooltip_default, {
209
+ }, null, 8, ["description"])) : __props.data.schema ? (openBlock(), createBlock(RequestTableTooltip_default, {
207
210
  key: 3,
208
211
  description: __props.data.description,
209
212
  schema: __props.data.schema,
@@ -224,6 +227,7 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
224
227
  "examples",
225
228
  "linethrough",
226
229
  "modelValue",
230
+ "placeholder",
227
231
  "type"
228
232
  ]))]),
229
233
  _: 1
@@ -239,13 +243,13 @@ var RequestTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
239
243
  class: "bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100",
240
244
  type: "button",
241
245
  onClick: _cache[9] || (_cache[9] = ($event) => emit("removeFile"))
242
- }, " Delete ")], 64)) : (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(ScalarButton), {
246
+ }, toDisplayString(unref(translate)("apiClient.requestTableRow.delete")), 1)], 64)) : (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(ScalarButton), {
243
247
  class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
244
248
  size: "sm",
245
249
  variant: "outlined",
246
250
  onClick: _cache[10] || (_cache[10] = ($event) => emit("uploadFile"))
247
251
  }, {
248
- default: withCtx(() => [_cache[11] || (_cache[11] = createElementVNode("span", null, "Select File", -1)), createVNode(unref(ScalarIcon), {
252
+ default: withCtx(() => [createElementVNode("span", null, toDisplayString(unref(translate)("apiClient.requestTableRow.selectFile")), 1), createVNode(unref(ScalarIcon), {
249
253
  class: "ml-1",
250
254
  icon: "Upload",
251
255
  size: "xs",
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableRow.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile'): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value) return\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<string[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"`Include ${data.name || 'row'} in request`\"\n class=\"!border-r\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"`${label} Key`\"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n placeholder=\"Key\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n :aria-label=\"`${label} Value`\"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n placeholder=\"Value\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"`Delete ${data.name || 'row'}`\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n label=\"Global cookies are shared across the whole workspace. Click to navigate.\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n description=\"This is a readonly property and you can not modify it! If you want to change it you have to override it or disable it using the checkbox\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n Delete\n </button>\n </template>\n <template v-else>\n <div class=\"p-0.5\">\n <ScalarButton\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>Select File</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div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,mBAaM,OAbN,YAaM,CAZJ,YAWe,MAAA,YAAA,GAAA;OAVb,OAAM;OACN,MAAK;OACL,SAAQ;OACP,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;;8BACY,CAAA,OAAA,QAAA,OAAA,MAAxB,mBAAwB,QAAA,MAAlB,eAAW,EAAA,IACjB,YAIoB,MAAA,UAAA,GAAA;QAHlB,OAAM;QACN,MAAK;QACL,MAAK;QACL,WAAU"}
1
+ {"version":3,"file":"RequestTableRow.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile'): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value) return\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<string[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.requestTableRow.include', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"!border-r\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"\n translate('apiClient.requestTableRow.keyLabel', { name: label ?? '' })\n \"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n :placeholder=\"translate('apiClient.requestTableRow.key')\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n :aria-label=\"\n translate('apiClient.requestTableRow.valueLabel', {\n name: label ?? '',\n })\n \"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n :placeholder=\"translate('apiClient.requestTableRow.value')\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"\n translate('apiClient.requestTableRow.deleteRow', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n :label=\"translate('apiClient.requestTableRow.globalCookieHint')\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n :description=\"translate('apiClient.requestTableRow.readOnlyHint')\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n {{ translate('apiClient.requestTableRow.delete') }}\n </button>\n </template>\n <template v-else>\n <div class=\"p-0.5\">\n <ScalarButton\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>{{ translate('apiClient.requestTableRow.selectFile') }}</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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AA;;MAjCd,OAAM;;6BAgBK,CAfK,OAAA,SAAA,UAAA,GAAhB,mBAeW,UAAA,EAAA,KAAA,EAAA,GAAA,CAdT,mBAOM,OAPN,YAOM,CALJ,mBAIC,QAAA;OAHC,OAAM;OACL,OAAO,aAAA;yBACJ,aAAA,KAAY,GAAA,GAAA,UAAA,CAAA,CAAA,GAGpB,mBAKS,UAAA;OAJP,OAAM;OACN,MAAK;OACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;yBACT,MAAA,SAAA,CAAS,CAAA,kCAAA,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA,MAAA,UAAA,GAId,mBAaM,OAbN,YAaM,CAZJ,YAWe,MAAA,YAAA,GAAA;OAVb,OAAM;OACN,MAAK;OACL,SAAQ;OACP,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;;8BACwD,CAApE,mBAAoE,QAAA,MAAA,gBAA3D,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,GAClB,YAIoB,MAAA,UAAA,GAAA;QAHlB,OAAM;QACN,MAAK;QACL,MAAK;QACL,WAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"names":[],"mappings":"AAyEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAgLF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AA0LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"isInvalid ? 'Input is invalid' : 'More Information'\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"\n schema &&\n ('type' in schema ||\n 'format' in schema ||\n 'minimum' in schema ||\n 'maximum' in schema ||\n 'default' in schema)\n \"\n class=\"schema text-c-2 truncate *:not-first:before:content-['_·_']\">\n <span v-if=\"'type' in schema\">{{ schema.type }}</span>\n <span v-if=\"'format' in schema\">{{ schema.format }}</span>\n <span v-if=\"'minimum' in schema\">min: {{ schema.minimum }}</span>\n <span v-if=\"'maximum' in schema\">max: {{ schema.maximum }}</span>\n <span v-if=\"'default' in schema\">default: {{ schema.default }}</span>\n </div>\n <ScalarMarkdown\n v-if=\"description && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestTableTooltip.vue.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"\n schema &&\n ('type' in schema ||\n 'format' in schema ||\n 'minimum' in schema ||\n 'maximum' in schema ||\n 'default' in schema)\n \"\n class=\"schema text-c-2 truncate *:not-first:before:content-['_·_']\">\n <span v-if=\"'type' in schema\">{{ schema.type }}</span>\n <span v-if=\"'format' in schema\">{{ schema.format }}</span>\n <span v-if=\"'minimum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.min') }}\n {{ schema.minimum }}</span\n >\n <span v-if=\"'maximum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.max') }}\n {{ schema.maximum }}</span\n >\n <span v-if=\"'default' in schema\"\n >{{ translate('apiClient.requestTableTooltip.default') }}\n {{ schema.default }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"description && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../../features/localization/index.js";
1
2
  import { validateParameter } from "../helpers/validate-parameter.js";
2
3
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
3
4
  import { ScalarIconInfo, ScalarIconWarning } from "@scalar/icons";
@@ -30,6 +31,7 @@ var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
30
31
  description: {}
31
32
  },
32
33
  setup(__props) {
34
+ const { translate } = useLocalization();
33
35
  const invalidParameterMessage = computed(() => validateParameter(__props.schema, __props.value));
34
36
  const isInvalid = computed(() => invalidParameterMessage.value.ok === false);
35
37
  return (_ctx, _cache) => {
@@ -41,15 +43,15 @@ var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
41
43
  popover: withCtx(() => [createElementVNode("div", _hoisted_2, [invalidParameterMessage.value.ok === false ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(invalidParameterMessage.value.message), 1)) : __props.schema && ("type" in __props.schema || "format" in __props.schema || "minimum" in __props.schema || "maximum" in __props.schema || "default" in __props.schema) ? (openBlock(), createElementBlock("div", _hoisted_4, [
42
44
  "type" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(__props.schema.type), 1)) : createCommentVNode("", true),
43
45
  "format" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(__props.schema.format), 1)) : createCommentVNode("", true),
44
- "minimum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_7, "min: " + toDisplayString(__props.schema.minimum), 1)) : createCommentVNode("", true),
45
- "maximum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_8, "max: " + toDisplayString(__props.schema.maximum), 1)) : createCommentVNode("", true),
46
- "default" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_9, "default: " + toDisplayString(__props.schema.default), 1)) : createCommentVNode("", true)
46
+ "minimum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(unref(translate)("apiClient.requestTableTooltip.min")) + " " + toDisplayString(__props.schema.minimum), 1)) : createCommentVNode("", true),
47
+ "maximum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(translate)("apiClient.requestTableTooltip.max")) + " " + toDisplayString(__props.schema.maximum), 1)) : createCommentVNode("", true),
48
+ "default" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(unref(translate)("apiClient.requestTableTooltip.default")) + " " + toDisplayString(__props.schema.default), 1)) : createCommentVNode("", true)
47
49
  ])) : createCommentVNode("", true), __props.description && !isInvalid.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
48
50
  key: 2,
49
51
  value: __props.description
50
52
  }, null, 8, ["value"])) : createCommentVNode("", true)])]),
51
53
  default: withCtx(() => [createElementVNode("button", {
52
- "aria-label": isInvalid.value ? "Input is invalid" : "More Information",
54
+ "aria-label": isInvalid.value ? unref(translate)("apiClient.requestTableTooltip.invalid") : unref(translate)("apiClient.requestTableTooltip.moreInformation"),
53
55
  class: "text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1",
54
56
  role: isInvalid.value ? "alert" : "none",
55
57
  type: "button"
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"isInvalid ? 'Input is invalid' : 'More Information'\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"\n schema &&\n ('type' in schema ||\n 'format' in schema ||\n 'minimum' in schema ||\n 'maximum' in schema ||\n 'default' in schema)\n \"\n class=\"schema text-c-2 truncate *:not-first:before:content-['_·_']\">\n <span v-if=\"'type' in schema\">{{ schema.type }}</span>\n <span v-if=\"'format' in schema\">{{ schema.format }}</span>\n <span v-if=\"'minimum' in schema\">min: {{ schema.minimum }}</span>\n <span v-if=\"'maximum' in schema\">max: {{ schema.maximum }}</span>\n <span v-if=\"'default' in schema\">default: {{ schema.default }}</span>\n </div>\n <ScalarMarkdown\n v-if=\"description && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,0BAA0B,eAAe,kBAAkB,QAAA,QAAQ,QAAA,KAAK,CAAC;EAC/E,MAAM,YAAY,eAAe,wBAAwB,MAAM,OAAO,KAAK;;uBAGzE,YA8CgB,MAAA,aAAA,GAAA;IA7Cb,QAAQ;IACT,WAAU;IACV,UAAA;;IAaW,SAAO,cA4BV,CA3BN,mBA2BM,OA3BN,YA2BM,CAvBI,wBAAA,MAAwB,OAAE,SAAA,UAAA,GADlC,mBAIM,OAJN,YAIM,gBADD,wBAAA,MAAwB,OAAO,GAAA,CAAA,KAGV,QAAA,WAAA,UAAiC,QAAA,UAAA,YAAoC,QAAA,UAAA,aAAqC,QAAA,UAAA,aAAqC,QAAA,UAAA,aAAqC,QAAA,WAAA,UAAA,GAD9M,mBAeM,OAfN,YAeM;eALkB,QAAA,UAAA,UAAA,GAAtB,mBAAsD,QAAA,YAAA,gBAArB,QAAA,OAAO,IAAI,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;iBACpB,QAAA,UAAA,UAAA,GAAxB,mBAA0D,QAAA,YAAA,gBAAvB,QAAA,OAAO,MAAM,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;kBACvB,QAAA,UAAA,UAAA,GAAzB,mBAAiE,QAAA,YAAhC,UAAK,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;kBAC9B,QAAA,UAAA,UAAA,GAAzB,mBAAiE,QAAA,YAAhC,UAAK,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;kBAC9B,QAAA,UAAA,UAAA,GAAzB,mBAAqE,QAAA,YAApC,cAAS,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;wCAGrD,QAAA,eAAW,CAAK,UAAA,SAAA,UAAA,GADxB,YAEyB,MAAA,cAAA,GAAA;;KAAtB,OAAO,QAAA;;2BA5BL,CAXT,mBAWS,UAAA;KAVN,cAAY,UAAA,QAAS,qBAAA;KACtB,OAAM;KACL,MAAM,UAAA,QAAS,UAAA;KAChB,MAAK;QAEG,UAAA,SAAA,UAAA,GADR,YAEmE,MAAA,iBAAA,GAAA;;KAAjE,OAAM;wBACR,YAE6C,MAAA,cAAA,GAAA;;KAA3C,OAAM"}
1
+ {"version":3,"file":"RequestTableTooltip.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"\n schema &&\n ('type' in schema ||\n 'format' in schema ||\n 'minimum' in schema ||\n 'maximum' in schema ||\n 'default' in schema)\n \"\n class=\"schema text-c-2 truncate *:not-first:before:content-['_·_']\">\n <span v-if=\"'type' in schema\">{{ schema.type }}</span>\n <span v-if=\"'format' in schema\">{{ schema.format }}</span>\n <span v-if=\"'minimum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.min') }}\n {{ schema.minimum }}</span\n >\n <span v-if=\"'maximum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.max') }}\n {{ schema.maximum }}</span\n >\n <span v-if=\"'default' in schema\"\n >{{ translate('apiClient.requestTableTooltip.default') }}\n {{ schema.default }}</span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,IAAA,IAAA;kBAEM,QAAA,UAAA,UAAA,GAAzB,mBAGC,QAAA,YAAA,gBAFK,MAAA,SAAA,CAAS,CAAA,uCAAA,CAAA,IAA4C,MACzD,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA;wCAIb,QAAA,eAAW,CAAK,UAAA,SAAA,UAAA,GADxB,YAEyB,MAAA,cAAA,GAAA;;KAAtB,OAAO,QAAA;;2BArCL,CAfT,mBAeS,UAAA;KAdN,cAAqB,UAAA,QAAsB,MAAA,SAAA,CAAS,CAAA,uCAAA,IAAsD,MAAA,SAAA,CAAS,CAAA,+CAAA;KAKpH,OAAM;KACL,MAAM,UAAA,QAAS,UAAA;KAChB,MAAK;QAEG,UAAA,SAAA,UAAA,GADR,YAEmE,MAAA,iBAAA,GAAA;;KAAjE,OAAM;wBACR,YAE6C,MAAA,cAAA,GAAA;;KAA3C,OAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-form-body-rows.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-form-body-rows.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAG/G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAA;AAExF,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,WAQ5C,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,YAAY,EACpB,aAAY,MAAM,EAAO,EACzB,wBAAqB,KACpB,OAAO,EA6BT,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,OAAO,EAChB,QAAQ,YAAY,GAAG,SAAS,EAChC,aAAY,MAAM,EAAO,KACxB;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EAqCpC,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,GAAI,KAAK,QAAQ,KAAG,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,GAAG,SAG5E,CAAA;AAED,uGAAuG;AACvG,eAAO,MAAM,eAAe,GAC1B,SAAS,aAAa,GAAG,SAAS,GAAG,IAAI,EACzC,aAAa,MAAM,EACnB,iBAAiB,YAAY,KAC5B,QAAQ,EAsIV,CAAA"}
1
+ {"version":3,"file":"get-form-body-rows.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-form-body-rows.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAG/G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAA;AAExF,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,WAQ5C,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,YAAY,EACpB,aAAY,MAAM,EAAO,EACzB,wBAAqB,KACpB,OAAO,EA6BT,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,OAAO,EAChB,QAAQ,YAAY,GAAG,SAAS,EAChC,aAAY,MAAM,EAAO,KACxB;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EAqCpC,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,GAAI,KAAK,QAAQ,KAAG,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,GAAG,SAG5E,CAAA;AAED,uGAAuG;AACvG,eAAO,MAAM,eAAe,GAC1B,SAAS,aAAa,GAAG,SAAS,GAAG,IAAI,EACzC,aAAa,MAAM,EACnB,iBAAiB,YAAY,KAC5B,QAAQ,EAmIV,CAAA"}
@@ -78,7 +78,8 @@ var getFormBodyValue = (row) => {
78
78
  };
79
79
  /** Build the table rows for the form data, optionally enriched with schema (e.g. enum) per property */
80
80
  var getFormBodyRows = (example, contentType, formBodySchema) => {
81
- if (!example?.value || contentType !== "multipart/form-data" && contentType !== "application/x-www-form-urlencoded") return [];
81
+ const value = example?.dataValue !== void 0 ? example.dataValue : example?.value;
82
+ if (!value || contentType !== "multipart/form-data" && contentType !== "application/x-www-form-urlencoded") return [];
82
83
  const schemaWithProperties = formBodySchema && isObjectSchema(formBodySchema) ? formBodySchema : void 0;
83
84
  const isComposed = Boolean(schemaWithProperties?.allOf || schemaWithProperties?.oneOf || schemaWithProperties?.anyOf);
84
85
  const requiredSet = schemaWithProperties ? new Set(schemaWithProperties.required ?? []) : void 0;
@@ -116,7 +117,7 @@ var getFormBodyRows = (example, contentType, formBodySchema) => {
116
117
  if (contentType === "multipart/form-data" && (Array.isArray(value) || isArray)) row.isArray = true;
117
118
  return [row];
118
119
  };
119
- if (Array.isArray(example.value)) return example.value.flatMap((exampleValue) => {
120
+ if (Array.isArray(value)) return value.flatMap((exampleValue) => {
120
121
  if (isObject(exampleValue)) {
121
122
  const name = String(exampleValue.name);
122
123
  if (contentType !== "multipart/form-data") return mapRow({
@@ -132,8 +133,8 @@ var getFormBodyRows = (example, contentType, formBodySchema) => {
132
133
  isDisabled: false
133
134
  };
134
135
  });
135
- if (contentType === "multipart/form-data" && schemaWithProperties && typeof example.value === "object") return collectExampleRows(example.value, schemaWithProperties).flatMap(({ path, value }) => mapValue(path.join("."), value));
136
- if (typeof example.value === "object" && example.value) return objectEntries(example.value).flatMap(([key, value]) => contentType === "multipart/form-data" ? mapValue(String(key), value) : mapRow({
136
+ if (contentType === "multipart/form-data" && schemaWithProperties && typeof value === "object") return collectExampleRows(value, schemaWithProperties).flatMap(({ path, value }) => mapValue(path.join("."), value));
137
+ if (typeof value === "object" && value) return objectEntries(value).flatMap(([key, value]) => contentType === "multipart/form-data" ? mapValue(String(key), value) : mapRow({
137
138
  name: String(key),
138
139
  value: stringifyValue(value)
139
140
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"get-form-body-rows.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/helpers/get-form-body-rows.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport { objectEntries } from '@scalar/helpers/object/object-entries'\nimport { coerceLeafValueToSchemaType } from '@scalar/workspace-store/request-example'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { ExampleObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\n\nexport const stringifyValue = (value: unknown) => {\n if (value instanceof File) {\n return value.name\n }\n if (typeof value === 'object' && value !== null) {\n return JSON.stringify(value)\n }\n return String(value)\n}\n\nexport type LeafRow = {\n path: string[]\n schema: SchemaObject | undefined\n isRequired: boolean\n}\n\n/**\n * Walk a (possibly nested) object schema and collect one entry per leaf property.\n *\n * A \"leaf\" is any property whose resolved schema is not an `{ type: 'object' }` schema\n * with named `properties` — i.e. primitives, arrays, files, and `additionalProperties`\n * placeholders all stop the recursion. Object properties recurse, so the widget example\n * (`file` + `props.{name,description,created_at}`) yields four leaves.\n */\nexport const collectLeafProperties = (\n schema: SchemaObject,\n parentPath: string[] = [],\n parentRequired = true,\n): LeafRow[] => {\n // Nothing to walk if this is not an object schema or has no declared properties.\n if (!isObjectSchema(schema) || !schema.properties) {\n return []\n }\n\n // `required` is a list of property names on *this* schema, so build it once per level.\n const requiredSet = new Set(schema.required ?? [])\n const leaves: LeafRow[] = []\n\n for (const [key, rawChildSchema] of objectEntries(schema.properties)) {\n const childSchema = resolve.schema(rawChildSchema)\n const path = [...parentPath, String(key)]\n\n // A leaf is only required when *every* ancestor was also required — a non-required\n // parent makes the whole subtree optional regardless of inner `required` lists.\n const isRequired = parentRequired && requiredSet.has(String(key))\n\n // Nested objects with named properties recurse so each leaf gets its own row;\n // everything else (primitives, arrays, files, additionalProperties placeholders)\n // is treated as a leaf and stops the descent.\n if (childSchema && isObjectSchema(childSchema) && childSchema.properties) {\n leaves.push(...collectLeafProperties(childSchema, path, isRequired))\n } else {\n leaves.push({ path, schema: childSchema, isRequired })\n }\n }\n\n return leaves\n}\n\n/**\n * Walk a schema + example together and collect one row per leaf, including example-only\n * keys that the schema does not declare. Schema-declared properties come first in schema\n * order; extras present in the example follow in example order at each level.\n *\n * Unlike `collectLeafProperties` (which is schema-only and feeds the dotted-name index),\n * this walker drives what the user actually sees in the form: a row for every leaf the\n * example contains, even when the schema is partial or out of date.\n */\nexport const collectExampleRows = (\n example: unknown,\n schema: SchemaObject | undefined,\n parentPath: string[] = [],\n): { path: string[]; value: unknown }[] => {\n const rows: { path: string[]; value: unknown }[] = []\n const exampleEntries = isObject(example) ? objectEntries(example) : []\n const exampleByKey = new Map<string, unknown>(exampleEntries.map(([key, value]) => [String(key), value]))\n const declaredKeys = new Set<string>()\n const schemaProperties = schema && isObjectSchema(schema) ? (schema.properties ?? {}) : {}\n\n // Schema-declared properties first, in schema order. Nested object schemas recurse so\n // each leaf gets its own row; otherwise the schema-declared key is a leaf and uses the\n // matching example value (or `undefined` when the example does not provide one).\n for (const [key, rawChildSchema] of objectEntries(schemaProperties)) {\n const keyStr = String(key)\n declaredKeys.add(keyStr)\n const childSchema = resolve.schema(rawChildSchema)\n const path = [...parentPath, keyStr]\n const exampleSubvalue = exampleByKey.get(keyStr)\n\n if (childSchema && isObjectSchema(childSchema) && childSchema.properties) {\n rows.push(...collectExampleRows(exampleSubvalue, childSchema, path))\n } else {\n rows.push({ path, value: exampleSubvalue })\n }\n }\n\n // Example-only properties at this level (preserve example order). Their inner shape is\n // not descended into — without a schema saying \"this is a nested object\" we have no\n // signal to flatten, so an object value becomes a single JSON-stringified row, matching\n // the schema-less fallback below.\n for (const [key, value] of exampleEntries) {\n const keyStr = String(key)\n if (declaredKeys.has(keyStr)) {\n continue\n }\n rows.push({ path: [...parentPath, keyStr], value })\n }\n\n return rows\n}\n\n/** Restore array values after text editing without parsing ordinary string fields. */\nexport const getFormBodyValue = (row: TableRow): string | File | unknown[] | undefined => {\n const value = coerceLeafValueToSchemaType(row.value, row.isArray ? { type: 'array' } : row.schema)\n return Array.isArray(value) ? value : (row.value ?? undefined)\n}\n\n/** Build the table rows for the form data, optionally enriched with schema (e.g. enum) per property */\nexport const getFormBodyRows = (\n example: ExampleObject | undefined | null,\n contentType: string,\n formBodySchema?: SchemaObject,\n): TableRow[] => {\n // We only need the rows for formData\n if (\n !example?.value ||\n (contentType !== 'multipart/form-data' && contentType !== 'application/x-www-form-urlencoded')\n ) {\n return []\n }\n\n // Get all the schema properties if the schema is an object schema\n const schemaWithProperties = formBodySchema && isObjectSchema(formBodySchema) ? formBodySchema : undefined\n // The request builder preserves composed fields because members can make them required.\n // Keep those fields checked so the initial form matches the body that will be sent.\n const isComposed = Boolean(schemaWithProperties?.allOf || schemaWithProperties?.oneOf || schemaWithProperties?.anyOf)\n const requiredSet = schemaWithProperties ? new Set(schemaWithProperties.required ?? []) : undefined\n\n // Pre-compute the leaf-by-dotted-name index up front so both the array and the\n // schema-driven branches can pull each row's leaf schema and required flag without\n // re-walking the schema. Without this, edited rows lose the per-leaf `Required`\n // badge because a top-level `properties[name]` lookup misses dotted names.\n const leafByDottedName = new Map<string, LeafRow>()\n if (schemaWithProperties) {\n for (const leaf of collectLeafProperties(schemaWithProperties)) {\n leafByDottedName.set(leaf.path.join('.'), leaf)\n }\n }\n\n const mapRow = ({\n name,\n value,\n isDisabled,\n }: {\n name: string\n value: string | File\n isDisabled?: boolean\n }): TableRow => {\n const row: TableRow = { name, value, isDisabled: isDisabled ?? false }\n if (!schemaWithProperties || !name) {\n return row\n }\n // Prefer the pre-resolved leaf (handles dotted names like `props.name`); fall back\n // to a top-level property lookup so user-added rows keep working.\n const leaf = leafByDottedName.get(name)\n const propSchema = leaf?.schema ?? resolve.schema(schemaWithProperties.properties?.[name])\n row.schema = propSchema\n row.description = propSchema?.description\n row.isRequired = leaf?.isRequired ?? requiredSet?.has(name) ?? false\n\n // Top-level optional properties default to disabled (unchecked), matching how optional\n // parameters behave. Scoped to top-level declared properties on purpose: the send side\n // (`build-request-body`) only drops top-level optional keys, so auto-disabling a nested\n // leaf (e.g. `props.name`) would leave it unchecked yet still transmitted. `Object.hasOwn`\n // (not `in`) keeps example-only keys named like `Object.prototype` members enabled. An\n // explicit `isDisabled` (from a stored form-row array) always wins.\n if (\n isDisabled === undefined &&\n !isComposed &&\n schemaWithProperties.properties &&\n Object.hasOwn(schemaWithProperties.properties, name)\n ) {\n row.isDisabled = !row.isRequired\n // Mark the row as disabled by default (no explicit `isDisabled` was stored) so typing a\n // value auto-enables it in `RequestTableRow`, matching how optional parameters behave. An\n // explicit `isDisabled` from a stored form-row array skips this branch and keeps winning.\n row.isDisabledByDefault = row.isDisabled\n }\n return row\n }\n\n const mapValue = (name: string, value: unknown, isDisabled?: boolean, isArray?: boolean): TableRow[] => {\n // Uploaded files must never pass through JSON.stringify, which discards their bytes.\n if (\n contentType === 'multipart/form-data' &&\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((item) => item instanceof File)\n ) {\n return value.map((file) => mapRow({ name, value: file, isDisabled }))\n }\n const row = mapRow({\n name,\n value: value instanceof File ? value : value == null ? '' : stringifyValue(value),\n isDisabled,\n })\n if (contentType === 'multipart/form-data' && (Array.isArray(value) || isArray)) {\n // Example-only arrays also need their type to survive a form-table round trip.\n row.isArray = true\n }\n return [row]\n }\n\n // We have form data stored as an array\n if (Array.isArray(example.value)) {\n return example.value.flatMap((exampleValue) => {\n if (isObject(exampleValue)) {\n const name = String(exampleValue.name)\n if (contentType !== 'multipart/form-data') {\n return mapRow({\n name,\n value: exampleValue.value instanceof File ? exampleValue.value : String(exampleValue.value),\n isDisabled: Boolean(exampleValue.isDisabled),\n })\n }\n return mapValue(name, exampleValue.value, Boolean(exampleValue.isDisabled), exampleValue.isArray === true)\n }\n return { name: '', value: exampleValue, isDisabled: false }\n })\n }\n\n // Schema-driven path: when the form body schema describes nested objects, emit one row\n // per leaf so users can edit individual fields. The dotted name (`props.name`) is folded\n // back into a single JSON multipart part by `build-request-body.ts` before the request is\n // sent. Gated to `multipart/form-data` because urlencoded has no regrouping step on send,\n // so dotted leaves would otherwise reach the wire as separate `props.name`-style fields.\n //\n // We walk the example alongside the schema so example-only properties (top-level extras\n // or undeclared keys inside a nested object) are still visible and editable instead of\n // being silently dropped to whatever the schema happens to declare.\n if (contentType === 'multipart/form-data' && schemaWithProperties && typeof example.value === 'object') {\n return collectExampleRows(example.value, schemaWithProperties).flatMap(({ path, value }) =>\n mapValue(path.join('.'), value),\n )\n }\n\n // We got an object try to convert it to an array of rows\n if (typeof example.value === 'object' && example.value) {\n return objectEntries(example.value).flatMap(([key, value]) =>\n contentType === 'multipart/form-data'\n ? mapValue(String(key), value)\n : mapRow({ name: String(key), value: stringifyValue(value) }),\n )\n }\n\n return []\n}\n"],"mappings":";;;;;;AASA,IAAa,kBAAkB,UAAmB;CAChD,IAAI,iBAAiB,MACnB,OAAO,MAAM;CAEf,IAAI,OAAO,UAAU,YAAY,UAAU,MACzC,OAAO,KAAK,UAAU,KAAK;CAE7B,OAAO,OAAO,KAAK;AACrB;;;;;;;;;AAgBA,IAAa,yBACX,QACA,aAAuB,CAAC,GACxB,iBAAiB,SACH;CAEd,IAAI,CAAC,eAAe,MAAM,KAAK,CAAC,OAAO,YACrC,OAAO,CAAC;CAIV,MAAM,cAAc,IAAI,IAAI,OAAO,YAAY,CAAC,CAAC;CACjD,MAA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C,KAAK,WACjD,gBAAgB,wBACZ,SAAS,OAAO,GAAG,GAAG,KAAK,IAC3B,OAAO;EAAE,MAAM,OAAO,GAAG;EAAG,OAAO,eAAe,KAAK;CAAE,CAAC,CAChE;CAGF,OAAO,CAAC;AACV"}
1
+ {"version":3,"file":"get-form-body-rows.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/helpers/get-form-body-rows.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport { objectEntries } from '@scalar/helpers/object/object-entries'\nimport { coerceLeafValueToSchemaType } from '@scalar/workspace-store/request-example'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { ExampleObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\n\nexport const stringifyValue = (value: unknown) => {\n if (value instanceof File) {\n return value.name\n }\n if (typeof value === 'object' && value !== null) {\n return JSON.stringify(value)\n }\n return String(value)\n}\n\nexport type LeafRow = {\n path: string[]\n schema: SchemaObject | undefined\n isRequired: boolean\n}\n\n/**\n * Walk a (possibly nested) object schema and collect one entry per leaf property.\n *\n * A \"leaf\" is any property whose resolved schema is not an `{ type: 'object' }` schema\n * with named `properties` — i.e. primitives, arrays, files, and `additionalProperties`\n * placeholders all stop the recursion. Object properties recurse, so the widget example\n * (`file` + `props.{name,description,created_at}`) yields four leaves.\n */\nexport const collectLeafProperties = (\n schema: SchemaObject,\n parentPath: string[] = [],\n parentRequired = true,\n): LeafRow[] => {\n // Nothing to walk if this is not an object schema or has no declared properties.\n if (!isObjectSchema(schema) || !schema.properties) {\n return []\n }\n\n // `required` is a list of property names on *this* schema, so build it once per level.\n const requiredSet = new Set(schema.required ?? [])\n const leaves: LeafRow[] = []\n\n for (const [key, rawChildSchema] of objectEntries(schema.properties)) {\n const childSchema = resolve.schema(rawChildSchema)\n const path = [...parentPath, String(key)]\n\n // A leaf is only required when *every* ancestor was also required — a non-required\n // parent makes the whole subtree optional regardless of inner `required` lists.\n const isRequired = parentRequired && requiredSet.has(String(key))\n\n // Nested objects with named properties recurse so each leaf gets its own row;\n // everything else (primitives, arrays, files, additionalProperties placeholders)\n // is treated as a leaf and stops the descent.\n if (childSchema && isObjectSchema(childSchema) && childSchema.properties) {\n leaves.push(...collectLeafProperties(childSchema, path, isRequired))\n } else {\n leaves.push({ path, schema: childSchema, isRequired })\n }\n }\n\n return leaves\n}\n\n/**\n * Walk a schema + example together and collect one row per leaf, including example-only\n * keys that the schema does not declare. Schema-declared properties come first in schema\n * order; extras present in the example follow in example order at each level.\n *\n * Unlike `collectLeafProperties` (which is schema-only and feeds the dotted-name index),\n * this walker drives what the user actually sees in the form: a row for every leaf the\n * example contains, even when the schema is partial or out of date.\n */\nexport const collectExampleRows = (\n example: unknown,\n schema: SchemaObject | undefined,\n parentPath: string[] = [],\n): { path: string[]; value: unknown }[] => {\n const rows: { path: string[]; value: unknown }[] = []\n const exampleEntries = isObject(example) ? objectEntries(example) : []\n const exampleByKey = new Map<string, unknown>(exampleEntries.map(([key, value]) => [String(key), value]))\n const declaredKeys = new Set<string>()\n const schemaProperties = schema && isObjectSchema(schema) ? (schema.properties ?? {}) : {}\n\n // Schema-declared properties first, in schema order. Nested object schemas recurse so\n // each leaf gets its own row; otherwise the schema-declared key is a leaf and uses the\n // matching example value (or `undefined` when the example does not provide one).\n for (const [key, rawChildSchema] of objectEntries(schemaProperties)) {\n const keyStr = String(key)\n declaredKeys.add(keyStr)\n const childSchema = resolve.schema(rawChildSchema)\n const path = [...parentPath, keyStr]\n const exampleSubvalue = exampleByKey.get(keyStr)\n\n if (childSchema && isObjectSchema(childSchema) && childSchema.properties) {\n rows.push(...collectExampleRows(exampleSubvalue, childSchema, path))\n } else {\n rows.push({ path, value: exampleSubvalue })\n }\n }\n\n // Example-only properties at this level (preserve example order). Their inner shape is\n // not descended into — without a schema saying \"this is a nested object\" we have no\n // signal to flatten, so an object value becomes a single JSON-stringified row, matching\n // the schema-less fallback below.\n for (const [key, value] of exampleEntries) {\n const keyStr = String(key)\n if (declaredKeys.has(keyStr)) {\n continue\n }\n rows.push({ path: [...parentPath, keyStr], value })\n }\n\n return rows\n}\n\n/** Restore array values after text editing without parsing ordinary string fields. */\nexport const getFormBodyValue = (row: TableRow): string | File | unknown[] | undefined => {\n const value = coerceLeafValueToSchemaType(row.value, row.isArray ? { type: 'array' } : row.schema)\n return Array.isArray(value) ? value : (row.value ?? undefined)\n}\n\n/** Build the table rows for the form data, optionally enriched with schema (e.g. enum) per property */\nexport const getFormBodyRows = (\n example: ExampleObject | undefined | null,\n contentType: string,\n formBodySchema?: SchemaObject,\n): TableRow[] => {\n // Forms use structured data even when the raw example also supplies wire text.\n const value = example?.dataValue !== undefined ? example.dataValue : example?.value\n // We only need the rows for formData\n if (!value || (contentType !== 'multipart/form-data' && contentType !== 'application/x-www-form-urlencoded')) {\n return []\n }\n\n // Get all the schema properties if the schema is an object schema\n const schemaWithProperties = formBodySchema && isObjectSchema(formBodySchema) ? formBodySchema : undefined\n // The request builder preserves composed fields because members can make them required.\n // Keep those fields checked so the initial form matches the body that will be sent.\n const isComposed = Boolean(schemaWithProperties?.allOf || schemaWithProperties?.oneOf || schemaWithProperties?.anyOf)\n const requiredSet = schemaWithProperties ? new Set(schemaWithProperties.required ?? []) : undefined\n\n // Pre-compute the leaf-by-dotted-name index up front so both the array and the\n // schema-driven branches can pull each row's leaf schema and required flag without\n // re-walking the schema. Without this, edited rows lose the per-leaf `Required`\n // badge because a top-level `properties[name]` lookup misses dotted names.\n const leafByDottedName = new Map<string, LeafRow>()\n if (schemaWithProperties) {\n for (const leaf of collectLeafProperties(schemaWithProperties)) {\n leafByDottedName.set(leaf.path.join('.'), leaf)\n }\n }\n\n const mapRow = ({\n name,\n value,\n isDisabled,\n }: {\n name: string\n value: string | File\n isDisabled?: boolean\n }): TableRow => {\n const row: TableRow = { name, value, isDisabled: isDisabled ?? false }\n if (!schemaWithProperties || !name) {\n return row\n }\n // Prefer the pre-resolved leaf (handles dotted names like `props.name`); fall back\n // to a top-level property lookup so user-added rows keep working.\n const leaf = leafByDottedName.get(name)\n const propSchema = leaf?.schema ?? resolve.schema(schemaWithProperties.properties?.[name])\n row.schema = propSchema\n row.description = propSchema?.description\n row.isRequired = leaf?.isRequired ?? requiredSet?.has(name) ?? false\n\n // Top-level optional properties default to disabled (unchecked), matching how optional\n // parameters behave. Scoped to top-level declared properties on purpose: the send side\n // (`build-request-body`) only drops top-level optional keys, so auto-disabling a nested\n // leaf (e.g. `props.name`) would leave it unchecked yet still transmitted. `Object.hasOwn`\n // (not `in`) keeps example-only keys named like `Object.prototype` members enabled. An\n // explicit `isDisabled` (from a stored form-row array) always wins.\n if (\n isDisabled === undefined &&\n !isComposed &&\n schemaWithProperties.properties &&\n Object.hasOwn(schemaWithProperties.properties, name)\n ) {\n row.isDisabled = !row.isRequired\n // Mark the row as disabled by default (no explicit `isDisabled` was stored) so typing a\n // value auto-enables it in `RequestTableRow`, matching how optional parameters behave. An\n // explicit `isDisabled` from a stored form-row array skips this branch and keeps winning.\n row.isDisabledByDefault = row.isDisabled\n }\n return row\n }\n\n const mapValue = (name: string, value: unknown, isDisabled?: boolean, isArray?: boolean): TableRow[] => {\n // Uploaded files must never pass through JSON.stringify, which discards their bytes.\n if (\n contentType === 'multipart/form-data' &&\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((item) => item instanceof File)\n ) {\n return value.map((file) => mapRow({ name, value: file, isDisabled }))\n }\n const row = mapRow({\n name,\n value: value instanceof File ? value : value == null ? '' : stringifyValue(value),\n isDisabled,\n })\n if (contentType === 'multipart/form-data' && (Array.isArray(value) || isArray)) {\n // Example-only arrays also need their type to survive a form-table round trip.\n row.isArray = true\n }\n return [row]\n }\n\n // We have form data stored as an array\n if (Array.isArray(value)) {\n return value.flatMap((exampleValue) => {\n if (isObject(exampleValue)) {\n const name = String(exampleValue.name)\n if (contentType !== 'multipart/form-data') {\n return mapRow({\n name,\n value: exampleValue.value instanceof File ? exampleValue.value : String(exampleValue.value),\n isDisabled: Boolean(exampleValue.isDisabled),\n })\n }\n return mapValue(name, exampleValue.value, Boolean(exampleValue.isDisabled), exampleValue.isArray === true)\n }\n return { name: '', value: exampleValue, isDisabled: false }\n })\n }\n\n // Schema-driven path: when the form body schema describes nested objects, emit one row\n // per leaf so users can edit individual fields. The dotted name (`props.name`) is folded\n // back into a single JSON multipart part by `build-request-body.ts` before the request is\n // sent. Gated to `multipart/form-data` because urlencoded has no regrouping step on send,\n // so dotted leaves would otherwise reach the wire as separate `props.name`-style fields.\n //\n // We walk the example alongside the schema so example-only properties (top-level extras\n // or undeclared keys inside a nested object) are still visible and editable instead of\n // being silently dropped to whatever the schema happens to declare.\n if (contentType === 'multipart/form-data' && schemaWithProperties && typeof value === 'object') {\n return collectExampleRows(value, schemaWithProperties).flatMap(({ path, value }) => mapValue(path.join('.'), value))\n }\n\n // We got an object try to convert it to an array of rows\n if (typeof value === 'object' && value) {\n return objectEntries(value).flatMap(([key, value]) =>\n contentType === 'multipart/form-data'\n ? mapValue(String(key), value)\n : mapRow({ name: String(key), value: stringifyValue(value) }),\n )\n }\n\n return []\n}\n"],"mappings":";;;;;;AASA,IAAa,kBAAkB,UAAmB;CAChD,IAAI,iBAAiB,MACnB,OAAO,MAAM;CAEf,IAAI,OAAO,UAAU,YAAY,UAAU,MACzC,OAAO,KAAK,UAAU,KAAK;CAE7B,OAAO,OAAO,KAAK;AACrB;;;;;;;;;AAgBA,IAAa,yBACX,QACA,aAAuB,CAAC,GACxB,iBAAiB,SACH;CAEd,IAAI,CAAC,eAAe,MAAM,KAAK,CAAC,OAAO,YACrC,OAAO,CAAC;CAIV,MAAM,cAAc,IAAI,IAAI,OAAO,YAAY,CAAC,CAAC;CACjD,MAAM,SAAoB,CAAC;CAE3B,KAAK,MAAM,CAAC,KAAK,mBAAmB,cAAc,OAAO,UAAU,GAAG;EACpE,MAA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