@scalar/api-client 3.2.2 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/style.css +122 -146
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +9 -0
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  7. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -0
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  10. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  11. package/dist/v2/blocks/operation-block/components/Header.vue.script.js +20 -10
  12. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  13. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
  14. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -2
  15. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
  16. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
  17. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  18. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  19. package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
  20. package/dist/v2/components/modals/ModalClientContainer.vue.script.js +17 -24
  21. package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
  22. package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -2
  23. package/dist/v2/components/sidebar/Sidebar.vue.script.js +2 -2
  24. package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
  25. package/dist/v2/constants.js +1 -1
  26. package/dist/v2/features/app/App.vue.d.ts +22 -4
  27. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  28. package/dist/v2/features/app/App.vue.js.map +1 -1
  29. package/dist/v2/features/app/App.vue.script.js +57 -54
  30. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  31. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  32. package/dist/v2/features/app/app-events.js +4 -0
  33. package/dist/v2/features/app/app-events.js.map +1 -1
  34. package/dist/v2/features/app/app-state.d.ts +6 -0
  35. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  36. package/dist/v2/features/app/app-state.js +15 -1
  37. package/dist/v2/features/app/app-state.js.map +1 -1
  38. package/dist/v2/features/app/components/AppHeader.vue.d.ts +20 -0
  39. package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +1 -0
  40. package/dist/v2/features/app/components/AppHeader.vue.js +7 -0
  41. package/dist/v2/features/app/components/AppHeader.vue.js.map +1 -0
  42. package/dist/v2/features/app/components/AppHeader.vue.script.js +43 -0
  43. package/dist/v2/features/app/components/AppHeader.vue.script.js.map +1 -0
  44. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +17 -56
  45. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  46. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  47. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  48. package/dist/v2/features/app/components/AppSidebar.vue.script.js +437 -271
  49. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  50. package/dist/v2/features/app/helpers/load-registry-document.d.ts +18 -0
  51. package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +1 -0
  52. package/dist/v2/features/app/helpers/load-registry-document.js +45 -0
  53. package/dist/v2/features/app/helpers/load-registry-document.js.map +1 -0
  54. package/dist/v2/features/app/helpers/routes.d.ts +6 -1
  55. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  56. package/dist/v2/features/app/helpers/routes.js +84 -75
  57. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  58. package/dist/v2/features/app/hooks/use-document-filter.d.ts +38 -0
  59. package/dist/v2/features/app/hooks/use-document-filter.d.ts.map +1 -0
  60. package/dist/v2/features/app/hooks/use-document-filter.js +63 -0
  61. package/dist/v2/features/app/hooks/use-document-filter.js.map +1 -0
  62. package/dist/v2/features/app/hooks/use-sidebar-context-menu.d.ts +17258 -0
  63. package/dist/v2/features/app/hooks/use-sidebar-context-menu.d.ts.map +1 -0
  64. package/dist/v2/features/app/hooks/use-sidebar-context-menu.js +107 -0
  65. package/dist/v2/features/app/hooks/use-sidebar-context-menu.js.map +1 -0
  66. package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +95 -0
  67. package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +1 -0
  68. package/dist/v2/features/app/hooks/use-sidebar-documents.js +97 -0
  69. package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +1 -0
  70. package/dist/v2/features/app/index.d.ts +1 -0
  71. package/dist/v2/features/app/index.d.ts.map +1 -1
  72. package/dist/v2/features/collection/components/GetStarted.vue.d.ts +13 -0
  73. package/dist/v2/features/collection/components/GetStarted.vue.d.ts.map +1 -0
  74. package/dist/v2/features/collection/components/GetStarted.vue.js +7 -0
  75. package/dist/v2/features/collection/components/GetStarted.vue.js.map +1 -0
  76. package/dist/v2/features/collection/components/GetStarted.vue.script.js +101 -0
  77. package/dist/v2/features/collection/components/GetStarted.vue.script.js.map +1 -0
  78. package/dist/v2/features/command-palette/helpers/generate-unique-slug.d.ts +4 -0
  79. package/dist/v2/features/command-palette/helpers/generate-unique-slug.d.ts.map +1 -1
  80. package/dist/v2/features/command-palette/helpers/generate-unique-slug.js +5 -1
  81. package/dist/v2/features/command-palette/helpers/generate-unique-slug.js.map +1 -1
  82. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts +16 -0
  83. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -0
  84. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +9 -0
  85. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -0
  86. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +123 -0
  87. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -0
  88. package/dist/v2/features/search/components/SearchResult.vue.d.ts +11 -0
  89. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -0
  90. package/dist/v2/features/search/components/SearchResult.vue.js +7 -0
  91. package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -0
  92. package/dist/v2/features/search/components/SearchResult.vue.script.js +71 -0
  93. package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -0
  94. package/dist/v2/features/search/hooks/use-document-search.d.ts +19 -0
  95. package/dist/v2/features/search/hooks/use-document-search.d.ts.map +1 -0
  96. package/dist/v2/features/search/hooks/use-document-search.js +42 -0
  97. package/dist/v2/features/search/hooks/use-document-search.js.map +1 -0
  98. package/dist/v2/features/search/index.d.ts +2 -0
  99. package/dist/v2/features/search/index.d.ts.map +1 -1
  100. package/dist/v2/features/search/index.js +3 -1
  101. package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
  102. package/dist/v2/helpers/handle-hotkeys.js +8 -4
  103. package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
  104. package/dist/v2/types/configuration.d.ts +1 -0
  105. package/dist/v2/types/configuration.d.ts.map +1 -1
  106. package/package.json +14 -13
  107. package/dist/assets/rabbit.ascii.virtual.js +0 -6
  108. package/dist/assets/rabbit.ascii.virtual.js.map +0 -1
  109. package/dist/assets/rabbitjump.ascii.virtual.js +0 -6
  110. package/dist/assets/rabbitjump.ascii.virtual.js.map +0 -1
  111. package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts +0 -4
  112. package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +0 -1
  113. package/dist/v2/features/app/components/DownloadAppButton.vue.js +0 -9
  114. package/dist/v2/features/app/components/DownloadAppButton.vue.js.map +0 -1
  115. package/dist/v2/features/app/components/DownloadAppButton.vue.script.js +0 -21
  116. package/dist/v2/features/app/components/DownloadAppButton.vue.script.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"OperationBlock.vue.script.js","names":[],"sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * OperationBlock\n *\n * Orchestrates the operation view by wiring together the Header, OperationBlock,\n * and ResponseBlock. Forwards user interactions to the workspace event bus and\n * passes through configuration such as auth, servers, plugins, and environment.\n * This component keeps the Operation page lean by centralizing event emission\n * and prop wiring between the blocks.\n *\n * Notable behavior:\n * - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide\n * draft overrides for the UI when present.\n */\nexport default {\n name: 'OperationBlock',\n}\n\nexport type OperationBlockProps = {\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Workspace cookies */\n workspaceCookies: XScalarCookie[]\n /** Document cookies */\n documentCookies: XScalarCookie[]\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** HTTP clients */\n httpClients: AvailableClients\n /** The history for the operation */\n history?: HistoryEntry[]\n /** Client layout */\n layout: ClientLayout\n /** Currently selected server */\n server: ServerObject | null\n /** Currently selected client */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** Meta information for the server */\n serverMeta: ServerMeta\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Operation object */\n operation: OperationObject\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Meta information for the auth update */\n authMeta: AuthMeta\n /** Document defined security schemes */\n securitySchemes: MergedSecuritySchemes\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** For environment variables in the inputs */\n environment: XScalarEnvironment\n /** The proxy URL for sending requests */\n proxyUrl: string\n /** Currently selected security */\n selectedSecurity: SelectedSecurity\n /** Currently selected security schemes */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n /** Security requirements */\n securityRequirements: OpenApiDocument['security']\n /** Default headers */\n defaultHeaders: Record<string, string>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n}\n</script>\n<script setup lang=\"ts\">\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { executeHook, type ClientPlugin } from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema'\nimport type {\n AuthMeta,\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n requestFactory,\n type MergedSecuritySchemes,\n type RequestPayload,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\nimport { computed, onBeforeUnmount, onMounted, ref, toValue, watch } from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport { harToFetchRequest } from '@/v2/blocks/operation-block/helpers/har-to-fetch-request'\nimport { harToFetchResponse } from '@/v2/blocks/operation-block/helpers/har-to-fetch-response'\nimport {\n getOperationExampleKey,\n isStreamingResponse,\n responseCache,\n} from '@/v2/blocks/operation-block/helpers/response-cache'\nimport {\n sendRequest,\n type ResponseInstance,\n} from '@/v2/blocks/operation-block/helpers/send-request'\nimport { validatePathParameters } from '@/v2/blocks/operation-block/helpers/validate-path-parameters'\nimport { generateClientOptions } from '@/v2/blocks/operation-code-sample'\nimport { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport Header from './components/Header.vue'\n\nconst {\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n method,\n operation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\n/** Hoist up client generation so it doesn't get re-generated on every operation */\nconst clientOptions = computed(() => generateClientOptions(httpClients))\n\nconst { toast } = useToasts()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast('Path parameters must have values.', 'error')\n return\n }\n\n const globalCookies = [...workspaceCookies, ...documentCookies]\n\n const { request: requestBuilder } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies,\n method,\n operation,\n path,\n proxyUrl,\n server,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n requestBodyCompositionSelection,\n })\n\n // Stop any previous streaming response\n if (response.value && 'reader' in response.value) {\n response.value.reader.cancel()\n }\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Execute the beforeRequest hook (plugins receive RequestFactory, not fetch Request)\n await executeHook(\n {\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'beforeRequest',\n plugins,\n )\n\n const envVariables = {\n ...getEnvironmentVariables(environment),\n ...variablesStore.getVariables(),\n }\n\n // Build the fetch Request after hooks may have mutated the factory\n const requestResult = (() => {\n try {\n return {\n ok: true,\n result: buildRequest(requestBuilder, {\n envVariables,\n }),\n } as const\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n error: message,\n } as const\n }\n })()\n\n if (requestResult.ok === false) {\n toast(requestResult.error, 'error')\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = requestResult.result.controller\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:sent', {\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n /** Execute the request */\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.result.isUsingProxy,\n requestPayload: requestResult.result.requestPayload,\n plugins,\n customFetch: toValue(options)?.customFetch,\n })\n\n if (sendResult) {\n // Execute the responseReceived hook\n await executeHook(\n {\n response: sendResult.originalResponse.clone(),\n requestBuilder,\n request: buildSafeBodyRequest(...sendResult.requestPayload),\n document,\n operation,\n variablesStore,\n },\n 'responseReceived',\n plugins,\n )\n }\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:complete', {\n payload: sendResult\n ? {\n response: sendResult.originalResponse.clone(),\n requestPayload: sendResult.requestPayload,\n duration: sendResult.response.duration,\n timestamp: sendResult.timestamp,\n }\n : undefined,\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n if (sendError) {\n // clean up the response and request\n response.value = null\n requestPayload.value = null\n abortController.value = null\n\n toast(sendError.message, 'error')\n return\n }\n\n // Store the response\n response.value = sendResult.response\n requestPayload.value = sendResult.requestPayload\n\n // Cache non-streaming responses so they can be restored when navigating back\n if (!isStreamingResponse(sendResult.response)) {\n responseCache.set(getOperationExampleKey(method, path, exampleKey), {\n response: sendResult.response,\n requestPayload: sendResult.requestPayload,\n })\n }\n}\n\nonMounted(() => {\n eventBus.on('operation:send:request:hotkey', handleExecute)\n eventBus.on('operation:cancel:request', cancelRequest)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as HttpMethodType,\n path: entry.request.url,\n duration: entry.time,\n status: entry.response.status,\n }))\n .reverse(),\n)\n\nconst handleSelectHistoryItem = ({ index }: { index: number }) => {\n const transformedIndex = (history.length ?? 0) - index - 1\n const historyItem = history[transformedIndex]\n if (!historyItem) {\n return\n }\n\n const navigate = () =>\n eventBus.emit('ui:navigate', {\n page: 'example',\n method,\n path,\n exampleName: 'draft',\n callback: (status) => {\n // Do not replace the response if the navigation was not successful\n if (status !== 'success') {\n return\n }\n // Reconstruct the response\n const fetchResponse = harToFetchResponse({\n harResponse: historyItem.response,\n url: historyItem.request.url,\n method,\n path,\n duration: historyItem.time,\n })\n\n // Reconstruct the request\n const fetchRequest = harToFetchRequest({\n harRequest: historyItem.request,\n })\n\n // Update the response and request\n response.value = fetchResponse\n requestPayload.value = fetchRequest\n },\n })\n\n eventBus.emit('operation:reload:history', {\n meta: {\n path,\n method,\n },\n index: transformedIndex,\n callback: navigate,\n })\n}\n\n/**\n * When the path, method, or example key changes: save current response to\n * cache (so it can be restored when navigating back), then restore from cache\n * for the new operation or clear if no cached response. Response is only\n * cleared on page refresh or when making a new request for that operation.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n const newKey = getOperationExampleKey(newMethod, newPath, newExampleKey)\n const cached = responseCache.get(newKey)\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n response.value = null\n requestPayload.value = null\n }\n\n // Cancel any in-flight request\n cancelRequest()\n },\n { immediate: true },\n)\n\nonBeforeUnmount(() => {\n // We cancel the request if the component is unmounted\n cancelRequest()\n})\n</script>\n<template>\n <div class=\"bg-b-1 flex h-full flex-col\">\n <div\n class=\"lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0\">\n <!-- Address Bar -->\n <Header\n :activeEnvironment\n :documentUrl\n :environment\n :environments\n :eventBus\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @select:history:item=\"handleSelectHistoryItem\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <RequestBlock\n :authMeta\n :clientOptions\n :defaultHeaders\n :documentCookies\n :environment\n :eventBus\n :exampleKey\n :layout\n :method\n :operation\n :options=\"toValue(options)\"\n :path\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :layout\n :plugins\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;CAeE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmKR,MAAM,gBAAgB,eAAe,sBA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AqBM,OArBN,YAqBM,CAlBJ,YAiBmD,gBAAA;IAhBhD,mBAAA,QAAA;IACA,aAAA,QAAA;IACA,aAAA,QAAA;IACA,cAAA,QAAA;IACA,UAAA,QAAA;IACA,kBAAA,QAAA;IACA,SAAS,iBAAA;IACT,aAAA,QAAA;IACA,QAAA,QAAA;IACA,QAAA,QAAA;IACA,MAAA,QAAA;IACA,QAAA,QAAA;IACA,YAAA,QAAA;IACA,SAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAS;IACT,yBAAqB;;;;;;;;;;;;;;;;;SAG1B,YAqCa,oBAAA,EArCD,OAAM,YAAU,EAAA;2BAoCN,CAnCpB,YAmCoB,2BAAA,EAnCD,OAAM,UAAQ,EAAA;4BAwBT,CAtBtB,YAsBsB,MAAA,qBAAA,EAAA;MArBnB,UAAA,QAAA;MACA,eAAA,cAAA;MACA,gBAAA,QAAA;MACA,iBAAA,QAAA;MACA,aAAA,QAAA;MACA,UAAA,QAAA;MACA,YAAA,QAAA;MACA,QAAA,QAAA;MACA,QAAA,QAAA;MACA,WAAA,QAAA;MACA,SAAS,QAAQ,QAAA,QAAO;MACxB,MAAA,QAAA;MACA,SAAA,QAAA;MACA,UAAA,QAAA;MACA,iCAAA,QAAA;MACA,sBAAA,QAAA;MACA,iBAAA,QAAA;MACA,gBAAA,QAAA;MACA,kBAAA,QAAA;MACA,yBAAA,QAAA;MACA,QAAA,QAAA;MACA,kBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;SAGH,YAOsD,MAAA,sBAAA,EAAA;MANnD,YAAA,QAAA;MACA,UAAA,QAAA;MACA,QAAA,QAAA;MACA,SAAA,QAAA;MACA,gBAAA,eAAA;MACA,UAAA,SAAA;MACA,wBAAwB,iBAAA,MAAiB"}
1
+ {"version":3,"file":"OperationBlock.vue.script.js","names":[],"sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * OperationBlock\n *\n * Orchestrates the operation view by wiring together the Header, OperationBlock,\n * and ResponseBlock. Forwards user interactions to the workspace event bus and\n * passes through configuration such as auth, servers, plugins, and environment.\n * This component keeps the Operation page lean by centralizing event emission\n * and prop wiring between the blocks.\n *\n * Notable behavior:\n * - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide\n * draft overrides for the UI when present.\n */\nexport default {\n name: 'OperationBlock',\n}\n\nexport type OperationBlockProps = {\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Workspace cookies */\n workspaceCookies: XScalarCookie[]\n /** Document cookies */\n documentCookies: XScalarCookie[]\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** HTTP clients */\n httpClients: AvailableClients\n /** The history for the operation */\n history?: HistoryEntry[]\n /** Client layout */\n layout: ClientLayout\n /** Currently selected server */\n server: ServerObject | null\n /** Currently selected client */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** Meta information for the server */\n serverMeta: ServerMeta\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Operation object */\n operation: OperationObject\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Meta information for the auth update */\n authMeta: AuthMeta\n /** Document defined security schemes */\n securitySchemes: MergedSecuritySchemes\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** For environment variables in the inputs */\n environment: XScalarEnvironment\n /** The proxy URL for sending requests */\n proxyUrl: string\n /** Currently selected security */\n selectedSecurity: SelectedSecurity\n /** Currently selected security schemes */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n /** Security requirements */\n securityRequirements: OpenApiDocument['security']\n /** Default headers */\n defaultHeaders: Record<string, string>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n}\n</script>\n<script setup lang=\"ts\">\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { executeHook, type ClientPlugin } from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema'\nimport type {\n AuthMeta,\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n requestFactory,\n type MergedSecuritySchemes,\n type RequestPayload,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\nimport { computed, onBeforeUnmount, onMounted, ref, toValue, watch } from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport { harToFetchRequest } from '@/v2/blocks/operation-block/helpers/har-to-fetch-request'\nimport { harToFetchResponse } from '@/v2/blocks/operation-block/helpers/har-to-fetch-response'\nimport {\n getOperationExampleKey,\n isStreamingResponse,\n responseCache,\n} from '@/v2/blocks/operation-block/helpers/response-cache'\nimport {\n sendRequest,\n type ResponseInstance,\n} from '@/v2/blocks/operation-block/helpers/send-request'\nimport { validatePathParameters } from '@/v2/blocks/operation-block/helpers/validate-path-parameters'\nimport { generateClientOptions } from '@/v2/blocks/operation-code-sample'\nimport { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport Header from './components/Header.vue'\n\nconst {\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n method,\n operation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\n/** Hoist up client generation so it doesn't get re-generated on every operation */\nconst clientOptions = computed(() => generateClientOptions(httpClients))\n\nconst { toast } = useToasts()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast('Path parameters must have values.', 'error')\n return\n }\n\n const globalCookies = [...workspaceCookies, ...documentCookies]\n\n const { request: requestBuilder } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies,\n method,\n operation,\n path,\n proxyUrl,\n server,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n requestBodyCompositionSelection,\n })\n\n // Stop any previous streaming response\n if (response.value && 'reader' in response.value) {\n response.value.reader.cancel()\n }\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Execute the beforeRequest hook (plugins receive RequestFactory, not fetch Request)\n await executeHook(\n {\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'beforeRequest',\n plugins,\n )\n\n const envVariables = {\n ...getEnvironmentVariables(environment),\n ...variablesStore.getVariables(),\n }\n\n // Build the fetch Request after hooks may have mutated the factory\n const requestResult = (() => {\n try {\n return {\n ok: true,\n result: buildRequest(requestBuilder, {\n envVariables,\n }),\n } as const\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n error: message,\n } as const\n }\n })()\n\n if (requestResult.ok === false) {\n toast(requestResult.error, 'error')\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = requestResult.result.controller\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:sent', {\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n /** Execute the request */\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.result.isUsingProxy,\n requestPayload: requestResult.result.requestPayload,\n plugins,\n customFetch: toValue(options)?.customFetch,\n })\n\n if (sendResult) {\n // Execute the responseReceived hook\n await executeHook(\n {\n response: sendResult.originalResponse.clone(),\n requestBuilder,\n request: buildSafeBodyRequest(...sendResult.requestPayload),\n document,\n operation,\n variablesStore,\n },\n 'responseReceived',\n plugins,\n )\n }\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:complete', {\n payload: sendResult\n ? {\n response: sendResult.originalResponse.clone(),\n requestPayload: sendResult.requestPayload,\n duration: sendResult.response.duration,\n timestamp: sendResult.timestamp,\n }\n : undefined,\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n if (sendError) {\n // clean up the response and request\n response.value = null\n requestPayload.value = null\n abortController.value = null\n\n toast(sendError.message, 'error')\n return\n }\n\n // Store the response\n response.value = sendResult.response\n requestPayload.value = sendResult.requestPayload\n\n // Cache non-streaming responses so they can be restored when navigating back\n if (!isStreamingResponse(sendResult.response)) {\n responseCache.set(getOperationExampleKey(method, path, exampleKey), {\n response: sendResult.response,\n requestPayload: sendResult.requestPayload,\n })\n }\n}\n\nonMounted(() => {\n eventBus.on('operation:send:request:hotkey', handleExecute)\n eventBus.on('operation:cancel:request', cancelRequest)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as HttpMethodType,\n path: entry.request.url,\n duration: entry.time,\n status: entry.response.status,\n }))\n .reverse(),\n)\n\nconst handleSelectHistoryItem = ({ index }: { index: number }) => {\n const transformedIndex = (history.length ?? 0) - index - 1\n const historyItem = history[transformedIndex]\n if (!historyItem) {\n return\n }\n\n const navigate = () =>\n eventBus.emit('ui:navigate', {\n page: 'example',\n method,\n path,\n exampleName: 'draft',\n callback: (status) => {\n // Do not replace the response if the navigation was not successful\n if (status !== 'success') {\n return\n }\n // Reconstruct the response\n const fetchResponse = harToFetchResponse({\n harResponse: historyItem.response,\n url: historyItem.request.url,\n method,\n path,\n duration: historyItem.time,\n })\n\n // Reconstruct the request\n const fetchRequest = harToFetchRequest({\n harRequest: historyItem.request,\n })\n\n // Update the response and request\n response.value = fetchResponse\n requestPayload.value = fetchRequest\n },\n })\n\n eventBus.emit('operation:reload:history', {\n meta: {\n path,\n method,\n },\n index: transformedIndex,\n callback: navigate,\n })\n}\n\nconst handleNavigateSettings = () => {\n eventBus.emit('ui:navigate', {\n page: 'operation',\n path: 'overview',\n operationPath: path,\n method,\n })\n}\n\n/**\n * When the path, method, or example key changes: save current response to\n * cache (so it can be restored when navigating back), then restore from cache\n * for the new operation or clear if no cached response. Response is only\n * cleared on page refresh or when making a new request for that operation.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n const newKey = getOperationExampleKey(newMethod, newPath, newExampleKey)\n const cached = responseCache.get(newKey)\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n response.value = null\n requestPayload.value = null\n }\n\n // Cancel any in-flight request\n cancelRequest()\n },\n { immediate: true },\n)\n\nonBeforeUnmount(() => {\n // We cancel the request if the component is unmounted\n cancelRequest()\n})\n</script>\n<template>\n <div class=\"bg-b-1 flex h-full flex-col\">\n <div\n class=\"lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0\">\n <!-- Address Bar -->\n <Header\n :activeEnvironment\n :documentUrl\n :environment\n :environments\n :eventBus\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @navigate:settings=\"handleNavigateSettings\"\n @select:history:item=\"handleSelectHistoryItem\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <RequestBlock\n :authMeta\n :clientOptions\n :defaultHeaders\n :documentCookies\n :environment\n :eventBus\n :exampleKey\n :layout\n :method\n :operation\n :options=\"toValue(options)\"\n :path\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :layout\n :plugins\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;CAeE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmKR,MAAM,gBAAgB,eAAe,sBAAsB,QAAA,YAAY,CAAA;EAEvE,MAAM,EAAE,UAAU,WAAU;EAG5B,MAAM,kBAAkB,IAA4B,KAAI;EACxD,MAAM,WAAW,IAA6B,KAAI;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AsBM,OAtBN,YAsBM,CAnBJ,YAkBmD,gBAAA;IAjBhD,mBAAA,QAAA;IACA,aAAA,QAAA;IACA,aAAA,QAAA;IACA,cAAA,QAAA;IACA,UAAA,QAAA;IACA,kBAAA,QAAA;IACA,SAAS,iBAAA;IACT,aAAA,QAAA;IACA,QAAA,QAAA;IACA,QAAA,QAAA;IACA,MAAA,QAAA;IACA,QAAA,QAAA;IACA,YAAA,QAAA;IACA,SAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAS;IACT,uBAAmB;IACnB,yBAAqB;;;;;;;;;;;;;;;;;SAG1B,YAqCa,oBAAA,EArCD,OAAM,YAAU,EAAA;2BAoCN,CAnCpB,YAmCoB,2BAAA,EAnCD,OAAM,UAAQ,EAAA;4BAwBT,CAtBtB,YAsBsB,MAAA,qBAAA,EAAA;MArBnB,UAAA,QAAA;MACA,eAAA,cAAA;MACA,gBAAA,QAAA;MACA,iBAAA,QAAA;MACA,aAAA,QAAA;MACA,UAAA,QAAA;MACA,YAAA,QAAA;MACA,QAAA,QAAA;MACA,QAAA,QAAA;MACA,WAAA,QAAA;MACA,SAAS,QAAQ,QAAA,QAAO;MACxB,MAAA,QAAA;MACA,SAAA,QAAA;MACA,UAAA,QAAA;MACA,iCAAA,QAAA;MACA,sBAAA,QAAA;MACA,iBAAA,QAAA;MACA,gBAAA,QAAA;MACA,kBAAA,QAAA;MACA,yBAAA,QAAA;MACA,QAAA,QAAA;MACA,kBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;SAGH,YAOsD,MAAA,sBAAA,EAAA;MANnD,YAAA,QAAA;MACA,UAAA,QAAA;MACA,QAAA,QAAA;MACA,SAAA,QAAA;MACA,gBAAA,eAAA;MACA,UAAA,SAAA;MACA,wBAAwB,iBAAA,MAAiB"}
@@ -51,11 +51,13 @@ declare const __VLS_export: import("vue").DefineComponent<HeaderProps, {}, {}, {
51
51
  index: number;
52
52
  }) => any;
53
53
  "add:environment": () => any;
54
+ "navigate:settings": () => any;
54
55
  }, string, import("vue").PublicProps, Readonly<HeaderProps> & Readonly<{
55
56
  onExecute?: (() => any) | undefined;
56
57
  "onSelect:history:item"?: ((payload: {
57
58
  index: number;
58
59
  }) => any) | undefined;
59
60
  "onAdd:environment"?: (() => any) | undefined;
61
+ "onNavigate:settings"?: (() => any) | undefined;
60
62
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
61
63
  //# sourceMappingURL=Header.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"AAsLA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,4BAA4B;IAC5B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;wBACoB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;;;eAS6B,MAAM;;;;;;eAAN,MAAM;;;kFA4QjD,CAAC"}
1
+ {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"AAiMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,4BAA4B;IAC5B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;wBACoB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;;;eAS6B,MAAM;;;;;;;eAAN,MAAM;;;;kFA+SjD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
2
2
  import Header_vue_vue_type_script_setup_true_lang_default from "./Header.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/v2/blocks/operation-block/components/Header.vue
5
- var Header_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Header_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-bcbdc356"]]);
5
+ var Header_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Header_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-1c2b0dae"]]);
6
6
  //#endregion
7
7
  export { Header_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n Operation block header: address bar, environment selector, and modal controls.\n\n Renders the top bar for the API client operation view: URL/method (AddressBar),\n optional environment selector, optional \"Open API Client\" button in modal layout,\n and close button for modal. Layout and visibility depend on `layout` and `source` props.\n */\nexport type HeaderProps = {\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethod\n /** Client layout */\n layout: ClientLayout\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Currently selected server */\n server: ServerObject | null\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** List of request history */\n history: History[]\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** Environment variables */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type {\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { AddressBar, type History } from '@/v2/blocks/scalar-address-bar-block'\nimport EnvironmentSelector from '@/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport OpenApiClientButton from './OpenApiClientButton.vue'\n\nconst { hideClientButton = false, eventBus } = defineProps<HeaderProps>()\n\nconst emit = defineEmits<{\n /** Execute the current operation example */\n (e: 'execute'): void\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Add a new environment */\n (e: 'add:environment'): void\n}>()\n\nconst handleSelectEnvironment = (environmentName: string) => {\n eventBus.emit('workspace:update:active-environment', environmentName)\n}\n\nconst handleAddEnvironment = () => {\n eventBus.emit('ui:navigate', { page: 'document', path: 'environment' })\n}\n</script>\n\n<template>\n <div\n class=\"lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1\">\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1\">\n <!--\n Holds space for the sidebar toggle\n\n Hidden for `modal` layout\n -->\n <div class=\"size-8\"></div>\n </div>\n <AddressBar\n :activeEnvironment\n :environment\n :environments\n :eventBus\n :history\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n @add:environment=\"emit('add:environment')\"\n @execute=\"emit('execute')\"\n @select:history:item=\"\n (payload) => emit('select:history:item', payload)\n \" />\n\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5\">\n <!--\n Environment Selector\n Hidden for `modal` layout\n -->\n <EnvironmentSelector\n v-if=\"layout !== 'modal'\"\n :activeEnvironment=\"activeEnvironment\"\n :environments=\"environments\"\n @add:environment=\"handleAddEnvironment\"\n @select:environment=\"handleSelectEnvironment\" />\n <!--\n Open API Client Button\n\n Only shown in `modal` layout\n -->\n <OpenApiClientButton\n v-if=\"layout === 'modal' && documentUrl && !hideClientButton\"\n buttonSource=\"modal\"\n class=\"!w-fit lg:-mr-1\"\n :integration=\"integration ?? null\"\n :source=\"source ?? 'api-reference'\"\n :url=\"documentUrl\" />\n\n <!--\n Close Button\n\n Only shown in `modal` layout and hidden for GitBook Integration\n -->\n <button\n v-if=\"layout === 'modal' && source !== 'gitbook'\"\n class=\"app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"lg\"\n thickness=\"2\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n\n <!--\n Close Button for GitBook Integration\n\n Hidden by default and visible for GitBook Integration in `modal` layout\n -->\n <button\n v-if=\"layout === 'modal' && source === 'gitbook'\"\n class=\"text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"md\"\n thickness=\"1.75\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n.app-exit-button {\n color: white;\n background: rgba(0, 0, 0, 0.1);\n}\n.app-exit-button:hover {\n background: rgba(255, 255, 255, 0.1);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"Header.vue.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n Operation block header: address bar, environment selector, and modal controls.\n\n Renders the top bar for the API client operation view: URL/method (AddressBar),\n optional environment selector, optional \"Open API Client\" button in modal layout,\n and close button for modal. Layout and visibility depend on `layout` and `source` props.\n */\nexport type HeaderProps = {\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethod\n /** Client layout */\n layout: ClientLayout\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Currently selected server */\n server: ServerObject | null\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** List of request history */\n history: History[]\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** Environment variables */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarIcon, ScalarIconButton } from '@scalar/components'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconGearSix } from '@scalar/icons'\nimport type {\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { AddressBar, type History } from '@/v2/blocks/scalar-address-bar-block'\nimport EnvironmentSelector from '@/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport OpenApiClientButton from './OpenApiClientButton.vue'\n\nconst { hideClientButton = false, eventBus } = defineProps<HeaderProps>()\n\nconst emit = defineEmits<{\n /** Execute the current operation example */\n (e: 'execute'): void\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Add a new environment */\n (e: 'add:environment'): void\n /** Navigate to the settings page for the current entity */\n (e: 'navigate:settings'): void\n}>()\n\nconst handleSelectEnvironment = (environmentName: string) => {\n eventBus.emit('workspace:update:active-environment', environmentName)\n}\n\nconst handleAddEnvironment = () => {\n eventBus.emit('ui:navigate', { page: 'document', path: 'environment' })\n}\n</script>\n\n<template>\n <div\n class=\"lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1\">\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1\">\n <!--\n Holds space for the sidebar toggle\n\n Hidden for `modal` layout\n -->\n <div class=\"size-8\"></div>\n </div>\n <AddressBar\n :activeEnvironment\n :environment\n :environments\n :eventBus\n :history\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n @add:environment=\"emit('add:environment')\"\n @execute=\"emit('execute')\"\n @select:history:item=\"\n (payload) => emit('select:history:item', payload)\n \" />\n\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5\">\n <!--\n Environment Selector\n Hidden for `modal` layout\n -->\n <EnvironmentSelector\n v-if=\"layout !== 'modal'\"\n :activeEnvironment=\"activeEnvironment\"\n :environments=\"environments\"\n @add:environment=\"handleAddEnvironment\"\n @select:environment=\"handleSelectEnvironment\" />\n <!-- Operation settings -->\n <ScalarIconButton\n v-if=\"layout !== 'modal'\"\n :icon=\"ScalarIconGearSix\"\n label=\"Operation settings\"\n size=\"sm\"\n weight=\"bold\"\n @click=\"emit('navigate:settings')\" />\n <!--\n Open API Client Button\n\n Only shown in `modal` layout\n -->\n <OpenApiClientButton\n v-if=\"layout === 'modal' && documentUrl && !hideClientButton\"\n buttonSource=\"modal\"\n class=\"!w-fit lg:-mr-1\"\n :integration=\"integration ?? null\"\n :source=\"source ?? 'api-reference'\"\n :url=\"documentUrl\" />\n\n <!--\n Close Button\n\n Only shown in `modal` layout and hidden for GitBook Integration\n -->\n <button\n v-if=\"layout === 'modal' && source !== 'gitbook'\"\n class=\"app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"lg\"\n thickness=\"2\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n\n <!--\n Close Button for GitBook Integration\n\n Hidden by default and visible for GitBook Integration in `modal` layout\n -->\n <button\n v-if=\"layout === 'modal' && source === 'gitbook'\"\n class=\"text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"md\"\n thickness=\"1.75\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n.app-exit-button {\n color: white;\n background: rgba(0, 0, 0, 0.1);\n}\n.app-exit-button:hover {\n background: rgba(255, 255, 255, 0.1);\n}\n</style>\n"],"mappings":""}
@@ -2,7 +2,8 @@ import OpenApiClientButton_default from "./OpenApiClientButton.vue.js";
2
2
  import AddressBar_default from "../../scalar-address-bar-block/components/AddressBar.vue.js";
3
3
  import EnvironmentSelector_default from "../../scalar-address-bar-block/components/EnvironmentSelector.vue.js";
4
4
  import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, unref } from "vue";
5
- import { ScalarIcon } from "@scalar/components";
5
+ import { ScalarIcon, ScalarIconButton } from "@scalar/components";
6
+ import { ScalarIconGearSix } from "@scalar/icons";
6
7
  //#region src/v2/blocks/operation-block/components/Header.vue?vue&type=script&setup=true&lang.ts
7
8
  var _hoisted_1 = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" };
8
9
  var _hoisted_2 = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5" };
@@ -31,7 +32,8 @@ var Header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
31
32
  emits: [
32
33
  "execute",
33
34
  "select:history:item",
34
- "add:environment"
35
+ "add:environment",
36
+ "navigate:settings"
35
37
  ],
36
38
  setup(__props, { emit: __emit }) {
37
39
  const emit = __emit;
@@ -46,7 +48,7 @@ var Header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
46
48
  };
47
49
  return (_ctx, _cache) => {
48
50
  return openBlock(), createElementBlock("div", _hoisted_1, [
49
- _cache[7] || (_cache[7] = createElementVNode("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [createElementVNode("div", { class: "size-8" })], -1)),
51
+ _cache[8] || (_cache[8] = createElementVNode("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [createElementVNode("div", { class: "size-8" })], -1)),
50
52
  createVNode(unref(AddressBar_default), {
51
53
  activeEnvironment: __props.activeEnvironment,
52
54
  environment: __props.environment,
@@ -83,8 +85,16 @@ var Header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
83
85
  "onAdd:environment": handleAddEnvironment,
84
86
  "onSelect:environment": handleSelectEnvironment
85
87
  }, null, 8, ["activeEnvironment", "environments"])) : createCommentVNode("", true),
86
- __props.layout === "modal" && __props.documentUrl && !__props.hideClientButton ? (openBlock(), createBlock(OpenApiClientButton_default, {
88
+ __props.layout !== "modal" ? (openBlock(), createBlock(unref(ScalarIconButton), {
87
89
  key: 1,
90
+ icon: unref(ScalarIconGearSix),
91
+ label: "Operation settings",
92
+ size: "sm",
93
+ weight: "bold",
94
+ onClick: _cache[3] || (_cache[3] = ($event) => emit("navigate:settings"))
95
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
96
+ __props.layout === "modal" && __props.documentUrl && !__props.hideClientButton ? (openBlock(), createBlock(OpenApiClientButton_default, {
97
+ key: 2,
88
98
  buttonSource: "modal",
89
99
  class: "!w-fit lg:-mr-1",
90
100
  integration: __props.integration ?? null,
@@ -96,25 +106,25 @@ var Header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
96
106
  "url"
97
107
  ])) : createCommentVNode("", true),
98
108
  __props.layout === "modal" && __props.source !== "gitbook" ? (openBlock(), createElementBlock("button", {
99
- key: 2,
109
+ key: 3,
100
110
  class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
101
111
  type: "button",
102
- onClick: _cache[3] || (_cache[3] = ($event) => __props.eventBus.emit("ui:close:client-modal"))
112
+ onClick: _cache[4] || (_cache[4] = ($event) => __props.eventBus.emit("ui:close:client-modal"))
103
113
  }, [createVNode(unref(ScalarIcon), {
104
114
  icon: "Close",
105
115
  size: "lg",
106
116
  thickness: "2"
107
- }), _cache[5] || (_cache[5] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))])) : createCommentVNode("", true),
117
+ }), _cache[6] || (_cache[6] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))])) : createCommentVNode("", true),
108
118
  __props.layout === "modal" && __props.source === "gitbook" ? (openBlock(), createElementBlock("button", {
109
- key: 3,
119
+ key: 4,
110
120
  class: "text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2",
111
121
  type: "button",
112
- onClick: _cache[4] || (_cache[4] = ($event) => __props.eventBus.emit("ui:close:client-modal"))
122
+ onClick: _cache[5] || (_cache[5] = ($event) => __props.eventBus.emit("ui:close:client-modal"))
113
123
  }, [createVNode(unref(ScalarIcon), {
114
124
  icon: "Close",
115
125
  size: "md",
116
126
  thickness: "1.75"
117
- }), _cache[6] || (_cache[6] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))])) : createCommentVNode("", true)
127
+ }), _cache[7] || (_cache[7] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))])) : createCommentVNode("", true)
118
128
  ])
119
129
  ]);
120
130
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n Operation block header: address bar, environment selector, and modal controls.\n\n Renders the top bar for the API client operation view: URL/method (AddressBar),\n optional environment selector, optional \"Open API Client\" button in modal layout,\n and close button for modal. Layout and visibility depend on `layout` and `source` props.\n */\nexport type HeaderProps = {\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethod\n /** Client layout */\n layout: ClientLayout\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Currently selected server */\n server: ServerObject | null\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** List of request history */\n history: History[]\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** Environment variables */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type {\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { AddressBar, type History } from '@/v2/blocks/scalar-address-bar-block'\nimport EnvironmentSelector from '@/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport OpenApiClientButton from './OpenApiClientButton.vue'\n\nconst { hideClientButton = false, eventBus } = defineProps<HeaderProps>()\n\nconst emit = defineEmits<{\n /** Execute the current operation example */\n (e: 'execute'): void\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Add a new environment */\n (e: 'add:environment'): void\n}>()\n\nconst handleSelectEnvironment = (environmentName: string) => {\n eventBus.emit('workspace:update:active-environment', environmentName)\n}\n\nconst handleAddEnvironment = () => {\n eventBus.emit('ui:navigate', { page: 'document', path: 'environment' })\n}\n</script>\n\n<template>\n <div\n class=\"lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1\">\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1\">\n <!--\n Holds space for the sidebar toggle\n\n Hidden for `modal` layout\n -->\n <div class=\"size-8\"></div>\n </div>\n <AddressBar\n :activeEnvironment\n :environment\n :environments\n :eventBus\n :history\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n @add:environment=\"emit('add:environment')\"\n @execute=\"emit('execute')\"\n @select:history:item=\"\n (payload) => emit('select:history:item', payload)\n \" />\n\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5\">\n <!--\n Environment Selector\n Hidden for `modal` layout\n -->\n <EnvironmentSelector\n v-if=\"layout !== 'modal'\"\n :activeEnvironment=\"activeEnvironment\"\n :environments=\"environments\"\n @add:environment=\"handleAddEnvironment\"\n @select:environment=\"handleSelectEnvironment\" />\n <!--\n Open API Client Button\n\n Only shown in `modal` layout\n -->\n <OpenApiClientButton\n v-if=\"layout === 'modal' && documentUrl && !hideClientButton\"\n buttonSource=\"modal\"\n class=\"!w-fit lg:-mr-1\"\n :integration=\"integration ?? null\"\n :source=\"source ?? 'api-reference'\"\n :url=\"documentUrl\" />\n\n <!--\n Close Button\n\n Only shown in `modal` layout and hidden for GitBook Integration\n -->\n <button\n v-if=\"layout === 'modal' && source !== 'gitbook'\"\n class=\"app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"lg\"\n thickness=\"2\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n\n <!--\n Close Button for GitBook Integration\n\n Hidden by default and visible for GitBook Integration in `modal` layout\n -->\n <button\n v-if=\"layout === 'modal' && source === 'gitbook'\"\n class=\"text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"md\"\n thickness=\"1.75\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n.app-exit-button {\n color: white;\n background: rgba(0, 0, 0, 0.1);\n}\n.app-exit-button:hover {\n background: rgba(255, 255, 255, 0.1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,MAAM,OAAO;EASb,MAAM,2BAA2B,oBAA4B;AAC3D,WAAA,SAAS,KAAK,uCAAuC,gBAAe;;EAGtE,MAAM,6BAA6B;AACjC,WAAA,SAAS,KAAK,eAAe;IAAE,MAAM;IAAY,MAAM;IAAe,CAAA;;;uBAKtE,mBAwFM,OAxFN,YAwFM;8BAtFJ,mBAQM,OAAA,EAPJ,OAAM,yEAAuE,EAAA,CAM7E,mBAA0B,OAAA,EAArB,OAAM,UAAQ,CAAA,CAAA,EAAA,GAAA;IAErB,YAg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WAAA,EAAA;MAFnB,MAAK;MACL,MAAK;MACL,WAAU;mCACZ,mBAAyC,QAAA,EAAnC,OAAM,WAAS,EAAC,gBAAY,GAAA,EAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"Header.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n Operation block header: address bar, environment selector, and modal controls.\n\n Renders the top bar for the API client operation view: URL/method (AddressBar),\n optional environment selector, optional \"Open API Client\" button in modal layout,\n and close button for modal. Layout and visibility depend on `layout` and `source` props.\n */\nexport type HeaderProps = {\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethod\n /** Client layout */\n layout: ClientLayout\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Currently selected server */\n server: ServerObject | null\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** List of request history */\n history: History[]\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** Environment variables */\n environment: XScalarEnvironment\n /** Meta information for the server */\n serverMeta: ServerMeta\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarIcon, ScalarIconButton } from '@scalar/components'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconGearSix } from '@scalar/icons'\nimport type {\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { AddressBar, type History } from '@/v2/blocks/scalar-address-bar-block'\nimport EnvironmentSelector from '@/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport OpenApiClientButton from './OpenApiClientButton.vue'\n\nconst { hideClientButton = false, eventBus } = defineProps<HeaderProps>()\n\nconst emit = defineEmits<{\n /** Execute the current operation example */\n (e: 'execute'): void\n /** Select a request history item by index */\n (e: 'select:history:item', payload: { index: number }): void\n /** Add a new environment */\n (e: 'add:environment'): void\n /** Navigate to the settings page for the current entity */\n (e: 'navigate:settings'): void\n}>()\n\nconst handleSelectEnvironment = (environmentName: string) => {\n eventBus.emit('workspace:update:active-environment', environmentName)\n}\n\nconst handleAddEnvironment = () => {\n eventBus.emit('ui:navigate', { page: 'document', path: 'environment' })\n}\n</script>\n\n<template>\n <div\n class=\"lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1\">\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1\">\n <!--\n Holds space for the sidebar toggle\n\n Hidden for `modal` layout\n -->\n <div class=\"size-8\"></div>\n </div>\n <AddressBar\n :activeEnvironment\n :environment\n :environments\n :eventBus\n :history\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n @add:environment=\"emit('add:environment')\"\n @execute=\"emit('execute')\"\n @select:history:item=\"\n (payload) => emit('select:history:item', payload)\n \" />\n\n <div\n class=\"mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5\">\n <!--\n Environment Selector\n Hidden for `modal` layout\n -->\n <EnvironmentSelector\n v-if=\"layout !== 'modal'\"\n :activeEnvironment=\"activeEnvironment\"\n :environments=\"environments\"\n @add:environment=\"handleAddEnvironment\"\n @select:environment=\"handleSelectEnvironment\" />\n <!-- Operation settings -->\n <ScalarIconButton\n v-if=\"layout !== 'modal'\"\n :icon=\"ScalarIconGearSix\"\n label=\"Operation settings\"\n size=\"sm\"\n weight=\"bold\"\n @click=\"emit('navigate:settings')\" />\n <!--\n Open API Client Button\n\n Only shown in `modal` layout\n -->\n <OpenApiClientButton\n v-if=\"layout === 'modal' && documentUrl && !hideClientButton\"\n buttonSource=\"modal\"\n class=\"!w-fit lg:-mr-1\"\n :integration=\"integration ?? null\"\n :source=\"source ?? 'api-reference'\"\n :url=\"documentUrl\" />\n\n <!--\n Close Button\n\n Only shown in `modal` layout and hidden for GitBook Integration\n -->\n <button\n v-if=\"layout === 'modal' && source !== 'gitbook'\"\n class=\"app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"lg\"\n thickness=\"2\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n\n <!--\n Close Button for GitBook Integration\n\n Hidden by default and visible for GitBook Integration in `modal` layout\n -->\n <button\n v-if=\"layout === 'modal' && source === 'gitbook'\"\n class=\"text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2\"\n type=\"button\"\n @click=\"eventBus.emit('ui:close:client-modal')\">\n <ScalarIcon\n icon=\"Close\"\n size=\"md\"\n thickness=\"1.75\" />\n <span class=\"sr-only\">Close Client</span>\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n.app-exit-button {\n color: white;\n background: rgba(0, 0, 0, 0.1);\n}\n.app-exit-button:hover {\n background: rgba(255, 255, 255, 0.1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DA,MAAM,OAAO;EAWb,MAAM,2BAA2B,oBAA4B;AAC3D,WAAA,SAAS,KAAK,uCAAuC,gBAAe;;EAGtE,MAAM,6BAA6B;AACjC,WAAA,SAAS,KAAK,eAAe;IAAE,MAAM;IAAY,MAAM;IAAe,CAAA;;;uBAKtE,mBAgGM,OAhGN,YAgGM;8BA9FJ,mBAQM,OAAA,EAPJ,OAAM,yEAAuE,EAAA,CAM7E,mBAA0B,OAAA,EAArB,OAAM,UAAQ,CAAA,CAAA,EAAA,GAAA;IAEr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AAA;KAS5B,QAAA,WAAM,WAAgB,QAAA,WAAM,aAAA,WAAA,EADpC,mBAUS,UAAA;;MARP,OAAM;MACN,MAAK;MACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,SAAS,KAAI,wBAAA;SACrB,YAGqB,MAAA,WAAA,EAAA;MAFnB,MAAK;MACL,MAAK;MACL,WAAU;mCACZ,mBAAyC,QAAA,EAAnC,OAAM,WAAS,EAAC,gBAAY,GAAA,EAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -22,7 +22,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
22
22
  documentSlug?: string;
23
23
  } | {
24
24
  page: "workspace";
25
- path: "environment" | "cookies" | "settings";
25
+ path: "environment" | "cookies" | "settings" | "get-started";
26
26
  } | {
27
27
  page: "example";
28
28
  documentSlug?: string;
@@ -56,7 +56,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
56
56
  documentSlug?: string;
57
57
  } | {
58
58
  page: "workspace";
59
- path: "environment" | "cookies" | "settings";
59
+ path: "environment" | "cookies" | "settings" | "get-started";
60
60
  } | {
61
61
  page: "example";
62
62
  documentSlug?: string;
@@ -46,7 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
46
46
  documentSlug?: string;
47
47
  } | {
48
48
  page: "workspace";
49
- path: "environment" | "cookies" | "settings";
49
+ path: "environment" | "cookies" | "settings" | "get-started";
50
50
  } | {
51
51
  page: "example";
52
52
  documentSlug?: string;
@@ -80,7 +80,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
80
80
  documentSlug?: string;
81
81
  } | {
82
82
  page: "workspace";
83
- path: "environment" | "cookies" | "settings";
83
+ path: "environment" | "cookies" | "settings" | "get-started";
84
84
  } | {
85
85
  page: "example";
86
86
  documentSlug?: string;
@@ -8,13 +8,13 @@ type __VLS_Props = {
8
8
  appVersion: string;
9
9
  };
10
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ openCommandPalette: () => any;
11
12
  addRequest: () => any;
12
13
  sendRequest: () => any;
13
- openCommandPalette: () => any;
14
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onOpenCommandPalette?: (() => any) | undefined;
15
16
  onAddRequest?: (() => any) | undefined;
16
17
  onSendRequest?: (() => any) | undefined;
17
- onOpenCommandPalette?: (() => any) | undefined;
18
18
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  declare const _default: typeof __VLS_export;
20
20
  export default _default;
@@ -2,9 +2,9 @@ import { type ModalState } from '@scalar/components';
2
2
  type __VLS_Props = {
3
3
  modalState: ModalState;
4
4
  };
5
- declare var __VLS_13: {};
5
+ declare var __VLS_7: {};
6
6
  type __VLS_Slots = {} & {
7
- default?: (props: typeof __VLS_13) => any;
7
+ default?: (props: typeof __VLS_7) => any;
8
8
  };
9
9
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
10
  close: () => any;
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"names":[],"mappings":"AAkLA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAW3B,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAkJ9C,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAOhD,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ModalClientContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"names":[],"mappings":"AA0KA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAI3B,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAgI9C,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAO/C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import ModalClientContainer_vue_vue_type_script_setup_true_lang_default from "./ModalClientContainer.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/v2/components/modals/ModalClientContainer.vue
5
- var ModalClientContainer_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6118685a"]]);
5
+ var ModalClientContainer_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ModalClientContainer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ae5e8531"]]);
6
6
  //#endregion
7
7
  export { ModalClientContainer_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContainer.vue.js","names":[],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n addScalarClassesToHeadless,\n ScalarTeleportRoot,\n type ModalState,\n} from '@scalar/components'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport {\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n ref,\n useId,\n watch,\n} from 'vue'\n\nconst props = defineProps<{ modalState: ModalState }>()\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst client = ref<HTMLElement | null>(null)\nconst id = useId()\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: `#${id}`,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <Transition name=\"scalar-client-fade\">\n <div\n v-show=\"modalState.open\"\n class=\"scalar scalar-app z-overlay relative\">\n <div class=\"scalar-container\">\n <div\n :id=\"id\"\n ref=\"client\"\n aria-label=\"API Client\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n </Transition>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: visible;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n\n.scalar-client-fade-enter-active,\n.scalar-client-fade-leave-active {\n transition: opacity 0.35s ease;\n}\n\n.scalar-client-fade-enter-from,\n.scalar-client-fade-leave-to {\n opacity: 0;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ModalClientContainer.vue.js","names":[],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n addScalarClassesToHeadless,\n ScalarTeleportRoot,\n type ModalState,\n} from '@scalar/components'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nconst props = defineProps<{ modalState: ModalState }>()\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n aria-label=\"API Client\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":""}
@@ -1,10 +1,8 @@
1
- import { Transition, createBlock, createElementVNode, createVNode, defineComponent, mergeProps, nextTick, onBeforeMount, onBeforeUnmount, openBlock, ref, renderSlot, unref, useId, vShow, watch, withCtx, withDirectives } from "vue";
1
+ import { createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, onBeforeMount, onBeforeUnmount, openBlock, ref, renderSlot, unref, watch, withCtx } from "vue";
2
2
  import { ScalarTeleportRoot, addScalarClassesToHeadless } from "@scalar/components";
3
3
  import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
4
4
  //#region src/v2/components/modals/ModalClientContainer.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = { class: "scalar scalar-app z-overlay relative" };
6
- var _hoisted_2 = { class: "scalar-container" };
7
- var _hoisted_3 = ["id"];
8
6
  var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
7
  __name: "ModalClientContainer",
10
8
  props: { modalState: {} },
@@ -13,10 +11,9 @@ var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /* @__PUR
13
11
  const props = __props;
14
12
  const emit = __emit;
15
13
  const client = ref(null);
16
- const id = useId();
17
14
  const { activate: activateFocusTrap, deactivate: deactivateFocusTrap } = useFocusTrap(client, {
18
15
  allowOutsideClick: true,
19
- fallbackFocus: `#${id}`
16
+ fallbackFocus: () => client.value
20
17
  });
21
18
  onBeforeMount(() => addScalarClassesToHeadless());
22
19
  watch(() => props.modalState.open, async (open) => {
@@ -33,26 +30,22 @@ var ModalClientContainer_vue_vue_type_script_setup_true_lang_default = /* @__PUR
33
30
  deactivateFocusTrap();
34
31
  });
35
32
  return (_ctx, _cache) => {
36
- return openBlock(), createBlock(Transition, { name: "scalar-client-fade" }, {
37
- default: withCtx(() => [withDirectives(createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("div", mergeProps({
38
- id: unref(id),
39
- ref_key: "client",
40
- ref: client,
41
- "aria-label": "API Client",
42
- "aria-modal": "true"
43
- }, _ctx.$attrs, {
44
- class: "scalar-app-layout scalar-client",
45
- role: "dialog",
46
- tabindex: "-1"
47
- }), [createVNode(unref(ScalarTeleportRoot), null, {
48
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
49
- _: 3
50
- })], 16, _hoisted_3), createElementVNode("div", {
51
- class: "scalar-app-exit",
52
- onClick: _cache[0] || (_cache[0] = ($event) => __props.modalState.hide())
53
- })])], 512), [[vShow, __props.modalState.open]])]),
33
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", { class: normalizeClass(["scalar-container", { "scalar-client--open": __props.modalState.open }]) }, [createElementVNode("div", mergeProps({
34
+ ref_key: "client",
35
+ ref: client,
36
+ "aria-label": "API Client",
37
+ "aria-modal": "true"
38
+ }, _ctx.$attrs, {
39
+ class: "scalar-app-layout scalar-client",
40
+ role: "dialog",
41
+ tabindex: "-1"
42
+ }), [createVNode(unref(ScalarTeleportRoot), null, {
43
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
54
44
  _: 3
55
- });
45
+ })], 16), createElementVNode("div", {
46
+ class: "scalar-app-exit",
47
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.modalState.hide())
48
+ })], 2)]);
56
49
  };
57
50
  }
58
51
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContainer.vue.script.js","names":["$attrs"],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n addScalarClassesToHeadless,\n ScalarTeleportRoot,\n type ModalState,\n} from '@scalar/components'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport {\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n ref,\n useId,\n watch,\n} from 'vue'\n\nconst props = defineProps<{ modalState: ModalState }>()\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst client = ref<HTMLElement | null>(null)\nconst id = useId()\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: `#${id}`,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <Transition name=\"scalar-client-fade\">\n <div\n v-show=\"modalState.open\"\n class=\"scalar scalar-app z-overlay relative\">\n <div class=\"scalar-container\">\n <div\n :id=\"id\"\n ref=\"client\"\n aria-label=\"API Client\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n </Transition>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: visible;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n\n.scalar-client-fade-enter-active,\n.scalar-client-fade-leave-active {\n transition: opacity 0.35s ease;\n}\n\n.scalar-client-fade-enter-from,\n.scalar-client-fade-leave-to {\n opacity: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;EAgBA,MAAM,QAAQ;EACd,MAAM,OAAO;EAKb,MAAM,SAAS,IAAwB,KAAI;EAC3C,MAAM,KAAK,OAAM;EAEjB,MAAM,EAAE,UAAU,mBAAmB,YAAY,wBAC/C,aAAa,QAAQ;GACnB,mBAAmB;GACnB,eAAe,IAAI;GACpB,CAAA;AAGH,sBAAoB,4BAA4B,CAAA;AAGhD,cACQ,MAAM,WAAW,MACvB,OAAO,SAAS;AACd,OAAI,MAAM;AACR,UAAM,UAAS;AACf,uBAAkB;AAClB,SAAK,OAAM;UACN;AACL,yBAAoB;AACpB,SAAK,QAAO;;KAGhB,EAAE,WAAW,OAAO,CACtB;AAGA,wBAAsB;AACpB,wBAAoB;IACrB;;uBAIC,YAyBa,YAAA,EAzBD,MAAK,sBAAoB,EAAA;2BAwB7B,CAAA,eAvBN,mBAuBM,OAvBN,YAuBM,CApBJ,mBAmBM,OAnBN,YAmBM,CAlBJ,mBAYM,OAZN,WAYM;KAXH,IAAI,MAAA,GAAE;cACH;KAAJ,KAAI;KACJ,cAAW;KACX,cAAW;OACHA,KAAAA,QAAM;KACd,OAAM;KACN,MAAK;KACL,UAAS;SACT,YAEqB,MAAA,mBAAA,EAAA,MAAA;4BADX,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA;;0BAKZ,mBAE+B,OAAA;KAD7B,OAAM;KACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,WAAW,MAAI;0BApBnB,QAAA,WAAW,KAAI,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"ModalClientContainer.vue.script.js","names":["$attrs"],"sources":["../../../../src/v2/components/modals/ModalClientContainer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n addScalarClassesToHeadless,\n ScalarTeleportRoot,\n type ModalState,\n} from '@scalar/components'\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap'\nimport { nextTick, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'\n\nconst props = defineProps<{ modalState: ModalState }>()\nconst emit = defineEmits<{\n (e: 'open'): void\n (e: 'close'): void\n}>()\n\nconst client = ref<HTMLElement | null>(null)\n\nconst { activate: activateFocusTrap, deactivate: deactivateFocusTrap } =\n useFocusTrap(client, {\n allowOutsideClick: true,\n fallbackFocus: () => client.value as HTMLElement,\n })\n\n// ensure scalar classes exist on headless-ui root\nonBeforeMount(() => addScalarClassesToHeadless())\n\n// manage the focus trap and emit lifecycle events\nwatch(\n () => props.modalState.open,\n async (open) => {\n if (open) {\n await nextTick()\n activateFocusTrap()\n emit('open')\n } else {\n deactivateFocusTrap()\n emit('close')\n }\n },\n { immediate: false },\n)\n\n// best-effort cleanup on unmount\nonBeforeUnmount(() => {\n deactivateFocusTrap()\n})\n</script>\n\n<template>\n <div class=\"scalar scalar-app z-overlay relative\">\n <div\n class=\"scalar-container\"\n :class=\"{ 'scalar-client--open': modalState.open }\">\n <div\n ref=\"client\"\n aria-label=\"API Client\"\n aria-modal=\"true\"\n v-bind=\"$attrs\"\n class=\"scalar-app-layout scalar-client\"\n role=\"dialog\"\n tabindex=\"-1\">\n <ScalarTeleportRoot>\n <slot />\n </ScalarTeleportRoot>\n </div>\n\n <!-- overlay / exit area -->\n <div\n class=\"scalar-app-exit\"\n @click=\"modalState.hide()\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.scalar .scalar-app-layout {\n background: var(--scalar-background-1);\n height: calc(100% - 120px);\n max-width: 1390px;\n width: 100%;\n margin: auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n/**\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar .scalar-app-layout {\n height: 100%;\n max-height: 90svh;\n }\n}\n\n.scalar .scalar-app-exit {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: #00000038;\n cursor: pointer;\n z-index: -1;\n}\n\n.dark-mode .scalar .scalar-app-exit {\n background: rgba(0, 0, 0, 0.45);\n}\n\n.scalar .scalar-app-exit:before {\n font-family: sans-serif;\n position: absolute;\n top: 0;\n right: 12px;\n font-size: 30px;\n font-weight: 100;\n line-height: 50px;\n text-align: center;\n color: white;\n opacity: 0.6;\n}\n\n.scalar .scalar-app-exit:hover:before {\n opacity: 1;\n}\n\n/* container */\n.scalar-container {\n overflow: hidden;\n visibility: hidden;\n position: fixed;\n bottom: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n will-change: opacity;\n transition:\n opacity 0.35s ease,\n visibility 0s linear 0.35s;\n}\n\n.scalar-container.scalar-client--open {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transition: opacity 0.35s ease;\n}\n\n.scalar .url-form-input {\n min-height: auto !important;\n}\n\n.scalar .scalar-container {\n line-height: normal;\n}\n</style>\n"],"mappings":";;;;;;;;;;EASA,MAAM,QAAQ;EACd,MAAM,OAAO;EAKb,MAAM,SAAS,IAAwB,KAAI;EAE3C,MAAM,EAAE,UAAU,mBAAmB,YAAY,wBAC/C,aAAa,QAAQ;GACnB,mBAAmB;GACnB,qBAAqB,OAAO;GAC7B,CAAA;AAGH,sBAAoB,4BAA4B,CAAA;AAGhD,cACQ,MAAM,WAAW,MACvB,OAAO,SAAS;AACd,OAAI,MAAM;AACR,UAAM,UAAS;AACf,uBAAkB;AAClB,SAAK,OAAM;UACN;AACL,yBAAoB;AACpB,SAAK,QAAO;;KAGhB,EAAE,WAAW,OAAO,CACtB;AAGA,wBAAsB;AACpB,wBAAoB;IACrB;;uBAIC,mBAsBM,OAtBN,YAsBM,CArBJ,mBAoBM,OAAA,EAnBJ,OAAK,eAAA,CAAC,oBAAkB,EAAA,uBACS,QAAA,WAAW,MAAI,CAAA,CAAA,EAAA,EAAA,CAChD,mBAWM,OAXN,WAWM;aAVA;IAAJ,KAAI;IACJ,cAAW;IACX,cAAW;MACHA,KAAAA,QAAM;IACd,OAAM;IACN,MAAK;IACL,UAAS;QACT,YAEqB,MAAA,mBAAA,EAAA,MAAA;2BADX,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA;;aAKZ,mBAE+B,OAAA;IAD7B,OAAM;IACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,WAAW,MAAI"}
@@ -20,6 +20,7 @@ export type ServerDropdownProps = {
20
20
  layout: ClientLayout;
21
21
  };
22
22
  declare const __VLS_export: import("vue").DefineComponent<ServerDropdownProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
+ "update:open": (value: boolean) => any;
23
24
  "update:variable": (payload: {
24
25
  index: number;
25
26
  key: string;
@@ -31,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<ServerDropdownProps, {
31
32
  meta: ServerMeta;
32
33
  }) => any;
33
34
  "update:servers": () => any;
34
- "update:open": (value: boolean) => any;
35
35
  }, string, import("vue").PublicProps, Readonly<ServerDropdownProps> & Readonly<{
36
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
36
37
  "onUpdate:variable"?: ((payload: {
37
38
  index: number;
38
39
  key: string;
@@ -44,6 +45,5 @@ declare const __VLS_export: import("vue").DefineComponent<ServerDropdownProps, {
44
45
  meta: ServerMeta;
45
46
  }) => any) | undefined;
46
47
  "onUpdate:servers"?: (() => any) | undefined;
47
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
48
48
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
49
49
  //# sourceMappingURL=ServerDropdown.vue.d.ts.map
@@ -4,7 +4,7 @@ import SidebarMenu_default from "./SidebarMenu.vue.js";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, isRef, mergeModels, normalizeClass, normalizeProps, openBlock, ref, renderSlot, unref, useModel, useSlots, withCtx } from "vue";
5
5
  import { ScalarIconButton, ScalarSidebarSearchInput } from "@scalar/components";
6
6
  import { ScalarIconFileDashed, ScalarIconMagnifyingGlass } from "@scalar/icons";
7
- import { ScalarSidebar } from "@scalar/sidebar";
7
+ import { ScalarSidebar as ScalarSidebar$1 } from "@scalar/sidebar";
8
8
  //#region src/v2/components/sidebar/Sidebar.vue?vue&type=script&setup=true&lang.ts
9
9
  var _hoisted_1 = { key: 1 };
10
10
  var Sidebar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -56,7 +56,7 @@ var Sidebar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
56
56
  "onUpdate:width": _cache[6] || (_cache[6] = ($event) => sidebarWidth.value = $event),
57
57
  class: "flex flex-col"
58
58
  }, {
59
- default: withCtx(() => [createVNode(unref(ScalarSidebar), {
59
+ default: withCtx(() => [createVNode(unref(ScalarSidebar$1), {
60
60
  class: "flex w-auto flex-1",
61
61
  indent: 20,
62
62
  isDraggable: __props.layout !== "modal",