@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modal-sidebar.js","names":[],"sources":["../../../../../src/v2/features/modal/hooks/use-modal-sidebar.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { createSidebarState, generateReverseIndex, getChildEntry } from '@scalar/sidebar'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { getParentEntry } from '@scalar/workspace-store/navigation'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type ComputedRef, computed, toValue, watch } from 'vue'\n\nimport type { RoutePayload } from '@/v2/features/modal/helpers/resolve-route-parameters'\nimport { generateLocationId } from '@/v2/helpers/generate-location-id'\n\nexport type UseModalSidebarReturn = {\n handleSelectItem: (id: string) => void\n state: ReturnType<typeof createSidebarState<TraversedEntry>>\n getEntryByLocation: (location: {\n document: string\n path?: string\n method?: HttpMethod\n example?: string\n }) => TraversedEntry | undefined\n}\n\n/**\n * useSidebarState - Custom hook to manage the sidebar state and navigation logic in the Scalar API client\n *\n * This composable manages the sidebar structure, synchronizes selection state\n * with the current route, and provides a handler for selecting sidebar items.\n *\n * Example usage:\n *\n * const { handleSelectItem, sidebarState } = useSidebarState({\n * workspaceStore,\n * workspaceSlug,\n * documentSlug,\n * path,\n * method,\n * exampleName,\n * })\n */\nexport const useModalSidebar = ({\n workspaceStore,\n documentSlug,\n path,\n method,\n exampleName,\n route,\n}: {\n workspaceStore: WorkspaceStore | null\n documentSlug: ComputedRef<string | undefined>\n path: ComputedRef<string | undefined>\n method: ComputedRef<HttpMethod | undefined>\n exampleName: ComputedRef<string | undefined>\n route: (payload: RoutePayload) => void\n}): UseModalSidebarReturn => {\n const entries = computed<TraversedEntry[]>(() => {\n const doc = workspaceStore?.workspace.documents[toValue(documentSlug) ?? '']\n return isOpenApiDocument(doc) ? (doc['x-scalar-navigation']?.children ?? []) : []\n })\n const state = createSidebarState(entries)\n\n /**\n * Computed index for fast lookup of sidebar nodes by their unique API location.\n *\n * - Only indexes nodes of type 'operation', or 'example'.\n * - The lookup key is a serialized array of: [operationPath, operationMethod, exampleName?].\n * - Supports precise resolution of sidebar entries given an API \"location\".\n */\n const locationIndex = computed(() =>\n generateReverseIndex({\n items: entries.value,\n nestedKey: 'children',\n filter: (node) => node.type === 'operation' || node.type === 'example',\n getId: (node) => {\n const operation = getParentEntry('operation', node)\n return generateLocationId({\n document: toValue(documentSlug) ?? '',\n path: operation?.path,\n method: operation?.method,\n example: node.type === 'example' ? node.name : undefined,\n })\n },\n }),\n )\n\n /**\n * Looks up a sidebar entry by its unique API location.\n * - First tries to find an entry matching all provided properties (including example).\n * - If not found, falls back to matching only the operation (ignores example field).\n * This allows resolving either examples, operations, or documents as appropriate.\n *\n * @param location - Object specifying the document name, path, method, and optional example name.\n * @returns The matching sidebar entry, or undefined if none found.\n *\n * Example:\n * const entry = getEntryByLocation({\n * document: 'pets',\n * path: '/pets',\n * method: 'get',\n * example: 'default',\n * })\n */\n const getEntryByLocation: UseModalSidebarReturn['getEntryByLocation'] = (location) => {\n // Try to find an entry with the most-specific location (including example)\n const entryWithExample = locationIndex.value.get(\n generateLocationId({\n document: location.document,\n path: location.path,\n method: location.method,\n example: location.example,\n }),\n )\n\n if (entryWithExample) {\n return entryWithExample\n }\n\n // Fallback to the operation (ignoring example) if an example wasn't found or specified\n return locationIndex.value.get(\n generateLocationId({\n document: location.document,\n path: location.path,\n method: location.method,\n }),\n )\n }\n\n /**\n * Handles item selection from the sidebar and routes navigation accordingly.\n *\n * Example:\n * handleSelectItem('id-of-entry')\n */\n const handleSelectItem = (id: string) => {\n const entry = state.getEntryById(id)\n\n if (!entry) {\n console.warn(`Could not find sidebar entry with id ${id} to select`)\n return\n }\n\n // Navigate to the example page\n if (entry.type === 'operation' || entry.type === 'example') {\n // If we are already in the operation, just toggle expansion\n if (state.isSelected(id)) {\n state.setExpanded(id, !state.isExpanded(id))\n return\n }\n\n const operation = getParentEntry('operation', entry)\n const example = getChildEntry('example', entry)\n\n if (example) {\n state.setSelected(example.id)\n state.setExpanded(example.id, true)\n } else {\n state.setSelected(id)\n }\n\n if (!operation) {\n return\n }\n\n return route({\n documentSlug: toValue(documentSlug),\n path: operation.path,\n method: operation.method,\n example: example?.name ?? 'default',\n })\n }\n\n state.setExpanded(id, !state.isExpanded(id))\n return\n }\n\n /** Keep the sidebar state in sync with the modal parameters */\n watch(\n [documentSlug, path, method, exampleName],\n ([newDocument, newPath, newMethod, newExample]) => {\n if (!newDocument) {\n // Reset selection if no document is selected\n state.setSelected(null)\n return\n }\n\n const entry = getEntryByLocation({\n document: newDocument,\n path: newPath,\n method: newMethod,\n example: newExample,\n })\n\n if (entry) {\n state.setSelected(entry.id)\n state.setExpanded(entry.id, true)\n }\n },\n {\n immediate: true,\n },\n )\n\n return {\n handleSelectItem,\n state,\n getEntryByLocation,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,mBAAmB,EAC9B,gBACA,cACA,MACA,QACA,aACA,YAQ2B;CAC3B,MAAM,UAAU,eAAiC;EAC/C,MAAM,MAAM,gBAAgB,UAAU,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-modal-sidebar.js","names":[],"sources":["../../../../../src/v2/features/modal/hooks/use-modal-sidebar.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { createSidebarState, generateReverseIndex, getChildEntry } from '@scalar/sidebar'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { getParentEntry } from '@scalar/workspace-store/navigation'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type ComputedRef, computed, toValue, watch } from 'vue'\n\nimport type { RoutePayload } from '@/v2/features/modal/helpers/resolve-route-parameters'\nimport { generateLocationId } from '@/v2/helpers/generate-location-id'\n\nexport type UseModalSidebarReturn = {\n handleSelectItem: (id: string) => void\n state: ReturnType<typeof createSidebarState<TraversedEntry>>\n getEntryByLocation: (location: {\n document: string\n path?: string\n method?: HttpMethod\n example?: string\n }) => TraversedEntry | undefined\n}\n\n/**\n * useSidebarState - Custom hook to manage the sidebar state and navigation logic in the Scalar API client\n *\n * This composable manages the sidebar structure, synchronizes selection state\n * with the current route, and provides a handler for selecting sidebar items.\n *\n * Example usage:\n *\n * const { handleSelectItem, sidebarState } = useSidebarState({\n * workspaceStore,\n * workspaceSlug,\n * documentSlug,\n * path,\n * method,\n * exampleName,\n * })\n */\nexport const useModalSidebar = ({\n workspaceStore,\n documentSlug,\n path,\n method,\n exampleName,\n route,\n}: {\n workspaceStore: WorkspaceStore | null\n documentSlug: ComputedRef<string | undefined>\n path: ComputedRef<string | undefined>\n method: ComputedRef<HttpMethod | undefined>\n exampleName: ComputedRef<string | undefined>\n route: (payload: RoutePayload) => void\n}): UseModalSidebarReturn => {\n const entries = computed<TraversedEntry[]>(() => {\n const doc = workspaceStore?.workspace.documents[toValue(documentSlug) ?? '']\n return isOpenApiDocument(doc) ? (doc['x-scalar-navigation']?.children ?? []) : []\n })\n const state = createSidebarState(entries)\n\n /**\n * Computed index for fast lookup of sidebar nodes by their unique API location.\n *\n * - Only indexes nodes of type 'operation', or 'example'.\n * - The lookup key is a serialized array of: [operationPath, operationMethod, exampleName?].\n * - Supports precise resolution of sidebar entries given an API \"location\".\n */\n const locationIndex = computed(() =>\n generateReverseIndex({\n items: entries.value,\n nestedKey: 'children',\n filter: (node) => node.type === 'operation' || node.type === 'example',\n getId: (node) => {\n const operation = getParentEntry('operation', node)\n return generateLocationId({\n document: toValue(documentSlug) ?? '',\n path: operation?.path,\n method: operation?.method,\n example: node.type === 'example' ? node.name : undefined,\n })\n },\n }),\n )\n\n /**\n * Looks up a sidebar entry by its unique API location.\n * - First tries to find an entry matching all provided properties (including example).\n * - If not found, falls back to matching only the operation (ignores example field).\n * This allows resolving either examples, operations, or documents as appropriate.\n *\n * @param location - Object specifying the document name, path, method, and optional example name.\n * @returns The matching sidebar entry, or undefined if none found.\n *\n * Example:\n * const entry = getEntryByLocation({\n * document: 'pets',\n * path: '/pets',\n * method: 'get',\n * example: 'default',\n * })\n */\n const getEntryByLocation: UseModalSidebarReturn['getEntryByLocation'] = (location) => {\n // Try to find an entry with the most-specific location (including example)\n const entryWithExample = locationIndex.value.get(\n generateLocationId({\n document: location.document,\n path: location.path,\n method: location.method,\n example: location.example,\n }),\n )\n\n if (entryWithExample) {\n return entryWithExample\n }\n\n // Fallback to the operation (ignoring example) if an example wasn't found or specified\n return locationIndex.value.get(\n generateLocationId({\n document: location.document,\n path: location.path,\n method: location.method,\n }),\n )\n }\n\n /**\n * Handles item selection from the sidebar and routes navigation accordingly.\n *\n * Example:\n * handleSelectItem('id-of-entry')\n */\n const handleSelectItem = (id: string) => {\n const entry = state.getEntryById(id)\n\n if (!entry) {\n console.warn(`Could not find sidebar entry with id ${id} to select`)\n return\n }\n\n // Navigate to the example page\n if (entry.type === 'operation' || entry.type === 'example') {\n // If we are already in the operation, just toggle expansion\n if (state.isSelected(id)) {\n state.setExpanded(id, !state.isExpanded(id))\n return\n }\n\n const operation = getParentEntry('operation', entry)\n const example = getChildEntry('example', entry)\n\n if (example) {\n state.setSelected(example.id)\n state.setExpanded(example.id, true)\n } else {\n state.setSelected(id)\n }\n\n if (!operation) {\n return\n }\n\n return route({\n documentSlug: toValue(documentSlug),\n path: operation.path,\n method: operation.method,\n example: example?.name ?? 'default',\n })\n }\n\n state.setExpanded(id, !state.isExpanded(id))\n return\n }\n\n /** Keep the sidebar state in sync with the modal parameters */\n watch(\n [documentSlug, path, method, exampleName],\n ([newDocument, newPath, newMethod, newExample]) => {\n if (!newDocument) {\n // Reset selection if no document is selected\n state.setSelected(null)\n return\n }\n\n const entry = getEntryByLocation({\n document: newDocument,\n path: newPath,\n method: newMethod,\n example: newExample,\n })\n\n if (entry) {\n state.setSelected(entry.id)\n state.setExpanded(entry.id, true)\n }\n },\n {\n immediate: true,\n },\n )\n\n return {\n handleSelectItem,\n state,\n getEntryByLocation,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,mBAAmB,EAC9B,gBACA,cACA,MACA,QACA,aACA,YAQ2B;CAC3B,MAAM,UAAU,eAAiC;EAC/C,MAAM,MAAM,gBAAgB,UAAU,UAAU,QAAQ,YAAY,KAAK;EACzE,OAAO,kBAAkB,GAAG,IAAK,IAAI,sBAAsB,EAAE,YAAY,CAAC,IAAK,CAAC;CAClF,CAAC;CACD,MAAM,QAAQ,mBAAmB,OAAO;;;;;;;;CASxC,MAAM,gBAAgB,eACpB,qBAAqB;EACnB,OAAO,QAAQ;EACf,WAAW;EACX,SAAS,SAAS,KAAK,SAAS,eAAe,KAAK,SAAS;EAC7D,QAAQ,SAAS;GACf,MAAM,YAAY,eAAe,aAAa,IAAI;GAClD,OAAO,mBAAmB;IACxB,UAAU,QAAQ,YAAY,KAAK;IACnC,MAAM,WAAW;IACjB,QAAQ,WAAW;IACnB,SAAS,KAAK,SAAS,YAAY,KAAK,OAAO,KAAA;GACjD,CAAC;EACH;CACF,CAAC,CACH;;;;;;;;;;;;;;;;;;CAmBA,MAAM,sBAAmE,aAAa;EAEpF,MAAM,mBAAmB,cAAc,MAAM,IAC3C,mBAAmB;GACjB,UAAU,SAAS;GACnB,MAAM,SAAS;GACf,QAAQ,SAAS;GACjB,SAAS,SAAS;EACpB,CAAC,CACH;EAEA,IAAI,kBACF,OAAO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":3,"file":"modal-events.js","names":[],"sources":["../../../../src/v2/features/modal/modal-events.ts"],"sourcesContent":["import type { ModalState } from '@scalar/components/modal'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type Ref, ref } from 'vue'\n\nimport type { UseModalSidebarReturn } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport { initializeWorkspaceEventHandlers } from '@/v2/workspace-events'\n\nconst EMPTY_REQUEST_BODY_COMPOSITION_SELECTION = {} as Record<string, number>\n\nexport function initializeModalEvents({\n eventBus,\n isSidebarOpen,\n requestBodyCompositionSelection,\n sidebarState,\n modalState,\n store,\n}: {\n eventBus: WorkspaceEventBus\n isSidebarOpen: Ref<boolean>\n requestBodyCompositionSelection: Ref<Record<string, number>>\n sidebarState: UseModalSidebarReturn\n modalState: ModalState\n store: WorkspaceStore\n}) {\n /** Initialize workspace event handlers */\n initializeWorkspaceEventHandlers({\n eventBus,\n store: ref(store),\n hooks: {},\n })\n\n //------------------------------------------------------------------------------------\n // Navigation Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('scroll-to:nav-item', ({ id }) => sidebarState.handleSelectItem(id))\n\n //------------------------------------------------------------------------------------\n // UI Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('ui:toggle:sidebar', () => (isSidebarOpen.value = !isSidebarOpen.value))\n eventBus.on('ui:close:client-modal', () => modalState.hide())\n eventBus.on('ui:open:client-modal', (payload) => {\n const nextRequestBodyCompositionSelection = (\n payload && 'requestBodyCompositionSelection' in payload && payload.requestBodyCompositionSelection\n ? payload.requestBodyCompositionSelection\n : EMPTY_REQUEST_BODY_COMPOSITION_SELECTION\n ) as Record<string, number>\n\n requestBodyCompositionSelection.value = nextRequestBodyCompositionSelection\n\n // Just open the modal\n if (!payload) {\n modalState.show()\n return\n }\n\n // We route to the exact ID\n if ('id' in payload && payload.id) {\n let targetId = payload.id\n\n // If exampleName is provided, try to find the specific example entry\n if ('exampleName' in payload && payload.exampleName) {\n const operationEntry = sidebarState.state.getEntryById(payload.id)\n\n // Try to find the specific example in the operation's children\n if (operationEntry && 'children' in operationEntry && operationEntry.children) {\n const exampleEntry = operationEntry.children.find(\n (child: TraversedEntry) => child.type === 'example' && child.name === payload.exampleName,\n )\n if (exampleEntry) {\n targetId = exampleEntry.id\n }\n }\n }\n\n sidebarState.handleSelectItem(targetId)\n }\n // We must find the ID first from the entries\n else if ('method' in payload && 'path' in payload) {\n const activeDoc = store.workspace.activeDocument\n sidebarState.handleSelectItem(\n sidebarState.getEntryByLocation({\n document: isOpenApiDocument(activeDoc) ? (activeDoc['x-scalar-navigation']?.id ?? '') : '',\n path: payload.path,\n method: payload.method,\n example: payload.exampleName,\n })?.id ?? '',\n )\n }\n\n modalState.show()\n })\n}\n"],"mappings":";;;;AAUA,IAAM,2CAA2C,
|
|
1
|
+
{"version":3,"file":"modal-events.js","names":[],"sources":["../../../../src/v2/features/modal/modal-events.ts"],"sourcesContent":["import type { ModalState } from '@scalar/components/modal'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type Ref, ref } from 'vue'\n\nimport type { UseModalSidebarReturn } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport { initializeWorkspaceEventHandlers } from '@/v2/workspace-events'\n\nconst EMPTY_REQUEST_BODY_COMPOSITION_SELECTION = {} as Record<string, number>\n\nexport function initializeModalEvents({\n eventBus,\n isSidebarOpen,\n requestBodyCompositionSelection,\n sidebarState,\n modalState,\n store,\n}: {\n eventBus: WorkspaceEventBus\n isSidebarOpen: Ref<boolean>\n requestBodyCompositionSelection: Ref<Record<string, number>>\n sidebarState: UseModalSidebarReturn\n modalState: ModalState\n store: WorkspaceStore\n}) {\n /** Initialize workspace event handlers */\n initializeWorkspaceEventHandlers({\n eventBus,\n store: ref(store),\n hooks: {},\n })\n\n //------------------------------------------------------------------------------------\n // Navigation Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('scroll-to:nav-item', ({ id }) => sidebarState.handleSelectItem(id))\n\n //------------------------------------------------------------------------------------\n // UI Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('ui:toggle:sidebar', () => (isSidebarOpen.value = !isSidebarOpen.value))\n eventBus.on('ui:close:client-modal', () => modalState.hide())\n eventBus.on('ui:open:client-modal', (payload) => {\n const nextRequestBodyCompositionSelection = (\n payload && 'requestBodyCompositionSelection' in payload && payload.requestBodyCompositionSelection\n ? payload.requestBodyCompositionSelection\n : EMPTY_REQUEST_BODY_COMPOSITION_SELECTION\n ) as Record<string, number>\n\n requestBodyCompositionSelection.value = nextRequestBodyCompositionSelection\n\n // Just open the modal\n if (!payload) {\n modalState.show()\n return\n }\n\n // We route to the exact ID\n if ('id' in payload && payload.id) {\n let targetId = payload.id\n\n // If exampleName is provided, try to find the specific example entry\n if ('exampleName' in payload && payload.exampleName) {\n const operationEntry = sidebarState.state.getEntryById(payload.id)\n\n // Try to find the specific example in the operation's children\n if (operationEntry && 'children' in operationEntry && operationEntry.children) {\n const exampleEntry = operationEntry.children.find(\n (child: TraversedEntry) => child.type === 'example' && child.name === payload.exampleName,\n )\n if (exampleEntry) {\n targetId = exampleEntry.id\n }\n }\n }\n\n sidebarState.handleSelectItem(targetId)\n }\n // We must find the ID first from the entries\n else if ('method' in payload && 'path' in payload) {\n const activeDoc = store.workspace.activeDocument\n sidebarState.handleSelectItem(\n sidebarState.getEntryByLocation({\n document: isOpenApiDocument(activeDoc) ? (activeDoc['x-scalar-navigation']?.id ?? '') : '',\n path: payload.path,\n method: payload.method,\n example: payload.exampleName,\n })?.id ?? '',\n )\n }\n\n modalState.show()\n })\n}\n"],"mappings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class: "flex h-full w-full items-center justify-center"
|
|
11
11
|
};
|
|
12
|
-
var Operation_vue_vue_type_script_setup_true_lang_default =
|
|
12
|
+
var Operation_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
13
|
__name: "Operation",
|
|
14
14
|
props: {
|
|
15
15
|
documentSlug: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n\nexport type OperationProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document — OpenAPI-only, the operation page has no AsyncAPI path */\n document: OpenApiDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** Client plugins */\n plugins: ClientPlugin[]\n /** App or modal options forwarded to operation/auth blocks */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ClientLayout } from '@/v2/types/layout'\nimport type { ApiClientOptions } from '@/v2/types/options'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n OperationProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\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\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFA,MAAM,iBAAiB,eAAe;
|
|
1
|
+
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n\nexport type OperationProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document — OpenAPI-only, the operation page has no AsyncAPI path */\n document: OpenApiDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** Client plugins */\n plugins: ClientPlugin[]\n /** App or modal options forwarded to operation/auth blocks */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ClientLayout } from '@/v2/types/layout'\nimport type { ApiClientOptions } from '@/v2/types/options'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n OperationProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\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\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFA,MAAM,iBAAiB,eAAe;GACpC,IAAI,CAAC,QAAA,QAAQ,CAAC,QAAA,UAAU,CAAC,QAAA,eAAe,CAAC,QAAA,UAC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A,OAAA,KAAA,CADJ,mBAAiE,QAAA,EAA3D,OAAM,WAAU,GAAC,uCAAmC,EAAA,CAAA,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/DocumentSearchModal.vue"],"names":[],"mappings":"AAyJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAQnG,KAAK,WAAW,GAAG;IACjB,mDAAmD;IACnD,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAA;CACtC,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentSearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/DocumentSearchModal.vue"],"names":[],"mappings":"AAyJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAQnG,KAAK,WAAW,GAAG;IACjB,mDAAmD;IACnD,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAA;CACtC,CAAC;AAqQF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
|
|
|
2
2
|
import DocumentSearchModal_vue_vue_type_script_setup_true_lang_default from "./DocumentSearchModal.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/features/search/components/DocumentSearchModal.vue
|
|
5
|
-
var DocumentSearchModal_default =
|
|
5
|
+
var DocumentSearchModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DocumentSearchModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d1af4404"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DocumentSearchModal_default as default };
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ var _hoisted_1 = {
|
|
|
10
10
|
class: "mb-0 flex flex-col",
|
|
11
11
|
role: "search"
|
|
12
12
|
};
|
|
13
|
-
var DocumentSearchModal_vue_vue_type_script_setup_true_lang_default =
|
|
13
|
+
var DocumentSearchModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
14
|
__name: "DocumentSearchModal",
|
|
15
15
|
props: {
|
|
16
16
|
modalState: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSearchModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/search/components/DocumentSearchModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarSearchResultList } from '@scalar/components/search-results'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, watch } from 'vue'\n\nimport { useDocumentSearch } from '@/v2/features/search/hooks/use-document-search'\n\nimport SearchResult from './SearchResult.vue'\n\nconst props = defineProps<{\n /** Controls the visibility of the search modal. */\n modalState: ModalState\n /** The document whose entries should be searched. */\n document: OpenApiDocument | undefined\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user picks a result, passing the navigation id. */\n (e: 'select', id: string): void\n}>()\n\n/** Base id for the search form. */\nconst id = nanoid()\nconst listboxId = `${id}-search-result`\nconst instructionsId = `${id}-search-instructions`\n\nconst { query, results } = useDocumentSearch(() => props.document)\n\nconst selectedIndex = ref<number | undefined>(undefined)\n\n/**\n * Reset the query every time the modal is opened so users always start from a\n * clean state. Matches the reference search modal behaviour.\n */\nwatch(\n () => props.modalState.open,\n (open) => {\n if (open) {\n query.value = ''\n selectedIndex.value = undefined\n }\n },\n)\n\n/** Keyboard navigation, wrapping around the ends of the result list. */\nconst navigateSearchResults = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = results.value.length\n if (length === 0) {\n return\n }\n\n if (typeof selectedIndex.value === 'number') {\n selectedIndex.value = (selectedIndex.value + offset + length) % length\n return\n }\n\n selectedIndex.value = offset === -1 ? length - 1 : 0\n}\n\nfunction handleSelect(idx: number | undefined) {\n if (typeof idx !== 'number' || !results.value[idx]) {\n return\n }\n\n const result = results.value[idx]\n props.modalState.hide()\n emit('select', result.item.id)\n}\n\n/**\n * aria-activedescendant for the combobox. Each result item must render the\n * matching id for assistive tech to announce the selection correctly.\n */\nconst activeDescendantId = computed(() => {\n const selectedResult = results.value[selectedIndex.value ?? -1]\n return selectedResult ? `search-result-${selectedResult.item.id}` : undefined\n})\n</script>\n\n<template>\n <ScalarModal\n aria-label=\"Document Search\"\n :state=\"modalState\"\n variant=\"search\">\n <div\n class=\"mb-0 flex flex-col\"\n role=\"search\">\n <ScalarSearchInput\n v-model=\"query\"\n :aria-activedescendant=\"activeDescendantId\"\n aria-autocomplete=\"list\"\n :aria-controls=\"listboxId\"\n :aria-describedby=\"instructionsId\"\n role=\"combobox\"\n @blur=\"selectedIndex = undefined\"\n @keydown.down.stop.prevent=\"navigateSearchResults('down')\"\n @keydown.enter.stop.prevent=\"() => handleSelect(selectedIndex)\"\n @keydown.up.stop.prevent=\"navigateSearchResults('up')\" />\n </div>\n <ScalarSearchResultList\n :id=\"listboxId\"\n aria-label=\"Document Search Results\"\n class=\"custom-scroll px-1 pb-1\"\n :noResults=\"!results.length\">\n <template #query>\n {{ query }}\n </template>\n <SearchResult\n v-for=\"(result, idx) in results\"\n :id=\"`search-result-${result.item.id}`\"\n :key=\"result.refIndex\"\n :isSelected=\"selectedIndex === idx\"\n :result=\"result\"\n @click.prevent=\"() => handleSelect(idx)\" />\n </ScalarSearchResultList>\n <div\n :id=\"instructionsId\"\n class=\"ref-search-meta\">\n <span\n aria-hidden=\"true\"\n class=\"contents\">\n <span>↑↓ Navigate</span>\n <span>⏎ Select</span>\n </span>\n <span class=\"sr-only\">\n Press up arrow / down arrow to navigate, enter to select, type to filter\n results\n </span>\n </div>\n </ScalarModal>\n</template>\n\n<style scoped>\n.ref-search-meta {\n background: var(--scalar-background-1);\n border-bottom-left-radius: var(--scalar-radius-lg);\n border-bottom-right-radius: var(--scalar-radius-lg);\n padding: 6px 12px;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n display: flex;\n gap: 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAOd,MAAM,OAAO;;EAMb,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"DocumentSearchModal.vue.script.js","names":[],"sources":["../../../../../src/v2/features/search/components/DocumentSearchModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarSearchResultList } from '@scalar/components/search-results'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, watch } from 'vue'\n\nimport { useDocumentSearch } from '@/v2/features/search/hooks/use-document-search'\n\nimport SearchResult from './SearchResult.vue'\n\nconst props = defineProps<{\n /** Controls the visibility of the search modal. */\n modalState: ModalState\n /** The document whose entries should be searched. */\n document: OpenApiDocument | undefined\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user picks a result, passing the navigation id. */\n (e: 'select', id: string): void\n}>()\n\n/** Base id for the search form. */\nconst id = nanoid()\nconst listboxId = `${id}-search-result`\nconst instructionsId = `${id}-search-instructions`\n\nconst { query, results } = useDocumentSearch(() => props.document)\n\nconst selectedIndex = ref<number | undefined>(undefined)\n\n/**\n * Reset the query every time the modal is opened so users always start from a\n * clean state. Matches the reference search modal behaviour.\n */\nwatch(\n () => props.modalState.open,\n (open) => {\n if (open) {\n query.value = ''\n selectedIndex.value = undefined\n }\n },\n)\n\n/** Keyboard navigation, wrapping around the ends of the result list. */\nconst navigateSearchResults = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = results.value.length\n if (length === 0) {\n return\n }\n\n if (typeof selectedIndex.value === 'number') {\n selectedIndex.value = (selectedIndex.value + offset + length) % length\n return\n }\n\n selectedIndex.value = offset === -1 ? length - 1 : 0\n}\n\nfunction handleSelect(idx: number | undefined) {\n if (typeof idx !== 'number' || !results.value[idx]) {\n return\n }\n\n const result = results.value[idx]\n props.modalState.hide()\n emit('select', result.item.id)\n}\n\n/**\n * aria-activedescendant for the combobox. Each result item must render the\n * matching id for assistive tech to announce the selection correctly.\n */\nconst activeDescendantId = computed(() => {\n const selectedResult = results.value[selectedIndex.value ?? -1]\n return selectedResult ? `search-result-${selectedResult.item.id}` : undefined\n})\n</script>\n\n<template>\n <ScalarModal\n aria-label=\"Document Search\"\n :state=\"modalState\"\n variant=\"search\">\n <div\n class=\"mb-0 flex flex-col\"\n role=\"search\">\n <ScalarSearchInput\n v-model=\"query\"\n :aria-activedescendant=\"activeDescendantId\"\n aria-autocomplete=\"list\"\n :aria-controls=\"listboxId\"\n :aria-describedby=\"instructionsId\"\n role=\"combobox\"\n @blur=\"selectedIndex = undefined\"\n @keydown.down.stop.prevent=\"navigateSearchResults('down')\"\n @keydown.enter.stop.prevent=\"() => handleSelect(selectedIndex)\"\n @keydown.up.stop.prevent=\"navigateSearchResults('up')\" />\n </div>\n <ScalarSearchResultList\n :id=\"listboxId\"\n aria-label=\"Document Search Results\"\n class=\"custom-scroll px-1 pb-1\"\n :noResults=\"!results.length\">\n <template #query>\n {{ query }}\n </template>\n <SearchResult\n v-for=\"(result, idx) in results\"\n :id=\"`search-result-${result.item.id}`\"\n :key=\"result.refIndex\"\n :isSelected=\"selectedIndex === idx\"\n :result=\"result\"\n @click.prevent=\"() => handleSelect(idx)\" />\n </ScalarSearchResultList>\n <div\n :id=\"instructionsId\"\n class=\"ref-search-meta\">\n <span\n aria-hidden=\"true\"\n class=\"contents\">\n <span>↑↓ Navigate</span>\n <span>⏎ Select</span>\n </span>\n <span class=\"sr-only\">\n Press up arrow / down arrow to navigate, enter to select, type to filter\n results\n </span>\n </div>\n </ScalarModal>\n</template>\n\n<style scoped>\n.ref-search-meta {\n background: var(--scalar-background-1);\n border-bottom-left-radius: var(--scalar-radius-lg);\n border-bottom-right-radius: var(--scalar-radius-lg);\n padding: 6px 12px;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n display: flex;\n gap: 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAOd,MAAM,OAAO;;EAMb,MAAM,KAAK,OAAO;EAClB,MAAM,YAAY,GAAG,GAAG;EACxB,MAAM,iBAAiB,GAAG,GAAG;EAE7B,MAAM,EAAE,OAAO,YAAY,wBAAwB,MAAM,QAAQ;EAEjE,MAAM,gBAAgB,IAAwB,KAAA,CAAS;;;;;EAMvD,YACQ,MAAM,WAAW,OACtB,SAAS;GACR,IAAI,MAAM;IACR,MAAM,QAAQ;IACd,cAAc,QAAQ,KAAA;GACxB;EACF,CACF;;EAGA,MAAM,yBAAyB,cAA6B;GAC1D,MAAM,SAAS,cAAc,OAAO,KAAK;GACzC,MAAM,SAAS,QAAQ,MAAM;GAC7B,IAAI,WAAW,GACb;GAGF,IAAI,OAAO,cAAc,UAAU,UAAU;IAC3C,cAAc,SAAS,cAAc,QAAQ,SAAS,UAAU;IAChE;GACF;GAEA,cAAc,QAAQ,WAAW,KAAK,SAAS,IAAI;EACrD;EAEA,SAAS,aAAa,KAAyB;GAC7C,IAAI,OAAO,QAAQ,YAAY,CA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gB,aAAa,GAAG,GAAA,CAAA,SAAA,CAAA;;;;;;;;;;KAE1C,mBAaM,OAAA;MAZH,IAAI;MACL,OAAM;uCACN,mBAKO,QAAA;MAJL,eAAY;MACZ,OAAM;SACN,mBAAwB,QAAA,MAAlB,aAAW,GACjB,mBAAqB,QAAA,MAAf,UAAQ,CAAA,GAAA,EAAA,GAEhB,mBAGO,QAAA,EAHD,OAAM,UAAS,GAAC,sFAGtB,EAAA,CAAA,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResult.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/SearchResult.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE1D,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;CAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchResult.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/SearchResult.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE1D,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;CAC7B,CAAC;AA8HF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -6,7 +6,7 @@ import { ScalarSearchResultItem } from "@scalar/components/search-results";
|
|
|
6
6
|
var _hoisted_1 = { class: "sr-only" };
|
|
7
7
|
var _hoisted_2 = { class: "inline-flex items-center gap-1" };
|
|
8
8
|
var _hoisted_3 = { class: "sr-only" };
|
|
9
|
-
var SearchResult_vue_vue_type_script_setup_true_lang_default =
|
|
9
|
+
var SearchResult_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
10
10
|
__name: "SearchResult",
|
|
11
11
|
props: {
|
|
12
12
|
id: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResult.vue.script.js","names":[],"sources":["../../../../../src/v2/features/search/components/SearchResult.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSearchResultItem } from '@scalar/components/search-results'\nimport {\n ScalarIconTag,\n ScalarIconTerminalWindow,\n ScalarIconTextAlignLeft,\n} from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { HttpMethod } from '@scalar/sidebar'\nimport type { FuseResult } from 'fuse.js'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\ndefineProps<{\n id: string\n isSelected: boolean\n result: FuseResult<FuseData>\n}>()\n\n/**\n * Icon used for each search result type. Operations use the terminal glyph to\n * match the sidebar's operation indicator, tags and headings use their closest\n * semantic equivalents.\n */\nconst ENTRY_ICONS: { [x in FuseData['type']]: ScalarIconComponent } = {\n heading: ScalarIconTextAlignLeft,\n operation: ScalarIconTerminalWindow,\n tag: ScalarIconTag,\n}\n\nconst ENTRY_LABELS: { [x in FuseData['type']]: string } = {\n heading: 'Heading',\n operation: 'Operation',\n tag: 'Tag',\n}\n</script>\n\n<template>\n <ScalarSearchResultItem\n :id=\"id\"\n :icon=\"ENTRY_ICONS[result.item.type]\"\n :selected=\"isSelected\">\n <span>\n <span class=\"sr-only\">{{ ENTRY_LABELS[result.item.type] }}: </span>\n {{ result.item.title }}\n <span class=\"sr-only\">,</span>\n </span>\n <template\n v-if=\"\n result.item.type === 'operation' &&\n (result.item.method || result.item.path) &&\n result.item.path !== result.item.title\n \"\n #description>\n <span class=\"inline-flex items-center gap-1\">\n <HttpMethod\n aria-hidden=\"true\"\n :method=\"result.item.method ?? 'get'\" />\n <span class=\"sr-only\">\n HTTP Method: {{ result.item.method ?? 'get' }}\n </span>\n <span class=\"sr-only\">Path: </span>\n {{ result.item.path }}\n </span>\n </template>\n <template\n v-else-if=\"result.item.description\"\n #description>\n <span class=\"sr-only\">Description: </span>\n {{ result.item.description }}\n </template>\n </ScalarSearchResultItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,cAAgE;GACpE,SAAS;GACT,WAAW;GACX,KAAK;
|
|
1
|
+
{"version":3,"file":"SearchResult.vue.script.js","names":[],"sources":["../../../../../src/v2/features/search/components/SearchResult.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSearchResultItem } from '@scalar/components/search-results'\nimport {\n ScalarIconTag,\n ScalarIconTerminalWindow,\n ScalarIconTextAlignLeft,\n} from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { HttpMethod } from '@scalar/sidebar'\nimport type { FuseResult } from 'fuse.js'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\ndefineProps<{\n id: string\n isSelected: boolean\n result: FuseResult<FuseData>\n}>()\n\n/**\n * Icon used for each search result type. Operations use the terminal glyph to\n * match the sidebar's operation indicator, tags and headings use their closest\n * semantic equivalents.\n */\nconst ENTRY_ICONS: { [x in FuseData['type']]: ScalarIconComponent } = {\n heading: ScalarIconTextAlignLeft,\n operation: ScalarIconTerminalWindow,\n tag: ScalarIconTag,\n}\n\nconst ENTRY_LABELS: { [x in FuseData['type']]: string } = {\n heading: 'Heading',\n operation: 'Operation',\n tag: 'Tag',\n}\n</script>\n\n<template>\n <ScalarSearchResultItem\n :id=\"id\"\n :icon=\"ENTRY_ICONS[result.item.type]\"\n :selected=\"isSelected\">\n <span>\n <span class=\"sr-only\">{{ ENTRY_LABELS[result.item.type] }}: </span>\n {{ result.item.title }}\n <span class=\"sr-only\">,</span>\n </span>\n <template\n v-if=\"\n result.item.type === 'operation' &&\n (result.item.method || result.item.path) &&\n result.item.path !== result.item.title\n \"\n #description>\n <span class=\"inline-flex items-center gap-1\">\n <HttpMethod\n aria-hidden=\"true\"\n :method=\"result.item.method ?? 'get'\" />\n <span class=\"sr-only\">\n HTTP Method: {{ result.item.method ?? 'get' }}\n </span>\n <span class=\"sr-only\">Path: </span>\n {{ result.item.path }}\n </span>\n </template>\n <template\n v-else-if=\"result.item.description\"\n #description>\n <span class=\"sr-only\">Description: </span>\n {{ result.item.description }}\n </template>\n </ScalarSearchResultItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,cAAgE;GACpE,SAAS;GACT,WAAW;GACX,KAAK;EACP;EAEA,MAAM,eAAoD;GACxD,SAAS;GACT,WAAW;GACX,KAAK;EACP;;uBAIE,YAiCyB,MAAA,sBAAA,GAAA;IAhCtB,IAAI,QAAA;IACJ,MAAM,YAAY,QAAA,OAAO,KAAK;IAC9B,UAAU,QAAA;;2BAKJ,CAJP,mBAIO,QAAA,MAAA;KAHL,mBAAwE,QAAxE,YAAwE,gBAA/C,aAAa,QAAA,OAAO,KAAK,KAAI,IAAI,SAAO,CAAA;qBAAO,MACxE,gBAAG,QAAA,OAAO,KAAK,KAAK,IAAG,KACvB,CAAA;+BAAA,mBAA8B,QAAA,EAAxB,OAAM,UAAS,GAAC,KAAC,EAAA;;;OAGR,QAAA,OAAO,KAAK,SAAI,gBAA6B,QAAA,OAAO,KAAK,UAAU,QAAA,OAAO,KAAK,SAAiB,QAAA,OAAO,KAAK,SAAS,QAAA,OAAO,KAAK,QAAA;UAK/I;sBAUM,CATP,mBASO,QATP,YASO;KARL,YAE0C,MAAA,UAAA,GAAA;MADxC,eAAY;MACX,QAAQ,QAAA,OAAO,KAAK,UAAM;;KAC7B,mBAEO,QAFP,YAAsB,mBACP,gBAAG,QAAA,OAAO,KAAK,UAAM,KAAA,GAAA,CAAA;+BAEpC,mBAAwC,QAAA,EAAlC,OAAM,UAAS,GAAC,aAAW,EAAA;qBAAO,MACxC,gBAAG,QAAA,OAAO,KAAK,IAAI,GAAA,CAAA;;;OAIV,QAAA,OAAO,KAAK,cAAA;UACtB;sBAC8C,CAAA,OAAA,OAAA,OAAA,KAA/C,mBAA+C,QAAA,EAAzC,OAAM,UAAS,GAAC,oBAAkB,EAAA,IAAA,gBAAO,MAC/C,gBAAG,QAAA,OAAO,KAAK,WAAW,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-fuse-instance.js","names":[],"sources":["../../../../../src/v2/features/search/helpers/create-fuse-instance.ts"],"sourcesContent":["import Fuse from 'fuse.js'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a Fuse instance for searching the API reference.\n *\n * Doesn't have any data yet, so it's empty.\n */\nexport function createFuseInstance(): Fuse<FuseData> {\n return new Fuse([], {\n // Define searchable fields with weights to prioritize more important matches\n keys: [\n // Highest weight - titles are most descriptive\n { name: 'title', weight: 0.7 },\n // Medium weight - helpful but often verbose\n { name: 'description', weight: 0.3 },\n // High weight - unique identifiers for operations\n { name: 'operationId', weight: 0.6 },\n // Good weight - endpoint paths are searchable\n { name: 'path', weight: 0.5 },\n // Medium-high weight - helps with categorization\n { name: 'tag', weight: 0.4 },\n // Medium weight - useful for filtering by method\n { name: 'method', weight: 0.3 },\n // Medium weight - useful for filtering by document name\n { name: 'documentName', weight: 0.3 },\n ],\n\n // Threshold controls how strict the matching is (0.0 = perfect match, 1.0 = very loose)\n // 0.3 allows for some typos and partial matches while maintaining relevance\n threshold: 0.3,\n\n // Maximum distance between characters that can be matched\n // Higher values allow matches even when characters are far apart in long text\n distance: 100,\n\n // Include the match score in results for debugging and potential UI enhancements\n includeScore: true,\n\n // Include detailed match information showing which parts of the text matched\n includeMatches: true,\n\n // Don't require matches to be at the beginning of strings\n // Makes search more flexible and user-friendly\n ignoreLocation: true,\n\n // Enable advanced search syntax like 'exact' for exact matches or !exclude for exclusions\n useExtendedSearch: true,\n\n // Find all possible matches in each item, not just the first one\n // Ensures comprehensive search results\n findAllMatches: true,\n })\n}\n"],"mappings":";;;;;;;AASA,SAAgB,qBAAqC;
|
|
1
|
+
{"version":3,"file":"create-fuse-instance.js","names":[],"sources":["../../../../../src/v2/features/search/helpers/create-fuse-instance.ts"],"sourcesContent":["import Fuse from 'fuse.js'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a Fuse instance for searching the API reference.\n *\n * Doesn't have any data yet, so it's empty.\n */\nexport function createFuseInstance(): Fuse<FuseData> {\n return new Fuse<FuseData>([], {\n // Define searchable fields with weights to prioritize more important matches\n keys: [\n // Highest weight - titles are most descriptive\n { name: 'title', weight: 0.7 },\n // Medium weight - helpful but often verbose\n { name: 'description', weight: 0.3 },\n // High weight - unique identifiers for operations\n { name: 'operationId', weight: 0.6 },\n // Good weight - endpoint paths are searchable\n { name: 'path', weight: 0.5 },\n // Medium-high weight - helps with categorization\n { name: 'tag', weight: 0.4 },\n // Medium weight - useful for filtering by method\n { name: 'method', weight: 0.3 },\n // Medium weight - useful for filtering by document name\n { name: 'documentName', weight: 0.3 },\n ],\n\n // Threshold controls how strict the matching is (0.0 = perfect match, 1.0 = very loose)\n // 0.3 allows for some typos and partial matches while maintaining relevance\n threshold: 0.3,\n\n // Maximum distance between characters that can be matched\n // Higher values allow matches even when characters are far apart in long text\n distance: 100,\n\n // Include the match score in results for debugging and potential UI enhancements\n includeScore: true,\n\n // Include detailed match information showing which parts of the text matched\n includeMatches: true,\n\n // Don't require matches to be at the beginning of strings\n // Makes search more flexible and user-friendly\n ignoreLocation: true,\n\n // Enable advanced search syntax like 'exact' for exact matches or !exclude for exclusions\n useExtendedSearch: true,\n\n // Find all possible matches in each item, not just the first one\n // Ensures comprehensive search results\n findAllMatches: true,\n })\n}\n"],"mappings":";;;;;;;AASA,SAAgB,qBAAqC;CACnD,OAAO,IAAI,KAAe,CAAC,GAAG;EAE5B,MAAM;GAEJ;IAAE,MAAM;IAAS,QAAQ;GAAI;GAE7B;IAAE,MAAM;IAAe,QAAQ;GAAI;GAEnC;IAAE,MAAM;IAAe,QAAQ;GAAI;GAEnC;IAAE,MAAM;IAAQ,QAAQ;GAAI;GAE5B;IAAE,MAAM;IAAO,QAAQ;GAAI;GAE3B;IAAE,MAAM;IAAU,QAAQ;GAAI;GAE9B;IAAE,MAAM;IAAgB,QAAQ;GAAI;EACtC;EAIA,WAAW;EAIX,UAAU;EAGV,cAAc;EAGd,gBAAgB;EAIhB,gBAAgB;EAGhB,mBAAmB;EAInB,gBAAgB;CAClB,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-search-index.js","names":[],"sources":["../../../../../src/v2/features/search/helpers/create-search-index.ts"],"sourcesContent":["import { getPathItemOperation } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(documents: OpenApiDocument[]): FuseData[] {\n const index: FuseData[] = []\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[], document?: OpenApiDocument): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children, document)\n }\n })\n }\n\n documents?.forEach((document) => processEntries(document['x-scalar-navigation']?.children ?? [], document))\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n */\nfunction addEntryToIndex(entry: TraversedEntry, index: FuseData[], document?: OpenApiDocument): void {\n // Operation\n if (entry.type === 'operation') {\n const operation = getResolvedRef(getPathItemOperation(document?.paths?.[entry.path], entry.method)) ?? {}\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operation.description || '',\n method: entry.method,\n path: entry.path,\n operationId: operation.operationId,\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n if (entry.type === 'tag' && entry.isGroup === false) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: entry.description || '',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Tag group\n if (entry.type === 'tag' && entry.isGroup === true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: 'Tag Group',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Headings from info.description\n if (entry.type === 'text') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title ?? '',\n description: 'Heading',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n}\n"],"mappings":";;;;;;AAUA,SAAgB,kBAAkB,WAA0C;CAC1E,MAAM,QAAoB,
|
|
1
|
+
{"version":3,"file":"create-search-index.js","names":[],"sources":["../../../../../src/v2/features/search/helpers/create-search-index.ts"],"sourcesContent":["import { getPathItemOperation } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(documents: OpenApiDocument[]): FuseData[] {\n const index: FuseData[] = []\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[], document?: OpenApiDocument): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children, document)\n }\n })\n }\n\n documents?.forEach((document) => processEntries(document['x-scalar-navigation']?.children ?? [], document))\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n */\nfunction addEntryToIndex(entry: TraversedEntry, index: FuseData[], document?: OpenApiDocument): void {\n // Operation\n if (entry.type === 'operation') {\n const operation = getResolvedRef(getPathItemOperation(document?.paths?.[entry.path], entry.method)) ?? {}\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operation.description || '',\n method: entry.method,\n path: entry.path,\n operationId: operation.operationId,\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n if (entry.type === 'tag' && entry.isGroup === false) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: entry.description || '',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Tag group\n if (entry.type === 'tag' && entry.isGroup === true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: 'Tag Group',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Headings from info.description\n if (entry.type === 'text') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title ?? '',\n description: 'Heading',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n}\n"],"mappings":";;;;;;AAUA,SAAgB,kBAAkB,WAA0C;CAC1E,MAAM,QAAoB,CAAC;;;;CAK3B,SAAS,eAAe,kBAAoC,UAAkC;EAC5F,iBAAiB,SAAS,UAAU;GAClC,gBAAgB,OAAO,OAAO,QAAQ;GAGtC,IAAI,cAAc,SAAS,MAAM,UAC/B,eAAe,MAAM,UAAU,QAAQ;EAE3C,CAAC;CACH;CAEA,WAAW,SAAS,aAAa,eAAe,SAAS,sBAAsB,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC;CAE1G,OAAO;AACT;;;;AAKA,SAAS,gBAAgB,OAAuB,OAAmB,UAAkC;CAEnG,IAAI,MAAM,SAAS,aAAa;EAC9B,MAAM,YAAY,eAAe,qBAAqB,UAAU,QAAQ,MAAM,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;EAExG,MAAM,KAAK;GACT,MAAM;GACN,OAAO,MAAM;GACb,IAAI,MAAM;GACV,aAAa,UAAU,eAAe;GACtC,QAAQ,MAAM;GACd,MAAM,MAAM;GACZ,aAAa,UAAU;GACvB;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;CAEA,IAAI,MAAM,SAAS,SAAS,MAAM,YAAY,OAAO;EACnD,MAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa,MAAM,eAAe;GAClC,MAAM;GACN;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;CAGA,IAAI,MAAM,SAAS,SAAS,MAAM,YAAY,MAAM;EAClD,MAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa;GACb,MAAM;GACN;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;CAGA,IAAI,MAAM,SAAS,QAAQ;EACzB,MAAM,KAAK;GACT,IAAI,MAAM;GACV,MAAM;GACN,OAAO,MAAM,SAAS;GACtB,aAAa;GACb;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-document-search.js","names":[],"sources":["../../../../../src/v2/features/search/hooks/use-document-search.ts"],"sourcesContent":["import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { FuseResult } from 'fuse.js'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\nimport type { FuseData } from '../types'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Fuzzy search scoped to a single OpenAPI document.\n *\n * Mirrors the behaviour of the reference search modal (`@scalar/api-reference`)\n * but stays local to api-client so the two packages do not have a circular\n * dependency. The index is rebuilt whenever the source document changes.\n *\n * When the query is empty we surface the first `MAX_SEARCH_RESULTS` entries of\n * the index as a zero-state list, matching the reference UX.\n */\nexport function useDocumentSearch(document: MaybeRefOrGetter<OpenApiDocument | undefined>) {\n const searchIndex = computed<FuseData[]>(() => {\n const doc = toValue(document)\n return doc ? createSearchIndex([doc]) : []\n })\n\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(searchIndex.value)\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed<FuseResult<FuseData>[]>(() => {\n const trimmed = query.value.trim()\n if (trimmed) {\n return fuse.value.search(trimmed, { limit: MAX_SEARCH_RESULTS })\n }\n\n return searchIndex.value.slice(0, MAX_SEARCH_RESULTS).map(\n (item, index) =>\n ({\n item,\n refIndex: index,\n }) satisfies FuseResult<FuseData>,\n )\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;AAQA,IAAM,qBAAqB;;;;;;;;;;;AAY3B,SAAgB,kBAAkB,UAAyD;CACzF,MAAM,cAAc,eAA2B;EAC7C,MAAM,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-document-search.js","names":[],"sources":["../../../../../src/v2/features/search/hooks/use-document-search.ts"],"sourcesContent":["import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { FuseResult } from 'fuse.js'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\nimport type { FuseData } from '../types'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Fuzzy search scoped to a single OpenAPI document.\n *\n * Mirrors the behaviour of the reference search modal (`@scalar/api-reference`)\n * but stays local to api-client so the two packages do not have a circular\n * dependency. The index is rebuilt whenever the source document changes.\n *\n * When the query is empty we surface the first `MAX_SEARCH_RESULTS` entries of\n * the index as a zero-state list, matching the reference UX.\n */\nexport function useDocumentSearch(document: MaybeRefOrGetter<OpenApiDocument | undefined>) {\n const searchIndex = computed<FuseData[]>(() => {\n const doc = toValue(document)\n return doc ? createSearchIndex([doc]) : []\n })\n\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(searchIndex.value)\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed<FuseResult<FuseData>[]>(() => {\n const trimmed = query.value.trim()\n if (trimmed) {\n return fuse.value.search(trimmed, { limit: MAX_SEARCH_RESULTS })\n }\n\n return searchIndex.value.slice(0, MAX_SEARCH_RESULTS).map(\n (item, index) =>\n ({\n item,\n refIndex: index,\n }) satisfies FuseResult<FuseData>,\n )\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;AAQA,IAAM,qBAAqB;;;;;;;;;;;AAY3B,SAAgB,kBAAkB,UAAyD;CACzF,MAAM,cAAc,eAA2B;EAC7C,MAAM,MAAM,QAAQ,QAAQ;EAC5B,OAAO,MAAM,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC;CAC3C,CAAC;CAED,MAAM,OAAO,eAAe;EAC1B,MAAM,WAAW,mBAAmB;EACpC,SAAS,cAAc,YAAY,KAAK;EACxC,OAAO;CACT,CAAC;CAED,MAAM,QAAQ,IAAY,EAAE;CAiB5B,OAAO;EACL,SAhBc,eAAuC;GACrD,MAAM,UAAU,MAAM,MAAM,KAAK;GACjC,IAAI,SACF,OAAO,KAAK,MAAM,OAAO,SAAS,EAAE,OAAO,mBAAmB,CAAC;GAGjE,OAAO,YAAY,MAAM,MAAM,GAAG,kBAAkB,CAAC,CAAC,KACnD,MAAM,WACJ;IACC;IACA,UAAU;GACZ,EACJ;EACF,CAGE;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-index.js","names":[],"sources":["../../../../../src/v2/features/search/hooks/use-search-index.ts"],"sourcesContent":["import type { Item } from '@scalar/sidebar'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Creates the search index from multiple OpenAPI documents\n */\nexport const useSearchIndex = (documents: MaybeRefOrGetter<OpenApiDocument[]>) => {\n /** When the document changes we replace the search index */\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(createSearchIndex(toValue(documents)))\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed<Item[] | null>(() => {\n if (query.value.length !== 0) {\n const fuseResults = fuse.value.search(query.value, {\n limit: MAX_SEARCH_RESULTS,\n })\n\n // Lets only show operations for now to match previous behavior\n return fuseResults.flatMap((result) => {\n if (result.item.entry.type !== 'operation') {\n return []\n }\n\n return result.item.entry\n })\n }\n\n return null\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;AAOA,IAAM,qBAAqB;;;;AAK3B,IAAa,kBAAkB,cAAmD;;CAEhF,MAAM,OAAO,eAAe;EAC1B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"use-search-index.js","names":[],"sources":["../../../../../src/v2/features/search/hooks/use-search-index.ts"],"sourcesContent":["import type { Item } from '@scalar/sidebar'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { type MaybeRefOrGetter, computed, ref, toValue } from 'vue'\n\nimport { createFuseInstance } from '../helpers/create-fuse-instance'\nimport { createSearchIndex } from '../helpers/create-search-index'\n\nconst MAX_SEARCH_RESULTS = 25\n\n/**\n * Creates the search index from multiple OpenAPI documents\n */\nexport const useSearchIndex = (documents: MaybeRefOrGetter<OpenApiDocument[]>) => {\n /** When the document changes we replace the search index */\n const fuse = computed(() => {\n const instance = createFuseInstance()\n instance.setCollection(createSearchIndex(toValue(documents)))\n return instance\n })\n\n const query = ref<string>('')\n\n const results = computed<Item[] | null>(() => {\n if (query.value.length !== 0) {\n const fuseResults = fuse.value.search(query.value, {\n limit: MAX_SEARCH_RESULTS,\n })\n\n // Lets only show operations for now to match previous behavior\n return fuseResults.flatMap((result) => {\n if (result.item.entry.type !== 'operation') {\n return []\n }\n\n return result.item.entry\n })\n }\n\n return null\n })\n\n return {\n results,\n query,\n }\n}\n"],"mappings":";;;;AAOA,IAAM,qBAAqB;;;;AAK3B,IAAa,kBAAkB,cAAmD;;CAEhF,MAAM,OAAO,eAAe;EAC1B,MAAM,WAAW,mBAAmB;EACpC,SAAS,cAAc,kBAAkB,QAAQ,SAAS,CAAC,CAAC;EAC5D,OAAO;CACT,CAAC;CAED,MAAM,QAAQ,IAAY,EAAE;CAqB5B,OAAO;EACL,SApBc,eAA8B;GAC5C,IAAI,MAAM,MAAM,WAAW,GAMzB,OALoB,KAAK,MAAM,OAAO,MAAM,OAAO,EACjD,OAAO,mBACT,CAGO,CAAA,CAAY,SAAS,WAAW;IACrC,IAAI,OAAO,KAAK,MAAM,SAAS,aAC7B,OAAO,CAAC;IAGV,OAAO,OAAO,KAAK;GACrB,CAAC;GAGH,OAAO;EACT,CAGE;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-location-id.js","names":[],"sources":["../../../src/v2/helpers/generate-location-id.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\n\n/**\n * Generates a unique string ID for an API location, based on the document, path, method, and example.\n * Filters out undefined values and serializes the composite array into a stable string.\n *\n * @param params - An object containing document, path, method, and optional example name.\n * @returns A stringified array representing the unique location identifier.\n *\n * Example:\n * generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })\n * // => '[\"mydoc\",\"/users\",\"get\",\"default\"]'\n */\nexport const generateLocationId = ({\n document,\n path,\n method,\n example,\n}: {\n document: string\n path?: string\n method?: HttpMethod\n example?: string\n}) => {\n return JSON.stringify([document, path, method, example].filter(isDefined))\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,sBAAsB,EACjC,UACA,MACA,QACA,cAMI;
|
|
1
|
+
{"version":3,"file":"generate-location-id.js","names":[],"sources":["../../../src/v2/helpers/generate-location-id.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\n\n/**\n * Generates a unique string ID for an API location, based on the document, path, method, and example.\n * Filters out undefined values and serializes the composite array into a stable string.\n *\n * @param params - An object containing document, path, method, and optional example name.\n * @returns A stringified array representing the unique location identifier.\n *\n * Example:\n * generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })\n * // => '[\"mydoc\",\"/users\",\"get\",\"default\"]'\n */\nexport const generateLocationId = ({\n document,\n path,\n method,\n example,\n}: {\n document: string\n path?: string\n method?: HttpMethod\n example?: string\n}) => {\n return JSON.stringify([document, path, method, example].filter(isDefined))\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,sBAAsB,EACjC,UACA,MACA,QACA,cAMI;CACJ,OAAO,KAAK,UAAU;EAAC;EAAU;EAAM;EAAQ;CAAO,CAAC,CAAC,OAAO,SAAS,CAAC;AAC3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-hotkeys.js","names":[],"sources":["../../../src/v2/helpers/handle-hotkeys.ts"],"sourcesContent":["import { isMacOS } from '@scalar/helpers/general/is-mac-os'\nimport type { ApiReferenceEvents, WorkspaceEventBus } from '@scalar/workspace-store/events'\n\nimport type { ClientLayout } from '@/v2/types/layout'\n\ntype HotKeyModifiers = ('altKey' | 'ctrlKey' | 'shiftKey' | 'metaKey' | 'default')[]\n\n/** Hotkey configuration */\ntype HotKeyConfig = Record<string | number, { event: keyof ApiReferenceEvents; modifiers: HotKeyModifiers }>\n\n/** Default hotkeys available in most contexts */\nconst DEFAULT_HOTKEYS: HotKeyConfig = {\n Enter: { event: 'operation:send:request:hotkey', modifiers: ['default'] },\n b: { event: 'ui:toggle:sidebar', modifiers: ['default'] },\n k: { event: 'ui:open:command-palette', modifiers: ['default'] },\n l: { event: 'ui:focus:address-bar', modifiers: ['default'] },\n j: { event: 'ui:focus:search', modifiers: ['default'] },\n i: { event: 'ui:open:settings', modifiers: ['default'] },\n s: { event: 'ui:save:local-document', modifiers: ['default'] },\n}\n\n/** Hotkey map by layout, we can allow the user to override this later */\nconst HOTKEYS: Record<ClientLayout, HotKeyConfig> = {\n web: DEFAULT_HOTKEYS,\n\n modal: {\n ...DEFAULT_HOTKEYS,\n Escape: { event: 'ui:close:client-modal', modifiers: [] },\n l: { event: 'ui:focus:send-button', modifiers: ['default'] },\n },\n\n desktop: {\n ...DEFAULT_HOTKEYS,\n n: { event: 'ui:open:command-palette', modifiers: ['default'] },\n t: { event: 'tabs:add:tab', modifiers: ['default'] },\n w: { event: 'tabs:close:tab', modifiers: ['default'] },\n ArrowLeft: { event: 'tabs:navigate:previous', modifiers: ['default', 'altKey'] },\n ArrowRight: { event: 'tabs:navigate:next', modifiers: ['default', 'altKey'] },\n 1: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 2: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 3: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 4: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 5: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 6: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 7: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 8: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 9: { event: 'tabs:focus:tab-last', modifiers: ['default'] },\n },\n}\n\n/** Keys that should work in input fields when the modifier is pressed */\nconst INPUT_ALLOWED_KEYS = new Set(['Escape', 'ArrowDown', 'ArrowUp', 'Enter'])\n\n/**\n * Checks if all required modifiers are pressed.\n * Resolves 'default' to metaKey (macOS) or ctrlKey (Windows/Linux).\n */\nconst areModifiersPressed = (event: KeyboardEvent, modifiers: HotKeyModifiers): boolean =>\n modifiers.length > 0 &&\n modifiers\n .map((modifier) => (modifier === 'default' ? (isMacOS() ? 'metaKey' : 'ctrlKey') : modifier))\n .every((key) => event[key] === true)\n\n/**\n * Determines if the event target is an editable element where hotkeys should be blocked.\n * Returns true if we should block the hotkey, false otherwise.\n */\nconst isEditableElement = (event: KeyboardEvent, key: string): boolean => {\n if (!(event.target instanceof HTMLElement)) {\n return false\n }\n\n const target = event.target\n\n // Allow certain functional keys in INPUT fields\n if (target.tagName === 'INPUT') {\n return !INPUT_ALLOWED_KEYS.has(key)\n }\n\n // Block all hotkeys in textareas and contenteditable elements\n return target.tagName === 'TEXTAREA' || target.contentEditable === 'true' || target.hasAttribute('contenteditable')\n}\n\n/**\n * Handles global keyboard shortcuts.\n * Checks modifier keys and input context before emitting events.\n *\n * @param event - the keyboard event\n * @param eventBus - event bus for emitting hotkey actions\n * @param layout - client layout\n */\nexport const handleHotkeys = (event: KeyboardEvent, eventBus: WorkspaceEventBus, layout: ClientLayout): void => {\n /** Special case for space */\n const key = event.key === ' ' ? 'Space' : event.key\n /** Get the discriminated hotkey event with payload */\n const hotkeyEvent = HOTKEYS[layout][key]\n\n if (!hotkeyEvent) {\n return\n }\n\n // Default to sending the keyboard event as the payload\n const payload = { event }\n\n // Escape always fires, regardless of context\n if (key === 'Escape') {\n eventBus.emit(hotkeyEvent.event, payload, { skipUnpackProxy: true })\n return\n }\n\n // If modifiers are pressed, fire the hotkey (even in input fields)\n if (areModifiersPressed(event, hotkeyEvent.modifiers)) {\n eventBus.emit(hotkeyEvent.event, payload, { skipUnpackProxy: true })\n return\n }\n\n // If modifiers are required but missing, do not fire the hotkey.\n if (hotkeyEvent.modifiers.length > 0) {\n return\n }\n\n // Without modifiers, only fire if not in an editable element\n if (!isEditableElement(event, key)) {\n eventBus.emit(hotkeyEvent.event, payload, { skipUnpackProxy: true })\n }\n}\n"],"mappings":";;;AAWA,IAAM,kBAAgC;CACpC,OAAO;EAAE,OAAO;EAAiC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"handle-hotkeys.js","names":[],"sources":["../../../src/v2/helpers/handle-hotkeys.ts"],"sourcesContent":["import { isMacOS } from '@scalar/helpers/general/is-mac-os'\nimport type { ApiReferenceEvents, WorkspaceEventBus } from '@scalar/workspace-store/events'\n\nimport type { ClientLayout } from '@/v2/types/layout'\n\ntype HotKeyModifiers = ('altKey' | 'ctrlKey' | 'shiftKey' | 'metaKey' | 'default')[]\n\n/** Hotkey configuration */\ntype HotKeyConfig = Record<string | number, { event: keyof ApiReferenceEvents; modifiers: HotKeyModifiers }>\n\n/** Default hotkeys available in most contexts */\nconst DEFAULT_HOTKEYS: HotKeyConfig = {\n Enter: { event: 'operation:send:request:hotkey', modifiers: ['default'] },\n b: { event: 'ui:toggle:sidebar', modifiers: ['default'] },\n k: { event: 'ui:open:command-palette', modifiers: ['default'] },\n l: { event: 'ui:focus:address-bar', modifiers: ['default'] },\n j: { event: 'ui:focus:search', modifiers: ['default'] },\n i: { event: 'ui:open:settings', modifiers: ['default'] },\n s: { event: 'ui:save:local-document', modifiers: ['default'] },\n}\n\n/** Hotkey map by layout, we can allow the user to override this later */\nconst HOTKEYS: Record<ClientLayout, HotKeyConfig> = {\n web: DEFAULT_HOTKEYS,\n\n modal: {\n ...DEFAULT_HOTKEYS,\n Escape: { event: 'ui:close:client-modal', modifiers: [] },\n l: { event: 'ui:focus:send-button', modifiers: ['default'] },\n },\n\n desktop: {\n ...DEFAULT_HOTKEYS,\n n: { event: 'ui:open:command-palette', modifiers: ['default'] },\n t: { event: 'tabs:add:tab', modifiers: ['default'] },\n w: { event: 'tabs:close:tab', modifiers: ['default'] },\n ArrowLeft: { event: 'tabs:navigate:previous', modifiers: ['default', 'altKey'] },\n ArrowRight: { event: 'tabs:navigate:next', modifiers: ['default', 'altKey'] },\n 1: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 2: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 3: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 4: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 5: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 6: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 7: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 8: { event: 'tabs:focus:tab', modifiers: ['default'] },\n 9: { event: 'tabs:focus:tab-last', modifiers: ['default'] },\n },\n}\n\n/** Keys that should work in input fields when the modifier is pressed */\nconst INPUT_ALLOWED_KEYS = new Set(['Escape', 'ArrowDown', 'ArrowUp', 'Enter'])\n\n/**\n * Checks if all required modifiers are pressed.\n * Resolves 'default' to metaKey (macOS) or ctrlKey (Windows/Linux).\n */\nconst areModifiersPressed = (event: KeyboardEvent, modifiers: HotKeyModifiers): boolean =>\n modifiers.length > 0 &&\n modifiers\n .map((modifier) => (modifier === 'default' ? (isMacOS() ? 'metaKey' : 'ctrlKey') : modifier))\n .every((key) => event[key] === true)\n\n/**\n * Determines if the event target is an editable element where hotkeys should be blocked.\n * Returns true if we should block the hotkey, false otherwise.\n */\nconst isEditableElement = (event: KeyboardEvent, key: string): boolean => {\n if (!(event.target instanceof HTMLElement)) {\n return false\n }\n\n const target = event.target\n\n // Allow certain functional keys in INPUT fields\n if (target.tagName === 'INPUT') {\n return !INPUT_ALLOWED_KEYS.has(key)\n }\n\n // Block all hotkeys in textareas and contenteditable elements\n return target.tagName === 'TEXTAREA' || target.contentEditable === 'true' || target.hasAttribute('contenteditable')\n}\n\n/**\n * Handles global keyboard shortcuts.\n * Checks modifier keys and input context before emitting events.\n *\n * @param event - the keyboard event\n * @param eventBus - event bus for emitting hotkey actions\n * @param layout - client layout\n */\nexport const handleHotkeys = (event: KeyboardEvent, eventBus: WorkspaceEventBus, layout: ClientLayout): void => {\n /** Special case for space */\n const key = event.key === ' ' ? 'Space' : event.key\n /** Get the discriminated hotkey event with payload */\n const hotkeyEvent = HOTKEYS[layout][key]\n\n if (!hotkeyEvent) {\n return\n }\n\n // Default to sending the keyboard event as the payload\n const payload = { event }\n\n // Escape always fires, regardless of context\n if (key === 'Escape') {\n eventBus.emit(hotkeyEvent.event, payload, { skipUnpackProxy: true })\n return\n }\n\n // If modifiers are pressed, fire the hotkey (even in input fields)\n if (areModifiersPressed(event, hotkeyEvent.modifiers)) {\n eventBus.emit(hotkeyEvent.event, payload, { skipUnpackProxy: true })\n return\n }\n\n // If modifiers are required but missing, do not fire the hotkey.\n if (hotkeyEvent.modifiers.length > 0) {\n return\n }\n\n // Without modifiers, only fire if not in an editable element\n if (!isEditableElement(event, key)) {\n eventBus.emit(hotkeyEvent.event, payload, { skipUnpackProxy: true })\n }\n}\n"],"mappings":";;;AAWA,IAAM,kBAAgC;CACpC,OAAO;EAAE,OAAO;EAAiC,WAAW,CAAC,SAAS;CAAE;CACxE,GAAG;EAAE,OAAO;EAAqB,WAAW,CAAC,SAAS;CAAE;CACxD,GAAG;EAAE,OAAO;EAA2B,WAAW,CAAC,SAAS;CAAE;CAC9D,GAAG;EAAE,OAAO;EAAwB,WAAW,CAAC,SAAS;CAAE;CAC3D,GAAG;EAAE,OAAO;EAAmB,WAAW,CAAC,SAAS;CAAE;CACtD,GAAG;EAAE,OAAO;EAAoB,WAAW,CAAC,SAAS;CAAE;CACvD,GAAG;EAAE,OAAO;EAA0B,WAAW,CAAC,SAAS;CAAE;AAC/D;;AAGA,IAAM,UAA8C;CAClD,KAAK;CAEL,OAAO;EACL,GAAG;EACH,QAAQ;GAAE,OAAO;GAAyB,WAAW,CAAC;EAAE;EACxD,GAAG;GAAE,OAAO;GAAwB,WAAW,CAAC,SAAS;EAAE;CAC7D;CAEA,SAAS;EACP,GAAG;EACH,GAAG;GAAE,OAAO;GAA2B,WAAW,CAAC,SAAS;EAAE;EAC9D,GAAG;GAAE,OAAO;GAAgB,WAAW,CAAC,SAAS;EAAE;EACnD,GAAG;GAAE,OAAO;GAAkB,WAAW,CAAC,SAAS;EAAE;EACrD,WAAW;GAAE,OAAO;GAA0B,WAAW,CAAC,WAAW,QAAQ;EAAE;EAC/E,YAAY;GAAE,OAAO;GAAsB,WAAW,CAAC,WAAW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U;EACpB,SAAS,KAAK,YAAY,OAAO,SAAS,EAAE,iBAAiB,KAAK,CAAC;EACnE;CACF;CAGA,IAAI,oBAAoB,OAAO,YAAY,SAAS,GAAG;EACrD,SAAS,KAAK,YAAY,OAAO,SAAS,EAAE,iBAAiB,KAAK,CAAC;EACnE;CACF;CAGA,IAAI,YAAY,UAAU,SAAS,GACjC;CAIF,IAAI,CAAC,kBAAkB,OAAO,GAAG,GAC/B,SAAS,KAAK,YAAY,OAAO,SAAS,EAAE,iBAAiB,KAAK,CAAC;AAEvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","names":[],"sources":["../../../src/v2/helpers/test-utils.ts"],"sourcesContent":["import type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { vi } from 'vitest'\n\n/** Creates a fresh mock event bus instance for testing */\nexport const createMockEventBus = (): WorkspaceEventBus =>\n ({\n on: vi.fn(() => vi.fn()),\n once: vi.fn(() => vi.fn()),\n off: vi.fn(),\n onAny: vi.fn(() => vi.fn()),\n offAny: vi.fn(),\n emit: vi.fn(() => null),\n flushDebouncedEmits: vi.fn(),\n }) as unknown as WorkspaceEventBus\n\n/** Mock event bus for all your testing needs */\nexport const mockEventBus = createMockEventBus()\n"],"mappings":";;;AAIA,IAAa,4BACV;CACC,IAAI,GAAG,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"test-utils.js","names":[],"sources":["../../../src/v2/helpers/test-utils.ts"],"sourcesContent":["import type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { vi } from 'vitest'\n\n/** Creates a fresh mock event bus instance for testing */\nexport const createMockEventBus = (): WorkspaceEventBus =>\n ({\n on: vi.fn(() => vi.fn()),\n once: vi.fn(() => vi.fn()),\n off: vi.fn(),\n onAny: vi.fn(() => vi.fn()),\n offAny: vi.fn(),\n emit: vi.fn(() => null),\n flushDebouncedEmits: vi.fn(),\n }) as unknown as WorkspaceEventBus\n\n/** Mock event bus for all your testing needs */\nexport const mockEventBus = createMockEventBus()\n"],"mappings":";;;AAIA,IAAa,4BACV;CACC,IAAI,GAAG,SAAS,GAAG,GAAG,CAAC;CACvB,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC;CACzB,KAAK,GAAG,GAAG;CACX,OAAO,GAAG,SAAS,GAAG,GAAG,CAAC;CAC1B,QAAQ,GAAG,GAAG;CACd,MAAM,GAAG,SAAS,IAAI;CACtB,qBAAqB,GAAG,GAAG;AAC7B;;AAGF,IAAa,eAAe,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-global-hot-keys.js","names":[],"sources":["../../../src/v2/hooks/use-global-hot-keys.ts"],"sourcesContent":["import type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { type MaybeRefOrGetter, onBeforeUnmount, onMounted, toValue } from 'vue'\n\nimport { handleHotkeys } from '@/v2/helpers/handle-hotkeys'\nimport type { ClientLayout } from '@/v2/types/layout'\n\n/**\n * Global hotkey handler for the app (web + desktop)\n *\n * @param eventBus - workspace event bus\n * @param layout - client layout\n * @param disableListeners - whether to disable the listeners\n */\nexport const useGlobalHotKeys = (\n eventBus: WorkspaceEventBus,\n layout: ClientLayout,\n disableListeners?: MaybeRefOrGetter<boolean>,\n): void => {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (toValue(disableListeners)) {\n return\n }\n\n handleHotkeys(ev, eventBus, layout)\n }\n\n // Enable the listeners\n onMounted(() => window.addEventListener('keydown', handleKeyDown))\n onBeforeUnmount(() => window.removeEventListener('keydown', handleKeyDown))\n}\n"],"mappings":";;;;;;;;;;AAaA,IAAa,oBACX,UACA,QACA,qBACS;CACT,MAAM,iBAAiB,OAAsB;
|
|
1
|
+
{"version":3,"file":"use-global-hot-keys.js","names":[],"sources":["../../../src/v2/hooks/use-global-hot-keys.ts"],"sourcesContent":["import type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { type MaybeRefOrGetter, onBeforeUnmount, onMounted, toValue } from 'vue'\n\nimport { handleHotkeys } from '@/v2/helpers/handle-hotkeys'\nimport type { ClientLayout } from '@/v2/types/layout'\n\n/**\n * Global hotkey handler for the app (web + desktop)\n *\n * @param eventBus - workspace event bus\n * @param layout - client layout\n * @param disableListeners - whether to disable the listeners\n */\nexport const useGlobalHotKeys = (\n eventBus: WorkspaceEventBus,\n layout: ClientLayout,\n disableListeners?: MaybeRefOrGetter<boolean>,\n): void => {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (toValue(disableListeners)) {\n return\n }\n\n handleHotkeys(ev, eventBus, layout)\n }\n\n // Enable the listeners\n onMounted(() => window.addEventListener('keydown', handleKeyDown))\n onBeforeUnmount(() => window.removeEventListener('keydown', handleKeyDown))\n}\n"],"mappings":";;;;;;;;;;AAaA,IAAa,oBACX,UACA,QACA,qBACS;CACT,MAAM,iBAAiB,OAAsB;EAC3C,IAAI,QAAQ,gBAAgB,GAC1B;EAGF,cAAc,IAAI,UAAU,MAAM;CACpC;CAGA,gBAAgB,OAAO,iBAAiB,WAAW,aAAa,CAAC;CACjE,sBAAsB,OAAO,oBAAoB,WAAW,aAAa,CAAC;AAC5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-lock.js","names":[],"sources":["../../../src/v2/hooks/use-scroll-lock.ts"],"sourcesContent":["import { type MaybeRefOrGetter, computed, onBeforeUnmount, ref, toValue } from 'vue'\n\n/**\n * useScrollLock - A Vue composition function to lock and unlock scrolling on a specific element.\n *\n * This hook provides a computed ref that allows you to enable or disable scrolling on a given HTMLElement.\n * Locking sets the element's `overflow` style to `'hidden'`.\n * Unlocking restores the original `overflow` value.\n *\n * The lock state will be automatically cleaned up (unlocked) when the component is unmounted.\n *\n * @param element - MaybeRefOrGetter for the HTMLElement to lock scrolling on. Can be a ref or a function.\n * @returns A computed ref: assign `true` to lock, `false` to unlock, read for current state.\n *\n * @example\n * ```ts\n * // In your setup():\n * const container = ref<HTMLElement | null>(null)\n * const scrollLock = useScrollLock(container)\n *\n * // To lock scrolling:\n * scrollLock.value = true\n *\n * // To unlock scrolling:\n * scrollLock.value = false\n * ```\n */\nexport const useScrollLock = (element: MaybeRefOrGetter<HTMLElement | null | undefined>) => {\n const initialValue = ref<string>('')\n const isLocked = ref(false)\n\n // Locks scrolling on the provided element and saves the initial overflow style\n const lock = () => {\n const el = toValue(element)\n\n if (!el) {\n return\n }\n\n // Save the initial overflow value\n initialValue.value = el.style.overflow\n el.style.overflow = 'hidden'\n }\n\n // Unlocks scrolling, restoring or removing the original overflow style\n const unlock = () => {\n const el = toValue(element)\n\n if (!el) {\n return\n }\n\n if (initialValue.value !== '') {\n el.style.overflow = initialValue.value\n } else {\n el.style.removeProperty('overflow')\n }\n }\n\n // Computed ref acting as a control interface for scroll lock\n const state = computed({\n get: () => isLocked.value,\n set: (value: boolean) => {\n isLocked.value = value\n value ? lock() : unlock()\n },\n })\n\n // Clean up when component is unmounted\n onBeforeUnmount(() => {\n if (isLocked.value) {\n unlock()\n }\n })\n\n return state\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAa,iBAAiB,YAA8D;CAC1F,MAAM,eAAe,IAAY,
|
|
1
|
+
{"version":3,"file":"use-scroll-lock.js","names":[],"sources":["../../../src/v2/hooks/use-scroll-lock.ts"],"sourcesContent":["import { type MaybeRefOrGetter, computed, onBeforeUnmount, ref, toValue } from 'vue'\n\n/**\n * useScrollLock - A Vue composition function to lock and unlock scrolling on a specific element.\n *\n * This hook provides a computed ref that allows you to enable or disable scrolling on a given HTMLElement.\n * Locking sets the element's `overflow` style to `'hidden'`.\n * Unlocking restores the original `overflow` value.\n *\n * The lock state will be automatically cleaned up (unlocked) when the component is unmounted.\n *\n * @param element - MaybeRefOrGetter for the HTMLElement to lock scrolling on. Can be a ref or a function.\n * @returns A computed ref: assign `true` to lock, `false` to unlock, read for current state.\n *\n * @example\n * ```ts\n * // In your setup():\n * const container = ref<HTMLElement | null>(null)\n * const scrollLock = useScrollLock(container)\n *\n * // To lock scrolling:\n * scrollLock.value = true\n *\n * // To unlock scrolling:\n * scrollLock.value = false\n * ```\n */\nexport const useScrollLock = (element: MaybeRefOrGetter<HTMLElement | null | undefined>) => {\n const initialValue = ref<string>('')\n const isLocked = ref(false)\n\n // Locks scrolling on the provided element and saves the initial overflow style\n const lock = () => {\n const el = toValue(element)\n\n if (!el) {\n return\n }\n\n // Save the initial overflow value\n initialValue.value = el.style.overflow\n el.style.overflow = 'hidden'\n }\n\n // Unlocks scrolling, restoring or removing the original overflow style\n const unlock = () => {\n const el = toValue(element)\n\n if (!el) {\n return\n }\n\n if (initialValue.value !== '') {\n el.style.overflow = initialValue.value\n } else {\n el.style.removeProperty('overflow')\n }\n }\n\n // Computed ref acting as a control interface for scroll lock\n const state = computed({\n get: () => isLocked.value,\n set: (value: boolean) => {\n isLocked.value = value\n value ? lock() : unlock()\n },\n })\n\n // Clean up when component is unmounted\n onBeforeUnmount(() => {\n if (isLocked.value) {\n unlock()\n }\n })\n\n return state\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAa,iBAAiB,YAA8D;CAC1F,MAAM,eAAe,IAAY,EAAE;CACnC,MAAM,WAAW,IAAI,KAAK;CAG1B,MAAM,aAAa;EACjB,MAAM,KAAK,QAAQ,OAAO;EAE1B,IAAI,CAAC,IACH;EAIF,aAAa,QAAQ,GAAG,MAAM;EAC9B,GAAG,MAAM,WAAW;CACtB;CAGA,MAAM,eAAe;EACnB,MAAM,KAAK,QAAQ,OAAO;EAE1B,IAAI,CAAC,IACH;EAGF,IAAI,aAAa,UAAU,IACzB,GAAG,MAAM,WAAW,aAAa;OAEjC,GAAG,MAAM,eAAe,UAAU;CAEtC;CAGA,MAAM,QAAQ,SAAS;EACrB,WAAW,SAAS;EACpB,MAAM,UAAmB;GACvB,SAAS,QAAQ;GACjB,QAAQ,KAAK,IAAI,OAAO;EAC1B;CACF,CAAC;CAGD,sBAAsB;EACpB,IAAI,SAAS,OACX,OAAO;CAEX,CAAC;CAED,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-events.js","names":[],"sources":["../../src/v2/workspace-events.ts"],"sourcesContent":["import type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { ApiReferenceEvents, CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport { type Ref, computed } from 'vue'\n\ntype Hook<T extends keyof ApiReferenceEvents> = Partial<{\n onBeforeExecute: (\n payload: ApiReferenceEvents[T],\n ) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>\n onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>\n}>\n\ntype Hooks = {\n [key in keyof ApiReferenceEvents]?: Hook<key>\n}\n\n/**\n * Wraps a given function with optional before/after execution hooks for a specific event.\n * - Calls onBeforeExecute hook before executing the main function.\n * - Calls onAfterExecute hook after executing the main function.\n *\n * @template T The event key from ApiReferenceEvents\n * @param event The event name\n * @param fn The main function to execute\n * @param hooks The hooks object containing before/after hooks for events\n * @returns An async function that runs hooks around the main function\n */\nconst withHook = <T extends keyof ApiReferenceEvents>(\n event: T,\n fn: (args: ApiReferenceEvents[T]) => unknown | Promise<unknown>,\n hooks: Hooks,\n) => {\n return async (args: ApiReferenceEvents[T]) => {\n // Call the before execution hook for this event, if any\n const result = (await hooks[event]?.onBeforeExecute?.(args)) ?? args\n // Execute the main function\n await fn(result)\n // Call the after execution hook for this event, if any\n await hooks[event]?.onAfterExecute?.(result)\n return result\n }\n}\n\n/**\n * Initializes all Workspace Event Handlers by subscribing eventBus listeners\n * to each relevant mutator operation. Hooks are used for before/after execution.\n *\n * @param eventBus The WorkspaceEventBus to subscribe to\n * @param store The WorkspaceStore instance\n * @param hooks Object containing optional before/after hooks for each event\n */\nexport function initializeWorkspaceEventHandlers({\n eventBus,\n store,\n hooks,\n}: {\n eventBus: WorkspaceEventBus\n store: Ref<WorkspaceStore | null>\n hooks: Hooks\n}) {\n // Generate all client mutators for the current workspace store\n const mutators = computed(() => generateClientMutators(store.value))\n\n /**\n * Returns the appropriate mutators depending on the collectionType.\n * If collectionType is 'document', gets the active document mutator,\n * otherwise, gets the workspace mutator.\n */\n const getMutators = ({ collectionType }: CollectionType) => {\n if (collectionType === 'document') {\n return mutators.value.active()\n }\n return mutators.value.workspace()\n }\n\n //------------------------------------------------------------------------------------\n // Workspace Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('workspace:update:active-proxy', (payload) =>\n withHook('workspace:update:active-proxy', mutators.value.workspace().workspace.updateActiveProxy, hooks)(payload),\n )\n eventBus.on('workspace:update:color-mode', (payload) =>\n withHook('workspace:update:color-mode', mutators.value.workspace().workspace.updateColorMode, hooks)(payload),\n )\n eventBus.on('workspace:update:theme', (payload) =>\n withHook('workspace:update:theme', mutators.value.workspace().workspace.updateTheme, hooks)(payload),\n )\n eventBus.on('workspace:update:selected-client', (payload) =>\n withHook(\n 'workspace:update:selected-client',\n mutators.value.workspace().workspace.updateSelectedClient,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:selected-example', (payload) =>\n withHook(\n 'workspace:update:selected-example',\n mutators.value.workspace().workspace.updateSelectedExample,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:active-environment', (payload) =>\n withHook(\n 'workspace:update:active-environment',\n mutators.value.workspace().workspace.updateActiveEnvironment,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Document Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('document:update:extension', (payload) =>\n withHook('document:update:extension', mutators.value.active().document.updateDocumentExtension, hooks)(payload),\n )\n eventBus.on('document:update:icon', (payload) =>\n withHook('document:update:icon', mutators.value.active().document.updateDocumentIcon, hooks)(payload),\n )\n eventBus.on('document:update:info', (payload) =>\n withHook('document:update:info', mutators.value.active().document.updateDocumentInfo, hooks)(payload),\n )\n eventBus.on('document:update:watch-mode', (payload) =>\n withHook('document:update:watch-mode', mutators.value.active().document.updateWatchMode, hooks)(payload),\n )\n eventBus.on('document:create:empty-document', (payload) =>\n withHook('document:create:empty-document', mutators.value.active().document.createEmptyDocument, hooks)(payload),\n )\n eventBus.on('document:delete:document', (payload) =>\n withHook('document:delete:document', mutators.value.active().document.deleteDocument, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Environment Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('environment:upsert:environment', (payload) =>\n withHook('environment:upsert:environment', getMutators(payload).environment.upsertEnvironment, hooks)(payload),\n )\n eventBus.on('environment:delete:environment', (payload) =>\n withHook('environment:delete:environment', getMutators(payload).environment.deleteEnvironment, hooks)(payload),\n )\n eventBus.on('environment:upsert:environment-variable', (payload) =>\n withHook(\n 'environment:upsert:environment-variable',\n getMutators(payload).environment.upsertEnvironmentVariable,\n hooks,\n )(payload),\n )\n eventBus.on('environment:delete:environment-variable', (payload) =>\n withHook(\n 'environment:delete:environment-variable',\n getMutators(payload).environment.deleteEnvironmentVariable,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Cookie Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('cookie:upsert:cookie', async (payload) => {\n await withHook('cookie:upsert:cookie', getMutators(payload).cookie.upsertCookie, hooks)(payload)\n })\n eventBus.on('cookie:delete:cookie', async (payload) => {\n await withHook('cookie:delete:cookie', getMutators(payload).cookie.deleteCookie, hooks)(payload)\n })\n\n //------------------------------------------------------------------------------------\n // Auth Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('auth:delete:security-scheme', (payload) =>\n withHook('auth:delete:security-scheme', mutators.value.active().auth.deleteSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:active-index', (payload) =>\n withHook('auth:update:active-index', mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload),\n )\n eventBus.on('auth:update:security-scheme', (payload) =>\n withHook('auth:update:security-scheme', mutators.value.active().auth.updateSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:selected-scopes', (payload) =>\n withHook('auth:update:selected-scopes', mutators.value.active().auth.updateSelectedScopes, hooks)(payload),\n )\n eventBus.on('auth:upsert:scopes', (payload) =>\n withHook('auth:upsert:scopes', mutators.value.active().auth.upsertScope, hooks)(payload),\n )\n eventBus.on('auth:delete:scopes', (payload) =>\n withHook('auth:delete:scopes', mutators.value.active().auth.deleteScope, hooks)(payload),\n )\n eventBus.on('auth:update:selected-security-schemes', (payload) =>\n withHook(\n 'auth:update:selected-security-schemes',\n mutators.value.active().auth.updateSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:selected-security-schemes', (payload) =>\n withHook(\n 'auth:clear:selected-security-schemes',\n mutators.value.active().auth.clearSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:update:security-scheme-secrets',\n mutators.value.active().auth.updateSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:clear:security-scheme-secrets',\n mutators.value.active().auth.clearSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Server Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('server:initialize:servers', (payload) =>\n withHook('server:initialize:servers', mutators.value.active().server.initializeServers, hooks)(payload),\n )\n eventBus.on('server:add:server', (payload) =>\n withHook('server:add:server', mutators.value.active().server.addServer, hooks)(payload),\n )\n eventBus.on('server:update:server', (payload) =>\n withHook('server:update:server', mutators.value.active().server.updateServer, hooks)(payload),\n )\n eventBus.on('server:delete:server', (payload) =>\n withHook('server:delete:server', mutators.value.active().server.deleteServer, hooks)(payload),\n )\n eventBus.on('server:clear:servers', (payload) =>\n withHook('server:clear:servers', mutators.value.active().server.clearServers, hooks)(payload),\n )\n eventBus.on('server:update:variables', (payload) =>\n withHook('server:update:variables', mutators.value.active().server.updateServerVariables, hooks)(payload),\n )\n eventBus.on('server:update:selected', (payload) =>\n withHook('server:update:selected', mutators.value.active().server.updateSelectedServer, hooks)(payload),\n )\n eventBus.on('asyncapi-server:update:selected', (payload) =>\n withHook(\n 'asyncapi-server:update:selected',\n mutators.value.active().server.updateSelectedAsyncApiServer,\n hooks,\n )(payload),\n )\n eventBus.on('asyncapi-server:update:variables', (payload) =>\n withHook(\n 'asyncapi-server:update:variables',\n mutators.value.active().server.updateAsyncApiServerVariables,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:create:operation', (payload) =>\n withHook('operation:create:operation', mutators.value.active().operation.createOperation, hooks)(payload),\n )\n eventBus.on('operation:update:pathMethod', (payload) =>\n withHook(\n 'operation:update:pathMethod',\n mutators.value.active().operation.updateOperationPathMethod,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:meta', (payload) =>\n withHook('operation:update:meta', mutators.value.active().operation.updateOperationMeta, hooks)(payload),\n )\n eventBus.on('operation:delete:operation', (payload) =>\n withHook('operation:delete:operation', mutators.value.active().operation.deleteOperation, hooks)(payload),\n )\n eventBus.on('operation:create:draft-example', (payload) =>\n withHook(\n 'operation:create:draft-example',\n mutators.value.active().operation.createOperationDraftExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:example', (payload) =>\n withHook('operation:delete:example', mutators.value.active().operation.deleteOperationExample, hooks)(payload),\n )\n eventBus.on('operation:rename:example', (payload) =>\n withHook('operation:rename:example', mutators.value.active().operation.renameOperationExample, hooks)(payload),\n )\n eventBus.on('operation:upsert:parameter', (payload) =>\n withHook('operation:upsert:parameter', mutators.value.active().operation.upsertOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:update:extra-parameters', (payload) =>\n withHook(\n 'operation:update:extra-parameters',\n mutators.value.active().operation.updateOperationExtraParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:parameter', (payload) =>\n withHook('operation:delete:parameter', mutators.value.active().operation.deleteOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:delete-all:parameters', (payload) =>\n withHook(\n 'operation:delete-all:parameters',\n mutators.value.active().operation.deleteAllOperationParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:extension', (payload) =>\n withHook('operation:update:extension', mutators.value.active().operation.updateOperationExtension, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:update:requestBody:contentType', (payload) =>\n withHook(\n 'operation:update:requestBody:contentType',\n mutators.value.active().operation.updateOperationRequestBodyContentType,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:value', (payload) =>\n withHook(\n 'operation:update:requestBody:value',\n mutators.value.active().operation.updateOperationRequestBodyExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:formValue', (payload) =>\n withHook(\n 'operation:update:requestBody:formValue',\n mutators.value.active().operation.updateOperationRequestBodyFormValue,\n hooks,\n )(payload),\n )\n eventBus.on('operation:reload:history', (payload) =>\n withHook('operation:reload:history', mutators.value.active().operation.reloadOperationHistory, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tag Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tag:create:tag', (payload) =>\n withHook('tag:create:tag', mutators.value.active().tag.createTag, hooks)(payload),\n )\n eventBus.on('tag:edit:tag', (payload) =>\n withHook('tag:edit:tag', mutators.value.active().tag.editTag, hooks)(payload),\n )\n eventBus.on('tag:delete:tag', (payload) =>\n withHook('tag:delete:tag', mutators.value.active().tag.deleteTag, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:add:tab', (payload) =>\n withHook('tabs:add:tab', mutators.value.workspace().tabs.addTab, hooks)(payload),\n )\n eventBus.on('tabs:close:tab', (payload) =>\n withHook('tabs:close:tab', mutators.value.workspace().tabs.closeTab, hooks)(payload),\n )\n eventBus.on('tabs:close:other-tabs', (payload) =>\n withHook('tabs:close:other-tabs', mutators.value.workspace().tabs.closeOtherTabs, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab', (payload) =>\n withHook('tabs:focus:tab', mutators.value.workspace().tabs.focusTab, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab-last', (payload) =>\n withHook('tabs:focus:tab-last', mutators.value.workspace().tabs.focusLastTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:previous', (payload) =>\n withHook('tabs:navigate:previous', mutators.value.workspace().tabs.navigatePreviousTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:next', (payload) =>\n withHook('tabs:navigate:next', mutators.value.workspace().tabs.navigateNextTab, hooks)(payload),\n )\n eventBus.on('tabs:update:tabs', (payload) =>\n withHook('tabs:update:tabs', mutators.value.workspace().tabs.updateTabs, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Hooks Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('hooks:on:request:complete', (payload) =>\n withHook('hooks:on:request:complete', mutators.value.active().operation.addResponseToHistory, hooks)(payload),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAM,YACJ,OACA,IACA,UACG;AACH,QAAO,OAAO,SAAgC;EAE5C,MAAM,SAAU,MAAM,MAAM,QAAQ,kBAAkB,KAAK,IAAK;AAEhE,QAAM,GAAG,OAAO;AAEhB,QAAM,MAAM,QAAQ,iBAAiB,OAAO;AAC5C,SAAO;;;;;;;;;;;AAYX,SAAgB,iCAAiC,EAC/C,UACA,OACA,SAKC;CAED,MAAM,WAAW,eAAe,uBAAuB,MAAM,MAAM,CAAC;;;;;;CAOpE,MAAM,eAAe,EAAE,qBAAqC;AAC1D,MAAI,mBAAmB,WACrB,QAAO,SAAS,MAAM,QAAQ;AAEhC,SAAO,SAAS,MAAM,WAAW;;AAMnC,UAAS,GAAG,kCAAkC,YAC5C,SAAS,iCAAiC,SAAS,MAAM,WAAW,CAAC,UA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AAS,kBAAkB,SAAS,MAAM,WAAW,CAAC,KAAK,UAAU,MAAM,CAAC,QAAQ,CACrF;AACD,UAAS,GAAG,0BAA0B,YACpC,SAAS,yBAAyB,SAAS,MAAM,WAAW,CAAC,KAAK,gBAAgB,MAAM,CAAC,QAAQ,CAClG;AACD,UAAS,GAAG,mBAAmB,YAC7B,SAAS,kBAAkB,SAAS,MAAM,WAAW,CAAC,KAAK,UAAU,MAAM,CAAC,QAAQ,CACrF;AACD,UAAS,GAAG,wBAAwB,YAClC,SAAS,uBAAuB,SAAS,MAAM,WAAW,CAAC,KAAK,cAAc,MAAM,CAAC,QAAQ,CAC9F;AACD,UAAS,GAAG,2BAA2B,YACrC,SAAS,0BAA0B,SAAS,MAAM,WAAW,CAAC,KAAK,qBAAqB,MAAM,CAAC,QAAQ,CACxG;AACD,UAAS,GAAG,uBAAuB,YACjC,SAAS,sBAAsB,SAAS,MAAM,WAAW,CAAC,KAAK,iBAAiB,MAAM,CAAC,QAAQ,CAChG;AACD,UAAS,GAAG,qBAAqB,YAC/B,SAAS,oBAAoB,SAAS,MAAM,WAAW,CAAC,KAAK,YAAY,MAAM,CAAC,QAAQ,CACzF;AAKD,UAAS,GAAG,8BAA8B,YACxC,SAAS,6BAA6B,SAAS,MAAM,QAAQ,CAAC,UAAU,sBAAsB,MAAM,CAAC,QAAQ,CAC9G"}
|
|
1
|
+
{"version":3,"file":"workspace-events.js","names":[],"sources":["../../src/v2/workspace-events.ts"],"sourcesContent":["import type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { ApiReferenceEvents, CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport { type Ref, computed } from 'vue'\n\ntype Hook<T extends keyof ApiReferenceEvents> = Partial<{\n onBeforeExecute: (\n payload: ApiReferenceEvents[T],\n ) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>\n onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>\n}>\n\ntype Hooks = {\n [key in keyof ApiReferenceEvents]?: Hook<key>\n}\n\n/**\n * Wraps a given function with optional before/after execution hooks for a specific event.\n * - Calls onBeforeExecute hook before executing the main function.\n * - Calls onAfterExecute hook after executing the main function.\n *\n * @template T The event key from ApiReferenceEvents\n * @param event The event name\n * @param fn The main function to execute\n * @param hooks The hooks object containing before/after hooks for events\n * @returns An async function that runs hooks around the main function\n */\nconst withHook = <T extends keyof ApiReferenceEvents>(\n event: T,\n fn: (args: ApiReferenceEvents[T]) => unknown | Promise<unknown>,\n hooks: Hooks,\n) => {\n return async (args: ApiReferenceEvents[T]) => {\n // Call the before execution hook for this event, if any\n const result = (await hooks[event]?.onBeforeExecute?.(args)) ?? args\n // Execute the main function\n await fn(result)\n // Call the after execution hook for this event, if any\n await hooks[event]?.onAfterExecute?.(result)\n return result\n }\n}\n\n/**\n * Initializes all Workspace Event Handlers by subscribing eventBus listeners\n * to each relevant mutator operation. Hooks are used for before/after execution.\n *\n * @param eventBus The WorkspaceEventBus to subscribe to\n * @param store The WorkspaceStore instance\n * @param hooks Object containing optional before/after hooks for each event\n */\nexport function initializeWorkspaceEventHandlers({\n eventBus,\n store,\n hooks,\n}: {\n eventBus: WorkspaceEventBus\n store: Ref<WorkspaceStore | null>\n hooks: Hooks\n}) {\n // Generate all client mutators for the current workspace store\n const mutators = computed(() => generateClientMutators(store.value))\n\n /**\n * Returns the appropriate mutators depending on the collectionType.\n * If collectionType is 'document', gets the active document mutator,\n * otherwise, gets the workspace mutator.\n */\n const getMutators = ({ collectionType }: CollectionType) => {\n if (collectionType === 'document') {\n return mutators.value.active()\n }\n return mutators.value.workspace()\n }\n\n //------------------------------------------------------------------------------------\n // Workspace Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('workspace:update:active-proxy', (payload) =>\n withHook('workspace:update:active-proxy', mutators.value.workspace().workspace.updateActiveProxy, hooks)(payload),\n )\n eventBus.on('workspace:update:color-mode', (payload) =>\n withHook('workspace:update:color-mode', mutators.value.workspace().workspace.updateColorMode, hooks)(payload),\n )\n eventBus.on('workspace:update:theme', (payload) =>\n withHook('workspace:update:theme', mutators.value.workspace().workspace.updateTheme, hooks)(payload),\n )\n eventBus.on('workspace:update:selected-client', (payload) =>\n withHook(\n 'workspace:update:selected-client',\n mutators.value.workspace().workspace.updateSelectedClient,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:selected-example', (payload) =>\n withHook(\n 'workspace:update:selected-example',\n mutators.value.workspace().workspace.updateSelectedExample,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:active-environment', (payload) =>\n withHook(\n 'workspace:update:active-environment',\n mutators.value.workspace().workspace.updateActiveEnvironment,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Document Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('document:update:extension', (payload) =>\n withHook('document:update:extension', mutators.value.active().document.updateDocumentExtension, hooks)(payload),\n )\n eventBus.on('document:update:icon', (payload) =>\n withHook('document:update:icon', mutators.value.active().document.updateDocumentIcon, hooks)(payload),\n )\n eventBus.on('document:update:info', (payload) =>\n withHook('document:update:info', mutators.value.active().document.updateDocumentInfo, hooks)(payload),\n )\n eventBus.on('document:update:watch-mode', (payload) =>\n withHook('document:update:watch-mode', mutators.value.active().document.updateWatchMode, hooks)(payload),\n )\n eventBus.on('document:create:empty-document', (payload) =>\n withHook('document:create:empty-document', mutators.value.active().document.createEmptyDocument, hooks)(payload),\n )\n eventBus.on('document:delete:document', (payload) =>\n withHook('document:delete:document', mutators.value.active().document.deleteDocument, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Environment Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('environment:upsert:environment', (payload) =>\n withHook('environment:upsert:environment', getMutators(payload).environment.upsertEnvironment, hooks)(payload),\n )\n eventBus.on('environment:delete:environment', (payload) =>\n withHook('environment:delete:environment', getMutators(payload).environment.deleteEnvironment, hooks)(payload),\n )\n eventBus.on('environment:upsert:environment-variable', (payload) =>\n withHook(\n 'environment:upsert:environment-variable',\n getMutators(payload).environment.upsertEnvironmentVariable,\n hooks,\n )(payload),\n )\n eventBus.on('environment:delete:environment-variable', (payload) =>\n withHook(\n 'environment:delete:environment-variable',\n getMutators(payload).environment.deleteEnvironmentVariable,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Cookie Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('cookie:upsert:cookie', async (payload) => {\n await withHook('cookie:upsert:cookie', getMutators(payload).cookie.upsertCookie, hooks)(payload)\n })\n eventBus.on('cookie:delete:cookie', async (payload) => {\n await withHook('cookie:delete:cookie', getMutators(payload).cookie.deleteCookie, hooks)(payload)\n })\n\n //------------------------------------------------------------------------------------\n // Auth Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('auth:delete:security-scheme', (payload) =>\n withHook('auth:delete:security-scheme', mutators.value.active().auth.deleteSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:active-index', (payload) =>\n withHook('auth:update:active-index', mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload),\n )\n eventBus.on('auth:update:security-scheme', (payload) =>\n withHook('auth:update:security-scheme', mutators.value.active().auth.updateSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:selected-scopes', (payload) =>\n withHook('auth:update:selected-scopes', mutators.value.active().auth.updateSelectedScopes, hooks)(payload),\n )\n eventBus.on('auth:upsert:scopes', (payload) =>\n withHook('auth:upsert:scopes', mutators.value.active().auth.upsertScope, hooks)(payload),\n )\n eventBus.on('auth:delete:scopes', (payload) =>\n withHook('auth:delete:scopes', mutators.value.active().auth.deleteScope, hooks)(payload),\n )\n eventBus.on('auth:update:selected-security-schemes', (payload) =>\n withHook(\n 'auth:update:selected-security-schemes',\n mutators.value.active().auth.updateSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:selected-security-schemes', (payload) =>\n withHook(\n 'auth:clear:selected-security-schemes',\n mutators.value.active().auth.clearSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:update:security-scheme-secrets',\n mutators.value.active().auth.updateSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:clear:security-scheme-secrets',\n mutators.value.active().auth.clearSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Server Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('server:initialize:servers', (payload) =>\n withHook('server:initialize:servers', mutators.value.active().server.initializeServers, hooks)(payload),\n )\n eventBus.on('server:add:server', (payload) =>\n withHook('server:add:server', mutators.value.active().server.addServer, hooks)(payload),\n )\n eventBus.on('server:update:server', (payload) =>\n withHook('server:update:server', mutators.value.active().server.updateServer, hooks)(payload),\n )\n eventBus.on('server:delete:server', (payload) =>\n withHook('server:delete:server', mutators.value.active().server.deleteServer, hooks)(payload),\n )\n eventBus.on('server:clear:servers', (payload) =>\n withHook('server:clear:servers', mutators.value.active().server.clearServers, hooks)(payload),\n )\n eventBus.on('server:update:variables', (payload) =>\n withHook('server:update:variables', mutators.value.active().server.updateServerVariables, hooks)(payload),\n )\n eventBus.on('server:update:selected', (payload) =>\n withHook('server:update:selected', mutators.value.active().server.updateSelectedServer, hooks)(payload),\n )\n eventBus.on('asyncapi-server:update:selected', (payload) =>\n withHook(\n 'asyncapi-server:update:selected',\n mutators.value.active().server.updateSelectedAsyncApiServer,\n hooks,\n )(payload),\n )\n eventBus.on('asyncapi-server:update:variables', (payload) =>\n withHook(\n 'asyncapi-server:update:variables',\n mutators.value.active().server.updateAsyncApiServerVariables,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:create:operation', (payload) =>\n withHook('operation:create:operation', mutators.value.active().operation.createOperation, hooks)(payload),\n )\n eventBus.on('operation:update:pathMethod', (payload) =>\n withHook(\n 'operation:update:pathMethod',\n mutators.value.active().operation.updateOperationPathMethod,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:meta', (payload) =>\n withHook('operation:update:meta', mutators.value.active().operation.updateOperationMeta, hooks)(payload),\n )\n eventBus.on('operation:delete:operation', (payload) =>\n withHook('operation:delete:operation', mutators.value.active().operation.deleteOperation, hooks)(payload),\n )\n eventBus.on('operation:create:draft-example', (payload) =>\n withHook(\n 'operation:create:draft-example',\n mutators.value.active().operation.createOperationDraftExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:example', (payload) =>\n withHook('operation:delete:example', mutators.value.active().operation.deleteOperationExample, hooks)(payload),\n )\n eventBus.on('operation:rename:example', (payload) =>\n withHook('operation:rename:example', mutators.value.active().operation.renameOperationExample, hooks)(payload),\n )\n eventBus.on('operation:upsert:parameter', (payload) =>\n withHook('operation:upsert:parameter', mutators.value.active().operation.upsertOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:update:extra-parameters', (payload) =>\n withHook(\n 'operation:update:extra-parameters',\n mutators.value.active().operation.updateOperationExtraParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:parameter', (payload) =>\n withHook('operation:delete:parameter', mutators.value.active().operation.deleteOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:delete-all:parameters', (payload) =>\n withHook(\n 'operation:delete-all:parameters',\n mutators.value.active().operation.deleteAllOperationParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:extension', (payload) =>\n withHook('operation:update:extension', mutators.value.active().operation.updateOperationExtension, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:update:requestBody:contentType', (payload) =>\n withHook(\n 'operation:update:requestBody:contentType',\n mutators.value.active().operation.updateOperationRequestBodyContentType,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:value', (payload) =>\n withHook(\n 'operation:update:requestBody:value',\n mutators.value.active().operation.updateOperationRequestBodyExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:formValue', (payload) =>\n withHook(\n 'operation:update:requestBody:formValue',\n mutators.value.active().operation.updateOperationRequestBodyFormValue,\n hooks,\n )(payload),\n )\n eventBus.on('operation:reload:history', (payload) =>\n withHook('operation:reload:history', mutators.value.active().operation.reloadOperationHistory, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tag Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tag:create:tag', (payload) =>\n withHook('tag:create:tag', mutators.value.active().tag.createTag, hooks)(payload),\n )\n eventBus.on('tag:edit:tag', (payload) =>\n withHook('tag:edit:tag', mutators.value.active().tag.editTag, hooks)(payload),\n )\n eventBus.on('tag:delete:tag', (payload) =>\n withHook('tag:delete:tag', mutators.value.active().tag.deleteTag, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:add:tab', (payload) =>\n withHook('tabs:add:tab', mutators.value.workspace().tabs.addTab, hooks)(payload),\n )\n eventBus.on('tabs:close:tab', (payload) =>\n withHook('tabs:close:tab', mutators.value.workspace().tabs.closeTab, hooks)(payload),\n )\n eventBus.on('tabs:close:other-tabs', (payload) =>\n withHook('tabs:close:other-tabs', mutators.value.workspace().tabs.closeOtherTabs, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab', (payload) =>\n withHook('tabs:focus:tab', mutators.value.workspace().tabs.focusTab, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab-last', (payload) =>\n withHook('tabs:focus:tab-last', mutators.value.workspace().tabs.focusLastTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:previous', (payload) =>\n withHook('tabs:navigate:previous', mutators.value.workspace().tabs.navigatePreviousTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:next', (payload) =>\n withHook('tabs:navigate:next', mutators.value.workspace().tabs.navigateNextTab, hooks)(payload),\n )\n eventBus.on('tabs:update:tabs', (payload) =>\n withHook('tabs:update:tabs', mutators.value.workspace().tabs.updateTabs, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Hooks Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('hooks:on:request:complete', (payload) =>\n withHook('hooks:on:request:complete', mutators.value.active().operation.addResponseToHistory, hooks)(payload),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAM,YACJ,OACA,IACA,UACG;CACH,OAAO,OAAO,SAAgC;EAE5C,MAAM,SAAU,MAAM,MAAM,MAAM,EAAE,kBAAkB,IAAI,KAAM;EAEhE,MAAM,GAAG,MAAM;EAEf,MAAM,MAAM,MAAM,EAAE,iBAAiB,MAAM;EAC3C,OAAO;CACT;AACF;;;;;;;;;AAUA,SAAgB,iCAAiC,EAC/C,UACA,OACA,SAKC;CAED,MAAM,WAAW,eAAe,uBAAuB,MAAM,KAAK,CAAC;;;;;;CAOnE,MAAM,eAAe,EAAE,qBAAqC;EAC1D,IAAI,mBAAmB,YACrB,OAAO,SAAS,MAAM,OAAO;EAE/B,OAAO,SAAS,MAAM,UAAU;CAClC;CAKA,SAAS,GAAG,kCAAkC,YAC5C,SAAS,iCAAiC,SAAS,MAAM,UAAU,CAAC,CAAC,UAAU,mBAAmB,KAAK,CAAC,CAAC,OAAO,CAClH;CACA,SAAS,GAAG,gCAAgC,YAC1C,SAAS,+BAA+B,SAAS,MAAM,UAAU,CAAC,CAAC,UAAU,iBAAiB,KAAK,CAAC,CAAC,OAAO,CAC9G;CACA,SAAS,GAAG,2BAA2B,YACrC,SAAS,0BAA0B,SAAS,MAAM,UAAU,CAAC,CAAC,UAAU,aAAa,KAAK,CAAC,CAAC,OAAO,CACrG;CACA,SAAS,GAAG,qCAAqC,YAC/C,SACE,oCACA,SAAS,MAAM,UAAU,CAAC,CAAC,UAAU,sBACrC,KACF,CAAC,CAAC,OAAO,CACX;CACA,SAAS,GAAG,sC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