@scalar/api-client 3.25.1 → 3.27.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 (118) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/style.css +156 -55
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js +33 -3
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -0
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  10. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  11. package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js +8 -6
  12. package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
  16. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js +88 -15
  17. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +6 -4
  19. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  20. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  21. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  22. package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js +3 -1
  23. package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts +35 -0
  25. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts.map +1 -0
  26. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js +7 -0
  27. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js.map +1 -0
  28. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js +111 -0
  29. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  30. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +9 -4
  31. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  33. package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js +65 -17
  34. package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  37. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js +22 -17
  38. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  39. package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts +9 -0
  40. package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts.map +1 -0
  41. package/dist/v2/blocks/request-block/helpers/group-form-body-files.js +60 -0
  42. package/dist/v2/blocks/request-block/helpers/group-form-body-files.js.map +1 -0
  43. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -0
  44. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  45. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  46. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  47. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js +31 -3
  48. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue_vue_type_script_setup_true_lang.js.map +1 -1
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js +33 -21
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.d.ts.map +1 -1
  55. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js.map +1 -1
  56. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js +4 -3
  57. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
  59. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  60. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js +4 -3
  61. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  63. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  64. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js +43 -25
  65. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  66. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +2 -2
  67. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  68. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +8 -8
  69. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  70. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +9 -10
  71. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  72. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +1 -1
  73. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -1
  74. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +1 -1
  75. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +1 -0
  76. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  77. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  78. package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js +14 -4
  79. package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/v2/constants.js +1 -1
  81. package/dist/v2/features/localization/locales/ar.d.ts +8 -0
  82. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -1
  83. package/dist/v2/features/localization/locales/ar.js +8 -0
  84. package/dist/v2/features/localization/locales/ar.js.map +1 -1
  85. package/dist/v2/features/localization/locales/de.d.ts +8 -0
  86. package/dist/v2/features/localization/locales/de.d.ts.map +1 -1
  87. package/dist/v2/features/localization/locales/de.js +8 -0
  88. package/dist/v2/features/localization/locales/de.js.map +1 -1
  89. package/dist/v2/features/localization/locales/es.d.ts +8 -0
  90. package/dist/v2/features/localization/locales/es.d.ts.map +1 -1
  91. package/dist/v2/features/localization/locales/es.js +8 -0
  92. package/dist/v2/features/localization/locales/es.js.map +1 -1
  93. package/dist/v2/features/localization/locales/fr.d.ts +8 -0
  94. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -1
  95. package/dist/v2/features/localization/locales/fr.js +8 -0
  96. package/dist/v2/features/localization/locales/fr.js.map +1 -1
  97. package/dist/v2/features/localization/locales/pt.d.ts +8 -0
  98. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -1
  99. package/dist/v2/features/localization/locales/pt.js +8 -0
  100. package/dist/v2/features/localization/locales/pt.js.map +1 -1
  101. package/dist/v2/features/localization/locales/ru.d.ts +8 -0
  102. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -1
  103. package/dist/v2/features/localization/locales/ru.js +8 -0
  104. package/dist/v2/features/localization/locales/ru.js.map +1 -1
  105. package/dist/v2/features/localization/locales/zh-cn.d.ts +8 -0
  106. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -1
  107. package/dist/v2/features/localization/locales/zh-cn.js +8 -0
  108. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -1
  109. package/dist/v2/features/localization/locales/zh-tw.d.ts +8 -0
  110. package/dist/v2/features/localization/locales/zh-tw.d.ts.map +1 -1
  111. package/dist/v2/features/localization/locales/zh-tw.js +8 -0
  112. package/dist/v2/features/localization/locales/zh-tw.js.map +1 -1
  113. package/dist/v2/features/localization/translations.d.ts +8 -0
  114. package/dist/v2/features/localization/translations.d.ts.map +1 -1
  115. package/dist/v2/features/localization/translations.js +8 -0
  116. package/dist/v2/features/localization/translations.js.map +1 -1
  117. package/dist/vue-styles.css +19 -19
  118. package/package.json +17 -17
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createVNode","_unref","AddressBar","_createBlock","EnvironmentSelector","_createCommentVNode","OpenApiClientButton","_toDisplayString"],"sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n Operation block header: address bar, environment selector, and modal controls.\n\n Renders the top bar for the API client operation view: URL/method (AddressBar),\n optional environment selector, optional \"Open API Client\" button in modal layout,\n and close button for modal. Layout and visibility depend on `layout` and `source` props.\n */\nexport type HeaderProps = {\n /** An external example must finish loading before sending. */\n executionDisabled?: boolean\n /** Current request path */\n path: string\n /** Current request method */\n method: string\n /** Whether this request comes from an OpenAPI webhook. */\n isWebhook?: boolean\n /** Client layout */\n layout: ClientLayout\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document slug */\n documentSlug: string\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Currently selected server */\n server: ServerObject | null\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** List of request history */\n history: History[]\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** Environment variables */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGearSix } from '@scalar/icons'\nimport type {\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { AddressBar, type History } from '@/v2/blocks/scalar-address-bar-block'\nimport EnvironmentSelector from '@/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue'\nimport { useLocalization } from '@/v2/features/localization'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport OpenApiClientButton from './OpenApiClientButton.vue'\n\nconst {\n hideClientButton = false,\n eventBus,\n exampleKey,\n documentSlug,\n} = defineProps<HeaderProps>()\n\nconst emit = defineEmits<{\n /** Execute the current operation example */\n (e: 'execute'): void\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Add a new environment */\n (e: 'add:environment'): void\n /** Navigate to the settings page for the current entity */\n (e: 'navigate:settings'): void\n /** Update the full destination URL used to deliver a webhook. */\n (e: 'update:webhook-url', url: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst handleSelectEnvironment = (environmentName: string) => {\n eventBus.emit('workspace:update:active-environment', environmentName)\n}\n\nconst handleAddEnvironment = () => {\n eventBus.emit('ui:navigate', { page: 'document', path: 'environment' })\n}\n</script>\n\n<template>\n <!--\n `@container` declares an unnamed container so the AddressBar can\n adapt to the right column's actual width (which shrinks when the\n sidebar opens) instead of the viewport. The query is declared here\n on the parent rather than on the AddressBar itself so the bar's\n `w-full` mobile state cannot feed back into its own breakpoint.\n -->\n <div\n class=\"lg:min-h-header t-app__top-container @container flex w-full flex-wrap items-center justify-center p-2\">\n <!-- Left spacer to center bar -->\n <div class=\"flex flex-1\"></div>\n <AddressBar\n :activeEnvironment\n :documentSlug\n :environment\n :environments\n :eventBus\n :exampleKey\n :executionDisabled\n :history\n :isWebhook\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n @add:environment=\"emit('add:environment')\"\n @execute=\"emit('execute')\"\n @select:history:item=\"(payload) => emit('select:history:item', payload)\"\n @update:webhookUrl=\"\n (value: string) => emit('update:webhook-url', value)\n \" />\n\n <div class=\"mb-2 flex flex-1 items-center justify-end gap-2 @3xl:mb-0\">\n <!--\n Environment Selector\n Hidden for `modal` layout\n -->\n <EnvironmentSelector\n v-if=\"layout !== 'modal'\"\n :activeEnvironment=\"activeEnvironment\"\n :environments=\"environments\"\n @add:environment=\"handleAddEnvironment\"\n @select:environment=\"handleSelectEnvironment\" />\n <!-- Operation settings -->\n <ScalarIconButton\n v-if=\"layout !== 'modal' && !isWebhook\"\n :icon=\"ScalarIconGearSix\"\n :label=\"translate('apiClient.header.operationSettings')\"\n size=\"sm\"\n weight=\"bold\"\n @click=\"emit('navigate:settings')\" />\n <!--\n Open API Client Button\n\n Only shown in `modal` layout\n -->\n <OpenApiClientButton\n v-if=\"layout === 'modal' && documentUrl && !hideClientButton\"\n buttonSource=\"modal\"\n class=\"!w-fit lg:-mr-1\"\n :integration=\"integration ?? null\"\n :operationMethod=\"method\"\n :operationPath=\"path\"\n :source=\"source ?? 'api-reference'\"\n :url=\"documentUrl\" />\n\n <!--\n Close Button\n\n Only shown in `modal` layout and hidden for GitBook Integration\n -->\n <button\n v-if=\"layout === 'modal' && source !== 'gitbook'\"\n class=\"app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2\"\n data-modal-initial-focus\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"lg\"\n thickness=\"2\" />\n <span class=\"sr-only\">{{\n translate('apiClient.header.closeClient')\n }}</span>\n </button>\n\n <!--\n Close Button for GitBook Integration\n\n Hidden by default and visible for GitBook Integration in `modal` layout\n -->\n <button\n v-if=\"layout === 'modal' && source === 'gitbook'\"\n class=\"text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2\"\n data-modal-initial-focus\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"md\"\n thickness=\"1.75\" />\n <span class=\"sr-only\">{{\n translate('apiClient.header.closeClient')\n }}</span>\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n.app-exit-button {\n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AAA,CAAiB,QAAA,aAD/BP,UAAA,GAAAM,YAMuCF,MAAA,gBAAA,GAAA;;MAJpC,MAAMA,MAAA,iBAAA;MACN,OAAOA,MAAA,SAAA,CAAS,CAAA,oCAAA;MACjB,MAAK;MACL,QAAO;MACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,mBAAA;;KAON,QAAA,WAAM,WAAgB,QAAA,eAAW,CAAK,QAAA,oBAD9CJ,UAAA,GAAAM,YAQuBG,6BAAA;;MANrB,cAAa;MACb,OAAM;MACL,aAAa,QAAA,eAAW;MACxB,iBAAiB,QAAA;MACjB,eAAe,QAAA;MACf,QAAQ,QAAA,UAAM;MACd,KAAK,QAAA;;;;;;;;KAQA,QAAA,WAAM,WAAgB,QAAA,WAAM,aADpCT,UAAA,GAAAC,mBAaS,UAAA;;MAXP,OAAM;MACN,4BAAA;MACA,MAAK;MACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,SAAS,KAAI,uBAAA;K,IACrBE,YAGkBC,MAAA,UAAA,GAAA;MAFhB,MAAK;MACL,MAAK;MACL,WAAU;K,IACZF,mBAES,QAFT,YAESQ,gBADPN,MAAA,SAAA,CAAS,CAAA,8BAAA,CAAA,GAAA,CAAA,C;KAUL,QAAA,WAAM,WAAgB,QAAA,WAAM,aADpCJ,UAAA,GAAAC,mBAaS,UAAA;;MAXP,OAAM;MACN,4BAAA;MACA,MAAK;MACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,SAAS,KAAI,uBAAA;K,IACrBE,YAGqBC,MAAA,UAAA,GAAA;MAFnB,MAAK;MACL,MAAK;MACL,WAAU;K,IACZF,mBAES,QAFT,YAESQ,gBADPN,MAAA,SAAA,CAAS,CAAA,8BAAA,CAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"Header.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createVNode","_unref","AddressBar","_createBlock","EnvironmentSelector","_createCommentVNode","OpenApiClientButton","_toDisplayString"],"sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n Operation block header: address bar, environment selector, and modal controls.\n\n Renders the top bar for the API client operation view: URL/method (AddressBar),\n optional environment selector, optional \"Open API Client\" button in modal layout,\n and close button for modal. Layout and visibility depend on `layout` and `source` props.\n */\nexport type HeaderProps = {\n /** An external example must finish loading before sending. */\n executionDisabled?: boolean\n /** Current request path */\n path: string\n /** Current request method */\n method: string\n /** Whether this request comes from an OpenAPI webhook. */\n isWebhook?: boolean\n /** Client layout */\n layout: ClientLayout\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document slug */\n documentSlug: string\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Currently selected server */\n server: ServerObject | null\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** List of request history */\n history: History[]\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** Environment variables */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGearSix } from '@scalar/icons'\nimport type {\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { AddressBar, type History } from '@/v2/blocks/scalar-address-bar-block'\nimport EnvironmentSelector from '@/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue'\nimport { useLocalization } from '@/v2/features/localization'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport OpenApiClientButton from './OpenApiClientButton.vue'\n\nconst {\n hideClientButton = false,\n eventBus,\n exampleKey,\n documentSlug,\n} = defineProps<HeaderProps>()\n\nconst emit = defineEmits<{\n /** Open the GET destination using browser navigation. */\n (e: 'open:browser'): void\n /** Execute the current operation example */\n (e: 'execute'): void\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Add a new environment */\n (e: 'add:environment'): void\n /** Navigate to the settings page for the current entity */\n (e: 'navigate:settings'): void\n /** Update the full destination URL used to deliver a webhook. */\n (e: 'update:webhook-url', url: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst handleSelectEnvironment = (environmentName: string) => {\n eventBus.emit('workspace:update:active-environment', environmentName)\n}\n\nconst handleAddEnvironment = () => {\n eventBus.emit('ui:navigate', { page: 'document', path: 'environment' })\n}\n</script>\n\n<template>\n <!--\n `@container` declares an unnamed container so the AddressBar can\n adapt to the right column's actual width (which shrinks when the\n sidebar opens) instead of the viewport. The query is declared here\n on the parent rather than on the AddressBar itself so the bar's\n `w-full` mobile state cannot feed back into its own breakpoint.\n -->\n <div\n class=\"lg:min-h-header t-app__top-container @container flex w-full flex-wrap items-center justify-center p-2\">\n <!-- Left spacer to center bar -->\n <div class=\"flex flex-1\"></div>\n <AddressBar\n :activeEnvironment\n :documentSlug\n :environment\n :environments\n :eventBus\n :exampleKey\n :executionDisabled\n :history\n :isWebhook\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n @add:environment=\"emit('add:environment')\"\n @execute=\"emit('execute')\"\n @open:browser=\"emit('open:browser')\"\n @select:history:item=\"(payload) => emit('select:history:item', payload)\"\n @update:webhookUrl=\"\n (value: string) => emit('update:webhook-url', value)\n \" />\n\n <div class=\"mb-2 flex flex-1 items-center justify-end gap-2 @3xl:mb-0\">\n <!--\n Environment Selector\n Hidden for `modal` layout\n -->\n <EnvironmentSelector\n v-if=\"layout !== 'modal'\"\n :activeEnvironment=\"activeEnvironment\"\n :environments=\"environments\"\n @add:environment=\"handleAddEnvironment\"\n @select:environment=\"handleSelectEnvironment\" />\n <!-- Operation settings -->\n <ScalarIconButton\n v-if=\"layout !== 'modal' && !isWebhook\"\n :icon=\"ScalarIconGearSix\"\n :label=\"translate('apiClient.header.operationSettings')\"\n size=\"sm\"\n weight=\"bold\"\n @click=\"emit('navigate:settings')\" />\n <!--\n Open API Client Button\n\n Only shown in `modal` layout\n -->\n <OpenApiClientButton\n v-if=\"layout === 'modal' && documentUrl && !hideClientButton\"\n buttonSource=\"modal\"\n class=\"!w-fit lg:-mr-1\"\n :integration=\"integration ?? null\"\n :operationMethod=\"method\"\n :operationPath=\"path\"\n :source=\"source ?? 'api-reference'\"\n :url=\"documentUrl\" />\n\n <!--\n Close Button\n\n Only shown in `modal` layout and hidden for GitBook Integration\n -->\n <button\n v-if=\"layout === 'modal' && source !== 'gitbook'\"\n class=\"app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2\"\n data-modal-initial-focus\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"lg\"\n thickness=\"2\" />\n <span class=\"sr-only\">{{\n translate('apiClient.header.closeClient')\n }}</span>\n </button>\n\n <!--\n Close Button for GitBook Integration\n\n Hidden by default and visible for GitBook Integration in `modal` layout\n -->\n <button\n v-if=\"layout === 'modal' && source === 'gitbook'\"\n class=\"text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2\"\n data-modal-initial-focus\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"md\"\n thickness=\"1.75\" />\n <span class=\"sr-only\">{{\n translate('apiClient.header.closeClient')\n }}</span>\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n.app-exit-button {\n color: white;\n background: rgba(0, 0, 0, 0.1);\n}\n.app-exit-button:hover {\n background: rgba(255, 255, 255, 0.1);\n}\n</style>\n"],"mappings":";;;;;;;;;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,MAAA,gBAAA,GAAA;;MAJpC,MAAMA,MAAA,iBAAA;MACN,OAAOA,MAAA,SAAA,CAAS,CAAA,oCAAA;MACjB,MAAK;MACL,QAAO;MACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,mBAAA;;KAON,QAAA,WAAM,WAAgB,QAAA,eAAW,CAAK,QAAA,oBAD9CJ,UAAA,GAAAM,YAQuBG,6BAAA;;MANrB,cAAa;MACb,OAAM;MACL,aAAa,QAAA,eAAW;MACxB,iBAAiB,QAAA;MACjB,eAAe,QAAA;MACf,QAAQ,QAAA,UAAM;MACd,KAAK,QAAA;;;;;;;;KAQA,QAAA,WAAM,WAAgB,QAAA,WAAM,aADpCT,UAAA,GAAAC,mBAaS,UAAA;;MAXP,OAAM;MACN,4BAAA;MACA,MAAK;MACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,SAAS,KAAI,uBAAA;K,IACrBE,YAGkBC,MAAA,UAAA,GAAA;MAFhB,MAAK;MACL,MAAK;MACL,WAAU;K,IACZF,mBAES,QAFT,YAESQ,gBADPN,MAAA,SAAA,CAAS,CAAA,8BAAA,CAAA,GAAA,CAAA,C;KAUL,QAAA,WAAM,WAAgB,QAAA,WAAM,aADpCJ,UAAA,GAAAC,mBAaS,UAAA;;MAXP,OAAM;MACN,4BAAA;MACA,MAAK;MACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,SAAS,KAAI,uBAAA;K,IACrBE,YAGqBC,MAAA,UAAA,GAAA;MAFnB,MAAK;MACL,MAAK;MACL,WAAU;K,IACZF,mBAES,QAFT,YAESQ,gBADPN,MAAA,SAAA,CAAS,CAAA,8BAAA,CAAA,GAAA,CAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBlock.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","ViewLayoutSection","_unref","_withCtx","_createElementVNode","_createElementBlock","_createCommentVNode","_toDisplayString","_createVNode","SectionFilter","_withDirectives","AuthSelector","_vShow","RequestParams","_mergeProps","_toHandlers","RequestBody","_Fragment","_renderList","_resolveDynamicComponent","RequestCodeSnippet"],"sources":["../../../../src/v2/blocks/request-block/RequestBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/blocks/code-example'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { canMethodHaveBody } from '@scalar/helpers/http/can-method-have-body'\nimport { REGEX } from '@scalar/helpers/regex/regex-helpers'\nimport { replaceEnvVariables } from '@scalar/helpers/regex/replace-variables'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { getUniqueExampleName } from '@scalar/workspace-store/navigation'\nimport {\n filterGlobalCookie,\n getEnvironmentVariables,\n getResolvedUrl,\n getSchemaExampleFromBody,\n type MergedSecuritySchemes,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, provide, ref, useId, watch } from 'vue'\n\nimport SectionFilter from '@/components/SectionFilter.vue'\nimport ViewLayoutSection from '@/components/ViewLayout/ViewLayoutSection.vue'\nimport RequestBody from '@/v2/blocks/request-block/components/RequestBody.vue'\nimport RequestCodeSnippet from '@/v2/blocks/request-block/components/RequestCodeSnippet.vue'\nimport RequestParams from '@/v2/blocks/request-block/components/RequestParams.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport { createParameterHandlers } from '@/v2/blocks/request-block/helpers/create-parameter-handlers'\nimport { createParameterRows } from '@/v2/blocks/request-block/helpers/create-parameter-rows'\nimport { groupBy } from '@/v2/blocks/request-block/helpers/group-by'\nimport { groupGlobalCookies } from '@/v2/blocks/request-block/helpers/group-global-cookies'\nimport { getStructuredBodyCodec } from '@/v2/blocks/request-block/helpers/structured-body-codec'\nimport { AuthSelector } from '@/v2/blocks/scalar-auth-selector-block'\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport {\n COLLAPSIBLE_SECTION_HEADING_LEVEL,\n type CollapsibleSectionHeadingLevel,\n} from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\nimport type { ClientLayout } from '@/v2/types/layout'\n\ntype Filter =\n 'All' | 'Auth' | 'Variables' | 'Cookies' | 'Headers' | 'Query' | 'Body'\n\nexport type RequestBlockProps = {\n /** Security scheme names visible in the authentication UI. */\n allowedSecuritySchemes?: string[]\n authMeta: AuthMeta\n clientOptions: ClientOptionGroup[]\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n exampleKey: string\n workspaceCookies: XScalarCookie[]\n documentCookies: XScalarCookie[]\n /** Slug of the document the operation belongs to */\n documentSlug: string\n layout: ClientLayout\n method: string\n operation: OperationObject\n /** Operation before downloaded examples are overlaid, for parameter edit targets. */\n sourceOperation?: OperationObject\n path: string\n plugins: ClientPlugin[]\n proxyUrl: string\n securityRequirements: OpenApiDocument['security']\n securitySchemes: MergedSecuritySchemes\n /** Originating OpenAPI version, used for XML mapping rules. */\n openapiVersion?: string\n requestBodyCompositionSelection?: Record<string, number>\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n selectedSecurity: SelectedSecurity\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n server: ServerObject | null\n defaultHeaders: Record<string, string>\n /** Initial view for structured request bodies, from the `x-scalar-default-request-body-view` document extension */\n defaultRequestBodyView?: 'form' | 'raw'\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}\n\nconst {\n allowedSecuritySchemes,\n authMeta = { type: 'document' },\n clientOptions,\n environment,\n eventBus,\n exampleKey,\n workspaceCookies,\n documentCookies,\n documentSlug,\n layout,\n method,\n operation,\n sourceOperation,\n path,\n plugins,\n proxyUrl,\n requestBodyCompositionSelection,\n openapiVersion,\n securityRequirements,\n securitySchemes,\n selectedClient,\n selectedSecurity,\n selectedSecuritySchemes,\n server,\n defaultHeaders: autoGeneratedHeaders,\n defaultRequestBodyView = 'raw',\n} = defineProps<RequestBlockProps>()\n\nconst { translate } = useLocalization()\n\n/** Base name for examples created by the \"generate example from schema\" button */\nconst GENERATED_EXAMPLE_NAME = 'Generated from schema'\n\n/** Operation metadata used across event emissions */\nconst meta = computed(() => ({\n method,\n path,\n exampleKey,\n}))\n\nconst deletedExpandedParameterPaths = ref<Record<string, string[][]>>({})\n\n/** Renamed expanded rows, tracked as old-schema-path -> typed-value-path per parameter. */\nconst renamedExpandedParameterPaths = ref<\n Record<string, { from: string[]; to: string[] }[]>\n>({})\n\nconst getExpandedParameterKey = (parameter: {\n in: string\n name: string\n}): string => `${parameter.in}:${parameter.name}`\n\nconst getHiddenValuePaths = (parameter: {\n in: string\n name: string\n}): string[][] =>\n deletedExpandedParameterPaths.value[getExpandedParameterKey(parameter)] ?? []\n\n/** Multi-field objects remain available in the picker; single-field objects retain ordinary deletion. */\nconst hideExpandedRowPath = (row: TableRow): void => {\n if (!row.originalParameter || !row.sourceParameterValuePath) {\n return\n }\n const siblings =\n sections.value.query?.filter(\n (entry) => entry.originalParameter === row.originalParameter,\n ) ?? []\n if (siblings.length > 1) {\n return\n }\n const key = getExpandedParameterKey(row.originalParameter)\n deletedExpandedParameterPaths.value = {\n ...deletedExpandedParameterPaths.value,\n [key]: [\n ...(deletedExpandedParameterPaths.value[key] ?? []),\n row.sourceParameterValuePath,\n ],\n }\n}\n\nconst getRenamedValuePaths = (parameter: {\n in: string\n name: string\n}): { from: string[]; to: string[] }[] =>\n renamedExpandedParameterPaths.value[getExpandedParameterKey(parameter)] ?? []\n\nconst pathsEqual = (a: string[], b: string[]): boolean =>\n a.length === b.length && a.every((segment, index) => segment === b[index])\n\n/**\n * Records that an expanded row was renamed from its current value path to the typed one, so the\n * read side can render the renamed key in the original property's slot instead of appending it to\n * the end of the table. Repeated renames of the same row stay anchored to the original schema path.\n */\nconst recordExpandedRowRename = (\n row: TableRow,\n newValuePath: string[],\n): void => {\n if (!row.originalParameter || !row.sourceParameterValuePath) {\n return\n }\n\n const from = row.sourceParameterValuePath\n const key = getExpandedParameterKey(row.originalParameter)\n const existing = renamedExpandedParameterPaths.value[key] ?? []\n\n // If this row was already renamed, the row's current path is the previous target. Re-anchor that\n // entry to the new target so a second rename does not create an orphaned mapping.\n const chained = existing.find((entry) => pathsEqual(entry.to, from))\n const next = chained\n ? existing.map((entry) =>\n entry === chained ? { from: entry.from, to: newValuePath } : entry,\n )\n : [...existing, { from, to: newValuePath }]\n\n renamedExpandedParameterPaths.value = {\n ...renamedExpandedParameterPaths.value,\n [key]: next,\n }\n}\n\n/** Whole-query parameters share the Query section but retain their original identity. */\nconst hasQuerystringParameter = computed(\n () =>\n operation.parameters?.some(\n (parameter) => getResolvedRef(parameter)?.in === 'querystring',\n ) ?? false,\n)\n\n/** Parameters grouped by type (path, query, header, cookie) */\nconst sections = computed(() =>\n groupBy(\n operation.parameters?.flatMap((reference, index) => {\n const param = getResolvedRef(reference)\n if (!param) {\n return []\n }\n return createParameterRows(param, exampleKey, {\n hiddenValuePaths:\n param.in === 'query' ? getHiddenValuePaths(param) : [],\n renamedValuePaths:\n param.in === 'query' ? getRenamedValuePaths(param) : [],\n }).map((row) => ({\n ...row,\n // Overlays retain parameter order, but their downloaded values are read-only.\n originalParameter:\n getResolvedRef(sourceOperation?.parameters?.[index]) ?? param,\n in: param.in === 'querystring' ? 'query' : param.in,\n }))\n }) ?? [],\n 'in',\n ({ in: _in, ...row }) => {\n return row\n },\n ),\n)\n\n// Generate a reverse map for fast lookup of headers by the name\nconst headersMap = computed(() =>\n groupBy(\n sections.value.header?.map((it) => ({\n ...it,\n name: it.name.toLowerCase(),\n })) ?? [],\n 'name',\n ),\n)\n\nconst defaultHeaders = computed(() => {\n const disableParameters =\n operation['x-scalar-disable-parameters']?.['default-headers']?.[\n exampleKey\n ] ?? {}\n\n const isOverridden = (name: string) => {\n const header = headersMap.value[name.toLowerCase()]?.[0]\n\n if (!header) {\n return false\n }\n\n return !header.isDisabled\n }\n\n return Object.entries(autoGeneratedHeaders).map(([name, value]) => {\n return {\n name,\n value,\n schema: undefined,\n isOverridden: isOverridden(name),\n isReadonly: true,\n isDisabled: disableParameters[name.toLowerCase()] ?? false,\n } satisfies TableRow\n })\n})\n\nconst headers = computed(() => [\n ...defaultHeaders.value,\n ...(sections.value.header ?? []),\n])\n\n/** Resolved request URL, used to filter global cookies by their domain and path. */\nconst requestCookieUrl = computed(() => {\n const environmentVariables = getEnvironmentVariables(environment)\n const resolvedUrl = getResolvedUrl({ server, path })\n return replaceEnvVariables(resolvedUrl, environmentVariables)\n})\n\n/**\n * Global cookies grouped by name. Same-named cookies collapse into a single logical cookie so\n * duplicate names no longer share one disabled state (which made toggling one toggle them all).\n * A name with multiple values becomes a preset the user can switch between.\n */\nconst globalCookieGroups = computed(() =>\n groupGlobalCookies({\n sources: [\n { location: 'workspace', cookies: workspaceCookies },\n { location: 'document', cookies: documentCookies },\n ],\n // Keep domain/path filtering but ignore the disabled flag, so a disabled preset value stays\n // selectable in the switcher (it is only hidden from the request, not from the dropdown).\n shouldInclude: (cookie) =>\n filterGlobalCookie({\n cookie: { ...cookie, isDisabled: false },\n url: requestCookieUrl.value,\n disabledGlobalCookies: {},\n }),\n }),\n)\n\nconst defaultCookies = computed<TableRow[]>(() => {\n const disabledGlobalCookies =\n operation['x-scalar-disable-parameters']?.['global-cookies']?.[\n exampleKey\n ] ?? {}\n\n return globalCookieGroups.value.map((group) => ({\n name: group.name,\n value: group.selectedValue,\n globalRoute: { page: group.location, path: 'cookies' } as const,\n isReadonly: true,\n isDisabled: disabledGlobalCookies[group.name.toLowerCase()] ?? false,\n presetOptions: group.isPreset ? group.options : undefined,\n }))\n})\n\n/**\n * Switch a grouped global cookie preset to the chosen value by enabling the matching sibling and\n * disabling the rest. Selection is written back to the source `x-scalar-cookies` list so it\n * persists, and the send path drops disabled cookies, so only the selected value is sent.\n */\nconst handleSelectCookiePreset = (index: number, value: string): void => {\n const group = globalCookieGroups.value[index]\n if (!group) {\n return\n }\n\n for (const sibling of group.siblings) {\n eventBus.emit('cookie:upsert:cookie', {\n collectionType: sibling.location,\n index: sibling.index,\n payload: { isDisabled: sibling.value !== value },\n })\n }\n}\n\nconst cookies = computed(() => [\n ...(defaultCookies.value ?? []),\n ...(sections.value.cookie ?? []),\n])\n\n/** Currently selected filter for the request sections */\nconst selectedFilter = ref<Filter>('All')\n\n/** Available operation sections */\nconst OPERATION_SECTIONS: readonly Filter[] = [\n 'Auth',\n 'Variables',\n 'Cookies',\n 'Headers',\n 'Query',\n 'Body',\n] as const\n\n/**\n * Pre-generated stable IDs for all possible filter sections.\n * These are created once at setup time to avoid regenerating IDs on re-render.\n */\nconst sectionIds: Record<Filter, string> = {\n All: useId(),\n Auth: useId(),\n Variables: useId(),\n Cookies: useId(),\n Headers: useId(),\n Query: useId(),\n Body: useId(),\n}\n\n/** Filters available based on operation state */\nconst filters = computed<Filter[]>(() => {\n const availableFilters = new Set<Filter>(['All', ...OPERATION_SECTIONS])\n\n if (!sections.value.path?.length) {\n availableFilters.delete('Variables')\n }\n if (!canMethodHaveBody(method)) {\n availableFilters.delete('Body')\n }\n if (isAuthHidden.value) {\n availableFilters.delete('Auth')\n }\n\n return [...availableFilters]\n})\n\n/**\n * Map available filters to their pre-generated stable IDs.\n * Only includes IDs for filters that are currently available.\n */\nconst filterIds = computed(() =>\n filters.value.reduce<Partial<Record<Filter, string>>>((ids, section) => {\n ids[section] = sectionIds[section]\n return ids\n }, {}),\n)\n\n/**\n * Hide auth selector in readonly mode when no security schemes are defined.\n * This keeps the UI clean when there are no authentication options available.\n */\nconst isAuthHidden = computed(\n () => layout === 'modal' && !Object.keys(securitySchemes ?? {}).length,\n)\n\n/**\n * Keep auth available for unauthenticated operations, but collapse it by default\n * in readonly modal layouts unless a requirement or manual selection exists.\n */\nconst isAuthDefaultOpen = computed(\n () =>\n layout !== 'modal' ||\n Boolean(\n securityRequirements?.length || selectedSecurity.selectedSchemes.length,\n ),\n)\n\n/** Get a sensible placeholder for the request name input */\nconst requestNamePlaceholder = computed(() => {\n if (operation.summary) {\n return operation.summary\n }\n const cleanPath = path.replace(REGEX.PROTOCOL, '')\n return cleanPath || translate('apiClient.requestBlock.requestName')\n})\n\n/** Check if the section should be shown based on the selected filter */\nconst isSectionVisible = (section: Filter): boolean => {\n return selectedFilter.value === 'All' || selectedFilter.value === section\n}\n\n/**\n * Reset filter to 'All' if Body filter is selected but method changes to one that cannot have a body.\n * This prevents showing an empty Body section when switching methods.\n */\nwatch(\n () => method,\n (newMethod) => {\n if (selectedFilter.value === 'Body' && !canMethodHaveBody(newMethod)) {\n selectedFilter.value = 'All'\n }\n },\n)\n\n// Expanded-row bookkeeping is keyed by `in:name`, which is not unique across operations or\n// examples. Reset both maps when the operation or example changes so stale delete/rename mappings\n// do not leak onto another request that happens to share a query parameter name.\nwatch(\n () => [method, path, exampleKey],\n () => {\n deletedExpandedParameterPaths.value = {}\n renamedExpandedParameterPaths.value = {}\n },\n)\n\n/** Handle operation summary updates */\nconst handleSummaryUpdate = (event: Event): void => {\n if (!(event.target instanceof HTMLInputElement)) {\n return\n }\n const summary = event.target.value\n eventBus.emit('operation:update:meta', {\n meta: meta.value,\n payload: { summary: summary.trim() },\n })\n}\n\n/** Parameter handlers */\nconst parameterHandlers = computed(() => ({\n path: createParameterHandlers('path', eventBus, meta.value, {\n context: sections.value.path ?? [],\n }),\n cookie: {\n ...createParameterHandlers('cookie', eventBus, meta.value, {\n context: cookies.value ?? [],\n globalParameters: defaultCookies.value.length,\n }),\n selectPreset: handleSelectCookiePreset,\n },\n header: createParameterHandlers('header', eventBus, meta.value, {\n context: headers.value,\n defaultParameters: defaultHeaders.value.length,\n }),\n query: createParameterHandlers('query', eventBus, meta.value, {\n context: sections.value.query ?? [],\n onDeleteExpandedRow: hideExpandedRowPath,\n onRenameExpandedRow: recordExpandedRowRename,\n }),\n}))\n\n/** Apply pending typing before the reset event so a delayed edit cannot undo the reset. */\nconst handleResetBody = ({ contentType }: { contentType: string }): void => {\n eventBus.flushDebouncedEmits?.()\n eventBus.emit('operation:reset:requestBody', {\n documentName: documentSlug,\n meta: meta.value,\n contentType,\n requestBodyCompositionSelection,\n openapiVersion,\n })\n}\n\n/** Handle request body content type update */\nconst handleUpdateContentType = (payload: { value: string }): void =>\n eventBus.emit('operation:update:requestBody:contentType', {\n payload: { contentType: payload.value },\n meta: meta.value,\n })\n\n/** Handle request body value update */\nconst handleUpdateBodyValue = ({\n payload,\n contentType,\n}: Pick<\n ApiReferenceEvents['operation:update:requestBody:value'],\n 'payload' | 'contentType'\n>): void => {\n const debounceKey =\n typeof payload === 'string'\n ? `update:requestBody:value-${contentType}`\n : undefined\n\n eventBus.emit(\n 'operation:update:requestBody:value',\n {\n payload,\n contentType,\n meta: meta.value,\n },\n {\n debounceKey,\n },\n )\n}\n\n/** Handle request body value update */\nconst handleUpdateBodyFormValue = ({\n payload,\n contentType,\n}: Pick<\n ApiReferenceEvents['operation:update:requestBody:formValue'],\n 'payload' | 'contentType'\n>): void => {\n const debounceKey = `update:requestBody:${contentType}-form-value`\n\n eventBus.emit(\n 'operation:update:requestBody:formValue',\n {\n payload: payload.map((row) => unpackProxyObject(row, { depth: 1 })),\n contentType,\n meta: meta.value,\n },\n {\n debounceKey,\n },\n )\n}\n\n/**\n * Create a new example seeded with values generated from the request body schema.\n *\n * Custom examples in the document otherwise hide the auto-generated fields entirely. Rather than\n * only rendering the generated body, we write it into a fresh example so the user can edit it and\n * so it survives an export of the document.\n */\nconst handleGenerateExample = ({\n contentType,\n}: {\n contentType: string\n}): void => {\n const requestBody = getResolvedRef(operation.requestBody)\n const codec = getStructuredBodyCodec(contentType)\n if (!requestBody || !codec) {\n return\n }\n\n const value = getSchemaExampleFromBody(\n requestBody,\n contentType,\n requestBodyCompositionSelection,\n )\n\n // A schema that generates nothing writable would leave the user on an empty new example.\n if (value === undefined || value === null) {\n return\n }\n\n const exampleName = getUniqueExampleName(operation, GENERATED_EXAMPLE_NAME)\n const exampleMeta = { path, method, exampleKey: exampleName }\n\n eventBus.emit('operation:create:draft-example', {\n documentName: documentSlug,\n meta: { path, method },\n exampleName,\n })\n\n // Carry over the content type the user was looking at, otherwise the new example opens on\n // whichever content type happens to come first on the request body.\n eventBus.emit('operation:update:requestBody:contentType', {\n payload: { contentType },\n meta: exampleMeta,\n })\n\n eventBus.emit('operation:update:requestBody:value', {\n payload: codec.stringify(value),\n contentType,\n meta: exampleMeta,\n })\n\n // The modal selects the example after its creation hook rebuilds the sidebar.\n if (layout === 'modal') {\n return\n }\n\n eventBus.emit('ui:navigate', {\n page: 'example',\n documentSlug,\n path,\n method,\n exampleName,\n })\n}\n\nconst labelRequestNameId = useId()\n\n/**\n * Where the collapsible sections below sit in the heading outline.\n *\n * The modal renders the operation summary as a heading above them, so they are\n * its subsections. Every other layout shows the summary as an editable input\n * rather than a heading, which leaves the sections at the top level.\n */\nprovide(\n COLLAPSIBLE_SECTION_HEADING_LEVEL,\n computed<CollapsibleSectionHeadingLevel>(() =>\n layout === 'modal' && operation.summary ? 3 : 2,\n ),\n)\n\nconst globalCookies = computed(() => [...workspaceCookies, ...documentCookies])\n\n/** Allow updating the operation extensions for the plugins */\nconst updateOperationExtension = (\n payload: ApiReferenceEvents['operation:update:extension']['payload'],\n): void =>\n eventBus.emit('operation:update:extension', { payload, meta: meta.value })\n\nconst filterLabels = computed(() => ({\n All: translate('apiClient.sectionFilter.all'),\n Auth: translate('apiClient.sectionFilter.auth'),\n Variables: translate('apiClient.sectionFilter.variables'),\n Cookies: translate('apiClient.sectionFilter.cookies'),\n Headers: translate('apiClient.sectionFilter.headers'),\n Query: translate('apiClient.sectionFilter.query'),\n Body: translate('apiClient.sectionFilter.body'),\n}))\n</script>\n<template>\n <ViewLayoutSection\n :aria-label=\"\n translate('apiClient.requestBlock.label', {\n name: operation.summary ?? '',\n })\n \">\n <template #title>\n <div\n class=\"group pointer-events-none flex flex-1 items-center gap-1 lg:pe-24\">\n <label\n v-if=\"layout !== 'modal'\"\n class=\"pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0\"\n :for=\"labelRequestNameId\" />\n <input\n v-if=\"layout !== 'modal'\"\n :id=\"labelRequestNameId\"\n class=\"text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25\"\n :placeholder=\"requestNamePlaceholder\"\n :value=\"operation.summary\"\n @blur=\"handleSummaryUpdate\" />\n <!-- In the modal the summary is the title of everything below it, so\n it carries the heading role that lets screen reader users jump to\n it. An operation without a summary renders nothing, because an\n empty heading is worse than none. -->\n <h2\n v-else-if=\"operation.summary\"\n class=\"text-c-1 flex h-8 items-center\">\n {{ operation.summary }}\n </h2>\n <span\n v-else\n class=\"text-c-1 flex h-8 items-center\" />\n </div>\n <SectionFilter\n v-model=\"selectedFilter\"\n :filters=\"filters\"\n :labels=\"filterLabels\" />\n </template>\n\n <div\n :id=\"filterIds.All\"\n class=\"request-section-content custom-scroll relative flex flex-1 flex-col\"\n :role=\"selectedFilter === 'All' ? 'tabpanel' : 'none'\">\n <!-- Auth Selector -->\n <AuthSelector\n v-show=\"isSectionVisible('Auth') && !isAuthHidden\"\n :id=\"filterIds.Auth\"\n :allowedSecuritySchemes\n :createAnySecurityScheme=\"layout !== 'modal'\"\n :defaultOpen=\"isAuthDefaultOpen\"\n :environment\n :eventBus\n :meta=\"authMeta\"\n :options\n :proxyUrl\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :title=\"translate('apiClient.requestBlock.authentication')\" />\n\n <!-- Variables (Path Parameters) -->\n <RequestParams\n v-show=\"isSectionVisible('Variables') && sections.path?.length\"\n :id=\"filterIds.Variables\"\n :environment\n :eventBus\n :exampleKey\n :rows=\"sections.path ?? []\"\n :showAddRowPlaceholder=\"false\"\n :title=\"translate('apiClient.requestBlock.variables')\"\n v-on=\"parameterHandlers.path\" />\n\n <!-- Cookies -->\n <RequestParams\n v-show=\"isSectionVisible('Cookies')\"\n :id=\"filterIds.Cookies\"\n :environment\n :eventBus\n :exampleKey\n :rows=\"cookies ?? []\"\n :showAddRowPlaceholder=\"true\"\n :title=\"translate('apiClient.requestBlock.cookies')\"\n v-on=\"parameterHandlers.cookie\" />\n\n <!-- Headers -->\n <RequestParams\n v-show=\"isSectionVisible('Headers')\"\n :id=\"filterIds.Headers\"\n :environment\n :eventBus\n :exampleKey\n :rows=\"headers ?? []\"\n :title=\"translate('apiClient.requestBlock.headers')\"\n v-on=\"parameterHandlers.header\" />\n\n <!-- Query Parameters -->\n <RequestParams\n v-show=\"isSectionVisible('Query')\"\n :id=\"filterIds.Query\"\n :key=\"JSON.stringify([documentSlug, method, path, exampleKey])\"\n :description=\"\n hasQuerystringParameter\n ? translate('apiClient.requestBlock.queryStringDescription')\n : undefined\n \"\n :environment\n :eventBus\n :exampleKey\n :rows=\"sections.query ?? []\"\n selectExpandedParameters\n :showAddRowPlaceholder=\"!hasQuerystringParameter\"\n :title=\"\n hasQuerystringParameter\n ? translate('apiClient.requestBlock.queryString')\n : translate('apiClient.requestBlock.queryParameters')\n \"\n v-on=\"parameterHandlers.query\" />\n\n <!-- Request Body -->\n <RequestBody\n v-show=\"isSectionVisible('Body') && canMethodHaveBody(method)\"\n :id=\"filterIds.Body\"\n :defaultView=\"defaultRequestBodyView\"\n :environment\n :exampleKey\n :openapiVersion\n :requestBody=\"getResolvedRef(operation.requestBody)\"\n :requestBodyCompositionSelection\n :title=\"translate('apiClient.requestBlock.requestBody')\"\n @generate:example=\"handleGenerateExample\"\n @reset=\"handleResetBody\"\n @update:contentType=\"handleUpdateContentType\"\n @update:formValue=\"handleUpdateBodyFormValue\"\n @update:value=\"handleUpdateBodyValue\" />\n\n <!-- Inject request section plugin components -->\n <ScalarErrorBoundary\n v-for=\"(plugin, index) in plugins\"\n :key=\"index\">\n <component\n :is=\"plugin.components.request.component\"\n v-if=\"plugin?.components?.request\"\n v-show=\"selectedFilter === 'All'\"\n :operation\n v-bind=\"plugin.components.request.additionalProps\"\n @operation:update:extension=\"updateOperationExtension\" />\n </ScalarErrorBoundary>\n\n <!-- Spacer -->\n <div class=\"flex grow\" />\n <!-- Code Snippet -->\n <RequestCodeSnippet\n v-show=\"selectedFilter === 'All'\"\n :clientOptions\n :eventBus\n :globalCookies\n integration=\"client\"\n :method\n :openapiVersion\n :operation\n :path\n :requestBodyCompositionSelection\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedContentType=\"\n getResolvedRef(operation.requestBody)?.[\n 'x-scalar-selected-content-type'\n ]?.[exampleKey]\n \"\n :selectedExample=\"exampleKey\"\n :selectedServer=\"server ?? undefined\" />\n </div>\n </ViewLayoutSection>\n</template>\n<style scoped>\n.request-section-content {\n --scalar-border-width: 0.5px;\n}\n.request-section-content-filter {\n box-shadow: 0 -10px 0 10px var(--scalar-background-1);\n}\n.request-item:focus-within .request-meta-buttons {\n opacity: 1;\n}\n.group-hover-input {\n border-width: var(--scalar-border-width);\n border-color: transparent;\n}\n.group:hover .group-hover-input {\n background: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n border-color: var(--scalar-border-color);\n}\n.group-hover-input:focus {\n background: transparent !important;\n border-color: var(--scalar-border-color) !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,IAAM,yBAAyB;;;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iCAAgE,GAAA,QAAA;MAKpI,iBAAiB,QAAA;MACjB,gBAAgB,QAAA,UAAU,KAAA;;;;;;;;;;;;;;;K,KAlBnB,CAAAU,OAAA,eAAA,UAAc,KAAA,C"}
1
+ {"version":3,"file":"RequestBlock.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","ViewLayoutSection","_unref","_withCtx","_createElementVNode","_createElementBlock","_createCommentVNode","_toDisplayString","_createVNode","SectionFilter","_withDirectives","AuthSelector","_vShow","RequestParams","_mergeProps","_toHandlers","RequestBody","_Fragment","_renderList","_resolveDynamicComponent","RequestCodeSnippet"],"sources":["../../../../src/v2/blocks/request-block/RequestBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/blocks/code-example'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { canMethodHaveBody } from '@scalar/helpers/http/can-method-have-body'\nimport { REGEX } from '@scalar/helpers/regex/regex-helpers'\nimport { replaceEnvVariables } from '@scalar/helpers/regex/replace-variables'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { getUniqueExampleName } from '@scalar/workspace-store/navigation'\nimport {\n filterGlobalCookie,\n getEnvironmentVariables,\n getResolvedUrl,\n getSchemaExampleFromBody,\n type MergedSecuritySchemes,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, provide, ref, useId, watch } from 'vue'\n\nimport SectionFilter from '@/components/SectionFilter.vue'\nimport ViewLayoutSection from '@/components/ViewLayout/ViewLayoutSection.vue'\nimport RequestBody from '@/v2/blocks/request-block/components/RequestBody.vue'\nimport RequestCodeSnippet from '@/v2/blocks/request-block/components/RequestCodeSnippet.vue'\nimport RequestParams from '@/v2/blocks/request-block/components/RequestParams.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport { createParameterHandlers } from '@/v2/blocks/request-block/helpers/create-parameter-handlers'\nimport { createParameterRows } from '@/v2/blocks/request-block/helpers/create-parameter-rows'\nimport { groupBy } from '@/v2/blocks/request-block/helpers/group-by'\nimport { groupGlobalCookies } from '@/v2/blocks/request-block/helpers/group-global-cookies'\nimport { getStructuredBodyCodec } from '@/v2/blocks/request-block/helpers/structured-body-codec'\nimport { AuthSelector } from '@/v2/blocks/scalar-auth-selector-block'\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport {\n COLLAPSIBLE_SECTION_HEADING_LEVEL,\n type CollapsibleSectionHeadingLevel,\n} from '@/v2/components/layout'\nimport { useLocalization } from '@/v2/features/localization'\nimport type { ClientLayout } from '@/v2/types/layout'\n\ntype Filter =\n 'All' | 'Auth' | 'Variables' | 'Cookies' | 'Headers' | 'Query' | 'Body'\n\nexport type RequestBlockProps = {\n /** Security scheme names visible in the authentication UI. */\n allowedSecuritySchemes?: string[]\n authMeta: AuthMeta\n clientOptions: ClientOptionGroup[]\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n exampleKey: string\n workspaceCookies: XScalarCookie[]\n documentCookies: XScalarCookie[]\n /** Slug of the document the operation belongs to */\n documentSlug: string\n layout: ClientLayout\n method: string\n operation: OperationObject\n /** Operation before downloaded examples are overlaid, for parameter edit targets. */\n sourceOperation?: OperationObject\n path: string\n plugins: ClientPlugin[]\n proxyUrl: string\n securityRequirements: OpenApiDocument['security']\n securitySchemes: MergedSecuritySchemes\n /** Originating OpenAPI version, used for XML mapping rules. */\n openapiVersion?: string\n requestBodyCompositionSelection?: Record<string, number>\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n selectedSecurity: SelectedSecurity\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n server: ServerObject | null\n defaultHeaders: Record<string, string>\n /** Initial view for structured request bodies, from the `x-scalar-default-request-body-view` document extension */\n defaultRequestBodyView?: 'form' | 'raw'\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}\n\nconst {\n allowedSecuritySchemes,\n authMeta = { type: 'document' },\n clientOptions,\n environment,\n eventBus,\n exampleKey,\n workspaceCookies,\n documentCookies,\n documentSlug,\n layout,\n method,\n operation,\n sourceOperation,\n path,\n plugins,\n proxyUrl,\n requestBodyCompositionSelection,\n openapiVersion,\n securityRequirements,\n securitySchemes,\n selectedClient,\n selectedSecurity,\n selectedSecuritySchemes,\n server,\n defaultHeaders: autoGeneratedHeaders,\n defaultRequestBodyView = 'raw',\n} = defineProps<RequestBlockProps>()\n\nconst { translate } = useLocalization()\n\n/** Base name for examples created by the \"generate example from schema\" button */\nconst GENERATED_EXAMPLE_NAME = 'Generated from schema'\n\n/** Operation metadata used across event emissions */\nconst meta = computed(() => ({\n method,\n path,\n exampleKey,\n}))\n\nconst deletedExpandedParameterPaths = ref<Record<string, string[][]>>({})\n\n/** Renamed expanded rows, tracked as old-schema-path -> typed-value-path per parameter. */\nconst renamedExpandedParameterPaths = ref<\n Record<string, { from: string[]; to: string[] }[]>\n>({})\n\nconst getExpandedParameterKey = (parameter: {\n in: string\n name: string\n}): string => `${parameter.in}:${parameter.name}`\n\nconst getHiddenValuePaths = (parameter: {\n in: string\n name: string\n}): string[][] =>\n deletedExpandedParameterPaths.value[getExpandedParameterKey(parameter)] ?? []\n\n/** Multi-field objects remain available in the picker; single-field objects retain ordinary deletion. */\nconst hideExpandedRowPath = (row: TableRow): void => {\n if (!row.originalParameter || !row.sourceParameterValuePath) {\n return\n }\n const siblings =\n sections.value.query?.filter(\n (entry) => entry.originalParameter === row.originalParameter,\n ) ?? []\n if (siblings.length > 1) {\n return\n }\n const key = getExpandedParameterKey(row.originalParameter)\n deletedExpandedParameterPaths.value = {\n ...deletedExpandedParameterPaths.value,\n [key]: [\n ...(deletedExpandedParameterPaths.value[key] ?? []),\n row.sourceParameterValuePath,\n ],\n }\n}\n\nconst getRenamedValuePaths = (parameter: {\n in: string\n name: string\n}): { from: string[]; to: string[] }[] =>\n renamedExpandedParameterPaths.value[getExpandedParameterKey(parameter)] ?? []\n\nconst pathsEqual = (a: string[], b: string[]): boolean =>\n a.length === b.length && a.every((segment, index) => segment === b[index])\n\n/**\n * Records that an expanded row was renamed from its current value path to the typed one, so the\n * read side can render the renamed key in the original property's slot instead of appending it to\n * the end of the table. Repeated renames of the same row stay anchored to the original schema path.\n */\nconst recordExpandedRowRename = (\n row: TableRow,\n newValuePath: string[],\n): void => {\n if (!row.originalParameter || !row.sourceParameterValuePath) {\n return\n }\n\n const from = row.sourceParameterValuePath\n const key = getExpandedParameterKey(row.originalParameter)\n const existing = renamedExpandedParameterPaths.value[key] ?? []\n\n // If this row was already renamed, the row's current path is the previous target. Re-anchor that\n // entry to the new target so a second rename does not create an orphaned mapping.\n const chained = existing.find((entry) => pathsEqual(entry.to, from))\n const next = chained\n ? existing.map((entry) =>\n entry === chained ? { from: entry.from, to: newValuePath } : entry,\n )\n : [...existing, { from, to: newValuePath }]\n\n renamedExpandedParameterPaths.value = {\n ...renamedExpandedParameterPaths.value,\n [key]: next,\n }\n}\n\n/** Whole-query parameters share the Query section but retain their original identity. */\nconst hasQuerystringParameter = computed(\n () =>\n operation.parameters?.some(\n (parameter) => getResolvedRef(parameter)?.in === 'querystring',\n ) ?? false,\n)\n\n/** Parameters grouped by type (path, query, header, cookie) */\nconst sections = computed(() =>\n groupBy(\n operation.parameters?.flatMap((reference, index) => {\n const param = getResolvedRef(reference)\n if (!param) {\n return []\n }\n return createParameterRows(param, exampleKey, {\n hiddenValuePaths:\n param.in === 'query' ? getHiddenValuePaths(param) : [],\n renamedValuePaths:\n param.in === 'query' ? getRenamedValuePaths(param) : [],\n }).map((row) => ({\n ...row,\n // Overlays retain parameter order, but their downloaded values are read-only.\n originalParameter:\n getResolvedRef(sourceOperation?.parameters?.[index]) ?? param,\n in: param.in === 'querystring' ? 'query' : param.in,\n }))\n }) ?? [],\n 'in',\n ({ in: _in, ...row }) => {\n return row\n },\n ),\n)\n\n// Generate a reverse map for fast lookup of headers by the name\nconst headersMap = computed(() =>\n groupBy(\n sections.value.header?.map((it) => ({\n ...it,\n name: it.name.toLowerCase(),\n })) ?? [],\n 'name',\n ),\n)\n\nconst defaultHeaders = computed(() => {\n const disableParameters =\n operation['x-scalar-disable-parameters']?.['default-headers']?.[\n exampleKey\n ] ?? {}\n\n const isOverridden = (name: string) => {\n const header = headersMap.value[name.toLowerCase()]?.[0]\n\n if (!header) {\n return false\n }\n\n return !header.isDisabled\n }\n\n return Object.entries(autoGeneratedHeaders).map(([name, value]) => {\n return {\n name,\n value,\n schema: undefined,\n isOverridden: isOverridden(name),\n isReadonly: true,\n isDisabled: disableParameters[name.toLowerCase()] ?? false,\n } satisfies TableRow\n })\n})\n\nconst headers = computed(() => [\n ...defaultHeaders.value,\n ...(sections.value.header ?? []),\n])\n\n/** Resolved request URL, used to filter global cookies by their domain and path. */\nconst requestCookieUrl = computed(() => {\n const environmentVariables = getEnvironmentVariables(environment)\n const resolvedUrl = getResolvedUrl({ server, path })\n return replaceEnvVariables(resolvedUrl, environmentVariables)\n})\n\n/**\n * Global cookies grouped by name. Same-named cookies collapse into a single logical cookie so\n * duplicate names no longer share one disabled state (which made toggling one toggle them all).\n * A name with multiple values becomes a preset the user can switch between.\n */\nconst globalCookieGroups = computed(() =>\n groupGlobalCookies({\n sources: [\n { location: 'workspace', cookies: workspaceCookies },\n { location: 'document', cookies: documentCookies },\n ],\n // Keep domain/path filtering but ignore the disabled flag, so a disabled preset value stays\n // selectable in the switcher (it is only hidden from the request, not from the dropdown).\n shouldInclude: (cookie) =>\n filterGlobalCookie({\n cookie: { ...cookie, isDisabled: false },\n url: requestCookieUrl.value,\n disabledGlobalCookies: {},\n }),\n }),\n)\n\nconst defaultCookies = computed<TableRow[]>(() => {\n const disabledGlobalCookies =\n operation['x-scalar-disable-parameters']?.['global-cookies']?.[\n exampleKey\n ] ?? {}\n\n return globalCookieGroups.value.map((group) => ({\n name: group.name,\n value: group.selectedValue,\n globalRoute: { page: group.location, path: 'cookies' } as const,\n isReadonly: true,\n isDisabled: disabledGlobalCookies[group.name.toLowerCase()] ?? false,\n presetOptions: group.isPreset ? group.options : undefined,\n }))\n})\n\n/**\n * Switch a grouped global cookie preset to the chosen value by enabling the matching sibling and\n * disabling the rest. Selection is written back to the source `x-scalar-cookies` list so it\n * persists, and the send path drops disabled cookies, so only the selected value is sent.\n */\nconst handleSelectCookiePreset = (index: number, value: string): void => {\n const group = globalCookieGroups.value[index]\n if (!group) {\n return\n }\n\n for (const sibling of group.siblings) {\n eventBus.emit('cookie:upsert:cookie', {\n collectionType: sibling.location,\n index: sibling.index,\n payload: { isDisabled: sibling.value !== value },\n })\n }\n}\n\nconst cookies = computed(() => [\n ...(defaultCookies.value ?? []),\n ...(sections.value.cookie ?? []),\n])\n\n/** Currently selected filter for the request sections */\nconst selectedFilter = ref<Filter>('All')\n\n/** Available operation sections */\nconst OPERATION_SECTIONS: readonly Filter[] = [\n 'Auth',\n 'Variables',\n 'Cookies',\n 'Headers',\n 'Query',\n 'Body',\n] as const\n\n/**\n * Pre-generated stable IDs for all possible filter sections.\n * These are created once at setup time to avoid regenerating IDs on re-render.\n */\nconst sectionIds: Record<Filter, string> = {\n All: useId(),\n Auth: useId(),\n Variables: useId(),\n Cookies: useId(),\n Headers: useId(),\n Query: useId(),\n Body: useId(),\n}\n\n/** Filters available based on operation state */\nconst filters = computed<Filter[]>(() => {\n const availableFilters = new Set<Filter>(['All', ...OPERATION_SECTIONS])\n\n if (!sections.value.path?.length) {\n availableFilters.delete('Variables')\n }\n if (!canMethodHaveBody(method)) {\n availableFilters.delete('Body')\n }\n if (isAuthHidden.value) {\n availableFilters.delete('Auth')\n }\n\n return [...availableFilters]\n})\n\n/**\n * Map available filters to their pre-generated stable IDs.\n * Only includes IDs for filters that are currently available.\n */\nconst filterIds = computed(() =>\n filters.value.reduce<Partial<Record<Filter, string>>>((ids, section) => {\n ids[section] = sectionIds[section]\n return ids\n }, {}),\n)\n\n/**\n * Hide auth selector in readonly mode when no security schemes are defined.\n * This keeps the UI clean when there are no authentication options available.\n */\nconst isAuthHidden = computed(\n () => layout === 'modal' && !Object.keys(securitySchemes ?? {}).length,\n)\n\n/**\n * Keep auth available for unauthenticated operations, but collapse it by default\n * in readonly modal layouts unless a requirement or manual selection exists.\n */\nconst isAuthDefaultOpen = computed(\n () =>\n layout !== 'modal' ||\n Boolean(\n securityRequirements?.length || selectedSecurity.selectedSchemes.length,\n ),\n)\n\n/** Get a sensible placeholder for the request name input */\nconst requestNamePlaceholder = computed(() => {\n if (operation.summary) {\n return operation.summary\n }\n const cleanPath = path.replace(REGEX.PROTOCOL, '')\n return cleanPath || translate('apiClient.requestBlock.requestName')\n})\n\n/** Check if the section should be shown based on the selected filter */\nconst isSectionVisible = (section: Filter): boolean => {\n return selectedFilter.value === 'All' || selectedFilter.value === section\n}\n\n/**\n * Reset filter to 'All' if Body filter is selected but method changes to one that cannot have a body.\n * This prevents showing an empty Body section when switching methods.\n */\nwatch(\n () => method,\n (newMethod) => {\n if (selectedFilter.value === 'Body' && !canMethodHaveBody(newMethod)) {\n selectedFilter.value = 'All'\n }\n },\n)\n\n// Expanded-row bookkeeping is keyed by `in:name`, which is not unique across operations or\n// examples. Reset both maps when the operation or example changes so stale delete/rename mappings\n// do not leak onto another request that happens to share a query parameter name.\nwatch(\n () => [method, path, exampleKey],\n () => {\n deletedExpandedParameterPaths.value = {}\n renamedExpandedParameterPaths.value = {}\n },\n)\n\n/** Handle operation summary updates */\nconst handleSummaryUpdate = (event: Event): void => {\n if (!(event.target instanceof HTMLInputElement)) {\n return\n }\n const summary = event.target.value\n eventBus.emit('operation:update:meta', {\n meta: meta.value,\n payload: { summary: summary.trim() },\n })\n}\n\n/** Parameter handlers */\nconst parameterHandlers = computed(() => ({\n path: createParameterHandlers('path', eventBus, meta.value, {\n context: sections.value.path ?? [],\n }),\n cookie: {\n ...createParameterHandlers('cookie', eventBus, meta.value, {\n context: cookies.value ?? [],\n globalParameters: defaultCookies.value.length,\n }),\n selectPreset: handleSelectCookiePreset,\n },\n header: createParameterHandlers('header', eventBus, meta.value, {\n context: headers.value,\n defaultParameters: defaultHeaders.value.length,\n }),\n query: createParameterHandlers('query', eventBus, meta.value, {\n context: sections.value.query ?? [],\n onDeleteExpandedRow: hideExpandedRowPath,\n onRenameExpandedRow: recordExpandedRowRename,\n }),\n}))\n\n/** Apply pending typing before the reset event so a delayed edit cannot undo the reset. */\nconst handleResetBody = ({ contentType }: { contentType: string }): void => {\n eventBus.flushDebouncedEmits?.()\n eventBus.emit('operation:reset:requestBody', {\n documentName: documentSlug,\n meta: meta.value,\n contentType,\n requestBodyCompositionSelection,\n openapiVersion,\n })\n}\n\n/** Handle request body content type update */\nconst handleUpdateContentType = (payload: { value: string }): void =>\n eventBus.emit('operation:update:requestBody:contentType', {\n payload: { contentType: payload.value },\n meta: meta.value,\n })\n\n/** Handle request body value update */\nconst handleUpdateBodyValue = ({\n payload,\n contentType,\n}: Pick<\n ApiReferenceEvents['operation:update:requestBody:value'],\n 'payload' | 'contentType'\n>): void => {\n const debounceKey =\n typeof payload === 'string'\n ? `update:requestBody:value-${contentType}`\n : undefined\n\n eventBus.emit(\n 'operation:update:requestBody:value',\n {\n payload,\n contentType,\n meta: meta.value,\n },\n {\n debounceKey,\n },\n )\n}\n\n/** Handle request body value update */\nconst handleUpdateBodyFormValue = ({\n payload,\n contentType,\n}: Pick<\n ApiReferenceEvents['operation:update:requestBody:formValue'],\n 'payload' | 'contentType'\n>): void => {\n const debounceKey = `update:requestBody:${contentType}-form-value`\n\n eventBus.emit(\n 'operation:update:requestBody:formValue',\n {\n payload: payload.map((row) => unpackProxyObject(row, { depth: 1 })),\n contentType,\n meta: meta.value,\n },\n {\n debounceKey,\n },\n )\n}\n\n/**\n * Create a new example seeded with values generated from the request body schema.\n *\n * Custom examples in the document otherwise hide the auto-generated fields entirely. Rather than\n * only rendering the generated body, we write it into a fresh example so the user can edit it and\n * so it survives an export of the document.\n */\nconst handleGenerateExample = ({\n contentType,\n}: {\n contentType: string\n}): void => {\n const requestBody = getResolvedRef(operation.requestBody)\n const codec = getStructuredBodyCodec(contentType)\n if (!requestBody || !codec) {\n return\n }\n\n const value = getSchemaExampleFromBody(\n requestBody,\n contentType,\n requestBodyCompositionSelection,\n )\n\n // A schema that generates nothing writable would leave the user on an empty new example.\n if (value === undefined || value === null) {\n return\n }\n\n const exampleName = getUniqueExampleName(operation, GENERATED_EXAMPLE_NAME)\n const exampleMeta = { path, method, exampleKey: exampleName }\n\n eventBus.emit('operation:create:draft-example', {\n documentName: documentSlug,\n meta: { path, method },\n exampleName,\n })\n\n // Carry over the content type the user was looking at, otherwise the new example opens on\n // whichever content type happens to come first on the request body.\n eventBus.emit('operation:update:requestBody:contentType', {\n payload: { contentType },\n meta: exampleMeta,\n })\n\n eventBus.emit('operation:update:requestBody:value', {\n payload: codec.stringify(value),\n contentType,\n meta: exampleMeta,\n })\n\n // The modal selects the example after its creation hook rebuilds the sidebar.\n if (layout === 'modal') {\n return\n }\n\n eventBus.emit('ui:navigate', {\n page: 'example',\n documentSlug,\n path,\n method,\n exampleName,\n })\n}\n\nconst labelRequestNameId = useId()\n\n/**\n * Where the collapsible sections below sit in the heading outline.\n *\n * The modal renders the operation summary as a heading above them, so they are\n * its subsections. Every other layout shows the summary as an editable input\n * rather than a heading, which leaves the sections at the top level.\n */\nprovide(\n COLLAPSIBLE_SECTION_HEADING_LEVEL,\n computed<CollapsibleSectionHeadingLevel>(() =>\n layout === 'modal' && operation.summary ? 3 : 2,\n ),\n)\n\nconst globalCookies = computed(() => [...workspaceCookies, ...documentCookies])\n\n/** Allow updating the operation extensions for the plugins */\nconst updateOperationExtension = (\n payload: ApiReferenceEvents['operation:update:extension']['payload'],\n): void =>\n eventBus.emit('operation:update:extension', { payload, meta: meta.value })\n\nconst filterLabels = computed(() => ({\n All: translate('apiClient.sectionFilter.all'),\n Auth: translate('apiClient.sectionFilter.auth'),\n Variables: translate('apiClient.sectionFilter.variables'),\n Cookies: translate('apiClient.sectionFilter.cookies'),\n Headers: translate('apiClient.sectionFilter.headers'),\n Query: translate('apiClient.sectionFilter.query'),\n Body: translate('apiClient.sectionFilter.body'),\n}))\n</script>\n<template>\n <ViewLayoutSection\n :aria-label=\"\n translate('apiClient.requestBlock.label', {\n name: operation.summary ?? '',\n })\n \">\n <template #title>\n <div\n class=\"group pointer-events-none flex flex-1 items-center gap-1 lg:pe-24\">\n <label\n v-if=\"layout !== 'modal'\"\n class=\"pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0\"\n :for=\"labelRequestNameId\" />\n <input\n v-if=\"layout !== 'modal'\"\n :id=\"labelRequestNameId\"\n class=\"text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25\"\n :placeholder=\"requestNamePlaceholder\"\n :value=\"operation.summary\"\n @blur=\"handleSummaryUpdate\" />\n <!-- In the modal the summary is the title of everything below it, so\n it carries the heading role that lets screen reader users jump to\n it. An operation without a summary renders nothing, because an\n empty heading is worse than none. -->\n <h2\n v-else-if=\"operation.summary\"\n class=\"text-c-1 flex h-8 items-center\">\n {{ operation.summary }}\n </h2>\n <span\n v-else\n class=\"text-c-1 flex h-8 items-center\" />\n </div>\n <SectionFilter\n v-model=\"selectedFilter\"\n :filters=\"filters\"\n :labels=\"filterLabels\" />\n </template>\n\n <div\n :id=\"filterIds.All\"\n class=\"request-section-content custom-scroll relative flex flex-1 flex-col\"\n :role=\"selectedFilter === 'All' ? 'tabpanel' : 'none'\">\n <!-- Auth Selector -->\n <AuthSelector\n v-show=\"isSectionVisible('Auth') && !isAuthHidden\"\n :id=\"filterIds.Auth\"\n :allowedSecuritySchemes\n :createAnySecurityScheme=\"layout !== 'modal'\"\n :defaultOpen=\"isAuthDefaultOpen\"\n :environment\n :eventBus\n :meta=\"authMeta\"\n :options\n :proxyUrl\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :title=\"translate('apiClient.requestBlock.authentication')\" />\n\n <!-- Variables (Path Parameters) -->\n <RequestParams\n v-show=\"isSectionVisible('Variables') && sections.path?.length\"\n :id=\"filterIds.Variables\"\n :environment\n :eventBus\n :exampleKey\n :rows=\"sections.path ?? []\"\n :showAddRowPlaceholder=\"false\"\n :title=\"translate('apiClient.requestBlock.variables')\"\n v-on=\"parameterHandlers.path\" />\n\n <!-- Cookies -->\n <RequestParams\n v-show=\"isSectionVisible('Cookies')\"\n :id=\"filterIds.Cookies\"\n :environment\n :eventBus\n :exampleKey\n :rows=\"cookies ?? []\"\n :showAddRowPlaceholder=\"true\"\n :title=\"translate('apiClient.requestBlock.cookies')\"\n v-on=\"parameterHandlers.cookie\" />\n\n <!-- Headers -->\n <RequestParams\n v-show=\"isSectionVisible('Headers')\"\n :id=\"filterIds.Headers\"\n :environment\n :eventBus\n :exampleKey\n :rows=\"headers ?? []\"\n :title=\"translate('apiClient.requestBlock.headers')\"\n v-on=\"parameterHandlers.header\" />\n\n <!-- Query Parameters -->\n <RequestParams\n v-show=\"isSectionVisible('Query')\"\n :id=\"filterIds.Query\"\n :key=\"JSON.stringify([documentSlug, method, path, exampleKey])\"\n :description=\"\n hasQuerystringParameter\n ? translate('apiClient.requestBlock.queryStringDescription')\n : undefined\n \"\n :environment\n :eventBus\n :exampleKey\n :rows=\"sections.query ?? []\"\n selectExpandedParameters\n :showAddRowPlaceholder=\"!hasQuerystringParameter\"\n :title=\"\n hasQuerystringParameter\n ? translate('apiClient.requestBlock.queryString')\n : translate('apiClient.requestBlock.queryParameters')\n \"\n v-on=\"parameterHandlers.query\" />\n\n <!-- Request Body -->\n <RequestBody\n v-show=\"isSectionVisible('Body') && canMethodHaveBody(method)\"\n :id=\"filterIds.Body\"\n :defaultView=\"defaultRequestBodyView\"\n :environment\n :exampleKey\n :openapiVersion\n :requestBody=\"getResolvedRef(operation.requestBody)\"\n :requestBodyCompositionSelection\n :title=\"translate('apiClient.requestBlock.requestBody')\"\n @generate:example=\"handleGenerateExample\"\n @reset=\"handleResetBody\"\n @update:contentType=\"handleUpdateContentType\"\n @update:formValue=\"handleUpdateBodyFormValue\"\n @update:value=\"handleUpdateBodyValue\" />\n\n <!-- Inject request section plugin components -->\n <ScalarErrorBoundary\n v-for=\"(plugin, index) in plugins\"\n :key=\"index\">\n <component\n :is=\"plugin.components.request.component\"\n v-if=\"plugin?.components?.request\"\n v-show=\"selectedFilter === 'All'\"\n :operation\n v-bind=\"plugin.components.request.additionalProps\"\n @operation:update:extension=\"updateOperationExtension\" />\n </ScalarErrorBoundary>\n\n <!-- Spacer -->\n <div class=\"flex grow\" />\n <!-- Code Snippet -->\n <RequestCodeSnippet\n v-show=\"selectedFilter === 'All'\"\n :clientOptions\n :eventBus\n :globalCookies\n integration=\"client\"\n :method\n :openapiVersion\n :operation\n :path\n :requestBodyCompositionSelection\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedContentType=\"\n getResolvedRef(operation.requestBody)?.[\n 'x-scalar-selected-content-type'\n ]?.[exampleKey]\n \"\n :selectedExample=\"exampleKey\"\n :selectedServer=\"server ?? undefined\" />\n </div>\n </ViewLayoutSection>\n</template>\n<style scoped>\n.request-section-content {\n --scalar-border-width: 0.5px;\n}\n.request-section-content-filter {\n box-shadow: 0 -10px 0 10px var(--scalar-background-1);\n}\n.request-item:focus-within .request-meta-buttons {\n opacity: 1;\n}\n.group-hover-input {\n border-width: var(--scalar-border-width);\n border-color: transparent;\n}\n.group:hover .group-hover-input {\n background: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n border-color: var(--scalar-border-color);\n}\n.group-hover-input:focus {\n background: transparent !important;\n border-color: var(--scalar-border-color) !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,IAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAH/B,MAAM,EAAE,cAAc,gBAAgB;;EAMtC,MAAM,OAAO,gBAAgB;GAC3B,QAAK,QAAA;GACL,MAAG,QAAA;GACH,YAAS,QAAA;EACX,EAAE;EAEF,MAAM,gCAAgC,IAAgC,CAAC,CAAC;;EAGxE,MAAM,gCAAgC,IAEpC,CAAC,CAAC;EAEJ,MAAM,2BAA2B,cAGnB,GAAG,UAAU,GAAG,GAAG,UAAU;EAE3C,MAAM,uBAAuB,cAI3B,8BAA8B,MAAM,wBAAwB,SAAS,MAAM,CAAC;;EAG9E,MAAM,uBAAuB,QAAwB;GACnD,IAAI,CAAC,IAAI,qBAAqB,CAAC,IAAI,0BACjC;GAMF,KAHE,SAAS,MAAM,OAAO,QACnB,UAAU,MAAM,sBAAsB,IAAI,iBAC7C,KAAK,CAAC,EAAA,CACK,SAAS,GACpB;GAEF,MAAM,MAAM,wBAAwB,IAAI,iBAAiB;GACzD,8BAA8B,QAAQ;IACpC,GAAG,8BAA8B;KAChC,MAAM,CACL,GAAI,8BAA8B,MAAM,QAAQ,CAAC,GACjD,IAAI,wBACN;GACF;EACF;EAEA,MAAM,wBAAwB,cAI5B,8BAA8B,MAAM,wBAAwB,SAAS,MAAM,CAAC;EAE9E,MAAM,cAAc,GAAa,MAC/B,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,SAAS,UAAU,YAAY,EAAE,MAAM;;;;;;EAO3E,MAAM,2BACJ,KACA,iBACS;GACT,IAA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,eAAAF,YAmB0CY,4BAAA;MAjBvC,eAAA,QAAA;MACA,UAAA,QAAA;MACA,eAAA,cAAA;MACD,aAAY;MACX,QAAA,QAAA;MACA,gBAAA,QAAA;MACA,WAAA,QAAA;MACA,MAAA,QAAA;MACA,iCAAA,QAAA;MACA,iBAAiB,QAAA;MACjB,gBAAA,QAAA;MACA,qBAAgClB,MAAA,cAAA,CAAc,CAAC,QAAA,UAAU,WAAW,CAAA,G,iCAAgE,GAAA,QAAA;MAKpI,iBAAiB,QAAA;MACjB,gBAAgB,QAAA,UAAU,KAAA;;;;;;;;;;;;;;;K,KAlBnB,CAAAU,OAAA,eAAA,UAAc,KAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyForm.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"names":[],"mappings":"AA4MA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAWrE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAA;IACzC,6FAA6F;IAC7F,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACtC,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;AAyPF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestBodyForm.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"names":[],"mappings":"AAiVA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAarE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAA;IACzC,6FAA6F;IAC7F,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACtC,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;AAoYF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyForm.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ExampleObject,\n MediaTypeObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n getFormBodyRows,\n getFormBodyValue,\n} from '@/v2/blocks/request-block/helpers/get-form-body-rows'\n\nconst {\n example,\n bodySchema,\n encoding,\n selectedContentType,\n environment,\n compositionSelection,\n} = defineProps<{\n example: ExampleObject | undefined | null\n /** Resolved schema for the form body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** Encoding overrides for individual multipart fields. */\n encoding?: MediaTypeObject['encoding']\n /** Selected request-body variants, shared with example generation and serialization. */\n compositionSelection?: Record<string, number>\n selectedContentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'update:formValue',\n payload: ApiReferenceEvents['operation:update:requestBody:formValue']['payload'],\n ): void\n}>()\n\n/** Local state for form body rows */\nconst localFormBodyRows = ref<TableRow[]>([])\n\n/** Sync the local form body rows with the example and schema */\nwatch(\n () =>\n [\n example,\n bodySchema,\n selectedContentType,\n compositionSelection,\n encoding,\n ] as const,\n ([newExample, schema, contentType, selection, fieldEncoding]) => {\n localFormBodyRows.value = getFormBodyRows(\n newExample,\n contentType,\n schema,\n selection,\n fieldEncoding,\n )\n },\n { immediate: true },\n)\n\n/** Undeclared fields follow additionalProperties instead of losing uploads whenever a schema exists. */\nconst allowUnknownFileUploads = computed<boolean>(() => {\n const schema = resolveFormSchema(bodySchema, compositionSelection)\n const additional =\n schema && 'additionalProperties' in schema\n ? schema.additionalProperties\n : undefined\n return typeof additional === 'object'\n ? isFileSchema(resolveFormSchema(additional) ?? { __scalar_: '' })\n : additional !== false\n})\n\nconst handleUpdateFormValue = (rows: TableRow[]) => {\n emit(\n 'update:formValue',\n rows.map((row) => ({\n name: row.name,\n value:\n selectedContentType === 'multipart/form-data'\n ? getFormBodyValue(row)\n : (row.value as string | File),\n isDisabled: row.isDisabled ?? false,\n ...(row.isDisabledByDefault ? { isDisabledByDefault: true } : {}),\n ...(selectedContentType === 'multipart/form-data' && row.isArray\n ? { isArray: true }\n : {}),\n })),\n )\n}\n\n/** Update a row in the table, combines with the previous data so we emit a whole row */\nconst handleUpsertRow = (\n index: number,\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n) => {\n // Add new row\n if (index >= localFormBodyRows.value.length) {\n localFormBodyRows.value = [\n ...localFormBodyRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (i !== index) {\n return row\n }\n\n const valueChanged = 'value' in payload && payload.value !== row.value\n const disabledChanged =\n payload.isDisabled !== undefined && payload.isDisabled !== row.isDisabled\n\n return {\n ...row,\n ...payload,\n // File selection bypasses the text input, but also expresses intent to send a value.\n ...(valueChanged && payload.value !== undefined && row.isDisabledByDefault\n ? { isDisabled: false }\n : {}),\n // Preserve untouched defaults while keeping deliberate checkbox choices explicit.\n isDisabledByDefault:\n row.isDisabledByDefault && !valueChanged && !disabledChanged,\n }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number) => {\n localFormBodyRows.value = localFormBodyRows.value.filter(\n (_, i) => i !== index,\n )\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Handle file upload for a specific row index */\nconst handleFileUpload = (index: number) => {\n const { open } = useFileDialog({\n onChange: (files) => {\n const file = files?.[0]\n\n if (file) {\n const currentRow = localFormBodyRows.value[index]\n handleUpsertRow(index, {\n name: currentRow?.name || file.name,\n value: file,\n })\n }\n },\n multiple: false,\n accept: '*/*',\n })\n void open()\n}\n</script>\n\n<template>\n <!-- Form Data -->\n <template v-if=\"selectedContentType === 'multipart/form-data'\">\n <RequestTable\n :allowUnknownFileUploads=\"allowUnknownFileUploads\"\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n showUploadButton\n @deleteRow=\"handleDeleteRow\"\n @removeFile=\"(index) => handleUpsertRow(index, { value: undefined })\"\n @uploadFile=\"handleFileUpload\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n\n <!-- Form URL Encoded -->\n <template v-else>\n <RequestTable\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestBodyForm.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ExampleObject,\n MediaTypeObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n getFormBodyRows,\n getFormBodyValue,\n} from '@/v2/blocks/request-block/helpers/get-form-body-rows'\nimport { groupFormBodyFiles } from '@/v2/blocks/request-block/helpers/group-form-body-files'\n\nconst {\n example,\n bodySchema,\n encoding,\n selectedContentType,\n environment,\n compositionSelection,\n} = defineProps<{\n example: ExampleObject | undefined | null\n /** Resolved schema for the form body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** Encoding overrides for individual multipart fields. */\n encoding?: MediaTypeObject['encoding']\n /** Selected request-body variants, shared with example generation and serialization. */\n compositionSelection?: Record<string, number>\n selectedContentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'update:formValue',\n payload: ApiReferenceEvents['operation:update:requestBody:formValue']['payload'],\n ): void\n}>()\n\n/** Local state for form body rows */\nconst localFormBodyRows = ref<TableRow[]>([])\n\nconst formFields = computed(() =>\n selectedContentType === 'multipart/form-data'\n ? groupFormBodyFiles(localFormBodyRows.value)\n : localFormBodyRows.value.map((data, index) => ({\n data,\n sourceIndices: [index],\n })),\n)\nconst displayedRows = computed<TableRow[]>(() =>\n formFields.value.map((field) => field.data),\n)\n\n/** Sync the local form body rows with the example and schema */\nwatch(\n () =>\n [\n example,\n bodySchema,\n selectedContentType,\n compositionSelection,\n encoding,\n ] as const,\n ([newExample, schema, contentType, selection, fieldEncoding]) => {\n localFormBodyRows.value = getFormBodyRows(\n newExample,\n contentType,\n schema,\n selection,\n fieldEncoding,\n )\n },\n { immediate: true },\n)\n\n/** Undeclared fields follow additionalProperties instead of losing uploads whenever a schema exists. */\nconst allowUnknownFileUploads = computed<boolean>(() => {\n const schema = resolveFormSchema(bodySchema, compositionSelection)\n const additional =\n schema && 'additionalProperties' in schema\n ? schema.additionalProperties\n : undefined\n return typeof additional === 'object'\n ? isFileSchema(resolveFormSchema(additional) ?? { __scalar_: '' })\n : additional !== false\n})\n\nconst handleUpdateFormValue = (rows: TableRow[]): void => {\n emit(\n 'update:formValue',\n rows.map((row) => ({\n name: row.name,\n value:\n selectedContentType === 'multipart/form-data'\n ? getFormBodyValue(row)\n : (row.value as string | File),\n isDisabled: row.isDisabled ?? false,\n ...(row.isDisabledByDefault ? { isDisabledByDefault: true } : {}),\n ...(selectedContentType === 'multipart/form-data' && row.isArray\n ? { isArray: true }\n : {}),\n })),\n )\n}\n\n/** Update a row in the table, combines with the previous data so we emit a whole row */\nconst handleUpsertRow = (\n index: number | number[],\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n): void => {\n const indices = Array.isArray(index) ? index : [index]\n // Add new row\n if (\n indices[0] !== undefined &&\n indices[0] >= localFormBodyRows.value.length\n ) {\n localFormBodyRows.value = [\n ...localFormBodyRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (!indices.includes(i)) {\n return row\n }\n\n const valueChanged = 'value' in payload && payload.value !== row.value\n const disabledChanged =\n payload.isDisabled !== undefined && payload.isDisabled !== row.isDisabled\n\n return {\n ...row,\n ...payload,\n // File selection bypasses the text input, but also expresses intent to send a value.\n ...(valueChanged && payload.value !== undefined && row.isDisabledByDefault\n ? { isDisabled: false }\n : {}),\n // Preserve untouched defaults while keeping deliberate checkbox choices explicit.\n isDisabledByDefault:\n row.isDisabledByDefault && !valueChanged && !disabledChanged,\n }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Remember individual choices while the whole file field is temporarily disabled. */\nconst disabledFileChoices = new WeakMap<File, boolean>()\n\n/** Apply field edits to all its parts without replacing sibling files with the first file. */\nconst handleFieldUpsert = (\n index: number,\n payload: Parameters<typeof handleUpsertRow>[1],\n): void => {\n const field = formFields.value[index]\n if (\n field?.data.files?.length &&\n payload.isDisabled !== undefined &&\n payload.isDisabled !== field.data.isDisabled\n ) {\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (!field.sourceIndices.includes(i) || !(row.value instanceof File)) {\n return row\n }\n if (payload.isDisabled) {\n disabledFileChoices.set(row.value, row.isDisabled ?? false)\n }\n const isDisabled =\n payload.isDisabled || (disabledFileChoices.get(row.value) ?? false)\n if (!payload.isDisabled) {\n disabledFileChoices.delete(row.value)\n }\n return { ...row, isDisabled, isDisabledByDefault: false }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n handleUpsertRow(\n field?.sourceIndices ?? localFormBodyRows.value.length,\n field?.data.files\n ? {\n ...(payload.name !== undefined ? { name: payload.name } : {}),\n ...(payload.isDisabled !== undefined &&\n payload.isDisabled !== field.data.isDisabled\n ? { isDisabled: payload.isDisabled }\n : {}),\n }\n : payload,\n )\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number): void => {\n const indices = formFields.value[index]?.sourceIndices ?? [index]\n localFormBodyRows.value = localFormBodyRows.value.filter(\n (_, i) => !indices.includes(i),\n )\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Remove a selected file, retaining one empty field after the last file is removed. */\nconst handleRemoveFile = (index: number, fileIndex?: number): void => {\n const field = formFields.value[index]\n const sourceIndex = fileIndex ?? field?.sourceIndices[0] ?? index\n if (field?.data.files) {\n const remaining = localFormBodyRows.value.filter(\n (row, i) =>\n field.sourceIndices.includes(i) &&\n i !== sourceIndex &&\n row.value instanceof File,\n )\n const original = localFormBodyRows.value[sourceIndex]\n if (!original) {\n return\n }\n const replacement = remaining.length\n ? remaining\n : [{ ...original, value: '[]', isArray: true }]\n localFormBodyRows.value = localFormBodyRows.value.flatMap((row, i) => {\n if (i === field.sourceIndices[0]) {\n return replacement\n }\n return field.sourceIndices.includes(i) ? [] : [row]\n })\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n handleUpsertRow(sourceIndex, { value: undefined })\n}\n\n/** Handle file upload for a specific row index */\nconst handleFileUpload = (index: number): void => {\n const field = formFields.value[index]\n const sourceIndices = field?.sourceIndices ?? [localFormBodyRows.value.length]\n const sourceIndex = sourceIndices[0] ?? localFormBodyRows.value.length\n const currentRow = localFormBodyRows.value[sourceIndex]\n // Array fields accept multiple files, serialized as separate multipart parts under the same name.\n const allowMultiple = Boolean(\n currentRow?.schema && isArraySchema(currentRow.schema),\n )\n\n const { open } = useFileDialog({\n onChange: (files) => {\n const selected = files ? Array.from(files) : []\n if (selected.length === 0) {\n return\n }\n\n // Every selected file shares the field key, falling back to the first file name when\n // the row has no name yet (e.g. schema-less requests).\n const fieldName = currentRow?.name || selected[0]?.name || ''\n\n // Keep a selection together beside its field, and emit once so consumers never\n // observe a partially applied selection.\n const selectedRows: TableRow[] = selected.map((file) => ({\n ...currentRow,\n name: fieldName,\n value: file,\n // Selecting files enables untouched optional fields while preserving explicit choices.\n isDisabled: field?.data.isDisabledByDefault\n ? false\n : (field?.data.isDisabled ?? false),\n isDisabledByDefault: false,\n }))\n const existingFiles = field?.data.files\n ? localFormBodyRows.value.filter(\n (row, i) => sourceIndices.includes(i) && row.value instanceof File,\n )\n : []\n const remaining = localFormBodyRows.value.filter(\n (_, i) => !sourceIndices.includes(i),\n )\n localFormBodyRows.value = [\n ...remaining.slice(0, sourceIndex),\n ...existingFiles,\n ...selectedRows,\n ...remaining.slice(sourceIndex),\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n },\n multiple: allowMultiple,\n accept: '*/*',\n })\n void open()\n}\n</script>\n\n<template>\n <!-- Form Data -->\n <template v-if=\"selectedContentType === 'multipart/form-data'\">\n <RequestTable\n :allowUnknownFileUploads=\"allowUnknownFileUploads\"\n :data=\"displayedRows\"\n deferKeyUpdates\n :environment=\"environment\"\n showUploadButton\n @deleteRow=\"handleDeleteRow\"\n @removeFile=\"handleRemoveFile\"\n @updateFile=\"\n (index, disabled) => handleUpsertRow(index, { isDisabled: disabled })\n \"\n @uploadFile=\"handleFileUpload\"\n @upsertRow=\"handleFieldUpsert\" />\n </template>\n\n <!-- Form URL Encoded -->\n <template v-else>\n <RequestTable\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n</template>\n"],"mappings":""}
@@ -1,7 +1,9 @@
1
1
  import { useFileDialog } from "../../../../hooks/use-file-dialog.js";
2
2
  import RequestTable_default from "./RequestTable.vue.js";
3
3
  import { getFormBodyRows, getFormBodyValue } from "../helpers/get-form-body-rows.js";
4
+ import { groupFormBodyFiles } from "../helpers/group-form-body-files.js";
4
5
  import { computed, createBlock, defineComponent, openBlock, ref, watch } from "vue";
6
+ import { isArraySchema } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
5
7
  import { isFileSchema } from "@scalar/workspace-store/helpers/is-file-schema";
6
8
  import { resolveFormSchema } from "@scalar/workspace-store/helpers/resolve-form-schema";
7
9
  //#region src/v2/blocks/request-block/components/RequestBodyForm.vue?vue&type=script&setup=true&lang.ts
@@ -20,6 +22,11 @@ var RequestBodyForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
20
22
  const emit = __emit;
21
23
  /** Local state for form body rows */
22
24
  const localFormBodyRows = ref([]);
25
+ const formFields = computed(() => __props.selectedContentType === "multipart/form-data" ? groupFormBodyFiles(localFormBodyRows.value) : localFormBodyRows.value.map((data, index) => ({
26
+ data,
27
+ sourceIndices: [index]
28
+ })));
29
+ const displayedRows = computed(() => formFields.value.map((field) => field.data));
23
30
  /** Sync the local form body rows with the example and schema */
24
31
  watch(() => [
25
32
  __props.example,
@@ -47,7 +54,8 @@ var RequestBodyForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
47
54
  };
48
55
  /** Update a row in the table, combines with the previous data so we emit a whole row */
49
56
  const handleUpsertRow = (index, payload) => {
50
- if (index >= localFormBodyRows.value.length) {
57
+ const indices = Array.isArray(index) ? index : [index];
58
+ if (indices[0] !== void 0 && indices[0] >= localFormBodyRows.value.length) {
51
59
  localFormBodyRows.value = [...localFormBodyRows.value, {
52
60
  name: "",
53
61
  value: "",
@@ -58,7 +66,7 @@ var RequestBodyForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
58
66
  return;
59
67
  }
60
68
  localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {
61
- if (i !== index) return row;
69
+ if (!indices.includes(i)) return row;
62
70
  const valueChanged = "value" in payload && payload.value !== row.value;
63
71
  const disabledChanged = payload.isDisabled !== void 0 && payload.isDisabled !== row.isDisabled;
64
72
  return {
@@ -70,25 +78,89 @@ var RequestBodyForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
70
78
  });
71
79
  handleUpdateFormValue(localFormBodyRows.value);
72
80
  };
81
+ /** Remember individual choices while the whole file field is temporarily disabled. */
82
+ const disabledFileChoices = /* @__PURE__ */ new WeakMap();
83
+ /** Apply field edits to all its parts without replacing sibling files with the first file. */
84
+ const handleFieldUpsert = (index, payload) => {
85
+ const field = formFields.value[index];
86
+ if (field?.data.files?.length && payload.isDisabled !== void 0 && payload.isDisabled !== field.data.isDisabled) {
87
+ localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {
88
+ if (!field.sourceIndices.includes(i) || !(row.value instanceof File)) return row;
89
+ if (payload.isDisabled) disabledFileChoices.set(row.value, row.isDisabled ?? false);
90
+ const isDisabled = payload.isDisabled || (disabledFileChoices.get(row.value) ?? false);
91
+ if (!payload.isDisabled) disabledFileChoices.delete(row.value);
92
+ return {
93
+ ...row,
94
+ isDisabled,
95
+ isDisabledByDefault: false
96
+ };
97
+ });
98
+ handleUpdateFormValue(localFormBodyRows.value);
99
+ return;
100
+ }
101
+ handleUpsertRow(field?.sourceIndices ?? localFormBodyRows.value.length, field?.data.files ? {
102
+ ...payload.name !== void 0 ? { name: payload.name } : {},
103
+ ...payload.isDisabled !== void 0 && payload.isDisabled !== field.data.isDisabled ? { isDisabled: payload.isDisabled } : {}
104
+ } : payload);
105
+ };
73
106
  /** Delete a row from the table */
74
107
  const handleDeleteRow = (index) => {
75
- localFormBodyRows.value = localFormBodyRows.value.filter((_, i) => i !== index);
108
+ const indices = formFields.value[index]?.sourceIndices ?? [index];
109
+ localFormBodyRows.value = localFormBodyRows.value.filter((_, i) => !indices.includes(i));
76
110
  handleUpdateFormValue(localFormBodyRows.value);
77
111
  };
112
+ /** Remove a selected file, retaining one empty field after the last file is removed. */
113
+ const handleRemoveFile = (index, fileIndex) => {
114
+ const field = formFields.value[index];
115
+ const sourceIndex = fileIndex ?? field?.sourceIndices[0] ?? index;
116
+ if (field?.data.files) {
117
+ const remaining = localFormBodyRows.value.filter((row, i) => field.sourceIndices.includes(i) && i !== sourceIndex && row.value instanceof File);
118
+ const original = localFormBodyRows.value[sourceIndex];
119
+ if (!original) return;
120
+ const replacement = remaining.length ? remaining : [{
121
+ ...original,
122
+ value: "[]",
123
+ isArray: true
124
+ }];
125
+ localFormBodyRows.value = localFormBodyRows.value.flatMap((row, i) => {
126
+ if (i === field.sourceIndices[0]) return replacement;
127
+ return field.sourceIndices.includes(i) ? [] : [row];
128
+ });
129
+ handleUpdateFormValue(localFormBodyRows.value);
130
+ return;
131
+ }
132
+ handleUpsertRow(sourceIndex, { value: void 0 });
133
+ };
78
134
  /** Handle file upload for a specific row index */
79
135
  const handleFileUpload = (index) => {
136
+ const field = formFields.value[index];
137
+ const sourceIndices = field?.sourceIndices ?? [localFormBodyRows.value.length];
138
+ const sourceIndex = sourceIndices[0] ?? localFormBodyRows.value.length;
139
+ const currentRow = localFormBodyRows.value[sourceIndex];
140
+ const allowMultiple = Boolean(currentRow?.schema && isArraySchema(currentRow.schema));
80
141
  const { open } = useFileDialog({
81
142
  onChange: (files) => {
82
- const file = files?.[0];
83
- if (file) {
84
- const currentRow = localFormBodyRows.value[index];
85
- handleUpsertRow(index, {
86
- name: currentRow?.name || file.name,
87
- value: file
88
- });
89
- }
143
+ const selected = files ? Array.from(files) : [];
144
+ if (selected.length === 0) return;
145
+ const fieldName = currentRow?.name || selected[0]?.name || "";
146
+ const selectedRows = selected.map((file) => ({
147
+ ...currentRow,
148
+ name: fieldName,
149
+ value: file,
150
+ isDisabled: field?.data.isDisabledByDefault ? false : field?.data.isDisabled ?? false,
151
+ isDisabledByDefault: false
152
+ }));
153
+ const existingFiles = field?.data.files ? localFormBodyRows.value.filter((row, i) => sourceIndices.includes(i) && row.value instanceof File) : [];
154
+ const remaining = localFormBodyRows.value.filter((_, i) => !sourceIndices.includes(i));
155
+ localFormBodyRows.value = [
156
+ ...remaining.slice(0, sourceIndex),
157
+ ...existingFiles,
158
+ ...selectedRows,
159
+ ...remaining.slice(sourceIndex)
160
+ ];
161
+ handleUpdateFormValue(localFormBodyRows.value);
90
162
  },
91
- multiple: false,
163
+ multiple: allowMultiple,
92
164
  accept: "*/*"
93
165
  });
94
166
  open();
@@ -97,14 +169,15 @@ var RequestBodyForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
97
169
  return __props.selectedContentType === "multipart/form-data" ? (openBlock(), createBlock(RequestTable_default, {
98
170
  key: 0,
99
171
  allowUnknownFileUploads: allowUnknownFileUploads.value,
100
- data: localFormBodyRows.value,
172
+ data: displayedRows.value,
101
173
  deferKeyUpdates: "",
102
174
  environment: __props.environment,
103
175
  showUploadButton: "",
104
176
  onDeleteRow: handleDeleteRow,
105
- onRemoveFile: _cache[0] || (_cache[0] = (index) => handleUpsertRow(index, { value: void 0 })),
177
+ onRemoveFile: handleRemoveFile,
178
+ onUpdateFile: _cache[0] || (_cache[0] = (index, disabled) => handleUpsertRow(index, { isDisabled: disabled })),
106
179
  onUploadFile: handleFileUpload,
107
- onUpsertRow: handleUpsertRow
180
+ onUpsertRow: handleFieldUpsert
108
181
  }, null, 8, [
109
182
  "allowUnknownFileUploads",
110
183
  "data",
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyForm.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","RequestTable"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ExampleObject,\n MediaTypeObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n getFormBodyRows,\n getFormBodyValue,\n} from '@/v2/blocks/request-block/helpers/get-form-body-rows'\n\nconst {\n example,\n bodySchema,\n encoding,\n selectedContentType,\n environment,\n compositionSelection,\n} = defineProps<{\n example: ExampleObject | undefined | null\n /** Resolved schema for the form body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** Encoding overrides for individual multipart fields. */\n encoding?: MediaTypeObject['encoding']\n /** Selected request-body variants, shared with example generation and serialization. */\n compositionSelection?: Record<string, number>\n selectedContentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'update:formValue',\n payload: ApiReferenceEvents['operation:update:requestBody:formValue']['payload'],\n ): void\n}>()\n\n/** Local state for form body rows */\nconst localFormBodyRows = ref<TableRow[]>([])\n\n/** Sync the local form body rows with the example and schema */\nwatch(\n () =>\n [\n example,\n bodySchema,\n selectedContentType,\n compositionSelection,\n encoding,\n ] as const,\n ([newExample, schema, contentType, selection, fieldEncoding]) => {\n localFormBodyRows.value = getFormBodyRows(\n newExample,\n contentType,\n schema,\n selection,\n fieldEncoding,\n )\n },\n { immediate: true },\n)\n\n/** Undeclared fields follow additionalProperties instead of losing uploads whenever a schema exists. */\nconst allowUnknownFileUploads = computed<boolean>(() => {\n const schema = resolveFormSchema(bodySchema, compositionSelection)\n const additional =\n schema && 'additionalProperties' in schema\n ? schema.additionalProperties\n : undefined\n return typeof additional === 'object'\n ? isFileSchema(resolveFormSchema(additional) ?? { __scalar_: '' })\n : additional !== false\n})\n\nconst handleUpdateFormValue = (rows: TableRow[]) => {\n emit(\n 'update:formValue',\n rows.map((row) => ({\n name: row.name,\n value:\n selectedContentType === 'multipart/form-data'\n ? getFormBodyValue(row)\n : (row.value as string | File),\n isDisabled: row.isDisabled ?? false,\n ...(row.isDisabledByDefault ? { isDisabledByDefault: true } : {}),\n ...(selectedContentType === 'multipart/form-data' && row.isArray\n ? { isArray: true }\n : {}),\n })),\n )\n}\n\n/** Update a row in the table, combines with the previous data so we emit a whole row */\nconst handleUpsertRow = (\n index: number,\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n) => {\n // Add new row\n if (index >= localFormBodyRows.value.length) {\n localFormBodyRows.value = [\n ...localFormBodyRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (i !== index) {\n return row\n }\n\n const valueChanged = 'value' in payload && payload.value !== row.value\n const disabledChanged =\n payload.isDisabled !== undefined && payload.isDisabled !== row.isDisabled\n\n return {\n ...row,\n ...payload,\n // File selection bypasses the text input, but also expresses intent to send a value.\n ...(valueChanged && payload.value !== undefined && row.isDisabledByDefault\n ? { isDisabled: false }\n : {}),\n // Preserve untouched defaults while keeping deliberate checkbox choices explicit.\n isDisabledByDefault:\n row.isDisabledByDefault && !valueChanged && !disabledChanged,\n }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number) => {\n localFormBodyRows.value = localFormBodyRows.value.filter(\n (_, i) => i !== index,\n )\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Handle file upload for a specific row index */\nconst handleFileUpload = (index: number) => {\n const { open } = useFileDialog({\n onChange: (files) => {\n const file = files?.[0]\n\n if (file) {\n const currentRow = localFormBodyRows.value[index]\n handleUpsertRow(index, {\n name: currentRow?.name || file.name,\n value: file,\n })\n }\n },\n multiple: false,\n accept: '*/*',\n })\n void open()\n}\n</script>\n\n<template>\n <!-- Form Data -->\n <template v-if=\"selectedContentType === 'multipart/form-data'\">\n <RequestTable\n :allowUnknownFileUploads=\"allowUnknownFileUploads\"\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n showUploadButton\n @deleteRow=\"handleDeleteRow\"\n @removeFile=\"(index) => handleUpsertRow(index, { value: undefined })\"\n @uploadFile=\"handleFileUpload\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n\n <!-- Form URL Encoded -->\n <template v-else>\n <RequestTable\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n</template>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,QAAQ,eAAe,KAAA,KAAa,QAAQ,eAAe,IAAI;IAEjE,OAAO;KACL,GAAG;KACH,GAAG;KAEH,GAAI,gBAAgB,QAAQ,UAAU,KAAA,KAAa,IAAI,sBACnD,EAAE,YAAY,MAAM,IACpB,CAAC;KAEL,qBACE,IAAI,uBAAuB,CAAC,gBAAgB,CAAC;IACjD;GACF,CAAC;GACD,sBAAsB,kBAAkB,KAAK;EAC/C;;EAGA,MAAM,mBAAmB,UAAkB;GACzC,kBAAkB,QAAQ,kBAAkB,MAAM,QAC/C,GAAG,MAAM,MAAM,KAClB;GACA,sBAAsB,kBAAkB,KAAK;EAC/C;;EAGA,MAAM,oBAAoB,UAAkB;GAC1C,MAAM,EAAE,SAAS,cAAc;IAC7B,WAAW,UAAU;KACnB,MAAM,OAAO,QAAQ;KAErB,IAAI,MAAM;MACR,MAAM,aAAa,kBAAkB,MAAM;MAC3C,gBAAgB,OAAO;OACrB,MAAM,YAAY,QAAQ,KAAK;OAC/B,OAAO;MACT,CAAC;KACH;IACF;IACA,UAAU;IACV,QAAQ;GACV,CAAC;GACD,KAAU;EACZ;;GAKkB,OAAA,QAAA,wBAAmB,yBACjCA,UAAA,GAAAC,YASiCC,sBAAA;;IAR9B,yBAAyB,wBAAA;IACzB,MAAM,kBAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACd,kBAAA;IACC,aAAW;IACX,cAAU,OAAA,OAAA,OAAA,MAAG,UAAU,gBAAgB,OAAK,EAAA,OAAW,KAAA,EAAS,CAAA;IAChE,cAAY;IACZ,aAAW;;;;;G,OAKdF,UAAA,GAAAC,YAKiCC,sBAAA;;IAJ9B,MAAM,kBAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACb,aAAW;IACX,aAAW"}
1
+ {"version":3,"file":"RequestBodyForm.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","RequestTable"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveFormSchema } from '@scalar/workspace-store/helpers/resolve-form-schema'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ExampleObject,\n MediaTypeObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, watch } from 'vue'\n\nimport { useFileDialog } from '@/hooks/use-file-dialog'\nimport RequestTable from '@/v2/blocks/request-block/components/RequestTable.vue'\nimport type { TableRow } from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n getFormBodyRows,\n getFormBodyValue,\n} from '@/v2/blocks/request-block/helpers/get-form-body-rows'\nimport { groupFormBodyFiles } from '@/v2/blocks/request-block/helpers/group-form-body-files'\n\nconst {\n example,\n bodySchema,\n encoding,\n selectedContentType,\n environment,\n compositionSelection,\n} = defineProps<{\n example: ExampleObject | undefined | null\n /** Resolved schema for the form body so the table can show enums and validation per field */\n bodySchema?: SchemaObject\n /** Encoding overrides for individual multipart fields. */\n encoding?: MediaTypeObject['encoding']\n /** Selected request-body variants, shared with example generation and serialization. */\n compositionSelection?: Record<string, number>\n selectedContentType: string\n environment: XScalarEnvironment\n}>()\n\nconst emit = defineEmits<{\n (\n e: 'update:formValue',\n payload: ApiReferenceEvents['operation:update:requestBody:formValue']['payload'],\n ): void\n}>()\n\n/** Local state for form body rows */\nconst localFormBodyRows = ref<TableRow[]>([])\n\nconst formFields = computed(() =>\n selectedContentType === 'multipart/form-data'\n ? groupFormBodyFiles(localFormBodyRows.value)\n : localFormBodyRows.value.map((data, index) => ({\n data,\n sourceIndices: [index],\n })),\n)\nconst displayedRows = computed<TableRow[]>(() =>\n formFields.value.map((field) => field.data),\n)\n\n/** Sync the local form body rows with the example and schema */\nwatch(\n () =>\n [\n example,\n bodySchema,\n selectedContentType,\n compositionSelection,\n encoding,\n ] as const,\n ([newExample, schema, contentType, selection, fieldEncoding]) => {\n localFormBodyRows.value = getFormBodyRows(\n newExample,\n contentType,\n schema,\n selection,\n fieldEncoding,\n )\n },\n { immediate: true },\n)\n\n/** Undeclared fields follow additionalProperties instead of losing uploads whenever a schema exists. */\nconst allowUnknownFileUploads = computed<boolean>(() => {\n const schema = resolveFormSchema(bodySchema, compositionSelection)\n const additional =\n schema && 'additionalProperties' in schema\n ? schema.additionalProperties\n : undefined\n return typeof additional === 'object'\n ? isFileSchema(resolveFormSchema(additional) ?? { __scalar_: '' })\n : additional !== false\n})\n\nconst handleUpdateFormValue = (rows: TableRow[]): void => {\n emit(\n 'update:formValue',\n rows.map((row) => ({\n name: row.name,\n value:\n selectedContentType === 'multipart/form-data'\n ? getFormBodyValue(row)\n : (row.value as string | File),\n isDisabled: row.isDisabled ?? false,\n ...(row.isDisabledByDefault ? { isDisabledByDefault: true } : {}),\n ...(selectedContentType === 'multipart/form-data' && row.isArray\n ? { isArray: true }\n : {}),\n })),\n )\n}\n\n/** Update a row in the table, combines with the previous data so we emit a whole row */\nconst handleUpsertRow = (\n index: number | number[],\n payload: Partial<{\n name: string\n value: string | File | undefined\n isDisabled: boolean\n }>,\n): void => {\n const indices = Array.isArray(index) ? index : [index]\n // Add new row\n if (\n indices[0] !== undefined &&\n indices[0] >= localFormBodyRows.value.length\n ) {\n localFormBodyRows.value = [\n ...localFormBodyRows.value,\n { name: '', value: '', ...payload, isDisabled: false },\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (!indices.includes(i)) {\n return row\n }\n\n const valueChanged = 'value' in payload && payload.value !== row.value\n const disabledChanged =\n payload.isDisabled !== undefined && payload.isDisabled !== row.isDisabled\n\n return {\n ...row,\n ...payload,\n // File selection bypasses the text input, but also expresses intent to send a value.\n ...(valueChanged && payload.value !== undefined && row.isDisabledByDefault\n ? { isDisabled: false }\n : {}),\n // Preserve untouched defaults while keeping deliberate checkbox choices explicit.\n isDisabledByDefault:\n row.isDisabledByDefault && !valueChanged && !disabledChanged,\n }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Remember individual choices while the whole file field is temporarily disabled. */\nconst disabledFileChoices = new WeakMap<File, boolean>()\n\n/** Apply field edits to all its parts without replacing sibling files with the first file. */\nconst handleFieldUpsert = (\n index: number,\n payload: Parameters<typeof handleUpsertRow>[1],\n): void => {\n const field = formFields.value[index]\n if (\n field?.data.files?.length &&\n payload.isDisabled !== undefined &&\n payload.isDisabled !== field.data.isDisabled\n ) {\n localFormBodyRows.value = localFormBodyRows.value.map((row, i) => {\n if (!field.sourceIndices.includes(i) || !(row.value instanceof File)) {\n return row\n }\n if (payload.isDisabled) {\n disabledFileChoices.set(row.value, row.isDisabled ?? false)\n }\n const isDisabled =\n payload.isDisabled || (disabledFileChoices.get(row.value) ?? false)\n if (!payload.isDisabled) {\n disabledFileChoices.delete(row.value)\n }\n return { ...row, isDisabled, isDisabledByDefault: false }\n })\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n handleUpsertRow(\n field?.sourceIndices ?? localFormBodyRows.value.length,\n field?.data.files\n ? {\n ...(payload.name !== undefined ? { name: payload.name } : {}),\n ...(payload.isDisabled !== undefined &&\n payload.isDisabled !== field.data.isDisabled\n ? { isDisabled: payload.isDisabled }\n : {}),\n }\n : payload,\n )\n}\n\n/** Delete a row from the table */\nconst handleDeleteRow = (index: number): void => {\n const indices = formFields.value[index]?.sourceIndices ?? [index]\n localFormBodyRows.value = localFormBodyRows.value.filter(\n (_, i) => !indices.includes(i),\n )\n handleUpdateFormValue(localFormBodyRows.value)\n}\n\n/** Remove a selected file, retaining one empty field after the last file is removed. */\nconst handleRemoveFile = (index: number, fileIndex?: number): void => {\n const field = formFields.value[index]\n const sourceIndex = fileIndex ?? field?.sourceIndices[0] ?? index\n if (field?.data.files) {\n const remaining = localFormBodyRows.value.filter(\n (row, i) =>\n field.sourceIndices.includes(i) &&\n i !== sourceIndex &&\n row.value instanceof File,\n )\n const original = localFormBodyRows.value[sourceIndex]\n if (!original) {\n return\n }\n const replacement = remaining.length\n ? remaining\n : [{ ...original, value: '[]', isArray: true }]\n localFormBodyRows.value = localFormBodyRows.value.flatMap((row, i) => {\n if (i === field.sourceIndices[0]) {\n return replacement\n }\n return field.sourceIndices.includes(i) ? [] : [row]\n })\n handleUpdateFormValue(localFormBodyRows.value)\n return\n }\n handleUpsertRow(sourceIndex, { value: undefined })\n}\n\n/** Handle file upload for a specific row index */\nconst handleFileUpload = (index: number): void => {\n const field = formFields.value[index]\n const sourceIndices = field?.sourceIndices ?? [localFormBodyRows.value.length]\n const sourceIndex = sourceIndices[0] ?? localFormBodyRows.value.length\n const currentRow = localFormBodyRows.value[sourceIndex]\n // Array fields accept multiple files, serialized as separate multipart parts under the same name.\n const allowMultiple = Boolean(\n currentRow?.schema && isArraySchema(currentRow.schema),\n )\n\n const { open } = useFileDialog({\n onChange: (files) => {\n const selected = files ? Array.from(files) : []\n if (selected.length === 0) {\n return\n }\n\n // Every selected file shares the field key, falling back to the first file name when\n // the row has no name yet (e.g. schema-less requests).\n const fieldName = currentRow?.name || selected[0]?.name || ''\n\n // Keep a selection together beside its field, and emit once so consumers never\n // observe a partially applied selection.\n const selectedRows: TableRow[] = selected.map((file) => ({\n ...currentRow,\n name: fieldName,\n value: file,\n // Selecting files enables untouched optional fields while preserving explicit choices.\n isDisabled: field?.data.isDisabledByDefault\n ? false\n : (field?.data.isDisabled ?? false),\n isDisabledByDefault: false,\n }))\n const existingFiles = field?.data.files\n ? localFormBodyRows.value.filter(\n (row, i) => sourceIndices.includes(i) && row.value instanceof File,\n )\n : []\n const remaining = localFormBodyRows.value.filter(\n (_, i) => !sourceIndices.includes(i),\n )\n localFormBodyRows.value = [\n ...remaining.slice(0, sourceIndex),\n ...existingFiles,\n ...selectedRows,\n ...remaining.slice(sourceIndex),\n ]\n handleUpdateFormValue(localFormBodyRows.value)\n },\n multiple: allowMultiple,\n accept: '*/*',\n })\n void open()\n}\n</script>\n\n<template>\n <!-- Form Data -->\n <template v-if=\"selectedContentType === 'multipart/form-data'\">\n <RequestTable\n :allowUnknownFileUploads=\"allowUnknownFileUploads\"\n :data=\"displayedRows\"\n deferKeyUpdates\n :environment=\"environment\"\n showUploadButton\n @deleteRow=\"handleDeleteRow\"\n @removeFile=\"handleRemoveFile\"\n @updateFile=\"\n (index, disabled) => handleUpsertRow(index, { isDisabled: disabled })\n \"\n @uploadFile=\"handleFileUpload\"\n @upsertRow=\"handleFieldUpsert\" />\n </template>\n\n <!-- Form URL Encoded -->\n <template v-else>\n <RequestTable\n :data=\"localFormBodyRows\"\n deferKeyUpdates\n :environment=\"environment\"\n @deleteRow=\"handleDeleteRow\"\n @upsertRow=\"handleUpsertRow\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,OAAO;;EAQb,MAAM,oBAAoB,IAAgB,CAAC,CAAC;EAE5C,MAAM,aAAa,eACjB,QAAA,wBAAwB,wBACpB,mBAAmB,kBAAkB,KAAK,IAC1C,kBAAkB,MAAM,KAAK,MAAM,WAAW;GAC5C;GACA,eAAe,CAAC,KAAK;EACvB,EAAE,CACR;EACA,MAAM,gBAAgB,eACpB,WAAW,MAAM,KAAK,UAAU,MAAM,IAAI,CAC5C;;EAGA,YAEI;GACE,QAAA;GACA,QAAA;GACA,QAAA;GACA,QAAA;GACA,QAAA;EACF,IACD,CAAC,YAAY,QAAQ,aAAa,WAAW,mBAAmB;GAC/D,kBAAkB,QAAQ,gBACxB,YACA,aACA,QACA,WACA,aACF;EACF,GACA,EAAE,WAAW,KAAK,CACpB;;EAGA,MAAM,0BAA0B,eAAwB;GACtD,MAAM,SAAS,kBAAkB,QAAA,YAAY,QAAA,oBAAoB;GACjE,MAAM,aACJ,UAAU,0BAA0B,SAChC,OAAO,uBACP,KAAA;GACN,OAAO,OAAO,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GAAG,MAAM,CAAC,cAAc,SAAS,CAAC,CACrC;KACA,kBAAkB,QAAQ;MACxB,GAAG,UAAU,MAAM,GAAG,WAAW;MACjC,GAAG;MACH,GAAG;MACH,GAAG,UAAU,MAAM,WAAW;KAChC;KACA,sBAAsB,kBAAkB,KAAK;IAC/C;IACA,UAAU;IACV,QAAQ;GACV,CAAC;GACD,KAAU;EACZ;;GAKkB,OAAA,QAAA,wBAAmB,yBACjCA,UAAA,GAAAC,YAYmCC,sBAAA;;IAXhC,yBAAyB,wBAAA;IACzB,MAAM,cAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACd,kBAAA;IACC,aAAW;IACX,cAAY;IACZ,cAAU,OAAA,OAAA,OAAA,MAAY,OAAO,aAAa,gBAAgB,OAAK,EAAA,YAAgB,SAAQ,CAAA;IAGvF,cAAY;IACZ,aAAW;;;;;G,OAKdF,UAAA,GAAAC,YAKiCC,sBAAA;;IAJ9B,MAAM,kBAAA;IACP,iBAAA;IACC,aAAa,QAAA;IACb,aAAW;IACX,aAAW"}
@@ -17,6 +17,7 @@ type __VLS_Props = {
17
17
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
18
18
  focusValue: (index: number) => void;
19
19
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
20
+ removeFile: (index: number, fileIndex?: number | undefined) => any;
20
21
  deleteRow: (index: number) => any;
21
22
  navigate: (route: NonNullable<({
22
23
  replace?: boolean;
@@ -43,11 +44,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
43
44
  method: string;
44
45
  documentSlug?: string;
45
46
  })) | undefined>) => any;
46
- upsertRow: (index: number, payload: TableRowUpsertPayload) => any;
47
47
  uploadFile: (index: number) => any;
48
- removeFile: (index: number) => any;
48
+ updateFile: (fileIndex: number, isDisabled: boolean) => any;
49
+ upsertRow: (index: number, payload: TableRowUpsertPayload) => any;
49
50
  selectPreset: (index: number, value: string) => any;
50
51
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
52
+ onRemoveFile?: ((index: number, fileIndex?: number | undefined) => any) | undefined;
51
53
  onDeleteRow?: ((index: number) => any) | undefined;
52
54
  onNavigate?: ((route: NonNullable<({
53
55
  replace?: boolean;
@@ -74,9 +76,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
74
76
  method: string;
75
77
  documentSlug?: string;
76
78
  })) | undefined>) => any) | undefined;
77
- onUpsertRow?: ((index: number, payload: TableRowUpsertPayload) => any) | undefined;
78
79
  onUploadFile?: ((index: number) => any) | undefined;
79
- onRemoveFile?: ((index: number) => any) | undefined;
80
+ onUpdateFile?: ((fileIndex: number, isDisabled: boolean) => any) | undefined;
81
+ onUpsertRow?: ((index: number, payload: TableRowUpsertPayload) => any) | undefined;
80
82
  onSelectPreset?: ((index: number, value: string) => any) | undefined;
81
83
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
82
84
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"names":[],"mappings":"AAsPA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAwB,EACtB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC3B,MAAM,0DAA0D,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,uFAAuF;IACvF,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;AAuWF,QAAA,MAAM,YAAY;wBA1MI,MAAM,KAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFA8MjC,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"names":[],"mappings":"AA0PA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAwB,EACtB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC3B,MAAM,0DAA0D,CAAA;AAQjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,uFAAuF;IACvF,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;AA4WF,QAAA,MAAM,YAAY;wBA9MI,MAAM,KAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAkNjC,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
2
2
  import RequestTable_vue_vue_type_script_setup_true_lang_default from "./RequestTable.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region src/v2/blocks/request-block/components/RequestTable.vue
5
- var RequestTable_default = /*#__PURE__*/ _plugin_vue_export_helper_default(RequestTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-321c6212"]]);
5
+ var RequestTable_default = /*#__PURE__*/ _plugin_vue_export_helper_default(RequestTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-81035f01"]]);
6
6
  //#endregion
7
7
  export { RequestTable_default as default };
8
8