@scalar/api-client 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/assets/computer.ascii.virtual.js.map +1 -1
- package/dist/components/HelpfulLink.vue.script.js +1 -1
- package/dist/components/HelpfulLink.vue.script.js.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -1
- package/dist/components/SectionFilter.vue.d.ts +1 -1
- package/dist/components/SectionFilter.vue.d.ts.map +1 -1
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue.script.js +2 -2
- package/dist/components/SectionFilter.vue.script.js.map +1 -1
- package/dist/components/SectionFilterButton.vue.script.js +1 -1
- package/dist/components/SectionFilterButton.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.script.js.map +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.script.js +1 -1
- package/dist/components/Server/ServerVariablesTextbox.vue.script.js.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.script.js.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.script.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.script.js +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.script.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.script.js.map +1 -1
- package/dist/hooks/use-file-dialog.js +2 -1
- package/dist/hooks/use-file-dialog.js.map +1 -1
- package/dist/plugins/posthog/index.js.map +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.js +1 -1
- package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -1
- package/dist/style.css +296 -273
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +4 -2
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js +1 -1
- package/dist/v2/blocks/operation-block/components/OpenApiClientButton.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +58 -29
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +5 -3
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +6 -3
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +8 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +29 -16
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/files.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +10 -5
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-content.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts +54 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js +56 -0
- package/dist/v2/blocks/request-block/helpers/group-global-cookies.js.map +1 -0
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +1 -1
- package/dist/v2/blocks/request-block/helpers/structured-body-codec.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/validate-parameter.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyDownload.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyInfo.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyToggle.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyVirtual.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/extract-filename.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/media-types.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/prettify-jsonc-string.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +7 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +3 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +3 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-callback.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js +6 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js +5 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js +1 -0
- package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
- package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -1
- package/dist/v2/components/code-input/helpers/lookup-variable-value.js.map +1 -1
- package/dist/v2/components/code-input/helpers/pill-signature.js.map +1 -1
- package/dist/v2/components/code-input/helpers/serialize-value.js.map +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue.script.js +1 -1
- package/dist/v2/components/context-menu/ContextMenu.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTable.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTable.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableCell.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableHeader.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js +3 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableRow.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableText.vue.script.js +1 -1
- package/dist/v2/components/data-table/DataTableText.vue.script.js.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.script.js +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.script.js.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js +1 -1
- package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.script.js +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.script.js.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.script.js +1 -1
- package/dist/v2/components/modals/DeleteModal.vue.script.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
- package/dist/v2/components/resize/Resize.vue.js +1 -1
- package/dist/v2/components/resize/Resize.vue.script.js +1 -1
- package/dist/v2/components/resize/Resize.vue.script.js.map +1 -1
- package/dist/v2/components/resize/use-split-resize.js +4 -2
- package/dist/v2/components/resize/use-split-resize.js.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.script.js +1 -1
- package/dist/v2/components/server/ServerDropdownItem.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.script.js +3 -3
- package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.script.js +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js +1 -1
- package/dist/v2/components/sidebar/SidebarToggle.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.script.js +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.script.js +1 -1
- package/dist/v2/features/environments/components/Environment.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js +3 -2
- package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentCreateModal.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/map-hidden-clients-config.js.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.script.js +1 -1
- package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -1
- package/dist/v2/features/search/helpers/create-fuse-instance.js.map +1 -1
- package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
- package/dist/v2/features/search/hooks/use-document-search.js.map +1 -1
- package/dist/v2/features/search/hooks/use-search-index.js.map +1 -1
- package/dist/v2/helpers/generate-location-id.js.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
- package/dist/v2/helpers/test-utils.js.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js.map +1 -1
- package/dist/v2/hooks/use-scroll-lock.js.map +1 -1
- package/dist/v2/workspace-events.js.map +1 -1
- package/dist/vue-styles.css +227 -234
- package/package.json +20 -20
|
@@ -13,7 +13,7 @@ var _hoisted_3 = {
|
|
|
13
13
|
var _hoisted_4 = ["placeholder"];
|
|
14
14
|
var DEFAULT_GRADIENT = "linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122))";
|
|
15
15
|
/** Check if the active color is one of the preset options. */
|
|
16
|
-
var EnvironmentColors_vue_vue_type_script_setup_true_lang_default =
|
|
16
|
+
var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
17
17
|
__name: "EnvironmentColors",
|
|
18
18
|
props: { activeColor: {} },
|
|
19
19
|
emits: ["select"],
|
|
@@ -71,7 +71,8 @@ var EnvironmentColors_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
71
71
|
* Ensures the color value has a # prefix for hex colors.
|
|
72
72
|
*/
|
|
73
73
|
const selectColor = (color) => {
|
|
74
|
-
|
|
74
|
+
const formattedColor = color && !color.startsWith("#") ? `#${color}` : color;
|
|
75
|
+
emit("select", formattedColor);
|
|
75
76
|
showSelector.value = false;
|
|
76
77
|
};
|
|
77
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentColors.vue.script.js","names":[],"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.includes(activeColor as (typeof colorOptions)[number]),\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};`\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\"\n :style=\"{ backgroundColor: activeColor }\"\n @click=\"toggleSelector\">\n <ScalarIcon\n v-if=\"activeColor\"\n class=\"text-c-btn 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\"\n :style=\"{ backgroundColor: option }\"\n @click=\"selectColor(option)\">\n <ScalarIcon\n v-if=\"isActiveColor(option)\"\n class=\"text-c-btn 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-c-btn\"\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,
|
|
1
|
+
{"version":3,"file":"EnvironmentColors.vue.script.js","names":[],"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.includes(activeColor as (typeof colorOptions)[number]),\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};`\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\"\n :style=\"{ backgroundColor: activeColor }\"\n @click=\"toggleSelector\">\n <ScalarIcon\n v-if=\"activeColor\"\n class=\"text-c-btn 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\"\n :style=\"{ backgroundColor: option }\"\n @click=\"selectColor(option)\">\n <ScalarIcon\n v-if=\"isActiveColor(option)\"\n class=\"text-c-btn 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-c-btn\"\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,SAAS,QAAA,WAA4C,CACpE;;EAGA,MAAM,gBAAgB,eACd,QAAA,eAAe,CAAC,cAAc,SAAS,CAAC,g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AAE,YAAY,MAAM;UAElB,cAAc,MAAM,KAAA,UAAA,GAD5B,YAIc,MAAA,UAAA,GAAA;;OAFZ,OAAM;OACN,MAAK;OACL,MAAK;;;+BAIT,mBAA8C,MAAA,EAA1C,OAAM,kCAAiC,GAAA,MAAA,EAAA;KAG3C,mBAUS,UAAA;MATP,OAAM;MACL,OAAK,eAAE,kBAAA,KAAiB;MACzB,MAAK;MACJ,SAAO;SAEA,cAAA,SAAA,UAAA,GADR,YAIc,MAAA,UAAA,GAAA;;MAFZ,OAAM;MACN,MAAK;MACL,MAAK;;;IAMH,gBAAA,SAAA,UAAA,GADR,mBAsBM,OAtBN,YAsBM;+BAnBJ,mBAAmE,QAAA,EAA7D,OAAM,qDAAoD,GAAA,MAAA,EAAA;KAChE,mBAE+B,QAAA;MAD7B,OAAM;MACL,OAAK,eAAE,kBAAA,KAAiB;;oBAC3B,mBAMoC,SAAA;eAL9B;MAAJ,KAAI;+EACgB,QAAA;MACpB,OAAM;MACL,aAAa,QAAA,eAAW;MACzB,MAAK;MACJ,SAAO;6CAJC,YAAA,KAAW,CAAA,CAAA;KAKtB,mBAOS,UAAA;MANP,OAAM;MACN,MAAK;MACJ,SAAO;SACR,YAEc,MAAA,UAAA,GAAA;MADZ,MAAK;MACL,MAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentCreateModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"names":[],"mappings":"AAkJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAUpH,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentCreateModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentCreateModal.vue"],"names":[],"mappings":"AAkJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2EAA2E,CAAA;AAUpH,KAAK,WAAW,GAAG;IACf,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAA;IACvE,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;AAoNrB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -10,7 +10,7 @@ var _hoisted_2 = {
|
|
|
10
10
|
class: "text-red text-xs"
|
|
11
11
|
};
|
|
12
12
|
var DEFAULT_COLOR = "#FFFFFF";
|
|
13
|
-
var EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default =
|
|
13
|
+
var EnvironmentCreateModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
14
|
__name: "EnvironmentCreateModal",
|
|
15
15
|
props: {
|
|
16
16
|
environments: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentCreateModal.vue.script.js","names":[],"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'\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\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=\"Environment name\" />\n </div>\n\n <!-- Error message -->\n <div\n v-if=\"isDuplicateName\"\n class=\"text-red text-xs\">\n This environment name is already in use.\n </div>\n\n <!-- Submit button -->\n <template #submit>\n {{ selectedEnvironmentName ? 'Update' : 'Add' }} Environment\n </template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;AAgCA,IAAM,gBAAgB;;;;;;;;;;;;EAEtB,MAAM,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"EnvironmentCreateModal.vue.script.js","names":[],"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'\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\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=\"Environment name\" />\n </div>\n\n <!-- Error message -->\n <div\n v-if=\"isDuplicateName\"\n class=\"text-red text-xs\">\n This environment name is already in use.\n </div>\n\n <!-- Submit button -->\n <template #submit>\n {{ selectedEnvironmentName ? 'Update' : 'Add' }} Environment\n </template>\n </CommandActionForm>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;AAgCA,IAAM,gBAAgB;;;;;;;;;;;;EAEtB,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,cAAc,QAAQ,YAAY;IACpC,OAGK;KACH,KAAK,QAAQ;KACb,cAAc,QAAQ;IACxB;GACF;EACF,CACF;;;;;EAMA,MAAM,qBAAqB,UAAwB;GACjD,cAAc,QAAQ;EACxB;;EAGA,MAAM,qBAA2B;GAE/B,IAAI,QAAA,yBACF,QAAA,SAAS,KAAK,kCAAkC;IAC9C,oBAAoB,QAAA;IACpB,SAAS,EACP,OAAO,cAAc,MACvB;IACA,iBAAiB,KAAK,MAAM,KAAK;IACjC,gBAAa,QAAA;GACf,CAAC;QAID,QAAA,SAAS,KAAK,kCAAkC;IAC9C,iBAAiB,KAAK,MAAM,KAAK;IACjC,SAAS,EACP,OAAO,cAAc,MACvB;IACA,gBAAa,QAAA;GACf,CAAC;GAGH,QAAA,MAAM,KAAK;EACb;;EAGA,MAAM,kBAAkB,eAAe;GACrC,IAAI,QAAA,yBACF,OACE,KAAK,UAAU,QAAA,2BACf,OAAO,KAAK,QAAA,YAAY,CAAC,CAAC,SAAS,KAAK,KAAK;GAIjD,OAAO,OAAO,KAAK,QAAA,YAAY,CAAC,CAAC,SAAS,KAAK,KAAK;EACtD,CAAC;;uBAIC,YAiCc,MAAA,WAAA,GAAA;IAhCZ,WAAU;IACV,MAAK;IACJ,OAAO,QAAA;;2BA6BY,CA5BpB,YA4BoB,MAAA,yBAAA,GAAA;KA3BjB,UAAQ,CAAG,KAAA,MAAK,KAAI,KAAM,gBAAA;KAC1B,UAAQ;;KAuBE,QAAM,cACiC,CAAA,gBAAA,gBAA7C,QAAA,0BAAuB,WAAA,KAAA,IAAsB,iBAClD,CAAA,CAAA,CAAA;4BAZM,CAZN,mBAYM,OAZN,YAYM,CAVJ,YAGgC,2BAAA;MAF7B,aAAa,cAAA;MACd,OAAM;MACL,UAAQ;mCAGX,YAGmC,MAAA,0BAAA,GAAA;kBAFxB,KAAA;wEAAI,QAAA;MACb,OAAM;MACN,aAAY;oCAKR,gBAAA,SAAA,UAAA,GADR,mBAIM,OAJN,YAE2B,4CAE3B,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"names":[],"mappings":"AAuDA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentDeleteModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"names":[],"mappings":"AAuDA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB,CAAC;AA8HF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -3,7 +3,7 @@ import { ScalarButton } from "@scalar/components/button";
|
|
|
3
3
|
import { ScalarModal } from "@scalar/components/modal";
|
|
4
4
|
//#region src/v2/features/environments/components/EnvironmentDeleteModal.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = { class: "flex justify-between" };
|
|
6
|
-
var EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var EnvironmentDeleteModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "EnvironmentDeleteModal",
|
|
8
8
|
props: {
|
|
9
9
|
state: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentDeleteModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\n\nconst { state, name = 'unknown' } = defineProps<{\n state: ModalState\n name: string | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (event: 'submit'): void\n}>()\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg flex flex-col gap-4\"\n size=\"xxs\"\n :state=\"state\"\n :title=\"`Delete ${name}`\">\n <p class=\"text-c-2 text-sm leading-normal text-pretty\">\n Are you sure you want to delete this environment? This action cannot be\n undone.\n </p>\n <div class=\"flex justify-between\">\n <ScalarButton\n size=\"sm\"\n variant=\"outlined\"\n @click=\"\n () => {\n emit('cancel')\n state.hide()\n }\n \">\n Cancel\n </ScalarButton>\n <ScalarButton\n size=\"sm\"\n variant=\"danger\"\n @click=\"\n () => {\n emit('submit')\n state.hide()\n }\n \">\n Delete Environment\n </ScalarButton>\n </div>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,OAAO;;uBAOX,YAiCc,MAAA,
|
|
1
|
+
{"version":3,"file":"EnvironmentDeleteModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/environments/components/EnvironmentDeleteModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\n\nconst { state, name = 'unknown' } = defineProps<{\n state: ModalState\n name: string | null\n}>()\n\nconst emit = defineEmits<{\n (event: 'cancel'): void\n (event: 'submit'): void\n}>()\n</script>\n\n<template>\n <ScalarModal\n bodyClass=\"border-t-0 rounded-t-lg flex flex-col gap-4\"\n size=\"xxs\"\n :state=\"state\"\n :title=\"`Delete ${name}`\">\n <p class=\"text-c-2 text-sm leading-normal text-pretty\">\n Are you sure you want to delete this environment? This action cannot be\n undone.\n </p>\n <div class=\"flex justify-between\">\n <ScalarButton\n size=\"sm\"\n variant=\"outlined\"\n @click=\"\n () => {\n emit('cancel')\n state.hide()\n }\n \">\n Cancel\n </ScalarButton>\n <ScalarButton\n size=\"sm\"\n variant=\"danger\"\n @click=\"\n () => {\n emit('submit')\n state.hide()\n }\n \">\n Delete Environment\n </ScalarButton>\n </div>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;EASA,MAAM,OAAO;;uBAOX,YAiCc,MAAA,WAAA,GAAA;IAhCZ,WAAU;IACV,MAAK;IACJ,OAAO,QAAA;IACP,OAAK,UAAY,QAAA;;2BAId,CAAA,OAAA,OAAA,OAAA,KAHJ,mBAGI,KAAA,EAHD,OAAM,8CAA6C,GAAC,qFAGvD,EAAA,IACA,mBAuBM,OAvBN,YAuBM,CAtBJ,YAUe,MAAA,YAAA,GAAA;KATb,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAA;MAAiC,KAAI,QAAA;MAAuB,QAAA,MAAM,KAAI;;;4BAO9E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,YAEJ,EAAA,CAAA,EAAA,CAAA;;QACA,YAUe,MAAA,YAAA,GAAA;KATb,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,WAAA;MAAiC,KAAI,QAAA;MAAuB,QAAA,MAAM,KAAI;;;4BAO9E,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFI,wBAEJ,EAAA,CAAA,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"names":[],"mappings":"AAmTA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AASnH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,iFAAiF;IACjF,oBAAoB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC7D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesDropdown.vue"],"names":[],"mappings":"AAmTA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AASnH,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,iFAAiF;IACjF,oBAAoB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC7D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAibF,QAAA,MAAM,YAAY;gCA7QiB,IAAI,GAAG,MAAM;;;;;;;;;;;kFAiR9C,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -19,7 +19,7 @@ var _hoisted_4 = {
|
|
|
19
19
|
};
|
|
20
20
|
var _hoisted_5 = { class: "max-w-[9rem] overflow-hidden text-right text-ellipsis whitespace-nowrap" };
|
|
21
21
|
var DROPDOWN_LIMIT = 12;
|
|
22
|
-
var EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default =
|
|
22
|
+
var EnvironmentVariablesDropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
23
|
__name: "EnvironmentVariablesDropdown",
|
|
24
24
|
props: {
|
|
25
25
|
query: {},
|
package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesDropdown.vue.script.js","names":[],"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\ntype DropdownRow =\n | { kind: 'env'; key: string; secondary: string }\n | { kind: 'context'; key: string; secondary: string }\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 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 fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75\"\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=\"Variable suggestions\"\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 Add Variable\n </ScalarButton>\n <!-- Backdrop for the dropdown -->\n <div\n class=\"bg-b-1 brightness-lifted absolute inset-0 -z-1 rounded shadow-lg\" />\n </div>\n </ScalarTeleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmIA,IAAM,iBAAiB;;;;;;;;;;;;;;;;EAjGvB,MAAM,OAAO;EAWb,MAAM,SAAS,IAAI,KAAI;EACvB,MAAM,cAAc,IAAwB,KAAI;EAChD,MAAM,wBAAwB,IAAI,EAAC;EAEnC,MAAM,8BAA8B;AAClC,QAAK,WAAU;AACf,UAAO,QAAQ;AAGf,QAAK,QAAO;;;EAId,MAAM,sBAAsB,gBACzB,QAAA,aAAa,aAAa,EAAE,EAAE,KAAK,OAAO;GACzC,KAAK,EAAE;GACP,OAAO,OAAO,EAAE,UAAU,WAAW,EAAE,QAAQ,EAAE,MAAM;GACxD,EAAE,CACL;EAEA,MAAM,cAAc,eAClB,QAAA,qBAAqB,KAAK,UAAU;GAClC,MAAM;GACN,KAAK,KAAK;GACV,WAAW,KAAK;GACjB,EAAE,CACL;EAEA,MAAM,UAAU,eACd,oBAAoB,MACjB,QAAQ,EAAE,KAAK,YAAY,QAAQ,MAAM,UAAU,GAAE,CACrD,KAAK,EAAE,KAAK,aAAa;GACxB,MAAM;GACN;GACA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;cAvDA;KAAJ,KAAI;KACJ,OAAM;KACL,OAAK,eAAE,cAAA,MAAa;KACpB,aAAS,OAAA,OAAA,OAAA,KAAA,oBAAV,IAAkB,CAAA,UAAA,CAAA;;KAKlB,mBAmCK,MAAA;MAlCF,IAAI,QAAA;MACL,cAAW;MACX,OAAM;MACN,MAAK;2BACL,mBA6BW,UAAA,MAAA,WA5Be,kBAAA,QAAhB,MAAM,UAAK;0BAEnB,mBAyBK,MAAA;eA1BI,KAAK,KAAI,GAAI,KAAK;OAExB,IAAI,SAAS,MAAK;OAClB,iBAAe,UAAU,sBAAA;OAC1B,OAAK,eAAA,CAAC,6IAA2I,EAAA,UAC7H,UAAU,sBAAA,OAAqB,CAAA,CAAA;OACnD,MAAK;OACJ,UAAK,WAAE,eAAe,KAAK,IAAG;UAC/B,mBAaM,OAbN,YAaM,CAXI,KAAK,SAAI,SAAA,WAAA,EADjB,mBAKO,QAAA;;OAHL,OAAM;OACL,OAAK,eAAA,EAAA,iBAAuC,QAAA,aAAa,OAAA,CAAA;mCAG5D,mBAIO,QAJP,YAE6H,OAE7H,GAAA,gBAAO,MACP,gBAAG,KAAK,IAAG,EAAA,EAAA,CAAA,CAAA,EAEb,mBAGO,QAHP,YAGO,gBADF,KAAK,UAAS,EAAA,EAAA,CAAA,EAAA,IAAA,WAAA;;MAMhB,kBAAA,MAAkB,UAAA,WAAA,EAD3B,YAOe,MAAA,aAAA,EAAA;;MALb,OAAM;MACN,SAAQ;MACP,SAAO;;6BACyB,CAAjC,YAAiC,MAAA,eAAA,EAAA,EAAjB,OAAM,UAAQ,CAAA,EAAA,OAAA,OAAA,OAAA,KAAA,gBAAG,kBAEnC,GAAA,EAAA,CAAA;;;+BAEA,mBAC6E,OAAA,EAA3E,OAAM,oEAAkE,EAAA,MAAA,GAAA"}
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesDropdown.vue.script.js","names":[],"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\ntype DropdownRow =\n | { kind: 'env'; key: string; secondary: string }\n | { kind: 'context'; key: string; secondary: string }\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 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 fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75\"\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=\"Variable suggestions\"\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 Add Variable\n </ScalarButton>\n <!-- Backdrop for the dropdown -->\n <div\n class=\"bg-b-1 brightness-lifted absolute inset-0 -z-1 rounded shadow-lg\" />\n </div>\n </ScalarTeleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmIA,IAAM,iBAAiB;;;;;;;;;;;;;;;;EAjGvB,MAAM,OAAO;EAWb,MAAM,SAAS,IAAI,IAAI;EACvB,MAAM,cAAc,IAAwB,IAAI;EAChD,MAAM,wBAAwB,IAAI,CAAC;EAEnC,MAAM,8BAA8B;GAClC,KAAK,UAAU;GACf,OAAO,QAAQ;GAGf,K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K,GAAG,GAAA,CAAA,CAAA,CAAA,GAEb,mBAGO,QAHP,YAGO,gBADF,KAAK,SAAS,GAAA,CAAA,CAAA,GAAA,IAAA,UAAA;;MAMhB,kBAAA,MAAkB,UAAA,UAAA,GAD3B,YAOe,MAAA,YAAA,GAAA;;MALb,OAAM;MACN,SAAQ;MACP,SAAO;;6BACyB,CAAjC,YAAiC,MAAA,cAAA,GAAA,EAAjB,OAAM,SAAQ,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,gBAAG,kBAEnC,EAAA,EAAA,CAAA;;;+BAEA,mBAC6E,OAAA,EAA3E,OAAM,mEAAkE,GAAA,MAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAWnH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/environments/components/EnvironmentVariablesTable.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAWnH,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GAAG,cAAc,CAAC;AAmWrB,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
|
|
|
2
2
|
import EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default from "./EnvironmentVariablesTable.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/features/environments/components/EnvironmentVariablesTable.vue
|
|
5
|
-
var EnvironmentVariablesTable_default =
|
|
5
|
+
var EnvironmentVariablesTable_default = /*#__PURE__*/ _plugin_vue_export_helper_default(EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5b336842"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { EnvironmentVariablesTable_default as default };
|
|
8
8
|
|
|
@@ -7,7 +7,7 @@ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock
|
|
|
7
7
|
import { ScalarButton } from "@scalar/components/button";
|
|
8
8
|
import { ScalarIconTrash } from "@scalar/icons";
|
|
9
9
|
//#region src/v2/features/environments/components/EnvironmentVariablesTable.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default =
|
|
10
|
+
var EnvironmentVariablesTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
11
11
|
__name: "EnvironmentVariablesTable",
|
|
12
12
|
props: {
|
|
13
13
|
environment: {},
|
package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentVariablesTable.vue.script.js","names":[],"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'\n\nconst { environment, environmentName, eventBus, collectionType } = defineProps<\n {\n environment: XScalarEnvironment\n environmentName: string\n eventBus: WorkspaceEventBus\n } & CollectionType\n>()\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>Name</DataTableHeader>\n <DataTableHeader>Value</DataTableHeader>\n <DataTableHeader>Actions</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=\"Environment Variable Name\"\n :environment=\"undefined\"\n :modelValue=\"row.name\"\n placeholder=\"Name\"\n @update:modelValue=\"\n (name) => handleVariableChange(name, row.value, index)\n \" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <CodeInputLite\n aria-label=\"Environment Variable Value\"\n :environment=\"undefined\"\n :modelValue=\"row.value\"\n placeholder=\"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,UAAU;GAAC;GAAO;GAAO;
|
|
1
|
+
{"version":3,"file":"EnvironmentVariablesTable.vue.script.js","names":[],"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'\n\nconst { environment, environmentName, eventBus, collectionType } = defineProps<\n {\n environment: XScalarEnvironment\n environmentName: string\n eventBus: WorkspaceEventBus\n } & CollectionType\n>()\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>Name</DataTableHeader>\n <DataTableHeader>Value</DataTableHeader>\n <DataTableHeader>Actions</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=\"Environment Variable Name\"\n :environment=\"undefined\"\n :modelValue=\"row.name\"\n placeholder=\"Name\"\n @update:modelValue=\"\n (name) => handleVariableChange(name, row.value, index)\n \" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <CodeInputLite\n aria-label=\"Environment Variable Value\"\n :environment=\"undefined\"\n :modelValue=\"row.value\"\n placeholder=\"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,UAAU;GAAC;GAAO;GAAO;EAAM;;EAGrC,MAAM,cAAc,e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IAC5D,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;CAC5C,CAAA;AAED;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;aAC0C,mBAAmB;;;;;aAAnB,mBAAmB;iGA4Q3E,CAAC"}
|
|
@@ -17,7 +17,7 @@ var _hoisted_2 = {
|
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "flex h-full w-full items-center justify-center"
|
|
19
19
|
};
|
|
20
|
-
var Modal_vue_vue_type_script_setup_true_lang_default =
|
|
20
|
+
var Modal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
21
21
|
__name: "Modal",
|
|
22
22
|
props: {
|
|
23
23
|
workspaceStore: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.vue.script.js","names":[],"sources":["../../../../src/v2/features/modal/Modal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type ModalProps = {\n /** The workspace store must be initialized and passed in */\n workspaceStore: WorkspaceStore\n /** The document must be initialized and passed in. OpenAPI-only — the modal has no AsyncAPI path. */\n document: ComputedRef<OpenApiDocument | null>\n /** The path must be initialized and passed in */\n path: ComputedRef<string | undefined>\n /** The event bus for handling all events */\n eventBus: WorkspaceEventBus\n /** The method must be initialized and passed in */\n method: ComputedRef<HttpMethod | undefined>\n /** The example name must be initialized and passed in */\n exampleName: ComputedRef<string | undefined>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection: Ref<Record<string, number>>\n /** Controls the visibility of the modal */\n modalState: ModalState\n /** The sidebar state must be initialized and passed in */\n sidebarState: UseModalSidebarReturn\n /** Api client plugins to include in the modal */\n plugins: ClientPlugin[]\n /** Subset of the configuration options for the modal */\n options: MaybeRefOrGetter<ApiClientOptions>\n}\n\n/**\n * Scalar Api Client Modal\n *\n * This component is used to render the API Client Modal\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ScalarListboxOption } from '@scalar/components/listbox'\nimport type { ModalState } from '@scalar/components/modal'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getActiveEnvironment } from '@scalar/workspace-store/request-example'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport {\n computed,\n onBeforeUnmount,\n ref,\n watch,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from 'vue'\n\nimport ModalClientContainer from '@/v2/components/modals/ModalClientContainer.vue'\nimport { Sidebar, SidebarToggle } from '@/v2/components/sidebar'\nimport { type UseModalSidebarReturn } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport { initializeModalEvents } from '@/v2/features/modal/modal-events'\nimport Operation from '@/v2/features/operation/Operation.vue'\nimport { useGlobalHotKeys } from '@/v2/hooks/use-global-hot-keys'\nimport { useScrollLock } from '@/v2/hooks/use-scroll-lock'\nimport type { ApiClientOptions, ApiClientOptionsRef } from '@/v2/types/options'\n\nconst {\n document,\n eventBus,\n modalState,\n options,\n plugins,\n requestBodyCompositionSelection,\n sidebarState,\n workspaceStore,\n} = defineProps<\n Omit<ModalProps, 'options'> & { options: ApiClientOptionsRef }\n>()\n\nconst activeWorkspace: ScalarListboxOption = {\n label: 'default',\n id: 'default',\n}\n\n/** Controls the visibility of the sidebar. */\nconst isSidebarOpen = ref(false)\n\n/** Initialize modal events */\ninitializeModalEvents({\n eventBus,\n isSidebarOpen,\n requestBodyCompositionSelection,\n sidebarState,\n modalState,\n store: workspaceStore,\n})\n\n/** Register global hotkeys for the app, passing the workspace event bus and layout state */\nuseGlobalHotKeys(eventBus, 'modal', () => !modalState.open)\n\n/** Clean up on close */\nconst cleanUp = () => {\n eventBus.emit('operation:cancel:request')\n}\n\nconst isLocked = useScrollLock(() => {\n if (typeof window !== 'undefined') {\n return window.document.body\n }\n return null\n})\n\nwatch(\n () => modalState.open,\n (open) => {\n // Make sure scrolling is locked or unlocked when the modal is opened or closed\n isLocked.value = open\n\n if (!open) {\n cleanUp()\n }\n },\n)\n\n// Ensure we add our scalar wrapper class to the headless ui root\nonBeforeUnmount(() => cleanUp())\n\n/** Default sidebar width in pixels. */\nconst DEFAULT_SIDEBAR_WIDTH = 288\n\n/** Width of the sidebar, with fallback to default. */\nconst sidebarWidth = computed(\n () =>\n workspaceStore?.workspace?.['x-scalar-sidebar-width'] ??\n DEFAULT_SIDEBAR_WIDTH,\n)\n\n/** Handler for sidebar width changes. */\nconst handleSidebarWidthUpdate = (width: number) =>\n workspaceStore?.update('x-scalar-sidebar-width', width)\n\n/**\n * Merged environment variables from workspace and document levels.\n * Variables from both sources are combined, with document variables\n * taking precedence in case of naming conflicts.\n */\nconst environment = computed(\n () => getActiveEnvironment(workspaceStore, document.value).environment,\n)\n\ndefineExpose({\n sidebarWidth,\n environment,\n})\n</script>\n\n<template>\n <ModalClientContainer :modalState>\n <!-- Toasts -->\n <ScalarToasts />\n\n <!-- If we have a document, path and method, render the operation -->\n <main\n v-if=\"document.value && path?.value && method?.value\"\n class=\"relative flex h-full min-h-0 w-full flex-1\">\n <SidebarToggle\n v-model=\"isSidebarOpen\"\n class=\"absolute top-2 left-4 z-10 max-md:top-4\" />\n <Sidebar\n v-show=\"isSidebarOpen\"\n v-model:sidebarWidth=\"sidebarWidth\"\n :activeWorkspace=\"activeWorkspace\"\n class=\"h-full max-md:absolute! max-md:z-5 max-md:w-full!\"\n :documents=\"[document.value]\"\n :eventBus\n :isDroppable=\"() => false\"\n layout=\"modal\"\n :sidebarState=\"sidebarState.state\"\n :workspaces=\"[]\"\n @selectItem=\"sidebarState.handleSelectItem\"\n @update:sidebarWidth=\"handleSidebarWidthUpdate\" />\n <Operation\n :activeWorkspace=\"activeWorkspace\"\n class=\"flex-1\"\n :document=\"document.value\"\n :documentSlug=\"document.value['x-scalar-navigation']?.name ?? ''\"\n :environment\n :eventBus\n :exampleName=\"exampleName?.value\"\n layout=\"modal\"\n :method=\"method?.value\"\n :options\n :path=\"path?.value\"\n :plugins\n :requestBodyCompositionSelection=\"requestBodyCompositionSelection.value\"\n :workspaceStore />\n </main>\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">No document selected</span>\n </div>\n </ModalClientContainer>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,MAAM,kBAAuC;GAC3C,OAAO;GACP,IAAI;
|
|
1
|
+
{"version":3,"file":"Modal.vue.script.js","names":[],"sources":["../../../../src/v2/features/modal/Modal.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type ModalProps = {\n /** The workspace store must be initialized and passed in */\n workspaceStore: WorkspaceStore\n /** The document must be initialized and passed in. OpenAPI-only — the modal has no AsyncAPI path. */\n document: ComputedRef<OpenApiDocument | null>\n /** The path must be initialized and passed in */\n path: ComputedRef<string | undefined>\n /** The event bus for handling all events */\n eventBus: WorkspaceEventBus\n /** The method must be initialized and passed in */\n method: ComputedRef<HttpMethod | undefined>\n /** The example name must be initialized and passed in */\n exampleName: ComputedRef<string | undefined>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection: Ref<Record<string, number>>\n /** Controls the visibility of the modal */\n modalState: ModalState\n /** The sidebar state must be initialized and passed in */\n sidebarState: UseModalSidebarReturn\n /** Api client plugins to include in the modal */\n plugins: ClientPlugin[]\n /** Subset of the configuration options for the modal */\n options: MaybeRefOrGetter<ApiClientOptions>\n}\n\n/**\n * Scalar Api Client Modal\n *\n * This component is used to render the API Client Modal\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ScalarListboxOption } from '@scalar/components/listbox'\nimport type { ModalState } from '@scalar/components/modal'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getActiveEnvironment } from '@scalar/workspace-store/request-example'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport {\n computed,\n onBeforeUnmount,\n ref,\n watch,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from 'vue'\n\nimport ModalClientContainer from '@/v2/components/modals/ModalClientContainer.vue'\nimport { Sidebar, SidebarToggle } from '@/v2/components/sidebar'\nimport { type UseModalSidebarReturn } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport { initializeModalEvents } from '@/v2/features/modal/modal-events'\nimport Operation from '@/v2/features/operation/Operation.vue'\nimport { useGlobalHotKeys } from '@/v2/hooks/use-global-hot-keys'\nimport { useScrollLock } from '@/v2/hooks/use-scroll-lock'\nimport type { ApiClientOptions, ApiClientOptionsRef } from '@/v2/types/options'\n\nconst {\n document,\n eventBus,\n modalState,\n options,\n plugins,\n requestBodyCompositionSelection,\n sidebarState,\n workspaceStore,\n} = defineProps<\n Omit<ModalProps, 'options'> & { options: ApiClientOptionsRef }\n>()\n\nconst activeWorkspace: ScalarListboxOption = {\n label: 'default',\n id: 'default',\n}\n\n/** Controls the visibility of the sidebar. */\nconst isSidebarOpen = ref(false)\n\n/** Initialize modal events */\ninitializeModalEvents({\n eventBus,\n isSidebarOpen,\n requestBodyCompositionSelection,\n sidebarState,\n modalState,\n store: workspaceStore,\n})\n\n/** Register global hotkeys for the app, passing the workspace event bus and layout state */\nuseGlobalHotKeys(eventBus, 'modal', () => !modalState.open)\n\n/** Clean up on close */\nconst cleanUp = () => {\n eventBus.emit('operation:cancel:request')\n}\n\nconst isLocked = useScrollLock(() => {\n if (typeof window !== 'undefined') {\n return window.document.body\n }\n return null\n})\n\nwatch(\n () => modalState.open,\n (open) => {\n // Make sure scrolling is locked or unlocked when the modal is opened or closed\n isLocked.value = open\n\n if (!open) {\n cleanUp()\n }\n },\n)\n\n// Ensure we add our scalar wrapper class to the headless ui root\nonBeforeUnmount(() => cleanUp())\n\n/** Default sidebar width in pixels. */\nconst DEFAULT_SIDEBAR_WIDTH = 288\n\n/** Width of the sidebar, with fallback to default. */\nconst sidebarWidth = computed(\n () =>\n workspaceStore?.workspace?.['x-scalar-sidebar-width'] ??\n DEFAULT_SIDEBAR_WIDTH,\n)\n\n/** Handler for sidebar width changes. */\nconst handleSidebarWidthUpdate = (width: number) =>\n workspaceStore?.update('x-scalar-sidebar-width', width)\n\n/**\n * Merged environment variables from workspace and document levels.\n * Variables from both sources are combined, with document variables\n * taking precedence in case of naming conflicts.\n */\nconst environment = computed(\n () => getActiveEnvironment(workspaceStore, document.value).environment,\n)\n\ndefineExpose({\n sidebarWidth,\n environment,\n})\n</script>\n\n<template>\n <ModalClientContainer :modalState>\n <!-- Toasts -->\n <ScalarToasts />\n\n <!-- If we have a document, path and method, render the operation -->\n <main\n v-if=\"document.value && path?.value && method?.value\"\n class=\"relative flex h-full min-h-0 w-full flex-1\">\n <SidebarToggle\n v-model=\"isSidebarOpen\"\n class=\"absolute top-2 left-4 z-10 max-md:top-4\" />\n <Sidebar\n v-show=\"isSidebarOpen\"\n v-model:sidebarWidth=\"sidebarWidth\"\n :activeWorkspace=\"activeWorkspace\"\n class=\"h-full max-md:absolute! max-md:z-5 max-md:w-full!\"\n :documents=\"[document.value]\"\n :eventBus\n :isDroppable=\"() => false\"\n layout=\"modal\"\n :sidebarState=\"sidebarState.state\"\n :workspaces=\"[]\"\n @selectItem=\"sidebarState.handleSelectItem\"\n @update:sidebarWidth=\"handleSidebarWidthUpdate\" />\n <Operation\n :activeWorkspace=\"activeWorkspace\"\n class=\"flex-1\"\n :document=\"document.value\"\n :documentSlug=\"document.value['x-scalar-navigation']?.name ?? ''\"\n :environment\n :eventBus\n :exampleName=\"exampleName?.value\"\n layout=\"modal\"\n :method=\"method?.value\"\n :options\n :path=\"path?.value\"\n :plugins\n :requestBodyCompositionSelection=\"requestBodyCompositionSelection.value\"\n :workspaceStore />\n </main>\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">No document selected</span>\n </div>\n </ModalClientContainer>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,MAAM,kBAAuC;GAC3C,OAAO;GACP,IAAI;EACN;;EAGA,MAAM,gBAAgB,IAAI,KAAK;;EAG/B,sBAAsB;GACpB,UAAO,QAAA;GACP;GACA,iCAA8B,QAAA;GAC9B,cAAW,QAAA;GACX,YAAS,QAAA;GACT,OAAO,QAAA;EACT,CAAC;;EAGD,iBAAiB,QAAA,UAAU,eAAe,CAAC,QAAA,WAAW,IAAI;;EAG1D,MAAM,gBAAgB;GACpB,QAAA,SAAS,KAAK,0BAA0B;EAC1C;EAEA,MAAM,WAAW,oBAAoB;GACnC,IAAI,OAAO,WAAW,aACpB,OAAO,OAAO,SAAS;GAEzB,OAAO;EACT,CAAC;EAED,YACQ,QAAA,WAAW,OAChB,SAAS;GAER,SAAS,QAAQ;GAEjB,IAAI,CAAC,MACH,QAAQ;EAEZ,CACF;EAGA,sBAAsB,QAAQ,CAAC;;EAG/B,MAAM,wBAAwB;;EAG9B,MAAM,eAAe,eAEjB,QAAA,gBAAgB,YAAY,6BAC5B,qBACJ;;EAGA,MAAM,4BAA4B,UAChC,QAAA,gBAAgB,OAAO,0BAA0B,KAAK;;;;;;EAOxD,MAAM,cAAc,eACZ,qBAAqB,QAAA,gBAAgB,QAAA,SAAS,KAAK,CAAC,CAAC,WAC7D;EAEA,SAAa;GACX;GACA;EACF,CAAC;;uBAIC,YA8CuB,8BAAA,EA9CA,YAAA,QAAA,WAAU,GAAA;2BAEf,CAAhB,YAAgB,MAAA,YAAA,CAAA,GAIR,QAAA,SAAS,SAAS,QAAA,MAAM,SAAS,QAAA,QAAQ,SAAA,UAAA,GADjD,mBAkCO,QAlCP,YAkCO;KA/BL,YAEoD,MAAA,qBAAA,GAAA;kBADzC,cAAA;iFAAa,QAAA;MACtB,OAAM;;oBACR,YAYoD,MAAA,eAAA,GAAA;MAV1C,cAAc,aAAA;mFAAY,QAAA,SAUZ,wBAAA;MATJ;MAClB,OAAM;MACL,WAAS,CAAG,QAAA,SAAS,KAAK;MAC1B,UAAA,QAAA;MACA,mBAAa;MACd,QAAO;MACN,cAAc,QAAA,aAAa;MAC3B,YAAY,CAAA;MACZ,cAAY,QAAA,aAAa;;;;;;;kBAVlB,cAAA,KAAa,CAAA,CAAA;KAYvB,YAcoB,mBAAA;MAbA;MAClB,OAAM;MACL,UAAU,QAAA,SAAS;MACnB,cAAc,QAAA,SAAS,MAAK,sBAAA,EAAyB,QAAI;MACzD,aAAA,YAAA;MACA,UAAA,QAAA;MACA,aAAa,QAAA,aAAa;MAC3B,QAAO;MACN,QAAQ,QAAA,QAAQ;MAChB,SAAA,QAAA;MACA,MAAM,QAAA,MAAM;MACZ,SAAA,QAAA;MACA,iCAAiC,QAAA,gCAAgC;MACjE,gBAAA,QAAA;;;;;;;;;;;;;;wBAGL,mBAIM,OAJN,YAIM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CADJ,mBAAkD,QAAA,EAA5C,OAAM,WAAU,GAAC,wBAAoB,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA"}
|
|
@@ -101,14 +101,25 @@ var createApiClientModal = ({ el, eventBus = createWorkspaceEventBus({ debug: fa
|
|
|
101
101
|
};
|
|
102
102
|
if (mountOnInitialize) mount();
|
|
103
103
|
return {
|
|
104
|
+
/** The Vue app instance for the modal. Use with caution. */
|
|
104
105
|
app,
|
|
106
|
+
/** Open the modal and optionally navigate to a specific route. */
|
|
105
107
|
open: (payload) => {
|
|
106
108
|
modalState.open = true;
|
|
107
109
|
if (payload) route(payload);
|
|
108
110
|
},
|
|
111
|
+
/** Mount the modal to a given element. */
|
|
109
112
|
mount,
|
|
113
|
+
/** Navigate to the specified path, method, and example. */
|
|
110
114
|
route,
|
|
115
|
+
/** Controls the visibility of the modal. */
|
|
111
116
|
modalState,
|
|
117
|
+
/**
|
|
118
|
+
* Merge new options into the current modal options.
|
|
119
|
+
*
|
|
120
|
+
* @param newOptions - The new options to merge into the current modal options.
|
|
121
|
+
* @param overwrite - Whether to overwrite the current modal options with the new options. If false, the new options will be merged with the current options.
|
|
122
|
+
*/
|
|
112
123
|
updateOptions: (newOptions, overwrite = false) => {
|
|
113
124
|
optionsRef.value = overwrite ? newOptions : {
|
|
114
125
|
...optionsRef.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-api-client-modal.js","names":[],"sources":["../../../../../src/v2/features/modal/helpers/create-api-client-modal.ts"],"sourcesContent":["import { type ModalState, useModal } from '@scalar/components/modal'\nimport { type ClientPlugin, subscribePluginEvents } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { type WorkspaceEventBus, createWorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type App, type MaybeRefOrGetter, computed, createApp, isRef, reactive, ref, toValue, watch } from 'vue'\n\nimport {\n type DefaultEntities,\n type RoutePayload,\n resolveRouteParameters,\n} from '@/v2/features/modal/helpers/resolve-route-parameters'\nimport { useModalSidebar } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport Modal, { type ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ApiClientOptions, ApiClientOptionsRef } from '@/v2/types/options'\n\ntype CreateApiClientOptions = {\n /** Element to mount the client modal to. */\n el: HTMLElement | null\n /**\n * Will attempt to mount the references immediately.\n * For SSR this may need to be disabled and handled manually on the client side.\n */\n mountOnInitialize?: boolean\n /** You can pass in an event bus if you have one already, or we will create one */\n eventBus?: WorkspaceEventBus\n /** The workspace store must be initialized and passed in. */\n workspaceStore: WorkspaceStore\n /** Api client plugins to include in the modal */\n plugins?: ClientPlugin[]\n /** Subset of the configuration options for the modal, if you want it to be reactive ensure its a ref */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n\nexport type ApiClientModal = {\n app: App\n open: (payload?: RoutePayload) => void\n mount: (mountingEl: HTMLElement | null) => void\n route: (payload: RoutePayload) => void\n updateOptions: (nextOptions: ApiClientOptions, overwrite?: boolean) => void\n modalState: ModalState\n}\n\n/**\n * Monotonic counter used to give every modal Vue app a unique `idPrefix`.\n *\n * Vue derives `useId()` values (and therefore our teleport target ids) from the app's\n * `idPrefix`. When more than one client app mounts on the same page — for example, the\n * API reference embeds this modal alongside another client instance — a shared prefix\n * makes both apps emit identical ids. A teleported popover then resolves to the first\n * matching target in the DOM, which can be a hidden app, so the popover never appears.\n * A per-app suffix keeps the ids unique across instances.\n */\nlet modalAppCount = 0\n\n/**\n * Creates the API Client Modal.\n *\n * The modal does not require a router. Instead, navigation is handled by setting\n * active entities directly through the returned `route` function.\n */\nexport const createApiClientModal = ({\n el,\n eventBus = createWorkspaceEventBus({\n debug: import.meta.env.DEV,\n }),\n mountOnInitialize = true,\n plugins = [],\n workspaceStore,\n options = {},\n}: CreateApiClientOptions): ApiClientModal => {\n const requestBodyCompositionSelection = ref<Record<string, number>>({})\n\n /** This is to ensure that the options are a ref if they are not already, useful for react */\n const optionsRef = (isRef(options) ? options : ref(toValue(options))) as ApiClientOptionsRef\n\n const defaultEntities: DefaultEntities = {\n path: 'default',\n method: 'default',\n example: 'default',\n documentSlug: workspaceStore.workspace['x-scalar-active-document'] || 'default',\n }\n\n const parameters = reactive<DefaultEntities>({ ...defaultEntities })\n\n /** Navigate to the specified path, method, and example. */\n const route = (payload: RoutePayload): void => {\n Object.assign(parameters, defaultEntities, payload)\n }\n\n /** Resolved parameters from the workspace store. */\n const resolvedParameters = computed(() => resolveRouteParameters(workspaceStore, parameters))\n const documentSlug = computed(() => resolvedParameters.value.documentSlug)\n const path = computed(() => resolvedParameters.value.path)\n const method = computed(() => resolvedParameters.value.method)\n const exampleName = computed(() => resolvedParameters.value.example)\n /** The document from the workspace store. Modal is OpenAPI-only; AsyncAPI docs surface as null. */\n const document = computed(() => {\n const doc = workspaceStore.workspace.documents[documentSlug.value ?? '']\n return isOpenApiDocument(doc) ? doc : null\n })\n\n /** Sidebar state and selection handling. */\n const sidebarState = useModalSidebar({\n workspaceStore,\n documentSlug: documentSlug,\n path: path,\n method: method,\n exampleName: exampleName,\n route,\n })\n\n const modalState = useModal()\n\n const app = createApp(Modal, {\n document,\n eventBus,\n exampleName,\n method,\n modalState,\n path,\n plugins,\n requestBodyCompositionSelection,\n sidebarState,\n workspaceStore,\n options: optionsRef,\n } satisfies ModalProps)\n\n /** Restore the workspace store when the modal is closed. */\n const handleModalClose = () => {\n requestBodyCompositionSelection.value = {}\n }\n\n /** Initialize plugins and subscribe to event bus events */\n const pluginUnsubscribes: (() => void)[] = []\n for (const plugin of plugins) {\n plugin.lifecycle?.onInit?.()\n\n pluginUnsubscribes.push(subscribePluginEvents(eventBus, plugin))\n }\n\n /** Clean up plugin lifecycle and event bus subscriptions when the app is unmounted */\n app.onUnmount(() => {\n for (const unsub of pluginUnsubscribes) {\n unsub()\n }\n for (const plugin of plugins) {\n plugin.lifecycle?.onDestroy?.()\n }\n })\n\n watch(\n () => modalState.open,\n (open) => (open ? null : handleModalClose()),\n )\n\n // Update the active proxy when the proxyUrl changes\n watch(\n () => toValue(optionsRef).proxyUrl,\n (newProxyUrl) => workspaceStore.update('x-scalar-active-proxy', newProxyUrl),\n { immediate: true },\n )\n\n // Use a unique id prefix to prevent collisions with other Vue apps on the page.\n // The suffix keeps the prefix unique even when several client apps mount together.\n app.config.idPrefix = `scalar-client-${modalAppCount++}`\n\n /** Mount the modal to a given element. */\n const mount = (mountingEl: HTMLElement | null = el): void => {\n if (!mountingEl) {\n console.error(\n '[@scalar/api-client] Could not create the API client Modal.',\n 'Invalid HTML element provided.',\n 'Read more: https://github.com/scalar/scalar/tree/main/packages/api-client',\n )\n return\n }\n app.mount(mountingEl)\n }\n\n if (mountOnInitialize) {\n mount()\n }\n\n return {\n /** The Vue app instance for the modal. Use with caution. */\n app,\n /** Open the modal and optionally navigate to a specific route. */\n open: (payload?: RoutePayload): void => {\n modalState.open = true\n if (payload) {\n route(payload)\n }\n },\n /** Mount the modal to a given element. */\n mount,\n /** Navigate to the specified path, method, and example. */\n route,\n /** Controls the visibility of the modal. */\n modalState,\n /**\n * Merge new options into the current modal options.\n *\n * @param newOptions - The new options to merge into the current modal options.\n * @param overwrite - Whether to overwrite the current modal options with the new options. If false, the new options will be merged with the current options.\n */\n updateOptions: (newOptions: ApiClientOptions, overwrite = false): void => {\n optionsRef.value = overwrite\n ? newOptions\n : {\n ...optionsRef.value,\n ...newOptions,\n }\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqDA,IAAI,gBAAgB;;;;;;;AAQpB,IAAa,wBAAwB,EACnC,IACA,WAAW,wBAAwB,EACjC,OAAA,
|
|
1
|
+
{"version":3,"file":"create-api-client-modal.js","names":[],"sources":["../../../../../src/v2/features/modal/helpers/create-api-client-modal.ts"],"sourcesContent":["import { type ModalState, useModal } from '@scalar/components/modal'\nimport { type ClientPlugin, subscribePluginEvents } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { type WorkspaceEventBus, createWorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type App, type MaybeRefOrGetter, computed, createApp, isRef, reactive, ref, toValue, watch } from 'vue'\n\nimport {\n type DefaultEntities,\n type RoutePayload,\n resolveRouteParameters,\n} from '@/v2/features/modal/helpers/resolve-route-parameters'\nimport { useModalSidebar } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport Modal, { type ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ApiClientOptions, ApiClientOptionsRef } from '@/v2/types/options'\n\ntype CreateApiClientOptions = {\n /** Element to mount the client modal to. */\n el: HTMLElement | null\n /**\n * Will attempt to mount the references immediately.\n * For SSR this may need to be disabled and handled manually on the client side.\n */\n mountOnInitialize?: boolean\n /** You can pass in an event bus if you have one already, or we will create one */\n eventBus?: WorkspaceEventBus\n /** The workspace store must be initialized and passed in. */\n workspaceStore: WorkspaceStore\n /** Api client plugins to include in the modal */\n plugins?: ClientPlugin[]\n /** Subset of the configuration options for the modal, if you want it to be reactive ensure its a ref */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n\nexport type ApiClientModal = {\n app: App\n open: (payload?: RoutePayload) => void\n mount: (mountingEl: HTMLElement | null) => void\n route: (payload: RoutePayload) => void\n updateOptions: (nextOptions: ApiClientOptions, overwrite?: boolean) => void\n modalState: ModalState\n}\n\n/**\n * Monotonic counter used to give every modal Vue app a unique `idPrefix`.\n *\n * Vue derives `useId()` values (and therefore our teleport target ids) from the app's\n * `idPrefix`. When more than one client app mounts on the same page — for example, the\n * API reference embeds this modal alongside another client instance — a shared prefix\n * makes both apps emit identical ids. A teleported popover then resolves to the first\n * matching target in the DOM, which can be a hidden app, so the popover never appears.\n * A per-app suffix keeps the ids unique across instances.\n */\nlet modalAppCount = 0\n\n/**\n * Creates the API Client Modal.\n *\n * The modal does not require a router. Instead, navigation is handled by setting\n * active entities directly through the returned `route` function.\n */\nexport const createApiClientModal = ({\n el,\n eventBus = createWorkspaceEventBus({\n debug: import.meta.env.DEV,\n }),\n mountOnInitialize = true,\n plugins = [],\n workspaceStore,\n options = {},\n}: CreateApiClientOptions): ApiClientModal => {\n const requestBodyCompositionSelection = ref<Record<string, number>>({})\n\n /** This is to ensure that the options are a ref if they are not already, useful for react */\n const optionsRef = (isRef(options) ? options : ref(toValue(options))) as ApiClientOptionsRef\n\n const defaultEntities: DefaultEntities = {\n path: 'default',\n method: 'default',\n example: 'default',\n documentSlug: workspaceStore.workspace['x-scalar-active-document'] || 'default',\n }\n\n const parameters = reactive<DefaultEntities>({ ...defaultEntities })\n\n /** Navigate to the specified path, method, and example. */\n const route = (payload: RoutePayload): void => {\n Object.assign(parameters, defaultEntities, payload)\n }\n\n /** Resolved parameters from the workspace store. */\n const resolvedParameters = computed(() => resolveRouteParameters(workspaceStore, parameters))\n const documentSlug = computed(() => resolvedParameters.value.documentSlug)\n const path = computed(() => resolvedParameters.value.path)\n const method = computed(() => resolvedParameters.value.method)\n const exampleName = computed(() => resolvedParameters.value.example)\n /** The document from the workspace store. Modal is OpenAPI-only; AsyncAPI docs surface as null. */\n const document = computed(() => {\n const doc = workspaceStore.workspace.documents[documentSlug.value ?? '']\n return isOpenApiDocument(doc) ? doc : null\n })\n\n /** Sidebar state and selection handling. */\n const sidebarState = useModalSidebar({\n workspaceStore,\n documentSlug: documentSlug,\n path: path,\n method: method,\n exampleName: exampleName,\n route,\n })\n\n const modalState = useModal()\n\n const app = createApp(Modal, {\n document,\n eventBus,\n exampleName,\n method,\n modalState,\n path,\n plugins,\n requestBodyCompositionSelection,\n sidebarState,\n workspaceStore,\n options: optionsRef,\n } satisfies ModalProps)\n\n /** Restore the workspace store when the modal is closed. */\n const handleModalClose = () => {\n requestBodyCompositionSelection.value = {}\n }\n\n /** Initialize plugins and subscribe to event bus events */\n const pluginUnsubscribes: (() => void)[] = []\n for (const plugin of plugins) {\n plugin.lifecycle?.onInit?.()\n\n pluginUnsubscribes.push(subscribePluginEvents(eventBus, plugin))\n }\n\n /** Clean up plugin lifecycle and event bus subscriptions when the app is unmounted */\n app.onUnmount(() => {\n for (const unsub of pluginUnsubscribes) {\n unsub()\n }\n for (const plugin of plugins) {\n plugin.lifecycle?.onDestroy?.()\n }\n })\n\n watch(\n () => modalState.open,\n (open) => (open ? null : handleModalClose()),\n )\n\n // Update the active proxy when the proxyUrl changes\n watch(\n () => toValue(optionsRef).proxyUrl,\n (newProxyUrl) => workspaceStore.update('x-scalar-active-proxy', newProxyUrl),\n { immediate: true },\n )\n\n // Use a unique id prefix to prevent collisions with other Vue apps on the page.\n // The suffix keeps the prefix unique even when several client apps mount together.\n app.config.idPrefix = `scalar-client-${modalAppCount++}`\n\n /** Mount the modal to a given element. */\n const mount = (mountingEl: HTMLElement | null = el): void => {\n if (!mountingEl) {\n console.error(\n '[@scalar/api-client] Could not create the API client Modal.',\n 'Invalid HTML element provided.',\n 'Read more: https://github.com/scalar/scalar/tree/main/packages/api-client',\n )\n return\n }\n app.mount(mountingEl)\n }\n\n if (mountOnInitialize) {\n mount()\n }\n\n return {\n /** The Vue app instance for the modal. Use with caution. */\n app,\n /** Open the modal and optionally navigate to a specific route. */\n open: (payload?: RoutePayload): void => {\n modalState.open = true\n if (payload) {\n route(payload)\n }\n },\n /** Mount the modal to a given element. */\n mount,\n /** Navigate to the specified path, method, and example. */\n route,\n /** Controls the visibility of the modal. */\n modalState,\n /**\n * Merge new options into the current modal options.\n *\n * @param newOptions - The new options to merge into the current modal options.\n * @param overwrite - Whether to overwrite the current modal options with the new options. If false, the new options will be merged with the current options.\n */\n updateOptions: (newOptions: ApiClientOptions, overwrite = false): void => {\n optionsRef.value = overwrite\n ? newOptions\n : {\n ...optionsRef.value,\n ...newOptions,\n }\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqDA,IAAI,gBAAgB;;;;;;;AAQpB,IAAa,wBAAwB,EACnC,IACA,WAAW,wBAAwB,EACjC,OAAA,MACF,CAAC,GACD,oBAAoB,MACpB,UAAU,CAAC,GACX,gBACA,UAAU,CAAC,QACiC;CAC5C,MAAM,kCAAkC,IAA4B,CAAC,CAAC;;CAGtE,MAAM,aAAc,MAAM,OAAO,IAAI,UAAU,IAAI,QAAQ,OAAO,CAAC;CAEnE,MAAM,kBAAmC;EACvC,MAAM;EACN,QAAQ;EACR,SAAS;EACT,cAAc,eAAe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M,SAAS,aAAiC,OAAa;EAC3D,IAAI,CAAC,YAAY;GACf,QAAQ,MACN,+DACA,kCACA,2EACF;GACA;EACF;EACA,IAAI,MAAM,UAAU;CACtB;CAEA,IAAI,mBACF,MAAM;CAGR,OAAO;;EAEL;;EAEA,OAAO,YAAiC;GACtC,WAAW,OAAO;GAClB,IAAI,SACF,MAAM,OAAO;EAEjB;;EAEA;;EAEA;;EAEA;;;;;;;EAOA,gBAAgB,YAA8B,YAAY,UAAgB;GACxE,WAAW,QAAQ,YACf,aACA;IACE,GAAG,WAAW;IACd,GAAG;GACL;EACN;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-hidden-clients-config.js","names":[],"sources":["../../../../../src/v2/features/modal/helpers/map-hidden-clients-config.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { AvailableClient, TargetId } from '@scalar/types/snippetz'\nimport { AVAILABLE_CLIENTS, type AvailableClients, GROUPED_CLIENTS } from '@scalar/types/snippetz'\n\n/**\n * Map the old hiddenClients config to the new httpClients config.\n * Filters out clients based on the configuration and returns the remaining clients.\n */\nexport const mapHiddenClientsConfig = (hiddenClients: ApiReferenceConfiguration['hiddenClients']): AvailableClients => {\n // Early return for boolean true - hide all clients\n if (hiddenClients === true) {\n return []\n }\n\n // Early return for falsy values or empty arrays - show all clients\n if (!hiddenClients || (Array.isArray(hiddenClients) && hiddenClients.length === 0)) {\n return AVAILABLE_CLIENTS\n }\n\n // Start with all clients visible and remove hidden ones\n const visibleClientsSet = new Set<AvailableClient>(AVAILABLE_CLIENTS)\n\n // Handle array config: ['js/fetch', 'js/axios', 'java', 'fetch', 'axios']\n if (Array.isArray(hiddenClients)) {\n for (const item of hiddenClients) {\n // Check if item is a target group first\n const group = GROUPED_CLIENTS[item as TargetId]\n\n // Item is a target group (e.g., 'java', 'ruby') - hide all clients in the group\n if (group) {\n for (const client of group) {\n visibleClientsSet.delete(`${item}/${client}` as AvailableClient)\n }\n }\n\n // Item is a full client ID (e.g., 'js/fetch') - hide this specific client\n else if (item.includes('/')) {\n visibleClientsSet.delete(item as AvailableClient)\n }\n\n // Item is a client name suffix (e.g., 'fetch', 'axios') - hide all matching clients\n else {\n for (const language of objectKeys(GROUPED_CLIENTS)) {\n visibleClientsSet.delete(`${language}/${item}` as AvailableClient)\n }\n }\n }\n }\n\n // Handle object config: { node: true, python: ['requests'] }\n else if (typeof hiddenClients === 'object') {\n for (const [targetId, clients] of Object.entries(hiddenClients)) {\n if (clients === true) {\n // Hide all clients for this target\n const group = GROUPED_CLIENTS[targetId as TargetId]\n if (group) {\n for (const client of group) {\n visibleClientsSet.delete(`${targetId}/${client}` as AvailableClient)\n }\n }\n } else if (Array.isArray(clients)) {\n // Hide specific clients for this target\n for (const client of clients) {\n // Try both formats: 'fetch' and 'js/fetch'\n visibleClientsSet.delete(client as AvailableClient)\n visibleClientsSet.delete(`${targetId}/${client}` as AvailableClient)\n }\n }\n }\n }\n\n return Array.from(visibleClientsSet)\n}\n"],"mappings":";;;;;;;AASA,IAAa,0BAA0B,kBAAgF;
|
|
1
|
+
{"version":3,"file":"map-hidden-clients-config.js","names":[],"sources":["../../../../../src/v2/features/modal/helpers/map-hidden-clients-config.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { AvailableClient, TargetId } from '@scalar/types/snippetz'\nimport { AVAILABLE_CLIENTS, type AvailableClients, GROUPED_CLIENTS } from '@scalar/types/snippetz'\n\n/**\n * Map the old hiddenClients config to the new httpClients config.\n * Filters out clients based on the configuration and returns the remaining clients.\n */\nexport const mapHiddenClientsConfig = (hiddenClients: ApiReferenceConfiguration['hiddenClients']): AvailableClients => {\n // Early return for boolean true - hide all clients\n if (hiddenClients === true) {\n return []\n }\n\n // Early return for falsy values or empty arrays - show all clients\n if (!hiddenClients || (Array.isArray(hiddenClients) && hiddenClients.length === 0)) {\n return AVAILABLE_CLIENTS\n }\n\n // Start with all clients visible and remove hidden ones\n const visibleClientsSet = new Set<AvailableClient>(AVAILABLE_CLIENTS)\n\n // Handle array config: ['js/fetch', 'js/axios', 'java', 'fetch', 'axios']\n if (Array.isArray(hiddenClients)) {\n for (const item of hiddenClients) {\n // Check if item is a target group first\n const group = GROUPED_CLIENTS[item as TargetId]\n\n // Item is a target group (e.g., 'java', 'ruby') - hide all clients in the group\n if (group) {\n for (const client of group) {\n visibleClientsSet.delete(`${item}/${client}` as AvailableClient)\n }\n }\n\n // Item is a full client ID (e.g., 'js/fetch') - hide this specific client\n else if (item.includes('/')) {\n visibleClientsSet.delete(item as AvailableClient)\n }\n\n // Item is a client name suffix (e.g., 'fetch', 'axios') - hide all matching clients\n else {\n for (const language of objectKeys(GROUPED_CLIENTS)) {\n visibleClientsSet.delete(`${language}/${item}` as AvailableClient)\n }\n }\n }\n }\n\n // Handle object config: { node: true, python: ['requests'] }\n else if (typeof hiddenClients === 'object') {\n for (const [targetId, clients] of Object.entries(hiddenClients)) {\n if (clients === true) {\n // Hide all clients for this target\n const group = GROUPED_CLIENTS[targetId as TargetId]\n if (group) {\n for (const client of group) {\n visibleClientsSet.delete(`${targetId}/${client}` as AvailableClient)\n }\n }\n } else if (Array.isArray(clients)) {\n // Hide specific clients for this target\n for (const client of clients) {\n // Try both formats: 'fetch' and 'js/fetch'\n visibleClientsSet.delete(client as AvailableClient)\n visibleClientsSet.delete(`${targetId}/${client}` as AvailableClient)\n }\n }\n }\n }\n\n return Array.from(visibleClientsSet)\n}\n"],"mappings":";;;;;;;AASA,IAAa,0BAA0B,kBAAgF;CAErH,IAAI,kBAAkB,MACpB,OAAO,CAAC;CAIV,IAAI,CAAC,iBAAkB,MAAM,QAAQ,aAAa,KAAK,cAAc,WAAW,GAC9E,OAAO;CAIT,MAAM,oBAAoB,IAAI,IAAqB,iBAAiB;CAGpE,IAAI,MAAM,QAAQ,aAAa,GAC7B,KAAK,MAAM,QAAQ,eAAe;EAEhC,MAAM,QAAQ,gBAAgB;EAG9B,IAAI,OACF,KAAK,MAAM,UAAU,OACnB,kBAAkB,OAAO,GAAG,KAAK,GAAG,QAA2B;OAK9D,IAAI,KAAK,SAAS,GAAG,GACxB,kBAAkB,OAAO,IAAuB;OAKhD,KAAK,MAAM,YAAY,WAAW,eAAe,GAC/C,kBAAkB,OAAO,GAAG,SAAS,GAAG,MAAyB;CAGvE;MAIG,IAAI,OAAO,kBAAkB;OAC3B,MAAM,CAAC,UAAU,YAAY,OAAO,QAAQ,aAAa,GAC5D,IAAI,YAAY,MAAM;GAEpB,MAAM,QAAQ,gBAAgB;GAC9B,IAAI,OACF,KAAK,MAAM,UAAU,OACnB,kBAAkB,OAAO,GAAG,SAAS,GAAG,QAA2B;EAGzE,OAAO,IAAI,MAAM,QAAQ,OAAO,GAE9B,KAAK,MAAM,UAAU,SAAS;GAE5B,kBAAkB,OAAO,MAAyB;GAClD,kBAAkB,OAAO,GAAG,SAAS,GAAG,QAA2B;EACrE;;CAKN,OAAO,MAAM,KAAK,iBAAiB;AACrC"}
|
|
@@ -103,6 +103,6 @@ var resolveRouteParameters = (store, params) => {
|
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
//#endregion
|
|
106
|
-
export { resolveRouteParameters };
|
|
106
|
+
export { resolveDocumentSlug, resolveExampleName, resolveMethod, resolvePath, resolveRouteParameters };
|
|
107
107
|
|
|
108
108
|
//# sourceMappingURL=resolve-route-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-route-parameters.js","names":[],"sources":["../../../../../src/v2/features/modal/helpers/resolve-route-parameters.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { getResolvedPathItem } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getOperationEntries } from '@scalar/workspace-store/navigation'\nimport type { TraversedEntry, TraversedExample } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\n\n/** Payload for routing and opening the API client modal. */\nexport type RoutePayload = {\n path: string\n method: HttpMethod\n example?: string\n documentSlug?: string\n}\n\n/** Raw input values that may contain \"default\" placeholders. */\nexport type DefaultEntities = Record<keyof RoutePayload, string>\n\n/** Context for resolving route parameters from the workspace store. */\ntype ResolverContext = {\n store: WorkspaceStore\n documentSlug: string | undefined\n}\n\n/** Type guard to check if an entry is an example. */\nconst isExample = (entry: TraversedEntry): entry is TraversedExample => entry.type === 'example'\n\n/**\n * Gets the document from the workspace store.\n * Returns undefined if the document slug is not provided or the document does not exist.\n * Modal routing is OpenAPI-only — AsyncAPI docs surface as undefined here.\n */\nconst getDocument = (ctx: ResolverContext) => {\n const doc = ctx.store.workspace.documents[ctx.documentSlug ?? '']\n return isOpenApiDocument(doc) ? doc : undefined\n}\n\n/**\n * Resolves the document slug from a raw input value.\n *\n * When \"default\" is specified and no document exists with that slug,\n * we fall back to the active document or the first available document.\n * Modal routing is OpenAPI-only, so the fallback skips AsyncAPI documents —\n * otherwise opening the modal with default params on a workspace that has\n * an AsyncAPI active or first document would hand a slug back that\n * `getDocument` then resolves to undefined, rendering the modal with\n * `document: null` even when OpenAPI documents exist.\n */\nexport const resolveDocumentSlug = (store: WorkspaceStore, slug: string | undefined): string | undefined => {\n const hasMatchingDocument = slug !== 'default' || store.workspace.documents[slug] !== undefined\n\n if (hasMatchingDocument) {\n return slug\n }\n\n // Prefer the active document when it is OpenAPI; otherwise pick the first\n // OpenAPI document in the workspace.\n const activeSlug = store.workspace['x-scalar-active-document']\n if (activeSlug && isOpenApiDocument(store.workspace.documents[activeSlug])) {\n return activeSlug\n }\n\n return Object.entries(store.workspace.documents).find(([, document]) => isOpenApiDocument(document))?.[0]\n}\n\n/**\n * Resolves the path from a raw input value.\n *\n * When \"default\" is specified, returns the first available path in the document.\n * This is useful for initial navigation when no specific path is requested.\n */\nexport const resolvePath = (ctx: ResolverContext, path: string | undefined): string | undefined => {\n const document = getDocument(ctx)\n\n if (!document) {\n return undefined\n }\n\n if (path === 'default') {\n return Object.keys(document.paths ?? {})[0]\n }\n\n return path\n}\n\n/**\n * Resolves the HTTP method from a raw input value.\n *\n * When \"default\" is specified, returns the first valid HTTP method for the given path.\n * This ensures we select a real method rather than metadata keys like \"parameters\" or \"summary\".\n */\nexport const resolveMethod = (\n ctx: ResolverContext,\n path: string | undefined,\n method: string | undefined,\n): HttpMethod | undefined => {\n const document = getDocument(ctx)\n\n if (!document || !path) {\n return undefined\n }\n\n if (method === 'default') {\n const pathItem = getResolvedPathItem(document.paths?.[path])\n if (!pathItem) {\n return undefined\n }\n const pathMethods = Object.keys(pathItem).filter(isHttpMethod)\n return pathMethods[0]\n }\n\n return isHttpMethod(method) ? method : undefined\n}\n\n/**\n * Resolves the example name from a raw input value.\n *\n * When \"default\" is specified, returns the first available example name.\n * Falls back to \"default\" when no examples exist, which signals to use the default request body.\n */\nexport const resolveExampleName = (\n ctx: ResolverContext,\n operation: TraversedEntry | undefined,\n exampleKey: string | undefined,\n): string => {\n const document = getDocument(ctx)\n\n if (!document || operation?.type !== 'operation') {\n return 'default'\n }\n\n const examples = operation.children?.filter(isExample) ?? []\n const matchingExample = examples.find((child) => child.name === exampleKey)\n\n if (matchingExample) {\n return matchingExample.name\n }\n\n if (exampleKey === 'default') {\n return examples[0]?.name ?? 'default'\n }\n\n return 'default'\n}\n\n/**\n * Resolves all route parameters from raw input values to their actual values.\n *\n * This function handles \"default\" placeholders by looking up actual values from the workspace store.\n * It ensures the modal can be opened even when the caller does not know specific paths, methods, or examples.\n */\nexport const resolveRouteParameters = (store: WorkspaceStore, params: DefaultEntities): Partial<RoutePayload> => {\n const documentSlug = resolveDocumentSlug(store, params.documentSlug)\n const ctx: ResolverContext = { store, documentSlug }\n\n const path = resolvePath(ctx, params.path)\n const method = resolveMethod(ctx, path, params.method)\n\n const traversedDocument = getDocument(ctx)?.['x-scalar-navigation']\n\n if (!traversedDocument) {\n return { documentSlug, path, method, example: 'default' }\n }\n\n const operations = getOperationEntries(traversedDocument)\n const operation = operations.get(`${path}|${method}`)?.find((entry) => entry.type === 'operation')\n const example = resolveExampleName(ctx, operation, params.example)\n\n return { documentSlug, path, method, example }\n}\n"],"mappings":";;;;;;AA0BA,IAAM,aAAa,UAAqD,MAAM,SAAS;;;;;;AAOvF,IAAM,eAAe,QAAyB;CAC5C,MAAM,MAAM,IAAI,MAAM,UAAU,UAAU,IAAI,gBAAgB;
|
|
1
|
+
{"version":3,"file":"resolve-route-parameters.js","names":[],"sources":["../../../../../src/v2/features/modal/helpers/resolve-route-parameters.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { getResolvedPathItem } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getOperationEntries } from '@scalar/workspace-store/navigation'\nimport type { TraversedEntry, TraversedExample } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\n\n/** Payload for routing and opening the API client modal. */\nexport type RoutePayload = {\n path: string\n method: HttpMethod\n example?: string\n documentSlug?: string\n}\n\n/** Raw input values that may contain \"default\" placeholders. */\nexport type DefaultEntities = Record<keyof RoutePayload, string>\n\n/** Context for resolving route parameters from the workspace store. */\ntype ResolverContext = {\n store: WorkspaceStore\n documentSlug: string | undefined\n}\n\n/** Type guard to check if an entry is an example. */\nconst isExample = (entry: TraversedEntry): entry is TraversedExample => entry.type === 'example'\n\n/**\n * Gets the document from the workspace store.\n * Returns undefined if the document slug is not provided or the document does not exist.\n * Modal routing is OpenAPI-only — AsyncAPI docs surface as undefined here.\n */\nconst getDocument = (ctx: ResolverContext) => {\n const doc = ctx.store.workspace.documents[ctx.documentSlug ?? '']\n return isOpenApiDocument(doc) ? doc : undefined\n}\n\n/**\n * Resolves the document slug from a raw input value.\n *\n * When \"default\" is specified and no document exists with that slug,\n * we fall back to the active document or the first available document.\n * Modal routing is OpenAPI-only, so the fallback skips AsyncAPI documents —\n * otherwise opening the modal with default params on a workspace that has\n * an AsyncAPI active or first document would hand a slug back that\n * `getDocument` then resolves to undefined, rendering the modal with\n * `document: null` even when OpenAPI documents exist.\n */\nexport const resolveDocumentSlug = (store: WorkspaceStore, slug: string | undefined): string | undefined => {\n const hasMatchingDocument = slug !== 'default' || store.workspace.documents[slug] !== undefined\n\n if (hasMatchingDocument) {\n return slug\n }\n\n // Prefer the active document when it is OpenAPI; otherwise pick the first\n // OpenAPI document in the workspace.\n const activeSlug = store.workspace['x-scalar-active-document']\n if (activeSlug && isOpenApiDocument(store.workspace.documents[activeSlug])) {\n return activeSlug\n }\n\n return Object.entries(store.workspace.documents).find(([, document]) => isOpenApiDocument(document))?.[0]\n}\n\n/**\n * Resolves the path from a raw input value.\n *\n * When \"default\" is specified, returns the first available path in the document.\n * This is useful for initial navigation when no specific path is requested.\n */\nexport const resolvePath = (ctx: ResolverContext, path: string | undefined): string | undefined => {\n const document = getDocument(ctx)\n\n if (!document) {\n return undefined\n }\n\n if (path === 'default') {\n return Object.keys(document.paths ?? {})[0]\n }\n\n return path\n}\n\n/**\n * Resolves the HTTP method from a raw input value.\n *\n * When \"default\" is specified, returns the first valid HTTP method for the given path.\n * This ensures we select a real method rather than metadata keys like \"parameters\" or \"summary\".\n */\nexport const resolveMethod = (\n ctx: ResolverContext,\n path: string | undefined,\n method: string | undefined,\n): HttpMethod | undefined => {\n const document = getDocument(ctx)\n\n if (!document || !path) {\n return undefined\n }\n\n if (method === 'default') {\n const pathItem = getResolvedPathItem(document.paths?.[path])\n if (!pathItem) {\n return undefined\n }\n const pathMethods = Object.keys(pathItem).filter(isHttpMethod)\n return pathMethods[0]\n }\n\n return isHttpMethod(method) ? method : undefined\n}\n\n/**\n * Resolves the example name from a raw input value.\n *\n * When \"default\" is specified, returns the first available example name.\n * Falls back to \"default\" when no examples exist, which signals to use the default request body.\n */\nexport const resolveExampleName = (\n ctx: ResolverContext,\n operation: TraversedEntry | undefined,\n exampleKey: string | undefined,\n): string => {\n const document = getDocument(ctx)\n\n if (!document || operation?.type !== 'operation') {\n return 'default'\n }\n\n const examples = operation.children?.filter(isExample) ?? []\n const matchingExample = examples.find((child) => child.name === exampleKey)\n\n if (matchingExample) {\n return matchingExample.name\n }\n\n if (exampleKey === 'default') {\n return examples[0]?.name ?? 'default'\n }\n\n return 'default'\n}\n\n/**\n * Resolves all route parameters from raw input values to their actual values.\n *\n * This function handles \"default\" placeholders by looking up actual values from the workspace store.\n * It ensures the modal can be opened even when the caller does not know specific paths, methods, or examples.\n */\nexport const resolveRouteParameters = (store: WorkspaceStore, params: DefaultEntities): Partial<RoutePayload> => {\n const documentSlug = resolveDocumentSlug(store, params.documentSlug)\n const ctx: ResolverContext = { store, documentSlug }\n\n const path = resolvePath(ctx, params.path)\n const method = resolveMethod(ctx, path, params.method)\n\n const traversedDocument = getDocument(ctx)?.['x-scalar-navigation']\n\n if (!traversedDocument) {\n return { documentSlug, path, method, example: 'default' }\n }\n\n const operations = getOperationEntries(traversedDocument)\n const operation = operations.get(`${path}|${method}`)?.find((entry) => entry.type === 'operation')\n const example = resolveExampleName(ctx, operation, params.example)\n\n return { documentSlug, path, method, example }\n}\n"],"mappings":";;;;;;AA0BA,IAAM,aAAa,UAAqD,MAAM,SAAS;;;;;;AAOvF,IAAM,eAAe,QAAyB;CAC5C,MAAM,MAAM,IAAI,MAAM,UAAU,UAAU,IAAI,gBAAgB;CAC9D,OAAO,kBAAkB,GAAG,IAAI,MAAM,KAAA;AACxC;;;;;;;;;;;;AAaA,IAAa,uBAAuB,OAAuB,SAAiD;CAG1G,IAF4B,SAAS,aAAa,MAAM,UAAU,UAAU,UAAU,KAAA,GAGpF,OAAO;CAKT,MAAM,aAAa,MAAM,UAAU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