@scalar/api-client 2.41.0 → 2.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/hooks/useClientConfig.d.ts +3 -3
  3. package/dist/style.css +48 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -0
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +24 -10
  8. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  9. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +18 -7
  11. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js.map +1 -1
  12. package/dist/v2/constants.js +1 -1
  13. package/dist/v2/features/app/helpers/routes.d.ts +5 -0
  14. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  15. package/dist/v2/features/app/helpers/routes.js +5 -0
  16. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  17. package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.d.ts +12 -0
  18. package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.d.ts.map +1 -0
  19. package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.js +9 -0
  20. package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.js.map +1 -0
  21. package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.script.js +174 -0
  22. package/dist/v2/features/collection/components/DocumentScriptsEditors.vue.script.js.map +1 -0
  23. package/dist/v2/features/collection/components/Scripts.vue.d.ts +16 -0
  24. package/dist/v2/features/collection/components/Scripts.vue.d.ts.map +1 -0
  25. package/dist/v2/features/collection/components/Scripts.vue.js +7 -0
  26. package/dist/v2/features/collection/components/Scripts.vue.js.map +1 -0
  27. package/dist/v2/features/collection/components/Scripts.vue.script.js +47 -0
  28. package/dist/v2/features/collection/components/Scripts.vue.script.js.map +1 -0
  29. package/dist/v2/features/collection/components/Tabs.vue.d.ts.map +1 -1
  30. package/dist/v2/features/collection/components/Tabs.vue.js.map +1 -1
  31. package/dist/v2/features/collection/components/Tabs.vue.script.js +2 -1
  32. package/dist/v2/features/collection/components/Tabs.vue.script.js.map +1 -1
  33. package/dist/v2/features/modal/index.d.ts +1 -0
  34. package/dist/v2/features/modal/index.d.ts.map +1 -1
  35. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  36. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  37. package/dist/v2/features/operation/Operation.vue.script.js +3 -1
  38. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  39. package/dist/v2/workspace-events.d.ts.map +1 -1
  40. package/dist/v2/workspace-events.js +1 -0
  41. package/dist/v2/workspace-events.js.map +1 -1
  42. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
  43. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAelF,OAAO,KAAK,EAAE,0BA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W,CAAA;IACxC,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GACD;IACE,cAAc,EAAE,WAAW,CAAA;IAC3B,QAAQ,EAAE,IAAI,CAAA;CACf,CACJ,CAAA;AAEH,MAAM,MAAM,0BAA0B,GAClC,WAAW,GACX,eAAe,GACf,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,CAAA;AAEjB,kFAAkF;AAClF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAlBK,UAAU,GAAG,WAAW;kCAC9B,iBAAiB;;wCAGX,WAAW;kCACjB,IAAI;;wCALE,UAAU,GAAG,WAAW;kCAC9B,iBAAiB;;wCAGX,WAAW;kCACjB,IAAI;;;;;;;;;;;;;;;;;;;;;oCALE,UAAU,GAAG,WAAW;8BAC9B,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;oCALE,UAAU,GAAG,WAAW;8BAC9B,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;;;;;;;;;;;;;;;;;;;gCALE,UAAU,GAAG,WAAW;0BAC9B,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;gCALE,UAAU,GAAG,WAAW;0BAC9B,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;;;;;;;;IAyKM,CAAA"}
@@ -90,6 +90,11 @@ var ROUTES = [{
90
90
  name: "document.settings",
91
91
  path: "settings",
92
92
  component: Settings_default
93
+ },
94
+ {
95
+ name: "document.scripts",
96
+ path: "scripts",
97
+ component: () => import("../../collection/components/Scripts.vue.js")
93
98
  }
94
99
  ]
95
100
  }]
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","names":[],"sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { mergeSearchParams } from '@scalar/helpers/url/merge-urls'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { Theme } from '@scalar/themes'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport type { RouteRecordRaw } from 'vue-router'\n\nimport Authentication from '@/v2/features/collection/components/Authentication.vue'\nimport Cookies from '@/v2/features/collection/components/Cookies.vue'\nimport { Editor } from '@/v2/features/collection/components/Editor'\nimport Environment from '@/v2/features/collection/components/Environment.vue'\nimport Overview from '@/v2/features/collection/components/Overview.vue'\nimport Servers from '@/v2/features/collection/components/Servers.vue'\nimport Settings from '@/v2/features/collection/components/Settings.vue'\nimport DocumentCollection from '@/v2/features/collection/DocumentCollection.vue'\nimport OperationCollection from '@/v2/features/collection/OperationCollection.vue'\nimport WorkspaceCollection from '@/v2/features/collection/WorkspaceCollection.vue'\nimport { Operation } from '@/v2/features/operation'\nimport { workspaceStorage } from '@/v2/helpers/storage'\nimport type { ImportDocumentFromRegistry } from '@/v2/types/configuration'\nimport type { ClientLayout } from '@/v2/types/layout'\n\n/** These props are provided at the route level */\nexport type RouteProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document */\n document: WorkspaceDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** The currently active workspace */\n activeWorkspace: { id: string; label: string }\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Custom themes available to the team */\n customThemes?: Theme[]\n /** The currently selected theme styles string */\n currentTheme?: string\n /** Whether the current color mode is dark */\n isDarkMode?: boolean\n /**\n * Fetches the full document from registry by meta. When provided, registry meta takes priority\n * over x-scalar-original-source-url when syncing. Returns the document as a plain object.\n */\n fetchRegistryDocument?: ImportDocumentFromRegistry\n /** Whether telemetry is enabled */\n telemetry?: boolean\n /** Updates the telemetry enabled state */\n onUpdateTelemetry?: (value: boolean) => void\n}\n\n/** When in the collections pages */\nexport type CollectionProps = RouteProps &\n (\n | {\n collectionType: 'document' | 'operation'\n document: WorkspaceDocument\n }\n | {\n collectionType: 'workspace'\n document: null\n }\n )\n\nexport type ScalarClientAppRouteParams =\n | 'namespace'\n | 'workspaceSlug'\n | 'documentSlug'\n | 'pathEncoded'\n | 'method'\n | 'exampleName'\n\n/** Routes for the API client app and web, the same as modal + workspace routes */\nexport const ROUTES = [\n {\n path: '/@:namespace/:workspaceSlug',\n children: [\n {\n path: 'document/:documentSlug',\n children: [\n // Example page\n {\n path: 'path/:pathEncoded/method/:method',\n children: [\n {\n name: 'example',\n path: 'example/:exampleName',\n component: Operation,\n },\n {\n name: 'operation',\n path: '',\n component: OperationCollection,\n redirect: {\n name: 'operation.overview',\n },\n children: [\n {\n name: 'operation.overview',\n path: 'overview',\n component: Overview,\n },\n {\n name: 'operation.servers',\n path: 'servers',\n component: Servers,\n },\n {\n name: 'operation.authentication',\n path: 'authentication',\n component: Authentication,\n },\n {\n name: 'operation.editor',\n path: 'editor',\n component: Editor,\n },\n ],\n },\n ],\n },\n // Document Page\n {\n name: 'document',\n path: '',\n component: DocumentCollection,\n children: [\n // Redirect to overview\n {\n name: 'document.redirect',\n path: '',\n redirect: {\n name: 'document.overview',\n },\n },\n // Document overview\n {\n name: 'document.overview',\n path: 'overview',\n component: Overview,\n },\n // Document servers\n {\n name: 'document.servers',\n path: 'servers',\n component: Servers,\n },\n // Document environment\n {\n name: 'document.environment',\n path: 'environment',\n component: Environment,\n },\n // Document authentication\n {\n name: 'document.authentication',\n path: 'authentication',\n component: Authentication,\n },\n // Document cookies\n {\n name: 'document.cookies',\n path: 'cookies',\n component: Cookies,\n },\n // Document settings\n {\n name: 'document.settings',\n path: 'settings',\n component: Settings,\n },\n ],\n },\n ],\n },\n // Workspace page\n {\n name: 'workspace',\n path: '',\n component: WorkspaceCollection,\n children: [\n // Workspace environment\n {\n name: 'workspace.environment',\n path: 'environment',\n component: Environment,\n },\n // Workspace cookies\n {\n name: 'workspace.cookies',\n path: 'cookies',\n component: Cookies,\n },\n // Workspace settings\n {\n name: 'workspace.settings',\n path: 'settings',\n component: Settings,\n },\n ],\n },\n ],\n },\n {\n path: '/:pathMatch(.*)*',\n redirect: () => {\n const DEFAULT_PATH = '/@local/default/document/drafts/overview'\n const lastPath = workspaceStorage.getLastPath() ?? DEFAULT_PATH\n\n // Set the default path to the last path so we don't go to an inifite loop if the last path is invalid\n workspaceStorage.setCurrentPath(DEFAULT_PATH)\n\n const url = new URL(lastPath, 'http://example.com')\n\n const queryParameters = new URLSearchParams(window.location.search)\n\n //Merge the query parameters with the last path\n const mergedSearchParams = mergeSearchParams(url.searchParams, queryParameters)\n\n // Preserve all query paramters\n return `${url.pathname}?${mergedSearchParams.toString()}`\n },\n },\n] satisfies RouteRecordRaw[]\n"],"mappings":";;;;;;;;;;;;;;;AAwFA,IAAa,SAAS,CACpB;CACE,MAAM;CACN,UAAU,CACR;EACE,MAAM;EACN,UAAU,CAER;GACE,MAAM;GACN,UAAU,CACR;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ,EACD;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACX,UAAU,EACR,MAAM,sBACP;IACD,UAAU;KACR;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACD;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACD;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACD;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACF;IACF,CACF;GACF,EAED;GACE,MAAM;GACN,MAAM;GACN,WAAW;GACX,UAAU;IAER;KACE,MAAM;KACN,MAAM;KACN,UAAU,EACR,MAAM,qBACP;KACF;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IACF;GACF,CACF;EACF,EAED;EACE,MAAM;EACN,MAAM;EACN,WAAW;EACX,UAAU;GAER;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ;GAED;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ;GAED;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ;GACF;EACF,CACF;CACF,EACD;CACE,MAAM;CACN,gBAAgB;EACd,MAAM,eAAe;EACrB,MAAM,WAAW,iBAAiB,aAAa,IAAI;AAGnD,mBAAiB,eAAe,aAAa;EAE7C,MAAM,MAAM,IAAI,IAAI,UAAU,qBAAqB;EAEnD,MAAM,kBAAkB,IAAI,gBAAgB,OAAO,SAAS,OAAO;EAGnE,MAAM,qBAAqB,kBAAkB,IAAI,cAAc,gBAAgB;AAG/E,SAAO,GAAG,IAAI,SAAS,GAAG,mBAAmB,UAAU;;CAE1D,CACF"}
1
+ {"version":3,"file":"routes.js","names":[],"sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { mergeSearchParams } from '@scalar/helpers/url/merge-urls'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { Theme } from '@scalar/themes'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport type { RouteRecordRaw } from 'vue-router'\n\nimport Authentication from '@/v2/features/collection/components/Authentication.vue'\nimport Cookies from '@/v2/features/collection/components/Cookies.vue'\nimport { Editor } from '@/v2/features/collection/components/Editor'\nimport Environment from '@/v2/features/collection/components/Environment.vue'\nimport Overview from '@/v2/features/collection/components/Overview.vue'\nimport Servers from '@/v2/features/collection/components/Servers.vue'\nimport Settings from '@/v2/features/collection/components/Settings.vue'\nimport DocumentCollection from '@/v2/features/collection/DocumentCollection.vue'\nimport OperationCollection from '@/v2/features/collection/OperationCollection.vue'\nimport WorkspaceCollection from '@/v2/features/collection/WorkspaceCollection.vue'\nimport { Operation } from '@/v2/features/operation'\nimport { workspaceStorage } from '@/v2/helpers/storage'\nimport type { ImportDocumentFromRegistry } from '@/v2/types/configuration'\nimport type { ClientLayout } from '@/v2/types/layout'\n\n/** These props are provided at the route level */\nexport type RouteProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document */\n document: WorkspaceDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** The currently active workspace */\n activeWorkspace: { id: string; label: string }\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Custom themes available to the team */\n customThemes?: Theme[]\n /** The currently selected theme styles string */\n currentTheme?: string\n /** Whether the current color mode is dark */\n isDarkMode?: boolean\n /**\n * Fetches the full document from registry by meta. When provided, registry meta takes priority\n * over x-scalar-original-source-url when syncing. Returns the document as a plain object.\n */\n fetchRegistryDocument?: ImportDocumentFromRegistry\n /** Whether telemetry is enabled */\n telemetry?: boolean\n /** Updates the telemetry enabled state */\n onUpdateTelemetry?: (value: boolean) => void\n}\n\n/** When in the collections pages */\nexport type CollectionProps = RouteProps &\n (\n | {\n collectionType: 'document' | 'operation'\n document: WorkspaceDocument\n }\n | {\n collectionType: 'workspace'\n document: null\n }\n )\n\nexport type ScalarClientAppRouteParams =\n | 'namespace'\n | 'workspaceSlug'\n | 'documentSlug'\n | 'pathEncoded'\n | 'method'\n | 'exampleName'\n\n/** Routes for the API client app and web, the same as modal + workspace routes */\nexport const ROUTES = [\n {\n path: '/@:namespace/:workspaceSlug',\n children: [\n {\n path: 'document/:documentSlug',\n children: [\n // Example page\n {\n path: 'path/:pathEncoded/method/:method',\n children: [\n {\n name: 'example',\n path: 'example/:exampleName',\n component: Operation,\n },\n {\n name: 'operation',\n path: '',\n component: OperationCollection,\n redirect: {\n name: 'operation.overview',\n },\n children: [\n {\n name: 'operation.overview',\n path: 'overview',\n component: Overview,\n },\n {\n name: 'operation.servers',\n path: 'servers',\n component: Servers,\n },\n {\n name: 'operation.authentication',\n path: 'authentication',\n component: Authentication,\n },\n {\n name: 'operation.editor',\n path: 'editor',\n component: Editor,\n },\n ],\n },\n ],\n },\n // Document Page\n {\n name: 'document',\n path: '',\n component: DocumentCollection,\n children: [\n // Redirect to overview\n {\n name: 'document.redirect',\n path: '',\n redirect: {\n name: 'document.overview',\n },\n },\n // Document overview\n {\n name: 'document.overview',\n path: 'overview',\n component: Overview,\n },\n // Document servers\n {\n name: 'document.servers',\n path: 'servers',\n component: Servers,\n },\n // Document environment\n {\n name: 'document.environment',\n path: 'environment',\n component: Environment,\n },\n // Document authentication\n {\n name: 'document.authentication',\n path: 'authentication',\n component: Authentication,\n },\n // Document cookies\n {\n name: 'document.cookies',\n path: 'cookies',\n component: Cookies,\n },\n // Document settings\n {\n name: 'document.settings',\n path: 'settings',\n component: Settings,\n },\n // Document scripts (pre-request / post-response)\n {\n name: 'document.scripts',\n path: 'scripts',\n component: () => import('@/v2/features/collection/components/Scripts.vue'),\n },\n ],\n },\n ],\n },\n // Workspace page\n {\n name: 'workspace',\n path: '',\n component: WorkspaceCollection,\n children: [\n // Workspace environment\n {\n name: 'workspace.environment',\n path: 'environment',\n component: Environment,\n },\n // Workspace cookies\n {\n name: 'workspace.cookies',\n path: 'cookies',\n component: Cookies,\n },\n // Workspace settings\n {\n name: 'workspace.settings',\n path: 'settings',\n component: Settings,\n },\n ],\n },\n ],\n },\n {\n path: '/:pathMatch(.*)*',\n redirect: () => {\n const DEFAULT_PATH = '/@local/default/document/drafts/overview'\n const lastPath = workspaceStorage.getLastPath() ?? DEFAULT_PATH\n\n // Set the default path to the last path so we don't go to an inifite loop if the last path is invalid\n workspaceStorage.setCurrentPath(DEFAULT_PATH)\n\n const url = new URL(lastPath, 'http://example.com')\n\n const queryParameters = new URLSearchParams(window.location.search)\n\n //Merge the query parameters with the last path\n const mergedSearchParams = mergeSearchParams(url.searchParams, queryParameters)\n\n // Preserve all query paramters\n return `${url.pathname}?${mergedSearchParams.toString()}`\n },\n },\n] satisfies RouteRecordRaw[]\n"],"mappings":";;;;;;;;;;;;;;;AAwFA,IAAa,SAAS,CACpB;CACE,MAAM;CACN,UAAU,CACR;EACE,MAAM;EACN,UAAU,CAER;GACE,MAAM;GACN,UAAU,CACR;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ,EACD;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACX,UAAU,EACR,MAAM,sBACP;IACD,UAAU;KACR;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACD;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACD;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACD;MACE,MAAM;MACN,MAAM;MACN,WAAW;MACZ;KACF;IACF,CACF;GACF,EAED;GACE,MAAM;GACN,MAAM;GACN,WAAW;GACX,UAAU;IAER;KACE,MAAM;KACN,MAAM;KACN,UAAU,EACR,MAAM,qBACP;KACF;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,WAAW;KACZ;IAED;KACE,MAAM;KACN,MAAM;KACN,iBAAiB,OAAO;KACzB;IACF;GACF,CACF;EACF,EAED;EACE,MAAM;EACN,MAAM;EACN,WAAW;EACX,UAAU;GAER;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ;GAED;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ;GAED;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACZ;GACF;EACF,CACF;CACF,EACD;CACE,MAAM;CACN,gBAAgB;EACd,MAAM,eAAe;EACrB,MAAM,WAAW,iBAAiB,aAAa,IAAI;AAGnD,mBAAiB,eAAe,aAAa;EAE7C,MAAM,MAAM,IAAI,IAAI,UAAU,qBAAqB;EAEnD,MAAM,kBAAkB,IAAI,gBAAgB,OAAO,SAAS,OAAO;EAGnE,MAAM,qBAAqB,kBAAkB,IAAI,cAAc,gBAAgB;AAG/E,SAAO,GAAG,IAAI,SAAS,GAAG,mBAAmB,UAAU;;CAE1D,CACF"}
@@ -0,0 +1,12 @@
1
+ import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
2
+ type __VLS_Props = {
3
+ document: WorkspaceDocument | null;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ "update:extension": (payload: Record<string, unknown>) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ "onUpdate:extension"?: ((payload: Record<string, unknown>) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ //# sourceMappingURL=DocumentScriptsEditors.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentScriptsEditors.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/DocumentScriptsEditors.vue"],"names":[],"mappings":"AAoPA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAWxE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AAkXF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,9 @@
1
+ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.js";
2
+ import DocumentScriptsEditors_vue_vue_type_script_setup_true_lang_default from "./DocumentScriptsEditors.vue.script.js";
3
+ /* empty css */
4
+ //#region src/v2/features/collection/components/DocumentScriptsEditors.vue
5
+ var DocumentScriptsEditors_default = /* @__PURE__ */ _plugin_vue_export_helper_default(DocumentScriptsEditors_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-8c8fa790"]]);
6
+ //#endregion
7
+ export { DocumentScriptsEditors_default as default };
8
+
9
+ //# sourceMappingURL=DocumentScriptsEditors.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentScriptsEditors.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/DocumentScriptsEditors.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCheckCircle } from '@scalar/icons'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport * as monaco from 'monaco-editor'\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n} from 'vue'\n\nconst { document } = defineProps<{\n document: WorkspaceDocument | null\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:extension', payload: Record<string, unknown>): void\n}>()\n\ntype ScriptTab = 'pre' | 'post'\n\nconst activeTab = ref<ScriptTab>('pre')\nconst editorContainerRef = ref<HTMLElement | null>(null)\n\nconst editor = shallowRef<monaco.editor.IStandaloneCodeEditor | null>(null)\nconst preModel = shallowRef<monaco.editor.ITextModel | null>(null)\nconst postModel = shallowRef<monaco.editor.ITextModel | null>(null)\n\n/** Local content state so the indicator updates immediately on type, before document prop syncs */\nconst preHasContent = ref(false)\nconst postHasContent = ref(false)\nconst preValue = (): string => (document?.['x-pre-request'] as string) ?? ''\nconst postValue = (): string => (document?.['x-post-response'] as string) ?? ''\n\n/** Content indicators: true when the script has non-whitespace content */\nconst hasPreContent = computed(\n () => preHasContent.value || preValue().trim().length > 0,\n)\n\nconst hasPostContent = computed(\n () => postHasContent.value || postValue().trim().length > 0,\n)\n\n/**\n * Creates Monaco text models for pre-request and post-response scripts.\n * Each model maintains its own content, undo history, and cursor state.\n * Change listeners emit updates to sync content with the parent component.\n */\nconst createModels = () => {\n preModel.value = monaco.editor.createModel(preValue(), 'javascript')\n postModel.value = monaco.editor.createModel(postValue(), 'javascript')\n\n preHasContent.value = preValue().trim().length > 0\n postHasContent.value = postValue().trim().length > 0\n\n preModel.value.onDidChangeContent(() => {\n const newValue = preModel.value?.getValue() ?? ''\n preHasContent.value = newValue.trim().length > 0\n emit('update:extension', { 'x-pre-request': newValue })\n })\n\n postModel.value.onDidChangeContent(() => {\n const newValue = postModel.value?.getValue() ?? ''\n postHasContent.value = newValue.trim().length > 0\n emit('update:extension', { 'x-post-response': newValue })\n })\n}\n\n/**\n * Initializes the Monaco editor instance with both models.\n * The editor is created once and reused; tab switching swaps models instead of recreating the editor.\n */\nconst createEditor = () => {\n if (!editorContainerRef.value) {\n return\n }\n\n createModels()\n\n const initialModel = activeTab.value === 'pre' ? preModel : postModel\n editor.value = monaco.editor.create(editorContainerRef.value, {\n automaticLayout: true,\n minimap: { enabled: false },\n lineNumbers: 'on',\n scrollBeyondLastLine: false,\n folding: true,\n showFoldingControls: 'always',\n fontSize: 13,\n lineHeight: 20,\n fontFamily: \"'JetBrains Mono', monospace\",\n scrollbar: {\n useShadows: false,\n verticalScrollbarSize: 8,\n horizontalScrollbarSize: 8,\n },\n padding: { top: 12, bottom: 12 },\n renderLineHighlight: 'none',\n wordWrap: 'on',\n model: initialModel.value,\n })\n}\n\n/**\n * Switches the active tab by swapping the model on the existing editor.\n * This preserves each model's undo history, cursor position, and scroll state.\n */\nconst switchTo = (tab: ScriptTab) => {\n if (activeTab.value === tab || !editor.value) {\n return\n }\n activeTab.value = tab\n const model = tab === 'pre' ? preModel : postModel\n if (model.value) {\n editor.value.setModel(model.value)\n }\n}\n\n/** Cleans up Monaco resources when the component unmounts. */\nconst disposeAll = () => {\n preModel.value?.dispose()\n postModel.value?.dispose()\n editor.value?.dispose()\n editor.value = null\n preModel.value = null\n postModel.value = null\n}\n\nonMounted(() => {\n createEditor()\n})\n\nonBeforeUnmount(() => {\n disposeAll()\n})\n\nwatch(\n () => [document?.['x-pre-request'], document?.['x-post-response']] as const,\n ([nextPre, nextPost]) => {\n const preStr = (nextPre as string) ?? ''\n const postStr = (nextPost as string) ?? ''\n preHasContent.value = preStr.trim().length > 0\n postHasContent.value = postStr.trim().length > 0\n\n if (preModel.value && preModel.value.getValue() !== preStr) {\n preModel.value.setValue(preStr)\n }\n if (postModel.value && postModel.value.getValue() !== postStr) {\n postModel.value.setValue(postStr)\n }\n },\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div class=\"document-scripts-editors flex flex-col gap-5\">\n <!-- Tabs with icons and content indicators -->\n <div\n aria-label=\"Script type\"\n class=\"document-scripts-editors__tabs flex shrink-0 gap-0.5 rounded-xl border border-[var(--scalar-border-color)] bg-[var(--scalar-background-2)] p-1\"\n role=\"tablist\">\n <button\n :aria-selected=\"activeTab === 'pre'\"\n class=\"flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-150\"\n :class=\"\n activeTab === 'pre'\n ? 'text-c-1 bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]'\n : 'text-c-2 hover:text-c-1 hover:bg-[var(--scalar-background-3)]'\n \"\n role=\"tab\"\n type=\"button\"\n @click=\"switchTo('pre')\">\n <ScalarIconArrowRight\n aria-hidden=\"true\"\n class=\"size-4 shrink-0 opacity-80\" />\n <span class=\"truncate\">Pre-request</span>\n <span\n v-if=\"hasPreContent\"\n aria-hidden=\"true\"\n class=\"h-2 w-2 shrink-0 rounded-full bg-[var(--scalar-color-green)]\"\n title=\"Has content\" />\n </button>\n <button\n :aria-selected=\"activeTab === 'post'\"\n class=\"flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-150\"\n :class=\"\n activeTab === 'post'\n ? 'text-c-1 bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]'\n : 'text-c-2 hover:text-c-1 hover:bg-[var(--scalar-background-3)]'\n \"\n role=\"tab\"\n type=\"button\"\n @click=\"switchTo('post')\">\n <ScalarIconCheckCircle\n aria-hidden=\"true\"\n class=\"size-4 shrink-0 opacity-80\" />\n <span class=\"truncate\">Post-response</span>\n <span\n v-if=\"hasPostContent\"\n aria-hidden=\"true\"\n class=\"h-2 w-2 shrink-0 rounded-full bg-[var(--scalar-color-green)]\"\n title=\"Has content\" />\n </button>\n </div>\n\n <!-- Description and editor card -->\n <div\n class=\"document-scripts-editors__card flex flex-col overflow-hidden rounded-xl border border-[var(--scalar-border-color)] bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]\">\n <div\n class=\"document-scripts-editors__card-header flex min-h-[4rem] shrink-0 items-center justify-between border-b border-[var(--scalar-border-color)] bg-[var(--scalar-background-2)] px-4 py-3\">\n <p class=\"text-c-2 text-sm leading-snug\">\n <template v-if=\"activeTab === 'pre'\">\n Runs before each request in this document. Use it to set variables,\n headers, or modify the request.\n </template>\n <template v-else>\n Runs after each response. Use it for tests, assertions, or saving\n data from the response.\n </template>\n </p>\n <span\n aria-hidden=\"true\"\n class=\"text-c-2 rounded bg-[var(--scalar-background-3)] px-2 py-1 font-mono text-xs\">\n JavaScript\n </span>\n </div>\n <div\n ref=\"editorContainerRef\"\n class=\"document-scripts-editors__container min-h-[300px] flex-1\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.document-scripts-editors__container {\n min-height: 300px;\n}\n</style>\n"],"mappings":""}
@@ -0,0 +1,174 @@
1
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, shallowRef, unref, watch } from "vue";
2
+ import { ScalarIconArrowRight, ScalarIconCheckCircle } from "@scalar/icons";
3
+ import * as monaco from "monaco-editor";
4
+ //#region src/v2/features/collection/components/DocumentScriptsEditors.vue?vue&type=script&setup=true&lang.ts
5
+ var _hoisted_1 = { class: "document-scripts-editors flex flex-col gap-5" };
6
+ var _hoisted_2 = {
7
+ "aria-label": "Script type",
8
+ class: "document-scripts-editors__tabs flex shrink-0 gap-0.5 rounded-xl border border-[var(--scalar-border-color)] bg-[var(--scalar-background-2)] p-1",
9
+ role: "tablist"
10
+ };
11
+ var _hoisted_3 = ["aria-selected"];
12
+ var _hoisted_4 = {
13
+ key: 0,
14
+ "aria-hidden": "true",
15
+ class: "h-2 w-2 shrink-0 rounded-full bg-[var(--scalar-color-green)]",
16
+ title: "Has content"
17
+ };
18
+ var _hoisted_5 = ["aria-selected"];
19
+ var _hoisted_6 = {
20
+ key: 0,
21
+ "aria-hidden": "true",
22
+ class: "h-2 w-2 shrink-0 rounded-full bg-[var(--scalar-color-green)]",
23
+ title: "Has content"
24
+ };
25
+ var _hoisted_7 = { class: "document-scripts-editors__card flex flex-col overflow-hidden rounded-xl border border-[var(--scalar-border-color)] bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]" };
26
+ var _hoisted_8 = { class: "document-scripts-editors__card-header flex min-h-[4rem] shrink-0 items-center justify-between border-b border-[var(--scalar-border-color)] bg-[var(--scalar-background-2)] px-4 py-3" };
27
+ var _hoisted_9 = { class: "text-c-2 text-sm leading-snug" };
28
+ var DocumentScriptsEditors_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
29
+ __name: "DocumentScriptsEditors",
30
+ props: { document: {} },
31
+ emits: ["update:extension"],
32
+ setup(__props, { emit: __emit }) {
33
+ const emit = __emit;
34
+ const activeTab = ref("pre");
35
+ const editorContainerRef = ref(null);
36
+ const editor = shallowRef(null);
37
+ const preModel = shallowRef(null);
38
+ const postModel = shallowRef(null);
39
+ /** Local content state so the indicator updates immediately on type, before document prop syncs */
40
+ const preHasContent = ref(false);
41
+ const postHasContent = ref(false);
42
+ const preValue = () => __props.document?.["x-pre-request"] ?? "";
43
+ const postValue = () => __props.document?.["x-post-response"] ?? "";
44
+ /** Content indicators: true when the script has non-whitespace content */
45
+ const hasPreContent = computed(() => preHasContent.value || preValue().trim().length > 0);
46
+ const hasPostContent = computed(() => postHasContent.value || postValue().trim().length > 0);
47
+ /**
48
+ * Creates Monaco text models for pre-request and post-response scripts.
49
+ * Each model maintains its own content, undo history, and cursor state.
50
+ * Change listeners emit updates to sync content with the parent component.
51
+ */
52
+ const createModels = () => {
53
+ preModel.value = monaco.editor.createModel(preValue(), "javascript");
54
+ postModel.value = monaco.editor.createModel(postValue(), "javascript");
55
+ preHasContent.value = preValue().trim().length > 0;
56
+ postHasContent.value = postValue().trim().length > 0;
57
+ preModel.value.onDidChangeContent(() => {
58
+ const newValue = preModel.value?.getValue() ?? "";
59
+ preHasContent.value = newValue.trim().length > 0;
60
+ emit("update:extension", { "x-pre-request": newValue });
61
+ });
62
+ postModel.value.onDidChangeContent(() => {
63
+ const newValue = postModel.value?.getValue() ?? "";
64
+ postHasContent.value = newValue.trim().length > 0;
65
+ emit("update:extension", { "x-post-response": newValue });
66
+ });
67
+ };
68
+ /**
69
+ * Initializes the Monaco editor instance with both models.
70
+ * The editor is created once and reused; tab switching swaps models instead of recreating the editor.
71
+ */
72
+ const createEditor = () => {
73
+ if (!editorContainerRef.value) return;
74
+ createModels();
75
+ const initialModel = activeTab.value === "pre" ? preModel : postModel;
76
+ editor.value = monaco.editor.create(editorContainerRef.value, {
77
+ automaticLayout: true,
78
+ minimap: { enabled: false },
79
+ lineNumbers: "on",
80
+ scrollBeyondLastLine: false,
81
+ folding: true,
82
+ showFoldingControls: "always",
83
+ fontSize: 13,
84
+ lineHeight: 20,
85
+ fontFamily: "'JetBrains Mono', monospace",
86
+ scrollbar: {
87
+ useShadows: false,
88
+ verticalScrollbarSize: 8,
89
+ horizontalScrollbarSize: 8
90
+ },
91
+ padding: {
92
+ top: 12,
93
+ bottom: 12
94
+ },
95
+ renderLineHighlight: "none",
96
+ wordWrap: "on",
97
+ model: initialModel.value
98
+ });
99
+ };
100
+ /**
101
+ * Switches the active tab by swapping the model on the existing editor.
102
+ * This preserves each model's undo history, cursor position, and scroll state.
103
+ */
104
+ const switchTo = (tab) => {
105
+ if (activeTab.value === tab || !editor.value) return;
106
+ activeTab.value = tab;
107
+ const model = tab === "pre" ? preModel : postModel;
108
+ if (model.value) editor.value.setModel(model.value);
109
+ };
110
+ /** Cleans up Monaco resources when the component unmounts. */
111
+ const disposeAll = () => {
112
+ preModel.value?.dispose();
113
+ postModel.value?.dispose();
114
+ editor.value?.dispose();
115
+ editor.value = null;
116
+ preModel.value = null;
117
+ postModel.value = null;
118
+ };
119
+ onMounted(() => {
120
+ createEditor();
121
+ });
122
+ onBeforeUnmount(() => {
123
+ disposeAll();
124
+ });
125
+ watch(() => [__props.document?.["x-pre-request"], __props.document?.["x-post-response"]], ([nextPre, nextPost]) => {
126
+ const preStr = nextPre ?? "";
127
+ const postStr = nextPost ?? "";
128
+ preHasContent.value = preStr.trim().length > 0;
129
+ postHasContent.value = postStr.trim().length > 0;
130
+ if (preModel.value && preModel.value.getValue() !== preStr) preModel.value.setValue(preStr);
131
+ if (postModel.value && postModel.value.getValue() !== postStr) postModel.value.setValue(postStr);
132
+ }, { flush: "post" });
133
+ return (_ctx, _cache) => {
134
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("button", {
135
+ "aria-selected": activeTab.value === "pre",
136
+ class: normalizeClass(["flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-150", activeTab.value === "pre" ? "text-c-1 bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]" : "text-c-2 hover:text-c-1 hover:bg-[var(--scalar-background-3)]"]),
137
+ role: "tab",
138
+ type: "button",
139
+ onClick: _cache[0] || (_cache[0] = ($event) => switchTo("pre"))
140
+ }, [
141
+ createVNode(unref(ScalarIconArrowRight), {
142
+ "aria-hidden": "true",
143
+ class: "size-4 shrink-0 opacity-80"
144
+ }),
145
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "truncate" }, "Pre-request", -1)),
146
+ hasPreContent.value ? (openBlock(), createElementBlock("span", _hoisted_4)) : createCommentVNode("", true)
147
+ ], 10, _hoisted_3), createElementVNode("button", {
148
+ "aria-selected": activeTab.value === "post",
149
+ class: normalizeClass(["flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-150", activeTab.value === "post" ? "text-c-1 bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]" : "text-c-2 hover:text-c-1 hover:bg-[var(--scalar-background-3)]"]),
150
+ role: "tab",
151
+ type: "button",
152
+ onClick: _cache[1] || (_cache[1] = ($event) => switchTo("post"))
153
+ }, [
154
+ createVNode(unref(ScalarIconCheckCircle), {
155
+ "aria-hidden": "true",
156
+ class: "size-4 shrink-0 opacity-80"
157
+ }),
158
+ _cache[3] || (_cache[3] = createElementVNode("span", { class: "truncate" }, "Post-response", -1)),
159
+ hasPostContent.value ? (openBlock(), createElementBlock("span", _hoisted_6)) : createCommentVNode("", true)
160
+ ], 10, _hoisted_5)]), createElementVNode("div", _hoisted_7, [createElementVNode("div", _hoisted_8, [createElementVNode("p", _hoisted_9, [activeTab.value === "pre" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Runs before each request in this document. Use it to set variables, headers, or modify the request. ")], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Runs after each response. Use it for tests, assertions, or saving data from the response. ")], 64))]), _cache[4] || (_cache[4] = createElementVNode("span", {
161
+ "aria-hidden": "true",
162
+ class: "text-c-2 rounded bg-[var(--scalar-background-3)] px-2 py-1 font-mono text-xs"
163
+ }, " JavaScript ", -1))]), createElementVNode("div", {
164
+ ref_key: "editorContainerRef",
165
+ ref: editorContainerRef,
166
+ class: "document-scripts-editors__container min-h-[300px] flex-1"
167
+ }, null, 512)])]);
168
+ };
169
+ }
170
+ });
171
+ //#endregion
172
+ export { DocumentScriptsEditors_vue_vue_type_script_setup_true_lang_default as default };
173
+
174
+ //# sourceMappingURL=DocumentScriptsEditors.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentScriptsEditors.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/DocumentScriptsEditors.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCheckCircle } from '@scalar/icons'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport * as monaco from 'monaco-editor'\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n} from 'vue'\n\nconst { document } = defineProps<{\n document: WorkspaceDocument | null\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:extension', payload: Record<string, unknown>): void\n}>()\n\ntype ScriptTab = 'pre' | 'post'\n\nconst activeTab = ref<ScriptTab>('pre')\nconst editorContainerRef = ref<HTMLElement | null>(null)\n\nconst editor = shallowRef<monaco.editor.IStandaloneCodeEditor | null>(null)\nconst preModel = shallowRef<monaco.editor.ITextModel | null>(null)\nconst postModel = shallowRef<monaco.editor.ITextModel | null>(null)\n\n/** Local content state so the indicator updates immediately on type, before document prop syncs */\nconst preHasContent = ref(false)\nconst postHasContent = ref(false)\nconst preValue = (): string => (document?.['x-pre-request'] as string) ?? ''\nconst postValue = (): string => (document?.['x-post-response'] as string) ?? ''\n\n/** Content indicators: true when the script has non-whitespace content */\nconst hasPreContent = computed(\n () => preHasContent.value || preValue().trim().length > 0,\n)\n\nconst hasPostContent = computed(\n () => postHasContent.value || postValue().trim().length > 0,\n)\n\n/**\n * Creates Monaco text models for pre-request and post-response scripts.\n * Each model maintains its own content, undo history, and cursor state.\n * Change listeners emit updates to sync content with the parent component.\n */\nconst createModels = () => {\n preModel.value = monaco.editor.createModel(preValue(), 'javascript')\n postModel.value = monaco.editor.createModel(postValue(), 'javascript')\n\n preHasContent.value = preValue().trim().length > 0\n postHasContent.value = postValue().trim().length > 0\n\n preModel.value.onDidChangeContent(() => {\n const newValue = preModel.value?.getValue() ?? ''\n preHasContent.value = newValue.trim().length > 0\n emit('update:extension', { 'x-pre-request': newValue })\n })\n\n postModel.value.onDidChangeContent(() => {\n const newValue = postModel.value?.getValue() ?? ''\n postHasContent.value = newValue.trim().length > 0\n emit('update:extension', { 'x-post-response': newValue })\n })\n}\n\n/**\n * Initializes the Monaco editor instance with both models.\n * The editor is created once and reused; tab switching swaps models instead of recreating the editor.\n */\nconst createEditor = () => {\n if (!editorContainerRef.value) {\n return\n }\n\n createModels()\n\n const initialModel = activeTab.value === 'pre' ? preModel : postModel\n editor.value = monaco.editor.create(editorContainerRef.value, {\n automaticLayout: true,\n minimap: { enabled: false },\n lineNumbers: 'on',\n scrollBeyondLastLine: false,\n folding: true,\n showFoldingControls: 'always',\n fontSize: 13,\n lineHeight: 20,\n fontFamily: \"'JetBrains Mono', monospace\",\n scrollbar: {\n useShadows: false,\n verticalScrollbarSize: 8,\n horizontalScrollbarSize: 8,\n },\n padding: { top: 12, bottom: 12 },\n renderLineHighlight: 'none',\n wordWrap: 'on',\n model: initialModel.value,\n })\n}\n\n/**\n * Switches the active tab by swapping the model on the existing editor.\n * This preserves each model's undo history, cursor position, and scroll state.\n */\nconst switchTo = (tab: ScriptTab) => {\n if (activeTab.value === tab || !editor.value) {\n return\n }\n activeTab.value = tab\n const model = tab === 'pre' ? preModel : postModel\n if (model.value) {\n editor.value.setModel(model.value)\n }\n}\n\n/** Cleans up Monaco resources when the component unmounts. */\nconst disposeAll = () => {\n preModel.value?.dispose()\n postModel.value?.dispose()\n editor.value?.dispose()\n editor.value = null\n preModel.value = null\n postModel.value = null\n}\n\nonMounted(() => {\n createEditor()\n})\n\nonBeforeUnmount(() => {\n disposeAll()\n})\n\nwatch(\n () => [document?.['x-pre-request'], document?.['x-post-response']] as const,\n ([nextPre, nextPost]) => {\n const preStr = (nextPre as string) ?? ''\n const postStr = (nextPost as string) ?? ''\n preHasContent.value = preStr.trim().length > 0\n postHasContent.value = postStr.trim().length > 0\n\n if (preModel.value && preModel.value.getValue() !== preStr) {\n preModel.value.setValue(preStr)\n }\n if (postModel.value && postModel.value.getValue() !== postStr) {\n postModel.value.setValue(postStr)\n }\n },\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div class=\"document-scripts-editors flex flex-col gap-5\">\n <!-- Tabs with icons and content indicators -->\n <div\n aria-label=\"Script type\"\n class=\"document-scripts-editors__tabs flex shrink-0 gap-0.5 rounded-xl border border-[var(--scalar-border-color)] bg-[var(--scalar-background-2)] p-1\"\n role=\"tablist\">\n <button\n :aria-selected=\"activeTab === 'pre'\"\n class=\"flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-150\"\n :class=\"\n activeTab === 'pre'\n ? 'text-c-1 bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]'\n : 'text-c-2 hover:text-c-1 hover:bg-[var(--scalar-background-3)]'\n \"\n role=\"tab\"\n type=\"button\"\n @click=\"switchTo('pre')\">\n <ScalarIconArrowRight\n aria-hidden=\"true\"\n class=\"size-4 shrink-0 opacity-80\" />\n <span class=\"truncate\">Pre-request</span>\n <span\n v-if=\"hasPreContent\"\n aria-hidden=\"true\"\n class=\"h-2 w-2 shrink-0 rounded-full bg-[var(--scalar-color-green)]\"\n title=\"Has content\" />\n </button>\n <button\n :aria-selected=\"activeTab === 'post'\"\n class=\"flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-150\"\n :class=\"\n activeTab === 'post'\n ? 'text-c-1 bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]'\n : 'text-c-2 hover:text-c-1 hover:bg-[var(--scalar-background-3)]'\n \"\n role=\"tab\"\n type=\"button\"\n @click=\"switchTo('post')\">\n <ScalarIconCheckCircle\n aria-hidden=\"true\"\n class=\"size-4 shrink-0 opacity-80\" />\n <span class=\"truncate\">Post-response</span>\n <span\n v-if=\"hasPostContent\"\n aria-hidden=\"true\"\n class=\"h-2 w-2 shrink-0 rounded-full bg-[var(--scalar-color-green)]\"\n title=\"Has content\" />\n </button>\n </div>\n\n <!-- Description and editor card -->\n <div\n class=\"document-scripts-editors__card flex flex-col overflow-hidden rounded-xl border border-[var(--scalar-border-color)] bg-[var(--scalar-background-1)] shadow-[var(--scalar-shadow-1)]\">\n <div\n class=\"document-scripts-editors__card-header flex min-h-[4rem] shrink-0 items-center justify-between border-b border-[var(--scalar-border-color)] bg-[var(--scalar-background-2)] px-4 py-3\">\n <p class=\"text-c-2 text-sm leading-snug\">\n <template v-if=\"activeTab === 'pre'\">\n Runs before each request in this document. Use it to set variables,\n headers, or modify the request.\n </template>\n <template v-else>\n Runs after each response. Use it for tests, assertions, or saving\n data from the response.\n </template>\n </p>\n <span\n aria-hidden=\"true\"\n class=\"text-c-2 rounded bg-[var(--scalar-background-3)] px-2 py-1 font-mono text-xs\">\n JavaScript\n </span>\n </div>\n <div\n ref=\"editorContainerRef\"\n class=\"document-scripts-editors__container min-h-[300px] flex-1\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.document-scripts-editors__container {\n min-height: 300px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,OAAO;EAMb,MAAM,YAAY,IA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
2
+ collectionType: "document" | "operation";
3
+ document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
4
+ }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
5
+ collectionType: "workspace";
6
+ document: null;
7
+ }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
8
+ collectionType: "document" | "operation";
9
+ document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
10
+ }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
11
+ collectionType: "workspace";
12
+ document: null;
13
+ })> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ //# sourceMappingURL=Scripts.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scripts.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Scripts.vue"],"names":[],"mappings":"AA+FA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,7 @@
1
+ import Scripts_vue_vue_type_script_setup_true_lang_default from "./Scripts.vue.script.js";
2
+ //#region src/v2/features/collection/components/Scripts.vue
3
+ var Scripts_default = Scripts_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { Scripts_default as default };
6
+
7
+ //# sourceMappingURL=Scripts.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scripts.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Scripts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport DocumentScriptsEditors from '@/v2/features/collection/components/DocumentScriptsEditors.vue'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst { document, eventBus, collectionType } = defineProps<CollectionProps>()\n\nconst handleUpdateExtension = (payload: Record<string, unknown>) => {\n eventBus.emit('document:update:extension', payload)\n}\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Pre-request &amp; Post-response Scripts</template>\n <template #description>\n Scripts at the document level run for every request in this document.\n Operation-level scripts (in the request editor) run in addition to these.\n </template>\n <DocumentScriptsEditors\n :document=\"document\"\n @update:extension=\"handleUpdateExtension\" />\n </Section>\n</template>\n"],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import Section_default from "../../settings/components/Section.vue.js";
2
+ import DocumentScriptsEditors_default from "./DocumentScriptsEditors.vue.js";
3
+ import { createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, withCtx } from "vue";
4
+ //#region src/v2/features/collection/components/Scripts.vue?vue&type=script&setup=true&lang.ts
5
+ var Scripts_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
6
+ __name: "Scripts",
7
+ props: {
8
+ documentSlug: {},
9
+ document: {},
10
+ eventBus: {},
11
+ layout: {},
12
+ path: {},
13
+ method: {},
14
+ exampleName: {},
15
+ environment: {},
16
+ workspaceStore: {},
17
+ activeWorkspace: {},
18
+ plugins: {},
19
+ customThemes: {},
20
+ currentTheme: {},
21
+ isDarkMode: { type: Boolean },
22
+ fetchRegistryDocument: { type: Function },
23
+ telemetry: { type: Boolean },
24
+ onUpdateTelemetry: { type: Function },
25
+ collectionType: {}
26
+ },
27
+ setup(__props) {
28
+ const handleUpdateExtension = (payload) => {
29
+ __props.eventBus.emit("document:update:extension", payload);
30
+ };
31
+ return (_ctx, _cache) => {
32
+ return __props.collectionType === "document" ? (openBlock(), createBlock(Section_default, { key: 0 }, {
33
+ title: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Pre-request & Post-response Scripts", -1)])]),
34
+ description: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Scripts at the document level run for every request in this document. Operation-level scripts (in the request editor) run in addition to these. ", -1)])]),
35
+ default: withCtx(() => [createVNode(DocumentScriptsEditors_default, {
36
+ document: __props.document,
37
+ "onUpdate:extension": handleUpdateExtension
38
+ }, null, 8, ["document"])]),
39
+ _: 1
40
+ })) : createCommentVNode("", true);
41
+ };
42
+ }
43
+ });
44
+ //#endregion
45
+ export { Scripts_vue_vue_type_script_setup_true_lang_default as default };
46
+
47
+ //# sourceMappingURL=Scripts.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scripts.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Scripts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport DocumentScriptsEditors from '@/v2/features/collection/components/DocumentScriptsEditors.vue'\nimport Section from '@/v2/features/settings/components/Section.vue'\n\nconst { document, eventBus, collectionType } = defineProps<CollectionProps>()\n\nconst handleUpdateExtension = (payload: Record<string, unknown>) => {\n eventBus.emit('document:update:extension', payload)\n}\n</script>\n\n<template>\n <Section v-if=\"collectionType === 'document'\">\n <template #title>Pre-request &amp; Post-response Scripts</template>\n <template #description>\n Scripts at the document level run for every request in this document.\n Operation-level scripts (in the request editor) run in addition to these.\n </template>\n <DocumentScriptsEditors\n :document=\"document\"\n @update:extension=\"handleUpdateExtension\" />\n </Section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA,MAAM,yBAAyB,YAAqC;AAClE,WAAA,SAAS,KAAK,6BAA6B,QAAO;;;UAKnC,QAAA,mBAAc,cAAA,WAAA,EAA7B,YASU,iBAAA,EAAA,KAAA,GAAA,EAAA;IARG,OAAK,cAAwC,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAvC,uCAAuC,GAAA,CAAA,EAAA,CAAA;IAC7C,aAAW,cAGtB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAHuB,qJAGvB,GAAA,CAAA,EAAA,CAAA;2BAG8C,CAF9C,YAE8C,gCAAA;KAD3C,UAAU,QAAA;KACV,sBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;CACxC,CAAC;AAkHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Tabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;CACxC,CAAC;AAmHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { capitalize, computed } from 'vue'\nimport { RouterLink } from 'vue-router'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\n\nconst { type } = defineProps<{\n type: CollectionProps['collectionType']\n}>()\n\n/** Different routes for workspace vs document */\nconst routes = computed(() => {\n if (type === 'workspace') {\n return ['environment', 'cookies', 'settings']\n }\n\n if (type === 'operation') {\n return ['overview', 'servers', 'authentication', 'editor']\n }\n\n return [\n 'overview',\n 'servers',\n 'authentication',\n 'environment',\n 'cookies',\n 'settings',\n ]\n})\n</script>\n\n<template>\n <div class=\"flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0\">\n <RouterLink\n v-for=\"route in routes\"\n :key=\"route\"\n v-slot=\"{ isActive, href, navigate }\"\n custom\n :to=\"{ name: `${type}.${route}` }\">\n <a\n class=\"-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline\"\n :href=\"href\"\n @click=\"navigate\">\n <span\n class=\"flex-center hover:text-c-1 h-full border-b\"\n :class=\"\n isActive\n ? 'text-c-1 border-c-1'\n : 'text-c-2 hover:text-c-1 border-transparent'\n \">\n {{ capitalize(route) }}\n </span>\n </a>\n </RouterLink>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Tabs.vue.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { capitalize, computed } from 'vue'\nimport { RouterLink } from 'vue-router'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\n\nconst { type } = defineProps<{\n type: CollectionProps['collectionType']\n}>()\n\n/** Different routes for workspace vs document */\nconst routes = computed(() => {\n if (type === 'workspace') {\n return ['environment', 'cookies', 'settings']\n }\n\n if (type === 'operation') {\n return ['overview', 'servers', 'authentication', 'editor']\n }\n\n return [\n 'overview',\n 'servers',\n 'authentication',\n 'environment',\n 'cookies',\n 'settings',\n 'scripts',\n ]\n})\n</script>\n\n<template>\n <div class=\"flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0\">\n <RouterLink\n v-for=\"route in routes\"\n :key=\"route\"\n v-slot=\"{ isActive, href, navigate }\"\n custom\n :to=\"{ name: `${type}.${route}` }\">\n <a\n class=\"-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline\"\n :href=\"href\"\n @click=\"navigate\">\n <span\n class=\"flex-center hover:text-c-1 h-full border-b\"\n :class=\"\n isActive\n ? 'text-c-1 border-c-1'\n : 'text-c-2 hover:text-c-1 border-transparent'\n \">\n {{ capitalize(route) }}\n </span>\n </a>\n </RouterLink>\n </div>\n</template>\n"],"mappings":""}
@@ -26,7 +26,8 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
26
26
  "authentication",
27
27
  "environment",
28
28
  "cookies",
29
- "settings"
29
+ "settings",
30
+ "scripts"
30
31
  ];
31
32
  });
32
33
  return (_ctx, _cache) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { capitalize, computed } from 'vue'\nimport { RouterLink } from 'vue-router'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\n\nconst { type } = defineProps<{\n type: CollectionProps['collectionType']\n}>()\n\n/** Different routes for workspace vs document */\nconst routes = computed(() => {\n if (type === 'workspace') {\n return ['environment', 'cookies', 'settings']\n }\n\n if (type === 'operation') {\n return ['overview', 'servers', 'authentication', 'editor']\n }\n\n return [\n 'overview',\n 'servers',\n 'authentication',\n 'environment',\n 'cookies',\n 'settings',\n ]\n})\n</script>\n\n<template>\n <div class=\"flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0\">\n <RouterLink\n v-for=\"route in routes\"\n :key=\"route\"\n v-slot=\"{ isActive, href, navigate }\"\n custom\n :to=\"{ name: `${type}.${route}` }\">\n <a\n class=\"-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline\"\n :href=\"href\"\n @click=\"navigate\">\n <span\n class=\"flex-center hover:text-c-1 h-full border-b\"\n :class=\"\n isActive\n ? 'text-c-1 border-c-1'\n : 'text-c-2 hover:text-c-1 border-transparent'\n \">\n {{ capitalize(route) }}\n </span>\n </a>\n </RouterLink>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;EAWA,MAAM,SAAS,eAAe;AAC5B,OAAI,QAAA,SAAS,YACX,QAAO;IAAC;IAAe;IAAW;IAAU;AAG9C,OAAI,QAAA,SAAS,YACX,QAAO;IAAC;IAAY;IAAW;IAAkB;IAAQ;AAG3D,UAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACF;IACD;;uBAIC,mBAsBM,OAtBN,YAsBM,EAAA,UAAA,KAAA,EArBJ,mBAoBa,UAAA,MAAA,WAnBK,OAAA,QAAT,UAAK;wBADd,YAoBa,MAAA,WAAA,EAAA;KAlBV,KAAK;KAEN,QAAA;KACC,IAAE,EAAA,MAAA,GAAa,QAAA,KAAI,GAAI,SAAK;;uBAczB,EAhBM,UAAU,MAAM,eAAQ,CAGlC,mBAaI,KAAA;MAZF,OAAM;MACC;MACN,SAAO;SACR,mBAQO,QAAA,EAPL,OAAK,eAAA,CAAC,8CACe,WAAA,wBAAA,6CAAA,CAAA,EAAA,EAAA,gBAKlB,WAAW,MAAK,CAAA,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Tabs.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { capitalize, computed } from 'vue'\nimport { RouterLink } from 'vue-router'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\n\nconst { type } = defineProps<{\n type: CollectionProps['collectionType']\n}>()\n\n/** Different routes for workspace vs document */\nconst routes = computed(() => {\n if (type === 'workspace') {\n return ['environment', 'cookies', 'settings']\n }\n\n if (type === 'operation') {\n return ['overview', 'servers', 'authentication', 'editor']\n }\n\n return [\n 'overview',\n 'servers',\n 'authentication',\n 'environment',\n 'cookies',\n 'settings',\n 'scripts',\n ]\n})\n</script>\n\n<template>\n <div class=\"flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0\">\n <RouterLink\n v-for=\"route in routes\"\n :key=\"route\"\n v-slot=\"{ isActive, href, navigate }\"\n custom\n :to=\"{ name: `${type}.${route}` }\">\n <a\n class=\"-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline\"\n :href=\"href\"\n @click=\"navigate\">\n <span\n class=\"flex-center hover:text-c-1 h-full border-b\"\n :class=\"\n isActive\n ? 'text-c-1 border-c-1'\n : 'text-c-2 hover:text-c-1 border-transparent'\n \">\n {{ capitalize(route) }}\n </span>\n </a>\n </RouterLink>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;EAWA,MAAM,SAAS,eAAe;AAC5B,OAAI,QAAA,SAAS,YACX,QAAO;IAAC;IAAe;IAAW;IAAU;AAG9C,OAAI,QAAA,SAAS,YACX,QAAO;IAAC;IAAY;IAAW;IAAkB;IAAQ;AAG3D,UAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACF;IACD;;uBAIC,mBAsBM,OAtBN,YAsBM,EAAA,UAAA,KAAA,EArBJ,mBAoBa,UAAA,MAAA,WAnBK,OAAA,QAAT,UAAK;wBADd,YAoBa,MAAA,WAAA,EAAA;KAlBV,KAAK;KAEN,QAAA;KACC,IAAE,EAAA,MAAA,GAAa,QAAA,KAAI,GAAI,SAAK;;uBAczB,EAhBM,UAAU,MAAM,eAAQ,CAGlC,mBAaI,KAAA;MAZF,OAAM;MACC;MACN,SAAO;SACR,mBAQO,QAAA,EAPL,OAAK,eAAA,CAAC,8CACe,WAAA,wBAAA,6CAAA,CAAA,EAAA,EAAA,gBAKlB,WAAW,MAAK,CAAA,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,CAAA,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export { type ApiClientModal, createApiClientModal } from './helpers/create-api-client-modal.js';
2
2
  export { mapHiddenClientsConfig } from './helpers/map-hidden-clients-config.js';
3
+ export type { RoutePayload } from './helpers/resolve-route-parameters.js';
3
4
  export { initializeModalEvents } from './modal-events.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAkMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAG/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;IAC/B,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;IAHxD,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;IAC/B,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;iGAqPxD,CAAC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAmMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAG/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;IAC/B,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;IAHxD,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;IAC/B,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;iGAuPxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { isElectron } from '@/libs/electron'\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { isElectron } from '@/libs/electron'\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
@@ -79,12 +79,13 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
79
79
  /** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */
80
80
  const httpClients = computed(() => mapHiddenClientsConfig(toValue(__props.options)?.hiddenClients));
81
81
  return (_ctx, _cache) => {
82
- return __props.path && __props.method && __props.exampleName && operation.value ? (openBlock(), createBlock(unref(OperationBlock_default), {
82
+ return __props.path && __props.method && __props.exampleName && operation.value && __props.document ? (openBlock(), createBlock(unref(OperationBlock_default), {
83
83
  key: 0,
84
84
  activeEnvironment: __props.workspaceStore.workspace["x-scalar-active-environment"],
85
85
  appVersion: unref(APP_VERSION),
86
86
  authMeta: authMeta.value,
87
87
  defaultHeaders: defaultHeaders.value,
88
+ document: __props.document,
88
89
  documentCookies: documentCookies.value,
89
90
  documentSecurity: __props.document?.security ?? [],
90
91
  documentUrl: __props.document?.["x-scalar-original-source-url"],
@@ -116,6 +117,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
116
117
  "appVersion",
117
118
  "authMeta",
118
119
  "defaultHeaders",
120
+ "document",
119
121
  "documentCookies",
120
122
  "documentSecurity",
121
123
  "documentUrl",
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { isElectron } from '@/libs/electron'\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,iBAAiB,eAAe;AACpC,OAAI,CAAC,QAAA,QAAQ,CAAC,QAAA,UAAU,CAAC,QAAA,eAAe,CAAC,QAAA,SACvC,QAAO;GAGT,MAAM,SAAS,yBACb,QAAA,gBACA,QAAA,cACA;IAAE,MAAG,QAAA;IAAG,QAAK,QAAA;IAAG,aAAU,QAAA;IAAG,EAC7B;IACE,eAAe,QAAQ,QAAA,QAAQ,EAAE;IACjC,kBAAkB,QAAA;IAClB,YAAY,YAAY;IACxB,QAAQ,QAAA,WAAW,QAAQ,QAAQ;IACnC,SAAS,QAAQ,QAAA,QAAQ,EAAE;IAC3B,YAAY;IACZ,gBAAgB,QAAQ,QAAA,QAAQ,EAAE;IACnC,CACH;AAEA,UAAO,OAAO,KAAK,OAAO,OAAO;IAClC;EAED,MAAM,YAAY,eAAe,e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AAA;IACpC,aAAa,QAAA,WAAQ;IACrB,aAAA,QAAA;IACA,cAAA,aAAA;IACA,UAAA,QAAA;IACA,YAAY,QAAA;IACZ,kBAAkB,QAAQ,QAAA,QAAO,EAAG,oBAAgB;IACpD,SAAS,QAAA,eAAe,QAAQ,WAAW,QAAA,cAAc,QAAA,MAAM,QAAA,OAAM;IACrE,aAAA,YAAA;IACA,QAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,MAAA,QAAA;IACA,SAAS,QAAA;IACT,UAAmB,MAAA,kBAAiB,CAAY,QAAA,eAAe,UAAS,0BAAqC,QAAA,WAAM,QAAA,QAAA,QAAA,IAAA;IAMnH,iCAAA,QAAA;IACA,sBAAsB,qBAAA;IACtB,iBAAA,gBAAA;IACA,gBAAgB,QAAA,eAAe,UAAS;IACxC,kBAAkB,iBAAA;IAClB,yBAAyB,wBAAA;IACzB,QAAQ,eAAA;IACR,YAAA,WAAA;IACA,SAAA,QAAA;IACA,kBAAA,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAIL,mBAIM,OAJN,YAIM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CADJ,mBAAiE,QAAA,EAA3D,OAAM,YAAU,EAAC,uCAAmC,GAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { isElectron } from '@/libs/electron'\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,iBAAiB,eAAe;AACpC,OAAI,CAAC,QAAA,QAAQ,CAAC,QAAA,UAAU,CAAC,QAAA,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