@scalar/api-reference 1.55.3 → 1.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +2 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +9 -7
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +4 -2
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +9 -4
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts +2 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +7 -3
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/{OpenApiVersion.vue.d.ts → SpecificationVersion.vue.d.ts} +5 -2
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.d.ts.map +1 -0
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js +23 -0
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js.map +1 -0
- package/dist/browser/standalone.js +275 -261
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue.js.map +1 -1
- package/dist/components/ApiReference.vue.script.js +20 -8
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Badge/Badge.vue.js.map +1 -1
- package/dist/components/Badge/Badge.vue.script.js.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.script.js +3 -2
- package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js.map +1 -1
- package/dist/components/Content/Content.vue.script.js +23 -9
- package/dist/components/Content/Content.vue.script.js.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +2 -3
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +2 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.script.js +5 -0
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +5 -3
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
- package/dist/components/MobileHeader.vue.js.map +1 -1
- package/dist/components/MobileHeader.vue.script.js +1 -1
- package/dist/components/MobileHeader.vue.script.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.script.js +1 -0
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.js +20 -12
- package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js +18 -8
- package/dist/features/Search/helpers/create-search-index.js.map +1 -1
- package/dist/features/Search/types.d.ts +6 -0
- package/dist/features/Search/types.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
- package/dist/helpers/map-config-plugins.d.ts.map +1 -1
- package/dist/helpers/map-config-plugins.js +9 -1
- package/dist/helpers/map-config-plugins.js.map +1 -1
- package/dist/helpers/normalize-configurations.d.ts.map +1 -1
- package/dist/helpers/normalize-configurations.js +6 -6
- package/dist/helpers/normalize-configurations.js.map +1 -1
- package/dist/helpers/openapi.d.ts +34 -5
- package/dist/helpers/openapi.d.ts.map +1 -1
- package/dist/helpers/openapi.js +108 -66
- package/dist/helpers/openapi.js.map +1 -1
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.js +10 -4
- package/dist/standalone/lib/html-api.js.map +1 -1
- package/dist/style.css +367 -1782
- package/dist/vue-styles.css +83 -83
- package/package.json +17 -15
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js.map +0 -1
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js +0 -19
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.vue.script.js","names":[],"sources":["../../../src/components/Content/Content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { generateClientOptions } from '@scalar/api-client/blocks/operation-code-sample'\nimport { mapHiddenClientsConfig } from '@scalar/api-client/modal'\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSelectedServer,\n getServers,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { TraversedEntry as TraversedEntryType } from '@scalar/workspace-store/schemas/navigation'\nimport type {\n Workspace,\n WorkspaceDocument,\n} from '@scalar/workspace-store/schemas/workspace'\nimport { computed, onMounted } from 'vue'\n\nimport { ClientSelector } from '@/blocks/scalar-client-selector-block'\nimport { InfoBlock } from '@/blocks/scalar-info-block'\nimport { IntroductionCardItem } from '@/blocks/scalar-info-block/'\nimport { ServerSelector } from '@/blocks/scalar-server-selector-block'\nimport { Auth } from '@/components/Content/Auth'\nimport TraversedEntry from '@/components/Content/Operations/TraversedEntry.vue'\nimport { RenderPlugins } from '@/components/RenderPlugins'\nimport { SectionFlare } from '@/components/SectionFlare'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport {\n firstLazyLoadComplete,\n scheduleInitialLoadComplete,\n} from '@/helpers/lazy-bus'\n\nconst {\n document,\n clientDocument,\n items,\n environment,\n eventBus,\n options,\n authStore,\n} = defineProps<{\n infoSectionId: string\n /** The subset of the configuration object required for the content component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'authentication'\n | 'baseServerURL'\n | 'documentDownloadType'\n | 'expandAllResponses'\n | 'hiddenClients'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'persistAuth'\n | 'proxyUrl'\n | 'servers'\n | 'showOperationId'\n | 'hideModels'\n >\n document: WorkspaceDocument | undefined\n clientDocument: WorkspaceDocument | undefined\n authStore: AuthStore\n xScalarDefaultClient: Workspace['x-scalar-default-client']\n items: TraversedEntryType[]\n expandedItems: Record<string, boolean>\n eventBus: WorkspaceEventBus\n environment: XScalarEnvironment\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n}>()\n\n/** Generate all client options so that it can be shared between the top client picker and the operations */\nconst clientOptions = computed(() =>\n generateClientOptions(mapHiddenClientsConfig(options.hiddenClients)),\n)\n\n/** Computed property to get all OpenAPI extension fields from the root document object */\nconst documentExtensions = computed(() => getXKeysFromObject(document))\n\n/** Computed property to get all OpenAPI extension fields from the document's info object */\nconst infoExtensions = computed(() => getXKeysFromObject(document?.info))\n\n/** Compute the servers for the document */\nconst servers = computed(() =>\n getServers(options?.servers ?? clientDocument?.servers, {\n baseServerUrl: options?.baseServerURL,\n documentUrl: clientDocument?.['x-scalar-original-source-url'],\n }),\n)\n\n/** Compute the selected server for the document only (for now) */\nconst selectedServer = computed(() =>\n getSelectedServer(clientDocument ?? null, null, null, servers.value),\n)\n\n/** Merge authentication config with the document security schemes */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n clientDocument?.components?.securitySchemes,\n options.authentication?.securitySchemes,\n authStore,\n clientDocument?.['x-scalar-navigation']?.name ?? '',\n ),\n)\n\n/** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */\nonMounted(() => {\n scheduleInitialLoadComplete()\n})\n</script>\n<template>\n <SectionFlare />\n\n <div class=\"narrow-references-container\">\n <slot name=\"start\" />\n\n <!-- Introduction -->\n\n <InfoBlock\n :id=\"infoSectionId\"\n :documentDownloadType=\"options.documentDownloadType\"\n :documentExtensions\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :eventBus\n :externalDocs=\"document?.externalDocs\"\n :headingSlugGenerator\n :info=\"document?.info\"\n :infoExtensions\n :layout=\"options.layout\"\n :oasVersion=\"document?.['x-original-oas-version']\">\n <template #selectors>\n <!-- Server Selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"servers?.length\"\n class=\"scalar-reference-intro-server scalar-client introduction-card-item text-base leading-normal [--scalar-address-bar-height:0px]\">\n <ServerSelector\n :eventBus\n :selectedServer\n :servers />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Auth selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"document && !options.hideTestRequestButton\"\n class=\"scalar-reference-intro-auth scalar-client introduction-card-item leading-normal\">\n <Auth\n :authStore\n :document=\"clientDocument\"\n :environment\n :eventBus\n :options\n :securitySchemes\n :selectedServer />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Client selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"clientOptions.length\"\n class=\"introduction-card-item scalar-reference-intro-clients\">\n <ClientSelector\n class=\"introduction-card-item scalar-reference-intro-clients\"\n :clientOptions\n :eventBus\n :selectedClient=\"xScalarDefaultClient\"\n :xScalarSdkInstallation=\"\n document?.info?.['x-scalar-sdk-installation']\n \" />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n </template>\n </InfoBlock>\n\n <!-- Render traversed operations and webhooks -->\n <!-- Use recursive component for cleaner rendering -->\n <TraversedEntry\n v-if=\"items.length && document\"\n :authStore\n :clientOptions\n :document\n :entries=\"items\"\n :eventBus\n :expandedItems\n :options\n :securitySchemes\n :selectedClient=\"xScalarDefaultClient\"\n :selectedServer>\n </TraversedEntry>\n\n <!-- Render plugins at content.end view -->\n <RenderPlugins\n :options\n viewName=\"content.end\" />\n\n <slot name=\"end\" />\n <!-- Placeholder content to allow the active item to be scrolled to the top while the rest of the content is lazy loaded -->\n <div\n v-if=\"!firstLazyLoadComplete\"\n class=\"h-dvh\"></div>\n </div>\n</template>\n\n<style>\n.narrow-references-container {\n container-name: narrow-references-container;\n container-type: inline-size;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,MAAM,gBAAgB,eACpB,sBAAsB,uBAAuB,QAAA,QAAQ,cAAc,CAAC,CACtE;;EAGA,MAAM,qBAAqB,eAAe,mBAAmB,QAAA,SAAS,CAAA;;EAGtE,MAAM,iBAAiB,eAAe,mBAAmB,QAAA,UAAU,KAAK,CAAA;;EAGxE,MAAM,UAAU,eACd,WAAW,QAAA,SAAS,WAAW,QAAA,gBAAgB,SAAS;GACtD,eAAe,QAAA,SAAS;GACxB,aAAa,QAAA,iBAAiB;GAC/B,CAAC,CACJ;;EAGA,MAAM,iBAAiB,eACrB,kBAAkB,QAAA,kBAAkB,MAAM,MAAM,MAAM,QAAQ,MAAM,CACtE;;EAGA,MAAM,kBAAkB,eACtB,cACE,QAAA,gBAAgB,YAAY,iBAC5B,QAAA,QAAQ,gBAAgB,iBACxB,QAAA,WACA,QAAA,iBAAiB,wBA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yC,QAAA,UAAU,OAAI;;;;;;;;;;;;;;;;;;;;;;;;;;IAW1D,QAAA,MAAM,UAAU,QAAA,YAAA,WAAA,EADxB,YAYiB,wBAAA;;KAVd,WAAA,QAAA;KACA,eAAA,cAAA;KACA,UAAA,QAAA;KACA,SAAS,QAAA;KACT,UAAA,QAAA;KACA,eAAA,QAAA;KACA,SAAA,QAAA;KACA,iBAAA,gBAAA;KACA,gBAAgB,QAAA;KAChB,gBAAA,eAAA;;;;;;;;;;;;;IAIH,YAE2B,MAAA,sBAAA,EAAA;KADxB,SAAA,QAAA;KACD,UAAS;;IAEX,WAAmB,KAAA,QAAA,MAAA;KAGV,MAAA,sBAAqB,IAAA,WAAA,EAD9B,mBAEsB,OAFtB,WAEsB,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"Content.vue.script.js","names":[],"sources":["../../../src/components/Content/Content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { generateClientOptions } from '@scalar/api-client/blocks/operation-code-sample'\nimport { mapHiddenClientsConfig } from '@scalar/api-client/modal'\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSelectedServer,\n getServers,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { TraversedEntry as TraversedEntryType } from '@scalar/workspace-store/schemas/navigation'\nimport {\n getDocumentType,\n isAsyncApiDocument,\n isOpenApiDocument,\n} from '@scalar/workspace-store/schemas/type-guards'\nimport type {\n Workspace,\n WorkspaceDocument,\n} from '@scalar/workspace-store/schemas/workspace'\nimport { computed, onMounted } from 'vue'\n\nimport { ClientSelector } from '@/blocks/scalar-client-selector-block'\nimport { InfoBlock } from '@/blocks/scalar-info-block'\nimport { IntroductionCardItem } from '@/blocks/scalar-info-block/'\nimport { ServerSelector } from '@/blocks/scalar-server-selector-block'\nimport { Auth } from '@/components/Content/Auth'\nimport TraversedEntry from '@/components/Content/Operations/TraversedEntry.vue'\nimport { RenderPlugins } from '@/components/RenderPlugins'\nimport { SectionFlare } from '@/components/SectionFlare'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport {\n firstLazyLoadComplete,\n scheduleInitialLoadComplete,\n} from '@/helpers/lazy-bus'\n\nconst {\n document,\n clientDocument,\n items,\n environment,\n eventBus,\n options,\n authStore,\n} = defineProps<{\n infoSectionId: string\n /** The subset of the configuration object required for the content component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'authentication'\n | 'baseServerURL'\n | 'documentDownloadType'\n | 'expandAllResponses'\n | 'hiddenClients'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'persistAuth'\n | 'proxyUrl'\n | 'servers'\n | 'showOperationId'\n | 'hideModels'\n >\n document: WorkspaceDocument | undefined\n clientDocument: WorkspaceDocument | undefined\n authStore: AuthStore\n xScalarDefaultClient: Workspace['x-scalar-default-client']\n items: TraversedEntryType[]\n expandedItems: Record<string, boolean>\n eventBus: WorkspaceEventBus\n environment: XScalarEnvironment\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n}>()\n\n/** Generate all client options so that it can be shared between the top client picker and the operations */\nconst clientOptions = computed(() =>\n generateClientOptions(mapHiddenClientsConfig(options.hiddenClients)),\n)\n\n/**\n * Narrow the (possibly AsyncAPI) documents to OpenAPI documents. api-reference\n * is OpenAPI-native, so AsyncAPI fields surface as undefined/empty.\n */\nconst openApiDocument = computed(() =>\n isOpenApiDocument(document) ? document : undefined,\n)\nconst openApiClientDocument = computed(() =>\n isOpenApiDocument(clientDocument) ? clientDocument : undefined,\n)\n\nconst documentType = computed(() => getDocumentType(document))\n\nconst specificationVersion = computed(() => {\n if (isAsyncApiDocument(document)) {\n return document['x-original-aas-version'] ?? document.asyncapi\n }\n return openApiDocument.value?.['x-original-oas-version']\n})\n\n/** Computed property to get all OpenAPI extension fields from the root document object */\nconst documentExtensions = computed(() => getXKeysFromObject(document))\n\n/** Computed property to get all OpenAPI extension fields from the document's info object */\nconst infoExtensions = computed(() => getXKeysFromObject(document?.info))\n\n/** Compute the servers for the document */\nconst servers = computed(() =>\n getServers(options?.servers ?? openApiClientDocument.value?.servers, {\n baseServerUrl: options?.baseServerURL,\n documentUrl: clientDocument?.['x-scalar-original-source-url'],\n }),\n)\n\n/** Compute the selected server for the document only (for now) */\nconst selectedServer = computed(() =>\n getSelectedServer(\n openApiClientDocument.value ?? null,\n null,\n null,\n servers.value,\n ),\n)\n\n/** Merge authentication config with the document security schemes */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n openApiClientDocument.value?.components?.securitySchemes,\n options.authentication?.securitySchemes,\n authStore,\n openApiClientDocument.value?.['x-scalar-navigation']?.name ?? '',\n ),\n)\n\n/** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */\nonMounted(() => {\n scheduleInitialLoadComplete()\n})\n</script>\n<template>\n <SectionFlare />\n\n <div class=\"narrow-references-container\">\n <slot name=\"start\" />\n\n <!-- Introduction -->\n\n <InfoBlock\n :id=\"infoSectionId\"\n :documentDownloadType=\"options.documentDownloadType\"\n :documentExtensions\n :documentType\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :eventBus\n :externalDocs=\"openApiDocument?.externalDocs\"\n :headingSlugGenerator\n :info=\"document?.info\"\n :infoExtensions\n :layout=\"options.layout\"\n :specificationVersion>\n <template #selectors>\n <!-- Server Selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"servers?.length\"\n class=\"scalar-reference-intro-server scalar-client introduction-card-item text-base leading-normal [--scalar-address-bar-height:0px]\">\n <ServerSelector\n :eventBus\n :selectedServer\n :servers />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Auth selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"document && !options.hideTestRequestButton\"\n class=\"scalar-reference-intro-auth scalar-client introduction-card-item leading-normal\">\n <Auth\n :authStore\n :document=\"clientDocument\"\n :environment\n :eventBus\n :options\n :securitySchemes\n :selectedServer />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Client selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"clientOptions.length\"\n class=\"introduction-card-item scalar-reference-intro-clients\">\n <ClientSelector\n class=\"introduction-card-item scalar-reference-intro-clients\"\n :clientOptions\n :eventBus\n :selectedClient=\"xScalarDefaultClient\"\n :xScalarSdkInstallation=\"\n openApiDocument?.info?.['x-scalar-sdk-installation']\n \" />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n </template>\n </InfoBlock>\n\n <!-- Render traversed operations and webhooks -->\n <!-- Use recursive component for cleaner rendering -->\n <TraversedEntry\n v-if=\"items.length && openApiDocument\"\n :authStore\n :clientOptions\n :document=\"openApiDocument\"\n :entries=\"items\"\n :eventBus\n :expandedItems\n :options\n :securitySchemes\n :selectedClient=\"xScalarDefaultClient\"\n :selectedServer>\n </TraversedEntry>\n\n <!-- Render plugins at content.end view -->\n <RenderPlugins\n :options\n viewName=\"content.end\" />\n\n <slot name=\"end\" />\n <!-- Placeholder content to allow the active item to be scrolled to the top while the rest of the content is lazy loaded -->\n <div\n v-if=\"!firstLazyLoadComplete\"\n class=\"h-dvh\"></div>\n </div>\n</template>\n\n<style>\n.narrow-references-container {\n container-name: narrow-references-container;\n container-type: inline-size;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFA,MAAM,gBAAgB,eACpB,sBAAsB,uBAAuB,QAAA,QAAQ,cAAc,CAAC,CACtE;;;;;EAMA,MAAM,kBAAkB,eACtB,kBAAkB,QAAA,SAAS,GAAG,QAAA,WAAW,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,mBAAA,IAAA,KAAA"}
|
|
@@ -4,9 +4,8 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
|
4
4
|
import type { AuthStore } from '@scalar/workspace-store/entities/auth';
|
|
5
5
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
6
6
|
import type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example';
|
|
7
|
-
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
|
|
8
7
|
import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
|
|
9
|
-
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
8
|
+
import type { OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
10
9
|
type __VLS_Props = {
|
|
11
10
|
/** The auth store */
|
|
12
11
|
authStore: AuthStore;
|
|
@@ -15,7 +14,7 @@ type __VLS_Props = {
|
|
|
15
14
|
/** Traversed entries to render */
|
|
16
15
|
entries: TraversedEntry[];
|
|
17
16
|
/** The document object */
|
|
18
|
-
document:
|
|
17
|
+
document: OpenApiDocument;
|
|
19
18
|
/** The http client options for the dropdown */
|
|
20
19
|
clientOptions: ClientOptionGroup[];
|
|
21
20
|
/** The subset of the configuration object required for the operation component */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraversedEntry.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TraversedEntry.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"names":[],"mappings":"AAkNA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AACxF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,KAAK,EACV,cAAc,EAMf,MAAM,4CAA4C,CAAA;AACnD,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACjB,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAA;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kCAAkC;IAClC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,0BAA0B;IAC1B,QAAQ,EAAE,eAAe,CAAA;IACzB,+CAA+C;IAC/C,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,kFAAkF;IAClF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,oBAAoB,GACpB,uBAAuB,GACvB,QAAQ,GACR,8BAA8B,GAC9B,yBAAyB,GACzB,iBAAiB,GACjB,YAAY,CACf,CAAA;IACD,iDAAiD;IACjD,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,CAAA;IACtC,sDAAsD;IACtD,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AAiTF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraversedEntry.vue.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type {
|
|
1
|
+
{"version":3,"file":"TraversedEntry.vue.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: OpenApiDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n | 'hideModels'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group, Tag or Tag Group (only in classic layout) -->\n <Tag\n v-else-if=\"\n isTag(entry) || (isTagGroup(entry) && options.layout === 'classic')\n \"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Display tag grop entries for modern layout (flattened) -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraversedEntry.vue.script.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type {
|
|
1
|
+
{"version":3,"file":"TraversedEntry.vue.script.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: OpenApiDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n | 'hideModels'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group, Tag or Tag Group (only in classic layout) -->\n <Tag\n v-else-if=\"\n isTag(entry) || (isTagGroup(entry) && options.layout === 'classic')\n \"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Display tag grop entries for modern layout (flattened) -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEA,MAAM,cACJ,UAEA,MAAM,YAAY,SAAS,MAAM,YAAY;EAE/C,MAAM,SACJ,UAEA,MAAM,YAAY,SAAS,CAAC,WAAW,MAAM,IAAI,MAAM,OAAO;EAEhE,MAAM,eAAe,UACnB,MAAM,YAAY;EAEpB,MAAM,aAAa,UACjB,MAAM,YAAY;;EAGpB,MAAM,eAAe,UACnB,MAAM,YAAY;EAEpB,MAAM,WAAW,UACf,MAAM,YAAY;EAEpB,SAAS,aAAa,OAA8C;AAClE,UAAO,UAAU,MAAK,GAClB,QAAA,SAAS,WAAW,MAAM,QAC1B,QAAA,SAAS,QAAQ,MAAM;;;;2BAO3B,mBAqGO,UAAA,MAAA,WApGW,QAAA,UAAT,UAAK;wBADd,YAqGO,cAAA;KAnGJ,IAAI,MAAM;KACV,KAAG,GAAK,MAAM,GAAE,GAAI,QAAA,QAAQ;KAC5B,UAAQ,CAAA,CAAI,QAAA,cAAc,MAAM;;4BAoBd,CAjBX,YAAY,MAAK,IAAK,UAAU,MAAK,IAAA,WAAA,EAD7C,YAkBmB,MAAA,yBAAA,EAAA;;MAhBhB,MAAM,QAAA,UAAK;;6BAeiB,CAd7B,YAc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,YAAY,WAAA,WAAA,EADxD,YAmBW,kBAAA;;MAjBR,IAAI,MAAM;MACV,UAAA,QAAA;MACA,aAAW,CAAG,QAAA,cAAc,MAAM;MAClC,QAAQ,QAAA,QAAQ;;6BAaA,CAZjB,YAYiB,2BAAA;OAXd,WAAA,QAAA;OACA,eAAA,QAAA;OACA,UAAA,QAAA;OACA,SAAS,MAAM,YAAQ,EAAA;OACvB,UAAA,QAAA;OACA,eAAe,QAAA;OACf,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,iBAAA,QAAA;OACA,gBAAA,QAAA;OACA,gBAAA,QAAA;;;;;;;;;;;;;;;;;;;;WAKQ,QAAQ,MAAK,IAAK,QAAA,SAAS,YAAY,UAAU,MAAM,SAAA,WAAA,EADpE,YAQQ,eAAA;;MANL,IAAI,MAAM;MACV,UAAA,QAAA;MACA,aAAW,CAAG,QAAA,cAAc,MAAM;MAClC,MAAM,MAAM;MACZ,SAAA,QAAA;MACA,QAAQ,MAAA,eAAc,CAAC,QAAA,SAAS,WAAW,QAAQ,MAAM,MAAI"}
|
|
@@ -12,6 +12,8 @@ type __VLS_Props = {
|
|
|
12
12
|
noncollapsible?: boolean;
|
|
13
13
|
/** Hide the heading */
|
|
14
14
|
hideHeading?: boolean;
|
|
15
|
+
/** Hide the schema description */
|
|
16
|
+
hideDescription?: boolean;
|
|
15
17
|
/** Show a special one way toggle for additional properties, also has a top border when open */
|
|
16
18
|
additionalProperties?: boolean;
|
|
17
19
|
/** Hide model names in type display */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AA+WA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAStE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,0EAA0E;IAC1E,OAAO,EAAE,aAAa,CAAA;IACtB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AA4cF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
2
2
|
import Schema_vue_vue_type_script_setup_true_lang_default from "./Schema.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/Content/Schema/Schema.vue
|
|
5
|
-
var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c988b726"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Schema_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon, ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n}>()\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => {\n return !noncollapsible && level > 0\n})\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => noncollapsible && e.stopPropagation()\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"noncollapsible\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon, ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n}>()\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => {\n return !noncollapsible && level > 0\n})\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => noncollapsible && e.stopPropagation()\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"noncollapsible\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
|
|
@@ -32,6 +32,10 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
32
32
|
default: false
|
|
33
33
|
},
|
|
34
34
|
hideHeading: { type: Boolean },
|
|
35
|
+
hideDescription: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
35
39
|
additionalProperties: { type: Boolean },
|
|
36
40
|
hideModelNames: {
|
|
37
41
|
type: Boolean,
|
|
@@ -54,6 +58,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
54
58
|
});
|
|
55
59
|
/** Gets the description to show for the schema */
|
|
56
60
|
const schemaDescription = computed(() => {
|
|
61
|
+
if (__props.hideDescription) return null;
|
|
57
62
|
if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return __props.schema.description || __props.schema.allOf[0]?.description || null;
|
|
58
63
|
if (!__props.schema?.description || typeof __props.schema.description !== "string") return null;
|
|
59
64
|
if (__props.schema.enum) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon, ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n}>()\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => {\n return !noncollapsible && level > 0\n})\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => noncollapsible && e.stopPropagation()\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"noncollapsible\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEA,MAAM,mBAAmB,eAAwB;AAC/C,UAAO,CAAC,QAAA,kBAAkB,QAAA,QAAQ;IACnC;;EAGD,MAAM,oBAAoB,eAAe;AAEvC,OAAI,QAAA,QAAQ,SAAS,QAAA,OAAO,MAAM,SAAS,KAAK,QAAA,SAAS,eACvD,QAAO,QAAA,OAAO,eAAe,QAAA,OAAO,MAAM,IAAI,eAAe;AAI/D,OAAI,CA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M,QAAA,kBAAkB,QAAA,SAAO,CAAA,CAAA,GAAA,mBAAA,IAAA,KAAA,EAAA,CAkC5C,QAAA,wBAAwB,QAAA,WAAA,EADjC,YAiCkB,MAAA,gBAAA,EAAA;;MA/BhB,IAAG;MACF,QAAM,CAAG,iBAAA;;6BAcyB,CAX3B,MAAA,aAAY,CAAC,QAAA,OAAM,IAAA,WAAA,EAD3B,YAYmC,gCAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,QAAA,QAAA;OACA,eAAe,QAAA;;;;;;;;;;;;;0BAElB,mBAaW,UAAA,EAAA,KAAA,GAAA,EAAA,CAXD,QAAA,UAAA,WAAA,EADR,YAWmC,wBAAA;;OAThC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAA,QAAA;OACA,SAAA,QAAA;OACA,QAAA,QAAA;OACA,eAAe,QAAA"}
|
|
1
|
+
{"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon, ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n}>()\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => {\n return !noncollapsible && level > 0\n})\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => noncollapsible && e.stopPropagation()\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"noncollapsible\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;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AAA,gBAAJ,SAAI,gBAAG,QAAA,KAAI,EAAA,EAAA,CAAA,CAAA;;;8BAEvC,mBASW,UAAA,EAAA,KAAA,GAAA,EAAA,CART,YAIc,MAAA,WAAA,EAAA;OAHZ,OAAK,eAAA,CAAC,0BAAwB,EAAA,gCACY,MAAI,CAAA,CAAA;OAC9C,MAAK;OACL,MAAK;8BACP,YAEoB,uBAAA;OADjB,MAAM,QAAA,QAAQ,SAAS,QAAA;OACvB,OAAO,QAAA;;;;;;;oBA9BH,QAAA,eAAW,EAAM,QAAA,kBAAkB,QAAA,SAAO,CAAA,CAAA,GAAA,mBAAA,IAAA,KAAA,EAAA,CAkC5C,QAAA,wBAAwB,QAAA,WAAA,EADjC,YAiCkB,MAAA,gBAAA,EAAA;;MA/BhB,IAAG;MACF,QAAM,CAAG,iBAAA;;6BAcyB,CAX3B,MAAA,aAAY,CAAC,QAAA,OAAM,IAAA,WAAA,EAD3B,YAYmC,gCAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,QAAA,QAAA;OACA,eAAe,QAAA;;;;;;;;;;;;;0BAElB,mBAaW,UAAA,EAAA,KAAA,GAAA,EAAA,CAXD,QAAA,UAAA,WAAA,EADR,YAWmC,wBAAA;;OAThC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAA,QAAA;OACA,SAAA,QAAA;OACA,QAAA,QAAA;OACA,eAAe,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAkQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AAmUJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n\n if ('$ref' in property && typeof property.$ref === 'string') {\n return getResolvedRef(property) as SchemaObject\n }\n\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n if (\n
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n\n if ('$ref' in property && typeof property.$ref === 'string') {\n return getResolvedRef(property) as SchemaObject\n }\n\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :description=\"getPropertyDescription(property)\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":""}
|
|
@@ -78,13 +78,15 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
|
|
|
78
78
|
* Get the value for additional properties.
|
|
79
79
|
*
|
|
80
80
|
* When additionalProperties is true or an empty object, it should render as { type: 'anything' }.
|
|
81
|
+
* $ref values are resolved before the type check so the referenced schema is rendered correctly.
|
|
81
82
|
*/
|
|
82
83
|
const getAdditionalPropertiesValue = (additionalProperties) => {
|
|
83
|
-
|
|
84
|
+
const resolved = typeof additionalProperties === "boolean" ? additionalProperties : resolve.schema(additionalProperties);
|
|
85
|
+
if (resolved === true || typeof resolved === "object" && Object.keys(resolved).length === 0 || typeof resolved !== "object" || !("type" in resolved)) return {
|
|
84
86
|
type: "anything",
|
|
85
|
-
...typeof
|
|
87
|
+
...typeof resolved === "object" ? resolved : {}
|
|
86
88
|
};
|
|
87
|
-
return
|
|
89
|
+
return resolved;
|
|
88
90
|
};
|
|
89
91
|
return (_ctx, _cache) => {
|
|
90
92
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaObjectProperties.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n\n if ('$ref' in property && typeof property.$ref === 'string') {\n return getResolvedRef(property) as SchemaObject\n }\n\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n if (\n additionalProperties === true ||\n (typeof additionalProperties === 'object' &&\n Object.keys(additionalProperties).length === 0) ||\n typeof additionalProperties !== 'object' ||\n !('type' in additionalProperties)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof additionalProperties === 'object' ? additionalProperties : {}),\n }\n }\n\n return additionalProperties\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :description=\"getPropertyDescription(property)\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,mBAAmB,eACvB,kBAAkB,QAAA,QAAQ,QAAA,eAAe,QAAA,QAAQ,CACnD;;;;;;;EAQA,MAAM,+BACJ,uBAIA,mBACG;GACH,MAAM,uBACJ,OAAO,0BAA0B,YAC7B,wBACA,QAAQ,OAAO,sBAAqB;AAE1C,OACE,OAAO,yBAAyB,YAChC,OAAO,qBAAqB,kCAAkC,YAC9D,qBAAqB,8BAA8B,MAAM,CAAC,SAAS,EAEnE,QAAO,GAAG,qBAAqB,8BAA8B,MAAM;AAIrE,OAAI,gBAAgB;IAClB,MAAM,WAAW,QAAQ,OAAO,eAAc;AAC9C,QAAI,UAAU,MACZ,QAAO,SAAS;;AAIpB,UAAO;;;;;;;;;EAUT,MAAM,wBACJ,mBACyB;AACzB,OAAI,CAAC,eACH;GAGF,MAAM,WAAW,QAAQ,OAAO,eAAc;AAC9C,OACE,YACA,UAAU,YACV,MAAM,QAAQ,SAAS,KAAK,IAC5B,SAAS,KAAK,SAAS,EAEvB,QAAO,SAAS;;;EAOpB,MAAM,2BAA2B,eAAe;AAC9C,OAAI,CAAC,aAAa,QAAA,OAAO,IAAI,CAAC,QAAA,OAAO,qBACnC;AAEF,UAAO,qBAAqB,QAAA,OAAO,cAAa;IACjD;;;;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cAAQ;yBADvB,YAgBmC,wBAAA;MAd3B;MACL,YAAA,QAAA;MACA,SAAA,QAAA;MACA,iBAAiB,QAAA;MACjB,wBAAwB;MACxB,eAAA,QAAA;MACA,UAAU,QAAA;MACV,aAAA,QAAA;MACA,gBAAgB,QAAA;MAChB,OAAA,QAAA;MACA,MAAM;MACN,SAAS,QAAA;MACT,aAAa,uBAAuB,SAAQ;MAC5C,QAAQ,kBAAkB,SAAQ;MAClC,eAAe,QAAA;;;;;;;;;;;;;;;;;;IAIJ,MAAA,aAAY,CAAC,QAAA,OAAM,IAAK,QAAA,OAAO,wBAAA,WAAA,EAC7C,YA0BmC,wBAAA;;KAzBhC,YAAA,QAAA;KACA,SAAA,QAAA;KACA,iBAAiB,QAAA;KACjB,wBAAiC,4BAAuC,QAAA,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMtH,eAAA,QAAA;KACA,UAAU,QAAA;KACV,aAAA,QAAA;KACA,gBAAA,QAAA;KACA,OAAA,QAAA;KACA,MAAe,4BAAuC,QAAA,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMrG,gBAAA;KACC,SAAS,QAAA;KACT,mBAAmB,yBAAA;KACnB,QAAQ,6BAA6B,QAAA,OAAO,qBAAoB;KAChE,eAAe,QAAA;KAChB,SAAQ"}
|
|
1
|
+
{"version":3,"file":"SchemaObjectProperties.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n\n if ('$ref' in property && typeof property.$ref === 'string') {\n return getResolvedRef(property) as SchemaObject\n }\n\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :description=\"getPropertyDescription(property)\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,mBAAmB,eACvB,kBAAkB,QAAA,QAAQ,QAAA,eAAe,QAAA,QAAQ,CACnD;;;;;;;EAQA,MAAM,+BACJ,uBAIA,mBACG;GACH,MAAM,uBACJ,OAAO,0BAA0B,YAC7B,wBACA,QAAQ,OAAO,sBAAqB;AAE1C,OACE,OAAO,yBAAyB,YAChC,OAAO,qBAAqB,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A,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMrG,gBAAA;KACC,SAAS,QAAA;KACT,mBAAmB,yBAAA;KACnB,QAAQ,6BAA6B,QAAA,OAAO,qBAAoB;KAChE,eAAe,QAAA;KAChB,SAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileHeader.vue.js","names":[],"sources":["../../src/components/MobileHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, ScalarIconButton } from '@scalar/components'\nimport { ScalarIconList, ScalarIconX } from '@scalar/icons'\n\ndefineProps<{\n breadcrumb: string\n isSidebarOpen: boolean\n showSidebar: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'toggleSidebar'): void\n}>()\n\ndefineSlots<{\n actions?(): never\n sidebar?(props: { sidebarClasses: string }): never\n search?(): never\n}>()\n\nconst variants = cva({\n base: 'lg:hidden items-center bg-b-1 sticky top-(--scalar-custom-header-height,0) z-10 [grid-area:header]',\n variants: {\n open: {\n true: 'h-(--refs-sidebar-height) custom-scrollbar flex flex-col',\n },\n },\n})\n</script>\n<template>\n <!-- Always render the desktop sidebar slot and let CSS handle breakpoints -->\n <slot\n v-bind=\"{\n sidebarClasses:\n 'hidden lg:flex sticky top-(--refs-header-height) h-(--refs-sidebar-height) w-(--refs-sidebar-width) [grid-area:navigation]',\n }\"\n name=\"sidebar\" />\n <div\n class=\"t-doc__header\"\n :class=\"variants({ open: isSidebarOpen })\">\n <header\n class=\"flex h-(--scalar-header-height) w-full items-center border-b bg-inherit px-2\">\n <ScalarIconButton\n v-if=\"showSidebar\"\n :icon=\"isSidebarOpen ? ScalarIconX : ScalarIconList\"\n :label=\"isSidebarOpen ? 'Close Menu' : 'Open Menu'\"\n size=\"md\"\n @click=\"emit('toggleSidebar')\" />\n\n <span\n v-if=\"showSidebar\"\n class=\"flex-1 text-sm font-medium whitespace-nowrap\">\n {{ breadcrumb }}\n </span>\n <slot\n v-else\n name=\"search\" />\n\n <div class=\"flex h-6 items-center gap-1 pl-1\">\n <slot name=\"actions\" />\n </div>\n </header>\n <!-- In mobile layout, render the sidebar slot into the header panel -->\n <slot\n v-if=\"isSidebarOpen\"\n v-bind=\"{\n sidebarClasses:\n 'overflow-y-auto custom-scrollbar min-h-0 flex-1 w-full border-none',\n }\"\n name=\"sidebar\" />\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"MobileHeader.vue.js","names":[],"sources":["../../src/components/MobileHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, ScalarIconButton } from '@scalar/components'\nimport { ScalarIconList, ScalarIconX } from '@scalar/icons'\n\ndefineProps<{\n breadcrumb: string\n isSidebarOpen: boolean\n showSidebar: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'toggleSidebar'): void\n}>()\n\ndefineSlots<{\n actions?(): never\n sidebar?(props: { sidebarClasses: string }): never\n search?(): never\n}>()\n\nconst variants = cva({\n base: 'lg:hidden items-center bg-b-1 sticky top-(--scalar-custom-header-height,0) z-10 [grid-area:header]',\n variants: {\n open: {\n true: 'h-(--refs-sidebar-height) custom-scrollbar flex flex-col z-50',\n },\n },\n})\n</script>\n<template>\n <!-- Always render the desktop sidebar slot and let CSS handle breakpoints -->\n <slot\n v-bind=\"{\n sidebarClasses:\n 'hidden lg:flex sticky top-(--refs-header-height) h-(--refs-sidebar-height) w-(--refs-sidebar-width) [grid-area:navigation]',\n }\"\n name=\"sidebar\" />\n <div\n class=\"t-doc__header\"\n :class=\"variants({ open: isSidebarOpen })\">\n <header\n class=\"flex h-(--scalar-header-height) w-full items-center border-b bg-inherit px-2\">\n <ScalarIconButton\n v-if=\"showSidebar\"\n :icon=\"isSidebarOpen ? ScalarIconX : ScalarIconList\"\n :label=\"isSidebarOpen ? 'Close Menu' : 'Open Menu'\"\n size=\"md\"\n @click=\"emit('toggleSidebar')\" />\n\n <span\n v-if=\"showSidebar\"\n class=\"flex-1 text-sm font-medium whitespace-nowrap\">\n {{ breadcrumb }}\n </span>\n <slot\n v-else\n name=\"search\" />\n\n <div class=\"flex h-6 items-center gap-1 pl-1\">\n <slot name=\"actions\" />\n </div>\n </header>\n <!-- In mobile layout, render the sidebar slot into the header panel -->\n <slot\n v-if=\"isSidebarOpen\"\n v-bind=\"{\n sidebarClasses:\n 'overflow-y-auto custom-scrollbar min-h-0 flex-1 w-full border-none',\n }\"\n name=\"sidebar\" />\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -20,7 +20,7 @@ var MobileHeader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
20
20
|
const emit = __emit;
|
|
21
21
|
const variants = cva({
|
|
22
22
|
base: "lg:hidden items-center bg-b-1 sticky top-(--scalar-custom-header-height,0) z-10 [grid-area:header]",
|
|
23
|
-
variants: { open: { true: "h-(--refs-sidebar-height) custom-scrollbar flex flex-col" } }
|
|
23
|
+
variants: { open: { true: "h-(--refs-sidebar-height) custom-scrollbar flex flex-col z-50" } }
|
|
24
24
|
});
|
|
25
25
|
return (_ctx, _cache) => {
|
|
26
26
|
return openBlock(), createElementBlock(Fragment, null, [renderSlot(_ctx.$slots, "sidebar", normalizeProps(guardReactiveProps({ sidebarClasses: "hidden lg:flex sticky top-(--refs-header-height) h-(--refs-sidebar-height) w-(--refs-sidebar-width) [grid-area:navigation]" }))), createElementVNode("div", { class: normalizeClass(["t-doc__header", unref(variants)({ open: __props.isSidebarOpen })]) }, [createElementVNode("header", _hoisted_1, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileHeader.vue.script.js","names":[],"sources":["../../src/components/MobileHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, ScalarIconButton } from '@scalar/components'\nimport { ScalarIconList, ScalarIconX } from '@scalar/icons'\n\ndefineProps<{\n breadcrumb: string\n isSidebarOpen: boolean\n showSidebar: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'toggleSidebar'): void\n}>()\n\ndefineSlots<{\n actions?(): never\n sidebar?(props: { sidebarClasses: string }): never\n search?(): never\n}>()\n\nconst variants = cva({\n base: 'lg:hidden items-center bg-b-1 sticky top-(--scalar-custom-header-height,0) z-10 [grid-area:header]',\n variants: {\n open: {\n true: 'h-(--refs-sidebar-height) custom-scrollbar flex flex-col',\n },\n },\n})\n</script>\n<template>\n <!-- Always render the desktop sidebar slot and let CSS handle breakpoints -->\n <slot\n v-bind=\"{\n sidebarClasses:\n 'hidden lg:flex sticky top-(--refs-header-height) h-(--refs-sidebar-height) w-(--refs-sidebar-width) [grid-area:navigation]',\n }\"\n name=\"sidebar\" />\n <div\n class=\"t-doc__header\"\n :class=\"variants({ open: isSidebarOpen })\">\n <header\n class=\"flex h-(--scalar-header-height) w-full items-center border-b bg-inherit px-2\">\n <ScalarIconButton\n v-if=\"showSidebar\"\n :icon=\"isSidebarOpen ? ScalarIconX : ScalarIconList\"\n :label=\"isSidebarOpen ? 'Close Menu' : 'Open Menu'\"\n size=\"md\"\n @click=\"emit('toggleSidebar')\" />\n\n <span\n v-if=\"showSidebar\"\n class=\"flex-1 text-sm font-medium whitespace-nowrap\">\n {{ breadcrumb }}\n </span>\n <slot\n v-else\n name=\"search\" />\n\n <div class=\"flex h-6 items-center gap-1 pl-1\">\n <slot name=\"actions\" />\n </div>\n </header>\n <!-- In mobile layout, render the sidebar slot into the header panel -->\n <slot\n v-if=\"isSidebarOpen\"\n v-bind=\"{\n sidebarClasses:\n 'overflow-y-auto custom-scrollbar min-h-0 flex-1 w-full border-none',\n }\"\n name=\"sidebar\" />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAUA,MAAM,OAAO;EAUb,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,MAAM,EACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"MobileHeader.vue.script.js","names":[],"sources":["../../src/components/MobileHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, ScalarIconButton } from '@scalar/components'\nimport { ScalarIconList, ScalarIconX } from '@scalar/icons'\n\ndefineProps<{\n breadcrumb: string\n isSidebarOpen: boolean\n showSidebar: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'toggleSidebar'): void\n}>()\n\ndefineSlots<{\n actions?(): never\n sidebar?(props: { sidebarClasses: string }): never\n search?(): never\n}>()\n\nconst variants = cva({\n base: 'lg:hidden items-center bg-b-1 sticky top-(--scalar-custom-header-height,0) z-10 [grid-area:header]',\n variants: {\n open: {\n true: 'h-(--refs-sidebar-height) custom-scrollbar flex flex-col z-50',\n },\n },\n})\n</script>\n<template>\n <!-- Always render the desktop sidebar slot and let CSS handle breakpoints -->\n <slot\n v-bind=\"{\n sidebarClasses:\n 'hidden lg:flex sticky top-(--refs-header-height) h-(--refs-sidebar-height) w-(--refs-sidebar-width) [grid-area:navigation]',\n }\"\n name=\"sidebar\" />\n <div\n class=\"t-doc__header\"\n :class=\"variants({ open: isSidebarOpen })\">\n <header\n class=\"flex h-(--scalar-header-height) w-full items-center border-b bg-inherit px-2\">\n <ScalarIconButton\n v-if=\"showSidebar\"\n :icon=\"isSidebarOpen ? ScalarIconX : ScalarIconList\"\n :label=\"isSidebarOpen ? 'Close Menu' : 'Open Menu'\"\n size=\"md\"\n @click=\"emit('toggleSidebar')\" />\n\n <span\n v-if=\"showSidebar\"\n class=\"flex-1 text-sm font-medium whitespace-nowrap\">\n {{ breadcrumb }}\n </span>\n <slot\n v-else\n name=\"search\" />\n\n <div class=\"flex h-6 items-center gap-1 pl-1\">\n <slot name=\"actions\" />\n </div>\n </header>\n <!-- In mobile layout, render the sidebar slot into the header panel -->\n <slot\n v-if=\"isSidebarOpen\"\n v-bind=\"{\n sidebarClasses:\n 'overflow-y-auto custom-scrollbar min-h-0 flex-1 w-full border-none',\n }\"\n name=\"sidebar\" />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAUA,MAAM,OAAO;EAUb,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,MAAM,EACJ,MAAM,iEACP,EACF;GACF,CAAA;;2DAIC,WAKmB,KAAA,QAAA,WAAA,eAAA,mBAJT,EAAA,gBAAA,8HAGP,CAAA,CAAA,CAAA,EAEH,mBAiCM,OAAA,EAhCJ,OAAK,eAAA,CAAC,iBACE,MAAA,SAAQ,CAAA,EAAA,MAAS,QAAA,eAAa,CAAA,CAAA,CAAA,EAAA,EAAA,CACtC,mBAqBS,UArBT,YAqBS;IAlBC,QAAA,eAAA,WAAA,EADR,YAKmC,MAAA,iBAAA,EAAA;;KAHhC,MAAM,QAAA,gBAAgB,MAAA,YAAW,GAAG,MAAA,eAAc;KAClD,OAAO,QAAA,gBAAa,eAAA;KACrB,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,gBAAA;;IAGN,QAAA,eAAA,WAAA,EADR,mBAIO,QAJP,YAIO,gBADF,QAAA,WAAU,EAAA,EAAA,IAEf,WAEkB,KAAA,QAAA,UAAA,EAAA,KAAA,GAAA,CAAA;IAElB,mBAEM,OAFN,YAEM,CADJ,WAAuB,KAAA,QAAA,UAAA,CAAA,CAAA;OAKnB,QAAA,gBADR,WAMmB,KAAA,QAAA,WAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAJT,EAAA,gBAAA,sEAGP,CAAA,CAAA,CAAA,GAAA,mBAAA,IAAA,KAAA,CAAA,EAAA,EAAA,CAAA,EAAA,GAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBody.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBody.vue"],"names":[],"mappings":"AAqRA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAcrG,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE;QACP,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;QACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;QACzD,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;KAChC,CAAA;CACF,CAAC;AAsGF,KAAK,gBAAgB,GAAG;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAyQxD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,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 RequestBody_vue_vue_type_script_setup_true_lang_default from "./RequestBody.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/features/Operation/components/RequestBody.vue
|
|
5
|
-
var RequestBody_default = /* @__PURE__ */ _plugin_vue_export_helper_default(RequestBody_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var RequestBody_default = /* @__PURE__ */ _plugin_vue_export_helper_default(RequestBody_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e475e108"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { RequestBody_default as default };
|
|
8
8
|
|