@scalar/api-client 3.17.0 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  3. package/dist/components/SectionFilter.vue.d.ts +2 -1
  4. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  5. package/dist/components/SectionFilter.vue.js +1 -1
  6. package/dist/components/SectionFilter.vue.js.map +1 -1
  7. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  8. package/dist/hooks/use-file-dialog.d.ts.map +1 -1
  9. package/dist/hooks/use-file-dialog.js +1 -0
  10. package/dist/hooks/use-file-dialog.js.map +1 -1
  11. package/dist/style.css +101 -85
  12. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -2
  13. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +17 -10
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  17. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -1
  18. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  19. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  20. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  21. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +3 -1
  22. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-block/helpers/send-request.js +9 -5
  24. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +1 -1
  26. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  28. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +5 -1
  29. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  31. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  32. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +61 -3
  33. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  34. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +17 -3
  35. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  37. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  38. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +42 -21
  39. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  40. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts +5 -3
  41. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
  43. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +6 -3
  44. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
  45. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts +1 -1
  46. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  48. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +1 -0
  49. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  50. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  51. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  52. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +4 -3
  53. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  54. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
  55. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  56. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  57. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  58. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +7 -3
  59. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  60. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +7 -1
  61. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  62. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  63. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +17 -5
  64. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  65. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -1
  66. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  68. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts +1 -1
  69. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
  70. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +17 -8
  71. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  72. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.d.ts +1 -1
  73. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -1
  74. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +3 -1
  75. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +36 -18
  77. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  78. package/dist/v2/blocks/request-block/helpers/get-parameter-content.d.ts +1 -1
  79. package/dist/v2/blocks/request-block/helpers/get-parameter-content.js.map +1 -1
  80. package/dist/v2/blocks/request-block/helpers/get-parameter-schema.d.ts +1 -1
  81. package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js.map +1 -1
  82. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.d.ts +1 -1
  83. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js +1 -1
  84. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -1
  85. package/dist/v2/blocks/request-block/helpers/group-by.d.ts +3 -4
  86. package/dist/v2/blocks/request-block/helpers/group-by.d.ts.map +1 -1
  87. package/dist/v2/blocks/request-block/helpers/group-by.js +12 -10
  88. package/dist/v2/blocks/request-block/helpers/group-by.js.map +1 -1
  89. package/dist/v2/blocks/request-block/helpers/validate-parameter.d.ts +1 -1
  90. package/dist/v2/blocks/request-block/helpers/validate-parameter.js.map +1 -1
  91. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  92. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  93. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +6 -1
  94. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  95. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -2
  96. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  97. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  98. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  99. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +2 -2
  100. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  101. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -1
  102. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -1
  103. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  104. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  105. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +5 -5
  106. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  107. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  108. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +10 -7
  109. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  110. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +1 -1
  111. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  112. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  113. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +1 -1
  114. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +5 -5
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +20 -154
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  124. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  126. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +1 -1
  127. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  128. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  129. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  130. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.d.ts +1 -1
  132. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -1
  133. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -1
  134. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  135. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  136. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  137. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  138. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  139. package/dist/v2/components/code-input/CodeInput.vue.script.js +1 -1
  140. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  141. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  142. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  143. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  144. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +7 -6
  145. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  146. package/dist/v2/components/code-input/helpers/build-pill-context.d.ts.map +1 -1
  147. package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -1
  148. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +1 -1
  149. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  150. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  151. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  152. package/dist/v2/components/server/ServerDropdown.vue.d.ts +1 -1
  153. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  154. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  155. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +1 -1
  156. package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
  157. package/dist/v2/components/server/ServerDropdownItem.vue.js.map +1 -1
  158. package/dist/v2/components/server/ServerDropdownItem.vue.script.js.map +1 -1
  159. package/dist/v2/constants.js +1 -1
  160. package/dist/v2/features/command-palette/components/CommandActionInput.vue.js.map +1 -1
  161. package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js +1 -1
  162. package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js.map +1 -1
  163. package/dist/v2/features/environments/components/EnvironmentColors.vue.js.map +1 -1
  164. package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js +1 -1
  165. package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js.map +1 -1
  166. package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
  167. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  168. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  169. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  170. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -1
  171. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +1 -1
  172. package/dist/v2/features/modal/modal-events.d.ts.map +1 -1
  173. package/dist/v2/features/modal/modal-events.js +10 -1
  174. package/dist/v2/features/modal/modal-events.js.map +1 -1
  175. package/dist/v2/features/operation/Operation.vue.d.ts +1 -1
  176. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  177. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  178. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts +1 -1
  179. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  180. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  181. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  182. package/dist/v2/features/search/helpers/create-search-index.d.ts +1 -1
  183. package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
  184. package/dist/v2/features/search/hooks/use-document-search.d.ts +1 -1
  185. package/dist/v2/features/search/hooks/use-document-search.js.map +1 -1
  186. package/dist/v2/features/search/hooks/use-search-index.d.ts +1 -1
  187. package/dist/v2/features/search/hooks/use-search-index.js.map +1 -1
  188. package/dist/vue-styles.css +84 -84
  189. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.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 /** Resolve the selected entry from the OpenAPI webhooks map. */\n isWebhook?: boolean\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 isWebhook = false,\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, isWebhook },\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 :isWebhook\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":""}
1
+ {"version":3,"file":"Operation.vue.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 /** Resolve the selected entry from the OpenAPI webhooks map. */\n isWebhook?: boolean\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.2/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 isWebhook = false,\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, isWebhook },\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 :isWebhook\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":""}
@@ -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 /** Resolve the selected entry from the OpenAPI webhooks map. */\n isWebhook?: boolean\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 isWebhook = false,\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, isWebhook },\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 :isWebhook\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":"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"}
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 /** Resolve the selected entry from the OpenAPI webhooks map. */\n isWebhook?: boolean\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.2/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 isWebhook = false,\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, isWebhook },\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 :isWebhook\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":"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"}
@@ -1,5 +1,5 @@
1
1
  import { type ModalState } from '@scalar/components/modal';
2
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
3
3
  type __VLS_Props = {
4
4
  /** Controls the visibility of the search modal. */
5
5
  modalState: ModalState;
@@ -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 = /*#__PURE__*/ _plugin_vue_export_helper_default(DocumentSearchModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d1af4404"]]);
5
+ var DocumentSearchModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DocumentSearchModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-89ab8a2d"]]);
6
6
  //#endregion
7
7
  export { DocumentSearchModal_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSearchModal.vue.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":""}
1
+ {"version":3,"file":"DocumentSearchModal.vue.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.2/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":""}
@@ -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,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,CAAC,QAAQ,MAAM,MAC5C;GAGF,MAAM,SAAS,QAAQ,MAAM;GAC7B,MAAM,WAAW,KAAK;GACtB,KAAK,UAAU,OAAO,KAAK,EAAE;EAC/B;;;;;EAMA,MAAM,qBAAqB,eAAe;GACxC,MAAM,iBAAiB,QAAQ,MAAM,cAAc,SAAS;GAC5D,OAAO,iBAAiB,iBAAiB,eAAe,KAAK,OAAO,KAAA;EACtE,CAAC;;uBAIC,YAiDc,MAAA,WAAA,GAAA;IAhDZ,cAAW;IACV,OAAO,QAAA;IACR,SAAQ;;2BAeF;KAdN,mBAcM,OAdN,YAcM,CAXJ,YAU2D,MAAA,iBAAA,GAAA;kBAThD,MAAA,KAAA;wFAAK,QAAA,SAAA;MACb,yBAAuB,mBAAA;MACxB,qBAAkB;MACjB,iBAAe;MACf,oBAAkB;MACnB,MAAK;MACJ,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,cAAA,QAAgB,KAAA;MACtB,WAAO;oEAAoB,sBAAqB,MAAA,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,MAAA,CAAA;8DACd,aAAa,cAAA,KAAa,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;oEACnC,sBAAqB,IAAA,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,IAAA,CAAA;;;KAEnD,YAeyB,MAAA,sBAAA,GAAA;MAdtB,IAAI;MACL,cAAW;MACX,OAAM;MACL,WAAS,CAAG,MAAA,OAAA,CAAO,CAAC;;MACV,OAAK,cACH,CAAA,gBAAA,gBAAR,MAAA,KAAA,CAAK,GAAA,CAAA,CAAA,CAAA;6BAGwB,EAAA,UAAA,IAAA,GADlC,mBAM6C,UAAA,MAAA,WALnB,MAAA,OAAA,IAAhB,QAAQ,QAAG;2BADrB,YAM6C,sBAAA;QAJ1C,IAAE,iBAAmB,OAAO,KAAK;QACjC,KAAK,OAAO;QACZ,YAAY,cAAA,UAAkB;QACtB;QACR,SAAK,oBAAgB,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
+ {"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.2/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,CAAC,QAAQ,MAAM,MAC5C;GAGF,MAAM,SAAS,QAAQ,MAAM;GAC7B,MAAM,WAAW,KAAK;GACtB,KAAK,UAAU,OAAO,KAAK,EAAE;EAC/B;;;;;EAMA,MAAM,qBAAqB,eAAe;GACxC,MAAM,iBAAiB,QAAQ,MAAM,cAAc,SAAS;GAC5D,OAAO,iBAAiB,iBAAiB,eAAe,KAAK,OAAO,KAAA;EACtE,CAAC;;uBAIC,YAiDc,MAAA,WAAA,GAAA;IAhDZ,cAAW;IACV,OAAO,QAAA;IACR,SAAQ;;2BAeF;KAdN,mBAcM,OAdN,YAcM,CAXJ,YAU2D,MAAA,iBAAA,GAAA;kBAThD,MAAA,KAAA;wFAAK,QAAA,SAAA;MACb,yBAAuB,mBAAA;MACxB,qBAAkB;MACjB,iBAAe;MACf,oBAAkB;MACnB,MAAK;MACJ,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,cAAA,QAAgB,KAAA;MACtB,WAAO;oEAAoB,sBAAqB,MAAA,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,MAAA,CAAA;8DACd,aAAa,cAAA,KAAa,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;oEACnC,sBAAqB,IAAA,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,IAAA,CAAA;;;KAEnD,YAeyB,MAAA,sBAAA,GAAA;MAdtB,IAAI;MACL,cAAW;MACX,OAAM;MACL,WAAS,CAAG,MAAA,OAAA,CAAO,CAAC;;MACV,OAAK,cACH,CAAA,gBAAA,gBAAR,MAAA,KAAA,CAAK,GAAA,CAAA,CAAA,CAAA;6BAGwB,EAAA,UAAA,IAAA,GADlC,mBAM6C,UAAA,MAAA,WALnB,MAAA,OAAA,IAAhB,QAAQ,QAAG;2BADrB,YAM6C,sBAAA;QAJ1C,IAAE,iBAAmB,OAAO,KAAK;QACjC,KAAK,OAAO;QACZ,YAAY,cAAA,UAAkB;QACtB;QACR,SAAK,oBAAgB,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,4 +1,4 @@
1
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
2
  import type { FuseData } from '../../../../v2/features/search/types';
3
3
  /**
4
4
  * Create a search index from a list of entries.
@@ -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 // Regular tags, including OpenAPI 3.2 operation-less parent sections (which are `isGroup: true`\n // but real tags), keep their own description.\n if (entry.type === 'tag' && entry.isTagGroup !== true) {\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 // Legacy `x-tagGroups` wrappers are not real tags, so they carry the generic group label.\n if (entry.type === 'tag' && entry.isTagGroup === 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;CAIA,IAAI,MAAM,SAAS,SAAS,MAAM,eAAe,MAAM;EACrD,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,eAAe,MAAM;EACrD,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
+ {"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.2/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 // Regular tags, including OpenAPI 3.2 operation-less parent sections (which are `isGroup: true`\n // but real tags), keep their own description.\n if (entry.type === 'tag' && entry.isTagGroup !== true) {\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 // Legacy `x-tagGroups` wrappers are not real tags, so they carry the generic group label.\n if (entry.type === 'tag' && entry.isTagGroup === 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;CAIA,IAAI,MAAM,SAAS,SAAS,MAAM,eAAe,MAAM;EACrD,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,eAAe,MAAM;EACrD,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,4 +1,4 @@
1
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
2
  import type { FuseResult } from 'fuse.js';
3
3
  import { type MaybeRefOrGetter } from 'vue';
4
4
  import type { FuseData } from '../types';
@@ -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,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
+ {"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.2/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,4 +1,4 @@
1
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
2
  import { type MaybeRefOrGetter } from 'vue';
3
3
  /**
4
4
  * Creates the search index from multiple OpenAPI documents
@@ -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,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
+ {"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.2/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"}