@scalar/api-reference 1.62.0 → 1.62.2

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 (181) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/browser/chunks/{AgentScalarChatInterface-C3QiXv0S.js → AgentScalarChatInterface-c6CQmaLr.js} +4 -4
  3. package/dist/browser/chunks/ScalarTextInput.vue-D_L-rtQC.js +27 -0
  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-BvqLUPs5.js +99 -0
  71. package/dist/browser/chunks/{modal-CMytT4BZ.js → modal-CfujTjCR.js} +2 -2
  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-BPQqqkn-.js → vendor-BlFFskFr.js} +116 -116
  93. package/dist/browser/standalone.esm.js +20 -20
  94. package/dist/browser/standalone.js +245 -245
  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 -2
  99. package/dist/components/ApiReference.vue.script.js.map +1 -1
  100. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -1
  101. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -1
  102. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +2 -0
  103. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
  104. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +6 -0
  105. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
  106. package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
  107. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -1
  108. package/dist/components/Content/AsyncApi/Channel.vue.script.js +4 -2
  109. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
  110. package/dist/components/Content/AsyncApi/ChannelsList.vue.d.ts +10 -0
  111. package/dist/components/Content/AsyncApi/ChannelsList.vue.d.ts.map +1 -0
  112. package/dist/components/Content/AsyncApi/ChannelsList.vue.js +9 -0
  113. package/dist/components/Content/AsyncApi/ChannelsList.vue.js.map +1 -0
  114. package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js +56 -0
  115. package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js.map +1 -0
  116. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  117. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  118. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  119. package/dist/components/Content/Schema/Schema.vue.script.js +93 -12
  120. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  121. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  122. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  123. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  124. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +38 -9
  125. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  126. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +1 -1
  127. package/dist/components/Content/Schema/helpers/dynamic-scope.d.ts +27 -0
  128. package/dist/components/Content/Schema/helpers/dynamic-scope.d.ts.map +1 -0
  129. package/dist/components/Content/Schema/helpers/dynamic-scope.js +35 -0
  130. package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -0
  131. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +10 -0
  132. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts.map +1 -1
  133. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +11 -2
  134. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
  135. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +9 -2
  136. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  137. package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
  138. package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -1
  139. package/dist/components/Content/Tags/components/TagSection.vue.script.js +14 -3
  140. package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
  141. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  142. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  143. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  144. package/dist/features/Operation/components/RequestBody.vue.script.js +3 -1
  145. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  146. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  147. package/dist/features/localization/locales/ar.d.ts +1 -0
  148. package/dist/features/localization/locales/ar.d.ts.map +1 -1
  149. package/dist/features/localization/locales/ar.js +2 -1
  150. package/dist/features/localization/locales/ar.js.map +1 -1
  151. package/dist/features/localization/locales/de.d.ts +1 -0
  152. package/dist/features/localization/locales/de.d.ts.map +1 -1
  153. package/dist/features/localization/locales/de.js +2 -1
  154. package/dist/features/localization/locales/de.js.map +1 -1
  155. package/dist/features/localization/locales/en.d.ts +1 -0
  156. package/dist/features/localization/locales/en.d.ts.map +1 -1
  157. package/dist/features/localization/locales/en.js +2 -1
  158. package/dist/features/localization/locales/en.js.map +1 -1
  159. package/dist/features/localization/locales/es.d.ts +1 -0
  160. package/dist/features/localization/locales/es.d.ts.map +1 -1
  161. package/dist/features/localization/locales/es.js +2 -1
  162. package/dist/features/localization/locales/es.js.map +1 -1
  163. package/dist/features/localization/locales/fr.d.ts +1 -0
  164. package/dist/features/localization/locales/fr.d.ts.map +1 -1
  165. package/dist/features/localization/locales/fr.js +2 -1
  166. package/dist/features/localization/locales/fr.js.map +1 -1
  167. package/dist/features/localization/locales/ru.d.ts +1 -0
  168. package/dist/features/localization/locales/ru.d.ts.map +1 -1
  169. package/dist/features/localization/locales/ru.js +2 -1
  170. package/dist/features/localization/locales/ru.js.map +1 -1
  171. package/dist/features/localization/locales/zh-cn.d.ts +1 -0
  172. package/dist/features/localization/locales/zh-cn.d.ts.map +1 -1
  173. package/dist/features/localization/locales/zh-cn.js +2 -1
  174. package/dist/features/localization/locales/zh-cn.js.map +1 -1
  175. package/dist/features/localization/translations.d.ts +7 -0
  176. package/dist/features/localization/translations.d.ts.map +1 -1
  177. package/dist/style.css +123 -97
  178. package/dist/vue-styles.css +116 -90
  179. package/package.json +14 -14
  180. package/dist/browser/chunks/ScalarTextInput.vue-CysYmeeN.js +0 -27
  181. package/dist/browser/chunks/modal-wI0tG53V.js +0 -99
@@ -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 { 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDA,MAAM,WAAW,OAAM;;;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,WAAA,MAAW,UAAA,WAAA,EADnB,YAMgB,uBAAA;;QAJb,UAAU,QAAA;QACV,SAAS,qBAAA;QACT,YAAY,WAAA;;QACF,OAAK,cAAW,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAV,cAAU,GAAA,CAAA,EAAA,CAAA;;;;;;;yBAE7B,mBAOuB,UAAA,MAAA,WAND,WAAA,QAAb,cAAS;4BADlB,YAOuB,mBAAA;SALpB,KAAK,UAAU;SACf,UAAU,QAAA;SACV,UAAU,QAAA;SACV,eAAe,QAAA;SACJ;SACX,SAAS,QAAA"}
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 level = 0,\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 * Nesting depth in the navigation tree. A channel nested inside a tag\n * (`level !== 0`) inherits the tag's horizontal padding, so it skips its own\n * `SectionContainer` padding to avoid doubling the indentation.\n */\n level?: number\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 :omit=\"level !== 0\"\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEA,MAAM,WAAW,OAAM;;;;;EAMvB,MAAM,kBAAkB,eACtB,uBAAuB,QAAA,UAAU,QAAA,QAAQ,YAAY,CACvD;EAEA,MAAM,cAAc,eAAe,gBAAgB,OAAO,eAAe,GAAE;;;;;;;;;EAU3E,MAAM,cAAc,eAClB,YAAY,gBAAgB,OAAO,OAAO,QAAA,QAAQ,eAAe,CACnE;;;;;EAMA,MAAM,aAAa,eACjB,wBAAwB,gBAAgB,OAAO,WAAW,CAC5D;;EAGA,MAAM,uBAAuB,gBAAsC;GACjE,YAAY,QAAA,SAAS,cAAc;GACnC,GAAG,2BAA2B,QAAA,QAAQ;GACvC,EAAC;;;;;EAMF,MAAM,SAAS,eACb,uBAAuB,QAAA,UAAU,gBAAgB,MAAM,CACzD;;EAGA,MAAM,aAAa,eACjB,qBACE,QAAA,QAAQ,UACR,qBACD,CACH;;UAKU,QAAA,WAAM,aAAA,WAAA,EADd,YA4C4B,MAAA,kCAAA,EAAA;;IA1CzB,cAAY,YAAA;IACb,OAAM;IACL,YAAU,CAAG,QAAA;IACb,uBAAiB,OAAA,OAAA,OAAA,MAAU,UAAkB,QAAA,UAAU,KAAI,mBAAA;KAAA,IAA0B,QAAA,QAAQ;KAAE,MAAQ;KAAK,CAAA;;IAIl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A;6BADL,CATT,YASS,MAAA,eAAA,EAAA,EARN,iBAAa,OAAA,OAAA,OAAA,WAAqB,QAAA,UAAU,KAAI,qBAAA,EAAA,IAA4B,QAAA,QAAQ,IAAE,CAAA,GAAA,EAAA;8BAOpE,CAJnB,YAImB,MAAA,yBAAA,EAAA;QAHhB,IAAI,MAAA,SAAQ;QACZ,OAAO;;+BACS,CAAA,gBAAA,gBAAd,YAAA,MAAW,EAAA,EAAA,CAAA,CAAA;;;;;;SAIpB,YAuBiB,MAAA,uBAAA,EAAA,MAAA;6BAnBe;OAH9B,YAG8B,wBAAA;QAF5B,OAAM;QACL,WAAW,OAAA,MAAO;QAClB,SAAS,OAAA,MAAO;;OACnB,YAEe,MAAA,eAAA,EAAA;QADZ,OAAO,YAAA;QACR,YAAA;;OAEM,WAAA,MAAW,UAAA,WAAA,EADnB,YAMgB,uBAAA;;QAJb,UAAU,QAAA;QACV,SAAS,qBAAA;QACT,YAAY,WAAA;;QACF,OAAK,cAAW,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAV,cAAU,GAAA,CAAA,EAAA,CAAA;;;;;;;yBAE7B,mBAOuB,UAAA,MAAA,WAND,WAAA,QAAb,cAAS;4BADlB,YAOuB,mBAAA;SALpB,KAAK,UAAU;SACf,UAAU,QAAA;SACV,UAAU,QAAA;SACV,eAAe,QAAA;SACJ;SACX,SAAS,QAAA"}
@@ -0,0 +1,10 @@
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ import type { TraversedTag } from '@scalar/workspace-store/schemas/navigation';
3
+ type __VLS_Props = {
4
+ tag: TraversedTag;
5
+ eventBus: WorkspaceEventBus | null;
6
+ };
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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ //# sourceMappingURL=ChannelsList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/AsyncApi/ChannelsList.vue"],"names":[],"mappings":"AAoGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,4CAA4C,CAAA;AAMnD,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AAmIF,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 ChannelsList_vue_vue_type_script_setup_true_lang_default from "./ChannelsList.vue.script.js";
3
+ /* empty css */
4
+ //#region src/components/Content/AsyncApi/ChannelsList.vue
5
+ var ChannelsList_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ChannelsList_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-817abeb3"]]);
6
+ //#endregion
7
+ export { ChannelsList_default as default };
8
+
9
+ //# sourceMappingURL=ChannelsList.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelsList.vue.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/ChannelsList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarCard,\n ScalarCardHeader,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n TraversedAsyncApiChannel,\n TraversedTag,\n} from '@scalar/workspace-store/schemas/navigation'\nimport { computed } from 'vue'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\n\nconst { tag } = defineProps<{\n tag: TraversedTag\n eventBus: WorkspaceEventBus | null\n}>()\nconst { translate } = useLocalization()\n\n/**\n * Channels grouped under this tag. The OpenAPI `OperationsList` only knows about\n * `operation`/`webhook` children, so AsyncAPI tags need their own list that links\n * straight to each channel section.\n */\nconst channels = computed(\n () =>\n tag.children?.filter(\n (child): child is TraversedAsyncApiChannel =>\n child.type === 'asyncapi-channel',\n ) ?? [],\n)\n</script>\n\n<template>\n <ScalarCard\n v-if=\"channels.length\"\n class=\"channels-card\">\n <ScalarCardHeader muted>\n <ScreenReader>{{ tag.title }}</ScreenReader>\n {{ translate('navigation.channels') }}\n </ScalarCardHeader>\n <ScalarCardSection class=\"custom-scroll max-h-[60vh]\">\n <ul\n :aria-label=\"translate('navigation.channels')\"\n class=\"channels\">\n <li\n v-for=\"channel in channels\"\n :key=\"channel.id\"\n class=\"contents\">\n <a\n class=\"channel\"\n @click.prevent=\"\n () => eventBus?.emit('scroll-to:nav-item', { id: channel.id })\n \">\n {{ channel.title || channel.channelAddress }}\n </a>\n </li>\n </ul>\n </ScalarCardSection>\n </ScalarCard>\n</template>\n\n<style scoped>\n.channels-card {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n font-size: var(--scalar-font-size-3);\n}\n.channels {\n overflow: auto;\n background: var(--scalar-background-2);\n padding: 10px 12px;\n width: 100%;\n}\n.channel {\n display: flex;\n white-space: nowrap;\n cursor: pointer;\n text-decoration: none;\n color: var(--scalar-color-1);\n line-height: 1.55;\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-small);\n}\n.channel:hover,\n.channel:focus-visible {\n text-decoration: underline;\n}\n</style>\n"],"mappings":""}
@@ -0,0 +1,56 @@
1
+ import { useLocalization } from "../../../features/localization/use-localization.js";
2
+ import ScreenReader_default from "../../ScreenReader.vue.js";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx, withModifiers } from "vue";
4
+ import { ScalarCard, ScalarCardHeader, ScalarCardSection } from "@scalar/components/card";
5
+ //#region src/components/Content/AsyncApi/ChannelsList.vue?vue&type=script&setup=true&lang.ts
6
+ var _hoisted_1 = ["aria-label"];
7
+ var _hoisted_2 = ["onClick"];
8
+ var ChannelsList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
+ __name: "ChannelsList",
10
+ props: {
11
+ tag: {},
12
+ eventBus: {}
13
+ },
14
+ setup(__props) {
15
+ const { translate } = useLocalization();
16
+ /**
17
+ * Channels grouped under this tag. The OpenAPI `OperationsList` only knows about
18
+ * `operation`/`webhook` children, so AsyncAPI tags need their own list that links
19
+ * straight to each channel section.
20
+ */
21
+ const channels = computed(() => __props.tag.children?.filter((child) => child.type === "asyncapi-channel") ?? []);
22
+ return (_ctx, _cache) => {
23
+ return channels.value.length ? (openBlock(), createBlock(unref(ScalarCard), {
24
+ key: 0,
25
+ class: "channels-card"
26
+ }, {
27
+ default: withCtx(() => [createVNode(unref(ScalarCardHeader), { muted: "" }, {
28
+ default: withCtx(() => [createVNode(ScreenReader_default, null, {
29
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.tag.title), 1)]),
30
+ _: 1
31
+ }), createTextVNode(" " + toDisplayString(unref(translate)("navigation.channels")), 1)]),
32
+ _: 1
33
+ }), createVNode(unref(ScalarCardSection), { class: "custom-scroll max-h-[60vh]" }, {
34
+ default: withCtx(() => [createElementVNode("ul", {
35
+ "aria-label": unref(translate)("navigation.channels"),
36
+ class: "channels"
37
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(channels.value, (channel) => {
38
+ return openBlock(), createElementBlock("li", {
39
+ key: channel.id,
40
+ class: "contents"
41
+ }, [createElementVNode("a", {
42
+ class: "channel",
43
+ onClick: withModifiers(() => __props.eventBus?.emit("scroll-to:nav-item", { id: channel.id }), ["prevent"])
44
+ }, toDisplayString(channel.title || channel.channelAddress), 9, _hoisted_2)]);
45
+ }), 128))], 8, _hoisted_1)]),
46
+ _: 1
47
+ })]),
48
+ _: 1
49
+ })) : createCommentVNode("", true);
50
+ };
51
+ }
52
+ });
53
+ //#endregion
54
+ export { ChannelsList_vue_vue_type_script_setup_true_lang_default as default };
55
+
56
+ //# sourceMappingURL=ChannelsList.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelsList.vue.script.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/ChannelsList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarCard,\n ScalarCardHeader,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n TraversedAsyncApiChannel,\n TraversedTag,\n} from '@scalar/workspace-store/schemas/navigation'\nimport { computed } from 'vue'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\n\nconst { tag } = defineProps<{\n tag: TraversedTag\n eventBus: WorkspaceEventBus | null\n}>()\nconst { translate } = useLocalization()\n\n/**\n * Channels grouped under this tag. The OpenAPI `OperationsList` only knows about\n * `operation`/`webhook` children, so AsyncAPI tags need their own list that links\n * straight to each channel section.\n */\nconst channels = computed(\n () =>\n tag.children?.filter(\n (child): child is TraversedAsyncApiChannel =>\n child.type === 'asyncapi-channel',\n ) ?? [],\n)\n</script>\n\n<template>\n <ScalarCard\n v-if=\"channels.length\"\n class=\"channels-card\">\n <ScalarCardHeader muted>\n <ScreenReader>{{ tag.title }}</ScreenReader>\n {{ translate('navigation.channels') }}\n </ScalarCardHeader>\n <ScalarCardSection class=\"custom-scroll max-h-[60vh]\">\n <ul\n :aria-label=\"translate('navigation.channels')\"\n class=\"channels\">\n <li\n v-for=\"channel in channels\"\n :key=\"channel.id\"\n class=\"contents\">\n <a\n class=\"channel\"\n @click.prevent=\"\n () => eventBus?.emit('scroll-to:nav-item', { id: channel.id })\n \">\n {{ channel.title || channel.channelAddress }}\n </a>\n </li>\n </ul>\n </ScalarCardSection>\n </ScalarCard>\n</template>\n\n<style scoped>\n.channels-card {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n font-size: var(--scalar-font-size-3);\n}\n.channels {\n overflow: auto;\n background: var(--scalar-background-2);\n padding: 10px 12px;\n width: 100%;\n}\n.channel {\n display: flex;\n white-space: nowrap;\n cursor: pointer;\n text-decoration: none;\n color: var(--scalar-color-1);\n line-height: 1.55;\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-small);\n}\n.channel:hover,\n.channel:focus-visible {\n text-decoration: underline;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;EAoBA,MAAM,EAAE,cAAc,iBAAgB;;;;;;EAOtC,MAAM,WAAW,eAEb,QAAA,IAAI,UAAU,QACX,UACC,MAAM,SAAS,mBAClB,IAAI,EAAE,CACX;;UAKU,SAAA,MAAS,UAAA,WAAA,EADjB,YAyBa,MAAA,WAAA,EAAA;;IAvBX,OAAM;;2BAIa,CAHnB,YAGmB,MAAA,iBAAA,EAAA,EAHD,OAAA,IAAK,EAAA;4BACuB,CAA5C,YAA4C,sBAAA,MAAA;6BAAf,CAAA,gBAAA,gBAAZ,QAAA,IAAI,MAAK,EAAA,EAAA,CAAA,CAAA;;yBAAkB,MAC5C,gBAAG,MAAA,UAAS,CAAA,sBAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;QAEd,YAiBoB,MAAA,kBAAA,EAAA,EAjBD,OAAM,8BAA4B,EAAA;4BAgB9C,CAfL,mBAeK,MAAA;MAdF,cAAY,MAAA,UAAS,CAAA,sBAAA;MACtB,OAAM;2BACN,mBAWK,UAAA,MAAA,WAVe,SAAA,QAAX,YAAO;0BADhB,mBAWK,MAAA;OATF,KAAK,QAAQ;OACd,OAAM;UACN,mBAMI,KAAA;OALF,OAAM;OACL,SAAK,oBAA+B,QAAA,UAAU,KAAI,sBAAA,EAAA,IAA6B,QAAQ,IAAE,CAAA,EAAA,CAAA,UAAA,CAAA;yBAGvF,QAAQ,SAAS,QAAQ,eAAc,EAAA,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yC"}
1
+ {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AA0iBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAoBtE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,0EAA0E;IAC1E,OAAO,EAAE,aAAa,CAAA;IACtB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAuoBF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import Schema_vue_vue_type_script_setup_true_lang_default from "./Schema.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Content/Schema/Schema.vue
5
- var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b482770e"]]);
5
+ var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e811e294"]]);
6
6
  //#endregion
7
7
  export { Schema_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { pushDynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport {\n resolveDynamicSchema,\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n useDynamicScope,\n} from './helpers/dynamic-scope'\nimport { inferDiscriminatorMappingComposition } from './helpers/get-compositions-to-render'\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * The dynamic scope inherited from ancestor schema resources.\n *\n * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the\n * tree. Empty at the root. See {@link useDynamicScope}.\n */\nconst dynamicScope = useDynamicScope()\n\n/**\n * The schema this node actually renders.\n *\n * Two normalizations happen here, both no-ops for ordinary schemas:\n * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.\n * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside\n * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.\n */\nconst resolvedSchema = computed((): SchemaObject | undefined => {\n if (!schema || typeof schema !== 'object') {\n return schema\n }\n\n const bound = resolveDynamicSchema(schema, dynamicScope)\n return '$ref' in bound ? resolve.schema(bound) : bound\n})\n\n/**\n * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.\n *\n * Built once at setup from the resource's stable identity (like the ancestor set below);\n * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.\n *\n * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`\n * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which\n * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).\n */\nconst scopeSchema = schema\n ? resolveDynamicSchema(schema, dynamicScope)\n : undefined\nprovide(\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope,\n)\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n const value = resolvedSchema.value\n\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!value?.description || typeof value.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (value.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in value) &&\n !('patternProperties' in value) &&\n !('additionalProperties' in value)\n ) {\n return null\n }\n\n // Return the schema's own description\n return value.description\n})\n\n/**\n * Some generators (for example NSwag) describe a polymorphic base type as a\n * plain object with a `discriminator.mapping` but no explicit `oneOf`. We infer\n * the variant composition from the mapping so the selector still renders.\n *\n * The `discriminator` prop is only set when this schema is already a variant\n * being rendered inside a `SchemaComposition`; skipping the inference in that\n * case avoids re-inferring (and recursing) on a self-referential mapping.\n *\n * The inference is restricted to plain object schemas (`isTypeObject`). A schema\n * carrying its own composition keyword (`allOf`/`not`) is rendered by the\n * `SchemaProperty` branch below; inferring a selector there would replace that\n * keyword's output with the variant dropdown instead of rendering both.\n */\nconst inferredDiscriminatorComposition = computed(() =>\n schema && !discriminator && isTypeObject(schema)\n ? inferDiscriminatorMappingComposition(schema, options.document)\n : null,\n)\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"resolvedSchema && Object.keys(resolvedSchema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(resolvedSchema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"resolvedSchema?.title ?? name\"\n :value=\"resolvedSchema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Variant selector inferred from a discriminator mapping -->\n <SchemaComposition\n v-if=\"inferredDiscriminatorComposition\"\n :breadcrumb\n :compact\n composition=\"oneOf\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :options\n :schema=\"inferredDiscriminatorComposition\"\n :schemaContext=\"schemaContext\" />\n <!-- Object properties -->\n <SchemaObjectProperties\n v-else-if=\"isTypeObject(resolvedSchema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"resolvedSchema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
@@ -1,10 +1,13 @@
1
1
  import { useLocalization } from "../../../features/localization/use-localization.js";
2
2
  import ScreenReader_default from "../../ScreenReader.vue.js";
3
3
  import { scrollTargetId } from "../../../helpers/lazy-bus.js";
4
+ import { SCHEMA_DYNAMIC_SCOPE_SYMBOL, resolveDynamicSchema, useDynamicScope } from "./helpers/dynamic-scope.js";
5
+ import { inferDiscriminatorMappingComposition } from "./helpers/get-compositions-to-render.js";
4
6
  import { isTypeObject } from "./helpers/is-type-object.js";
5
7
  import { isEmptySchemaObject } from "./helpers/is-empty-schema-object.js";
6
8
  import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
7
9
  import { SCHEMA_ANCESTORS_SYMBOL } from "./helpers/schema-cycle.js";
10
+ import SchemaComposition_default from "./SchemaComposition.vue.js";
8
11
  import SchemaHeading_default from "./SchemaHeading.vue.js";
9
12
  import SchemaProperty_default from "./SchemaProperty.vue.js";
10
13
  import SchemaObjectProperties_default from "./SchemaObjectProperties.vue.js";
@@ -12,6 +15,8 @@ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock
12
15
  import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
13
16
  import { ScalarMarkdown } from "@scalar/components/markdown";
14
17
  import { ScalarIcon } from "@scalar/components/icon";
18
+ import { resolve } from "@scalar/workspace-store/resolve";
19
+ import { pushDynamicScope } from "@scalar/workspace-store/helpers/dynamic-ref";
15
20
  //#region src/components/Content/Schema/Schema.vue?vue&type=script&setup=true&lang.ts
16
21
  var _hoisted_1 = {
17
22
  key: 0,
@@ -57,6 +62,38 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
57
62
  setup(__props) {
58
63
  const { translate } = useLocalization();
59
64
  /**
65
+ * The dynamic scope inherited from ancestor schema resources.
66
+ *
67
+ * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the
68
+ * tree. Empty at the root. See {@link useDynamicScope}.
69
+ */
70
+ const dynamicScope = useDynamicScope();
71
+ /**
72
+ * The schema this node actually renders.
73
+ *
74
+ * Two normalizations happen here, both no-ops for ordinary schemas:
75
+ * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.
76
+ * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside
77
+ * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.
78
+ */
79
+ const resolvedSchema = computed(() => {
80
+ if (!__props.schema || typeof __props.schema !== "object") return __props.schema;
81
+ const bound = resolveDynamicSchema(__props.schema, dynamicScope);
82
+ return "$ref" in bound ? resolve.schema(bound) : bound;
83
+ });
84
+ /**
85
+ * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.
86
+ *
87
+ * Built once at setup from the resource's stable identity (like the ancestor set below);
88
+ * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.
89
+ *
90
+ * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`
91
+ * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which
92
+ * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).
93
+ */
94
+ const scopeSchema = __props.schema ? resolveDynamicSchema(__props.schema, dynamicScope) : void 0;
95
+ provide(SCHEMA_DYNAMIC_SCOPE_SYMBOL, scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope);
96
+ /**
60
97
  * Cycle-safe `expandAllSchemaProperties`.
61
98
  *
62
99
  * We track ancestor schema keys along the current render path. A node is
@@ -106,18 +143,34 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
106
143
  const childAttributesLabel = computed(() => __props.schema?.title ?? translate("schema.childAttributes"));
107
144
  /** Gets the description to show for the schema */
108
145
  const schemaDescription = computed(() => {
146
+ const value = resolvedSchema.value;
109
147
  if (__props.hideDescription) return null;
110
148
  if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return mergeAllOfSchemas(__props.schema)?.description || null;
111
- if (!__props.schema?.description || typeof __props.schema.description !== "string") return null;
112
- if (__props.schema.enum) return null;
113
- if (!("properties" in __props.schema) && !("patternProperties" in __props.schema) && !("additionalProperties" in __props.schema)) return null;
114
- return __props.schema.description;
149
+ if (!value?.description || typeof value.description !== "string") return null;
150
+ if (value.enum) return null;
151
+ if (!("properties" in value) && !("patternProperties" in value) && !("additionalProperties" in value)) return null;
152
+ return value.description;
115
153
  });
154
+ /**
155
+ * Some generators (for example NSwag) describe a polymorphic base type as a
156
+ * plain object with a `discriminator.mapping` but no explicit `oneOf`. We infer
157
+ * the variant composition from the mapping so the selector still renders.
158
+ *
159
+ * The `discriminator` prop is only set when this schema is already a variant
160
+ * being rendered inside a `SchemaComposition`; skipping the inference in that
161
+ * case avoids re-inferring (and recursing) on a self-referential mapping.
162
+ *
163
+ * The inference is restricted to plain object schemas (`isTypeObject`). A schema
164
+ * carrying its own composition keyword (`allOf`/`not`) is rendered by the
165
+ * `SchemaProperty` branch below; inferring a selector there would replace that
166
+ * keyword's output with the variant dropdown instead of rendering both.
167
+ */
168
+ const inferredDiscriminatorComposition = computed(() => __props.schema && !__props.discriminator && isTypeObject(__props.schema) ? inferDiscriminatorMappingComposition(__props.schema, __props.options.document) : null);
116
169
  const handleClick = (e) => {
117
170
  if (__props.noncollapsible) e.stopPropagation();
118
171
  };
119
172
  return (_ctx, _cache) => {
120
- return typeof __props.schema === "object" && Object.keys(__props.schema).length ? (openBlock(), createBlock(unref(Disclosure), {
173
+ return resolvedSchema.value && Object.keys(resolvedSchema.value).length ? (openBlock(), createBlock(unref(Disclosure), {
121
174
  key: 0,
122
175
  defaultOpen: defaultOpen.value
123
176
  }, {
@@ -130,7 +183,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
130
183
  { "border-t": __props.additionalProperties && open }
131
184
  ]]) }, [
132
185
  schemaDescription.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ScalarMarkdown), { value: schemaDescription.value }, null, 8, ["value"])])) : createCommentVNode("", true),
133
- unref(isEmptySchemaObject)(__props.schema) ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(translate)("schema.emptyObject")), 1)) : createCommentVNode("", true),
186
+ unref(isEmptySchemaObject)(resolvedSchema.value) ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(translate)("schema.emptyObject")), 1)) : createCommentVNode("", true),
134
187
  createElementVNode("div", { class: normalizeClass(["schema-properties", { "schema-properties-open": open }]) }, [__props.additionalProperties ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(DisclosureButton), {
135
188
  as: "button",
136
189
  class: "schema-card-title schema-card-title--compact",
@@ -172,8 +225,8 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
172
225
  icon: "Add",
173
226
  size: "sm"
174
227
  }, null, 8, ["class"]), createVNode(SchemaHeading_default, {
175
- name: __props.schema?.title ?? __props.name,
176
- value: __props.schema
228
+ name: resolvedSchema.value?.title ?? __props.name,
229
+ value: resolvedSchema.value
177
230
  }, null, 8, ["name", "value"])], 64))]),
178
231
  _: 2
179
232
  }, 1032, [
@@ -185,10 +238,38 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
185
238
  as: "ul",
186
239
  static: !shouldShowToggle.value
187
240
  }, {
188
- default: withCtx(() => [unref(isTypeObject)(__props.schema) ? (openBlock(), createBlock(SchemaObjectProperties_default, {
241
+ default: withCtx(() => [inferredDiscriminatorComposition.value ? (openBlock(), createBlock(SchemaComposition_default, {
189
242
  key: 0,
190
243
  breadcrumb: __props.breadcrumb,
191
244
  compact: __props.compact,
245
+ composition: "oneOf",
246
+ compositionPath: __props.compositionPath,
247
+ discriminator: __props.schema?.discriminator,
248
+ eventBus: __props.eventBus,
249
+ hideHeading: __props.hideHeading,
250
+ hideModelNames: __props.hideModelNames,
251
+ level: __props.level,
252
+ name: __props.name,
253
+ options: __props.options,
254
+ schema: inferredDiscriminatorComposition.value,
255
+ schemaContext: __props.schemaContext
256
+ }, null, 8, [
257
+ "breadcrumb",
258
+ "compact",
259
+ "compositionPath",
260
+ "discriminator",
261
+ "eventBus",
262
+ "hideHeading",
263
+ "hideModelNames",
264
+ "level",
265
+ "name",
266
+ "options",
267
+ "schema",
268
+ "schemaContext"
269
+ ])) : unref(isTypeObject)(resolvedSchema.value) ? (openBlock(), createBlock(SchemaObjectProperties_default, {
270
+ key: 1,
271
+ breadcrumb: __props.breadcrumb,
272
+ compact: __props.compact,
192
273
  compositionPath: __props.compositionPath,
193
274
  discriminator: __props.discriminator,
194
275
  eventBus: __props.eventBus,
@@ -196,7 +277,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
196
277
  hideModelNames: __props.hideModelNames,
197
278
  level: __props.level + 1,
198
279
  options: __props.options,
199
- schema: __props.schema,
280
+ schema: resolvedSchema.value,
200
281
  schemaContext: __props.schemaContext
201
282
  }, null, 8, [
202
283
  "breadcrumb",
@@ -210,7 +291,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
210
291
  "options",
211
292
  "schema",
212
293
  "schemaContext"
213
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.schema ? (openBlock(), createBlock(SchemaProperty_default, {
294
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [resolvedSchema.value ? (openBlock(), createBlock(SchemaProperty_default, {
214
295
  key: 0,
215
296
  breadcrumb: __props.breadcrumb,
216
297
  compact: __props.compact,
@@ -220,7 +301,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
220
301
  hideModelNames: __props.hideModelNames,
221
302
  level: __props.level,
222
303
  options: __props.options,
223
- schema: __props.schema,
304
+ schema: resolvedSchema.value,
224
305
  schemaContext: __props.schemaContext
225
306
  }, null, 8, [
226
307
  "breadcrumb",
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6EA,MAAM,EAAE,cAAc,iBAAgB;;;;;;;;;;;EAYtC,MAAM,YAAY,OAAO,yBAAyB,KAAA,EAAS;EAE3D,MAAM,WAAW,eACA,QAAA,YAAY,QAAQ,CAAC,CAAC,WAAW,IAAI,QAAA,SAAS,CAC/D;EAIA,MAAM,iBAAiB,IAAI,IAAa,aAAa,EAAE,CAAA;AACvD,MAAI,QAAA,YAAY,KACd,gBAAe,IAAI,QAAA,SAAQ;AAE7B,UAAQ,yBAAyB,eAAc;EAE/C,MAAM,oBAAoB,eACT,CAAC,CAAC,QAAA,QAAQ,6BAA6B,CAAC,SAAS,MAClE;;;;;EAMA,MAAM,mBAAmB,eAAwB,CAAC,QAAA,kBAAkB,QAAA,QAAQ,EAAC;;;;;;;;;EAU7E,MAAM,uBAAuB,eAAwB;AACnD,OAAI,CAAC,QAAA,YAAY,OACf,QAAO;GAET,MAAM,OAAO,QAAA,WAAW,KAAK,IAAG;GAChC,MAAM,SAAS,eAAe;AAC9B,UAAO,WAAW,QAAQ,OAAO,WAAW,GAAG,KAAK,GAAE;IACvD;;;;;;;;;;;;EAaD,MAAM,cAAc,eAEhB,QAAA,kBAAkB,kBAAkB,SAAS,qBAAqB,MACtE;EAEA,MAAM,uBAAuB,eACb,QAAA,QAAQ,SAAS,UAAU,yBAAyB,C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],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { pushDynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport {\n resolveDynamicSchema,\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n useDynamicScope,\n} from './helpers/dynamic-scope'\nimport { inferDiscriminatorMappingComposition } from './helpers/get-compositions-to-render'\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * The dynamic scope inherited from ancestor schema resources.\n *\n * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the\n * tree. Empty at the root. See {@link useDynamicScope}.\n */\nconst dynamicScope = useDynamicScope()\n\n/**\n * The schema this node actually renders.\n *\n * Two normalizations happen here, both no-ops for ordinary schemas:\n * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.\n * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside\n * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.\n */\nconst resolvedSchema = computed((): SchemaObject | undefined => {\n if (!schema || typeof schema !== 'object') {\n return schema\n }\n\n const bound = resolveDynamicSchema(schema, dynamicScope)\n return '$ref' in bound ? resolve.schema(bound) : bound\n})\n\n/**\n * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.\n *\n * Built once at setup from the resource's stable identity (like the ancestor set below);\n * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.\n *\n * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`\n * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which\n * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).\n */\nconst scopeSchema = schema\n ? resolveDynamicSchema(schema, dynamicScope)\n : undefined\nprovide(\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope,\n)\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n const value = resolvedSchema.value\n\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!value?.description || typeof value.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (value.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in value) &&\n !('patternProperties' in value) &&\n !('additionalProperties' in value)\n ) {\n return null\n }\n\n // Return the schema's own description\n return value.description\n})\n\n/**\n * Some generators (for example NSwag) describe a polymorphic base type as a\n * plain object with a `discriminator.mapping` but no explicit `oneOf`. We infer\n * the variant composition from the mapping so the selector still renders.\n *\n * The `discriminator` prop is only set when this schema is already a variant\n * being rendered inside a `SchemaComposition`; skipping the inference in that\n * case avoids re-inferring (and recursing) on a self-referential mapping.\n *\n * The inference is restricted to plain object schemas (`isTypeObject`). A schema\n * carrying its own composition keyword (`allOf`/`not`) is rendered by the\n * `SchemaProperty` branch below; inferring a selector there would replace that\n * keyword's output with the variant dropdown instead of rendering both.\n */\nconst inferredDiscriminatorComposition = computed(() =>\n schema && !discriminator && isTypeObject(schema)\n ? inferDiscriminatorMappingComposition(schema, options.document)\n : null,\n)\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"resolvedSchema && Object.keys(resolvedSchema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(resolvedSchema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"resolvedSchema?.title ?? name\"\n :value=\"resolvedSchema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Variant selector inferred from a discriminator mapping -->\n <SchemaComposition\n v-if=\"inferredDiscriminatorComposition\"\n :breadcrumb\n :compact\n composition=\"oneOf\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :options\n :schema=\"inferredDiscriminatorComposition\"\n :schemaContext=\"schemaContext\" />\n <!-- Object properties -->\n <SchemaObjectProperties\n v-else-if=\"isTypeObject(resolvedSchema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"resolvedSchema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFA,MAAM,EAAE,cAAc,iBAAgB;;;;;;;EAQtC,MAAM,eAAe,iBAAgB;;;;;;;;;EAUrC,MAAM,iBAAiB,eAAyC;AAC9D,OAAI,CAAC,QAAA,UAAU,OAAO,QAAA,WAAW,SAC/B,QAAO,QAAA;GAGT,MAAM,QAAQ,qBAAqB,QAAA,QAAQ,aAAY;AACvD,UAAO,UAAU,QAAQ,QAAQ,OAAO,MAAM,GAAG;IAClD;;;;;;;;;;;EAYD,MAAM,cAAc,QAAA,SAChB,qBAAqB,QAAA,QAAQ,aAAY,GACzC,KAAA;AACJ,UACE,6BACA,cAAc,iBAAiB,cAAc,YAAY,GAAG,aAC9D;;;;;;;;;;;EAYA,MAAM,YAAY,OAAO,yBAAyB,KAAA,EAAS;EAE3D,MAAM,WAAW,eACA,QAAA,YAAY,QAAQ,CAAC,CAAC,WAAW,IAAI,QAAA,SAAS,CAC/D;EAIA,MAAM,iBAAiB,IAAI,IAAa,aAAa,EAAE,CAAA;AACvD,MAAI,QAAA,YAAY,KACd,gBAAe,IAAI,QAAA,SAAQ;AAE7B,UAAQ,yBAAyB,eAAc;EAE/C,MAAM,oBA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F,QAAM,CAAG,iBAAA;;6BAgByB,CAb3B,iCAAA,SAAA,WAAA,EADR,YAcmC,2BAAA;;OAZhC,YAAA,QAAA;OACA,SAAA,QAAA;OACD,aAAY;OACX,iBAAiB,QAAA;OACjB,eAAe,QAAA,QAAQ;OACvB,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA;OACP,MAAM,QAAA;OACN,SAAA,QAAA;OACA,QAAQ,iCAAA;OACR,eAAe,QAAA;;;;;;;;;;;;;;YAGL,MAAA,aAAY,CAAC,eAAA,MAAc,IAAA,WAAA,EADxC,YAYmC,gCAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,QAAQ,eAAA;OACR,eAAe,QAAA;;;;;;;;;;;;;0BAElB,mBAaW,UAAA,EAAA,KAAA,GAAA,EAAA,CAXD,eAAA,SAAA,WAAA,EADR,YAWmC,wBAAA;;OAThC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAA,QAAA;OACA,SAAA,QAAA;OACA,QAAQ,eAAA;OACR,eAAe,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAmjBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAK9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;A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QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA+mBJ,QAAA,MAAM,YAAY;cAvoBH,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;6EAsoB1B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import SchemaProperty_vue_vue_type_script_setup_true_lang_default from "./SchemaProperty.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Content/Schema/SchemaProperty.vue
5
- var SchemaProperty_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SchemaProperty_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-f14a8d89"]]);
5
+ var SchemaProperty_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SchemaProperty_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-3bdda27e"]]);
6
6
  //#endregion
7
7
  export { SchemaProperty_default as default };
8
8