@scalar/api-client 3.14.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/assets/computer.ascii.virtual.js.map +1 -1
- package/dist/components/HelpfulLink.vue.script.js +1 -1
- package/dist/components/HelpfulLink.vue.script.js.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -1
- package/dist/components/SectionFilter.vue.d.ts +1 -1
- package/dist/components/SectionFilter.vue.d.ts.map +1 -1
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue.script.js +2 -2
- package/dist/components/SectionFilter.vue.script.js.map +1 -1
- package/dist/components/SectionFilterButton.vue.script.js +1 -1
- package/dist/components/SectionFilterButton.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.script.js +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.script.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js.map +1 -1
- package/dist/hooks/use-file-dialog.js +2 -1
- package/dist/hooks/use-file-dialog.js.map +1 -1
- package/dist/plugins/posthog/index.js.map +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.js +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -1
- package/dist/style.css +298 -275
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +38 -6
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/persist-script-environment.d.ts +53 -0
- package/dist/v2/blocks/operation-block/helpers/persist-script-environment.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/persist-script-environment.js +91 -0
- package/dist/v2/blocks/operation-block/helpers/persist-script-environment.js.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +58 -29
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +5 -3
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +6 -3
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +8 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +29 -16
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/files.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +10 -5
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-content.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts +54 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js +56 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js.map +1 -0
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +1 -1
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/validate-parameter.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +10 -3
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/extract-filename.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.d.ts +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.js +12 -0
- package/dist/v2/blocks/response-block/helpers/media-types.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/prettify-ndjson.d.ts +12 -0
- package/dist/v2/blocks/response-block/helpers/prettify-ndjson.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/prettify-ndjson.js +19 -0
- package/dist/v2/blocks/response-block/helpers/prettify-ndjson.js.map +1 -0
- package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +7 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +3 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +3 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +24 -17
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.d.ts +20 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.js +27 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.js.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +15 -6
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js +6 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js +5 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js +1 -0
- package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
- package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -1
- package/dist/v2/components/code-input/helpers/lookup-variable-value.js.map +1 -1
- package/dist/v2/components/code-input/helpers/pill-signature.js.map +1 -1
- package/dist/v2/components/code-input/helpers/serialize-value.js.map +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue.script.js +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTable.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTable.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +3 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableText.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableText.vue.script.js.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.script.js +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.script.js +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.script.js.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.script.js +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
- package/dist/v2/components/resize/Resize.vue.js +1 -1
- package/dist/v2/components/resize/Resize.vue.script.js +1 -1
- package/dist/v2/components/resize/Resize.vue.script.js.map +1 -1
- package/dist/v2/components/resize/use-split-resize.js +4 -2
- package/dist/v2/components/resize/use-split-resize.js.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.script.js +3 -3
- package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.script.js +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.script.js +1 -1
- package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js +3 -2
- package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/map-hidden-clients-config.js.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.script.js +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
- package/dist/v2/features/search/helpers/create-fuse-instance.js.map +1 -1
- package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
- package/dist/v2/features/search/hooks/use-document-search.js.map +1 -1
- package/dist/v2/features/search/hooks/use-search-index.js.map +1 -1
- package/dist/v2/helpers/generate-location-id.js.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
- package/dist/v2/helpers/test-utils.js.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js.map +1 -1
- package/dist/v2/hooks/use-scroll-lock.js.map +1 -1
- package/dist/v2/workspace-events.js.map +1 -1
- package/dist/vue-styles.css +229 -236
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-content-length.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/get-content-length.ts"],"sourcesContent":["import { formatBytes } from '@scalar/helpers/formatters/format-bytes'\n\nimport type { ResponseInstance } from '@/v2/blocks/operation-block/helpers/send-request'\n\n/** Extract content length from headers */\nexport const getContentLength = (response: ResponseInstance) => {\n const contentLength = Number.parseInt(\n response.headers?.['Content-Length'] || response.headers?.['content-length'] || '0',\n 10,\n )\n\n if (isNaN(contentLength) || contentLength <= 0) {\n return undefined\n }\n\n return formatBytes(contentLength)\n}\n"],"mappings":";;;AAKA,IAAa,oBAAoB,aAA+B;CAC9D,MAAM,gBAAgB,OAAO,SAC3B,SAAS,UAAU,qBAAqB,SAAS,UAAU,qBAAqB,KAChF,
|
|
1
|
+
{"version":3,"file":"get-content-length.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/get-content-length.ts"],"sourcesContent":["import { formatBytes } from '@scalar/helpers/formatters/format-bytes'\n\nimport type { ResponseInstance } from '@/v2/blocks/operation-block/helpers/send-request'\n\n/** Extract content length from headers */\nexport const getContentLength = (response: ResponseInstance) => {\n const contentLength = Number.parseInt(\n response.headers?.['Content-Length'] || response.headers?.['content-length'] || '0',\n 10,\n )\n\n if (isNaN(contentLength) || contentLength <= 0) {\n return undefined\n }\n\n return formatBytes(contentLength)\n}\n"],"mappings":";;;AAKA,IAAa,oBAAoB,aAA+B;CAC9D,MAAM,gBAAgB,OAAO,SAC3B,SAAS,UAAU,qBAAqB,SAAS,UAAU,qBAAqB,KAChF,EACF;CAEA,IAAI,MAAM,aAAa,KAAK,iBAAiB,GAC3C;CAGF,OAAO,YAAY,aAAa;AAClC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeMirrorLanguage } from '@scalar/use-codemirror';
|
|
2
|
-
export type MediaPreview = 'object' | 'image' | 'video' | 'audio' | 'json';
|
|
2
|
+
export type MediaPreview = 'object' | 'image' | 'video' | 'audio' | 'json' | 'ndjson';
|
|
3
3
|
type MediaConfig = {
|
|
4
4
|
preview?: MediaPreview;
|
|
5
5
|
alpha?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-types.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/helpers/media-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"media-types.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/helpers/media-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;AAErF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AA6JD,iEAAiE;AACjE,eAAO,MAAM,cAAc,EAAE,MAAM,EAEX,CAAA;AAExB,sCAAsC;AACtC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAiBxE;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -38,6 +38,18 @@ var mediaTypes = {
|
|
|
38
38
|
language: "json",
|
|
39
39
|
preview: "json"
|
|
40
40
|
},
|
|
41
|
+
"application/x-ndjson": {
|
|
42
|
+
extension: ".ndjson",
|
|
43
|
+
raw: true,
|
|
44
|
+
language: "json",
|
|
45
|
+
preview: "ndjson"
|
|
46
|
+
},
|
|
47
|
+
"application/ndjson": {
|
|
48
|
+
extension: ".ndjson",
|
|
49
|
+
raw: true,
|
|
50
|
+
language: "json",
|
|
51
|
+
preview: "ndjson"
|
|
52
|
+
},
|
|
41
53
|
"application/msword": { extension: ".doc" },
|
|
42
54
|
"application/octet-stream": { extension: ".bin" },
|
|
43
55
|
"application/ogg": { extension: ".ogx" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-types.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/media-types.ts"],"sourcesContent":["import type { CodeMirrorLanguage } from '@scalar/use-codemirror'\n\nexport type MediaPreview = 'object' | 'image' | 'video' | 'audio' | 'json'\n\ntype MediaConfig = {\n preview?: MediaPreview\n alpha?: boolean\n raw?: boolean\n language?: CodeMirrorLanguage\n extension: string\n}\n\n/** Media Type (MIME Type) Definitions */\nconst mediaTypes: { [type: string]: MediaConfig | undefined } = {\n 'application/epub+zip': { extension: '.epub' },\n 'application/gzip': { extension: '.gz' },\n 'application/java-archive': { extension: '.jar' },\n 'application/javascript': { extension: '.js', raw: true },\n 'application/json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/ld+json': {\n extension: '.jsonld',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/problem+json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/vnd.api+json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/dns-json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/msword': { extension: '.doc' },\n 'application/octet-stream': { extension: '.bin' },\n 'application/ogg': { extension: '.ogx' },\n 'application/pdf': { extension: '.pdf', preview: 'object' },\n 'application/rtf': { extension: '.rtf', raw: true },\n 'application/vnd.amazon.ebook': { extension: '.azw' },\n 'application/vnd.apple.installer+xml': {\n extension: '.mpkg',\n raw: true,\n language: 'xml',\n },\n 'application/vnd.mozilla.xul+xml': {\n extension: '.xul',\n raw: true,\n language: 'xml',\n },\n 'application/vnd.ms-excel': { extension: '.xls' },\n 'application/vnd.ms-fontobject': { extension: '.eot' },\n 'application/vnd.ms-powerpoint': { extension: '.ppt' },\n 'application/vnd.oasis.opendocument.presentation': { extension: '.odp' },\n 'application/vnd.oasis.opendocument.spreadsheet': { extension: '.ods' },\n 'application/vnd.oasis.opendocument.text': { extension: '.odt' },\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': {\n extension: '.pptx',\n },\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': {\n extension: '.xlsx',\n },\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': {\n extension: '.docx',\n },\n 'application/vnd.rar': { extension: '.rar' },\n 'application/vnd.visio': { extension: '.vsd' },\n 'application/x-7z-compressed': { extension: '.7z' },\n 'application/x-abiword': { extension: '.abw' },\n 'application/x-bzip': { extension: '.bz' },\n 'application/x-bzip2': { extension: '.bz2' },\n 'application/x-cdf': { extension: '.cda' },\n 'application/x-csh': { extension: '.csh' },\n 'application/x-freearc': { extension: '.arc' },\n 'application/x-httpd-php': { extension: '.php', raw: true },\n 'application/x-sh': { extension: '.sh', raw: true },\n 'application/x-tar': { extension: '.tar' },\n 'application/xhtml+xml': { extension: '.xhtml', raw: true, language: 'html' },\n 'application/xml': { extension: '.xml', raw: true, language: 'xml' },\n 'application/yaml': { extension: '.yaml', raw: true, language: 'yaml' },\n 'application/zip': { extension: '.zip' },\n 'audio/aac': { extension: '.aac' },\n 'audio/midi': { extension: '.midi' },\n 'audio/mpeg': { extension: '.mp3', preview: 'audio' },\n 'audio/ogg': { extension: '.oga' },\n 'audio/wav': { extension: '.wav' },\n 'audio/webm': { extension: '.weba' },\n 'font/otf': { extension: '.otf' },\n 'font/ttf': { extension: '.ttf' },\n 'font/woff': { extension: '.woff' },\n 'font/woff2': { extension: '.woff2' },\n 'image/apng': { extension: '.apng', preview: 'image', alpha: true },\n 'image/avif': { extension: '.avif', preview: 'image' },\n 'image/bmp': { extension: '.bmp', preview: 'image' },\n 'image/gif': { extension: '.gif', preview: 'image', alpha: true },\n 'image/jpeg': { extension: '.jpg', preview: 'image' },\n 'image/png': { extension: '.png', preview: 'image', alpha: true },\n 'image/svg+xml': {\n extension: '.svg',\n raw: true,\n language: 'xml',\n preview: 'image',\n alpha: true,\n },\n 'image/tiff': { extension: '.tiff' },\n 'image/vnd.microsoft.icon': { extension: '.ico', preview: 'image' },\n 'image/webp': { extension: '.webp', preview: 'image', alpha: true },\n 'text/calendar': { extension: '.ics', raw: true },\n 'text/css': { extension: '.css', raw: true, language: 'css' },\n 'text/csv': { extension: '.csv', raw: true },\n 'text/html': {\n extension: '.html',\n raw: true,\n language: 'html',\n preview: 'object',\n },\n 'text/javascript': { extension: '.js', raw: true },\n 'text/json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'text/plain': { extension: '.txt', raw: true },\n 'text/xml': { extension: '.xml', raw: true, language: 'xml' },\n 'text/yaml': { extension: '.yaml', raw: true, language: 'yaml' },\n 'video/3gpp': { extension: '.3gp' },\n 'audio/3gpp': { extension: '.3gp' },\n 'video/3gpp2': { extension: '.3g2' },\n 'audio/3gpp2': { extension: '.3g2' },\n 'video/mp2t': { extension: '.ts' },\n 'video/mp4': { extension: '.mp4', preview: 'video' },\n 'video/mpeg': { extension: '.mpeg' },\n 'video/ogg': { extension: '.ogv' },\n 'video/webm': { extension: '.webm', preview: 'video' },\n 'video/x-msvideo': { extension: '.avi' },\n}\n\n/** Media Types (MIME Types) that can be displayed as raw text */\nexport const textMediaTypes: string[] = Object.entries(mediaTypes)\n .filter(([, config]) => config?.raw)\n .map(([type]) => type)\n\n/** Get the config for a media type */\nexport function getMediaTypeConfig(type: string): MediaConfig | undefined {\n const config = mediaTypes[type]\n if (config) {\n return config\n }\n\n // Fallback for +json types\n if (type.endsWith('+json')) {\n return {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n }\n }\n\n return undefined\n}\n\n/** Check if a media type that can be displayed as raw text */\nexport function isTextMediaType(type: string): boolean {\n return !!getMediaTypeConfig(type)?.raw\n}\n"],"mappings":";;AAaA,IAAM,aAA0D;CAC9D,wBAAwB,EAAE,WAAW,SAAS;CAC9C,oBAAoB,EAAE,WAAW,OAAO;CACxC,4BAA4B,EAAE,WAAW,QAAQ;CACjD,0BAA0B;EAAE,WAAW;EAAO,KAAK;EAAM;CACzD,oBAAoB;EAClB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;EACV;CACD,uBAAuB;EACrB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;EACV;CACD,4BAA4B;EAC1B,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;EACV;CACD,4BAA4B;EAC1B,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;EACV;CACD,wBAAwB;EACtB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;EACV;CACD,sBAAsB,EAAE,WAAW,QAAQ;CAC3C,4BAA4B,EAAE,WAAW,QAAQ;CACjD,mBAAmB,EAAE,WAAW,QAAQ;CACxC,mBAAmB;EAAE,WAAW;EAAQ,SAAS;EAAU;CAC3D,mBAAmB;EAAE,WAAW;EAAQ,KAAK;EAAM;CACnD,gCAAgC,EAAE,WAAW,QAAQ;CACrD,uCAAuC;EACrC,WAAW;EACX,KAAK;EACL,UAAU;EACX;CACD,mCAAmC;EACjC,WAAW;EACX,KAAK;EACL,UAAU;EACX;CACD,4BAA4B,EAAE,WAAW,QAAQ;CACjD,iCAAiC,EAAE,WAAW,QAAQ;CACtD,iCAAiC,EAAE,WAAW,QAAQ;CACtD,mDAAmD,EAAE,WAAW,QAAQ;CACxE,kDAAkD,EAAE,WAAW,QAAQ;CACvE,2CAA2C,EAAE,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AAK,CAAC,UAAU,KAAK;;AAGxB,SAAgB,mBAAmB,MAAuC;CACxE,MAAM,SAAS,WAAW;AAC1B,KAAI,OACF,QAAO;AAIT,KAAI,KAAK,SAAS,QAAQ,CACxB,QAAO;EACL,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;EACV;;;AAOL,SAAgB,gBAAgB,MAAuB;AACrD,QAAO,CAAC,CAAC,mBAAmB,KAAK,EAAE"}
|
|
1
|
+
{"version":3,"file":"media-types.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/media-types.ts"],"sourcesContent":["import type { CodeMirrorLanguage } from '@scalar/use-codemirror'\n\nexport type MediaPreview = 'object' | 'image' | 'video' | 'audio' | 'json' | 'ndjson'\n\ntype MediaConfig = {\n preview?: MediaPreview\n alpha?: boolean\n raw?: boolean\n language?: CodeMirrorLanguage\n extension: string\n}\n\n/** Media Type (MIME Type) Definitions */\nconst mediaTypes: { [type: string]: MediaConfig | undefined } = {\n 'application/epub+zip': { extension: '.epub' },\n 'application/gzip': { extension: '.gz' },\n 'application/java-archive': { extension: '.jar' },\n 'application/javascript': { extension: '.js', raw: true },\n 'application/json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/ld+json': {\n extension: '.jsonld',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/problem+json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/vnd.api+json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'application/dns-json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n // Newline-delimited JSON is many JSON objects separated by newlines, not one\n // JSON document. The `ndjson` preview pretty-prints each line on its own, while\n // Raw keeps the exact wire format of one object per line.\n 'application/x-ndjson': {\n extension: '.ndjson',\n raw: true,\n language: 'json',\n preview: 'ndjson',\n },\n 'application/ndjson': {\n extension: '.ndjson',\n raw: true,\n language: 'json',\n preview: 'ndjson',\n },\n 'application/msword': { extension: '.doc' },\n 'application/octet-stream': { extension: '.bin' },\n 'application/ogg': { extension: '.ogx' },\n 'application/pdf': { extension: '.pdf', preview: 'object' },\n 'application/rtf': { extension: '.rtf', raw: true },\n 'application/vnd.amazon.ebook': { extension: '.azw' },\n 'application/vnd.apple.installer+xml': {\n extension: '.mpkg',\n raw: true,\n language: 'xml',\n },\n 'application/vnd.mozilla.xul+xml': {\n extension: '.xul',\n raw: true,\n language: 'xml',\n },\n 'application/vnd.ms-excel': { extension: '.xls' },\n 'application/vnd.ms-fontobject': { extension: '.eot' },\n 'application/vnd.ms-powerpoint': { extension: '.ppt' },\n 'application/vnd.oasis.opendocument.presentation': { extension: '.odp' },\n 'application/vnd.oasis.opendocument.spreadsheet': { extension: '.ods' },\n 'application/vnd.oasis.opendocument.text': { extension: '.odt' },\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': {\n extension: '.pptx',\n },\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': {\n extension: '.xlsx',\n },\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': {\n extension: '.docx',\n },\n 'application/vnd.rar': { extension: '.rar' },\n 'application/vnd.visio': { extension: '.vsd' },\n 'application/x-7z-compressed': { extension: '.7z' },\n 'application/x-abiword': { extension: '.abw' },\n 'application/x-bzip': { extension: '.bz' },\n 'application/x-bzip2': { extension: '.bz2' },\n 'application/x-cdf': { extension: '.cda' },\n 'application/x-csh': { extension: '.csh' },\n 'application/x-freearc': { extension: '.arc' },\n 'application/x-httpd-php': { extension: '.php', raw: true },\n 'application/x-sh': { extension: '.sh', raw: true },\n 'application/x-tar': { extension: '.tar' },\n 'application/xhtml+xml': { extension: '.xhtml', raw: true, language: 'html' },\n 'application/xml': { extension: '.xml', raw: true, language: 'xml' },\n 'application/yaml': { extension: '.yaml', raw: true, language: 'yaml' },\n 'application/zip': { extension: '.zip' },\n 'audio/aac': { extension: '.aac' },\n 'audio/midi': { extension: '.midi' },\n 'audio/mpeg': { extension: '.mp3', preview: 'audio' },\n 'audio/ogg': { extension: '.oga' },\n 'audio/wav': { extension: '.wav' },\n 'audio/webm': { extension: '.weba' },\n 'font/otf': { extension: '.otf' },\n 'font/ttf': { extension: '.ttf' },\n 'font/woff': { extension: '.woff' },\n 'font/woff2': { extension: '.woff2' },\n 'image/apng': { extension: '.apng', preview: 'image', alpha: true },\n 'image/avif': { extension: '.avif', preview: 'image' },\n 'image/bmp': { extension: '.bmp', preview: 'image' },\n 'image/gif': { extension: '.gif', preview: 'image', alpha: true },\n 'image/jpeg': { extension: '.jpg', preview: 'image' },\n 'image/png': { extension: '.png', preview: 'image', alpha: true },\n 'image/svg+xml': {\n extension: '.svg',\n raw: true,\n language: 'xml',\n preview: 'image',\n alpha: true,\n },\n 'image/tiff': { extension: '.tiff' },\n 'image/vnd.microsoft.icon': { extension: '.ico', preview: 'image' },\n 'image/webp': { extension: '.webp', preview: 'image', alpha: true },\n 'text/calendar': { extension: '.ics', raw: true },\n 'text/css': { extension: '.css', raw: true, language: 'css' },\n 'text/csv': { extension: '.csv', raw: true },\n 'text/html': {\n extension: '.html',\n raw: true,\n language: 'html',\n preview: 'object',\n },\n 'text/javascript': { extension: '.js', raw: true },\n 'text/json': {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n },\n 'text/plain': { extension: '.txt', raw: true },\n 'text/xml': { extension: '.xml', raw: true, language: 'xml' },\n 'text/yaml': { extension: '.yaml', raw: true, language: 'yaml' },\n 'video/3gpp': { extension: '.3gp' },\n 'audio/3gpp': { extension: '.3gp' },\n 'video/3gpp2': { extension: '.3g2' },\n 'audio/3gpp2': { extension: '.3g2' },\n 'video/mp2t': { extension: '.ts' },\n 'video/mp4': { extension: '.mp4', preview: 'video' },\n 'video/mpeg': { extension: '.mpeg' },\n 'video/ogg': { extension: '.ogv' },\n 'video/webm': { extension: '.webm', preview: 'video' },\n 'video/x-msvideo': { extension: '.avi' },\n}\n\n/** Media Types (MIME Types) that can be displayed as raw text */\nexport const textMediaTypes: string[] = Object.entries(mediaTypes)\n .filter(([, config]) => config?.raw)\n .map(([type]) => type)\n\n/** Get the config for a media type */\nexport function getMediaTypeConfig(type: string): MediaConfig | undefined {\n const config = mediaTypes[type]\n if (config) {\n return config\n }\n\n // Fallback for +json types\n if (type.endsWith('+json')) {\n return {\n extension: '.json',\n raw: true,\n language: 'json',\n preview: 'json',\n }\n }\n\n return undefined\n}\n\n/** Check if a media type that can be displayed as raw text */\nexport function isTextMediaType(type: string): boolean {\n return !!getMediaTypeConfig(type)?.raw\n}\n"],"mappings":";;AAaA,IAAM,aAA0D;CAC9D,wBAAwB,EAAE,WAAW,QAAQ;CAC7C,oBAAoB,EAAE,WAAW,MAAM;CACvC,4BAA4B,EAAE,WAAW,OAAO;CAChD,0BAA0B;EAAE,WAAW;EAAO,KAAK;CAAK;CACxD,oBAAoB;EAClB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CACA,uBAAuB;EACrB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CACA,4BAA4B;EAC1B,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CACA,4BAA4B;EAC1B,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CACA,wBAAwB;EACtB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CAIA,wBAAwB;EACtB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CACA,sBAAsB;EACpB,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;CACA,sBAAsB,EAAE,WAAW,OAAO;CAC1C,4BAA4B,EAAE,WAAW,OAAO;CAChD,mBAAmB,EAAE,WAAW,OAAO;CACvC,mBAAmB;EAAE,WAAW;EAAQ,SAAS;CAAS;CAC1D,mBAAmB;EAAE,WAAW;EAAQ,KAAK;CAAK;CAClD,gCAAgC,EAAE,WAAW,OAAO;CACpD,uCAAuC;EACrC,WAAW;EACX,KAAK;EACL,UAAU;CACZ;CACA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AW,QAAQ;CACnC,aAAa,EAAE,WAAW,OAAO;CACjC,cAAc;EAAE,WAAW;EAAS,SAAS;CAAQ;CACrD,mBAAmB,EAAE,WAAW,OAAO;AACzC;;AAGA,IAAa,iBAA2B,OAAO,QAAQ,UAAU,CAAC,CAC/D,QAAQ,GAAG,YAAY,QAAQ,GAAG,CAAC,CACnC,KAAK,CAAC,UAAU,IAAI;;AAGvB,SAAgB,mBAAmB,MAAuC;CACxE,MAAM,SAAS,WAAW;CAC1B,IAAI,QACF,OAAO;CAIT,IAAI,KAAK,SAAS,OAAO,GACvB,OAAO;EACL,WAAW;EACX,KAAK;EACL,UAAU;EACV,SAAS;CACX;AAIJ;;AAGA,SAAgB,gBAAgB,MAAuB;CACrD,OAAO,CAAC,CAAC,mBAAmB,IAAI,CAAC,EAAE;AACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-set-cookie.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/parse-set-cookie.ts"],"sourcesContent":["/**\n * Parse a Set-Cookie header value into name and value.\n *\n * Set-Cookie headers have the format: name=value; attribute1; attribute2=value2\n * We extract just the cookie name and value (the part before the first semicolon).\n *\n * @param setCookieValue - The full Set-Cookie header value\n * @returns Object with cookie name and value, or null if parsing fails\n *\n * @example\n * parseSetCookie('sessionId=abc123; Path=/; HttpOnly')\n * // Returns: { name: 'sessionId', value: 'abc123; Path=/; HttpOnly' }\n */\nexport const parseSetCookie = (setCookieValue: string): { name: string; value: string } | null => {\n if (!setCookieValue || typeof setCookieValue !== 'string') {\n return null\n }\n\n // Find the first equals sign to split name from value\n const firstEqualsIndex = setCookieValue.indexOf('=')\n\n if (firstEqualsIndex === -1) {\n // Invalid cookie format (no equals sign)\n return null\n }\n\n const name = setCookieValue.substring(0, firstEqualsIndex).trim()\n // Keep everything after the equals sign as the value (including attributes)\n const value = setCookieValue.substring(firstEqualsIndex + 1).trim()\n\n if (!name) {\n // Cookie name cannot be empty\n return null\n }\n\n return { name, value }\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAa,kBAAkB,mBAAmE;
|
|
1
|
+
{"version":3,"file":"parse-set-cookie.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/parse-set-cookie.ts"],"sourcesContent":["/**\n * Parse a Set-Cookie header value into name and value.\n *\n * Set-Cookie headers have the format: name=value; attribute1; attribute2=value2\n * We extract just the cookie name and value (the part before the first semicolon).\n *\n * @param setCookieValue - The full Set-Cookie header value\n * @returns Object with cookie name and value, or null if parsing fails\n *\n * @example\n * parseSetCookie('sessionId=abc123; Path=/; HttpOnly')\n * // Returns: { name: 'sessionId', value: 'abc123; Path=/; HttpOnly' }\n */\nexport const parseSetCookie = (setCookieValue: string): { name: string; value: string } | null => {\n if (!setCookieValue || typeof setCookieValue !== 'string') {\n return null\n }\n\n // Find the first equals sign to split name from value\n const firstEqualsIndex = setCookieValue.indexOf('=')\n\n if (firstEqualsIndex === -1) {\n // Invalid cookie format (no equals sign)\n return null\n }\n\n const name = setCookieValue.substring(0, firstEqualsIndex).trim()\n // Keep everything after the equals sign as the value (including attributes)\n const value = setCookieValue.substring(firstEqualsIndex + 1).trim()\n\n if (!name) {\n // Cookie name cannot be empty\n return null\n }\n\n return { name, value }\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAa,kBAAkB,mBAAmE;CAChG,IAAI,CAAC,kBAAkB,OAAO,mBAAmB,UAC/C,OAAO;CAIT,MAAM,mBAAmB,eAAe,QAAQ,GAAG;CAEnD,IAAI,qBAAqB,IAEvB,OAAO;CAGT,MAAM,OAAO,eAAe,UAAU,GAAG,gBAAgB,CAAC,CAAC,KAAK;CAEhE,MAAM,QAAQ,eAAe,UAAU,mBAAmB,CAAC,CAAC,CAAC,KAAK;CAElE,IAAI,CAAC,MAEH,OAAO;CAGT,OAAO;EAAE;EAAM;CAAM;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettify-jsonc-string.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/prettify-jsonc-string.ts"],"sourcesContent":["import { applyEdits, format } from 'jsonc-parser'\n\nconst jsoncFormatOptions = {\n tabSize: 2,\n insertSpaces: true,\n eol: '\\n',\n} as const\n\n/**\n * Pretty-print JSON/JSONC for preview without round-tripping through JSON.parse,\n * so digit sequences in large integers stay exact in the string.\n */\nexport function prettifyJsoncString(content: string): string {\n try {\n const edits = format(content, undefined, jsoncFormatOptions)\n if (edits.length > 0) {\n return applyEdits(content, edits)\n }\n } catch {\n // applyEdits can throw on malformed edit sequences\n }\n return content\n}\n"],"mappings":";;AAEA,IAAM,qBAAqB;CACzB,SAAS;CACT,cAAc;CACd,KAAK;
|
|
1
|
+
{"version":3,"file":"prettify-jsonc-string.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/prettify-jsonc-string.ts"],"sourcesContent":["import { applyEdits, format } from 'jsonc-parser'\n\nconst jsoncFormatOptions = {\n tabSize: 2,\n insertSpaces: true,\n eol: '\\n',\n} as const\n\n/**\n * Pretty-print JSON/JSONC for preview without round-tripping through JSON.parse,\n * so digit sequences in large integers stay exact in the string.\n */\nexport function prettifyJsoncString(content: string): string {\n try {\n const edits = format(content, undefined, jsoncFormatOptions)\n if (edits.length > 0) {\n return applyEdits(content, edits)\n }\n } catch {\n // applyEdits can throw on malformed edit sequences\n }\n return content\n}\n"],"mappings":";;AAEA,IAAM,qBAAqB;CACzB,SAAS;CACT,cAAc;CACd,KAAK;AACP;;;;;AAMA,SAAgB,oBAAoB,SAAyB;CAC3D,IAAI;EACF,MAAM,QAAQ,OAAO,SAAS,KAAA,GAAW,kBAAkB;EAC3D,IAAI,MAAM,SAAS,GACjB,OAAO,WAAW,SAAS,KAAK;CAEpC,QAAQ,CAER;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pretty-print newline-delimited JSON (NDJSON) for preview.
|
|
3
|
+
*
|
|
4
|
+
* NDJSON is one JSON value per line, so we format each line on its own and
|
|
5
|
+
* separate the records with a blank line to keep them visually distinct.
|
|
6
|
+
* Empty lines are dropped. Formatting is lenient: each line is reformatted as
|
|
7
|
+
* far as the JSONC formatter can restructure it, and anything it cannot parse
|
|
8
|
+
* is left as-is rather than rejected, so a malformed or partial record never
|
|
9
|
+
* breaks the whole preview.
|
|
10
|
+
*/
|
|
11
|
+
export declare function prettifyNdjson(content: string): string;
|
|
12
|
+
//# sourceMappingURL=prettify-ndjson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettify-ndjson.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/helpers/prettify-ndjson.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { prettifyJsoncString } from "./prettify-jsonc-string.js";
|
|
2
|
+
//#region src/v2/blocks/response-block/helpers/prettify-ndjson.ts
|
|
3
|
+
/**
|
|
4
|
+
* Pretty-print newline-delimited JSON (NDJSON) for preview.
|
|
5
|
+
*
|
|
6
|
+
* NDJSON is one JSON value per line, so we format each line on its own and
|
|
7
|
+
* separate the records with a blank line to keep them visually distinct.
|
|
8
|
+
* Empty lines are dropped. Formatting is lenient: each line is reformatted as
|
|
9
|
+
* far as the JSONC formatter can restructure it, and anything it cannot parse
|
|
10
|
+
* is left as-is rather than rejected, so a malformed or partial record never
|
|
11
|
+
* breaks the whole preview.
|
|
12
|
+
*/
|
|
13
|
+
function prettifyNdjson(content) {
|
|
14
|
+
return content.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).map((line) => prettifyJsoncString(line)).join("\n\n");
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { prettifyNdjson };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=prettify-ndjson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettify-ndjson.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/prettify-ndjson.ts"],"sourcesContent":["import { prettifyJsoncString } from '@/v2/blocks/response-block/helpers/prettify-jsonc-string'\n\n/**\n * Pretty-print newline-delimited JSON (NDJSON) for preview.\n *\n * NDJSON is one JSON value per line, so we format each line on its own and\n * separate the records with a blank line to keep them visually distinct.\n * Empty lines are dropped. Formatting is lenient: each line is reformatted as\n * far as the JSONC formatter can restructure it, and anything it cannot parse\n * is left as-is rather than rejected, so a malformed or partial record never\n * breaks the whole preview.\n */\nexport function prettifyNdjson(content: string): string {\n return content\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .map((line) => prettifyJsoncString(line))\n .join('\\n\\n')\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,eAAe,SAAyB;CACtD,OAAO,QACJ,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC,CAAC,CACjC,KAAK,SAAS,oBAAoB,IAAI,CAAC,CAAC,CACxC,KAAK,MAAM;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-response-body.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/process-response-body.ts"],"sourcesContent":["import { resolveResponseMimeType } from '@/v2/blocks/response-block/helpers/resolve-response-content-type'\n\nimport { extractFilename } from './../helpers/extract-filename'\n\nconst isBlob = (b: any): b is Blob => b instanceof Blob\n\n/**\n * Processes the response body of an HTTP request.\n * Extracts MIME type, attachment filename, and generates a data URL.\n */\nexport function processResponseBody({ data, headers }: { data: unknown; headers: { name: string; value: string }[] }) {\n const contentType = headers.find((header) => header.name.toLowerCase() === 'content-type')\n const mimeType = resolveResponseMimeType(contentType?.value)\n const attachmentFilename = extractFilename(\n headers.find((header) => header.name.toLowerCase() === 'content-disposition')?.value ?? '',\n )\n\n const dataUrl = (() => {\n if (isBlob(data)) {\n return URL.createObjectURL(data)\n }\n if (typeof data === 'string') {\n return URL.createObjectURL(new Blob([data], { type: mimeType ? mimeType.toString() : undefined }))\n }\n if (data instanceof Object && Object.keys(data).length) {\n return URL.createObjectURL(\n new Blob([JSON.stringify(data)], {\n type: mimeType ? mimeType.toString() : undefined,\n }),\n )\n }\n return ''\n })()\n\n return { mimeType, attachmentFilename, dataUrl }\n}\n"],"mappings":";;;AAIA,IAAM,UAAU,MAAsB,aAAa;;;;;AAMnD,SAAgB,oBAAoB,EAAE,MAAM,WAA0E;CAEpH,MAAM,WAAW,wBADG,QAAQ,MAAM,WAAW,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"process-response-body.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/process-response-body.ts"],"sourcesContent":["import { resolveResponseMimeType } from '@/v2/blocks/response-block/helpers/resolve-response-content-type'\n\nimport { extractFilename } from './../helpers/extract-filename'\n\nconst isBlob = (b: any): b is Blob => b instanceof Blob\n\n/**\n * Processes the response body of an HTTP request.\n * Extracts MIME type, attachment filename, and generates a data URL.\n */\nexport function processResponseBody({ data, headers }: { data: unknown; headers: { name: string; value: string }[] }) {\n const contentType = headers.find((header) => header.name.toLowerCase() === 'content-type')\n const mimeType = resolveResponseMimeType(contentType?.value)\n const attachmentFilename = extractFilename(\n headers.find((header) => header.name.toLowerCase() === 'content-disposition')?.value ?? '',\n )\n\n const dataUrl = (() => {\n if (isBlob(data)) {\n return URL.createObjectURL(data)\n }\n if (typeof data === 'string') {\n return URL.createObjectURL(new Blob([data], { type: mimeType ? mimeType.toString() : undefined }))\n }\n if (data instanceof Object && Object.keys(data).length) {\n return URL.createObjectURL(\n new Blob([JSON.stringify(data)], {\n type: mimeType ? mimeType.toString() : undefined,\n }),\n )\n }\n return ''\n })()\n\n return { mimeType, attachmentFilename, dataUrl }\n}\n"],"mappings":";;;AAIA,IAAM,UAAU,MAAsB,aAAa;;;;;AAMnD,SAAgB,oBAAoB,EAAE,MAAM,WAA0E;CAEpH,MAAM,WAAW,wBADG,QAAQ,MAAM,WAAW,OAAO,KAAK,YAAY,MAAM,cAClC,CAAA,EAAa,KAAK;CAsB3D,OAAO;EAAE;EAAU,oBArBQ,gBACzB,QAAQ,MAAM,WAAW,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC,EAAE,SAAS,EAoBvE;EAAoB,gBAjBhB;GACrB,IAAI,OAAO,IAAI,GACb,OAAO,IAAI,gBAAgB,IAAI;GAEjC,IAAI,OAAO,SAAS,UAClB,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC,IAAI,GAAG,EAAE,MAAM,WAAW,SAAS,SAAS,IAAI,KAAA,EAAU,CAAC,CAAC;GAEnG,IAAI,gBAAgB,UAAU,OAAO,KAAK,IAAI,CAAC,CAAC,QAC9C,OAAO,IAAI,gBACT,IAAI,KAAK,CAAC,KAAK,UAAU,IAAI,CAAC,GAAG,EAC/B,MAAM,WAAW,SAAS,SAAS,IAAI,KAAA,EACzC,CAAC,CACH;GAEF,OAAO;EACT,EAAA,CAEuC;CAAQ;AACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-response-body-handler.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/resolve-response-body-handler.ts"],"sourcesContent":["import type { ClientPlugin, ResponseBodyHandler } from '@scalar/oas-utils/helpers'\n\n/**\n * Find the first plugin response body handler that matches a given MIME type.\n * Plugins are checked in order — first match wins, allowing users to override native behavior.\n *\n * Matching supports:\n * - Exact match: \"application/msgpack\"\n * - Suffix wildcard: \"application/vnd.*+json\" matches \"application/vnd.api+json\"\n */\nexport const resolveResponseBodyHandler = (\n mimeType: string,\n plugins: ClientPlugin[],\n): ResponseBodyHandler | undefined => {\n for (const plugin of plugins) {\n if (!plugin.responseBody) {\n continue\n }\n\n for (const handler of plugin.responseBody) {\n if (matchesMimeType(mimeType, handler.mimeTypes)) {\n return handler\n }\n }\n }\n\n return undefined\n}\n\n/**\n * Checks if the given MIME type matches any of the provided MIME type patterns.\n * Supports both exact match (e.g. \"application/json\") and wildcard patterns (e.g. \"application/*\", \"application/vnd.*+json\").\n *\n * Example:\n * matchesMimeType('application/json', ['application/*']) // true\n * matchesMimeType('application/vnd.api+json', ['application/vnd.*+json']) // true\n * matchesMimeType('text/plain', ['application/json']) // false\n *\n * @param actual - The MIME type to match (e.g., \"application/json\")\n * @param patterns - List of patterns that may include wildcards (e.g., [\"application/*\", \"text/*\"])\n * @returns true if actual matches any pattern; false otherwise\n */\nconst matchesMimeType = (actual: string, patterns: string[]): boolean => {\n const normalized = actual.toLowerCase()\n\n for (const pattern of patterns) {\n const normalizedPattern = pattern.toLowerCase()\n\n // Exact match: \"application/json\" === \"application/json\"\n if (normalizedPattern === normalized) {\n return true\n }\n\n // Wildcard match: \"application/*\" or \"application/vnd.*+json\"\n if (normalizedPattern.includes('*')) {\n // Escape regex special chars except for *\n const escaped = normalizedPattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*')\n const regex = new RegExp(`^${escaped}$`)\n if (regex.test(normalized)) {\n return true\n }\n }\n }\n\n return false\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,8BACX,UACA,YACoC;
|
|
1
|
+
{"version":3,"file":"resolve-response-body-handler.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/resolve-response-body-handler.ts"],"sourcesContent":["import type { ClientPlugin, ResponseBodyHandler } from '@scalar/oas-utils/helpers'\n\n/**\n * Find the first plugin response body handler that matches a given MIME type.\n * Plugins are checked in order — first match wins, allowing users to override native behavior.\n *\n * Matching supports:\n * - Exact match: \"application/msgpack\"\n * - Suffix wildcard: \"application/vnd.*+json\" matches \"application/vnd.api+json\"\n */\nexport const resolveResponseBodyHandler = (\n mimeType: string,\n plugins: ClientPlugin[],\n): ResponseBodyHandler | undefined => {\n for (const plugin of plugins) {\n if (!plugin.responseBody) {\n continue\n }\n\n for (const handler of plugin.responseBody) {\n if (matchesMimeType(mimeType, handler.mimeTypes)) {\n return handler\n }\n }\n }\n\n return undefined\n}\n\n/**\n * Checks if the given MIME type matches any of the provided MIME type patterns.\n * Supports both exact match (e.g. \"application/json\") and wildcard patterns (e.g. \"application/*\", \"application/vnd.*+json\").\n *\n * Example:\n * matchesMimeType('application/json', ['application/*']) // true\n * matchesMimeType('application/vnd.api+json', ['application/vnd.*+json']) // true\n * matchesMimeType('text/plain', ['application/json']) // false\n *\n * @param actual - The MIME type to match (e.g., \"application/json\")\n * @param patterns - List of patterns that may include wildcards (e.g., [\"application/*\", \"text/*\"])\n * @returns true if actual matches any pattern; false otherwise\n */\nconst matchesMimeType = (actual: string, patterns: string[]): boolean => {\n const normalized = actual.toLowerCase()\n\n for (const pattern of patterns) {\n const normalizedPattern = pattern.toLowerCase()\n\n // Exact match: \"application/json\" === \"application/json\"\n if (normalizedPattern === normalized) {\n return true\n }\n\n // Wildcard match: \"application/*\" or \"application/vnd.*+json\"\n if (normalizedPattern.includes('*')) {\n // Escape regex special chars except for *\n const escaped = normalizedPattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*')\n const regex = new RegExp(`^${escaped}$`)\n if (regex.test(normalized)) {\n return true\n }\n }\n }\n\n return false\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,8BACX,UACA,YACoC;CACpC,KAAK,MAAM,UAAU,SAAS;EAC5B,IAAI,CAAC,OAAO,cACV;EAGF,KAAK,MAAM,WAAW,OAAO,cAC3B,IAAI,gBAAgB,UAAU,QAAQ,SAAS,GAC7C,OAAO;CAGb;AAGF;;;;;;;;;;;;;;AAeA,IAAM,mBAAmB,QAAgB,aAAgC;CACvE,MAAM,aAAa,OAAO,YAAY;CAEtC,KAAK,MAAM,WAAW,UAAU;EAC9B,MAAM,oBAAoB,QAAQ,YAAY;EAG9C,IAAI,sBAAsB,YACxB,OAAO;EAIT,IAAI,kBAAkB,SAAS,GAAG,GAAG;GAEnC,MAAM,UAAU,kBAAkB,QAAQ,sBAAsB,MAAM,CAAC,CAAC,QAAQ,OAAO,IAAI;GAE3F,IAAI,IADc,OAAO,IAAI,QAAQ,EACjC,CAAA,CAAM,KAAK,UAAU,GACvB,OAAO;EAEX;CACF;CAEA,OAAO;AACT"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { parseMimeType } from "@scalar/helpers/http/mime-type";
|
|
2
|
+
//#region src/v2/blocks/response-block/helpers/resolve-response-content-type.ts
|
|
3
|
+
/**
|
|
4
|
+
* Browser fetch uses text/plain;charset=UTF-8 as the default body type
|
|
5
|
+
* when the response does not include a Content-Type header.
|
|
6
|
+
*/
|
|
7
|
+
var DEFAULT_RESPONSE_CONTENT_TYPE = "text/plain;charset=UTF-8";
|
|
2
8
|
/**
|
|
3
9
|
* Resolve the response content type with a consistent fallback.
|
|
4
10
|
*/
|
|
@@ -8,6 +14,6 @@ var resolveResponseContentType = (contentType) => contentType ?? "text/plain;cha
|
|
|
8
14
|
*/
|
|
9
15
|
var resolveResponseMimeType = (contentType) => parseMimeType(resolveResponseContentType(contentType));
|
|
10
16
|
//#endregion
|
|
11
|
-
export { resolveResponseContentType, resolveResponseMimeType };
|
|
17
|
+
export { DEFAULT_RESPONSE_CONTENT_TYPE, resolveResponseContentType, resolveResponseMimeType };
|
|
12
18
|
|
|
13
19
|
//# sourceMappingURL=resolve-response-content-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-response-content-type.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/resolve-response-content-type.ts"],"sourcesContent":["import { parseMimeType } from '@scalar/helpers/http/mime-type'\n\n/**\n * Browser fetch uses text/plain;charset=UTF-8 as the default body type\n * when the response does not include a Content-Type header.\n */\nexport const DEFAULT_RESPONSE_CONTENT_TYPE = 'text/plain;charset=UTF-8'\n\n/**\n * Resolve the response content type with a consistent fallback.\n */\nexport const resolveResponseContentType = (contentType: string | null | undefined): string =>\n contentType ?? DEFAULT_RESPONSE_CONTENT_TYPE\n\n/**\n * Parse the effective response MIME type using the fallback content type.\n */\nexport const resolveResponseMimeType = (contentType: string | null | undefined) =>\n parseMimeType(resolveResponseContentType(contentType))\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"resolve-response-content-type.js","names":[],"sources":["../../../../../src/v2/blocks/response-block/helpers/resolve-response-content-type.ts"],"sourcesContent":["import { parseMimeType } from '@scalar/helpers/http/mime-type'\n\n/**\n * Browser fetch uses text/plain;charset=UTF-8 as the default body type\n * when the response does not include a Content-Type header.\n */\nexport const DEFAULT_RESPONSE_CONTENT_TYPE = 'text/plain;charset=UTF-8'\n\n/**\n * Resolve the response content type with a consistent fallback.\n */\nexport const resolveResponseContentType = (contentType: string | null | undefined): string =>\n contentType ?? DEFAULT_RESPONSE_CONTENT_TYPE\n\n/**\n * Parse the effective response MIME type using the fallback content type.\n */\nexport const resolveResponseMimeType = (contentType: string | null | undefined) =>\n parseMimeType(resolveResponseContentType(contentType))\n"],"mappings":";;;;;;AAMA,IAAa,gCAAgC;;;;AAK7C,IAAa,8BAA8B,gBACzC,eAAA;;;;AAKF,IAAa,2BAA2B,gBACtC,cAAc,2BAA2B,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AAmrBA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAIrF,OAAO,KAAK,EAEV,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAoBhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGzE;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,MAAM,MAAM,eAAe,GAAG;IAC5B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AACD,QAAA,MAAM,YAAY;;;;;eAoB6B,MAAM;;;;;eAAN,MAAM;;;
|
|
1
|
+
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AAmrBA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAIrF,OAAO,KAAK,EAEV,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAoBhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGzE;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,MAAM,MAAM,eAAe,GAAG;IAC5B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AACD,QAAA,MAAM,YAAY;;;;;eAoB6B,MAAM;;;;;eAAN,MAAM;;;kFA09BjD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
|
|
|
2
2
|
import AddressBar_vue_vue_type_script_setup_true_lang_default from "./AddressBar.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue
|
|
5
|
-
var AddressBar_default =
|
|
5
|
+
var AddressBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(AddressBar_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d37cbfcc"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AddressBar_default as default };
|
|
8
8
|
|
|
@@ -38,7 +38,7 @@ var _hoisted_11 = {
|
|
|
38
38
|
class: "inline-flex items-center gap-1"
|
|
39
39
|
};
|
|
40
40
|
var _hoisted_12 = { class: "sr-only" };
|
|
41
|
-
var AddressBar_vue_vue_type_script_setup_true_lang_default =
|
|
41
|
+
var AddressBar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
42
42
|
name: "AddressBar",
|
|
43
43
|
props: {
|
|
44
44
|
path: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBar.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * AddressBar component\n * This component is used to display the address bar for the operation block\n * It is used to display the path, method, server, and history for the operation\n */\nexport default {\n name: 'AddressBar',\n}\nexport type AddressBarProps = {\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** Openapi document slug */\n documentSlug: string\n /** Currently selected example key for the current operation */\n exampleKey: string\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 /** Client layout */\n layout: ClientLayout\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport { getSelector } from '@scalar/helpers/dom/get-selector'\nimport { REQUEST_METHODS } from '@scalar/helpers/http/http-info'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { extractServerFromPath } from '@scalar/helpers/url/extract-server-from-path'\nimport { ScalarIconCopy, ScalarIconWarningCircle } from '@scalar/icons'\nimport { EditorView } from '@scalar/use-codemirror'\nimport type {\n ApiReferenceEvents,\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.1/strict/openapi-document'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { HttpMethod } from '@/components/HttpMethod'\nimport { getOperationExampleKey } from '@/v2/blocks/operation-block/helpers/response-cache'\nimport { isPlaceholderPath } from '@/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path'\nimport { refocusBlurTarget } from '@/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target'\nimport { useLoadingAnimation } from '@/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation'\nimport { usePathMasking } from '@/v2/blocks/scalar-address-bar-block/hooks/use-path-masking'\nimport { CodeInput } from '@/v2/components/code-input'\nimport { ServerDropdown } from '@/v2/components/server'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport AddressBarHistory, { type History } from './AddressBarHistory.vue'\n\nconst {\n path,\n method,\n layout,\n eventBus,\n exampleKey,\n documentSlug,\n server,\n servers,\n environment,\n serverMeta,\n} = defineProps<AddressBarProps>()\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}>()\n\n// ───────────────────────────────────────────────────────────────────\n// Template refs & reactive state\n// ───────────────────────────────────────────────────────────────────\n\nconst id = useId()\nconst sendButtonRef = useTemplateRef('sendButtonRef')\nconst mobileSendButtonRef = useTemplateRef('mobileSendButtonRef')\nconst addressBarRef = useTemplateRef('addressBarRef')\n\nconst { percentage, startLoading, stopLoading, isLoading } =\n useLoadingAnimation()\n\nconst pathConflict = ref<string | null>(null)\nconst methodConflict = ref<HttpMethodType | null>(null)\nconst tabbedOut = ref(false)\nconst isServerDropdownOpen = ref(false)\nconst isHistoryDropdownOpen = ref(false)\n\n// ───────────────────────────────────────────────────────────────────\n// Derived state\n// ───────────────────────────────────────────────────────────────────\n\n/** Keeps the cursor visible past the fade-right overlay while typing */\nconst addressBarScrollMargins = EditorView.scrollMargins.of(() => ({\n right: 24,\n}))\n\n/** Animated background transform for the loading indicator */\nconst style = computed(() => ({\n backgroundColor: `color-mix(in srgb, transparent 90%, ${REQUEST_METHODS[method].colorVar})`,\n transform: `translate3d(-${percentage.value}%,0,0)`,\n}))\n\n/** Whether there is a path or method conflict */\nconst hasConflict = computed(() => methodConflict.value || pathConflict.value)\n\n/** Whether either dropdown (server or history) is open */\nconst isDropdownOpen = computed(\n () => isServerDropdownOpen.value || isHistoryDropdownOpen.value,\n)\n\n/** Uniquely identifies the currently selected operation + example */\nconst uniqueKey = computed(() =>\n getOperationExampleKey(method, path, exampleKey, documentSlug),\n)\n\n/** Clear conflict state when switching to a different operation */\nwatch(uniqueKey, () => {\n pathConflict.value = null\n methodConflict.value = null\n})\n\n// ───────────────────────────────────────────────────────────────────\n// Focus helpers\n// ───────────────────────────────────────────────────────────────────\n\nconst handleFocusSendButton = (): void => {\n const desktop = sendButtonRef.value?.$el\n const mobile = mobileSendButtonRef.value?.$el\n\n // Focus whichever send button is currently visible\n if (desktop && desktop.offsetParent !== null) {\n desktop.focus()\n } else {\n mobile?.focus()\n }\n}\n\nconst handleFocusAddressBar = (\n payload: ApiReferenceEvents['ui:focus:address-bar'],\n): void => {\n // On non-desktop layouts, if already focused we let the browser handle the\n // native behavior (e.g. selecting the browser's own address bar).\n if (addressBarRef.value?.isFocused && layout !== 'desktop') {\n return\n }\n\n addressBarRef.value?.focus('end')\n\n if (payload && 'clear' in payload && payload.clear) {\n addressBarRef.value?.setCodeMirrorContent('')\n }\n\n if (payload && 'event' in payload) {\n payload.event.preventDefault()\n }\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Path masking\n//\n// Drafts on `/` and auto-generated `/_scalar_temp...` paths are internal\n// placeholders — the address bar focuses and clears on mount and on\n// navigation so the user sees a blank prompt instead of the internal\n// path. The deferred mask only clears when CodeMirror still contains that\n// placeholder path, so a user edit that lands before the frame is preserved.\n// ───────────────────────────────────────────────────────────────────\n\nusePathMasking({\n isReady: () => addressBarRef.value?.codeMirror,\n operationKey: () => uniqueKey.value,\n shouldMask: () => isPlaceholderPath(path, documentSlug),\n // Defer to the next frame so focus() runs after click-handler side\n // effects that move focus (e.g. a dropdown refocusing its trigger),\n // which would otherwise blur our input and emit a spurious path\n // update against the now-empty value.\n onMask: () =>\n requestAnimationFrame(() => {\n const editorContent =\n addressBarRef.value?.codeMirror?.state.doc.toString()\n\n if (editorContent && editorContent !== path) {\n return\n }\n\n handleFocusAddressBar({ clear: true })\n }),\n})\n\n// ───────────────────────────────────────────────────────────────────\n// Server extraction\n// ───────────────────────────────────────────────────────────────────\n\n/** If the path contains a server URL, extract it and select or add that server */\nconst extractAndSelectServer = (targetPath: string): string => {\n const extracted = extractServerFromPath(targetPath)\n if (!extracted) {\n return targetPath\n }\n\n const [url, remainingPath] = extracted\n\n // Server is already selected — nothing to do\n if (url === server?.url) {\n return remainingPath\n }\n\n const matchingServer = servers.find((s) => s.url === url)\n if (matchingServer) {\n eventBus.emit('server:update:selected', { url, meta: serverMeta })\n } else {\n eventBus.emit('server:add:server', {\n url,\n select: true,\n meta: { type: 'operation', path, method },\n })\n }\n\n return remainingPath\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Path / method updates\n// ───────────────────────────────────────────────────────────────────\n\nconst normalizePath = (value: string): string =>\n value.startsWith('/') ? value : `/${value}`\n\n/** Emit a path/method update and reconcile conflicts + cursor state on the result */\nconst emitPathMethodUpdate = (\n targetMethod: HttpMethodType,\n targetPath: string,\n blurTargetSelector: string | null = null,\n): void => {\n const extractedPath = extractAndSelectServer(targetPath)\n const normalizedPath = normalizePath(extractedPath)\n\n // Keep CodeMirror in sync so a conflict does not leave a stale value on screen\n addressBarRef.value?.setCodeMirrorContent(normalizedPath)\n\n eventBus.emit('operation:update:pathMethod', {\n meta: { method, path },\n blurTargetSelector,\n payload: { method: targetMethod, path: normalizedPath },\n callback: (status, returnedSelector) => {\n if (status === 'success' || status === 'no-change') {\n methodConflict.value = null\n pathConflict.value = null\n } else if (status === 'conflict') {\n if (targetMethod !== method) {\n methodConflict.value = targetMethod\n }\n if (normalizedPath !== path) {\n pathConflict.value = normalizedPath\n }\n\n return\n }\n\n // Edge case: pasting a full URL extracts the server but leaves the path\n // unchanged. CodeMirror still shows the full URL, so force it back to\n // just the path.\n const mirrorContent = addressBarRef.value?.codeMirrorRef?.textContent\n if (\n status === 'no-change' &&\n mirrorContent &&\n mirrorContent !== extractedPath\n ) {\n addressBarRef.value?.setCodeMirrorContent(extractedPath)\n }\n\n nextTick(() => refocusBlurTarget(returnedSelector))\n },\n })\n}\n\n/** Change the operation's method, preferring the conflicting path if present */\nconst handleMethodChange = (newMethod: HttpMethodType): void =>\n emitPathMethodUpdate(newMethod, pathConflict.value ?? path)\n\n/**\n * Save the path on blur and replay the click that caused the blur (so e.g. a\n * click on the Send button still fires after the async update resolves).\n *\n * Tab-outs do not replay — tabbing to a button should not trigger its click\n * (`tabbedOut` is set on `@keydown.tab`).\n *\n * Programmatic focus moves also do not replay. On first navigation into a\n * draft operation, `usePathMasking` focuses and clears the address bar while\n * `ScalarSidebarNestedItems` focuses the drilled-in Back button in\n * `nextTick`. That steals focus from CodeMirror, fires blur with a\n * `relatedTarget` (the Back button), and without a guard we would treat it\n * like a user click: capture the selector, then `refocusBlurTarget` would\n * synthesize `.click()` on Back and navigate away.\n *\n * `FocusEvent.sourceCapabilities` is null when no input device caused the\n * focus change (e.g. `element.focus()`). A real pointer click sets it on the\n * blur that precedes the click, so we still replay Send and other buttons.\n */\nconst handlePathBlur = (newPath: string, event: FocusEvent): void => {\n const relatedTarget = event.relatedTarget as Element | null\n const blurTargetSelector =\n tabbedOut.value ||\n ('sourceCapabilities' in event && event.sourceCapabilities === null)\n ? null\n : getSelector(relatedTarget)\n tabbedOut.value = false\n\n emitPathMethodUpdate(\n methodConflict.value ?? method,\n newPath,\n blurTargetSelector,\n )\n}\n\n/** Save the path on Enter and trigger the Send button after the update resolves */\nconst handlePathSubmit = (\n newPath: string,\n event: KeyboardEvent | FocusEvent,\n): void => {\n // Prevent the global hotkey listener from also handling this Enter press\n event.stopPropagation()\n\n emitPathMethodUpdate(\n methodConflict.value ?? method,\n newPath,\n '[data-addressbar-action=\"send\"]',\n )\n}\n\n/** Unset the server when backspace is pressed on an empty path */\nconst handlePathBackspace = (event: KeyboardEvent): void => {\n if ((event.target as HTMLElement)?.innerText === '\\n') {\n eventBus.emit('server:update:selected', { url: '', meta: serverMeta })\n }\n}\n\n/** Address bar copy is handled in OperationBlock (same URL as Send). */\nconst requestCopyUrl = (): void => {\n eventBus.emit('copy-url:address-bar')\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Navigation\n// ───────────────────────────────────────────────────────────────────\n\nconst navigateToServersPage = (): void => {\n if (serverMeta.type === 'operation') {\n eventBus.emit('ui:navigate', {\n page: 'operation',\n path: 'servers',\n operationPath: serverMeta.path,\n method: serverMeta.method,\n })\n return\n }\n\n eventBus.emit('ui:navigate', { page: 'document', path: 'servers' })\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Lifecycle\n// ───────────────────────────────────────────────────────────────────\n\nconst unsubscribes: Array<() => void> = []\n\nonMounted(() => {\n unsubscribes.push(\n eventBus.on('ui:focus:address-bar', handleFocusAddressBar),\n eventBus.on('ui:focus:send-button', handleFocusSendButton),\n eventBus.on('hooks:on:request:sent', startLoading),\n eventBus.on('hooks:on:request:complete', stopLoading),\n )\n})\n\nonBeforeUnmount(() => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe()\n }\n\n // Prevents the loading animation from continuing after unmount\n stopLoading()\n})\n\ndefineExpose({\n methodConflict,\n pathConflict,\n})\n</script>\n<template>\n <!--\n Address bar.\n\n The wide-container layout matches the original single-row bar:\n `[Method | URL | Copy | History | Send]`. When the surrounding\n `@container` drops below `@3xl` the bar collapses to\n `[URL | History]` and a second row appears beneath it with a\n duplicate `Method`, `Copy`, and `Send` so the URL gets the full\n container width while every action stays on the same line as the\n send button.\n -->\n <div\n class=\"order-last flex h-auto w-full max-w-3xl grow-3 flex-wrap items-stretch [--scalar-address-bar-height:32px] @3xl:order-0 @3xl:flex-nowrap\">\n <!-- Address Bar -->\n <div\n :id=\"id\"\n class=\"address-bar-bg-states text-xxs group relative flex h-(--scalar-address-bar-height) w-full flex-1 flex-row items-stretch rounded-lg p-0.75\"\n :class=\"{\n 'outline-c-danger outline': hasConflict,\n 'rounded-b-none': isDropdownOpen,\n }\">\n <div\n class=\"pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border\"\n :class=\"{\n 'rounded-b-none': isDropdownOpen,\n }\">\n <div\n class=\"absolute top-0 left-0 h-full w-full\"\n :style />\n </div>\n\n <!--\n Method, Copy, and Send are hidden in mobile mode (container\n narrower than `@3xl`) and the duplicate buttons in the trailing\n mobile actions row take over at that point.\n -->\n <div class=\"hidden @3xl:flex\">\n <HttpMethod\n :isEditable=\"layout !== 'modal'\"\n isSquare\n :method=\"methodConflict ?? method\"\n teleport\n @change=\"handleMethodChange\" />\n </div>\n\n <div\n class=\"scroll-timeline-x scroll-timeline-x-hidden relative flex w-full bg-blend-normal\">\n <!-- Servers -->\n <ServerDropdown\n v-if=\"servers.length\"\n :layout=\"layout\"\n :meta=\"serverMeta\"\n :server=\"server\"\n :servers=\"servers\"\n :target=\"id\"\n @update:open=\"(value) => (isServerDropdownOpen = value)\"\n @update:selectedServer=\"\n (payload) => eventBus.emit('server:update:selected', payload)\n \"\n @update:servers=\"navigateToServersPage\"\n @update:variable=\"\n (payload) => eventBus.emit('server:update:variables', payload)\n \" />\n\n <!-- Path + URL + env vars -->\n <CodeInput\n ref=\"addressBarRef\"\n alwaysEmitChange\n aria-label=\"Path\"\n class=\"ml-1 min-w-fit pl-px outline-none\"\n disableCloseBrackets\n :disabled=\"layout === 'modal'\"\n disableEnter\n disableTabIndent\n :emitOnBlur=\"false\"\n :environment=\"environment\"\n :extensions=\"[addressBarScrollMargins]\"\n importCurl\n :layout=\"layout\"\n :modelValue=\"path\"\n :placeholder=\"server ? '' : 'Enter a URL'\"\n server\n @blur=\"handlePathBlur\"\n @keydown.delete=\"handlePathBackspace\"\n @keydown.tab=\"tabbedOut = true\"\n @submit=\"handlePathSubmit\" />\n </div>\n\n <!-- Copy url button -->\n <ScalarButton\n class=\"hover:bg-b-3 mx-1 hidden @3xl:flex\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"requestCopyUrl\">\n <ScalarIconCopy />\n <span class=\"sr-only\">Copy URL</span>\n </ScalarButton>\n\n <AddressBarHistory\n :history=\"history\"\n :target=\"id\"\n @select:history:item=\"(payload) => emit('select:history:item', payload)\"\n @update:open=\"(value) => (isHistoryDropdownOpen = value)\" />\n <!-- Error message -->\n <div\n v-if=\"hasConflict\"\n class=\"z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6\">\n <div\n class=\"text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1\">\n <ScalarIconWarningCircle size=\"sm\" />\n <div class=\"min-w-0 flex-1\">\n A\n <em>{{ methodConflict?.toUpperCase() ?? method.toUpperCase() }}</em>\n request to\n <ScalarWrappingText :text=\"pathConflict ?? path\" />\n already exists in this document\n </div>\n </div>\n </div>\n\n <ScalarButton\n ref=\"sendButtonRef\"\n class=\"relative hidden h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold @3xl:flex\"\n data-addressbar-action=\"send\"\n :disabled=\"isLoading\"\n @click=\"emit('execute')\">\n <span\n aria-hidden=\"true\"\n class=\"inline-flex items-center gap-1\">\n <ScalarIcon\n class=\"relative shrink-0 fill-current\"\n icon=\"Play\"\n size=\"xs\" />\n <span class=\"text-xxs flex\">Send</span>\n </span>\n <span class=\"sr-only\">\n Send {{ method }} request to {{ server?.url ?? '' }}{{ path }}\n </span>\n </ScalarButton>\n </div>\n\n <!--\n Mobile actions row. Visible by default and hidden once the\n container reaches `@3xl`, where the duplicate Method / Copy /\n Send buttons move back into the bar itself.\n -->\n <div\n class=\"mt-2 flex h-(--scalar-address-bar-height) w-full items-stretch gap-1 @3xl:hidden\">\n <HttpMethod\n :isEditable=\"layout !== 'modal'\"\n isSquare\n :method=\"methodConflict ?? method\"\n teleport\n @change=\"handleMethodChange\" />\n <ScalarButton\n class=\"hover:bg-b-3 ml-auto\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"requestCopyUrl\">\n <ScalarIconCopy />\n <span class=\"sr-only\">Copy URL</span>\n </ScalarButton>\n <ScalarButton\n ref=\"mobileSendButtonRef\"\n class=\"relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold\"\n data-addressbar-action=\"send\"\n :disabled=\"isLoading\"\n @click=\"emit('execute')\">\n <span\n aria-hidden=\"true\"\n class=\"inline-flex items-center gap-1\">\n <ScalarIcon\n class=\"relative shrink-0 fill-current\"\n icon=\"Play\"\n size=\"xs\" />\n <span class=\"text-xxs\">Send</span>\n </span>\n <span class=\"sr-only\">\n Send {{ method }} request to {{ server?.url ?? '' }}{{ path }}\n </span>\n </ScalarButton>\n </div>\n </div>\n</template>\n<style scoped>\n:deep(.cm-editor) {\n height: 100%;\n outline: none;\n width: 100%;\n}\n:deep(.cm-line) {\n padding: 0;\n}\n:deep(.cm-content) {\n padding: 0;\n display: flex;\n align-items: center;\n font-size: var(--scalar-small);\n}\n.scroll-timeline-x {\n -ms-overflow-style: none;\n /* Fade the URL at the viewport edges. Mask lives on the scrollport (this\n element) rather than on `.cm-scroller`, whose width follows the URL's\n full content and pushes the right edge off-screen when overflowing. */\n mask-image: linear-gradient(\n to right,\n transparent 0,\n black 6px,\n black calc(100% - 24px),\n transparent 100%\n );\n}\n.scroll-timeline-x-hidden {\n overflow-x: auto;\n}\n.scroll-timeline-x-hidden :deep(.cm-scroller) {\n scrollbar-width: none;\n -ms-overflow-style: none;\n padding-right: 20px;\n overflow: auto;\n}\n.scroll-timeline-x-hidden::-webkit-scrollbar {\n width: 0;\n height: 0;\n display: none;\n}\n.scroll-timeline-x-hidden :deep(.cm-scroller::-webkit-scrollbar) {\n width: 0;\n height: 0;\n display: none;\n}\n.scroll-timeline-x-address {\n line-height: 27px;\n scrollbar-width: none; /* Firefox */\n}\n/* make clickable are to left of send button */\n.scroll-timeline-x-address:after {\n content: '';\n position: absolute;\n height: 100%;\n width: 24px;\n right: 0;\n cursor: text;\n}\n.scroll-timeline-x-address:empty:before {\n content: 'Enter URL or cURL request';\n color: var(--scalar-color-3);\n pointer-events: none;\n}\n\n.address-bar-bg-states {\n --scalar-address-bar-bg: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n background: var(--scalar-address-bar-bg);\n}\n.address-bar-bg-states:has(.cm-focused) {\n --scalar-address-bar-bg: var(--scalar-background-1);\n border-color: var(--scalar-border-color);\n outline-width: 1px;\n outline-style: solid;\n}\n.address-bar-bg-states:has(.cm-focused) .fade-left,\n.address-bar-bg-states:has(.cm-focused) .fade-right {\n --scalar-address-bar-bg: var(--scalar-background-1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOE,MAAM;;;;;;;;;;;;;;;;EAgFR,MAAM,OAAO;EAWb,MAAM,KAAK,OAAM;EACjB,MAAM,gBAAgB,eAAe,gBAAe;EACpD,MAAM,sBAAsB,eAAe,sBAAqB;EAChE,MAAM,gBAAgB,eAAe,gBAAe;EAEpD,MAAM,EAAE,YAAY,cAAc,aAAa,cAC7C,qBAAoB;EAEtB,MAAM,eAAe,IAAmB,KAAI;EAC5C,MAAM,iBAAiB,IAA2B,KAAI;EACtD,MAAM,YAAY,IAAI,MAAK;EAC3B,MAAM,uBAAuB,IAAI,MAAK;EACtC,MAAM,wBAAwB,IAAI,MAAK;;EAOvC,MAAM,0BAA0B,WAAW,cAAc,UAAU,EACjE,OAAO,IACR,EAAC;;EAGF,MAAM,QAAQ,gBAAgB;GAC5B,iBAAiB,uCAAuC,gBAAgB,QAAA,QAAQ,SAAS;GACzF,WAAW,gBAAgB,WAAW,MAAM;GAC7C,EAAC;;EAGF,MAAM,cAAc,eAAe,eAAe,SAAS,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CAAA,EAAA,OAAA,QAAA,OAAA,MAClB,mBAAqC,QAAA,EAA/B,OAAM,WAAS,EAAC,YAAQ,GAAA,EAAA,CAAA;;;IAEhC,YAkBe,MAAA,aAAA,EAAA;cAjBT;KAAJ,KAAI;KACJ,OAAM;KACN,0BAAuB;KACtB,UAAU,MAAA,UAAS;KACnB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,UAAA;;4BASL,CARP,mBAQO,QARP,aAQO,CALL,YAGc,MAAA,WAAA,EAAA;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;qCACP,mBAAkC,QAAA,EAA5B,OAAM,YAAU,EAAC,QAAI,GAAA,EAAA,CAAA,EAE7B,mBAEO,QAFP,aAAsB,WACf,gBAAG,QAAA,OAAM,GAAG,iBAAY,gBAAG,QAAA,QAAQ,OAAG,GAAA,GAAA,gBAAY,QAAA,KAAI,EAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"AddressBar.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * AddressBar component\n * This component is used to display the address bar for the operation block\n * It is used to display the path, method, server, and history for the operation\n */\nexport default {\n name: 'AddressBar',\n}\nexport type AddressBarProps = {\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** Openapi document slug */\n documentSlug: string\n /** Currently selected example key for the current operation */\n exampleKey: string\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 /** Client layout */\n layout: ClientLayout\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport { getSelector } from '@scalar/helpers/dom/get-selector'\nimport { REQUEST_METHODS } from '@scalar/helpers/http/http-info'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { extractServerFromPath } from '@scalar/helpers/url/extract-server-from-path'\nimport { ScalarIconCopy, ScalarIconWarningCircle } from '@scalar/icons'\nimport { EditorView } from '@scalar/use-codemirror'\nimport type {\n ApiReferenceEvents,\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.1/strict/openapi-document'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { HttpMethod } from '@/components/HttpMethod'\nimport { getOperationExampleKey } from '@/v2/blocks/operation-block/helpers/response-cache'\nimport { isPlaceholderPath } from '@/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path'\nimport { refocusBlurTarget } from '@/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target'\nimport { useLoadingAnimation } from '@/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation'\nimport { usePathMasking } from '@/v2/blocks/scalar-address-bar-block/hooks/use-path-masking'\nimport { CodeInput } from '@/v2/components/code-input'\nimport { ServerDropdown } from '@/v2/components/server'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport AddressBarHistory, { type History } from './AddressBarHistory.vue'\n\nconst {\n path,\n method,\n layout,\n eventBus,\n exampleKey,\n documentSlug,\n server,\n servers,\n environment,\n serverMeta,\n} = defineProps<AddressBarProps>()\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}>()\n\n// ───────────────────────────────────────────────────────────────────\n// Template refs & reactive state\n// ───────────────────────────────────────────────────────────────────\n\nconst id = useId()\nconst sendButtonRef = useTemplateRef('sendButtonRef')\nconst mobileSendButtonRef = useTemplateRef('mobileSendButtonRef')\nconst addressBarRef = useTemplateRef('addressBarRef')\n\nconst { percentage, startLoading, stopLoading, isLoading } =\n useLoadingAnimation()\n\nconst pathConflict = ref<string | null>(null)\nconst methodConflict = ref<HttpMethodType | null>(null)\nconst tabbedOut = ref(false)\nconst isServerDropdownOpen = ref(false)\nconst isHistoryDropdownOpen = ref(false)\n\n// ───────────────────────────────────────────────────────────────────\n// Derived state\n// ───────────────────────────────────────────────────────────────────\n\n/** Keeps the cursor visible past the fade-right overlay while typing */\nconst addressBarScrollMargins = EditorView.scrollMargins.of(() => ({\n right: 24,\n}))\n\n/** Animated background transform for the loading indicator */\nconst style = computed(() => ({\n backgroundColor: `color-mix(in srgb, transparent 90%, ${REQUEST_METHODS[method].colorVar})`,\n transform: `translate3d(-${percentage.value}%,0,0)`,\n}))\n\n/** Whether there is a path or method conflict */\nconst hasConflict = computed(() => methodConflict.value || pathConflict.value)\n\n/** Whether either dropdown (server or history) is open */\nconst isDropdownOpen = computed(\n () => isServerDropdownOpen.value || isHistoryDropdownOpen.value,\n)\n\n/** Uniquely identifies the currently selected operation + example */\nconst uniqueKey = computed(() =>\n getOperationExampleKey(method, path, exampleKey, documentSlug),\n)\n\n/** Clear conflict state when switching to a different operation */\nwatch(uniqueKey, () => {\n pathConflict.value = null\n methodConflict.value = null\n})\n\n// ───────────────────────────────────────────────────────────────────\n// Focus helpers\n// ───────────────────────────────────────────────────────────────────\n\nconst handleFocusSendButton = (): void => {\n const desktop = sendButtonRef.value?.$el\n const mobile = mobileSendButtonRef.value?.$el\n\n // Focus whichever send button is currently visible\n if (desktop && desktop.offsetParent !== null) {\n desktop.focus()\n } else {\n mobile?.focus()\n }\n}\n\nconst handleFocusAddressBar = (\n payload: ApiReferenceEvents['ui:focus:address-bar'],\n): void => {\n // On non-desktop layouts, if already focused we let the browser handle the\n // native behavior (e.g. selecting the browser's own address bar).\n if (addressBarRef.value?.isFocused && layout !== 'desktop') {\n return\n }\n\n addressBarRef.value?.focus('end')\n\n if (payload && 'clear' in payload && payload.clear) {\n addressBarRef.value?.setCodeMirrorContent('')\n }\n\n if (payload && 'event' in payload) {\n payload.event.preventDefault()\n }\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Path masking\n//\n// Drafts on `/` and auto-generated `/_scalar_temp...` paths are internal\n// placeholders — the address bar focuses and clears on mount and on\n// navigation so the user sees a blank prompt instead of the internal\n// path. The deferred mask only clears when CodeMirror still contains that\n// placeholder path, so a user edit that lands before the frame is preserved.\n// ───────────────────────────────────────────────────────────────────\n\nusePathMasking({\n isReady: () => addressBarRef.value?.codeMirror,\n operationKey: () => uniqueKey.value,\n shouldMask: () => isPlaceholderPath(path, documentSlug),\n // Defer to the next frame so focus() runs after click-handler side\n // effects that move focus (e.g. a dropdown refocusing its trigger),\n // which would otherwise blur our input and emit a spurious path\n // update against the now-empty value.\n onMask: () =>\n requestAnimationFrame(() => {\n const editorContent =\n addressBarRef.value?.codeMirror?.state.doc.toString()\n\n if (editorContent && editorContent !== path) {\n return\n }\n\n handleFocusAddressBar({ clear: true })\n }),\n})\n\n// ───────────────────────────────────────────────────────────────────\n// Server extraction\n// ───────────────────────────────────────────────────────────────────\n\n/** If the path contains a server URL, extract it and select or add that server */\nconst extractAndSelectServer = (targetPath: string): string => {\n const extracted = extractServerFromPath(targetPath)\n if (!extracted) {\n return targetPath\n }\n\n const [url, remainingPath] = extracted\n\n // Server is already selected — nothing to do\n if (url === server?.url) {\n return remainingPath\n }\n\n const matchingServer = servers.find((s) => s.url === url)\n if (matchingServer) {\n eventBus.emit('server:update:selected', { url, meta: serverMeta })\n } else {\n eventBus.emit('server:add:server', {\n url,\n select: true,\n meta: { type: 'operation', path, method },\n })\n }\n\n return remainingPath\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Path / method updates\n// ───────────────────────────────────────────────────────────────────\n\nconst normalizePath = (value: string): string =>\n value.startsWith('/') ? value : `/${value}`\n\n/** Emit a path/method update and reconcile conflicts + cursor state on the result */\nconst emitPathMethodUpdate = (\n targetMethod: HttpMethodType,\n targetPath: string,\n blurTargetSelector: string | null = null,\n): void => {\n const extractedPath = extractAndSelectServer(targetPath)\n const normalizedPath = normalizePath(extractedPath)\n\n // Keep CodeMirror in sync so a conflict does not leave a stale value on screen\n addressBarRef.value?.setCodeMirrorContent(normalizedPath)\n\n eventBus.emit('operation:update:pathMethod', {\n meta: { method, path },\n blurTargetSelector,\n payload: { method: targetMethod, path: normalizedPath },\n callback: (status, returnedSelector) => {\n if (status === 'success' || status === 'no-change') {\n methodConflict.value = null\n pathConflict.value = null\n } else if (status === 'conflict') {\n if (targetMethod !== method) {\n methodConflict.value = targetMethod\n }\n if (normalizedPath !== path) {\n pathConflict.value = normalizedPath\n }\n\n return\n }\n\n // Edge case: pasting a full URL extracts the server but leaves the path\n // unchanged. CodeMirror still shows the full URL, so force it back to\n // just the path.\n const mirrorContent = addressBarRef.value?.codeMirrorRef?.textContent\n if (\n status === 'no-change' &&\n mirrorContent &&\n mirrorContent !== extractedPath\n ) {\n addressBarRef.value?.setCodeMirrorContent(extractedPath)\n }\n\n nextTick(() => refocusBlurTarget(returnedSelector))\n },\n })\n}\n\n/** Change the operation's method, preferring the conflicting path if present */\nconst handleMethodChange = (newMethod: HttpMethodType): void =>\n emitPathMethodUpdate(newMethod, pathConflict.value ?? path)\n\n/**\n * Save the path on blur and replay the click that caused the blur (so e.g. a\n * click on the Send button still fires after the async update resolves).\n *\n * Tab-outs do not replay — tabbing to a button should not trigger its click\n * (`tabbedOut` is set on `@keydown.tab`).\n *\n * Programmatic focus moves also do not replay. On first navigation into a\n * draft operation, `usePathMasking` focuses and clears the address bar while\n * `ScalarSidebarNestedItems` focuses the drilled-in Back button in\n * `nextTick`. That steals focus from CodeMirror, fires blur with a\n * `relatedTarget` (the Back button), and without a guard we would treat it\n * like a user click: capture the selector, then `refocusBlurTarget` would\n * synthesize `.click()` on Back and navigate away.\n *\n * `FocusEvent.sourceCapabilities` is null when no input device caused the\n * focus change (e.g. `element.focus()`). A real pointer click sets it on the\n * blur that precedes the click, so we still replay Send and other buttons.\n */\nconst handlePathBlur = (newPath: string, event: FocusEvent): void => {\n const relatedTarget = event.relatedTarget as Element | null\n const blurTargetSelector =\n tabbedOut.value ||\n ('sourceCapabilities' in event && event.sourceCapabilities === null)\n ? null\n : getSelector(relatedTarget)\n tabbedOut.value = false\n\n emitPathMethodUpdate(\n methodConflict.value ?? method,\n newPath,\n blurTargetSelector,\n )\n}\n\n/** Save the path on Enter and trigger the Send button after the update resolves */\nconst handlePathSubmit = (\n newPath: string,\n event: KeyboardEvent | FocusEvent,\n): void => {\n // Prevent the global hotkey listener from also handling this Enter press\n event.stopPropagation()\n\n emitPathMethodUpdate(\n methodConflict.value ?? method,\n newPath,\n '[data-addressbar-action=\"send\"]',\n )\n}\n\n/** Unset the server when backspace is pressed on an empty path */\nconst handlePathBackspace = (event: KeyboardEvent): void => {\n if ((event.target as HTMLElement)?.innerText === '\\n') {\n eventBus.emit('server:update:selected', { url: '', meta: serverMeta })\n }\n}\n\n/** Address bar copy is handled in OperationBlock (same URL as Send). */\nconst requestCopyUrl = (): void => {\n eventBus.emit('copy-url:address-bar')\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Navigation\n// ───────────────────────────────────────────────────────────────────\n\nconst navigateToServersPage = (): void => {\n if (serverMeta.type === 'operation') {\n eventBus.emit('ui:navigate', {\n page: 'operation',\n path: 'servers',\n operationPath: serverMeta.path,\n method: serverMeta.method,\n })\n return\n }\n\n eventBus.emit('ui:navigate', { page: 'document', path: 'servers' })\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Lifecycle\n// ───────────────────────────────────────────────────────────────────\n\nconst unsubscribes: Array<() => void> = []\n\nonMounted(() => {\n unsubscribes.push(\n eventBus.on('ui:focus:address-bar', handleFocusAddressBar),\n eventBus.on('ui:focus:send-button', handleFocusSendButton),\n eventBus.on('hooks:on:request:sent', startLoading),\n eventBus.on('hooks:on:request:complete', stopLoading),\n )\n})\n\nonBeforeUnmount(() => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe()\n }\n\n // Prevents the loading animation from continuing after unmount\n stopLoading()\n})\n\ndefineExpose({\n methodConflict,\n pathConflict,\n})\n</script>\n<template>\n <!--\n Address bar.\n\n The wide-container layout matches the original single-row bar:\n `[Method | URL | Copy | History | Send]`. When the surrounding\n `@container` drops below `@3xl` the bar collapses to\n `[URL | History]` and a second row appears beneath it with a\n duplicate `Method`, `Copy`, and `Send` so the URL gets the full\n container width while every action stays on the same line as the\n send button.\n -->\n <div\n class=\"order-last flex h-auto w-full max-w-3xl grow-3 flex-wrap items-stretch [--scalar-address-bar-height:32px] @3xl:order-0 @3xl:flex-nowrap\">\n <!-- Address Bar -->\n <div\n :id=\"id\"\n class=\"address-bar-bg-states text-xxs group relative flex h-(--scalar-address-bar-height) w-full flex-1 flex-row items-stretch rounded-lg p-0.75\"\n :class=\"{\n 'outline-c-danger outline': hasConflict,\n 'rounded-b-none': isDropdownOpen,\n }\">\n <div\n class=\"pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border\"\n :class=\"{\n 'rounded-b-none': isDropdownOpen,\n }\">\n <div\n class=\"absolute top-0 left-0 h-full w-full\"\n :style />\n </div>\n\n <!--\n Method, Copy, and Send are hidden in mobile mode (container\n narrower than `@3xl`) and the duplicate buttons in the trailing\n mobile actions row take over at that point.\n -->\n <div class=\"hidden @3xl:flex\">\n <HttpMethod\n :isEditable=\"layout !== 'modal'\"\n isSquare\n :method=\"methodConflict ?? method\"\n teleport\n @change=\"handleMethodChange\" />\n </div>\n\n <div\n class=\"scroll-timeline-x scroll-timeline-x-hidden relative flex w-full bg-blend-normal\">\n <!-- Servers -->\n <ServerDropdown\n v-if=\"servers.length\"\n :layout=\"layout\"\n :meta=\"serverMeta\"\n :server=\"server\"\n :servers=\"servers\"\n :target=\"id\"\n @update:open=\"(value) => (isServerDropdownOpen = value)\"\n @update:selectedServer=\"\n (payload) => eventBus.emit('server:update:selected', payload)\n \"\n @update:servers=\"navigateToServersPage\"\n @update:variable=\"\n (payload) => eventBus.emit('server:update:variables', payload)\n \" />\n\n <!-- Path + URL + env vars -->\n <CodeInput\n ref=\"addressBarRef\"\n alwaysEmitChange\n aria-label=\"Path\"\n class=\"ml-1 min-w-fit pl-px outline-none\"\n disableCloseBrackets\n :disabled=\"layout === 'modal'\"\n disableEnter\n disableTabIndent\n :emitOnBlur=\"false\"\n :environment=\"environment\"\n :extensions=\"[addressBarScrollMargins]\"\n importCurl\n :layout=\"layout\"\n :modelValue=\"path\"\n :placeholder=\"server ? '' : 'Enter a URL'\"\n server\n @blur=\"handlePathBlur\"\n @keydown.delete=\"handlePathBackspace\"\n @keydown.tab=\"tabbedOut = true\"\n @submit=\"handlePathSubmit\" />\n </div>\n\n <!-- Copy url button -->\n <ScalarButton\n class=\"hover:bg-b-3 mx-1 hidden @3xl:flex\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"requestCopyUrl\">\n <ScalarIconCopy />\n <span class=\"sr-only\">Copy URL</span>\n </ScalarButton>\n\n <AddressBarHistory\n :history=\"history\"\n :target=\"id\"\n @select:history:item=\"(payload) => emit('select:history:item', payload)\"\n @update:open=\"(value) => (isHistoryDropdownOpen = value)\" />\n <!-- Error message -->\n <div\n v-if=\"hasConflict\"\n class=\"z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6\">\n <div\n class=\"text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1\">\n <ScalarIconWarningCircle size=\"sm\" />\n <div class=\"min-w-0 flex-1\">\n A\n <em>{{ methodConflict?.toUpperCase() ?? method.toUpperCase() }}</em>\n request to\n <ScalarWrappingText :text=\"pathConflict ?? path\" />\n already exists in this document\n </div>\n </div>\n </div>\n\n <ScalarButton\n ref=\"sendButtonRef\"\n class=\"relative hidden h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold @3xl:flex\"\n data-addressbar-action=\"send\"\n :disabled=\"isLoading\"\n @click=\"emit('execute')\">\n <span\n aria-hidden=\"true\"\n class=\"inline-flex items-center gap-1\">\n <ScalarIcon\n class=\"relative shrink-0 fill-current\"\n icon=\"Play\"\n size=\"xs\" />\n <span class=\"text-xxs flex\">Send</span>\n </span>\n <span class=\"sr-only\">\n Send {{ method }} request to {{ server?.url ?? '' }}{{ path }}\n </span>\n </ScalarButton>\n </div>\n\n <!--\n Mobile actions row. Visible by default and hidden once the\n container reaches `@3xl`, where the duplicate Method / Copy /\n Send buttons move back into the bar itself.\n -->\n <div\n class=\"mt-2 flex h-(--scalar-address-bar-height) w-full items-stretch gap-1 @3xl:hidden\">\n <HttpMethod\n :isEditable=\"layout !== 'modal'\"\n isSquare\n :method=\"methodConflict ?? method\"\n teleport\n @change=\"handleMethodChange\" />\n <ScalarButton\n class=\"hover:bg-b-3 ml-auto\"\n size=\"xs\"\n variant=\"ghost\"\n @click=\"requestCopyUrl\">\n <ScalarIconCopy />\n <span class=\"sr-only\">Copy URL</span>\n </ScalarButton>\n <ScalarButton\n ref=\"mobileSendButtonRef\"\n class=\"relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold\"\n data-addressbar-action=\"send\"\n :disabled=\"isLoading\"\n @click=\"emit('execute')\">\n <span\n aria-hidden=\"true\"\n class=\"inline-flex items-center gap-1\">\n <ScalarIcon\n class=\"relative shrink-0 fill-current\"\n icon=\"Play\"\n size=\"xs\" />\n <span class=\"text-xxs\">Send</span>\n </span>\n <span class=\"sr-only\">\n Send {{ method }} request to {{ server?.url ?? '' }}{{ path }}\n </span>\n </ScalarButton>\n </div>\n </div>\n</template>\n<style scoped>\n:deep(.cm-editor) {\n height: 100%;\n outline: none;\n width: 100%;\n}\n:deep(.cm-line) {\n padding: 0;\n}\n:deep(.cm-content) {\n padding: 0;\n display: flex;\n align-items: center;\n font-size: var(--scalar-small);\n}\n.scroll-timeline-x {\n -ms-overflow-style: none;\n /* Fade the URL at the viewport edges. Mask lives on the scrollport (this\n element) rather than on `.cm-scroller`, whose width follows the URL's\n full content and pushes the right edge off-screen when overflowing. */\n mask-image: linear-gradient(\n to right,\n transparent 0,\n black 6px,\n black calc(100% - 24px),\n transparent 100%\n );\n}\n.scroll-timeline-x-hidden {\n overflow-x: auto;\n}\n.scroll-timeline-x-hidden :deep(.cm-scroller) {\n scrollbar-width: none;\n -ms-overflow-style: none;\n padding-right: 20px;\n overflow: auto;\n}\n.scroll-timeline-x-hidden::-webkit-scrollbar {\n width: 0;\n height: 0;\n display: none;\n}\n.scroll-timeline-x-hidden :deep(.cm-scroller::-webkit-scrollbar) {\n width: 0;\n height: 0;\n display: none;\n}\n.scroll-timeline-x-address {\n line-height: 27px;\n scrollbar-width: none; /* Firefox */\n}\n/* make clickable are to left of send button */\n.scroll-timeline-x-address:after {\n content: '';\n position: absolute;\n height: 100%;\n width: 24px;\n right: 0;\n cursor: text;\n}\n.scroll-timeline-x-address:empty:before {\n content: 'Enter URL or cURL request';\n color: var(--scalar-color-3);\n pointer-events: none;\n}\n\n.address-bar-bg-states {\n --scalar-address-bar-bg: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-background-2)\n );\n background: var(--scalar-address-bar-bg);\n}\n.address-bar-bg-states:has(.cm-focused) {\n --scalar-address-bar-bg: var(--scalar-background-1);\n border-color: var(--scalar-border-color);\n outline-width: 1px;\n outline-style: solid;\n}\n.address-bar-bg-states:has(.cm-focused) .fade-left,\n.address-bar-bg-states:has(.cm-focused) .fade-right {\n --scalar-address-bar-bg: var(--scalar-background-1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOE,MAAM;;;;;;;;;;;;;;;;EAgFR,MAAM,OAAO;EAWb,MAAM,KAAK,MAAM;EACjB,MAAM,gBAAgB,eAAe,eAAe;EACpD,MAAM,sBAAsB,eAAe,qBAAqB;EAChE,MAAM,gBAAgB,eAAe,eAAe;EAEpD,MAAM,EAAE,YAAY,cAAc,aAAa,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AA,EAAjC,OAAM,gBAAe,GAAC,QAAI,EAAA,EAAA,CAAA,GAElC,mBAEO,QAFP,YAAsB,WACf,gBAAG,QAAA,MAAM,IAAG,iBAAY,gBAAG,QAAA,QAAQ,OAAG,EAAA,IAAA,gBAAY,QAAA,IAAI,GAAA,CAAA,CAAA,CAAA;;;uBAUjE,mBAmCM,OAnCN,aAmCM;IAjCJ,YAKiC,MAAA,kBAAA,GAAA;KAJ9B,YAAY,QAAA,WAAM;KACnB,UAAA;KACC,QAAQ,eAAA,SAAkB,QAAA;KAC3B,UAAA;KACC,UAAQ;;IACX,YAOe,MAAA,YAAA,GAAA;KANb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAO;;4BACU,CAAlB,YAAkB,MAAA,cAAA,CAAA,GAAA,OAAA,QAAA,OAAA,MAClB,mBAAqC,QAAA,EAA/B,OAAM,UAAS,GAAC,YAAQ,EAAA,EAAA,CAAA;;;IAEhC,YAkBe,MAAA,YAAA,GAAA;cAjBT;KAAJ,KAAI;KACJ,OAAM;KACN,0BAAuB;KACtB,UAAU,MAAA,SAAA;KACV,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,SAAA;;4BASL,CARP,mBAQO,QARP,aAQO,CALL,YAGc,MAAA,UAAA,GAAA;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;qCACP,mBAAkC,QAAA,EAA5B,OAAM,WAAU,GAAC,QAAI,EAAA,EAAA,CAAA,GAE7B,mBAEO,QAFP,aAAsB,WACf,gBAAG,QAAA,MAAM,IAAG,iBAAY,gBAAG,QAAA,QAAQ,OAAG,EAAA,IAAA,gBAAY,QAAA,IAAI,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue"],"names":[],"mappings":"AAqHA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAQrF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,OAAO,EAAE,OAAO,EAAE,CAAA;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue"],"names":[],"mappings":"AAqHA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAQrF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,OAAO,EAAE,OAAO,EAAE,CAAA;CACnB,CAAC;AA4RF,QAAA,MAAM,YAAY;;;eAtR6B,MAAM;;;;;eAAN,MAAM;;kFAyRnD,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
|
|
|
2
2
|
import AddressBarHistory_vue_vue_type_script_setup_true_lang_default from "./AddressBarHistory.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue
|
|
5
|
-
var AddressBarHistory_default =
|
|
5
|
+
var AddressBarHistory_default = /*#__PURE__*/ _plugin_vue_export_helper_default(AddressBarHistory_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-12140f4f"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AddressBarHistory_default as default };
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ import { formatMilliseconds } from "@scalar/helpers/formatters/format-millisecon
|
|
|
10
10
|
//#region src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var _hoisted_1 = { class: "min-w-0" };
|
|
12
12
|
var _hoisted_2 = { class: "text-c-1 min-w-0 truncate" };
|
|
13
|
-
var AddressBarHistory_vue_vue_type_script_setup_true_lang_default =
|
|
13
|
+
var AddressBarHistory_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
14
|
__name: "AddressBarHistory",
|
|
15
15
|
props: {
|
|
16
16
|
target: {},
|
package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarHistory.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'\nimport {\n ScalarFloating,\n ScalarFloatingBackdrop,\n} from '@scalar/components/floating'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { formatMilliseconds } from '@scalar/helpers/formatters/format-milliseconds'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { httpStatusCodes } from '@scalar/helpers/http/http-status-codes'\n\nimport { HttpMethod } from '@/components/HttpMethod'\nimport ValueEmitter from '@/v2/components/layout/ValueEmitter.vue'\n\nimport { getStatusCodeColor } from './httpStatusCodeColors'\n\nexport type History = {\n method: HttpMethodType\n path: string\n duration: number\n status: number\n}\n\nconst { target } = defineProps<{\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n /** List of all request history items */\n history: History[]\n}>()\n\nconst emits = defineEmits<{\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Update the open state of the history popover */\n (e: 'update:open', value: boolean): void\n}>()\n</script>\n<template>\n <Menu\n v-slot=\"{ open }\"\n as=\"div\">\n <!-- Emit the slot value back out the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emits('update:open', value)\"\n @unmount=\"emits('update:open', false)\" />\n\n <ScalarFloating\n :offset=\"0\"\n resize\n :target=\"target\">\n <!-- History -->\n <MenuButton\n v-if=\"history.length\"\n class=\"address-bar-history-button text-c-3 focus:text-c-1 relative mr-1 rounded-lg p-1.5\">\n <ScalarIcon\n icon=\"History\"\n size=\"sm\"\n thickness=\"2.25\" />\n <span class=\"sr-only\">Request History</span>\n </MenuButton>\n <!-- History shadow and placement-->\n <template\n v-if=\"open\"\n #floating=\"{ width }\">\n <!-- History Item -->\n <MenuItems\n class=\"custom-scroll grid max-h-[inherit] grid-cols-[44px_1fr_repeat(3,auto)] items-center p-0.75\"\n static\n :style=\"{ width }\">\n <MenuItem\n v-for=\"(entry, index) in history\"\n :key=\"index\"\n as=\"button\"\n class=\"font-code ui-active:*:bg-b-2 text-c-2 contents text-sm font-medium *:flex *:h-8 *:cursor-pointer *:items-center *:rounded-none *:px-1.5 *:first:rounded-l *:last:rounded-r\"\n :value=\"index\"\n @click=\"emits('select:history:item', { index })\">\n <HttpMethod\n class=\"text-[11px]\"\n :method=\"entry.method\" />\n <div class=\"min-w-0\">\n <div class=\"text-c-1 min-w-0 truncate\">\n {{ entry.path }}\n </div>\n </div>\n <div>{{ formatMilliseconds(entry.duration) }}</div>\n <div :class=\"[getStatusCodeColor(entry.status).color]\">\n {{ entry.status }}\n </div>\n <div>\n {{ httpStatusCodes[entry.status]?.name }}\n </div>\n </MenuItem>\n </MenuItems>\n <ScalarFloatingBackdrop class=\"inset-x-px rounded-none rounded-b-lg\" />\n </template>\n </ScalarFloating>\n </Menu>\n</template>\n<style scoped>\n.address-bar-history-button:hover {\n background: var(--scalar-background-3);\n}\n.address-bar-history-button:focus-within {\n background: var(--scalar-background-2);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,QAAQ;;uBAQZ,YA2DO,MAAA,
|
|
1
|
+
{"version":3,"file":"AddressBarHistory.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'\nimport {\n ScalarFloating,\n ScalarFloatingBackdrop,\n} from '@scalar/components/floating'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { formatMilliseconds } from '@scalar/helpers/formatters/format-milliseconds'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { httpStatusCodes } from '@scalar/helpers/http/http-status-codes'\n\nimport { HttpMethod } from '@/components/HttpMethod'\nimport ValueEmitter from '@/v2/components/layout/ValueEmitter.vue'\n\nimport { getStatusCodeColor } from './httpStatusCodeColors'\n\nexport type History = {\n method: HttpMethodType\n path: string\n duration: number\n status: number\n}\n\nconst { target } = defineProps<{\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n /** List of all request history items */\n history: History[]\n}>()\n\nconst emits = defineEmits<{\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Update the open state of the history popover */\n (e: 'update:open', value: boolean): void\n}>()\n</script>\n<template>\n <Menu\n v-slot=\"{ open }\"\n as=\"div\">\n <!-- Emit the slot value back out the parent -->\n <ValueEmitter\n :value=\"open\"\n @change=\"(value) => emits('update:open', value)\"\n @unmount=\"emits('update:open', false)\" />\n\n <ScalarFloating\n :offset=\"0\"\n resize\n :target=\"target\">\n <!-- History -->\n <MenuButton\n v-if=\"history.length\"\n class=\"address-bar-history-button text-c-3 focus:text-c-1 relative mr-1 rounded-lg p-1.5\">\n <ScalarIcon\n icon=\"History\"\n size=\"sm\"\n thickness=\"2.25\" />\n <span class=\"sr-only\">Request History</span>\n </MenuButton>\n <!-- History shadow and placement-->\n <template\n v-if=\"open\"\n #floating=\"{ width }\">\n <!-- History Item -->\n <MenuItems\n class=\"custom-scroll grid max-h-[inherit] grid-cols-[44px_1fr_repeat(3,auto)] items-center p-0.75\"\n static\n :style=\"{ width }\">\n <MenuItem\n v-for=\"(entry, index) in history\"\n :key=\"index\"\n as=\"button\"\n class=\"font-code ui-active:*:bg-b-2 text-c-2 contents text-sm font-medium *:flex *:h-8 *:cursor-pointer *:items-center *:rounded-none *:px-1.5 *:first:rounded-l *:last:rounded-r\"\n :value=\"index\"\n @click=\"emits('select:history:item', { index })\">\n <HttpMethod\n class=\"text-[11px]\"\n :method=\"entry.method\" />\n <div class=\"min-w-0\">\n <div class=\"text-c-1 min-w-0 truncate\">\n {{ entry.path }}\n </div>\n </div>\n <div>{{ formatMilliseconds(entry.duration) }}</div>\n <div :class=\"[getStatusCodeColor(entry.status).color]\">\n {{ entry.status }}\n </div>\n <div>\n {{ httpStatusCodes[entry.status]?.name }}\n </div>\n </MenuItem>\n </MenuItems>\n <ScalarFloatingBackdrop class=\"inset-x-px rounded-none rounded-b-lg\" />\n </template>\n </ScalarFloating>\n </Menu>\n</template>\n<style scoped>\n.address-bar-history-button:hover {\n background: var(--scalar-background-3);\n}\n.address-bar-history-button:focus-within {\n background: var(--scalar-background-2);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,QAAQ;;uBAQZ,YA2DO,MAAA,IAAA,GAAA,EAzDL,IAAG,MAAK,GAAA;sBAKmC,EANjC,WAAI,CAGd,YAG2C,sBAAA;KAFxC,OAAO;KACP,UAAM,OAAA,OAAA,OAAA,MAAG,UAAU,MAAK,eAAgB,KAAK;KAC7C,WAAO,OAAA,OAAA,OAAA,MAAA,WAAE,MAAK,eAAA,KAAA;4BAEjB,YAiDiB,MAAA,cAAA,GAAA;KAhDd,QAAQ;KACT,QAAA;KACC,QAAQ,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d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAmOA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAmOA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAmhBF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js
CHANGED
|
@@ -15,7 +15,7 @@ var _hoisted_9 = {
|
|
|
15
15
|
key: 5,
|
|
16
16
|
class: "text-c-3 px-2 py-1.5 text-xs"
|
|
17
17
|
};
|
|
18
|
-
var EnvironmentSelector_vue_vue_type_script_setup_true_lang_default =
|
|
18
|
+
var EnvironmentSelector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
19
19
|
__name: "EnvironmentSelector",
|
|
20
20
|
props: {
|
|
21
21
|
environments: { default: () => [] },
|
package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentSelector.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport {\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n} from '@scalar/components/dropdown'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed } from 'vue'\n\nconst { environments = [], activeEnvironment } = defineProps<{\n /** List of available environments */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an environment is selected */\n (e: 'select:environment', environmentName: string): void\n /** Emitted when user wants to add a new environment */\n (e: 'add:environment'): void\n}>()\n\n/** Whether an environment is currently active */\nconst hasActiveEnvironment = computed(() => !!activeEnvironment)\n\n/** Whether environments exist */\nconst hasEnvironments = computed(() => environments.length > 0)\n\n/** Whether the currently selected environment exists in the dropdown options */\nconst hasSelectedEnvironmentInOptions = computed(() => {\n if (!activeEnvironment) {\n return false\n }\n\n return environments.includes(activeEnvironment)\n})\n\n/** True when an environment is selected but unavailable in the current context */\nconst hasMissingActiveEnvironment = computed(\n () => hasActiveEnvironment.value && !hasSelectedEnvironmentInOptions.value,\n)\n\n/** Display text for the button */\nconst displayText = computed(() => {\n if (hasMissingActiveEnvironment.value) {\n return `${activeEnvironment} (Unavailable)`\n }\n\n if (hasActiveEnvironment.value) {\n return activeEnvironment\n }\n if (!hasEnvironments.value) {\n return 'Add Environment'\n }\n return 'Select Environment'\n})\n\n/** Button styling based on state */\nconst buttonClass = computed(() => {\n if (hasMissingActiveEnvironment.value) {\n return 'hover:bg-b-2 text-c-2 border-transparent'\n }\n\n if (hasActiveEnvironment.value) {\n return 'bg-c-accent/10 text-c-accent hover:bg-c-accent/20 border-c-accent/30'\n }\n if (!hasEnvironments.value) {\n return 'hover:bg-b-2 text-c-3 border-transparent'\n }\n return 'hover:bg-b-2 text-c-2 border-transparent'\n})\n\nconst handleAddEnvironment = () => {\n emit('add:environment')\n}\n\nconst handleSelectEnvironment = (environmentName: string) => {\n emit('select:environment', environmentName)\n}\n</script>\n\n<template>\n <div class=\"relative flex items-center\">\n <!-- Environment indicator badge (only show when active) -->\n\n <ScalarDropdown>\n <ScalarButton\n :aria-label=\"`Current environment: ${displayText}`\"\n class=\"line-clamp-1 h-full w-fit justify-start border px-2 py-1 font-normal transition-colors\"\n :class=\"buttonClass\"\n size=\"sm\"\n variant=\"ghost\">\n <div class=\"flex max-w-[220px] min-w-0 items-center gap-1.5\">\n <!-- Icon indicator -->\n <ScalarIcon\n class=\"shrink-0\"\n :class=\"\n hasActiveEnvironment && !hasMissingActiveEnvironment\n ? 'text-c-accent'\n : 'text-c-3'\n \"\n icon=\"Globe\"\n size=\"sm\" />\n\n <!-- Environment name -->\n <span\n class=\"text-xxs block max-w-[160px] min-w-0 truncate text-left font-medium\">\n {{ displayText }}\n </span>\n\n <!-- Dropdown arrow -->\n <ScalarIcon\n class=\"shrink-0\"\n icon=\"ChevronDown\"\n size=\"xs\" />\n </div>\n </ScalarButton>\n\n <template #items>\n <!-- No environment option (clear selection) -->\n <ScalarDropdownItem\n v-if=\"hasActiveEnvironment\"\n class=\"group/item flex w-full items-center gap-1.5\"\n @click=\"handleSelectEnvironment('')\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n !activeEnvironment\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"text-c-2\">No Environment</span>\n </ScalarDropdownItem>\n\n <ScalarDropdownDivider v-if=\"hasActiveEnvironment && hasEnvironments\" />\n\n <!-- Environment list -->\n <ScalarDropdownItem\n v-for=\"environmentName in environments\"\n :key=\"environmentName\"\n class=\"group/item flex w-full min-w-0 items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n @click=\"handleSelectEnvironment(environmentName)\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n activeEnvironment === environmentName\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"min-w-0 flex-1 truncate\">{{ environmentName }}</span>\n </ScalarDropdownItem>\n <ScalarDropdownDivider v-if=\"hasMissingActiveEnvironment\" />\n\n <ScalarDropdownItem\n v-if=\"hasMissingActiveEnvironment\"\n class=\"group/item flex h-auto w-full min-w-0 items-start gap-1.5 overflow-hidden\"\n disabled>\n <div\n class=\"bg-c-accent text-b-1 mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full p-[3px]\">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <div class=\"min-w-0 flex-1 text-left\">\n <span class=\"block truncate\">\n {{ activeEnvironment }}\n </span>\n <span class=\"text-c-3 block truncate text-xs\">\n Not available in this context\n </span>\n </div>\n </ScalarDropdownItem>\n\n <ScalarDropdownDivider v-if=\"hasEnvironments\" />\n\n <!-- Add new environment button -->\n <ScalarDropdownItem\n class=\"text-c-accent flex items-center gap-1.5\"\n @click=\"handleAddEnvironment\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>{{\n hasEnvironments ? 'New Environment' : 'Create Environment'\n }}</span>\n </ScalarDropdownItem>\n\n <!-- Helper text for empty state -->\n <div\n v-if=\"!hasEnvironments && !hasActiveEnvironment\"\n class=\"text-c-3 px-2 py-1.5 text-xs\">\n <p class=\"mb-1\">\n Environments let you manage variables like API keys and base URLs\n across different contexts.\n </p>\n </div>\n </template>\n </ScalarDropdown>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,OAAO;;EAQb,MAAM,uBAAuB,eAAe,CAAC,CAAC,QAAA,kBAAiB;;EAG/D,MAAM,kBAAkB,eAAe,QAAA,aAAa,SAAS,EAAC;;EAG9D,MAAM,kCAAkC,eAAe;AACrD,OAAI,CAAC,QAAA,kBACH,QAAO;AAGT,UAAO,QAAA,aAAa,SA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AA,EAHD,OAAM,QAAM,EAAC,kGAGhB,GAAA,CAAA,EAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;;2BA3FW,CA9Bf,YA8Be,MAAA,aAAA,EAAA;KA7BZ,cAAU,wBAA0B,YAAA;KACrC,OAAK,eAAA,CAAC,0FACE,YAAA,MAAW,CAAA;KACnB,MAAK;KACL,SAAQ;;4BAwBF,CAvBN,mBAuBM,OAvBN,YAuBM;MArBJ,YAQc,MAAA,WAAA,EAAA;OAPZ,OAAK,eAAA,CAAC,YACiB,qBAAA,SAAoB,CAAK,4BAAA,QAAA,kBAAA,WAAA,CAAA;OAKhD,MAAK;OACL,MAAK;;MAGP,mBAGO,QAHP,YAGO,gBADF,YAAA,MAAW,EAAA,EAAA;MAIhB,YAGc,MAAA,WAAA,EAAA;OAFZ,OAAM;OACN,MAAK;OACL,MAAK"}
|
|
1
|
+
{"version":3,"file":"EnvironmentSelector.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport {\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n} from '@scalar/components/dropdown'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed } from 'vue'\n\nconst { environments = [], activeEnvironment } = defineProps<{\n /** List of available environments */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when an environment is selected */\n (e: 'select:environment', environmentName: string): void\n /** Emitted when user wants to add a new environment */\n (e: 'add:environment'): void\n}>()\n\n/** Whether an environment is currently active */\nconst hasActiveEnvironment = computed(() => !!activeEnvironment)\n\n/** Whether environments exist */\nconst hasEnvironments = computed(() => environments.length > 0)\n\n/** Whether the currently selected environment exists in the dropdown options */\nconst hasSelectedEnvironmentInOptions = computed(() => {\n if (!activeEnvironment) {\n return false\n }\n\n return environments.includes(activeEnvironment)\n})\n\n/** True when an environment is selected but unavailable in the current context */\nconst hasMissingActiveEnvironment = computed(\n () => hasActiveEnvironment.value && !hasSelectedEnvironmentInOptions.value,\n)\n\n/** Display text for the button */\nconst displayText = computed(() => {\n if (hasMissingActiveEnvironment.value) {\n return `${activeEnvironment} (Unavailable)`\n }\n\n if (hasActiveEnvironment.value) {\n return activeEnvironment\n }\n if (!hasEnvironments.value) {\n return 'Add Environment'\n }\n return 'Select Environment'\n})\n\n/** Button styling based on state */\nconst buttonClass = computed(() => {\n if (hasMissingActiveEnvironment.value) {\n return 'hover:bg-b-2 text-c-2 border-transparent'\n }\n\n if (hasActiveEnvironment.value) {\n return 'bg-c-accent/10 text-c-accent hover:bg-c-accent/20 border-c-accent/30'\n }\n if (!hasEnvironments.value) {\n return 'hover:bg-b-2 text-c-3 border-transparent'\n }\n return 'hover:bg-b-2 text-c-2 border-transparent'\n})\n\nconst handleAddEnvironment = () => {\n emit('add:environment')\n}\n\nconst handleSelectEnvironment = (environmentName: string) => {\n emit('select:environment', environmentName)\n}\n</script>\n\n<template>\n <div class=\"relative flex items-center\">\n <!-- Environment indicator badge (only show when active) -->\n\n <ScalarDropdown>\n <ScalarButton\n :aria-label=\"`Current environment: ${displayText}`\"\n class=\"line-clamp-1 h-full w-fit justify-start border px-2 py-1 font-normal transition-colors\"\n :class=\"buttonClass\"\n size=\"sm\"\n variant=\"ghost\">\n <div class=\"flex max-w-[220px] min-w-0 items-center gap-1.5\">\n <!-- Icon indicator -->\n <ScalarIcon\n class=\"shrink-0\"\n :class=\"\n hasActiveEnvironment && !hasMissingActiveEnvironment\n ? 'text-c-accent'\n : 'text-c-3'\n \"\n icon=\"Globe\"\n size=\"sm\" />\n\n <!-- Environment name -->\n <span\n class=\"text-xxs block max-w-[160px] min-w-0 truncate text-left font-medium\">\n {{ displayText }}\n </span>\n\n <!-- Dropdown arrow -->\n <ScalarIcon\n class=\"shrink-0\"\n icon=\"ChevronDown\"\n size=\"xs\" />\n </div>\n </ScalarButton>\n\n <template #items>\n <!-- No environment option (clear selection) -->\n <ScalarDropdownItem\n v-if=\"hasActiveEnvironment\"\n class=\"group/item flex w-full items-center gap-1.5\"\n @click=\"handleSelectEnvironment('')\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n !activeEnvironment\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"text-c-2\">No Environment</span>\n </ScalarDropdownItem>\n\n <ScalarDropdownDivider v-if=\"hasActiveEnvironment && hasEnvironments\" />\n\n <!-- Environment list -->\n <ScalarDropdownItem\n v-for=\"environmentName in environments\"\n :key=\"environmentName\"\n class=\"group/item flex w-full min-w-0 items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n @click=\"handleSelectEnvironment(environmentName)\">\n <div\n class=\"flex h-4 w-4 items-center justify-center rounded-full p-[3px]\"\n :class=\"\n activeEnvironment === environmentName\n ? 'bg-c-accent text-b-1'\n : 'shadow-border text-transparent'\n \">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <span class=\"min-w-0 flex-1 truncate\">{{ environmentName }}</span>\n </ScalarDropdownItem>\n <ScalarDropdownDivider v-if=\"hasMissingActiveEnvironment\" />\n\n <ScalarDropdownItem\n v-if=\"hasMissingActiveEnvironment\"\n class=\"group/item flex h-auto w-full min-w-0 items-start gap-1.5 overflow-hidden\"\n disabled>\n <div\n class=\"bg-c-accent text-b-1 mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full p-[3px]\">\n <ScalarIcon\n class=\"size-2.5\"\n icon=\"Checkmark\"\n thickness=\"3\" />\n </div>\n <div class=\"min-w-0 flex-1 text-left\">\n <span class=\"block truncate\">\n {{ activeEnvironment }}\n </span>\n <span class=\"text-c-3 block truncate text-xs\">\n Not available in this context\n </span>\n </div>\n </ScalarDropdownItem>\n\n <ScalarDropdownDivider v-if=\"hasEnvironments\" />\n\n <!-- Add new environment button -->\n <ScalarDropdownItem\n class=\"text-c-accent flex items-center gap-1.5\"\n @click=\"handleAddEnvironment\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>{{\n hasEnvironments ? 'New Environment' : 'Create Environment'\n }}</span>\n </ScalarDropdownItem>\n\n <!-- Helper text for empty state -->\n <div\n v-if=\"!hasEnvironments && !hasActiveEnvironment\"\n class=\"text-c-3 px-2 py-1.5 text-xs\">\n <p class=\"mb-1\">\n Environments let you manage variables like API keys and base URLs\n across different contexts.\n </p>\n </div>\n </template>\n </ScalarDropdown>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,OAAO;;EAQb,MAAM,uBAAuB,eAAe,CAAC,CAAC,QAAA,iBAAiB;;EAG/D,MAAM,kBAAkB,eAAe,QAAA,aAAa,SAAS,CAAC;;EAG9D,MAAM,kCAAkC,eAAe;GACrD,IAAI,CAAC,QAAA,mBACH,OAAO;GAGT,OAAO,QAAA,aAAa,SAAS,QAAA,iBAAiB;EAChD,CAAC;;EAGD,MAAM,8BAA8B,eAC5B,qBAAqB,SAAS,CAAC,gCAAgC,KACvE;;EAGA,MAAM,cAAc,eAAe;GACjC,IAAI,4BAA4B,OAC9B,OAAO,GAAG,QAAA,kBAAkB;GAG9B,IAAI,qBAAqB,OACvB,OAAO,QAAA;GAET,IAAI,CAAC,gBAAgB,OACnB,OAAO;GAET,OAAO;EACT,CAAC;;EAGD,MAAM,cAAc,eAAe;GACjC,IAAI,4BAA4B,OAC9B,OAAO;GAGT,IAAI,qBAAqB,OACvB,OAAO;GAET,IAAI,CAAC,gBAAgB,OACnB,OAAO;GAET,OAAO;EACT,CAAC;EAED,MAAM,6BAA6B;GACjC,KAAK,iBAAiB;EACxB;EAEA,MAAM,2BAA2B,oBAA4B;GAC3D,KA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UAAA,GAAA;OAFZ,OAAM;OACN,MAAK;OACL,MAAK"}
|
|
@@ -12,7 +12,9 @@ var STATUS_CODES_COLORS = {
|
|
|
12
12
|
505: { color: "text-orange" }
|
|
13
13
|
};
|
|
14
14
|
var getStatusCodeColor = (statusCode) => {
|
|
15
|
-
return STATUS_CODES_COLORS[statusCode] || {
|
|
15
|
+
return STATUS_CODES_COLORS[statusCode] || {
|
|
16
|
+
/** default color */
|
|
17
|
+
color: "text-grey" };
|
|
16
18
|
};
|
|
17
19
|
//#endregion
|
|
18
20
|
export { getStatusCodeColor };
|