@scalar/api-reference 1.60.0 → 1.61.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 (179) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/browser/chunks/{AgentScalarChatInterface-CesFQ_Ax.js → AgentScalarChatInterface-BhUn0w1j.js} +2 -2
  3. package/dist/browser/chunks/{ScalarTextInput.vue-C14zmVNI.js → ScalarTextInput.vue-BUzf4Z_k.js} +2 -2
  4. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +1 -1
  5. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +1 -1
  6. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +1 -1
  7. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +1 -1
  8. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +1 -1
  9. package/dist/browser/chunks/browser-67K6wmG9.js +1 -1
  10. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +1 -1
  11. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +1 -1
  12. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +1 -1
  13. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +1 -1
  14. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +1 -1
  15. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +1 -1
  16. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +1 -1
  17. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +1 -1
  18. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +1 -1
  19. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +1 -1
  20. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +1 -1
  21. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +1 -1
  22. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +1 -1
  23. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +1 -1
  24. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +1 -1
  25. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +1 -1
  26. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +1 -1
  27. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +1 -1
  28. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +1 -1
  29. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +1 -1
  30. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +1 -1
  31. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +1 -1
  32. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +1 -1
  33. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +1 -1
  34. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +1 -1
  35. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +1 -1
  36. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +1 -1
  37. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +1 -1
  38. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +1 -1
  39. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +1 -1
  40. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +1 -1
  41. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +1 -1
  42. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +1 -1
  43. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +1 -1
  44. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +1 -1
  45. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +1 -1
  46. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +1 -1
  47. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +1 -1
  48. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +1 -1
  49. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +1 -1
  50. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +1 -1
  51. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +1 -1
  52. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +1 -1
  53. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +1 -1
  54. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +1 -1
  55. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +1 -1
  56. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +1 -1
  57. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +1 -1
  58. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +1 -1
  59. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +1 -1
  60. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +1 -1
  61. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +1 -1
  62. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +1 -1
  63. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +1 -1
  64. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +1 -1
  65. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +1 -1
  66. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +1 -1
  67. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +1 -1
  68. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +1 -1
  69. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +1 -1
  70. package/dist/browser/chunks/{modal-LBDjZSmM.js → modal-CKthJJWy.js} +2 -2
  71. package/dist/browser/chunks/{modal-BZzcBkVp.js → modal-CZI71Aau.js} +19 -19
  72. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +1 -1
  73. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +1 -1
  74. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +1 -1
  75. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +1 -1
  76. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +1 -1
  77. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +1 -1
  78. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +1 -1
  79. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +1 -1
  80. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +1 -1
  81. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +1 -1
  82. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +1 -1
  83. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +1 -1
  84. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +1 -1
  85. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +1 -1
  86. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +1 -1
  87. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +1 -1
  88. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +1 -1
  89. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +1 -1
  90. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +1 -1
  91. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +1 -1
  92. package/dist/browser/chunks/{vendor-wW8jg8wN.js → vendor-BeJNu9KM.js} +2 -2
  93. package/dist/browser/standalone.esm.js +6 -6
  94. package/dist/browser/standalone.js +248 -248
  95. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  96. package/dist/components/ApiReference.vue.js +1 -1
  97. package/dist/components/ApiReference.vue.js.map +1 -1
  98. package/dist/components/ApiReference.vue.script.js +12 -6
  99. package/dist/components/ApiReference.vue.script.js.map +1 -1
  100. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts +10 -0
  101. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts.map +1 -0
  102. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +9 -0
  103. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js.map +1 -0
  104. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +43 -0
  105. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -0
  106. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -1
  107. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -1
  108. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +2 -0
  109. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
  110. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +4 -1
  111. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
  112. package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
  113. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -1
  114. package/dist/components/Content/AsyncApi/Channel.vue.script.js +98 -44
  115. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
  116. package/dist/components/Content/AsyncApi/Message.vue.d.ts +18 -0
  117. package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -0
  118. package/dist/components/Content/AsyncApi/Message.vue.js +9 -0
  119. package/dist/components/Content/AsyncApi/Message.vue.js.map +1 -0
  120. package/dist/components/Content/AsyncApi/Message.vue.script.js +159 -0
  121. package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -0
  122. package/dist/components/Content/AsyncApi/Operation.vue.d.ts +18 -0
  123. package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -0
  124. package/dist/components/Content/AsyncApi/Operation.vue.js +9 -0
  125. package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -0
  126. package/dist/components/Content/AsyncApi/Operation.vue.script.js +84 -0
  127. package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -0
  128. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts +14 -0
  129. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts.map +1 -0
  130. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js +14 -0
  131. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -0
  132. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts +9 -0
  133. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts.map +1 -0
  134. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js +12 -0
  135. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -0
  136. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts +13 -0
  137. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts.map +1 -0
  138. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js +23 -0
  139. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -0
  140. package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts +10 -0
  141. package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts.map +1 -0
  142. package/dist/components/Content/AsyncApi/helpers/pick-heading.js +20 -0
  143. package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -0
  144. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts +21 -0
  145. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts.map +1 -0
  146. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js +35 -0
  147. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -0
  148. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  149. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  150. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  151. package/dist/components/Content/Schema/Schema.vue.script.js +2 -1
  152. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  153. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  154. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  155. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +16 -1
  156. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  157. package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
  158. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  159. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  160. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  161. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +21 -6
  162. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  163. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  164. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +10 -9
  165. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  166. package/dist/helpers/get-async-api-message-payload-schema.d.ts +18 -0
  167. package/dist/helpers/get-async-api-message-payload-schema.d.ts.map +1 -0
  168. package/dist/helpers/get-async-api-message-payload-schema.js +33 -0
  169. package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -0
  170. package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -1
  171. package/dist/helpers/get-async-api-model-schema.js +2 -11
  172. package/dist/helpers/get-async-api-model-schema.js.map +1 -1
  173. package/dist/helpers/map-config-plugins.d.ts +8 -3
  174. package/dist/helpers/map-config-plugins.d.ts.map +1 -1
  175. package/dist/helpers/map-config-plugins.js +22 -4
  176. package/dist/helpers/map-config-plugins.js.map +1 -1
  177. package/dist/style.css +416 -311
  178. package/dist/vue-styles.css +398 -298
  179. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Channel.vue.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Channel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type {\n AsyncApiChannelObject,\n AsyncApiDocument,\n} from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getResolvedRef,\n mergeSiblingReferences,\n} from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedAsyncApiChannel } from '@scalar/workspace-store/schemas/navigation'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n Section,\n SectionContainer,\n SectionContainerAccordion,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport ParameterList from '@/features/Operation/components/ParameterList.vue'\n\nimport { adaptAsyncApiParameters } from './helpers/adapt-async-api-parameters'\n\n/** Subset of the configuration the shared `ParameterList` renderer needs. */\ntype ParameterListOptions = Pick<\n ApiReferenceConfigurationRaw,\n | 'hideModels'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'expandAllSchemaProperties'\n>\n\nconst { channel, document, layout, isCollapsed, eventBus, options } =\n defineProps<{\n channel: TraversedAsyncApiChannel\n document: AsyncApiDocument\n layout: 'classic' | 'modern'\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n options?: Partial<ParameterListOptions>\n }>()\n\nconst headerId = useId()\n\n/**\n * Resolve the channel from the document so we can read its description.\n * The navigation entry only carries the address and identifying keys.\n */\nconst resolvedChannel = computed<AsyncApiChannelObject | undefined>(() => {\n const node = document.channels?.[channel.channelName]\n return node ? getResolvedRef(node, mergeSiblingReferences) : undefined\n})\n\nconst description = computed(() => resolvedChannel.value?.description ?? '')\n\n/**\n * Heading shown above each channel section.\n *\n * Prefers the human-friendly `channel.title` when it is set, then falls back\n * to `channel.address`, and finally to the channel map key.\n * `channel.channelAddress` already encodes the address-or-key fallback during\n * navigation traversal, so we only need to overlay `title` on top of it.\n */\nconst headingText = computed(() => {\n const title = resolvedChannel.value?.title?.trim()\n return title || channel.channelAddress\n})\n\n/**\n * Channel address parameters mapped into the OpenAPI parameter shape so we can reuse the shared\n * `ParameterList` component instead of building a dedicated AsyncAPI renderer.\n */\nconst parameters = computed(() =>\n adaptAsyncApiParameters(resolvedChannel.value?.parameters),\n)\n\n/** Fill in defaults so the shared renderer always receives a complete options object. */\nconst parameterListOptions = computed<ParameterListOptions>(() => ({\n hideModels: options?.hideModels ?? false,\n orderRequiredPropertiesFirst: options?.orderRequiredPropertiesFirst ?? false,\n orderSchemaPropertiesBy: options?.orderSchemaPropertiesBy ?? 'preserve',\n expandAllSchemaProperties: options?.expandAllSchemaProperties ?? false,\n}))\n</script>\n\n<template>\n <SectionContainerAccordion\n v-if=\"layout === 'classic'\"\n :aria-label=\"headingText\"\n class=\"channel-section\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) =>\n eventBus?.emit('toggle:nav-item', { id: channel.id, open: value })\n \">\n <template #title>\n <SectionHeader class=\"channel-name\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <ScalarMarkdown\n class=\"channel-description\"\n :value=\"description\"\n withImages />\n </template>\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n </SectionContainerAccordion>\n\n <SectionContainer\n v-else\n :aria-labelledby=\"headerId\"\n role=\"region\">\n <Section\n :id=\"channel.id\"\n role=\"none\"\n @intersecting=\"\n () => eventBus?.emit('intersecting:nav-item', { id: channel.id })\n \">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag\n :id=\"headerId\"\n :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <SectionContent>\n <ScalarMarkdown\n :value=\"description\"\n withImages />\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n </SectionContent>\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.channel-section {\n margin-bottom: 48px;\n}\n.channel-description {\n padding-bottom: 4px;\n text-align: left;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"Channel.vue.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Channel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n TraversedAsyncApiChannel,\n TraversedAsyncApiOperation,\n} from '@scalar/workspace-store/schemas/navigation'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n Section,\n SectionContainer,\n SectionContainerAccordion,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport ParameterList from '@/features/Operation/components/ParameterList.vue'\n\nimport AsyncApiLabels from './AsyncApiLabels.vue'\nimport { adaptAsyncApiParameters } from './helpers/adapt-async-api-parameters'\nimport {\n resolveSchemaRenderOptions,\n type AsyncApiSchemaRenderOptions,\n} from './helpers/async-api-render-options'\nimport { filterChildrenByType } from './helpers/filter-children-by-type'\nimport { getChannelServerLabels } from './helpers/get-async-api-labels'\nimport { pickHeading } from './helpers/pick-heading'\nimport { resolveAsyncApiChannel } from './helpers/resolve-async-api-nodes'\nimport Operation from './Operation.vue'\n\n/** Subset of the configuration the shared `ParameterList` renderer needs. */\ntype ParameterListOptions = AsyncApiSchemaRenderOptions &\n Pick<ApiReferenceConfigurationRaw, 'hideModels'>\n\nconst {\n channel,\n document,\n layout,\n isCollapsed,\n eventBus,\n options,\n expandedItems = {},\n} = defineProps<{\n channel: TraversedAsyncApiChannel\n document: AsyncApiDocument\n layout: 'classic' | 'modern'\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n options?: Partial<ParameterListOptions>\n /** Map of navigation item id to expanded state, shared with the sidebar. */\n expandedItems?: Record<string, boolean>\n}>()\n\nconst headerId = useId()\n\n/**\n * Resolve the channel from the document so we can read its description.\n * The navigation entry only carries the address and identifying keys.\n */\nconst resolvedChannel = computed(() =>\n resolveAsyncApiChannel(document, channel.channelName),\n)\n\nconst description = computed(() => resolvedChannel.value?.description ?? '')\n\n/**\n * Heading shown above each channel section.\n *\n * Prefers the human-friendly `channel.title` when it is set, then falls back\n * to `channel.address`. `channel.channelAddress` already encodes the\n * address-or-key fallback during navigation traversal, so we only need to\n * overlay `title` on top of it.\n */\nconst headingText = computed(() =>\n pickHeading(resolvedChannel.value?.title, channel.channelAddress),\n)\n\n/**\n * Channel address parameters mapped into the OpenAPI parameter shape so we can reuse the shared\n * `ParameterList` component instead of building a dedicated AsyncAPI renderer.\n */\nconst parameters = computed(() =>\n adaptAsyncApiParameters(resolvedChannel.value?.parameters),\n)\n\n/** Fill in defaults so the shared renderer always receives a complete options object. */\nconst parameterListOptions = computed<ParameterListOptions>(() => ({\n hideModels: options?.hideModels ?? false,\n ...resolveSchemaRenderOptions(options),\n}))\n\n/**\n * Server-name and protocol labels for the channel, resolved from `document.servers`\n * (restricted to `channel.servers` when declared) and rendered as pills in the header.\n */\nconst labels = computed(() =>\n getChannelServerLabels(document, resolvedChannel.value),\n)\n\n/** Operations that target this channel, rendered nested beneath the channel content. */\nconst operations = computed(() =>\n filterChildrenByType<TraversedAsyncApiOperation>(\n channel.children,\n 'asyncapi-operation',\n ),\n)\n</script>\n\n<template>\n <SectionContainerAccordion\n v-if=\"layout === 'classic'\"\n :aria-label=\"headingText\"\n class=\"channel-section\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) =>\n eventBus?.emit('toggle:nav-item', { id: channel.id, open: value })\n \">\n <template #title>\n <SectionHeader class=\"channel-name\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <AsyncApiLabels\n class=\"channel-labels\"\n :protocols=\"labels.protocols\"\n :servers=\"labels.servers\" />\n <ScalarMarkdown\n class=\"channel-description\"\n :value=\"description\"\n withImages />\n </template>\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n <Operation\n v-for=\"operation in operations\"\n :key=\"operation.id\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :expandedItems=\"expandedItems\"\n :operation=\"operation\"\n :options=\"options\" />\n </SectionContainerAccordion>\n\n <SectionContainer\n v-else\n :aria-labelledby=\"headerId\"\n role=\"region\">\n <Section\n :id=\"channel.id\"\n role=\"none\"\n @intersecting=\"\n () => eventBus?.emit('intersecting:nav-item', { id: channel.id })\n \">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag\n :id=\"headerId\"\n :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <SectionContent>\n <AsyncApiLabels\n class=\"channel-labels\"\n :protocols=\"labels.protocols\"\n :servers=\"labels.servers\" />\n <ScalarMarkdown\n :value=\"description\"\n withImages />\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n <Operation\n v-for=\"operation in operations\"\n :key=\"operation.id\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :expandedItems=\"expandedItems\"\n :operation=\"operation\"\n :options=\"options\" />\n </SectionContent>\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.channel-section {\n margin-bottom: 48px;\n}\n.channel-labels {\n margin-bottom: 8px;\n}\n.channel-description {\n padding-bottom: 4px;\n text-align: left;\n}\n</style>\n"],"mappings":""}
@@ -6,10 +6,16 @@ import SectionHeader_default from "../../Section/SectionHeader.vue.js";
6
6
  import SectionHeaderTag_default from "../../Section/SectionHeaderTag.vue.js";
7
7
  import Anchor_default from "../../Anchor/Anchor.vue.js";
8
8
  import ParameterList_default from "../../../features/Operation/components/ParameterList.vue.js";
9
+ import AsyncApiLabels_default from "./AsyncApiLabels.vue.js";
9
10
  import { adaptAsyncApiParameters } from "./helpers/adapt-async-api-parameters.js";
10
- import { computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, useId, withCtx } from "vue";
11
+ import { resolveSchemaRenderOptions } from "./helpers/async-api-render-options.js";
12
+ import { filterChildrenByType } from "./helpers/filter-children-by-type.js";
13
+ import { getChannelServerLabels } from "./helpers/get-async-api-labels.js";
14
+ import { pickHeading } from "./helpers/pick-heading.js";
15
+ import { resolveAsyncApiChannel } from "./helpers/resolve-async-api-nodes.js";
16
+ import Operation_default from "./Operation.vue.js";
17
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, openBlock, renderList, toDisplayString, unref, useId, withCtx } from "vue";
11
18
  import { ScalarMarkdown } from "@scalar/components/markdown";
12
- import { getResolvedRef, mergeSiblingReferences } from "@scalar/workspace-store/helpers/get-resolved-ref";
13
19
  //#region src/components/Content/AsyncApi/Channel.vue?vue&type=script&setup=true&lang.ts
14
20
  var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
15
21
  __name: "Channel",
@@ -19,7 +25,8 @@ var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
19
25
  layout: {},
20
26
  isCollapsed: { type: Boolean },
21
27
  eventBus: {},
22
- options: {}
28
+ options: {},
29
+ expandedItems: { default: () => ({}) }
23
30
  },
24
31
  setup(__props) {
25
32
  const headerId = useId();
@@ -27,22 +34,17 @@ var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
27
34
  * Resolve the channel from the document so we can read its description.
28
35
  * The navigation entry only carries the address and identifying keys.
29
36
  */
30
- const resolvedChannel = computed(() => {
31
- const node = __props.document.channels?.[__props.channel.channelName];
32
- return node ? getResolvedRef(node, mergeSiblingReferences) : void 0;
33
- });
37
+ const resolvedChannel = computed(() => resolveAsyncApiChannel(__props.document, __props.channel.channelName));
34
38
  const description = computed(() => resolvedChannel.value?.description ?? "");
35
39
  /**
36
40
  * Heading shown above each channel section.
37
41
  *
38
42
  * Prefers the human-friendly `channel.title` when it is set, then falls back
39
- * to `channel.address`, and finally to the channel map key.
40
- * `channel.channelAddress` already encodes the address-or-key fallback during
41
- * navigation traversal, so we only need to overlay `title` on top of it.
43
+ * to `channel.address`. `channel.channelAddress` already encodes the
44
+ * address-or-key fallback during navigation traversal, so we only need to
45
+ * overlay `title` on top of it.
42
46
  */
43
- const headingText = computed(() => {
44
- return resolvedChannel.value?.title?.trim() || __props.channel.channelAddress;
45
- });
47
+ const headingText = computed(() => pickHeading(resolvedChannel.value?.title, __props.channel.channelAddress));
46
48
  /**
47
49
  * Channel address parameters mapped into the OpenAPI parameter shape so we can reuse the shared
48
50
  * `ParameterList` component instead of building a dedicated AsyncAPI renderer.
@@ -51,10 +53,15 @@ var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
51
53
  /** Fill in defaults so the shared renderer always receives a complete options object. */
52
54
  const parameterListOptions = computed(() => ({
53
55
  hideModels: __props.options?.hideModels ?? false,
54
- orderRequiredPropertiesFirst: __props.options?.orderRequiredPropertiesFirst ?? false,
55
- orderSchemaPropertiesBy: __props.options?.orderSchemaPropertiesBy ?? "preserve",
56
- expandAllSchemaProperties: __props.options?.expandAllSchemaProperties ?? false
56
+ ...resolveSchemaRenderOptions(__props.options)
57
57
  }));
58
+ /**
59
+ * Server-name and protocol labels for the channel, resolved from `document.servers`
60
+ * (restricted to `channel.servers` when declared) and rendered as pills in the header.
61
+ */
62
+ const labels = computed(() => getChannelServerLabels(__props.document, resolvedChannel.value));
63
+ /** Operations that target this channel, rendered nested beneath the channel content. */
64
+ const operations = computed(() => filterChildrenByType(__props.channel.children, "asyncapi-operation"));
58
65
  return (_ctx, _cache) => {
59
66
  return __props.layout === "classic" ? (openBlock(), createBlock(unref(SectionContainerAccordion_default), {
60
67
  key: 0,
@@ -66,20 +73,28 @@ var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
66
73
  open: value
67
74
  }))
68
75
  }, {
69
- title: withCtx(() => [createVNode(unref(SectionHeader_default), { class: "channel-name" }, {
70
- default: withCtx(() => [createVNode(unref(Anchor_default), { onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.channel.id })) }, {
71
- default: withCtx(() => [createVNode(unref(SectionHeaderTag_default), { level: 2 }, {
72
- default: withCtx(() => [createTextVNode(toDisplayString(headingText.value), 1)]),
76
+ title: withCtx(() => [
77
+ createVNode(unref(SectionHeader_default), { class: "channel-name" }, {
78
+ default: withCtx(() => [createVNode(unref(Anchor_default), { onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.channel.id })) }, {
79
+ default: withCtx(() => [createVNode(unref(SectionHeaderTag_default), { level: 2 }, {
80
+ default: withCtx(() => [createTextVNode(toDisplayString(headingText.value), 1)]),
81
+ _: 1
82
+ })]),
73
83
  _: 1
74
84
  })]),
75
85
  _: 1
76
- })]),
77
- _: 1
78
- }), createVNode(unref(ScalarMarkdown), {
79
- class: "channel-description",
80
- value: description.value,
81
- withImages: ""
82
- }, null, 8, ["value"])]),
86
+ }),
87
+ createVNode(AsyncApiLabels_default, {
88
+ class: "channel-labels",
89
+ protocols: labels.value.protocols,
90
+ servers: labels.value.servers
91
+ }, null, 8, ["protocols", "servers"]),
92
+ createVNode(unref(ScalarMarkdown), {
93
+ class: "channel-description",
94
+ value: description.value,
95
+ withImages: ""
96
+ }, null, 8, ["value"])
97
+ ]),
83
98
  default: withCtx(() => [parameters.value.length ? (openBlock(), createBlock(ParameterList_default, {
84
99
  key: 0,
85
100
  eventBus: __props.eventBus,
@@ -92,7 +107,22 @@ var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
92
107
  "eventBus",
93
108
  "options",
94
109
  "parameters"
95
- ])) : createCommentVNode("", true)]),
110
+ ])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(operations.value, (operation) => {
111
+ return openBlock(), createBlock(Operation_default, {
112
+ key: operation.id,
113
+ document: __props.document,
114
+ eventBus: __props.eventBus,
115
+ expandedItems: __props.expandedItems,
116
+ operation,
117
+ options: __props.options
118
+ }, null, 8, [
119
+ "document",
120
+ "eventBus",
121
+ "expandedItems",
122
+ "operation",
123
+ "options"
124
+ ]);
125
+ }), 128))]),
96
126
  _: 1
97
127
  }, 8, ["aria-label", "modelValue"])) : (openBlock(), createBlock(unref(SectionContainer_default), {
98
128
  key: 1,
@@ -117,22 +147,46 @@ var Channel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
117
147
  })]),
118
148
  _: 1
119
149
  }), createVNode(unref(SectionContent_default), null, {
120
- default: withCtx(() => [createVNode(unref(ScalarMarkdown), {
121
- value: description.value,
122
- withImages: ""
123
- }, null, 8, ["value"]), parameters.value.length ? (openBlock(), createBlock(ParameterList_default, {
124
- key: 0,
125
- eventBus: __props.eventBus,
126
- options: parameterListOptions.value,
127
- parameters: parameters.value
128
- }, {
129
- title: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("Parameters", -1)])]),
130
- _: 1
131
- }, 8, [
132
- "eventBus",
133
- "options",
134
- "parameters"
135
- ])) : createCommentVNode("", true)]),
150
+ default: withCtx(() => [
151
+ createVNode(AsyncApiLabels_default, {
152
+ class: "channel-labels",
153
+ protocols: labels.value.protocols,
154
+ servers: labels.value.servers
155
+ }, null, 8, ["protocols", "servers"]),
156
+ createVNode(unref(ScalarMarkdown), {
157
+ value: description.value,
158
+ withImages: ""
159
+ }, null, 8, ["value"]),
160
+ parameters.value.length ? (openBlock(), createBlock(ParameterList_default, {
161
+ key: 0,
162
+ eventBus: __props.eventBus,
163
+ options: parameterListOptions.value,
164
+ parameters: parameters.value
165
+ }, {
166
+ title: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("Parameters", -1)])]),
167
+ _: 1
168
+ }, 8, [
169
+ "eventBus",
170
+ "options",
171
+ "parameters"
172
+ ])) : createCommentVNode("", true),
173
+ (openBlock(true), createElementBlock(Fragment, null, renderList(operations.value, (operation) => {
174
+ return openBlock(), createBlock(Operation_default, {
175
+ key: operation.id,
176
+ document: __props.document,
177
+ eventBus: __props.eventBus,
178
+ expandedItems: __props.expandedItems,
179
+ operation,
180
+ options: __props.options
181
+ }, null, 8, [
182
+ "document",
183
+ "eventBus",
184
+ "expandedItems",
185
+ "operation",
186
+ "options"
187
+ ]);
188
+ }), 128))
189
+ ]),
136
190
  _: 1
137
191
  })]),
138
192
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"Channel.vue.script.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Channel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type {\n AsyncApiChannelObject,\n AsyncApiDocument,\n} from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getResolvedRef,\n mergeSiblingReferences,\n} from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedAsyncApiChannel } from '@scalar/workspace-store/schemas/navigation'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n Section,\n SectionContainer,\n SectionContainerAccordion,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport ParameterList from '@/features/Operation/components/ParameterList.vue'\n\nimport { adaptAsyncApiParameters } from './helpers/adapt-async-api-parameters'\n\n/** Subset of the configuration the shared `ParameterList` renderer needs. */\ntype ParameterListOptions = Pick<\n ApiReferenceConfigurationRaw,\n | 'hideModels'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'expandAllSchemaProperties'\n>\n\nconst { channel, document, layout, isCollapsed, eventBus, options } =\n defineProps<{\n channel: TraversedAsyncApiChannel\n document: AsyncApiDocument\n layout: 'classic' | 'modern'\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n options?: Partial<ParameterListOptions>\n }>()\n\nconst headerId = useId()\n\n/**\n * Resolve the channel from the document so we can read its description.\n * The navigation entry only carries the address and identifying keys.\n */\nconst resolvedChannel = computed<AsyncApiChannelObject | undefined>(() => {\n const node = document.channels?.[channel.channelName]\n return node ? getResolvedRef(node, mergeSiblingReferences) : undefined\n})\n\nconst description = computed(() => resolvedChannel.value?.description ?? '')\n\n/**\n * Heading shown above each channel section.\n *\n * Prefers the human-friendly `channel.title` when it is set, then falls back\n * to `channel.address`, and finally to the channel map key.\n * `channel.channelAddress` already encodes the address-or-key fallback during\n * navigation traversal, so we only need to overlay `title` on top of it.\n */\nconst headingText = computed(() => {\n const title = resolvedChannel.value?.title?.trim()\n return title || channel.channelAddress\n})\n\n/**\n * Channel address parameters mapped into the OpenAPI parameter shape so we can reuse the shared\n * `ParameterList` component instead of building a dedicated AsyncAPI renderer.\n */\nconst parameters = computed(() =>\n adaptAsyncApiParameters(resolvedChannel.value?.parameters),\n)\n\n/** Fill in defaults so the shared renderer always receives a complete options object. */\nconst parameterListOptions = computed<ParameterListOptions>(() => ({\n hideModels: options?.hideModels ?? false,\n orderRequiredPropertiesFirst: options?.orderRequiredPropertiesFirst ?? false,\n orderSchemaPropertiesBy: options?.orderSchemaPropertiesBy ?? 'preserve',\n expandAllSchemaProperties: options?.expandAllSchemaProperties ?? false,\n}))\n</script>\n\n<template>\n <SectionContainerAccordion\n v-if=\"layout === 'classic'\"\n :aria-label=\"headingText\"\n class=\"channel-section\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) =>\n eventBus?.emit('toggle:nav-item', { id: channel.id, open: value })\n \">\n <template #title>\n <SectionHeader class=\"channel-name\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <ScalarMarkdown\n class=\"channel-description\"\n :value=\"description\"\n withImages />\n </template>\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n </SectionContainerAccordion>\n\n <SectionContainer\n v-else\n :aria-labelledby=\"headerId\"\n role=\"region\">\n <Section\n :id=\"channel.id\"\n role=\"none\"\n @intersecting=\"\n () => eventBus?.emit('intersecting:nav-item', { id: channel.id })\n \">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag\n :id=\"headerId\"\n :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <SectionContent>\n <ScalarMarkdown\n :value=\"description\"\n withImages />\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n </SectionContent>\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.channel-section {\n margin-bottom: 48px;\n}\n.channel-description {\n padding-bottom: 4px;\n text-align: left;\n}\n</style>\n"],"mappings":"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"}
1
+ {"version":3,"file":"Channel.vue.script.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Channel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n TraversedAsyncApiChannel,\n TraversedAsyncApiOperation,\n} from '@scalar/workspace-store/schemas/navigation'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n Section,\n SectionContainer,\n SectionContainerAccordion,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport ParameterList from '@/features/Operation/components/ParameterList.vue'\n\nimport AsyncApiLabels from './AsyncApiLabels.vue'\nimport { adaptAsyncApiParameters } from './helpers/adapt-async-api-parameters'\nimport {\n resolveSchemaRenderOptions,\n type AsyncApiSchemaRenderOptions,\n} from './helpers/async-api-render-options'\nimport { filterChildrenByType } from './helpers/filter-children-by-type'\nimport { getChannelServerLabels } from './helpers/get-async-api-labels'\nimport { pickHeading } from './helpers/pick-heading'\nimport { resolveAsyncApiChannel } from './helpers/resolve-async-api-nodes'\nimport Operation from './Operation.vue'\n\n/** Subset of the configuration the shared `ParameterList` renderer needs. */\ntype ParameterListOptions = AsyncApiSchemaRenderOptions &\n Pick<ApiReferenceConfigurationRaw, 'hideModels'>\n\nconst {\n channel,\n document,\n layout,\n isCollapsed,\n eventBus,\n options,\n expandedItems = {},\n} = defineProps<{\n channel: TraversedAsyncApiChannel\n document: AsyncApiDocument\n layout: 'classic' | 'modern'\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n options?: Partial<ParameterListOptions>\n /** Map of navigation item id to expanded state, shared with the sidebar. */\n expandedItems?: Record<string, boolean>\n}>()\n\nconst headerId = useId()\n\n/**\n * Resolve the channel from the document so we can read its description.\n * The navigation entry only carries the address and identifying keys.\n */\nconst resolvedChannel = computed(() =>\n resolveAsyncApiChannel(document, channel.channelName),\n)\n\nconst description = computed(() => resolvedChannel.value?.description ?? '')\n\n/**\n * Heading shown above each channel section.\n *\n * Prefers the human-friendly `channel.title` when it is set, then falls back\n * to `channel.address`. `channel.channelAddress` already encodes the\n * address-or-key fallback during navigation traversal, so we only need to\n * overlay `title` on top of it.\n */\nconst headingText = computed(() =>\n pickHeading(resolvedChannel.value?.title, channel.channelAddress),\n)\n\n/**\n * Channel address parameters mapped into the OpenAPI parameter shape so we can reuse the shared\n * `ParameterList` component instead of building a dedicated AsyncAPI renderer.\n */\nconst parameters = computed(() =>\n adaptAsyncApiParameters(resolvedChannel.value?.parameters),\n)\n\n/** Fill in defaults so the shared renderer always receives a complete options object. */\nconst parameterListOptions = computed<ParameterListOptions>(() => ({\n hideModels: options?.hideModels ?? false,\n ...resolveSchemaRenderOptions(options),\n}))\n\n/**\n * Server-name and protocol labels for the channel, resolved from `document.servers`\n * (restricted to `channel.servers` when declared) and rendered as pills in the header.\n */\nconst labels = computed(() =>\n getChannelServerLabels(document, resolvedChannel.value),\n)\n\n/** Operations that target this channel, rendered nested beneath the channel content. */\nconst operations = computed(() =>\n filterChildrenByType<TraversedAsyncApiOperation>(\n channel.children,\n 'asyncapi-operation',\n ),\n)\n</script>\n\n<template>\n <SectionContainerAccordion\n v-if=\"layout === 'classic'\"\n :aria-label=\"headingText\"\n class=\"channel-section\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) =>\n eventBus?.emit('toggle:nav-item', { id: channel.id, open: value })\n \">\n <template #title>\n <SectionHeader class=\"channel-name\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <AsyncApiLabels\n class=\"channel-labels\"\n :protocols=\"labels.protocols\"\n :servers=\"labels.servers\" />\n <ScalarMarkdown\n class=\"channel-description\"\n :value=\"description\"\n withImages />\n </template>\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n <Operation\n v-for=\"operation in operations\"\n :key=\"operation.id\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :expandedItems=\"expandedItems\"\n :operation=\"operation\"\n :options=\"options\" />\n </SectionContainerAccordion>\n\n <SectionContainer\n v-else\n :aria-labelledby=\"headerId\"\n role=\"region\">\n <Section\n :id=\"channel.id\"\n role=\"none\"\n @intersecting=\"\n () => eventBus?.emit('intersecting:nav-item', { id: channel.id })\n \">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: channel.id })\n \">\n <SectionHeaderTag\n :id=\"headerId\"\n :level=\"2\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <SectionContent>\n <AsyncApiLabels\n class=\"channel-labels\"\n :protocols=\"labels.protocols\"\n :servers=\"labels.servers\" />\n <ScalarMarkdown\n :value=\"description\"\n withImages />\n <ParameterList\n v-if=\"parameters.length\"\n :eventBus=\"eventBus\"\n :options=\"parameterListOptions\"\n :parameters=\"parameters\">\n <template #title>Parameters</template>\n </ParameterList>\n <Operation\n v-for=\"operation in operations\"\n :key=\"operation.id\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :expandedItems=\"expandedItems\"\n :operation=\"operation\"\n :options=\"options\" />\n </SectionContent>\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.channel-section {\n margin-bottom: 48px;\n}\n.channel-labels {\n margin-bottom: 8px;\n}\n.channel-description {\n padding-bottom: 4px;\n text-align: left;\n}\n</style>\n"],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
2
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import type { TraversedAsyncApiMessage } from '@scalar/workspace-store/schemas/navigation';
4
+ import { type AsyncApiSchemaRenderOptions } from './helpers/async-api-render-options.js';
5
+ /** Subset of the configuration the shared `Schema` renderer needs. */
6
+ type SchemaRenderOptions = AsyncApiSchemaRenderOptions;
7
+ type __VLS_Props = {
8
+ message: TraversedAsyncApiMessage;
9
+ document: AsyncApiDocument;
10
+ eventBus: WorkspaceEventBus | null;
11
+ options?: Partial<SchemaRenderOptions>;
12
+ /** Map of navigation item id to expanded state, shared with the sidebar. */
13
+ expandedItems?: Record<string, boolean>;
14
+ };
15
+ 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>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ //# sourceMappingURL=Message.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/AsyncApi/Message.vue"],"names":[],"mappings":"AA8PA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAA;AAc1F,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,oCAAoC,CAAA;AAQ3C,sEAAsE;AACtE,KAAK,mBAAmB,GAAG,2BAA2B,CAAA;AAEtD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,wBAAwB,CAAA;IACjC,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACtC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC,CAAC;AA8TF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,9 @@
1
+ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.js";
2
+ import Message_vue_vue_type_script_setup_true_lang_default from "./Message.vue.script.js";
3
+ /* empty css */
4
+ //#region src/components/Content/AsyncApi/Message.vue
5
+ var Message_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Message_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-50be0795"]]);
6
+ //#endregion
7
+ export { Message_default as default };
8
+
9
+ //# sourceMappingURL=Message.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.vue.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Message.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedAsyncApiMessage } from '@scalar/workspace-store/schemas/navigation'\nimport { computed, ref, useId, useTemplateRef, watch } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Schema } from '@/components/Content/Schema'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { SectionAccordion, SectionHeaderTag } from '@/components/Section'\nimport {\n getAsyncApiMessageHeadersSchema,\n getAsyncApiMessagePayloadSchema,\n} from '@/helpers/get-async-api-message-payload-schema'\nimport { useIntersection } from '@/hooks/use-intersection'\n\nimport AsyncApiLabels from './AsyncApiLabels.vue'\nimport {\n resolveSchemaRenderOptions,\n type AsyncApiSchemaRenderOptions,\n} from './helpers/async-api-render-options'\nimport { getChannelServerLabels } from './helpers/get-async-api-labels'\nimport { pickHeading } from './helpers/pick-heading'\nimport {\n resolveAsyncApiChannel,\n resolveAsyncApiMessage,\n} from './helpers/resolve-async-api-nodes'\n\n/** Subset of the configuration the shared `Schema` renderer needs. */\ntype SchemaRenderOptions = AsyncApiSchemaRenderOptions\n\nconst {\n message,\n document,\n eventBus,\n options,\n expandedItems = {},\n} = defineProps<{\n message: TraversedAsyncApiMessage\n document: AsyncApiDocument\n eventBus: WorkspaceEventBus | null\n options?: Partial<SchemaRenderOptions>\n /** Map of navigation item id to expanded state, shared with the sidebar. */\n expandedItems?: Record<string, boolean>\n}>()\n\nconst headerId = useId()\nconst section = useTemplateRef<HTMLElement>('section')\n\nuseIntersection(section, () =>\n eventBus?.emit('intersecting:nav-item', { id: message.id }),\n)\n\n/**\n * Resolve the message from the channel it lives on. The navigation entry only\n * carries the identifying keys, so we walk `document.channels[channelName].messages`.\n */\nconst resolvedMessage = computed(() =>\n resolveAsyncApiMessage(document, message.channelName, message.messageName),\n)\n\n/** Heading prefers the human-friendly title, falling back to the message map key. */\nconst headingText = computed(() =>\n pickHeading(resolvedMessage.value?.title, message.title, message.messageName),\n)\n\nconst description = computed(\n () =>\n resolvedMessage.value?.description || resolvedMessage.value?.summary || '',\n)\n\n/**\n * Protocol keys declared directly on the message's protocol-specific `bindings`\n * (for example `ws`, `kafka`). The bindings object may be a `$ref`, so it is resolved\n * before reading the keys. Keys are lowercased to match the server protocols (which the\n * helper normalizes), so the union below de-duplicates case-insensitively.\n */\nconst messageBindingProtocols = computed(() => {\n const bindings = resolvedMessage.value?.bindings\n if (!bindings) {\n return []\n }\n const resolved = getResolvedRef(bindings)\n return Object.entries(resolved)\n .filter(([, value]) => value != null)\n .map(([protocol]) => protocol.toLowerCase())\n})\n\n/**\n * Protocol labels for the message. A message is carried over whatever protocols its\n * channel's servers speak, so we start from the channel's server protocols and union in\n * any extra protocols the message declares its own bindings for. Without this a\n * multi-protocol message would only surface the single protocol it happens to declare a\n * binding for (or none at all).\n */\nconst protocolLabels = computed(() => {\n const channel = resolveAsyncApiChannel(document, message.channelName)\n const { protocols } = getChannelServerLabels(document, channel)\n return [...new Set([...protocols, ...messageBindingProtocols.value])]\n})\n\n/** Payload schema, unwrapped from `$ref`s and Multi Format Schema wrappers. */\nconst payloadSchema = computed(() =>\n resolvedMessage.value\n ? getAsyncApiMessagePayloadSchema(resolvedMessage.value)\n : undefined,\n)\n\n/** Header schema, unwrapped the same way as the payload. */\nconst headersSchema = computed(() =>\n resolvedMessage.value\n ? getAsyncApiMessageHeadersSchema(resolvedMessage.value)\n : undefined,\n)\n\n/** Fill in defaults so the shared Schema renderer always receives a complete options object. */\nconst schemaOptions = computed<SchemaOptions>(() => ({\n hideReadOnly: false,\n ...resolveSchemaRenderOptions(options),\n}))\n\n/**\n * Accordion open state. Kept locally so clicking the header always toggles\n * immediately, and seeded/synced from the shared sidebar expansion map so\n * expanding the message in the sidebar (or deep-linking to it) opens it here too.\n */\nconst isExpanded = ref(expandedItems[message.id] ?? false)\n\nwatch(\n () => expandedItems[message.id],\n (value) => {\n if (value !== undefined) {\n isExpanded.value = value\n }\n },\n)\n\n/** Toggling the accordion updates local state and keeps the sidebar in sync. */\nconst onToggle = (open: boolean) => {\n isExpanded.value = open\n eventBus?.emit('toggle:nav-item', { id: message.id, open })\n}\n</script>\n\n<template>\n <div\n :id=\"message.id\"\n ref=\"section\"\n class=\"message\">\n <SectionAccordion\n class=\"message-accordion\"\n :modelValue=\"isExpanded\"\n @update:modelValue=\"onToggle\">\n <template #title>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: message.id })\n \">\n <span class=\"message-heading\">\n <SectionHeaderTag\n :id=\"headerId\"\n class=\"message-title\"\n :level=\"4\">\n {{ headingText }}\n </SectionHeaderTag>\n <AsyncApiLabels :protocols=\"protocolLabels\" />\n </span>\n </Anchor>\n </template>\n\n <ScalarMarkdown\n v-if=\"description\"\n class=\"message-description\"\n :value=\"description\"\n withImages />\n\n <div\n v-if=\"headersSchema\"\n class=\"message-schema\">\n <div class=\"message-schema-title\">Headers</div>\n <Schema\n compact\n :eventBus=\"eventBus\"\n name=\"Headers\"\n noncollapsible\n :options=\"schemaOptions\"\n :schema=\"headersSchema\" />\n </div>\n\n <div\n v-if=\"payloadSchema\"\n class=\"message-schema\">\n <div class=\"message-schema-title\">Payload</div>\n <Schema\n compact\n :eventBus=\"eventBus\"\n name=\"Payload\"\n noncollapsible\n :options=\"schemaOptions\"\n :schema=\"payloadSchema\" />\n </div>\n </SectionAccordion>\n </div>\n</template>\n\n<style scoped>\n.message {\n scroll-margin-top: var(--refs-viewport-offset);\n}\n.message-title {\n font-size: var(--scalar-heading-4);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n/*\n * Lay the heading and protocol labels out on one wrapping row. The labels live inside the\n * Anchor slot so the copy-anchor \"#\" button (absolutely positioned just past the end of the\n * slot content on hover) trails after the last pill instead of overlapping the first one.\n */\n.message-heading {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n}\n/* Pad the expanded body so the description and schemas don't sit flush against the border. */\n.message-accordion :deep(.section-accordion-content-card) {\n padding: 12px;\n}\n.message-description {\n padding-bottom: 4px;\n text-align: left;\n}\n.message-schema {\n margin-top: 12px;\n}\n.message-schema:first-child {\n margin-top: 0;\n}\n.message-schema-title {\n font-size: var(--scalar-font-size-2);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n margin-bottom: 8px;\n}\n</style>\n"],"mappings":""}
@@ -0,0 +1,159 @@
1
+ import { useIntersection } from "../../../hooks/use-intersection.js";
2
+ import SectionAccordion_default from "../../Section/SectionAccordion.vue.js";
3
+ import SectionHeaderTag_default from "../../Section/SectionHeaderTag.vue.js";
4
+ import Anchor_default from "../../Anchor/Anchor.vue.js";
5
+ import Schema_default from "../Schema/Schema.vue.js";
6
+ import { getAsyncApiMessageHeadersSchema, getAsyncApiMessagePayloadSchema } from "../../../helpers/get-async-api-message-payload-schema.js";
7
+ import AsyncApiLabels_default from "./AsyncApiLabels.vue.js";
8
+ import { resolveSchemaRenderOptions } from "./helpers/async-api-render-options.js";
9
+ import { getChannelServerLabels } from "./helpers/get-async-api-labels.js";
10
+ import { pickHeading } from "./helpers/pick-heading.js";
11
+ import { resolveAsyncApiChannel, resolveAsyncApiMessage } from "./helpers/resolve-async-api-nodes.js";
12
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, toDisplayString, unref, useId, useTemplateRef, watch, withCtx } from "vue";
13
+ import { ScalarMarkdown } from "@scalar/components/markdown";
14
+ import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
15
+ //#region src/components/Content/AsyncApi/Message.vue?vue&type=script&setup=true&lang.ts
16
+ var _hoisted_1 = ["id"];
17
+ var _hoisted_2 = { class: "message-heading" };
18
+ var _hoisted_3 = {
19
+ key: 1,
20
+ class: "message-schema"
21
+ };
22
+ var _hoisted_4 = {
23
+ key: 2,
24
+ class: "message-schema"
25
+ };
26
+ var Message_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
27
+ __name: "Message",
28
+ props: {
29
+ message: {},
30
+ document: {},
31
+ eventBus: {},
32
+ options: {},
33
+ expandedItems: { default: () => ({}) }
34
+ },
35
+ setup(__props) {
36
+ const headerId = useId();
37
+ const section = useTemplateRef("section");
38
+ useIntersection(section, () => __props.eventBus?.emit("intersecting:nav-item", { id: __props.message.id }));
39
+ /**
40
+ * Resolve the message from the channel it lives on. The navigation entry only
41
+ * carries the identifying keys, so we walk `document.channels[channelName].messages`.
42
+ */
43
+ const resolvedMessage = computed(() => resolveAsyncApiMessage(__props.document, __props.message.channelName, __props.message.messageName));
44
+ /** Heading prefers the human-friendly title, falling back to the message map key. */
45
+ const headingText = computed(() => pickHeading(resolvedMessage.value?.title, __props.message.title, __props.message.messageName));
46
+ const description = computed(() => resolvedMessage.value?.description || resolvedMessage.value?.summary || "");
47
+ /**
48
+ * Protocol keys declared directly on the message's protocol-specific `bindings`
49
+ * (for example `ws`, `kafka`). The bindings object may be a `$ref`, so it is resolved
50
+ * before reading the keys. Keys are lowercased to match the server protocols (which the
51
+ * helper normalizes), so the union below de-duplicates case-insensitively.
52
+ */
53
+ const messageBindingProtocols = computed(() => {
54
+ const bindings = resolvedMessage.value?.bindings;
55
+ if (!bindings) return [];
56
+ const resolved = getResolvedRef(bindings);
57
+ return Object.entries(resolved).filter(([, value]) => value != null).map(([protocol]) => protocol.toLowerCase());
58
+ });
59
+ /**
60
+ * Protocol labels for the message. A message is carried over whatever protocols its
61
+ * channel's servers speak, so we start from the channel's server protocols and union in
62
+ * any extra protocols the message declares its own bindings for. Without this a
63
+ * multi-protocol message would only surface the single protocol it happens to declare a
64
+ * binding for (or none at all).
65
+ */
66
+ const protocolLabels = computed(() => {
67
+ const channel = resolveAsyncApiChannel(__props.document, __props.message.channelName);
68
+ const { protocols } = getChannelServerLabels(__props.document, channel);
69
+ return [...new Set([...protocols, ...messageBindingProtocols.value])];
70
+ });
71
+ /** Payload schema, unwrapped from `$ref`s and Multi Format Schema wrappers. */
72
+ const payloadSchema = computed(() => resolvedMessage.value ? getAsyncApiMessagePayloadSchema(resolvedMessage.value) : void 0);
73
+ /** Header schema, unwrapped the same way as the payload. */
74
+ const headersSchema = computed(() => resolvedMessage.value ? getAsyncApiMessageHeadersSchema(resolvedMessage.value) : void 0);
75
+ /** Fill in defaults so the shared Schema renderer always receives a complete options object. */
76
+ const schemaOptions = computed(() => ({
77
+ hideReadOnly: false,
78
+ ...resolveSchemaRenderOptions(__props.options)
79
+ }));
80
+ /**
81
+ * Accordion open state. Kept locally so clicking the header always toggles
82
+ * immediately, and seeded/synced from the shared sidebar expansion map so
83
+ * expanding the message in the sidebar (or deep-linking to it) opens it here too.
84
+ */
85
+ const isExpanded = ref(__props.expandedItems[__props.message.id] ?? false);
86
+ watch(() => __props.expandedItems[__props.message.id], (value) => {
87
+ if (value !== void 0) isExpanded.value = value;
88
+ });
89
+ /** Toggling the accordion updates local state and keeps the sidebar in sync. */
90
+ const onToggle = (open) => {
91
+ isExpanded.value = open;
92
+ __props.eventBus?.emit("toggle:nav-item", {
93
+ id: __props.message.id,
94
+ open
95
+ });
96
+ };
97
+ return (_ctx, _cache) => {
98
+ return openBlock(), createElementBlock("div", {
99
+ id: __props.message.id,
100
+ ref_key: "section",
101
+ ref: section,
102
+ class: "message"
103
+ }, [createVNode(unref(SectionAccordion_default), {
104
+ class: "message-accordion",
105
+ modelValue: isExpanded.value,
106
+ "onUpdate:modelValue": onToggle
107
+ }, {
108
+ title: withCtx(() => [createVNode(unref(Anchor_default), { onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.message.id })) }, {
109
+ default: withCtx(() => [createElementVNode("span", _hoisted_2, [createVNode(unref(SectionHeaderTag_default), {
110
+ id: unref(headerId),
111
+ class: "message-title",
112
+ level: 4
113
+ }, {
114
+ default: withCtx(() => [createTextVNode(toDisplayString(headingText.value), 1)]),
115
+ _: 1
116
+ }, 8, ["id"]), createVNode(AsyncApiLabels_default, { protocols: protocolLabels.value }, null, 8, ["protocols"])])]),
117
+ _: 1
118
+ })]),
119
+ default: withCtx(() => [
120
+ description.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
121
+ key: 0,
122
+ class: "message-description",
123
+ value: description.value,
124
+ withImages: ""
125
+ }, null, 8, ["value"])) : createCommentVNode("", true),
126
+ headersSchema.value ? (openBlock(), createElementBlock("div", _hoisted_3, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "message-schema-title" }, "Headers", -1)), createVNode(unref(Schema_default), {
127
+ compact: "",
128
+ eventBus: __props.eventBus,
129
+ name: "Headers",
130
+ noncollapsible: "",
131
+ options: schemaOptions.value,
132
+ schema: headersSchema.value
133
+ }, null, 8, [
134
+ "eventBus",
135
+ "options",
136
+ "schema"
137
+ ])])) : createCommentVNode("", true),
138
+ payloadSchema.value ? (openBlock(), createElementBlock("div", _hoisted_4, [_cache[2] || (_cache[2] = createElementVNode("div", { class: "message-schema-title" }, "Payload", -1)), createVNode(unref(Schema_default), {
139
+ compact: "",
140
+ eventBus: __props.eventBus,
141
+ name: "Payload",
142
+ noncollapsible: "",
143
+ options: schemaOptions.value,
144
+ schema: payloadSchema.value
145
+ }, null, 8, [
146
+ "eventBus",
147
+ "options",
148
+ "schema"
149
+ ])])) : createCommentVNode("", true)
150
+ ]),
151
+ _: 1
152
+ }, 8, ["modelValue"])], 8, _hoisted_1);
153
+ };
154
+ }
155
+ });
156
+ //#endregion
157
+ export { Message_vue_vue_type_script_setup_true_lang_default as default };
158
+
159
+ //# sourceMappingURL=Message.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.vue.script.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Message.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedAsyncApiMessage } from '@scalar/workspace-store/schemas/navigation'\nimport { computed, ref, useId, useTemplateRef, watch } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Schema } from '@/components/Content/Schema'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { SectionAccordion, SectionHeaderTag } from '@/components/Section'\nimport {\n getAsyncApiMessageHeadersSchema,\n getAsyncApiMessagePayloadSchema,\n} from '@/helpers/get-async-api-message-payload-schema'\nimport { useIntersection } from '@/hooks/use-intersection'\n\nimport AsyncApiLabels from './AsyncApiLabels.vue'\nimport {\n resolveSchemaRenderOptions,\n type AsyncApiSchemaRenderOptions,\n} from './helpers/async-api-render-options'\nimport { getChannelServerLabels } from './helpers/get-async-api-labels'\nimport { pickHeading } from './helpers/pick-heading'\nimport {\n resolveAsyncApiChannel,\n resolveAsyncApiMessage,\n} from './helpers/resolve-async-api-nodes'\n\n/** Subset of the configuration the shared `Schema` renderer needs. */\ntype SchemaRenderOptions = AsyncApiSchemaRenderOptions\n\nconst {\n message,\n document,\n eventBus,\n options,\n expandedItems = {},\n} = defineProps<{\n message: TraversedAsyncApiMessage\n document: AsyncApiDocument\n eventBus: WorkspaceEventBus | null\n options?: Partial<SchemaRenderOptions>\n /** Map of navigation item id to expanded state, shared with the sidebar. */\n expandedItems?: Record<string, boolean>\n}>()\n\nconst headerId = useId()\nconst section = useTemplateRef<HTMLElement>('section')\n\nuseIntersection(section, () =>\n eventBus?.emit('intersecting:nav-item', { id: message.id }),\n)\n\n/**\n * Resolve the message from the channel it lives on. The navigation entry only\n * carries the identifying keys, so we walk `document.channels[channelName].messages`.\n */\nconst resolvedMessage = computed(() =>\n resolveAsyncApiMessage(document, message.channelName, message.messageName),\n)\n\n/** Heading prefers the human-friendly title, falling back to the message map key. */\nconst headingText = computed(() =>\n pickHeading(resolvedMessage.value?.title, message.title, message.messageName),\n)\n\nconst description = computed(\n () =>\n resolvedMessage.value?.description || resolvedMessage.value?.summary || '',\n)\n\n/**\n * Protocol keys declared directly on the message's protocol-specific `bindings`\n * (for example `ws`, `kafka`). The bindings object may be a `$ref`, so it is resolved\n * before reading the keys. Keys are lowercased to match the server protocols (which the\n * helper normalizes), so the union below de-duplicates case-insensitively.\n */\nconst messageBindingProtocols = computed(() => {\n const bindings = resolvedMessage.value?.bindings\n if (!bindings) {\n return []\n }\n const resolved = getResolvedRef(bindings)\n return Object.entries(resolved)\n .filter(([, value]) => value != null)\n .map(([protocol]) => protocol.toLowerCase())\n})\n\n/**\n * Protocol labels for the message. A message is carried over whatever protocols its\n * channel's servers speak, so we start from the channel's server protocols and union in\n * any extra protocols the message declares its own bindings for. Without this a\n * multi-protocol message would only surface the single protocol it happens to declare a\n * binding for (or none at all).\n */\nconst protocolLabels = computed(() => {\n const channel = resolveAsyncApiChannel(document, message.channelName)\n const { protocols } = getChannelServerLabels(document, channel)\n return [...new Set([...protocols, ...messageBindingProtocols.value])]\n})\n\n/** Payload schema, unwrapped from `$ref`s and Multi Format Schema wrappers. */\nconst payloadSchema = computed(() =>\n resolvedMessage.value\n ? getAsyncApiMessagePayloadSchema(resolvedMessage.value)\n : undefined,\n)\n\n/** Header schema, unwrapped the same way as the payload. */\nconst headersSchema = computed(() =>\n resolvedMessage.value\n ? getAsyncApiMessageHeadersSchema(resolvedMessage.value)\n : undefined,\n)\n\n/** Fill in defaults so the shared Schema renderer always receives a complete options object. */\nconst schemaOptions = computed<SchemaOptions>(() => ({\n hideReadOnly: false,\n ...resolveSchemaRenderOptions(options),\n}))\n\n/**\n * Accordion open state. Kept locally so clicking the header always toggles\n * immediately, and seeded/synced from the shared sidebar expansion map so\n * expanding the message in the sidebar (or deep-linking to it) opens it here too.\n */\nconst isExpanded = ref(expandedItems[message.id] ?? false)\n\nwatch(\n () => expandedItems[message.id],\n (value) => {\n if (value !== undefined) {\n isExpanded.value = value\n }\n },\n)\n\n/** Toggling the accordion updates local state and keeps the sidebar in sync. */\nconst onToggle = (open: boolean) => {\n isExpanded.value = open\n eventBus?.emit('toggle:nav-item', { id: message.id, open })\n}\n</script>\n\n<template>\n <div\n :id=\"message.id\"\n ref=\"section\"\n class=\"message\">\n <SectionAccordion\n class=\"message-accordion\"\n :modelValue=\"isExpanded\"\n @update:modelValue=\"onToggle\">\n <template #title>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: message.id })\n \">\n <span class=\"message-heading\">\n <SectionHeaderTag\n :id=\"headerId\"\n class=\"message-title\"\n :level=\"4\">\n {{ headingText }}\n </SectionHeaderTag>\n <AsyncApiLabels :protocols=\"protocolLabels\" />\n </span>\n </Anchor>\n </template>\n\n <ScalarMarkdown\n v-if=\"description\"\n class=\"message-description\"\n :value=\"description\"\n withImages />\n\n <div\n v-if=\"headersSchema\"\n class=\"message-schema\">\n <div class=\"message-schema-title\">Headers</div>\n <Schema\n compact\n :eventBus=\"eventBus\"\n name=\"Headers\"\n noncollapsible\n :options=\"schemaOptions\"\n :schema=\"headersSchema\" />\n </div>\n\n <div\n v-if=\"payloadSchema\"\n class=\"message-schema\">\n <div class=\"message-schema-title\">Payload</div>\n <Schema\n compact\n :eventBus=\"eventBus\"\n name=\"Payload\"\n noncollapsible\n :options=\"schemaOptions\"\n :schema=\"payloadSchema\" />\n </div>\n </SectionAccordion>\n </div>\n</template>\n\n<style scoped>\n.message {\n scroll-margin-top: var(--refs-viewport-offset);\n}\n.message-title {\n font-size: var(--scalar-heading-4);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n/*\n * Lay the heading and protocol labels out on one wrapping row. The labels live inside the\n * Anchor slot so the copy-anchor \"#\" button (absolutely positioned just past the end of the\n * slot content on hover) trails after the last pill instead of overlapping the first one.\n */\n.message-heading {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n}\n/* Pad the expanded body so the description and schemas don't sit flush against the border. */\n.message-accordion :deep(.section-accordion-content-card) {\n padding: 12px;\n}\n.message-description {\n padding-bottom: 4px;\n text-align: left;\n}\n.message-schema {\n margin-top: 12px;\n}\n.message-schema:first-child {\n margin-top: 0;\n}\n.message-schema-title {\n font-size: var(--scalar-font-size-2);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n margin-bottom: 8px;\n}\n</style>\n"],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
2
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import type { TraversedAsyncApiOperation } from '@scalar/workspace-store/schemas/navigation';
4
+ import type { AsyncApiSchemaRenderOptions } from './helpers/async-api-render-options.js';
5
+ /** Subset of the configuration the nested `Message`/`Schema` renderers need. */
6
+ type OperationOptions = AsyncApiSchemaRenderOptions;
7
+ type __VLS_Props = {
8
+ operation: TraversedAsyncApiOperation;
9
+ document: AsyncApiDocument;
10
+ eventBus: WorkspaceEventBus | null;
11
+ options?: Partial<OperationOptions>;
12
+ /** Map of navigation item id to expanded state, shared with the sidebar. */
13
+ expandedItems?: Record<string, boolean>;
14
+ };
15
+ 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>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ //# sourceMappingURL=Operation.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/AsyncApi/Operation.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,4CAA4C,CAAA;AAOnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAMrF,gFAAgF;AAChF,KAAK,gBAAgB,GAAG,2BAA2B,CAAA;AAEnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,0BAA0B,CAAA;IACrC,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACnC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC,CAAC;AA0LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,9 @@
1
+ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.js";
2
+ import Operation_vue_vue_type_script_setup_true_lang_default from "./Operation.vue.script.js";
3
+ /* empty css */
4
+ //#region src/components/Content/AsyncApi/Operation.vue
5
+ var Operation_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Operation_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ef35fcd1"]]);
6
+ //#endregion
7
+ export { Operation_default as default };
8
+
9
+ //# sourceMappingURL=Operation.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Operation.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n TraversedAsyncApiMessage,\n TraversedAsyncApiOperation,\n} from '@scalar/workspace-store/schemas/navigation'\nimport { computed, useId, useTemplateRef } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { SectionHeaderTag } from '@/components/Section'\nimport { useIntersection } from '@/hooks/use-intersection'\n\nimport type { AsyncApiSchemaRenderOptions } from './helpers/async-api-render-options'\nimport { filterChildrenByType } from './helpers/filter-children-by-type'\nimport { pickHeading } from './helpers/pick-heading'\nimport { resolveAsyncApiOperation } from './helpers/resolve-async-api-nodes'\nimport Message from './Message.vue'\n\n/** Subset of the configuration the nested `Message`/`Schema` renderers need. */\ntype OperationOptions = AsyncApiSchemaRenderOptions\n\nconst {\n operation,\n document,\n eventBus,\n options,\n expandedItems = {},\n} = defineProps<{\n operation: TraversedAsyncApiOperation\n document: AsyncApiDocument\n eventBus: WorkspaceEventBus | null\n options?: Partial<OperationOptions>\n /** Map of navigation item id to expanded state, shared with the sidebar. */\n expandedItems?: Record<string, boolean>\n}>()\n\nconst headerId = useId()\nconst section = useTemplateRef<HTMLElement>('section')\n\nuseIntersection(section, () =>\n eventBus?.emit('intersecting:nav-item', { id: operation.id }),\n)\n\n/**\n * Resolve the operation from the document so we can read its summary/description.\n * Operation traits are merged in (matching the channel connection UI) so trait-only\n * fields render as part of the operation.\n */\nconst resolvedOperation = computed(() =>\n resolveAsyncApiOperation(document, operation.operationName),\n)\n\n/** Heading prefers title, then summary, then the operation map key. */\nconst headingText = computed(() =>\n pickHeading(\n resolvedOperation.value?.title,\n operation.title,\n operation.operationName,\n ),\n)\n\nconst description = computed(\n () =>\n resolvedOperation.value?.description ||\n resolvedOperation.value?.summary ||\n '',\n)\n\n/** Only the message children of this operation. */\nconst messages = computed(() =>\n filterChildrenByType<TraversedAsyncApiMessage>(\n operation.children,\n 'asyncapi-message',\n ),\n)\n</script>\n\n<template>\n <div\n :id=\"operation.id\"\n ref=\"section\"\n class=\"operation\"\n :class=\"`operation--${operation.action}`\">\n <div class=\"operation-header\">\n <span\n class=\"operation-action\"\n :class=\"`operation-action--${operation.action}`\">\n {{ operation.action }}\n </span>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: operation.id })\n \">\n <SectionHeaderTag\n :id=\"headerId\"\n class=\"operation-title\"\n :level=\"3\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </div>\n\n <ScalarMarkdown\n v-if=\"description\"\n class=\"operation-description\"\n :value=\"description\"\n withImages />\n\n <Message\n v-for=\"message in messages\"\n :key=\"message.id\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :expandedItems=\"expandedItems\"\n :message=\"message\"\n :options=\"options\" />\n </div>\n</template>\n\n<style scoped>\n.operation {\n margin-top: 32px;\n scroll-margin-top: var(--refs-viewport-offset);\n}\n\n.operation-header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.operation-title {\n font-size: var(--scalar-heading-3);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n\n/* Filled, color-coded pill carries the primary send/receive signal. */\n.operation-action {\n text-transform: uppercase;\n font-size: var(--scalar-mini);\n font-weight: var(--scalar-semibold);\n letter-spacing: 0.05em;\n border-radius: 12px;\n padding: 2px 8px;\n display: inline-flex;\n align-items: center;\n}\n.operation-action--send {\n color: var(--scalar-color-blue);\n background: color-mix(in srgb, var(--scalar-color-blue), transparent 88%);\n}\n.operation-action--receive {\n color: var(--scalar-color-green);\n background: color-mix(in srgb, var(--scalar-color-green), transparent 88%);\n}\n\n.operation-description {\n text-align: left;\n margin-top: 4px;\n}\n/* Space the first message accordion away from the operation header/description. */\n.operation > :deep(.message) {\n margin-top: 12px;\n}\n</style>\n"],"mappings":""}