@scalar/api-client 3.27.0 → 3.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +1 -2
- package/dist/assets/computer.ascii_raw.js +1 -2
- package/dist/components/HelpfulLink.vue.js +1 -2
- package/dist/components/HelpfulLink.vue.js.map +1 -1
- package/dist/components/HelpfulLink.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -2
- package/dist/components/HttpMethod/HttpMethod.vue.js.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +2 -3
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js.map +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/SectionFilter.vue.js +2 -3
- package/dist/components/SectionFilter.vue.js.map +1 -1
- package/dist/components/SectionFilter.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/components/SectionFilterButton.vue.js +1 -2
- package/dist/components/SectionFilterButton.vue.js.map +1 -1
- package/dist/components/SectionFilterButton.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/Server/ServerVariablesForm.vue.js +1 -2
- package/dist/components/Server/ServerVariablesForm.vue.js.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/Server/ServerVariablesForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.js +1 -2
- package/dist/components/Server/ServerVariablesSelect.vue.js.map +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/Server/ServerVariablesSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.js +1 -2
- package/dist/components/Server/ServerVariablesTextbox.vue.js.map +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +1 -2
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -2
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/ViewLayout/ViewLayout.vue.js +1 -2
- package/dist/components/ViewLayout/ViewLayout.vue.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -2
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -2
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/ViewLayout/ViewLayoutSection.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/hooks/use-file-dialog.js +1 -2
- package/dist/plugins/posthog/index.js +1 -2
- package/dist/plugins/posthog/sanitize-event-payload.js +1 -2
- package/dist/style.css +468 -445
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +1 -2
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -3
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/operation-block/components/Header.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +2 -3
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/persist-script-environment.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/response-cache.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -2
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +3 -4
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js +13 -7
- package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +3 -4
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/v2/blocks/request-block/components/RequestBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.d.ts +3 -0
- package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/v2/blocks/request-block/components/RequestBodyMultipart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue_vue_type_script_setup_true_lang.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.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/request-block/components/RequestParams.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +2 -3
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js +5 -6
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -2
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +1 -2
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts +2 -0
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +6 -3
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/files.js +1 -2
- package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js +1 -2
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -2
- package/dist/v2/blocks/request-block/helpers/get-parameter-content.js +1 -2
- package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js +1 -2
- package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js +1 -2
- package/dist/v2/blocks/request-block/helpers/group-by.js +1 -2
- package/dist/v2/blocks/request-block/helpers/group-form-body-files.js +2 -3
- package/dist/v2/blocks/request-block/helpers/group-form-body-files.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js +1 -2
- package/dist/v2/blocks/request-block/helpers/multipart-body.js +1 -2
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +1 -2
- package/dist/v2/blocks/request-block/helpers/validate-parameter.js +1 -2
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/v2/blocks/response-block/ResponseBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/Headers.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue_vue_type_script_setup_true_lang.js +5 -6
- package/dist/v2/blocks/response-block/components/ResponseBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +1 -2
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/extract-filename.js +1 -2
- package/dist/v2/blocks/response-block/helpers/get-content-length.js +1 -2
- package/dist/v2/blocks/response-block/helpers/media-types.js +1 -2
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +1 -2
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js +1 -2
- package/dist/v2/blocks/response-block/helpers/prettify-ndjson.js +1 -2
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +1 -2
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js +1 -2
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +1 -2
- package/dist/v2/blocks/response-block/helpers/response-stream-multipart.js +1 -2
- package/dist/v2/blocks/response-block/helpers/response-stream.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -3
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -3
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +1 -2
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +1 -2
- 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_vue_type_script_setup_true_lang.js +7 -8
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-client-authorization.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +2 -3
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +2 -3
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -3
- package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/components/code-input/CodeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +2 -3
- package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/v2/components/code-input/CodeInputLite.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.js +1 -2
- package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/code-input/code-variable-widget.js +1 -2
- package/dist/v2/components/code-input/helpers/build-pill-context.js +1 -2
- package/dist/v2/components/code-input/helpers/lookup-variable-value.js +1 -2
- package/dist/v2/components/code-input/helpers/pill-signature.js +1 -2
- package/dist/v2/components/code-input/helpers/serialize-value.js +1 -2
- package/dist/v2/components/context-menu/ContextMenu.vue.js +1 -2
- package/dist/v2/components/context-menu/ContextMenu.vue.js.map +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/DataTable.vue.js +1 -2
- package/dist/v2/components/data-table/DataTable.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTable.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/DataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.js +1 -2
- package/dist/v2/components/data-table/DataTableCell.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +1 -2
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/DataTableHeader.vue.js +1 -2
- package/dist/v2/components/data-table/DataTableHeader.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -3
- package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/v2/components/data-table/DataTableInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +1 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js +1 -2
- package/dist/v2/components/data-table/DataTableText.vue.js +1 -2
- package/dist/v2/components/data-table/DataTableText.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableText.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/data-table/index.js +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.js +1 -2
- package/dist/v2/components/forms/ConfirmationForm.vue.js.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -2
- package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/layout/CollapsibleSection.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.js +1 -2
- package/dist/v2/components/layout/ValueEmitter.vue.js.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue_vue_type_script_setup_true_lang.js +0 -1
- package/dist/v2/components/layout/collapsible-section-heading-level.js +1 -2
- package/dist/v2/components/layout/index.js +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.js +1 -2
- package/dist/v2/components/modals/DeleteModal.vue.js.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/components/modals/DeleteModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +2 -3
- package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/resize/Resize.vue.js +2 -3
- package/dist/v2/components/resize/Resize.vue.js.map +1 -1
- package/dist/v2/components/resize/Resize.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/resize/use-split-resize.js +1 -2
- package/dist/v2/components/server/ServerDropdown.vue.js +1 -2
- package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/components/server/ServerDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.js +2 -3
- package/dist/v2/components/server/ServerDropdownItem.vue.js.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/server/ServerDropdownItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +1 -2
- package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/components/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +1 -2
- package/dist/v2/components/sidebar/SidebarMenu.vue.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/sidebar/SidebarToggle.vue.js +2 -3
- package/dist/v2/components/sidebar/SidebarToggle.vue.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/components/sidebar/index.js +1 -1
- package/dist/v2/constants.js +2 -3
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +1 -2
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +1 -2
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -2
- package/dist/v2/features/environments/EnvironmentsList.vue.js.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/features/environments/components/Environment.vue.js +1 -2
- package/dist/v2/features/environments/components/Environment.vue.js.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/features/environments/components/Environment.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue.js +1 -2
- package/dist/v2/features/environments/components/EnvironmentColors.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue_vue_type_script_setup_true_lang.js +9 -10
- package/dist/v2/features/environments/components/EnvironmentColors.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js +1 -2
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js +1 -2
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js +1 -2
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +2 -3
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/features/localization/index.js +1 -2
- package/dist/v2/features/localization/locales/ar.js +1 -2
- package/dist/v2/features/localization/locales/de.js +1 -2
- package/dist/v2/features/localization/locales/es.js +1 -2
- package/dist/v2/features/localization/locales/fr.js +1 -2
- package/dist/v2/features/localization/locales/pt.js +1 -2
- package/dist/v2/features/localization/locales/ru.js +1 -2
- package/dist/v2/features/localization/locales/zh-cn.js +1 -2
- package/dist/v2/features/localization/locales/zh-tw.js +1 -2
- package/dist/v2/features/localization/translations.js +1 -2
- package/dist/v2/features/modal/Modal.vue.js +1 -2
- package/dist/v2/features/modal/Modal.vue.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +1 -2
- package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -2
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -2
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +1 -2
- package/dist/v2/features/modal/index.js +2 -2
- package/dist/v2/features/modal/modal-events.js +1 -2
- package/dist/v2/features/modal/use-lazy-api-client.js +1 -2
- package/dist/v2/features/operation/Operation.vue.js +1 -2
- package/dist/v2/features/operation/Operation.vue.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js +2 -3
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/features/search/components/SearchResult.vue.js +1 -2
- package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/v2/features/search/components/SearchResult.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/features/search/helpers/create-fuse-instance.js +1 -2
- package/dist/v2/features/search/helpers/create-search-index.js +1 -2
- package/dist/v2/features/search/hooks/use-document-search.js +1 -2
- package/dist/v2/features/search/hooks/use-search-index.js +1 -2
- package/dist/v2/features/search/index.js +1 -1
- package/dist/v2/helpers/generate-location-id.js +1 -2
- package/dist/v2/helpers/handle-hotkeys.js +1 -2
- package/dist/v2/helpers/test-utils.js +1 -2
- package/dist/v2/hooks/use-global-hot-keys.js +1 -2
- package/dist/v2/hooks/use-scroll-lock.js +1 -2
- package/dist/v2/workspace-events.js +1 -2
- package/dist/vue-styles.css +130 -130
- package/package.json +26 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_toDisplayString","_unref","_createTextVNode","
|
|
1
|
+
{"version":3,"file":"Environment.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_toDisplayString","_unref","_createTextVNode","_createVNode","EnvironmentVariablesTable"],"sources":["../../../../../src/v2/features/environments/components/Environment.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconNotePencil, ScalarIconTrash } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\nimport EnvironmentVariablesTable from '@/v2/features/environments/components/EnvironmentVariablesTable.vue'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n environmentName,\n environment,\n eventBus,\n collectionType,\n isActive = false,\n} = defineProps<\n {\n environment: XScalarEnvironment\n environmentName: string\n eventBus: WorkspaceEventBus\n isActive?: boolean\n } & CollectionType\n>()\n\nconst emit = defineEmits<{\n (e: 'edit'): void\n (e: 'delete'): void\n}>()\n\nconst { translate } = useLocalization()\n</script>\n<template>\n <div\n class=\"group relative rounded-lg border transition-colors\"\n :class=\"isActive ? 'border-c-accent bg-c-accent/5' : ''\">\n <!-- Info -->\n <div\n class=\"flex justify-between rounded-t-lg px-1 py-1 text-sm\"\n :class=\"isActive ? 'bg-c-accent/10' : 'bg-b-2'\">\n <div class=\"flex items-center gap-1.5\">\n <div class=\"flex h-6 w-6 items-center justify-center p-1\">\n <span\n class=\"h-2.5 w-2.5 rounded-full\"\n :style=\"{ backgroundColor: environment.color }\"></span>\n </div>\n <span class=\"px-1 py-0.5 text-sm font-medium\">\n {{ environmentName }}\n </span>\n <!-- Active badge -->\n <span\n v-if=\"isActive\"\n class=\"bg-c-accent text-b-1 flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium\"\n :title=\"\n translate('apiClient.environment.thisIsTheActiveEnvironment')\n \">\n <span class=\"size-1.5 rounded-full bg-current\"></span\n >{{ translate('apiClient.environment.active') }}</span\n >\n </div>\n\n <!-- Actions -->\n <div class=\"hidden flex-row items-center gap-1 group-hover:flex\">\n <ScalarIconButton\n :icon=\"ScalarIconNotePencil\"\n :label=\"translate('apiClient.environment.editEnvironment')\"\n size=\"sm\"\n @click=\"emit('edit')\" />\n\n <ScalarIconButton\n :icon=\"ScalarIconTrash\"\n :label=\"translate('apiClient.environment.deleteEnvironment')\"\n size=\"sm\"\n @click=\"emit('delete')\" />\n </div>\n </div>\n\n <!-- Variables Table -->\n <EnvironmentVariablesTable\n :collectionType\n :environment\n :environment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,iBAAA,QAAA;IACA,UAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"names":[],"mappings":"AA8LA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"names":[],"mappings":"AA8LA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;AA6UF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import EnvironmentColors_vue_vue_type_script_setup_true_lang_default from "./EnvironmentColors.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// src/v2/features/environments/components/EnvironmentColors.vue
|
|
3
3
|
var EnvironmentColors_default = EnvironmentColors_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { EnvironmentColors_default as default };
|
|
6
5
|
|
|
7
6
|
//# sourceMappingURL=EnvironmentColors.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentColors.vue.js","names":[
|
|
1
|
+
{"version":3,"file":"EnvironmentColors.vue.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeStyle, openBlock, ref, renderList, unref, vModelText, withDirectives } from "vue";
|
|
2
2
|
import { ScalarIcon } from "@scalar/components/icon";
|
|
3
|
-
|
|
3
|
+
// src/v2/features/environments/components/EnvironmentColors.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "color-selector flex h-4 flex-row items-center justify-between gap-1.5 space-x-1"
|
|
@@ -49,7 +49,7 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
49
49
|
*/
|
|
50
50
|
const customButtonStyle = computed(() => {
|
|
51
51
|
const displayColor = customColor.value || __props.activeColor;
|
|
52
|
-
return isCustomColor.value || customColor.value ? `background-color: ${displayColor};` : `background: ${DEFAULT_GRADIENT};`;
|
|
52
|
+
return isCustomColor.value || customColor.value ? `background-color: ${displayColor}; --env-color: ${displayColor};` : `background: ${DEFAULT_GRADIENT};`;
|
|
53
53
|
});
|
|
54
54
|
/**
|
|
55
55
|
* Toggle the custom color input visibility.
|
|
@@ -89,12 +89,12 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
89
89
|
return openBlock(), createElementBlock("div", null, [
|
|
90
90
|
!showCustomInput.value && !showSelector.value ? (openBlock(), createElementBlock("div", {
|
|
91
91
|
key: 0,
|
|
92
|
-
class: "flex h-4 w-4 cursor-pointer items-center justify-center rounded-full",
|
|
93
|
-
style: normalizeStyle({
|
|
92
|
+
class: "flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-(--env-color)",
|
|
93
|
+
style: normalizeStyle({ "--env-color": __props.activeColor }),
|
|
94
94
|
onClick: toggleSelector
|
|
95
95
|
}, [__props.activeColor ? (openBlock(), createBlock(unref(ScalarIcon), {
|
|
96
96
|
key: 0,
|
|
97
|
-
class: "text-
|
|
97
|
+
class: "text-auto-contrast-(--env-color) p-0.5",
|
|
98
98
|
icon: "Checkmark",
|
|
99
99
|
size: "xs"
|
|
100
100
|
})) : createCommentVNode("", true)], 4)) : createCommentVNode("", true),
|
|
@@ -102,12 +102,12 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
102
102
|
(openBlock(), createElementBlock(Fragment, null, renderList(colorOptions, (option) => {
|
|
103
103
|
return createElementVNode("div", {
|
|
104
104
|
key: option,
|
|
105
|
-
class: "flex h-4 w-4 cursor-pointer items-center justify-center rounded-full",
|
|
106
|
-
style: normalizeStyle({
|
|
105
|
+
class: "flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-(--env-color)",
|
|
106
|
+
style: normalizeStyle({ "--env-color": option }),
|
|
107
107
|
onClick: ($event) => selectColor(option)
|
|
108
108
|
}, [isActiveColor(option) ? (openBlock(), createBlock(unref(ScalarIcon), {
|
|
109
109
|
key: 0,
|
|
110
|
-
class: "text-
|
|
110
|
+
class: "text-auto-contrast-(--env-color) p-0.5",
|
|
111
111
|
icon: "Checkmark",
|
|
112
112
|
size: "xs"
|
|
113
113
|
})) : createCommentVNode("", true)], 12, _hoisted_2);
|
|
@@ -120,7 +120,7 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
120
120
|
onClick: toggleCustomInput
|
|
121
121
|
}, [isCustomColor.value ? (openBlock(), createBlock(unref(ScalarIcon), {
|
|
122
122
|
key: 0,
|
|
123
|
-
class: "text-
|
|
123
|
+
class: "text-auto-contrast-(--env-color)",
|
|
124
124
|
icon: "Checkmark",
|
|
125
125
|
size: "xs"
|
|
126
126
|
})) : createCommentVNode("", true)], 4)
|
|
@@ -153,7 +153,6 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
|
-
//#endregion
|
|
157
156
|
export { EnvironmentColors_vue_vue_type_script_setup_true_lang_default as default };
|
|
158
157
|
|
|
159
158
|
//# sourceMappingURL=EnvironmentColors.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentColors.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_createBlock","_unref","
|
|
1
|
+
{"version":3,"file":"EnvironmentColors.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_createBlock","_unref","_Fragment","_renderList","_createElementVNode","_withDirectives","_vModelText","_createVNode"],"sources":["../../../../../src/v2/features/environments/components/EnvironmentColors.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { computed, nextTick, ref } from 'vue'\n\nconst { activeColor } = defineProps<{\n activeColor: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', color: string): void\n}>()\n\nconst customColor = ref('')\nconst customColorInputRef = ref<HTMLInputElement | null>(null)\nconst showCustomInput = ref(false)\nconst showSelector = ref(false)\n\n/**\n * Predefined color options available in the color picker.\n * Each option provides a standard color choice for the environment.\n */\nconst colorOptions = [\n '#FFFFFF',\n '#EF0006',\n '#EDBE20',\n '#069061',\n '#FB892C',\n '#0082D0',\n '#5203D1',\n '#FFC0CB',\n] as const\n\n/** Default gradient shown when no custom color is selected. */\nconst DEFAULT_GRADIENT =\n 'linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122))'\n\n/** Check if the active color is one of the preset options. */\nconst isPresetColor = computed(() =>\n colorOptions.some((color) => color === activeColor),\n)\n\n/** Check if a custom color is being used (not in the preset list). */\nconst isCustomColor = computed(\n () => activeColor && !isPresetColor.value && !showCustomInput.value,\n)\n\n/** Check if the given color matches the currently active color. */\nconst isActiveColor = (color: string): boolean => activeColor === color\n\n/**\n * Style for the custom color button.\n * Shows the actual color if custom, otherwise shows a gradient.\n */\nconst customButtonStyle = computed(() => {\n const displayColor = customColor.value || activeColor\n return isCustomColor.value || customColor.value\n ? `background-color: ${displayColor}; --env-color: ${displayColor};`\n : `background: ${DEFAULT_GRADIENT};`\n})\n\n/**\n * Toggle the custom color input visibility.\n * Focuses the input after it becomes visible.\n */\nconst toggleCustomInput = async () => {\n showCustomInput.value = !showCustomInput.value\n showSelector.value = false\n\n if (!showCustomInput.value) {\n return\n }\n\n await nextTick()\n customColorInputRef.value?.focus()\n}\n\n/** Toggle the color selector visibility. */\nconst toggleSelector = (): void => {\n showSelector.value = !showSelector.value\n}\n\n/**\n * Select a color and emit the selection event.\n * Ensures the color value has a # prefix for hex colors.\n */\nconst selectColor = (color: string): void => {\n const formattedColor = color && !color.startsWith('#') ? `#${color}` : color\n emit('select', formattedColor)\n showSelector.value = false\n}\n\n/**\n * Handle custom color input changes.\n * Formats the color and emits the selection.\n */\nconst handleCustomColorInput = (): void => {\n if (!customColor.value) {\n return\n }\n\n const formattedColor = customColor.value.startsWith('#')\n ? customColor.value\n : `#${customColor.value}`\n\n customColor.value = formattedColor\n selectColor(formattedColor)\n}\n</script>\n<template>\n <div>\n <!-- Collapsed view: single color dot -->\n <div\n v-if=\"!showCustomInput && !showSelector\"\n class=\"flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-(--env-color)\"\n :style=\"{ '--env-color': activeColor }\"\n @click=\"toggleSelector\">\n <ScalarIcon\n v-if=\"activeColor\"\n class=\"text-auto-contrast-(--env-color) p-0.5\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </div>\n\n <!-- Expanded view: color palette selector -->\n <div\n v-if=\"!showCustomInput && showSelector\"\n class=\"color-selector flex h-4 flex-row items-center justify-between gap-1.5 space-x-1\">\n <!-- Preset color options -->\n <div\n v-for=\"option in colorOptions\"\n :key=\"option\"\n class=\"flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-(--env-color)\"\n :style=\"{ '--env-color': option }\"\n @click=\"selectColor(option)\">\n <ScalarIcon\n v-if=\"isActiveColor(option)\"\n class=\"text-auto-contrast-(--env-color) p-0.5\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </div>\n\n <!-- Divider -->\n <hr class=\"border-ghost h-5 w-0.5 border-l\" />\n\n <!-- Custom color button -->\n <button\n class=\"z-10 flex h-4 w-4 cursor-pointer flex-row items-center justify-center gap-2 rounded-full\"\n :style=\"customButtonStyle\"\n type=\"button\"\n @click=\"toggleCustomInput\">\n <ScalarIcon\n v-if=\"isCustomColor\"\n class=\"text-auto-contrast-(--env-color)\"\n icon=\"Checkmark\"\n size=\"xs\" />\n </button>\n </div>\n\n <!-- Custom color input view -->\n <div\n v-if=\"showCustomInput\"\n class=\"color-selector flex h-4 flex-1 items-center gap-2 rounded\">\n <span class=\"absolute h-4 w-4 rounded-full border border-dashed\" />\n <span\n class=\"z-[1] h-4 w-4 rounded-full\"\n :style=\"customButtonStyle\" />\n <input\n ref=\"customColorInputRef\"\n v-model=\"customColor\"\n class=\"w-full flex-1 border-transparent text-sm outline-none\"\n :placeholder=\"activeColor || '#000000'\"\n type=\"text\"\n @input=\"handleCustomColorInput\" />\n <button\n class=\"text-c-3 hover:bg-b-2 rounded-lg p-1.5\"\n type=\"button\"\n @click=\"toggleCustomInput\">\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;AAiCA,IAAM,mBACJ;;;;;;;EA1BF,MAAM,OAAO;EAIb,MAAM,cAAc,IAAI,EAAE;EAC1B,MAAM,sBAAsB,IAA6B,IAAI;EAC7D,MAAM,kBAAkB,IAAI,KAAK;EACjC,MAAM,eAAe,IAAI,KAAK;;;;;EAM9B,MAAM,eAAe;GACnB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;;EAOA,MAAM,gBAAgB,eACpB,aAAa,MAAM,UAAU,UAAU,QAAA,WAAW,CACpD;;EAGA,MAAM,gBAAgB,eACd,QAAA,eAAe,CAAC,cAAc,SAAS,CAAC,gBAAgB,KAChE;;EAGA,MAAM,iBAAiB,UAA2B,QAAA,gBAAgB;;;;;EAMlE,MAAM,oBAAoB,eAAe;GACvC,MAAM,eAAe,YAAY,SAAS,QAAA;GAC1C,OAAO,cAAc,SAAS,YAAY,QACtC,qBAAqB,aAAa,iBAAiB,aAAa,KAChE,eAAe,iBAAiB;EACtC,CAAC;;;;;EAMD,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mBAA8C,MAAA,EAA1C,OAAM,kCAAiC,GAAA,MAAA,EAAA;KAG3CA,mBAUS,UAAA;MATP,OAAM;MACL,OAAKL,eAAE,kBAAA,KAAiB;MACzB,MAAK;MACJ,SAAO;K,IAEA,cAAA,SADRF,UAAA,GAAAG,YAIcC,MAAA,UAAA,GAAA;;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;;;IAMH,gBAAA,SADRJ,UAAA,GAAAC,mBAsBM,OAtBN,YAsBM;KAnBJ,OAAA,OAAA,OAAA,KAAAM,mBAAmE,QAAA,EAA7D,OAAM,qDAAoD,GAAA,MAAA,EAAA;KAChEA,mBAE+B,QAAA;MAD7B,OAAM;MACL,OAAKL,eAAE,kBAAA,KAAiB;;KAC3BM,eAAAD,mBAMoC,SAAA;MAL9B,SAAA;MAAJ,KAAI;MACK,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,YAAW,QAAA;MACpB,OAAM;MACL,aAAa,QAAA,eAAW;MACzB,MAAK;MACJ,SAAO;K,2BAJC,CAAAE,YAAA,YAAA,KAAW,C;KAKtBF,mBAOS,UAAA;MANP,OAAM;MACN,MAAK;MACJ,SAAO;K,IACRG,YAEcN,MAAA,UAAA,GAAA;MADZ,MAAK;MACL,MAAK"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default from "./EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// src/v2/features/environments/components/EnvironmentCreateModal.vue
|
|
3
3
|
var EnvironmentCreateModal_default = EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { EnvironmentCreateModal_default as default };
|
|
6
5
|
|
|
7
6
|
//# sourceMappingURL=EnvironmentCreateModal.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentCreateModal.vue.js","names":[
|
|
1
|
+
{"version":3,"file":"EnvironmentCreateModal.vue.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useLocalization } from "../../localization/index.js";
|
|
2
1
|
import CommandActionForm_default from "../../command-palette/components/CommandActionForm.vue.js";
|
|
3
2
|
import CommandActionInput_default from "../../command-palette/components/CommandActionInput.vue.js";
|
|
3
|
+
import { useLocalization } from "../../localization/index.js";
|
|
4
4
|
import EnvironmentColors_default from "./EnvironmentColors.vue.js";
|
|
5
5
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
|
|
6
6
|
import { ScalarModal } from "@scalar/components/modal";
|
|
7
|
-
|
|
7
|
+
// src/v2/features/environments/components/EnvironmentCreateModal.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var _hoisted_1 = { class: "flex items-start gap-2" };
|
|
9
9
|
var _hoisted_2 = {
|
|
10
10
|
key: 0,
|
|
@@ -93,7 +93,6 @@ var EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
//#endregion
|
|
97
96
|
export { EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default as default };
|
|
98
97
|
|
|
99
98
|
//# sourceMappingURL=EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createVNode","CommandActionForm","_createTextVNode","_toDisplayString","_createElementVNode","EnvironmentColors","CommandActionInput","_createElementBlock"
|
|
1
|
+
{"version":3,"file":"EnvironmentCreateModal.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createVNode","CommandActionForm","_createTextVNode","_toDisplayString","_createElementVNode","EnvironmentColors","CommandActionInput","_createElementBlock"],"sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironments } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed, ref, watch } from 'vue'\n\nimport {\n CommandActionForm,\n CommandActionInput,\n} from '@/v2/features/command-palette'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport EnvironmentColors from './EnvironmentColors.vue'\n\nconst {\n state,\n eventBus,\n collectionType,\n environments,\n selectedEnvironmentName,\n} = defineProps<\n {\n environments: NonNullable<XScalarEnvironments['x-scalar-environments']>\n selectedEnvironmentName: string | null\n state: ModalState\n eventBus: WorkspaceEventBus\n } & CollectionType\n>()\n\nconst { translate } = useLocalization()\n\n/** Default color for new environments. */\nconst DEFAULT_COLOR = '#FFFFFF'\n\nconst name = ref('')\nconst selectedColor = ref(DEFAULT_COLOR)\n\n/** Ensure [re]set the form on open */\nwatch(\n () => state.open,\n (isOpen) => {\n if (isOpen) {\n const environment = environments[selectedEnvironmentName ?? '']\n\n // We are editing so lets fill in the form with the existing data\n if (selectedEnvironmentName && environment) {\n name.value = selectedEnvironmentName\n selectedColor.value = environment.color\n }\n\n // We are adding a new environment so lets clear the form\n else {\n name.value = ''\n selectedColor.value = DEFAULT_COLOR\n }\n }\n },\n)\n\n/**\n * Handle color selection from the color picker.\n * Updates the selected color for the new environment.\n */\nconst handleColorSelect = (color: string): void => {\n selectedColor.value = color\n}\n\n/** Emits an event to create the environment with the provided name and color. */\nconst handleSubmit = (): void => {\n // Editing an existing environment\n if (selectedEnvironmentName) {\n eventBus.emit('environment:upsert:environment', {\n oldEnvironmentName: selectedEnvironmentName,\n payload: {\n color: selectedColor.value,\n },\n environmentName: name.value.trim(),\n collectionType,\n })\n }\n // Adding a new environment\n else {\n eventBus.emit('environment:upsert:environment', {\n environmentName: name.value.trim(),\n payload: {\n color: selectedColor.value,\n },\n collectionType,\n })\n }\n\n state.hide()\n}\n\n/** Check if the environment name is a duplicate */\nconst isDuplicateName = computed(() => {\n if (selectedEnvironmentName) {\n return (\n name.value !== selectedEnvironmentName &&\n Object.keys(environments).includes(name.value)\n )\n }\n\n return Object.keys(environments).includes(name.value)\n})\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg\"\n size=\"xs\"\n :state=\"state\">\n <CommandActionForm\n :disabled=\"!name.trim() || isDuplicateName\"\n @submit=\"handleSubmit\">\n <div class=\"flex items-start gap-2\">\n <!-- Color picker for environment -->\n <EnvironmentColors\n :activeColor=\"selectedColor\"\n class=\"peer\"\n @select=\"handleColorSelect\" />\n\n <!-- Environment name input, hidden when color selector is expanded -->\n <CommandActionInput\n v-model=\"name\"\n class=\"-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden\"\n :placeholder=\"\n translate('apiClient.environmentCreateModal.environmentName')\n \" />\n </div>\n\n <!-- Error message -->\n <div\n v-if=\"isDuplicateName\"\n class=\"text-red text-xs\">\n {{\n translate(\n 'apiClient.environmentCreateModal.thisEnvironmentNameIsAlreadyInUse',\n )\n }}\n </div>\n\n <!-- Submit button -->\n <template #submit>\n {{\n selectedEnvironmentName\n ? translate('apiClient.environmentCreateModal.update')\n : translate('apiClient.environmentCreateModal.add')\n }}\n </template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAM,gBAAgB;;;;;;;;;;;EAHtB,MAAM,EAAE,cAAc,gBAAgB;;EAKtC,MAAM,OAAO,IAAI,EAAE;EACnB,MAAM,gBAAgB,IAAI,aAAa;;EAGvC,YACQ,QAAA,MAAM,OACX,WAAW;GACV,IAAI,QAAQ;IACV,MAAM,cAAc,QAAA,aAAa,QAAA,2BAA2B;IAG5D,IAAI,QAAA,2BAA2B,aAAa;KAC1C,KAAK,QAAQ,QAAA;KACb,c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GAAA;MAJK,YAAA,KAAA;MAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,KAAI,QAAA;MACb,OAAM;MACL,aAA0BR,MAAA,SAAA,CAAS,CAAA,kDAAA;K,8CAOhC,gBAAA,SADRF,UAAA,GAAAW,mBAQM,OARN,YAQMJ,gBAJFL,MAAA,SAAA,CAAS,C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default from "./EnvironmentDeleteModal.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// src/v2/features/environments/components/EnvironmentDeleteModal.vue
|
|
3
3
|
var EnvironmentDeleteModal_default = EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { EnvironmentDeleteModal_default as default };
|
|
6
5
|
|
|
7
6
|
//# sourceMappingURL=EnvironmentDeleteModal.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentDeleteModal.vue.js","names":[
|
|
1
|
+
{"version":3,"file":"EnvironmentDeleteModal.vue.js","names":[],"sources":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import { useLocalization } from "../../localization/index.js";
|
|
|
2
2
|
import { createBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
3
3
|
import { ScalarButton } from "@scalar/components/button";
|
|
4
4
|
import { ScalarModal } from "@scalar/components/modal";
|
|
5
|
-
|
|
5
|
+
// src/v2/features/environments/components/EnvironmentDeleteModal.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = { class: "text-c-2 text-sm leading-normal text-pretty" };
|
|
7
7
|
var _hoisted_2 = { class: "flex justify-between" };
|
|
8
8
|
var EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -48,7 +48,6 @@ var EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
//#endregion
|
|
52
51
|
export { EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default as default };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=EnvironmentDeleteModal.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default from "./EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// src/v2/features/environments/components/EnvironmentVariablesDropdown.vue
|
|
3
3
|
var EnvironmentVariablesDropdown_default = EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { EnvironmentVariablesDropdown_default as default };
|
|
6
5
|
|
|
7
6
|
//# sourceMappingURL=EnvironmentVariablesDropdown.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesDropdown.vue.js","names":[
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesDropdown.vue.js","names":[],"sources":[],"mappings":""}
|
|
@@ -6,7 +6,7 @@ import { POPULAR_CONTEXT_FUNCTION_KEYS } from "@scalar/workspace-store/request-e
|
|
|
6
6
|
import { ScalarTeleport } from "@scalar/components/teleport";
|
|
7
7
|
import { onClickOutside } from "@vueuse/core";
|
|
8
8
|
import Fuse from "fuse.js";
|
|
9
|
-
|
|
9
|
+
// src/v2/features/environments/components/EnvironmentVariablesDropdown.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var _hoisted_1 = ["id", "aria-label"];
|
|
11
11
|
var _hoisted_2 = [
|
|
12
12
|
"id",
|
|
@@ -194,7 +194,6 @@ var EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default = /
|
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
|
-
//#endregion
|
|
198
197
|
export { EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default as default };
|
|
199
198
|
|
|
200
199
|
//# sourceMappingURL=EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_normalizeStyle","_withModifiers","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode","_createCommentVNode"],"sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarTeleport } from '@scalar/components/teleport'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { POPULAR_CONTEXT_FUNCTION_KEYS } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { onClickOutside } from '@vueuse/core'\nimport Fuse from 'fuse.js'\nimport { computed, onMounted, ref, watch, type CSSProperties } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n query,\n environment,\n dropdownPosition,\n contextFunctionItems = [],\n listboxId,\n} = defineProps<{\n query: string\n environment?: XScalarEnvironment\n dropdownPosition?: { left: number; top: number }\n /** Runtime placeholders such as `{{$guid}}`, shown with environment variables */\n contextFunctionItems?: { key: string; description: string }[]\n /**\n * Id for the `role=\"listbox\"` element. When set, each option also receives a\n * stable id so the owning combobox input can reference the active option via\n * `aria-activedescendant` (W3C combobox pattern).\n */\n listboxId?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', variable: string): void\n (e: 'redirect'): void\n /**\n * Fired when the user dismisses the panel by clicking outside. The owning\n * combobox needs this to clear its `aria-expanded`/`aria-controls` state,\n * which would otherwise keep pointing at a listbox that is no longer mounted.\n */\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\ntype DropdownRow =\n | { kind: 'env'; key: string; secondary: string }\n | { kind: 'context'; key: string; secondary: string }\n\nconst isOpen = ref(true)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst selectedVariableIndex = ref(0)\n\nconst redirectToEnvironment = () => {\n emit('redirect')\n isOpen.value = false\n // The panel is gone, so tell the combobox to drop its aria-expanded /\n // aria-controls — otherwise they keep pointing at a dismissed listbox.\n emit('close')\n}\n\n/** Normalize the variables to have a name and value */\nconst normalizedVariables = computed(() =>\n (environment?.variables ?? []).map((v) => ({\n key: v.name,\n value: typeof v.value === 'string' ? v.value : v.value.default,\n })),\n)\n\nconst contextRows = computed((): DropdownRow[] =>\n contextFunctionItems.map((item) => ({\n kind: 'context',\n key: item.key,\n secondary: item.description,\n })),\n)\n\nconst envRows = computed((): DropdownRow[] =>\n normalizedVariables.value\n .filter(({ key, value }) => key !== '' || value !== '')\n .map(({ key, value }) => ({\n kind: 'env' as const,\n key,\n secondary: value,\n })),\n)\n\ntype FuseRow = DropdownRow & { fuseText: string }\n\nconst envFuseSource = computed((): FuseRow[] =>\n envRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst contextFuseSource = computed((): FuseRow[] =>\n contextRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst fuseEnv = computed(\n () =>\n new Fuse(envFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst fuseContext = computed(\n () =>\n new Fuse(contextFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst popularContextRows = computed((): DropdownRow[] => {\n const byKey = new Map(contextFunctionItems.map((c) => [c.key, c]))\n return POPULAR_CONTEXT_FUNCTION_KEYS.flatMap((key) => {\n const item = byKey.get(key)\n return item\n ? [\n {\n kind: 'context' as const,\n key: item.key,\n secondary: item.description,\n },\n ]\n : []\n })\n})\n\nconst DROPDOWN_LIMIT = 12\n\nconst filteredVariables = computed((): DropdownRow[] => {\n if (!query.trim()) {\n const envSlice = envRows.value.slice(-4)\n return [...envSlice, ...popularContextRows.value]\n }\n\n const q = query.trim()\n const envMatches = fuseEnv.value\n .search(q, { limit: DROPDOWN_LIMIT })\n .map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n\n const remaining = DROPDOWN_LIMIT - envMatches.length\n const contextMatches =\n remaining > 0\n ? fuseContext.value.search(q, { limit: remaining }).map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n : []\n\n return [...envMatches, ...contextMatches]\n})\n\nconst optionId = (index: number): string | undefined =>\n listboxId ? `${listboxId}-option-${index}` : undefined\n\n/**\n * Id of the currently highlighted option, for the combobox's\n * `aria-activedescendant`. Undefined when there is no list to point at.\n */\nconst activeOptionId = computed((): string | undefined =>\n filteredVariables.value.length\n ? optionId(selectedVariableIndex.value)\n : undefined,\n)\n\nconst selectVariable = (variableKey: string): void => {\n emit('select', variableKey)\n}\n\n// Narrowing the query shrinks the list; keep the highlight in range so both the\n// visible selection and `aria-activedescendant` never reference a dropped option.\nwatch(\n () => filteredVariables.value.length,\n (length) => {\n if (selectedVariableIndex.value > length - 1) {\n selectedVariableIndex.value = Math.max(0, length - 1)\n }\n },\n)\n\nconst handleArrowKey = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = filteredVariables.value.length\n\n if (length === 0) {\n return\n }\n\n selectedVariableIndex.value =\n (selectedVariableIndex.value + offset + length) % length\n}\n\nconst handleSelect = () => {\n if (selectedVariableIndex.value >= 0) {\n const selectedVariable =\n filteredVariables.value[selectedVariableIndex.value]\n if (selectedVariable) {\n selectVariable(selectedVariable.key)\n }\n }\n}\n\ndefineExpose({\n handleArrowKey,\n handleSelect,\n activeOptionId,\n})\n\nonMounted(() => {\n // Reset selected index to the first item when dropdown opens\n selectedVariableIndex.value = 0\n})\n\nconst dropdownStyle = computed<CSSProperties>(() => {\n return {\n left: (dropdownPosition?.left ?? 0) + 'px',\n // Add a 5px offset from the editor\n top: (dropdownPosition?.top ?? 0) + 5 + 'px',\n }\n})\n\nonClickOutside(\n dropdownRef,\n () => {\n isOpen.value = false\n emit('close')\n },\n { ignore: [dropdownRef] },\n)\n</script>\n<template>\n <ScalarTeleport\n v-if=\"isOpen\"\n class=\"scalar-client\">\n <div\n ref=\"dropdownRef\"\n class=\"custom-scroll z-context bg-b-1 dark:bg-b-1.5 fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75 shadow-lg\"\n :style=\"dropdownStyle\"\n @mousedown.prevent>\n <!--\n Always rendered (even with no matches) so the combobox's `aria-controls`\n always resolves to a real listbox; an empty list simply has no options.\n -->\n <ul\n :id=\"listboxId\"\n :aria-label=\"\n translate(\n 'apiClient.environmentVariablesDropdown.variableSuggestions',\n )\n \"\n class=\"gap-1/2 flex flex-col\"\n role=\"listbox\">\n <template\n v-for=\"(item, index) in filteredVariables\"\n :key=\"`${item.kind}-${item.key}`\">\n <li\n :id=\"optionId(index)\"\n :aria-selected=\"index === selectedVariableIndex\"\n class=\"font-code text-xxs hover:bg-b-3 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150\"\n :class=\"{ 'bg-b-3': index === selectedVariableIndex }\"\n role=\"option\"\n @click=\"selectVariable(item.key)\">\n <div class=\"flex items-center gap-2 whitespace-nowrap\">\n <span\n v-if=\"item.kind === 'env'\"\n class=\"h-2.25 w-2.25 min-w-2.25 rounded-full\"\n :style=\"{\n backgroundColor: environment?.color,\n }\" />\n <span\n v-else\n class=\"text-c-3 bg-b-3 flex h-4.5 min-w-4.5 items-center justify-center rounded px-0.5 font-sans text-[9px] font-semibold\">\n fn\n </span>\n {{ item.key }}\n </div>\n <span\n class=\"max-w-[9rem] overflow-hidden text-right text-ellipsis whitespace-nowrap\">\n {{ item.secondary }}\n </span>\n </li>\n </template>\n </ul>\n <ScalarButton\n v-if=\"!filteredVariables.length\"\n class=\"font-code text-xxs bg-b-inherit hover:bg-b-3 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150\"\n variant=\"outlined\"\n @click=\"redirectToEnvironment\">\n <ScalarIconPlus class=\"size-3\" />{{\n translate('apiClient.environmentVariablesDropdown.addVariable')\n }}\n </ScalarButton>\n </div>\n </ScalarTeleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuIA,IAAM,iBAAiB;;;;;;;;;;;;;;;;EAvGvB,MAAM,OAAO;EAWb,MAAM,EAAE,cAAc,gBAAgB;EAMtC,MAAM,SAAS,IAAI,IAAI;EACvB,MAAM,cAAc,IAAwB,IAAI;EAChD,MAAM,wBAAwB,IAAI,CAAC;EAEnC,MAAM,8BAA8B;GAClC,KAAK,UAAU;GACf,OAAO,QAAQ;GAGf,KAAK,OAAO;EACd;;EAGA,MAAM,sBAAsB,gBACzB,QAAA,aAAa,aAAa,CAAC,EAAA,CAAG,KAAK,OAAO;GACzC,KAAK,EAAE;GACP,OAAO,OAAO,EAAE,UAAU,WAAW,EAAE,QAAQ,EAAE,MAAM;EACzD,EAAE,CACJ;EAEA,MAAM,cAAc,eAClB,QAAA,qBAAqB,KAAK,UAAU;GAClC,MAAM;GACN,KAAK,KAAK;GACV,WAAW,KAAK;EAClB,EAAE,CACJ;EAEA,MAAM,UAAU,eACd,oBAAoB,MACjB,QAAQ,EAAE,KAAK,YAAY,QAAQ,MAAM,UAAU,EAAE,CAAA,CACrD,KAAK,EAAE,KAAK,aAAa;GACxB,MAAM;GACN;GACA,WAAW;EACb,EAAE,CACN;EAIA,MAAM,gBAAgB,eACpB,QAAQ,MAAM,KAAK,SAAS;GAC1B,GAAG;GACH,UAAU,GAAG,IAAI,IAAI,GAAG,IAAI;EAC9B,EAAE,CACJ;EAEA,MAAM,oBAAoB,eACxB,YAAY,MAAM,KAAK,SAAS;GAC9B,GAAG;GACH,UAAU,GAAG,IAAI,IA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;I,IAKlBF,mBAuCK,MAAA;KAtCF,IAAI,QAAA;KACJ,cAAuBF,MAAA,SAAA,CAAS,C;KAKjC,OAAM;KACN,MAAK;I,KACLF,UAAA,IAAA,GAAAO,mBA6BWC,UAAA,MAAAC,WA5Be,kBAAA,QAAhB,MAAM,UAAK;KAEnB,OAAAT,UAAA,GAAAO,mBAyBK,MAAA;MA1BI,KAAA,GAAA,KAAK,KAAI,GAAI,KAAK;MAExB,IAAI,SAAS,KAAK;MAClB,iBAAe,UAAU,sBAAA;MAC1B,OAAKG,eAAA,CAAC,6IAA2I,EAAA,UAC7H,UAAU,sBAAA,MAAqB,CAAA,CAAA;MACnD,MAAK;MACJ,UAAK,WAAE,eAAe,KAAK,GAAG;K,IAC/BN,mBAaM,OAbN,YAaM,CAXI,KAAK,SAAI,SADjBJ,UAAA,GAAAO,mBAKO,QAAA;;MAHL,OAAM;MACL,OAAKF,eAAA,EAAuC,iBAAA,QAAA,aAAa,M;K,gBAG5DL,UAAA,GAAAO,mBAIO,QAJP,YAE6H,MAE7H,IAAOI,gBAAA,MACPC,gBAAG,KAAK,GAAG,GAAA,CAAA,C,IAEbR,mBAGO,QAHP,YAGOQ,gBADF,KAAK,SAAS,GAAA,CAAA,C;I,4BAMhB,CAAA,kBAAA,MAAkB,UAD3BZ,UAAA,GAAAC,YAQeC,MAAA,YAAA,GAAA;;KANb,OAAM;KACN,SAAQ;KACP,SAAO;;KACR,SAAAC,cAAiC,CAAjCU,YAAiCX,MAAA,cAAA,GAAA,EAAjB,OAAM,SAAQ,CAAA,GAC5BS,gBAAAC,gBAAAV,MAAA,SAAA,CAAS,CAAA,oDAAA,CAAA,GAAA,CAAA,C"}
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesDropdown.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_normalizeStyle","_withModifiers","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode"],"sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarTeleport } from '@scalar/components/teleport'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { POPULAR_CONTEXT_FUNCTION_KEYS } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { onClickOutside } from '@vueuse/core'\nimport Fuse from 'fuse.js'\nimport { computed, onMounted, ref, watch, type CSSProperties } from 'vue'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n query,\n environment,\n dropdownPosition,\n contextFunctionItems = [],\n listboxId,\n} = defineProps<{\n query: string\n environment?: XScalarEnvironment\n dropdownPosition?: { left: number; top: number }\n /** Runtime placeholders such as `{{$guid}}`, shown with environment variables */\n contextFunctionItems?: { key: string; description: string }[]\n /**\n * Id for the `role=\"listbox\"` element. When set, each option also receives a\n * stable id so the owning combobox input can reference the active option via\n * `aria-activedescendant` (W3C combobox pattern).\n */\n listboxId?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'select', variable: string): void\n (e: 'redirect'): void\n /**\n * Fired when the user dismisses the panel by clicking outside. The owning\n * combobox needs this to clear its `aria-expanded`/`aria-controls` state,\n * which would otherwise keep pointing at a listbox that is no longer mounted.\n */\n (e: 'close'): void\n}>()\n\nconst { translate } = useLocalization()\n\ntype DropdownRow =\n | { kind: 'env'; key: string; secondary: string }\n | { kind: 'context'; key: string; secondary: string }\n\nconst isOpen = ref(true)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst selectedVariableIndex = ref(0)\n\nconst redirectToEnvironment = () => {\n emit('redirect')\n isOpen.value = false\n // The panel is gone, so tell the combobox to drop its aria-expanded /\n // aria-controls — otherwise they keep pointing at a dismissed listbox.\n emit('close')\n}\n\n/** Normalize the variables to have a name and value */\nconst normalizedVariables = computed(() =>\n (environment?.variables ?? []).map((v) => ({\n key: v.name,\n value: typeof v.value === 'string' ? v.value : v.value.default,\n })),\n)\n\nconst contextRows = computed((): DropdownRow[] =>\n contextFunctionItems.map((item) => ({\n kind: 'context',\n key: item.key,\n secondary: item.description,\n })),\n)\n\nconst envRows = computed((): DropdownRow[] =>\n normalizedVariables.value\n .filter(({ key, value }) => key !== '' || value !== '')\n .map(({ key, value }) => ({\n kind: 'env' as const,\n key,\n secondary: value,\n })),\n)\n\ntype FuseRow = DropdownRow & { fuseText: string }\n\nconst envFuseSource = computed((): FuseRow[] =>\n envRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst contextFuseSource = computed((): FuseRow[] =>\n contextRows.value.map((row) => ({\n ...row,\n fuseText: `${row.key} ${row.secondary}`,\n })),\n)\n\nconst fuseEnv = computed(\n () =>\n new Fuse(envFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst fuseContext = computed(\n () =>\n new Fuse(contextFuseSource.value, {\n keys: ['fuseText'],\n threshold: 0.35,\n }),\n)\n\nconst popularContextRows = computed((): DropdownRow[] => {\n const byKey = new Map(contextFunctionItems.map((c) => [c.key, c]))\n return POPULAR_CONTEXT_FUNCTION_KEYS.flatMap((key) => {\n const item = byKey.get(key)\n return item\n ? [\n {\n kind: 'context' as const,\n key: item.key,\n secondary: item.description,\n },\n ]\n : []\n })\n})\n\nconst DROPDOWN_LIMIT = 12\n\nconst filteredVariables = computed((): DropdownRow[] => {\n if (!query.trim()) {\n const envSlice = envRows.value.slice(-4)\n return [...envSlice, ...popularContextRows.value]\n }\n\n const q = query.trim()\n const envMatches = fuseEnv.value\n .search(q, { limit: DROPDOWN_LIMIT })\n .map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n\n const remaining = DROPDOWN_LIMIT - envMatches.length\n const contextMatches =\n remaining > 0\n ? fuseContext.value.search(q, { limit: remaining }).map((res) => {\n const { kind, key, secondary } = res.item\n return { kind, key, secondary }\n })\n : []\n\n return [...envMatches, ...contextMatches]\n})\n\nconst optionId = (index: number): string | undefined =>\n listboxId ? `${listboxId}-option-${index}` : undefined\n\n/**\n * Id of the currently highlighted option, for the combobox's\n * `aria-activedescendant`. Undefined when there is no list to point at.\n */\nconst activeOptionId = computed((): string | undefined =>\n filteredVariables.value.length\n ? optionId(selectedVariableIndex.value)\n : undefined,\n)\n\nconst selectVariable = (variableKey: string): void => {\n emit('select', variableKey)\n}\n\n// Narrowing the query shrinks the list; keep the highlight in range so both the\n// visible selection and `aria-activedescendant` never reference a dropped option.\nwatch(\n () => filteredVariables.value.length,\n (length) => {\n if (selectedVariableIndex.value > length - 1) {\n selectedVariableIndex.value = Math.max(0, length - 1)\n }\n },\n)\n\nconst handleArrowKey = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = filteredVariables.value.length\n\n if (length === 0) {\n return\n }\n\n selectedVariableIndex.value =\n (selectedVariableIndex.value + offset + length) % length\n}\n\nconst handleSelect = () => {\n if (selectedVariableIndex.value >= 0) {\n const selectedVariable =\n filteredVariables.value[selectedVariableIndex.value]\n if (selectedVariable) {\n selectVariable(selectedVariable.key)\n }\n }\n}\n\ndefineExpose({\n handleArrowKey,\n handleSelect,\n activeOptionId,\n})\n\nonMounted(() => {\n // Reset selected index to the first item when dropdown opens\n selectedVariableIndex.value = 0\n})\n\nconst dropdownStyle = computed<CSSProperties>(() => {\n return {\n left: (dropdownPosition?.left ?? 0) + 'px',\n // Add a 5px offset from the editor\n top: (dropdownPosition?.top ?? 0) + 5 + 'px',\n }\n})\n\nonClickOutside(\n dropdownRef,\n () => {\n isOpen.value = false\n emit('close')\n },\n { ignore: [dropdownRef] },\n)\n</script>\n<template>\n <ScalarTeleport\n v-if=\"isOpen\"\n class=\"scalar-client\">\n <div\n ref=\"dropdownRef\"\n class=\"custom-scroll z-context bg-b-1 dark:bg-b-1.5 fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75 shadow-lg\"\n :style=\"dropdownStyle\"\n @mousedown.prevent>\n <!--\n Always rendered (even with no matches) so the combobox's `aria-controls`\n always resolves to a real listbox; an empty list simply has no options.\n -->\n <ul\n :id=\"listboxId\"\n :aria-label=\"\n translate(\n 'apiClient.environmentVariablesDropdown.variableSuggestions',\n )\n \"\n class=\"gap-1/2 flex flex-col\"\n role=\"listbox\">\n <template\n v-for=\"(item, index) in filteredVariables\"\n :key=\"`${item.kind}-${item.key}`\">\n <li\n :id=\"optionId(index)\"\n :aria-selected=\"index === selectedVariableIndex\"\n class=\"font-code text-xxs hover:bg-b-3 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150\"\n :class=\"{ 'bg-b-3': index === selectedVariableIndex }\"\n role=\"option\"\n @click=\"selectVariable(item.key)\">\n <div class=\"flex items-center gap-2 whitespace-nowrap\">\n <span\n v-if=\"item.kind === 'env'\"\n class=\"h-2.25 w-2.25 min-w-2.25 rounded-full\"\n :style=\"{\n backgroundColor: environment?.color,\n }\" />\n <span\n v-else\n class=\"text-c-3 bg-b-3 flex h-4.5 min-w-4.5 items-center justify-center rounded px-0.5 font-sans text-[9px] font-semibold\">\n fn\n </span>\n {{ item.key }}\n </div>\n <span\n class=\"max-w-[9rem] overflow-hidden text-right text-ellipsis whitespace-nowrap\">\n {{ item.secondary }}\n </span>\n </li>\n </template>\n </ul>\n <ScalarButton\n v-if=\"!filteredVariables.length\"\n class=\"font-code text-xxs bg-b-inherit hover:bg-b-3 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150\"\n variant=\"outlined\"\n @click=\"redirectToEnvironment\">\n <ScalarIconPlus class=\"size-3\" />{{\n translate('apiClient.environmentVariablesDropdown.addVariable')\n }}\n </ScalarButton>\n </div>\n </ScalarTeleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuIA,IAAM,iBAAiB;;;;;;;;;;;;;;;;EAvGvB,MAAM,OAAO;EAWb,MAAM,EAAE,cAAc,gBAAgB;E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AqB,CAAA,CAAA;MACnD,MAAK;MACJ,UAAK,WAAE,eAAe,KAAK,GAAG;K,IAC/BN,mBAaM,OAbN,YAaM,CAXI,KAAK,SAAI,SADjBJ,UAAA,GAAAO,mBAKO,QAAA;;MAHL,OAAM;MACL,OAAKF,eAAA,EAAuC,iBAAA,QAAA,aAAa,M;K,gBAG5DL,UAAA,GAAAO,mBAIO,QAJP,YAE6H,MAE7H,IAAOI,gBAAA,MACPC,gBAAG,KAAK,GAAG,GAAA,CAAA,C,IAEbR,mBAGO,QAHP,YAGOQ,gBADF,KAAK,SAAS,GAAA,CAAA,C;I,4BAMhB,CAAA,kBAAA,MAAkB,UAD3BZ,UAAA,GAAAC,YAQeC,MAAA,YAAA,GAAA;;KANb,OAAM;KACN,SAAQ;KACP,SAAO;;KACR,SAAAC,cAAiC,CAAjCU,YAAiCX,MAAA,cAAA,GAAA,EAAjB,OAAM,SAAQ,CAAA,GAC5BS,gBAAAC,gBAAAV,MAAA,SAAA,CAAS,CAAA,oDAAA,CAAA,GAAA,CAAA,C"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
2
1
|
import EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default from "./EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js";
|
|
3
2
|
/* empty css */
|
|
4
|
-
|
|
3
|
+
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
// src/v2/features/environments/components/EnvironmentVariablesTable.vue
|
|
5
5
|
var EnvironmentVariablesTable_default = /*#__PURE__*/ _plugin_vue_export_helper_default(EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-4b7f675d"]]);
|
|
6
|
-
//#endregion
|
|
7
6
|
export { EnvironmentVariablesTable_default as default };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=EnvironmentVariablesTable.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesTable.vue.js","names":[
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesTable.vue.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useLocalization } from "../../localization/index.js";
|
|
2
1
|
import CodeInputLite_default from "../../../components/code-input/CodeInputLite.vue.js";
|
|
3
2
|
import DataTable_default from "../../../components/data-table/DataTable.vue.js";
|
|
4
3
|
import DataTableCell_default from "../../../components/data-table/DataTableCell.vue.js";
|
|
5
4
|
import DataTableHeader_default from "../../../components/data-table/DataTableHeader.vue.js";
|
|
6
5
|
import DataTableRow_default from "../../../components/data-table/DataTableRow.vue.js";
|
|
6
|
+
import { useLocalization } from "../../localization/index.js";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
8
8
|
import { ScalarButton } from "@scalar/components/button";
|
|
9
9
|
import { ScalarIconTrash } from "@scalar/icons";
|
|
10
|
-
|
|
10
|
+
// src/v2/features/environments/components/EnvironmentVariablesTable.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
12
12
|
__name: "EnvironmentVariablesTable",
|
|
13
13
|
props: {
|
|
@@ -153,7 +153,6 @@ var EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default = /*@_
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
|
-
//#endregion
|
|
157
156
|
export { EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default as default };
|
|
158
157
|
|
|
159
158
|
//# sourceMappingURL=EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","DataTable","_withCtx","_createVNode","DataTableRow","DataTableHeader","_createTextVNode","_toDisplayString","_createElementBlock","_Fragment","_renderList","DataTableCell","CodeInputLite"
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesTable.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","DataTable","_withCtx","_createVNode","DataTableRow","DataTableHeader","_createTextVNode","_toDisplayString","_createElementBlock","_Fragment","_renderList","DataTableCell","CodeInputLite"],"sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconTrash } from '@scalar/icons'\nimport type {\n CollectionType,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed } from 'vue'\n\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTable,\n DataTableCell,\n DataTableHeader,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { environment, environmentName, eventBus, collectionType } = defineProps<\n {\n environment: XScalarEnvironment\n environmentName: string\n eventBus: WorkspaceEventBus\n } & CollectionType\n>()\n\nconst { translate } = useLocalization()\n\n/** Column widths: Name, Value, Actions (delete button) */\nconst COLUMNS = ['1fr', '1fr', '36px']\n\n/** Adds an empty row at the end for creating new variables */\nconst displayRows = computed<\n {\n name: string\n value: string\n }[]\n>(() => {\n /** Normalize the variables to have a name and value */\n const variableRows = environment.variables.map((v) => ({\n name: v.name,\n value: typeof v.value === 'string' ? v.value : v.value.default,\n }))\n\n const lastRow = environment.variables.at(-1)\n const hasContentInLastRow =\n lastRow && (lastRow.name !== '' || lastRow.value !== '')\n\n // Add the extra row at the end\n if (!lastRow || hasContentInLastRow) {\n return [...variableRows, { name: '', value: '' }]\n }\n\n return variableRows\n})\n\n/** Updates an existing variable or creates a new one */\nconst handleVariableChange = (\n name: string,\n value: string,\n index: number,\n): void => {\n const isNewVariable = index >= environment.variables.length\n\n /**\n * Do not allow adding a new variable with an empty name on the last row,\n * we allow it on other rows as it will delete the row\n */\n if (!name && isNewVariable) {\n return\n }\n\n // Adding a new variable\n if (index >= environment.variables.length) {\n eventBus.emit('environment:upsert:environment-variable', {\n environmentName,\n variable: { name, value },\n collectionType,\n })\n return\n }\n\n // Updating\n eventBus.emit('environment:upsert:environment-variable', {\n environmentName,\n variable: { name, value },\n index,\n collectionType,\n })\n}\n\n/** Deletes a variable by index */\nconst handleVariableDelete = (index: number): void =>\n eventBus.emit('environment:delete:environment-variable', {\n environmentName,\n index,\n collectionType,\n })\n</script>\n<template>\n <!-- Environment variables table -->\n <DataTable\n class=\"group/table data-table h-min flex-1 rounded\"\n :columns=\"COLUMNS\">\n <!-- Accessibility header row -->\n <DataTableRow class=\"sr-only !block\">\n <DataTableHeader>\n {{ translate('apiClient.environmentVariablesTable.name') }}\n </DataTableHeader>\n <DataTableHeader>\n {{ translate('apiClient.environmentVariablesTable.value') }}\n </DataTableHeader>\n <DataTableHeader>\n {{ translate('apiClient.environmentVariablesTable.actions') }}\n </DataTableHeader>\n </DataTableRow>\n\n <!-- Variable rows -->\n <DataTableRow\n v-for=\"(row, index) in displayRows\"\n :key=\"index\"\n class=\"group/row\">\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"\n translate(\n 'apiClient.environmentVariablesTable.environmentVariableName',\n )\n \"\n :environment=\"undefined\"\n :modelValue=\"row.name\"\n :placeholder=\"translate('apiClient.environmentVariablesTable.name')\"\n @update:modelValue=\"\n (name) => handleVariableChange(name, row.value, index)\n \" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"\n translate(\n 'apiClient.environmentVariablesTable.environmentVariableValue',\n )\n \"\n :environment=\"undefined\"\n :modelValue=\"row.value\"\n :placeholder=\"translate('apiClient.environmentVariablesTable.value')\"\n @update:modelValue=\"\n (value) => handleVariableChange(row.name, value, index)\n \" />\n </DataTableCell>\n\n <!-- Delete button -->\n <DataTableCell class=\"flex items-center justify-center\">\n <ScalarButton\n v-if=\"index < environment.variables.length\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 hidden h-fit rounded p-1 group-focus-within:flex group-hover/row:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"handleVariableDelete(index)\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n </DataTableCell>\n </DataTableRow>\n </DataTable>\n</template>\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EA2BA,MAAM,EAAE,cAAc,gBAAgB;;EAGtC,MAAM,UAAU;GAAC;GAAO;GAAO;EAAM;;EAGrC,MAAM,cAAc,eAKZ;;GAEN,MAAM,eAAe,QAAA,YAAY,UAAU,KAAK,OAAO;IACrD,MAAM,EAAE;IACR,OAAO,OAAO,EAAE,UAAU,WAAW,EAAE,QAAQ,EAAE,MAAM;GACzD,EAAE;GAEF,MAAM,UAAU,QAAA,YAAY,UAAU,GAAG,EAAE;GAC3C,MAAM,sBACJ,YAAY,QAAQ,SAAS,MAAM,QAAQ,UAAU;GAGvD,IAAI,CAAC,WAAW,qBACd,OAAO,CAAC,GAAG,cAAc;IAAE,MAAM;IAAI,OAAO;GAAG,CAAC;GAGlD,OAAO;EACT,CAAC;;EAGD,MAAM,wBACJ,MACA,OACA,UACS;GACT,MAAM,gBAAgB,SAAS,QAAA,YAAY,UAAU;;;;;GAMrD,IAAI,CAAC,QAAQ,eACX;GAIF,IAAI,SAAS,QAAA,YAAY,UAAU,QAAQ;IACzC,QAAA,S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VH,cAAyBZ,MAAA,SAAA,CAAS,C;SAKlC,aAAa,KAAA;SACb,YAAY,IAAI;SAChB,aAAaA,MAAA,SAAA,CAAS,CAAA,0CAAA;SACtB,wBAAiC,SAAS,qBAAqB,MAAM,IAAI,OAAO,KAAK;;;;;;;;;OAM1FG,YAagBH,MAAAW,qBAAA,GAAA,MAAA;QAZd,SAAAT,cAWM,CAXNC,YAWMH,MAAAY,qBAAA,GAAA;SAVH,cAAyBZ,MAAA,SAAA,CAAS,C;SAKlC,aAAa,KAAA;SACb,YAAY,IAAI;SAChB,aAAaA,MAAA,SAAA,CAAS,CAAA,2CAAA;SACtB,wBAAiC,UAAU,qBAAqB,IAAI,MAAM,OAAO,KAAK;;;;;;;;;OAM3FG,YASgBH,MAAAW,qBAAA,GAAA,EATD,OAAM,mCAAkC,GAAA;QACrD,SAAAT,cAOe,CANP,QAAQ,QAAA,YAAY,UAAU,UADtCJ,UAAA,GAAAC,YAOeC,MAAA,YAAA,GAAA;;SALb,OAAM;SACN,MAAK;SACL,SAAQ;SACP,UAAK,WAAE,qBAAqB,KAAK;;SAClC,SAAAE,cAAoC,CAApCC,YAAoCH,MAAA,eAAA,GAAA,EAAnB,OAAM,WAAU,CAAA,C"}
|
|
@@ -8,7 +8,7 @@ import { zhCn } from "./locales/zh-cn.js";
|
|
|
8
8
|
import { zhTw } from "./locales/zh-tw.js";
|
|
9
9
|
import { en } from "./translations.js";
|
|
10
10
|
import { createLocalization } from "@scalar/localization";
|
|
11
|
-
|
|
11
|
+
// src/v2/features/localization/index.ts
|
|
12
12
|
/** API Client localization, also consumable beneath the API Reference provider. */
|
|
13
13
|
var { provideLocalization, useLocalization, resolveLocalization } = createLocalization({
|
|
14
14
|
localeTranslations: {
|
|
@@ -31,7 +31,6 @@ var { provideLocalization, useLocalization, resolveLocalization } = createLocali
|
|
|
31
31
|
]),
|
|
32
32
|
logPrefix: "[@scalar/api-client]"
|
|
33
33
|
});
|
|
34
|
-
//#endregion
|
|
35
34
|
export { provideLocalization, resolveLocalization, useLocalization };
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/v2/features/localization/locales/ar.ts
|
|
2
2
|
/** Built-in API Client translations for ar. */
|
|
3
3
|
var ar = {
|
|
4
4
|
"serverVariablesSelect": { "selected": "المحدد:" },
|
|
@@ -367,7 +367,6 @@ var ar = {
|
|
|
367
367
|
"deleteSidebarListElement": { "delete": "حذف {name}" },
|
|
368
368
|
"deleteModal": { "delete": "حذف {name}" }
|
|
369
369
|
};
|
|
370
|
-
//#endregion
|
|
371
370
|
export { ar };
|
|
372
371
|
|
|
373
372
|
//# sourceMappingURL=ar.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/v2/features/localization/locales/de.ts
|
|
2
2
|
/** Built-in API Client translations for de. */
|
|
3
3
|
var de = {
|
|
4
4
|
"serverVariablesSelect": { "selected": "Ausgewählt:" },
|
|
@@ -367,7 +367,6 @@ var de = {
|
|
|
367
367
|
"deleteSidebarListElement": { "delete": "{name} löschen" },
|
|
368
368
|
"deleteModal": { "delete": "{name} löschen" }
|
|
369
369
|
};
|
|
370
|
-
//#endregion
|
|
371
370
|
export { de };
|
|
372
371
|
|
|
373
372
|
//# sourceMappingURL=de.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/v2/features/localization/locales/es.ts
|
|
2
2
|
/** Built-in API Client translations for es. */
|
|
3
3
|
var es = {
|
|
4
4
|
"serverVariablesSelect": { "selected": "Seleccionado:" },
|
|
@@ -367,7 +367,6 @@ var es = {
|
|
|
367
367
|
"deleteSidebarListElement": { "delete": "Eliminar {name}" },
|
|
368
368
|
"deleteModal": { "delete": "Eliminar {name}" }
|
|
369
369
|
};
|
|
370
|
-
//#endregion
|
|
371
370
|
export { es };
|
|
372
371
|
|
|
373
372
|
//# sourceMappingURL=es.js.map
|