@scalar/api-reference 1.55.2 → 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.
Files changed (106) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +2 -0
  3. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  4. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
  5. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
  6. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +9 -7
  7. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
  8. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +4 -2
  9. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
  10. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js.map +1 -1
  11. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +9 -4
  12. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
  13. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts +2 -1
  14. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
  15. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
  16. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -1
  17. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +7 -3
  18. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
  19. package/dist/blocks/scalar-info-block/components/{OpenApiVersion.vue.d.ts → SpecificationVersion.vue.d.ts} +5 -2
  20. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.d.ts.map +1 -0
  21. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.js +7 -0
  22. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.js.map +1 -0
  23. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js +23 -0
  24. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js.map +1 -0
  25. package/dist/browser/standalone.js +275 -261
  26. package/dist/browser/webpack-stats.json +1 -1
  27. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts +1 -1
  28. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts.map +1 -1
  29. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js.map +1 -1
  30. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -1
  31. package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts +1 -1
  32. package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
  33. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
  34. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -1
  35. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
  36. package/dist/components/Anchor/Anchor.vue.js.map +1 -1
  37. package/dist/components/Anchor/Anchor.vue.script.js +1 -1
  38. package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
  39. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  40. package/dist/components/ApiReference.vue.js +1 -1
  41. package/dist/components/ApiReference.vue.js.map +1 -1
  42. package/dist/components/ApiReference.vue.script.js +20 -8
  43. package/dist/components/ApiReference.vue.script.js.map +1 -1
  44. package/dist/components/Badge/Badge.vue.js +1 -1
  45. package/dist/components/Badge/Badge.vue.js.map +1 -1
  46. package/dist/components/Badge/Badge.vue.script.js.map +1 -1
  47. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
  48. package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
  49. package/dist/components/Content/Auth/Auth.vue.script.js +3 -2
  50. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  51. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  52. package/dist/components/Content/Content.vue.js.map +1 -1
  53. package/dist/components/Content/Content.vue.script.js +23 -9
  54. package/dist/components/Content/Content.vue.script.js.map +1 -1
  55. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +2 -3
  56. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  57. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  58. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  59. package/dist/components/Content/Schema/Schema.vue.d.ts +2 -0
  60. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  61. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  62. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  63. package/dist/components/Content/Schema/Schema.vue.script.js +5 -0
  64. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  65. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  66. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  67. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +5 -3
  68. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  69. package/dist/components/MobileHeader.vue.js.map +1 -1
  70. package/dist/components/MobileHeader.vue.script.js +1 -1
  71. package/dist/components/MobileHeader.vue.script.js.map +1 -1
  72. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  73. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  74. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  75. package/dist/features/Operation/components/RequestBody.vue.script.js +1 -0
  76. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  77. package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -1
  78. package/dist/features/Search/helpers/create-fuse-instance.js +20 -12
  79. package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
  80. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  81. package/dist/features/Search/helpers/create-search-index.js +18 -8
  82. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  83. package/dist/features/Search/types.d.ts +6 -0
  84. package/dist/features/Search/types.d.ts.map +1 -1
  85. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
  86. package/dist/helpers/map-config-plugins.d.ts.map +1 -1
  87. package/dist/helpers/map-config-plugins.js +9 -1
  88. package/dist/helpers/map-config-plugins.js.map +1 -1
  89. package/dist/helpers/normalize-configurations.d.ts.map +1 -1
  90. package/dist/helpers/normalize-configurations.js +6 -6
  91. package/dist/helpers/normalize-configurations.js.map +1 -1
  92. package/dist/helpers/openapi.d.ts +34 -5
  93. package/dist/helpers/openapi.d.ts.map +1 -1
  94. package/dist/helpers/openapi.js +108 -66
  95. package/dist/helpers/openapi.js.map +1 -1
  96. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  97. package/dist/standalone/lib/html-api.js +10 -4
  98. package/dist/standalone/lib/html-api.js.map +1 -1
  99. package/dist/style.css +374 -1772
  100. package/dist/vue-styles.css +83 -83
  101. package/package.json +15 -13
  102. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.d.ts.map +0 -1
  103. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -7
  104. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js.map +0 -1
  105. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js +0 -19
  106. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,93 @@
1
1
  # @scalar/api-reference
2
2
 
3
+ ## 1.57.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#9211](https://github.com/scalar/scalar/pull/9211): feat: make `WorkspaceDocument` an union of OpenApiDocument and AsyncApiDocument
8
+
9
+ ### Patch Changes
10
+
11
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-reference): clean up deprecated document listeners on destroy
12
+
13
+ `createApiReference()` registered three document-level listeners
14
+ (`scalar:reload-references`, `scalar:destroy-references`,
15
+ `scalar:update-references-config`) but `destroy()` only unmounted the
16
+ Vue app — the listeners stayed attached forever. In environments that
17
+ mount and destroy instances repeatedly (notably the Astro integration's
18
+ `renderMode="client"` with view transitions), each navigation leaked
19
+ three permanent listeners on `document`.
20
+
21
+ Tie the listeners to an `AbortController` and abort it from `destroy()`
22
+ so they all come off in one shot.
23
+
24
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix: show "Download AsyncAPI Document" label for AsyncAPI documents
25
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix: rename the "OAS" version badge to "OpenAPI" and show an "AsyncAPI" badge for AsyncAPI documents
26
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-client): block invalid request URLs before send and surface `buildRequest` failures as results
27
+
28
+ Request construction now treats a bad merged URL as a first-class failure instead of throwing deep inside helpers. After `mergeUrls`, `resolveRequestFactoryUrl` rejects incomplete targets when strict mode applies: relative URLs, an empty server base, or path strings that still contain unresolved `{{variable}}` placeholders. Callers may set `allowMissingRequestServerBase` where a full absolute URL is intentionally optional (for example the embedded modal layout in `OperationBlock`, or API Reference `onBeforeRequest` hooks that build against the document origin).
29
+
30
+ `buildRequest` returns a `Result` (`ok` / `err`) with stable error codes such as `MISSING_REQUEST_SERVER_BASE`, `INVALID_REQUEST_FACTORY_URL`, and `BUILD_REQUEST_FAILED` for unexpected synchronous failures. Those failures are wrapped with `safeRun` from `@scalar/helpers`, which logs to `console.error` and maps throws to a string message on the result. The API Reference plugin path logs and skips `onBeforeRequest` when a preview request cannot be built, so user hooks never run against a half-built fetch payload.
31
+
32
+ Downstream packages (`api-client`, `api-reference`, `scalar-app` where applicable) unwrap the result, show toasts or logs, and avoid calling `sendRequest` until the URL is valid.
33
+
34
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-reference): improve search ranking for parameter, request-body, and model field names, including polymorphic (oneOf/anyOf/allOf) schemas
35
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix: resolve $ref in additionalProperties before rendering schema
36
+ - [#9211](https://github.com/scalar/scalar/pull/9211): chore: use the new schemas
37
+ - [#9211](https://github.com/scalar/scalar/pull/9211): Fix mobile sidebar z-index to ensure it appears above all content when open
38
+ - [#9211](https://github.com/scalar/scalar/pull/9211): Avoid repeating request body schema descriptions above collapsed overflow properties.
39
+ - [#9211](https://github.com/scalar/scalar/pull/9211): feat: add more analytics events
40
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix: agent scalar warnings
41
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-reference): lower badge style specificity
42
+ - [#9211](https://github.com/scalar/scalar/pull/9211): fix: posthog stream warning
43
+
44
+ ## 1.56.0
45
+
46
+ ### Minor Changes
47
+
48
+ - [#9018](https://github.com/scalar/scalar/pull/9018): feat: make `WorkspaceDocument` an union of OpenApiDocument and AsyncApiDocument
49
+
50
+ ### Patch Changes
51
+
52
+ - [#9164](https://github.com/scalar/scalar/pull/9164): fix(api-reference): clean up deprecated document listeners on destroy
53
+
54
+ `createApiReference()` registered three document-level listeners
55
+ (`scalar:reload-references`, `scalar:destroy-references`,
56
+ `scalar:update-references-config`) but `destroy()` only unmounted the
57
+ Vue app — the listeners stayed attached forever. In environments that
58
+ mount and destroy instances repeatedly (notably the Astro integration's
59
+ `renderMode="client"` with view transitions), each navigation leaked
60
+ three permanent listeners on `document`.
61
+
62
+ Tie the listeners to an `AbortController` and abort it from `destroy()`
63
+ so they all come off in one shot.
64
+
65
+ - [#9158](https://github.com/scalar/scalar/pull/9158): fix: show "Download AsyncAPI Document" label for AsyncAPI documents
66
+ - [#9159](https://github.com/scalar/scalar/pull/9159): fix: rename the "OAS" version badge to "OpenAPI" and show an "AsyncAPI" badge for AsyncAPI documents
67
+ - [#9184](https://github.com/scalar/scalar/pull/9184): fix(api-client): block invalid request URLs before send and surface `buildRequest` failures as results
68
+
69
+ Request construction now treats a bad merged URL as a first-class failure instead of throwing deep inside helpers. After `mergeUrls`, `resolveRequestFactoryUrl` rejects incomplete targets when strict mode applies: relative URLs, an empty server base, or path strings that still contain unresolved `{{variable}}` placeholders. Callers may set `allowMissingRequestServerBase` where a full absolute URL is intentionally optional (for example the embedded modal layout in `OperationBlock`, or API Reference `onBeforeRequest` hooks that build against the document origin).
70
+
71
+ `buildRequest` returns a `Result` (`ok` / `err`) with stable error codes such as `MISSING_REQUEST_SERVER_BASE`, `INVALID_REQUEST_FACTORY_URL`, and `BUILD_REQUEST_FAILED` for unexpected synchronous failures. Those failures are wrapped with `safeRun` from `@scalar/helpers`, which logs to `console.error` and maps throws to a string message on the result. The API Reference plugin path logs and skips `onBeforeRequest` when a preview request cannot be built, so user hooks never run against a half-built fetch payload.
72
+
73
+ Downstream packages (`api-client`, `api-reference`, `scalar-app` where applicable) unwrap the result, show toasts or logs, and avoid calling `sendRequest` until the URL is valid.
74
+
75
+ - [#9144](https://github.com/scalar/scalar/pull/9144): fix(api-reference): improve search ranking for parameter, request-body, and model field names, including polymorphic (oneOf/anyOf/allOf) schemas
76
+ - [#9192](https://github.com/scalar/scalar/pull/9192): fix: resolve $ref in additionalProperties before rendering schema
77
+ - [#8844](https://github.com/scalar/scalar/pull/8844): chore: use the new schemas
78
+ - [#9170](https://github.com/scalar/scalar/pull/9170): Fix mobile sidebar z-index to ensure it appears above all content when open
79
+ - [#9136](https://github.com/scalar/scalar/pull/9136): Avoid repeating request body schema descriptions above collapsed overflow properties.
80
+ - [#9125](https://github.com/scalar/scalar/pull/9125): feat: add more analytics events
81
+ - [#9120](https://github.com/scalar/scalar/pull/9120): fix: agent scalar warnings
82
+ - [#9111](https://github.com/scalar/scalar/pull/9111): fix(api-reference): lower badge style specificity
83
+ - [#9124](https://github.com/scalar/scalar/pull/9124): fix: posthog stream warning
84
+
85
+ ## 1.55.3
86
+
87
+ ### Patch Changes
88
+
89
+ - [#9095](https://github.com/scalar/scalar/pull/9095): fix(api-reference): use overflow-wrap break-word for tag labels
90
+
3
91
  ## 1.55.2
4
92
 
5
93
  ### Patch Changes
@@ -10,6 +10,8 @@ type __VLS_Props = {
10
10
  * so the link can point to the document.
11
11
  */
12
12
  documentUrl?: string;
13
+ /** The kind of document being rendered. Drives the button label. */
14
+ documentType?: 'openapi' | 'asyncapi';
13
15
  };
14
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
17
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"names":[],"mappings":"AAqMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIvE,KAAK,WAAW,GAAG;IACjB,kCAAkC;IAClC,oBAAoB,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAA;IACvE,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAgIF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"names":[],"mappings":"AAmNA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,kCAAkC;IAClC,oBAAoB,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAA;IACvE,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AA+IF,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 DownloadLink_vue_vue_type_script_setup_true_lang_default from "./DownloadLink.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/blocks/scalar-info-block/components/DownloadLink.vue
5
- var DownloadLink_default = /* @__PURE__ */ _plugin_vue_export_helper_default(DownloadLink_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-95e980e1"]]);
5
+ var DownloadLink_default = /* @__PURE__ */ _plugin_vue_export_helper_default(DownloadLink_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b258a15f"]]);
6
6
  //#endregion
7
7
  export { DownloadLink_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadLink.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\n\nimport Badge from '@/components/Badge/Badge.vue'\n\nconst { eventBus, documentDownloadType, documentUrl } = defineProps<{\n /** The document download type. */\n documentDownloadType: ApiReferenceConfiguration['documentDownloadType']\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /**\n * URL of the OpenAPI document. Required when documentDownloadType is 'direct'\n * so the link can point to the document.\n */\n documentUrl?: string\n}>()\n\n// The id is retrieved at the layout level.\nconst handleDownloadClick = (format: 'json' | 'yaml') => {\n eventBus.emit('ui:download:document', { format })\n}\n</script>\n<template>\n <div\n v-if=\"\n ['yaml', 'json', 'both'].includes(documentDownloadType) ||\n (documentDownloadType === 'direct' && documentUrl)\n \"\n class=\"download-container group\"\n :class=\"{\n 'download-both': documentDownloadType === 'both',\n }\">\n <!-- Direct link to the document -->\n <a\n v-if=\"documentDownloadType === 'direct' && documentUrl\"\n class=\"download-link download-button\"\n :href=\"documentUrl\">\n <span> Download OpenAPI Document </span>\n </a>\n\n <!-- JSON -->\n <button\n v-if=\"documentDownloadType === 'json' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('json')\">\n <span> Download OpenAPI Document </span>\n <Badge class=\"extension hidden group-hover:flex\">json</Badge>\n </button>\n\n <!-- YAML -->\n <button\n v-if=\"documentDownloadType === 'yaml' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('yaml')\">\n <span> Download OpenAPI Document </span>\n <Badge class=\"extension hidden group-hover:flex\">yaml</Badge>\n </button>\n </div>\n</template>\n\n<style scoped>\n@reference '@/style.css';\n\n.download-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 0.5px 8px;\n position: relative;\n width: fit-content;\n z-index: 1;\n}\n\n.download-container:has(:focus-visible)::before,\n.download-container.download-both:hover::before {\n content: '';\n width: calc(100% + 24px);\n height: 90px;\n position: absolute;\n top: -11px;\n left: -12px;\n border-radius: var(--scalar-radius-lg);\n box-shadow: var(--scalar-shadow-2);\n pointer-events: none;\n background: var(--scalar-background-1);\n}\n\n.download-button {\n color: var(--scalar-link-color);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: fit-content;\n padding: 0;\n position: relative;\n white-space: nowrap !important;\n\n outline: none;\n}\n\n.download-button::before {\n border-radius: var(--scalar-radius);\n content: '';\n height: calc(100% + 16px);\n left: -9px;\n position: absolute;\n top: -8px;\n width: calc(100% + 18px);\n}\n\n.download-button:last-of-type::before {\n width: calc(100% + 15px);\n}\n\n.download-button:hover::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.download-button:focus-visible::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n @apply outline;\n}\n\n.download-button span {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n align-items: center;\n display: flex;\n gap: 6px;\n line-height: 1.625;\n z-index: 1;\n}\n\n.download-button:hover span {\n text-decoration-color: var(--scalar-color-1, currentColor);\n color: var(--scalar-link-color-hover, var(--scalar-color-accent));\n -webkit-text-decoration: var(--scalar-text-decoration-hover);\n text-decoration: var(--scalar-text-decoration-hover);\n}\n\n/* Second button displayed when hovering over the download container */\n.download-button:nth-of-type(2) {\n @apply sr-only;\n}\n\n.download-container:has(:focus-visible) .download-button:nth-of-type(2),\n.download-container:hover .download-button:nth-of-type(2) {\n @apply not-sr-only;\n\n position: absolute;\n top: 42px;\n}\n\n.extension {\n z-index: 1;\n background: var(--scalar-link-color, var(--scalar-color-accent));\n color: var(--scalar-background-1);\n}\n.download-container:has(:focus-visible) .extension,\n.download-container:hover .extension {\n opacity: 1;\n}\n\n.download-link {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n}\n\n.download-link:hover {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n text-decoration-color: var(--font-color);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"DownloadLink.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport Badge from '@/components/Badge/Badge.vue'\n\nconst {\n eventBus,\n documentDownloadType,\n documentUrl,\n documentType = 'openapi',\n} = defineProps<{\n /** The document download type. */\n documentDownloadType: ApiReferenceConfiguration['documentDownloadType']\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /**\n * URL of the OpenAPI document. Required when documentDownloadType is 'direct'\n * so the link can point to the document.\n */\n documentUrl?: string\n /** The kind of document being rendered. Drives the button label. */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\nconst label = computed(() =>\n documentType === 'asyncapi'\n ? 'Download AsyncAPI Document'\n : 'Download OpenAPI Document',\n)\n\n// The id is retrieved at the layout level.\nconst handleDownloadClick = (format: 'json' | 'yaml') => {\n eventBus.emit('ui:download:document', { format })\n}\n</script>\n<template>\n <div\n v-if=\"\n ['yaml', 'json', 'both'].includes(documentDownloadType) ||\n (documentDownloadType === 'direct' && documentUrl)\n \"\n class=\"download-container group\"\n :class=\"{\n 'download-both': documentDownloadType === 'both',\n }\">\n <!-- Direct link to the document -->\n <a\n v-if=\"documentDownloadType === 'direct' && documentUrl\"\n class=\"download-link download-button\"\n :href=\"documentUrl\">\n <span>{{ label }}</span>\n </a>\n\n <!-- JSON -->\n <button\n v-if=\"documentDownloadType === 'json' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('json')\">\n <span>{{ label }}</span>\n <Badge class=\"extension hidden group-hover:flex\">json</Badge>\n </button>\n\n <!-- YAML -->\n <button\n v-if=\"documentDownloadType === 'yaml' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('yaml')\">\n <span>{{ label }}</span>\n <Badge class=\"extension hidden group-hover:flex\">yaml</Badge>\n </button>\n </div>\n</template>\n\n<style scoped>\n@reference '@/style.css';\n\n.download-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 0.5px 8px;\n position: relative;\n width: fit-content;\n z-index: 1;\n}\n\n.download-container:has(:focus-visible)::before,\n.download-container.download-both:hover::before {\n content: '';\n width: calc(100% + 24px);\n height: 90px;\n position: absolute;\n top: -11px;\n left: -12px;\n border-radius: var(--scalar-radius-lg);\n box-shadow: var(--scalar-shadow-2);\n pointer-events: none;\n background: var(--scalar-background-1);\n}\n\n.download-button {\n color: var(--scalar-link-color);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: fit-content;\n padding: 0;\n position: relative;\n white-space: nowrap !important;\n\n outline: none;\n}\n\n.download-button::before {\n border-radius: var(--scalar-radius);\n content: '';\n height: calc(100% + 16px);\n left: -9px;\n position: absolute;\n top: -8px;\n width: calc(100% + 18px);\n}\n\n.download-button:last-of-type::before {\n width: calc(100% + 15px);\n}\n\n.download-button:hover::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.download-button:focus-visible::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n @apply outline;\n}\n\n.download-button span {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n align-items: center;\n display: flex;\n gap: 6px;\n line-height: 1.625;\n z-index: 1;\n}\n\n.download-button:hover span {\n text-decoration-color: var(--scalar-color-1, currentColor);\n color: var(--scalar-link-color-hover, var(--scalar-color-accent));\n -webkit-text-decoration: var(--scalar-text-decoration-hover);\n text-decoration: var(--scalar-text-decoration-hover);\n}\n\n/* Second button displayed when hovering over the download container */\n.download-button:nth-of-type(2) {\n @apply sr-only;\n}\n\n.download-container:has(:focus-visible) .download-button:nth-of-type(2),\n.download-container:hover .download-button:nth-of-type(2) {\n @apply not-sr-only;\n\n position: absolute;\n top: 42px;\n}\n\n.extension {\n z-index: 1;\n background: var(--scalar-link-color, var(--scalar-color-accent));\n color: var(--scalar-background-1);\n}\n.download-container:has(:focus-visible) .extension,\n.download-container:hover .extension {\n opacity: 1;\n}\n\n.download-link {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n}\n\n.download-link:hover {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n text-decoration-color: var(--font-color);\n}\n</style>\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import Badge_default from "../../../components/Badge/Badge.vue.js";
2
- import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, withCtx, withModifiers } from "vue";
2
+ import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, withCtx, withModifiers } from "vue";
3
3
  //#region src/blocks/scalar-info-block/components/DownloadLink.vue?vue&type=script&setup=true&lang.ts
4
4
  var _hoisted_1 = ["href"];
5
5
  var DownloadLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -7,9 +7,11 @@ var DownloadLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
7
7
  props: {
8
8
  documentDownloadType: {},
9
9
  eventBus: {},
10
- documentUrl: {}
10
+ documentUrl: {},
11
+ documentType: { default: "openapi" }
11
12
  },
12
13
  setup(__props) {
14
+ const label = computed(() => __props.documentType === "asyncapi" ? "Download AsyncAPI Document" : "Download OpenAPI Document");
13
15
  const handleDownloadClick = (format) => {
14
16
  __props.eventBus.emit("ui:download:document", { format });
15
17
  };
@@ -26,14 +28,14 @@ var DownloadLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
26
28
  key: 0,
27
29
  class: "download-link download-button",
28
30
  href: __props.documentUrl
29
- }, [..._cache[2] || (_cache[2] = [createElementVNode("span", null, " Download OpenAPI Document ", -1)])], 8, _hoisted_1)) : createCommentVNode("", true),
31
+ }, [createElementVNode("span", null, toDisplayString(label.value), 1)], 8, _hoisted_1)) : createCommentVNode("", true),
30
32
  __props.documentDownloadType === "json" || __props.documentDownloadType === "both" ? (openBlock(), createElementBlock("button", {
31
33
  key: 1,
32
34
  class: "download-button",
33
35
  type: "button",
34
36
  onClick: _cache[0] || (_cache[0] = withModifiers(() => handleDownloadClick("json"), ["prevent"]))
35
- }, [_cache[4] || (_cache[4] = createElementVNode("span", null, " Download OpenAPI Document ", -1)), createVNode(Badge_default, { class: "extension hidden group-hover:flex" }, {
36
- default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("json", -1)])]),
37
+ }, [createElementVNode("span", null, toDisplayString(label.value), 1), createVNode(Badge_default, { class: "extension hidden group-hover:flex" }, {
38
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("json", -1)])]),
37
39
  _: 1
38
40
  })])) : createCommentVNode("", true),
39
41
  __props.documentDownloadType === "yaml" || __props.documentDownloadType === "both" ? (openBlock(), createElementBlock("button", {
@@ -41,8 +43,8 @@ var DownloadLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
41
43
  class: "download-button",
42
44
  type: "button",
43
45
  onClick: _cache[1] || (_cache[1] = withModifiers(() => handleDownloadClick("yaml"), ["prevent"]))
44
- }, [_cache[6] || (_cache[6] = createElementVNode("span", null, " Download OpenAPI Document ", -1)), createVNode(Badge_default, { class: "extension hidden group-hover:flex" }, {
45
- default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("yaml", -1)])]),
46
+ }, [createElementVNode("span", null, toDisplayString(label.value), 1), createVNode(Badge_default, { class: "extension hidden group-hover:flex" }, {
47
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("yaml", -1)])]),
46
48
  _: 1
47
49
  })])) : createCommentVNode("", true)
48
50
  ], 2)) : createCommentVNode("", true);
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadLink.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\n\nimport Badge from '@/components/Badge/Badge.vue'\n\nconst { eventBus, documentDownloadType, documentUrl } = defineProps<{\n /** The document download type. */\n documentDownloadType: ApiReferenceConfiguration['documentDownloadType']\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /**\n * URL of the OpenAPI document. Required when documentDownloadType is 'direct'\n * so the link can point to the document.\n */\n documentUrl?: string\n}>()\n\n// The id is retrieved at the layout level.\nconst handleDownloadClick = (format: 'json' | 'yaml') => {\n eventBus.emit('ui:download:document', { format })\n}\n</script>\n<template>\n <div\n v-if=\"\n ['yaml', 'json', 'both'].includes(documentDownloadType) ||\n (documentDownloadType === 'direct' && documentUrl)\n \"\n class=\"download-container group\"\n :class=\"{\n 'download-both': documentDownloadType === 'both',\n }\">\n <!-- Direct link to the document -->\n <a\n v-if=\"documentDownloadType === 'direct' && documentUrl\"\n class=\"download-link download-button\"\n :href=\"documentUrl\">\n <span> Download OpenAPI Document </span>\n </a>\n\n <!-- JSON -->\n <button\n v-if=\"documentDownloadType === 'json' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('json')\">\n <span> Download OpenAPI Document </span>\n <Badge class=\"extension hidden group-hover:flex\">json</Badge>\n </button>\n\n <!-- YAML -->\n <button\n v-if=\"documentDownloadType === 'yaml' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('yaml')\">\n <span> Download OpenAPI Document </span>\n <Badge class=\"extension hidden group-hover:flex\">yaml</Badge>\n </button>\n </div>\n</template>\n\n<style scoped>\n@reference '@/style.css';\n\n.download-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 0.5px 8px;\n position: relative;\n width: fit-content;\n z-index: 1;\n}\n\n.download-container:has(:focus-visible)::before,\n.download-container.download-both:hover::before {\n content: '';\n width: calc(100% + 24px);\n height: 90px;\n position: absolute;\n top: -11px;\n left: -12px;\n border-radius: var(--scalar-radius-lg);\n box-shadow: var(--scalar-shadow-2);\n pointer-events: none;\n background: var(--scalar-background-1);\n}\n\n.download-button {\n color: var(--scalar-link-color);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: fit-content;\n padding: 0;\n position: relative;\n white-space: nowrap !important;\n\n outline: none;\n}\n\n.download-button::before {\n border-radius: var(--scalar-radius);\n content: '';\n height: calc(100% + 16px);\n left: -9px;\n position: absolute;\n top: -8px;\n width: calc(100% + 18px);\n}\n\n.download-button:last-of-type::before {\n width: calc(100% + 15px);\n}\n\n.download-button:hover::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.download-button:focus-visible::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n @apply outline;\n}\n\n.download-button span {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n align-items: center;\n display: flex;\n gap: 6px;\n line-height: 1.625;\n z-index: 1;\n}\n\n.download-button:hover span {\n text-decoration-color: var(--scalar-color-1, currentColor);\n color: var(--scalar-link-color-hover, var(--scalar-color-accent));\n -webkit-text-decoration: var(--scalar-text-decoration-hover);\n text-decoration: var(--scalar-text-decoration-hover);\n}\n\n/* Second button displayed when hovering over the download container */\n.download-button:nth-of-type(2) {\n @apply sr-only;\n}\n\n.download-container:has(:focus-visible) .download-button:nth-of-type(2),\n.download-container:hover .download-button:nth-of-type(2) {\n @apply not-sr-only;\n\n position: absolute;\n top: 42px;\n}\n\n.extension {\n z-index: 1;\n background: var(--scalar-link-color, var(--scalar-color-accent));\n color: var(--scalar-background-1);\n}\n.download-container:has(:focus-visible) .extension,\n.download-container:hover .extension {\n opacity: 1;\n}\n\n.download-link {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n}\n\n.download-link:hover {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n text-decoration-color: var(--font-color);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;EAmBA,MAAM,uBAAuB,WAA4B;AACvD,WAAA,SAAS,KAAK,wBAAwB,EAAE,QAAQ,CAAA;;;;;;;KAKR,SAAS,QAAA,qBAAoB,IAAY,QAAA,yBAAoB,YAAiB,QAAA,eAAA,WAAA,EADtH,mBAoCM,OAAA;;IA/BJ,OAAK,eAAA,CAAC,4BAA0B,EAAA,iBACC,QAAA,yBAAoB,QAAA,CAAA,CAAA;;IAK7C,QAAA,yBAAoB,YAAiB,QAAA,eAAA,WAAA,EAD7C,mBAKI,KAAA;;KAHF,OAAM;KACL,MAAM,QAAA;sCACP,mBAAwC,QAAA,MAAlC,+BAA2B,GAAA,CAAA,EAAA,EAAA,GAAA,WAAA,IAAA,mBAAA,IAAA,KAAA;IAK3B,QAAA,yBAAoB,UAAe,QAAA,yBAAoB,UAAA,WAAA,EAD/D,mBAOS,UAAA;;KALP,OAAM;KACN,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAgB,oBAAmB,OAAA,EAAA,CAAA,UAAA,CAAA;kCACzC,mBAAwC,QAAA,MAAlC,+BAA2B,GAAA,GACjC,YAA6D,eAAA,EAAtD,OAAM,qCAAmC,EAAA;4BAAK,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAJ,QAAI,GAAA,CAAA,EAAA,CAAA;;;IAK/C,QAAA,yBAAoB,UAAe,QAAA,yBAAoB,UAAA,WAAA,EAD/D,mBAOS,UAAA;;KALP,OAAM;KACN,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAgB,oBAAmB,OAAA,EAAA,CAAA,UAAA,CAAA;kCACzC,mBAAwC,QAAA,MAAlC,+BAA2B,GAAA,GACjC,YAA6D,eAAA,EAAtD,OAAM,qCAAmC,EAAA;4BAAK,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAJ,QAAI,GAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"DownloadLink.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/DownloadLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport Badge from '@/components/Badge/Badge.vue'\n\nconst {\n eventBus,\n documentDownloadType,\n documentUrl,\n documentType = 'openapi',\n} = defineProps<{\n /** The document download type. */\n documentDownloadType: ApiReferenceConfiguration['documentDownloadType']\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /**\n * URL of the OpenAPI document. Required when documentDownloadType is 'direct'\n * so the link can point to the document.\n */\n documentUrl?: string\n /** The kind of document being rendered. Drives the button label. */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\nconst label = computed(() =>\n documentType === 'asyncapi'\n ? 'Download AsyncAPI Document'\n : 'Download OpenAPI Document',\n)\n\n// The id is retrieved at the layout level.\nconst handleDownloadClick = (format: 'json' | 'yaml') => {\n eventBus.emit('ui:download:document', { format })\n}\n</script>\n<template>\n <div\n v-if=\"\n ['yaml', 'json', 'both'].includes(documentDownloadType) ||\n (documentDownloadType === 'direct' && documentUrl)\n \"\n class=\"download-container group\"\n :class=\"{\n 'download-both': documentDownloadType === 'both',\n }\">\n <!-- Direct link to the document -->\n <a\n v-if=\"documentDownloadType === 'direct' && documentUrl\"\n class=\"download-link download-button\"\n :href=\"documentUrl\">\n <span>{{ label }}</span>\n </a>\n\n <!-- JSON -->\n <button\n v-if=\"documentDownloadType === 'json' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('json')\">\n <span>{{ label }}</span>\n <Badge class=\"extension hidden group-hover:flex\">json</Badge>\n </button>\n\n <!-- YAML -->\n <button\n v-if=\"documentDownloadType === 'yaml' || documentDownloadType === 'both'\"\n class=\"download-button\"\n type=\"button\"\n @click.prevent=\"() => handleDownloadClick('yaml')\">\n <span>{{ label }}</span>\n <Badge class=\"extension hidden group-hover:flex\">yaml</Badge>\n </button>\n </div>\n</template>\n\n<style scoped>\n@reference '@/style.css';\n\n.download-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 0.5px 8px;\n position: relative;\n width: fit-content;\n z-index: 1;\n}\n\n.download-container:has(:focus-visible)::before,\n.download-container.download-both:hover::before {\n content: '';\n width: calc(100% + 24px);\n height: 90px;\n position: absolute;\n top: -11px;\n left: -12px;\n border-radius: var(--scalar-radius-lg);\n box-shadow: var(--scalar-shadow-2);\n pointer-events: none;\n background: var(--scalar-background-1);\n}\n\n.download-button {\n color: var(--scalar-link-color);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: fit-content;\n padding: 0;\n position: relative;\n white-space: nowrap !important;\n\n outline: none;\n}\n\n.download-button::before {\n border-radius: var(--scalar-radius);\n content: '';\n height: calc(100% + 16px);\n left: -9px;\n position: absolute;\n top: -8px;\n width: calc(100% + 18px);\n}\n\n.download-button:last-of-type::before {\n width: calc(100% + 15px);\n}\n\n.download-button:hover::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.download-button:focus-visible::before {\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n @apply outline;\n}\n\n.download-button span {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n align-items: center;\n display: flex;\n gap: 6px;\n line-height: 1.625;\n z-index: 1;\n}\n\n.download-button:hover span {\n text-decoration-color: var(--scalar-color-1, currentColor);\n color: var(--scalar-link-color-hover, var(--scalar-color-accent));\n -webkit-text-decoration: var(--scalar-text-decoration-hover);\n text-decoration: var(--scalar-text-decoration-hover);\n}\n\n/* Second button displayed when hovering over the download container */\n.download-button:nth-of-type(2) {\n @apply sr-only;\n}\n\n.download-container:has(:focus-visible) .download-button:nth-of-type(2),\n.download-container:hover .download-button:nth-of-type(2) {\n @apply not-sr-only;\n\n position: absolute;\n top: 42px;\n}\n\n.extension {\n z-index: 1;\n background: var(--scalar-link-color, var(--scalar-color-accent));\n color: var(--scalar-background-1);\n}\n.download-container:has(:focus-visible) .extension,\n.download-container:hover .extension {\n opacity: 1;\n}\n\n.download-link {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n --font-visited: var(--scalar-link-color-visited, var(--scalar-color-2));\n\n text-decoration: var(--scalar-text-decoration);\n color: var(--font-color);\n font-weight: var(--scalar-link-font-weight, var(--scalar-semibold));\n text-underline-offset: 0.25rem;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--font-color) 30%, transparent);\n}\n\n.download-link:hover {\n --font-color: var(--scalar-link-color, var(--scalar-color-accent));\n text-decoration-color: var(--font-color);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EA0BA,MAAM,QAAQ,eACZ,QAAA,iBAAiB,aACb,+BACA,4BACN;EAGA,MAAM,uBAAuB,WAA4B;AACvD,WAAA,SAAS,KAAK,wBAAwB,EAAE,QAAQ,CAAA;;;;;;;KAKR,SAAS,QAAA,qBAAoB,IAAY,QAAA,yBAAoB,YAAiB,QAAA,eAAA,WAAA,EADtH,mBAoCM,OAAA;;IA/BJ,OAAK,eAAA,CAAC,4BAA0B,EAAA,iBACC,QAAA,yBAAoB,QAAA,CAAA,CAAA;;IAK7C,QAAA,yBAAoB,YAAiB,QAAA,eAAA,WAAA,EAD7C,mBAKI,KAAA;;KAHF,OAAM;KACL,MAAM,QAAA;QACP,mBAAwB,QAAA,MAAA,gBAAf,MAAA,MAAK,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,IAAA,mBAAA,IAAA,KAAA;IAKR,QAAA,yBAAoB,UAAe,QAAA,yBAAoB,UAAA,WAAA,EAD/D,mBAOS,UAAA;;KALP,OAAM;KACN,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAgB,oBAAmB,OAAA,EAAA,CAAA,UAAA,CAAA;QACzC,mBAAwB,QAAA,MAAA,gBAAf,MAAA,MAAK,EAAA,EAAA,EACd,YAA6D,eAAA,EAAtD,OAAM,qCAAmC,EAAA;4BAAK,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAJ,QAAI,GAAA,CAAA,EAAA,CAAA;;;IAK/C,QAAA,yBAAoB,UAAe,QAAA,yBAAoB,UAAA,WAAA,EAD/D,mBAOS,UAAA;;KALP,OAAM;KACN,MAAK;KACJ,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAgB,oBAAmB,OAAA,EAAA,CAAA,UAAA,CAAA;QACzC,mBAAwB,QAAA,MAAA,gBAAf,MAAA,MAAK,EAAA,EAAA,EACd,YAA6D,eAAA,EAAtD,OAAM,qCAAmC,EAAA;4BAAK,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAJ,QAAI,GAAA,CAAA,EAAA,CAAA"}
@@ -5,8 +5,8 @@ import type { ExternalDocumentationObject, InfoObject } from '@scalar/workspace-
5
5
  type __VLS_Props = {
6
6
  /** Optional unique identifier for the info block. */
7
7
  id?: string;
8
- /** Original openapi version of the input document */
9
- oasVersion?: string;
8
+ /** Original specification version of the input document (OpenAPI or AsyncAPI). */
9
+ specificationVersion?: string;
10
10
  /** The Info object from the OpenAPI document. */
11
11
  info: InfoObject | undefined;
12
12
  /** The external documentation object from the OpenAPI document, if present. */
@@ -25,6 +25,8 @@ type __VLS_Props = {
25
25
  documentDownloadType?: ApiReferenceConfiguration['documentDownloadType'];
26
26
  /** URL of the OpenAPI document. Used when documentDownloadType is 'direct'. */
27
27
  documentUrl?: string;
28
+ /** The kind of document being rendered. Drives download button labels. */
29
+ documentType?: 'openapi' | 'asyncapi';
28
30
  };
29
31
  declare var __VLS_15: {};
30
32
  type __VLS_Slots = {} & {
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"names":[],"mappings":"AAkFA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,2BAA2B,EAC3B,UAAU,EACX,MAAM,8DAA8D,CAAA;AAQrE,KAAK,WAAW,GAAG;IACjB,qDAAqD;IACrD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iDAAiD;IACjD,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,iDAAiD;IACjD,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAA;IACxE,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAoGF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKlD,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"InfoBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"names":[],"mappings":"AAuFA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,2BAA2B,EAC3B,UAAU,EACX,MAAM,8DAA8D,CAAA;AAQrE,KAAK,WAAW,GAAG;IACjB,qDAAqD;IACrD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,iDAAiD;IACjD,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,iDAAiD;IACjD,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAA;IACxE,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AAyGF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKlD,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBlock.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport DownloadLink from '@/blocks/scalar-info-block/components/DownloadLink.vue'\n\nimport IntroductionCard from './IntroductionCard.vue'\nimport IntroductionLayout from './IntroductionLayout.vue'\n\nconst {\n headingSlugGenerator,\n layout,\n eventBus,\n documentDownloadType = 'both',\n documentUrl,\n} = defineProps<{\n /** Optional unique identifier for the info block. */\n id?: string\n /** Original openapi version of the input document */\n oasVersion?: string\n /** The Info object from the OpenAPI document. */\n info: InfoObject | undefined\n /** The external documentation object from the OpenAPI document, if present. */\n externalDocs?: ExternalDocumentationObject\n /** OpenAPI extension fields at the document level. */\n documentExtensions?: Record<string, unknown>\n /** OpenAPI extension fields at the info object level. */\n infoExtensions?: Record<string, unknown>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n /** Determines the layout style for the info block ('modern' or 'classic'). */\n layout?: 'modern' | 'classic'\n /** The document download type. */\n documentDownloadType?: ApiReferenceConfiguration['documentDownloadType']\n /** URL of the OpenAPI document. Used when documentDownloadType is 'direct'. */\n documentUrl?: string\n}>()\n\n/**\n * Put the selectors in\n * - the after slot for classic layout,\n * - and the aside slot for other layouts.\n */\nconst introCardsSlot = computed(() =>\n layout === 'classic' ? 'after' : 'aside',\n)\n</script>\n\n<template>\n <IntroductionLayout\n :id\n :documentExtensions\n :eventBus=\"eventBus\"\n :externalDocs\n :headingSlugGenerator\n :info\n :infoExtensions\n :oasVersion>\n <template #[introCardsSlot]>\n <IntroductionCard :row=\"layout === 'classic'\">\n <slot name=\"selectors\" />\n </IntroductionCard>\n </template>\n <template #download-link>\n <DownloadLink\n :documentDownloadType\n :documentUrl\n :eventBus />\n </template>\n </IntroductionLayout>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"InfoBlock.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport DownloadLink from '@/blocks/scalar-info-block/components/DownloadLink.vue'\n\nimport IntroductionCard from './IntroductionCard.vue'\nimport IntroductionLayout from './IntroductionLayout.vue'\n\nconst {\n headingSlugGenerator,\n layout,\n eventBus,\n documentDownloadType = 'both',\n documentUrl,\n documentType,\n} = defineProps<{\n /** Optional unique identifier for the info block. */\n id?: string\n /** Original specification version of the input document (OpenAPI or AsyncAPI). */\n specificationVersion?: string\n /** The Info object from the OpenAPI document. */\n info: InfoObject | undefined\n /** The external documentation object from the OpenAPI document, if present. */\n externalDocs?: ExternalDocumentationObject\n /** OpenAPI extension fields at the document level. */\n documentExtensions?: Record<string, unknown>\n /** OpenAPI extension fields at the info object level. */\n infoExtensions?: Record<string, unknown>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n /** Determines the layout style for the info block ('modern' or 'classic'). */\n layout?: 'modern' | 'classic'\n /** The document download type. */\n documentDownloadType?: ApiReferenceConfiguration['documentDownloadType']\n /** URL of the OpenAPI document. Used when documentDownloadType is 'direct'. */\n documentUrl?: string\n /** The kind of document being rendered. Drives download button labels. */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\n/**\n * Put the selectors in\n * - the after slot for classic layout,\n * - and the aside slot for other layouts.\n */\nconst introCardsSlot = computed(() =>\n layout === 'classic' ? 'after' : 'aside',\n)\n</script>\n\n<template>\n <IntroductionLayout\n :id\n :documentExtensions\n :documentType\n :eventBus=\"eventBus\"\n :externalDocs\n :headingSlugGenerator\n :info\n :infoExtensions\n :specificationVersion>\n <template #[introCardsSlot]>\n <IntroductionCard :row=\"layout === 'classic'\">\n <slot name=\"selectors\" />\n </IntroductionCard>\n </template>\n <template #download-link>\n <DownloadLink\n :documentDownloadType\n :documentType\n :documentUrl\n :eventBus />\n </template>\n </IntroductionLayout>\n</template>\n"],"mappings":""}
@@ -7,7 +7,7 @@ var InfoBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
7
7
  __name: "InfoBlock",
8
8
  props: {
9
9
  id: {},
10
- oasVersion: {},
10
+ specificationVersion: {},
11
11
  info: {},
12
12
  externalDocs: {},
13
13
  documentExtensions: {},
@@ -16,7 +16,8 @@ var InfoBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
16
16
  headingSlugGenerator: { type: Function },
17
17
  layout: {},
18
18
  documentDownloadType: { default: "both" },
19
- documentUrl: {}
19
+ documentUrl: {},
20
+ documentType: {}
20
21
  },
21
22
  setup(__props) {
22
23
  /**
@@ -29,12 +30,13 @@ var InfoBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
29
30
  return openBlock(), createBlock(IntroductionLayout_default, {
30
31
  id: __props.id,
31
32
  documentExtensions: __props.documentExtensions,
33
+ documentType: __props.documentType,
32
34
  eventBus: __props.eventBus,
33
35
  externalDocs: __props.externalDocs,
34
36
  headingSlugGenerator: __props.headingSlugGenerator,
35
37
  info: __props.info,
36
38
  infoExtensions: __props.infoExtensions,
37
- oasVersion: __props.oasVersion
39
+ specificationVersion: __props.specificationVersion
38
40
  }, {
39
41
  [introCardsSlot.value]: withCtx(() => [createVNode(IntroductionCard_default, { row: __props.layout === "classic" }, {
40
42
  default: withCtx(() => [renderSlot(_ctx.$slots, "selectors")]),
@@ -42,10 +44,12 @@ var InfoBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
42
44
  }, 8, ["row"])]),
43
45
  "download-link": withCtx(() => [createVNode(DownloadLink_default, {
44
46
  documentDownloadType: __props.documentDownloadType,
47
+ documentType: __props.documentType,
45
48
  documentUrl: __props.documentUrl,
46
49
  eventBus: __props.eventBus
47
50
  }, null, 8, [
48
51
  "documentDownloadType",
52
+ "documentType",
49
53
  "documentUrl",
50
54
  "eventBus"
51
55
  ])]),
@@ -53,12 +57,13 @@ var InfoBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
53
57
  }, 1032, [
54
58
  "id",
55
59
  "documentExtensions",
60
+ "documentType",
56
61
  "eventBus",
57
62
  "externalDocs",
58
63
  "headingSlugGenerator",
59
64
  "info",
60
65
  "infoExtensions",
61
- "oasVersion"
66
+ "specificationVersion"
62
67
  ]);
63
68
  };
64
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBlock.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport DownloadLink from '@/blocks/scalar-info-block/components/DownloadLink.vue'\n\nimport IntroductionCard from './IntroductionCard.vue'\nimport IntroductionLayout from './IntroductionLayout.vue'\n\nconst {\n headingSlugGenerator,\n layout,\n eventBus,\n documentDownloadType = 'both',\n documentUrl,\n} = defineProps<{\n /** Optional unique identifier for the info block. */\n id?: string\n /** Original openapi version of the input document */\n oasVersion?: string\n /** The Info object from the OpenAPI document. */\n info: InfoObject | undefined\n /** The external documentation object from the OpenAPI document, if present. */\n externalDocs?: ExternalDocumentationObject\n /** OpenAPI extension fields at the document level. */\n documentExtensions?: Record<string, unknown>\n /** OpenAPI extension fields at the info object level. */\n infoExtensions?: Record<string, unknown>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n /** Determines the layout style for the info block ('modern' or 'classic'). */\n layout?: 'modern' | 'classic'\n /** The document download type. */\n documentDownloadType?: ApiReferenceConfiguration['documentDownloadType']\n /** URL of the OpenAPI document. Used when documentDownloadType is 'direct'. */\n documentUrl?: string\n}>()\n\n/**\n * Put the selectors in\n * - the after slot for classic layout,\n * - and the aside slot for other layouts.\n */\nconst introCardsSlot = computed(() =>\n layout === 'classic' ? 'after' : 'aside',\n)\n</script>\n\n<template>\n <IntroductionLayout\n :id\n :documentExtensions\n :eventBus=\"eventBus\"\n :externalDocs\n :headingSlugGenerator\n :info\n :infoExtensions\n :oasVersion>\n <template #[introCardsSlot]>\n <IntroductionCard :row=\"layout === 'classic'\">\n <slot name=\"selectors\" />\n </IntroductionCard>\n </template>\n <template #download-link>\n <DownloadLink\n :documentDownloadType\n :documentUrl\n :eventBus />\n </template>\n </IntroductionLayout>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,iBAAiB,eACrB,QAAA,WAAW,YAAY,UAAU,QACnC;;uBAIE,YAoBqB,4BAAA;IAnBlB,IAAA,QAAA;IACA,oBAAA,QAAA;IACA,UAAU,QAAA;IACV,cAAA,QAAA;IACA,sBAAA,QAAA;IACA,MAAA,QAAA;IACA,gBAAA,QAAA;IACA,YAAA,QAAA;;KACU,eAAA,QAAgB,cAGN,CAFnB,YAEmB,0BAAA,EAFA,KAAK,QAAA,WAAM,WAAA,EAAA;4BACH,CAAzB,WAAyB,KAAA,QAAA,YAAA,CAAA,CAAA;;;IAGlB,iBAAa,cAIR,CAHd,YAGc,sBAAA;KAFX,sBAAA,QAAA;KACA,aAAA,QAAA;KACA,UAAA,QAAA"}
1
+ {"version":3,"file":"InfoBlock.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/InfoBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport DownloadLink from '@/blocks/scalar-info-block/components/DownloadLink.vue'\n\nimport IntroductionCard from './IntroductionCard.vue'\nimport IntroductionLayout from './IntroductionLayout.vue'\n\nconst {\n headingSlugGenerator,\n layout,\n eventBus,\n documentDownloadType = 'both',\n documentUrl,\n documentType,\n} = defineProps<{\n /** Optional unique identifier for the info block. */\n id?: string\n /** Original specification version of the input document (OpenAPI or AsyncAPI). */\n specificationVersion?: string\n /** The Info object from the OpenAPI document. */\n info: InfoObject | undefined\n /** The external documentation object from the OpenAPI document, if present. */\n externalDocs?: ExternalDocumentationObject\n /** OpenAPI extension fields at the document level. */\n documentExtensions?: Record<string, unknown>\n /** OpenAPI extension fields at the info object level. */\n infoExtensions?: Record<string, unknown>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n /** Determines the layout style for the info block ('modern' or 'classic'). */\n layout?: 'modern' | 'classic'\n /** The document download type. */\n documentDownloadType?: ApiReferenceConfiguration['documentDownloadType']\n /** URL of the OpenAPI document. Used when documentDownloadType is 'direct'. */\n documentUrl?: string\n /** The kind of document being rendered. Drives download button labels. */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\n/**\n * Put the selectors in\n * - the after slot for classic layout,\n * - and the aside slot for other layouts.\n */\nconst introCardsSlot = computed(() =>\n layout === 'classic' ? 'after' : 'aside',\n)\n</script>\n\n<template>\n <IntroductionLayout\n :id\n :documentExtensions\n :documentType\n :eventBus=\"eventBus\"\n :externalDocs\n :headingSlugGenerator\n :info\n :infoExtensions\n :specificationVersion>\n <template #[introCardsSlot]>\n <IntroductionCard :row=\"layout === 'classic'\">\n <slot name=\"selectors\" />\n </IntroductionCard>\n </template>\n <template #download-link>\n <DownloadLink\n :documentDownloadType\n :documentType\n :documentUrl\n :eventBus />\n </template>\n </IntroductionLayout>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDA,MAAM,iBAAiB,eACrB,QAAA,WAAW,YAAY,UAAU,QACnC;;uBAIE,YAsBqB,4BAAA;IArBlB,IAAA,QAAA;IACA,oBAAA,QAAA;IACA,cAAA,QAAA;IACA,UAAU,QAAA;IACV,cAAA,QAAA;IACA,sBAAA,QAAA;IACA,MAAA,QAAA;IACA,gBAAA,QAAA;IACA,sBAAA,QAAA;;KACU,eAAA,QAAgB,cAGN,CAFnB,YAEmB,0BAAA,EAFA,KAAK,QAAA,WAAM,WAAA,EAAA;4BACH,CAAzB,WAAyB,KAAA,QAAA,YAAA,CAAA,CAAA;;;IAGlB,iBAAa,cAKR,CAJd,YAIc,sBAAA;KAHX,sBAAA,QAAA;KACA,cAAA,QAAA;KACA,aAAA,QAAA;KACA,UAAA,QAAA"}
@@ -3,7 +3,8 @@ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
3
  import type { ExternalDocumentationObject, InfoObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
4
  type __VLS_Props = {
5
5
  id: string | undefined;
6
- oasVersion: string | undefined;
6
+ documentType?: 'openapi' | 'asyncapi';
7
+ specificationVersion: string | undefined;
7
8
  info: InfoObject | undefined;
8
9
  externalDocs?: ExternalDocumentationObject;
9
10
  documentExtensions?: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"IntroductionLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"names":[],"mappings":"AAmGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,2BAA2B,EAC3B,UAAU,EACX,MAAM,8DAA8D,CAAA;AAkBrE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AA8OF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK9C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"IntroductionLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"names":[],"mappings":"AAsGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,2BAA2B,EAC3B,UAAU,EACX,MAAM,8DAA8D,CAAA;AAkBrE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACrC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AAgPF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GACrD;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK9C,QAAA,MAAM,UAAU,kSAEd,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 IntroductionLayout_vue_vue_type_script_setup_true_lang_default from "./IntroductionLayout.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/blocks/scalar-info-block/components/IntroductionLayout.vue
5
- var IntroductionLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(IntroductionLayout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-0b1e2255"]]);
5
+ var IntroductionLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(IntroductionLayout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6c24d687"]]);
6
6
  //#endregion
7
7
  export { IntroductionLayout_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"IntroductionLayout.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport OpenApiVersion from './OpenApiVersion.vue'\n\ndefineProps<{\n id: string | undefined\n oasVersion: string | undefined\n info: InfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n aria-label=\"Introduction\"\n class=\"introduction-section z-1 gap-12\"\n @intersecting=\"\n () => id && eventBus?.emit('intersecting:nav-item', { id })\n \">\n <SectionContent :loading=\"!info\">\n <div class=\"flex gap-1.5\">\n <InfoVersion\n v-if=\"info\"\n :version=\"info?.version\" />\n <OpenApiVersion :oasVersion=\"oasVersion\" />\n </div>\n <SectionHeader\n :loading=\"!info?.title\"\n tight>\n <SectionHeaderTag :level=\"1\">\n {{ info?.title }}\n </SectionHeaderTag>\n <template #links>\n <InfoLinks\n v-if=\"info\"\n :externalDocs=\"externalDocs\"\n :info=\"info\" />\n </template>\n </SectionHeader>\n <SectionColumns>\n <SectionColumn>\n <slot name=\"download-link\" />\n <InfoDescription\n :description=\"info?.description\"\n :eventBus=\"eventBus\"\n :headingSlugGenerator=\"headingSlugGenerator\" />\n </SectionColumn>\n <SectionColumn v-if=\"$slots.aside\">\n <div class=\"sticky-cards\">\n <slot name=\"aside\" />\n </div>\n </SectionColumn>\n </SectionColumns>\n <SpecificationExtension :value=\"documentExtensions\" />\n <SpecificationExtension :value=\"infoExtensions\" />\n </SectionContent>\n <slot name=\"after\" />\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.sticky-cards {\n display: flex;\n flex-direction: column;\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"IntroductionLayout.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport SpecificationVersion from './SpecificationVersion.vue'\n\ndefineProps<{\n id: string | undefined\n documentType?: 'openapi' | 'asyncapi'\n specificationVersion: string | undefined\n info: InfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n aria-label=\"Introduction\"\n class=\"introduction-section z-1 gap-12\"\n @intersecting=\"\n () => id && eventBus?.emit('intersecting:nav-item', { id })\n \">\n <SectionContent :loading=\"!info\">\n <div class=\"flex gap-1.5\">\n <InfoVersion\n v-if=\"info\"\n :version=\"info?.version\" />\n <SpecificationVersion\n :documentType\n :version=\"specificationVersion\" />\n </div>\n <SectionHeader\n :loading=\"!info?.title\"\n tight>\n <SectionHeaderTag :level=\"1\">\n {{ info?.title }}\n </SectionHeaderTag>\n <template #links>\n <InfoLinks\n v-if=\"info\"\n :externalDocs=\"externalDocs\"\n :info=\"info\" />\n </template>\n </SectionHeader>\n <SectionColumns>\n <SectionColumn>\n <slot name=\"download-link\" />\n <InfoDescription\n :description=\"info?.description\"\n :eventBus=\"eventBus\"\n :headingSlugGenerator=\"headingSlugGenerator\" />\n </SectionColumn>\n <SectionColumn v-if=\"$slots.aside\">\n <div class=\"sticky-cards\">\n <slot name=\"aside\" />\n </div>\n </SectionColumn>\n </SectionColumns>\n <SpecificationExtension :value=\"documentExtensions\" />\n <SpecificationExtension :value=\"infoExtensions\" />\n </SectionContent>\n <slot name=\"after\" />\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.sticky-cards {\n display: flex;\n flex-direction: column;\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n</style>\n"],"mappings":""}
@@ -9,7 +9,7 @@ import SpecificationExtension_default from "../../../features/specification-exte
9
9
  import InfoDescription_default from "./InfoDescription.vue.js";
10
10
  import InfoLinks_default from "./InfoLinks.vue.js";
11
11
  import InfoVersion_default from "./InfoVersion.vue.js";
12
- import OpenApiVersion_default from "./OpenApiVersion.vue.js";
12
+ import SpecificationVersion_default from "./SpecificationVersion.vue.js";
13
13
  import { createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
14
14
  //#region src/blocks/scalar-info-block/components/IntroductionLayout.vue?vue&type=script&setup=true&lang.ts
15
15
  var _hoisted_1 = { class: "flex gap-1.5" };
@@ -18,7 +18,8 @@ var IntroductionLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
18
18
  __name: "IntroductionLayout",
19
19
  props: {
20
20
  id: {},
21
- oasVersion: {},
21
+ documentType: {},
22
+ specificationVersion: {},
22
23
  info: {},
23
24
  externalDocs: {},
24
25
  documentExtensions: {},
@@ -40,7 +41,10 @@ var IntroductionLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
40
41
  createElementVNode("div", _hoisted_1, [__props.info ? (openBlock(), createBlock(InfoVersion_default, {
41
42
  key: 0,
42
43
  version: __props.info?.version
43
- }, null, 8, ["version"])) : createCommentVNode("", true), createVNode(OpenApiVersion_default, { oasVersion: __props.oasVersion }, null, 8, ["oasVersion"])]),
44
+ }, null, 8, ["version"])) : createCommentVNode("", true), createVNode(SpecificationVersion_default, {
45
+ documentType: __props.documentType,
46
+ version: __props.specificationVersion
47
+ }, null, 8, ["documentType", "version"])]),
44
48
  createVNode(unref(SectionHeader_default), {
45
49
  loading: !__props.info?.title,
46
50
  tight: ""
@@ -1 +1 @@
1
- {"version":3,"file":"IntroductionLayout.vue.script.js","names":["$slots"],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport OpenApiVersion from './OpenApiVersion.vue'\n\ndefineProps<{\n id: string | undefined\n oasVersion: string | undefined\n info: InfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n aria-label=\"Introduction\"\n class=\"introduction-section z-1 gap-12\"\n @intersecting=\"\n () => id && eventBus?.emit('intersecting:nav-item', { id })\n \">\n <SectionContent :loading=\"!info\">\n <div class=\"flex gap-1.5\">\n <InfoVersion\n v-if=\"info\"\n :version=\"info?.version\" />\n <OpenApiVersion :oasVersion=\"oasVersion\" />\n </div>\n <SectionHeader\n :loading=\"!info?.title\"\n tight>\n <SectionHeaderTag :level=\"1\">\n {{ info?.title }}\n </SectionHeaderTag>\n <template #links>\n <InfoLinks\n v-if=\"info\"\n :externalDocs=\"externalDocs\"\n :info=\"info\" />\n </template>\n </SectionHeader>\n <SectionColumns>\n <SectionColumn>\n <slot name=\"download-link\" />\n <InfoDescription\n :description=\"info?.description\"\n :eventBus=\"eventBus\"\n :headingSlugGenerator=\"headingSlugGenerator\" />\n </SectionColumn>\n <SectionColumn v-if=\"$slots.aside\">\n <div class=\"sticky-cards\">\n <slot name=\"aside\" />\n </div>\n </SectionColumn>\n </SectionColumns>\n <SpecificationExtension :value=\"documentExtensions\" />\n <SpecificationExtension :value=\"infoExtensions\" />\n </SectionContent>\n <slot name=\"after\" />\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.sticky-cards {\n display: flex;\n flex-direction: column;\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAqCE,YAgDmB,MAAA,yBAAA,EAAA,MAAA;2BADP,CA7CV,YA6CU,MAAA,gBAAA,EAAA;KA5CP,IAAI,QAAA;KACL,cAAW;KACX,OAAM;KACL,gBAAY,OAAA,OAAA,OAAA,WAAiB,QAAA,MAAM,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;4BAuC/D,CApCjB,YAoCiB,MAAA,uBAAA,EAAA,EApCA,SAAO,CAAG,QAAA,MAAA,EAAA;6BAMnB;OALN,mBAKM,OALN,YAKM,CAHI,QAAA,QAAA,WAAA,EADR,YAE6B,qBAAA;;QAA1B,SAAS,QAAA,MAAM;iEAClB,YAA2C,wBAAA,EAA1B,YAAY,QAAA,YAAU,EAAA,MAAA,GAAA,CAAA,aAAA,CAAA,CAAA,CAAA;OAEzC,YAYgB,MAAA,sBAAA,EAAA;QAXb,SAAO,CAAG,QAAA,MAAM;QACjB,OAAA;;QAIW,OAAK,cAIG,CAFT,QAAA,QAAA,WAAA,EADR,YAGiB,mBAAA;;SADd,cAAc,QAAA;SACd,MAAM,QAAA;;+BALQ,CAFnB,YAEmB,MAAA,yBAAA,EAAA,EAFA,OAAO,GAAC,EAAA;gCACR,CAAA,gBAAA,gBAAd,QAAA,MAAM,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;OASlB,YAaiB,MAAA,uBAAA,EAAA,MAAA;+BANC,CANhB,YAMgB,MAAA,sBAAA,EAAA,MAAA;gCALe,CAA7B,WAA6B,KAAA,QAAA,iBAAA,EAAA,EAAA,KAAA,GAAA,KAAA,EAC7B,YAGiD,yBAAA;UAF9C,aAAa,QAAA,MAAM;UACnB,UAAU,QAAA;UACV,sBAAsB,QAAA;;;;;;;YAENA,KAAAA,OAAO,SAAA,WAAA,EAA5B,YAIgB,MAAA,sBAAA,EAAA,EAAA,KAAA,GAAA,EAAA;gCADR,CAFN,mBAEM,OAFN,YAEM,CADJ,WAAqB,KAAA,QAAA,SAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;;;;;OAI3B,YAAsD,MAAA,+BAAA,EAAA,EAA7B,OAAO,QAAA,oBAAkB,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;OAClD,YAAkD,MAAA,+BAAA,EAAA,EAAzB,OAAO,QAAA,gBAAc,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;;;yBAEhD,WAAqB,KAAA,QAAA,SAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"IntroductionLayout.vue.script.js","names":["$slots"],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport SpecificationVersion from './SpecificationVersion.vue'\n\ndefineProps<{\n id: string | undefined\n documentType?: 'openapi' | 'asyncapi'\n specificationVersion: string | undefined\n info: InfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n aria-label=\"Introduction\"\n class=\"introduction-section z-1 gap-12\"\n @intersecting=\"\n () => id && eventBus?.emit('intersecting:nav-item', { id })\n \">\n <SectionContent :loading=\"!info\">\n <div class=\"flex gap-1.5\">\n <InfoVersion\n v-if=\"info\"\n :version=\"info?.version\" />\n <SpecificationVersion\n :documentType\n :version=\"specificationVersion\" />\n </div>\n <SectionHeader\n :loading=\"!info?.title\"\n tight>\n <SectionHeaderTag :level=\"1\">\n {{ info?.title }}\n </SectionHeaderTag>\n <template #links>\n <InfoLinks\n v-if=\"info\"\n :externalDocs=\"externalDocs\"\n :info=\"info\" />\n </template>\n </SectionHeader>\n <SectionColumns>\n <SectionColumn>\n <slot name=\"download-link\" />\n <InfoDescription\n :description=\"info?.description\"\n :eventBus=\"eventBus\"\n :headingSlugGenerator=\"headingSlugGenerator\" />\n </SectionColumn>\n <SectionColumn v-if=\"$slots.aside\">\n <div class=\"sticky-cards\">\n <slot name=\"aside\" />\n </div>\n </SectionColumn>\n </SectionColumns>\n <SpecificationExtension :value=\"documentExtensions\" />\n <SpecificationExtension :value=\"infoExtensions\" />\n </SectionContent>\n <slot name=\"after\" />\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.sticky-cards {\n display: flex;\n flex-direction: column;\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAsCE,YAkDmB,MAAA,yBAAA,EAAA,MAAA;2BADP,CA/CV,YA+CU,MAAA,gBAAA,EAAA;KA9CP,IAAI,QAAA;KACL,cAAW;KACX,OAAM;KACL,gBAAY,OAAA,OAAA,OAAA,WAAiB,QAAA,MAAM,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;4BAyC/D,CAtCjB,YAsCiB,MAAA,uBAAA,EAAA,EAtCA,SAAO,CAAG,QAAA,MAAA,EAAA;6BAQnB;OAPN,mBAOM,OAPN,YAOM,CALI,QAAA,QAAA,WAAA,EADR,YAE6B,qBAAA;;QAA1B,SAAS,QAAA,MAAM;iEAClB,YAEoC,8BAAA;QADjC,cAAA,QAAA;QACA,SAAS,QAAA;;OAEd,YAYgB,MAAA,sBAAA,EAAA;QAXb,SAAO,CAAG,QAAA,MAAM;QACjB,OAAA;;QAIW,OAAK,cAIG,CAFT,QAAA,QAAA,WAAA,EADR,YAGiB,mBAAA;;SADd,cAAc,QAAA;SACd,MAAM,QAAA;;+BALQ,CAFnB,YAEmB,MAAA,yBAAA,EAAA,EAFA,OAAO,GAAC,EAAA;gCACR,CAAA,gBAAA,gBAAd,QAAA,MAAM,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;OASlB,YAaiB,MAAA,uBAAA,EAAA,MAAA;+BANC,CANhB,YAMgB,MAAA,sBAAA,EAAA,MAAA;gCALe,CAA7B,WAA6B,KAAA,QAAA,iBAAA,EAAA,EAAA,KAAA,GAAA,KAAA,EAC7B,YAGiD,yBAAA;UAF9C,aAAa,QAAA,MAAM;UACnB,UAAU,QAAA;UACV,sBAAsB,QAAA;;;;;;;YAENA,KAAAA,OAAO,SAAA,WAAA,EAA5B,YAIgB,MAAA,sBAAA,EAAA,EAAA,KAAA,GAAA,EAAA;gCADR,CAFN,mBAEM,OAFN,YAEM,CADJ,WAAqB,KAAA,QAAA,SAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;;;;;OAI3B,YAAsD,MAAA,+BAAA,EAAA,EAA7B,OAAO,QAAA,oBAAkB,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;OAClD,YAAkD,MAAA,+BAAA,EAAA,EAAzB,OAAO,QAAA,gBAAc,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;;;yBAEhD,WAAqB,KAAA,QAAA,SAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
@@ -1,7 +1,10 @@
1
1
  type __VLS_Props = {
2
- oasVersion?: string;
2
+ /** The kind of document being described. Drives the badge label. */
3
+ documentType?: 'openapi' | 'asyncapi';
4
+ /** The original specification version (e.g. "3.1.0" for OpenAPI, "3.0.0" for AsyncAPI). */
5
+ version?: string;
3
6
  };
4
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
8
  declare const _default: typeof __VLS_export;
6
9
  export default _default;
7
- //# sourceMappingURL=OpenApiVersion.vue.d.ts.map
10
+ //# sourceMappingURL=SpecificationVersion.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpecificationVersion.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-info-block/components/SpecificationVersion.vue"],"names":[],"mappings":"AA2BA,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACrC,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC;AA+CF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,7 @@
1
+ import SpecificationVersion_vue_vue_type_script_setup_true_lang_default from "./SpecificationVersion.vue.script.js";
2
+ //#region src/blocks/scalar-info-block/components/SpecificationVersion.vue
3
+ var SpecificationVersion_default = SpecificationVersion_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { SpecificationVersion_default as default };
6
+
7
+ //# sourceMappingURL=SpecificationVersion.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpecificationVersion.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/SpecificationVersion.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { Badge } from '@/components/Badge'\n\nconst { documentType = 'openapi', version } = defineProps<{\n /** The kind of document being described. Drives the badge label. */\n documentType?: 'openapi' | 'asyncapi'\n /** The original specification version (e.g. \"3.1.0\" for OpenAPI, \"3.0.0\" for AsyncAPI). */\n version?: string\n}>()\n\nconst label = computed(() =>\n documentType === 'asyncapi' ? 'AsyncAPI' : 'OpenAPI',\n)\n</script>\n\n<template>\n <Badge v-if=\"version\">{{ label }} {{ version }}</Badge>\n</template>\n"],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import Badge_default from "../../../components/Badge/Badge.vue.js";
2
+ import { computed, createBlock, createCommentVNode, createTextVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
3
+ //#region src/blocks/scalar-info-block/components/SpecificationVersion.vue?vue&type=script&setup=true&lang.ts
4
+ var SpecificationVersion_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
5
+ __name: "SpecificationVersion",
6
+ props: {
7
+ documentType: { default: "openapi" },
8
+ version: {}
9
+ },
10
+ setup(__props) {
11
+ const label = computed(() => __props.documentType === "asyncapi" ? "AsyncAPI" : "OpenAPI");
12
+ return (_ctx, _cache) => {
13
+ return __props.version ? (openBlock(), createBlock(unref(Badge_default), { key: 0 }, {
14
+ default: withCtx(() => [createTextVNode(toDisplayString(label.value) + " " + toDisplayString(__props.version), 1)]),
15
+ _: 1
16
+ })) : createCommentVNode("", true);
17
+ };
18
+ }
19
+ });
20
+ //#endregion
21
+ export { SpecificationVersion_vue_vue_type_script_setup_true_lang_default as default };
22
+
23
+ //# sourceMappingURL=SpecificationVersion.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpecificationVersion.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/SpecificationVersion.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { Badge } from '@/components/Badge'\n\nconst { documentType = 'openapi', version } = defineProps<{\n /** The kind of document being described. Drives the badge label. */\n documentType?: 'openapi' | 'asyncapi'\n /** The original specification version (e.g. \"3.1.0\" for OpenAPI, \"3.0.0\" for AsyncAPI). */\n version?: string\n}>()\n\nconst label = computed(() =>\n documentType === 'asyncapi' ? 'AsyncAPI' : 'OpenAPI',\n)\n</script>\n\n<template>\n <Badge v-if=\"version\">{{ label }} {{ version }}</Badge>\n</template>\n"],"mappings":";;;;;;;;;;EAYA,MAAM,QAAQ,eACZ,QAAA,iBAAiB,aAAa,aAAa,UAC7C;;UAIe,QAAA,WAAA,WAAA,EAAb,YAAuD,MAAA,cAAA,EAAA,EAAA,KAAA,GAAA,EAAA;2BAAtB,CAAA,gBAAA,gBAAR,MAAA,MAAK,GAAG,MAAC,gBAAG,QAAA,QAAO,EAAA,EAAA,CAAA,CAAA"}