@scalar/api-reference 1.57.2 → 1.57.3

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 (240) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  3. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
  4. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
  5. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +2 -1
  6. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
  7. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  8. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
  9. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
  10. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +2 -1
  11. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
  12. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +2 -1
  13. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
  14. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js.map +1 -1
  15. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
  16. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.d.ts +2 -1
  17. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.d.ts.map +1 -1
  18. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js.map +1 -1
  19. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +2 -1
  20. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
  21. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js.map +1 -1
  22. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +1 -1
  23. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -1
  24. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts +2 -1
  25. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
  26. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
  27. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -1
  28. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
  29. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  30. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js.map +1 -1
  31. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +2 -1
  32. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -1
  33. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js.map +1 -1
  34. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +1 -1
  35. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
  36. package/dist/browser/standalone.js +282 -268
  37. package/dist/browser/webpack-stats.json +1 -1
  38. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
  39. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -1
  40. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +1 -1
  41. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
  42. package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
  43. package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
  44. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +1 -1
  45. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
  46. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  47. package/dist/components/Anchor/Anchor.vue.js.map +1 -1
  48. package/dist/components/Anchor/Anchor.vue.script.js +2 -1
  49. package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
  50. package/dist/components/ApiReference.vue.js +1 -1
  51. package/dist/components/ApiReference.vue.js.map +1 -1
  52. package/dist/components/ApiReference.vue.script.js +6 -4
  53. package/dist/components/ApiReference.vue.script.js.map +1 -1
  54. package/dist/components/Content/Content.vue.js.map +1 -1
  55. package/dist/components/Content/Content.vue.script.js +1 -1
  56. package/dist/components/Content/Content.vue.script.js.map +1 -1
  57. package/dist/components/Content/Models/components/ModernLayout.vue.js.map +1 -1
  58. package/dist/components/Content/Models/components/ModernLayout.vue.script.js +1 -1
  59. package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -1
  60. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  61. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  62. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  63. package/dist/components/Content/Schema/Schema.vue.script.js +2 -1
  64. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  65. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  66. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  67. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +1 -1
  68. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  69. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -1
  70. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
  71. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js.map +1 -1
  72. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +2 -1
  73. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js.map +1 -1
  74. package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
  75. package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -1
  76. package/dist/components/Content/Schema/SchemaEnums.vue.script.js +1 -1
  77. package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
  78. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  79. package/dist/components/Content/Schema/SchemaHeading.vue.js.map +1 -1
  80. package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
  81. package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
  82. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
  83. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +2 -1
  84. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
  85. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  86. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  87. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  88. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +2 -1
  89. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  90. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
  91. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js.map +1 -1
  92. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +1 -1
  93. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
  94. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  95. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
  96. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -1
  97. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +16 -5
  98. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
  99. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  100. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  101. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  102. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +3 -3
  103. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  104. package/dist/components/Content/Schema/helpers/format-example.d.ts.map +1 -1
  105. package/dist/components/Content/Schema/helpers/format-example.js +12 -8
  106. package/dist/components/Content/Schema/helpers/format-example.js.map +1 -1
  107. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
  108. package/dist/components/Content/Tags/components/ClassicLayout.vue.js.map +1 -1
  109. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +1 -1
  110. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -1
  111. package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -1
  112. package/dist/components/Content/Tags/components/TagSection.vue.script.js +1 -1
  113. package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
  114. package/dist/components/GettingStarted.vue.js +1 -1
  115. package/dist/components/GettingStarted.vue.js.map +1 -1
  116. package/dist/components/GettingStarted.vue.script.js +4 -4
  117. package/dist/components/GettingStarted.vue.script.js.map +1 -1
  118. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  119. package/dist/components/MobileHeader.vue.js.map +1 -1
  120. package/dist/components/MobileHeader.vue.script.js +2 -1
  121. package/dist/components/MobileHeader.vue.script.js.map +1 -1
  122. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  123. package/dist/components/OperationsList/OperationsList.vue.js.map +1 -1
  124. package/dist/components/OperationsList/OperationsList.vue.script.js +1 -1
  125. package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
  126. package/dist/components/RenderPlugins/RenderPlugins.vue.js.map +1 -1
  127. package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +1 -1
  128. package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -1
  129. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  130. package/dist/features/Operation/components/ContentTypeSelect.vue.js.map +1 -1
  131. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +3 -1
  132. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
  133. package/dist/features/Operation/components/Headers.vue.js +1 -1
  134. package/dist/features/Operation/components/Headers.vue.js.map +1 -1
  135. package/dist/features/Operation/components/Headers.vue.script.js +1 -1
  136. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  137. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  138. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  139. package/dist/features/Operation/components/ParameterListItem.vue.script.js +2 -1
  140. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  141. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  142. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  143. package/dist/features/Operation/components/RequestBody.vue.script.js +1 -1
  144. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  145. package/dist/features/Operation/components/SecurityRequirementBadge.vue.js.map +1 -1
  146. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +1 -1
  147. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
  148. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  149. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  150. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  151. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +3 -1
  152. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  153. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  154. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  155. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  156. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +2 -1
  157. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  158. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  159. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  160. package/dist/features/Search/components/SearchButton.vue.script.js +3 -1
  161. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  162. package/dist/features/Search/components/SearchModal.vue.d.ts +1 -1
  163. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  164. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  165. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  166. package/dist/features/Search/components/SearchModal.vue.script.js +3 -1
  167. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  168. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  169. package/dist/features/Search/components/SearchResult.vue.script.js +1 -1
  170. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  171. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js.map +1 -1
  172. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +1 -1
  173. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
  174. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  175. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  176. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +2 -1
  177. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  178. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts.map +1 -1
  179. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js.map +1 -1
  180. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +4 -1
  181. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -1
  182. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts.map +1 -1
  183. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js.map +1 -1
  184. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +2 -1
  185. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
  186. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
  187. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -1
  188. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +2 -1
  189. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
  190. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
  191. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -1
  192. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +3 -1
  193. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
  194. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js.map +1 -1
  195. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +1 -1
  196. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
  197. package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -1
  198. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +1 -1
  199. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
  200. package/dist/features/developer-tools/components/ModifyConfiguration.vue.d.ts.map +1 -1
  201. package/dist/features/developer-tools/components/ModifyConfiguration.vue.js.map +1 -1
  202. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +2 -1
  203. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
  204. package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -1
  205. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +1 -1
  206. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
  207. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  208. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  209. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  210. package/dist/features/example-responses/ExampleResponse.vue.script.js +2 -1
  211. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  212. package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
  213. package/dist/features/example-responses/ExampleResponseTabList.vue.js.map +1 -1
  214. package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +1 -1
  215. package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -1
  216. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  217. package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -1
  218. package/dist/features/example-responses/ExampleResponses.vue.script.js +3 -1
  219. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  220. package/dist/features/example-responses/ExampleSchema.vue.d.ts.map +1 -1
  221. package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -1
  222. package/dist/features/example-responses/ExampleSchema.vue.script.js +2 -1
  223. package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
  224. package/dist/features/info-object/Contact.vue.js.map +1 -1
  225. package/dist/features/info-object/Contact.vue.script.js +1 -1
  226. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  227. package/dist/features/info-object/License.vue.d.ts +2 -1
  228. package/dist/features/info-object/License.vue.d.ts.map +1 -1
  229. package/dist/features/info-object/License.vue.js.map +1 -1
  230. package/dist/features/info-object/License.vue.script.js +7 -7
  231. package/dist/features/info-object/License.vue.script.js.map +1 -1
  232. package/dist/features/multiple-documents/DocumentSelector.vue.js.map +1 -1
  233. package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
  234. package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -1
  235. package/dist/features/specification-extension/SpecificationExtension.vue.js.map +1 -1
  236. package/dist/features/specification-extension/SpecificationExtension.vue.script.js +1 -1
  237. package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -1
  238. package/dist/style.css +567 -567
  239. package/dist/vue-styles.css +350 -350
  240. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResponses.vue.js","names":[],"sources":["../../../src/features/example-responses/ExampleResponses.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ExamplePicker } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n ScalarIcon,\n ScalarMarkdown,\n} from '@scalar/components'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExample } from '@scalar/workspace-store/request-example'\nimport type {\n MediaTypeObject,\n ResponsesObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, toValue, useId, watch } from 'vue'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport ExampleSchema from '@/features/example-responses/ExampleSchema.vue'\n\nimport ExampleResponse from './ExampleResponse.vue'\nimport ExampleResponseTab from './ExampleResponseTab.vue'\nimport ExampleResponseTabList from './ExampleResponseTabList.vue'\nimport { hasResponseContent } from './helpers/has-response-content'\nimport { normalizeMimeTypeObject } from './helpers/normalize-mime-type-object'\n\n/**\n * TODO: copyToClipboard isn't using the right content if there are multiple examples\n */\n\nconst { responses } = defineProps<{\n responses: ResponsesObject\n}>()\n\nconst id = useId()\nconst { copyToClipboard } = useClipboard()\n\n// Bring the status codes in the right order.\nconst orderedStatusCodes = computed<string[]>(() =>\n Object.keys(responses ?? {}).sort(),\n)\n\n// Filter to only valid response keys that should render in the example responses panel\nconst statusCodesWithContent = computed<string[]>(() =>\n orderedStatusCodes.value.filter((statusCode) =>\n hasResponseContent(getResolvedRef(responses?.[statusCode]), statusCode),\n ),\n)\n\n// Keep track of the current selected tab\nconst selectedResponseIndex = ref<number>(0)\n\n/**\n * Clamp the selected index when the filtered list shrinks.\n * Without this, the index can become out of bounds and cause a mismatch\n * between the visible tabs and the displayed content.\n *\n * We also reset `selectedExampleKey` to match the behavior of `changeTab`,\n * since the new response may not have the same example keys.\n */\nwatch(statusCodesWithContent, (codes) => {\n if (codes.length === 0) {\n selectedResponseIndex.value = 0\n selectedExampleKey.value = ''\n } else if (selectedResponseIndex.value >= codes.length) {\n selectedResponseIndex.value = codes.length - 1\n selectedExampleKey.value = ''\n }\n})\n\n// Return the whole response object\nconst currentResponse = computed(() => {\n const currentStatusCode =\n toValue(statusCodesWithContent)[toValue(selectedResponseIndex)] ?? ''\n\n return getResolvedRef(responses?.[currentStatusCode])\n})\n\nconst currentResponseContent = computed<MediaTypeObject | undefined>(() => {\n const normalizedContent = normalizeMimeTypeObject(\n currentResponse.value?.content,\n )\n\n /** All the keys of the normalized content */\n const keys = objectKeys(normalizedContent ?? {})\n return normalizedContent?.[keys[0] ?? '']\n})\n\nconst hasMultipleExamples = computed<boolean>(\n () =>\n !!currentResponseContent.value?.examples &&\n Object.keys(currentResponseContent.value?.examples ?? {}).length > 1,\n)\n\nconst selectedExampleKey = ref<string>(\n Object.keys(currentResponseContent.value?.examples ?? {})[0] ?? '',\n)\n\n/** Get the current example to display */\nconst currentExample = computed(() => {\n if (!currentResponseContent.value) {\n return undefined\n }\n\n // When multiple examples exist and one is selected, we access it directly\n if (hasMultipleExamples.value && selectedExampleKey.value) {\n return currentResponseContent.value.examples?.[selectedExampleKey.value]\n }\n\n // Otherwise, we use getExample with an undefined exampleKey to handle fallbacks\n return getExample(currentResponseContent.value, undefined, undefined)\n})\n\nconst changeTab = (index: number) => {\n selectedResponseIndex.value = index\n selectedExampleKey.value = ''\n}\n\nconst showSchema = ref(false)\n</script>\n<template>\n <ScalarCard\n v-if=\"statusCodesWithContent.length\"\n aria-label=\"Example Responses\"\n class=\"response-card\"\n role=\"region\">\n <ExampleResponseTabList @change=\"changeTab\">\n <ExampleResponseTab\n v-for=\"statusCode in statusCodesWithContent\"\n :key=\"statusCode\"\n :aria-controls=\"id\">\n <ScreenReader>Status:</ScreenReader>\n {{ statusCode }}\n </ExampleResponseTab>\n\n <template #actions>\n <button\n v-if=\"currentResponseContent?.example\"\n class=\"code-copy\"\n type=\"button\"\n @click=\"() => copyToClipboard(currentResponseContent?.example)\">\n <ScalarIcon\n icon=\"Clipboard\"\n width=\"12px\" />\n </button>\n <label\n v-if=\"currentResponseContent?.schema\"\n class=\"scalar-card-checkbox\">\n Show Schema\n <input\n v-model=\"showSchema\"\n :aria-controls=\"id\"\n class=\"scalar-card-checkbox-input\"\n type=\"checkbox\" />\n <span class=\"scalar-card-checkbox-checkmark\" />\n </label>\n </template>\n </ExampleResponseTabList>\n <ScalarCardSection class=\"grid flex-1\">\n <!-- Schema -->\n <ExampleSchema\n v-if=\"currentResponseContent?.schema && showSchema\"\n :id=\"id\"\n :schema=\"currentResponseContent?.schema\" />\n\n <!-- Example -->\n <ExampleResponse\n v-else\n :id=\"id\"\n :example=\"currentExample\"\n :response=\"currentResponseContent\" />\n </ScalarCardSection>\n <ScalarCardFooter\n v-if=\"currentResponse?.description || hasMultipleExamples\"\n class=\"response-card-footer\">\n <ExamplePicker\n v-if=\"hasMultipleExamples\"\n v-model=\"selectedExampleKey\"\n class=\"response-example-selector px-0\"\n :examples=\"currentResponseContent?.examples\" />\n <div class=\"response-description\">\n <ScalarMarkdown\n v-if=\"currentResponse?.description\"\n class=\"response-description-markdown\"\n :value=\"currentResponse.description\" />\n </div>\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n\n<style scoped>\n.response-card {\n font-size: var(--scalar-font-size-3);\n}\n\n.code-copy {\n display: flex;\n align-items: center;\n justify-content: center;\n appearance: none;\n -webkit-appearance: none;\n outline: none;\n background: transparent;\n cursor: pointer;\n color: var(--scalar-color-3);\n border: none;\n padding: 0;\n margin-right: 12px;\n}\n.code-copy:hover {\n color: var(--scalar-color-1);\n}\n.code-copy svg {\n width: 13px;\n height: 13px;\n}\n.response-card-footer {\n display: flex;\n flex-direction: row-reverse;\n flex-wrap: wrap;\n justify-content: start;\n flex-shrink: 0;\n padding: 7px 12px;\n column-gap: 8px;\n}\n.response-example-selector {\n flex-shrink: 0;\n margin: -4px;\n}\n.response-description {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-small);\n color: var(--scalar-color--1);\n\n box-sizing: border-box;\n\n flex-grow: 1;\n}\n.response-description-markdown {\n max-height: 3lh;\n}\n\n.response-description-markdown :deep(*) {\n margin: 0;\n}\n.schema-type {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n background: var(--scalar-background-3);\n padding: 2px 4px;\n border-radius: 4px;\n margin-right: 4px;\n}\n.schema-example {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n}\n\n.example-response-tab {\n display: block;\n margin: 6px;\n}\n\n.scalar-card-checkbox {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n min-height: 17px;\n cursor: pointer;\n user-select: none;\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-normal);\n color: var(--scalar-color-2);\n width: fit-content;\n white-space: nowrap;\n gap: 6px;\n padding: 7px 6px;\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:focus-visible)\n .scalar-card-checkbox-checkmark {\n outline: 1px solid var(--scalar-color-accent);\n}\n.scalar-card-checkbox:hover {\n color: var(--scalar-color--1);\n}\n.scalar-card-checkbox .scalar-card-checkbox-input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.scalar-card-checkbox-checkmark {\n height: 16px;\n width: 16px;\n border-radius: var(--scalar-radius);\n background-color: transparent;\n background-color: var(--scalar-background-3);\n box-shadow: inset 0 0 0 var(--scalar-border-width) var(--scalar-border-color);\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:checked) {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark {\n background-color: var(--scalar-button-1);\n box-shadow: none;\n}\n\n.scalar-card-checkbox-checkmark:after {\n content: '';\n position: absolute;\n display: none;\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark:after {\n display: block;\n}\n\n.scalar-card-checkbox .scalar-card-checkbox-checkmark:after {\n right: 11.5px;\n top: 12.5px;\n width: 5px;\n height: 9px;\n border: solid 1px var(--scalar-button-1-color);\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(45deg);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ExampleResponses.vue.js","names":[],"sources":["../../../src/features/example-responses/ExampleResponses.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ExamplePicker } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExample } from '@scalar/workspace-store/request-example'\nimport type {\n MediaTypeObject,\n ResponsesObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, toValue, useId, watch } from 'vue'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport ExampleSchema from '@/features/example-responses/ExampleSchema.vue'\n\nimport ExampleResponse from './ExampleResponse.vue'\nimport ExampleResponseTab from './ExampleResponseTab.vue'\nimport ExampleResponseTabList from './ExampleResponseTabList.vue'\nimport { hasResponseContent } from './helpers/has-response-content'\nimport { normalizeMimeTypeObject } from './helpers/normalize-mime-type-object'\n\n/**\n * TODO: copyToClipboard isn't using the right content if there are multiple examples\n */\n\nconst { responses } = defineProps<{\n responses: ResponsesObject\n}>()\n\nconst id = useId()\nconst { copyToClipboard } = useClipboard()\n\n// Bring the status codes in the right order.\nconst orderedStatusCodes = computed<string[]>(() =>\n Object.keys(responses ?? {}).sort(),\n)\n\n// Filter to only valid response keys that should render in the example responses panel\nconst statusCodesWithContent = computed<string[]>(() =>\n orderedStatusCodes.value.filter((statusCode) =>\n hasResponseContent(getResolvedRef(responses?.[statusCode]), statusCode),\n ),\n)\n\n// Keep track of the current selected tab\nconst selectedResponseIndex = ref<number>(0)\n\n/**\n * Clamp the selected index when the filtered list shrinks.\n * Without this, the index can become out of bounds and cause a mismatch\n * between the visible tabs and the displayed content.\n *\n * We also reset `selectedExampleKey` to match the behavior of `changeTab`,\n * since the new response may not have the same example keys.\n */\nwatch(statusCodesWithContent, (codes) => {\n if (codes.length === 0) {\n selectedResponseIndex.value = 0\n selectedExampleKey.value = ''\n } else if (selectedResponseIndex.value >= codes.length) {\n selectedResponseIndex.value = codes.length - 1\n selectedExampleKey.value = ''\n }\n})\n\n// Return the whole response object\nconst currentResponse = computed(() => {\n const currentStatusCode =\n toValue(statusCodesWithContent)[toValue(selectedResponseIndex)] ?? ''\n\n return getResolvedRef(responses?.[currentStatusCode])\n})\n\nconst currentResponseContent = computed<MediaTypeObject | undefined>(() => {\n const normalizedContent = normalizeMimeTypeObject(\n currentResponse.value?.content,\n )\n\n /** All the keys of the normalized content */\n const keys = objectKeys(normalizedContent ?? {})\n return normalizedContent?.[keys[0] ?? '']\n})\n\nconst hasMultipleExamples = computed<boolean>(\n () =>\n !!currentResponseContent.value?.examples &&\n Object.keys(currentResponseContent.value?.examples ?? {}).length > 1,\n)\n\nconst selectedExampleKey = ref<string>(\n Object.keys(currentResponseContent.value?.examples ?? {})[0] ?? '',\n)\n\n/** Get the current example to display */\nconst currentExample = computed(() => {\n if (!currentResponseContent.value) {\n return undefined\n }\n\n // When multiple examples exist and one is selected, we access it directly\n if (hasMultipleExamples.value && selectedExampleKey.value) {\n return currentResponseContent.value.examples?.[selectedExampleKey.value]\n }\n\n // Otherwise, we use getExample with an undefined exampleKey to handle fallbacks\n return getExample(currentResponseContent.value, undefined, undefined)\n})\n\nconst changeTab = (index: number) => {\n selectedResponseIndex.value = index\n selectedExampleKey.value = ''\n}\n\nconst showSchema = ref(false)\n</script>\n<template>\n <ScalarCard\n v-if=\"statusCodesWithContent.length\"\n aria-label=\"Example Responses\"\n class=\"response-card\"\n role=\"region\">\n <ExampleResponseTabList @change=\"changeTab\">\n <ExampleResponseTab\n v-for=\"statusCode in statusCodesWithContent\"\n :key=\"statusCode\"\n :aria-controls=\"id\">\n <ScreenReader>Status:</ScreenReader>\n {{ statusCode }}\n </ExampleResponseTab>\n\n <template #actions>\n <button\n v-if=\"currentResponseContent?.example\"\n class=\"code-copy\"\n type=\"button\"\n @click=\"() => copyToClipboard(currentResponseContent?.example)\">\n <ScalarIcon\n icon=\"Clipboard\"\n width=\"12px\" />\n </button>\n <label\n v-if=\"currentResponseContent?.schema\"\n class=\"scalar-card-checkbox\">\n Show Schema\n <input\n v-model=\"showSchema\"\n :aria-controls=\"id\"\n class=\"scalar-card-checkbox-input\"\n type=\"checkbox\" />\n <span class=\"scalar-card-checkbox-checkmark\" />\n </label>\n </template>\n </ExampleResponseTabList>\n <ScalarCardSection class=\"grid flex-1\">\n <!-- Schema -->\n <ExampleSchema\n v-if=\"currentResponseContent?.schema && showSchema\"\n :id=\"id\"\n :schema=\"currentResponseContent?.schema\" />\n\n <!-- Example -->\n <ExampleResponse\n v-else\n :id=\"id\"\n :example=\"currentExample\"\n :response=\"currentResponseContent\" />\n </ScalarCardSection>\n <ScalarCardFooter\n v-if=\"currentResponse?.description || hasMultipleExamples\"\n class=\"response-card-footer\">\n <ExamplePicker\n v-if=\"hasMultipleExamples\"\n v-model=\"selectedExampleKey\"\n class=\"response-example-selector px-0\"\n :examples=\"currentResponseContent?.examples\" />\n <div class=\"response-description\">\n <ScalarMarkdown\n v-if=\"currentResponse?.description\"\n class=\"response-description-markdown\"\n :value=\"currentResponse.description\" />\n </div>\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n\n<style scoped>\n.response-card {\n font-size: var(--scalar-font-size-3);\n}\n\n.code-copy {\n display: flex;\n align-items: center;\n justify-content: center;\n appearance: none;\n -webkit-appearance: none;\n outline: none;\n background: transparent;\n cursor: pointer;\n color: var(--scalar-color-3);\n border: none;\n padding: 0;\n margin-right: 12px;\n}\n.code-copy:hover {\n color: var(--scalar-color-1);\n}\n.code-copy svg {\n width: 13px;\n height: 13px;\n}\n.response-card-footer {\n display: flex;\n flex-direction: row-reverse;\n flex-wrap: wrap;\n justify-content: start;\n flex-shrink: 0;\n padding: 7px 12px;\n column-gap: 8px;\n}\n.response-example-selector {\n flex-shrink: 0;\n margin: -4px;\n}\n.response-description {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-small);\n color: var(--scalar-color--1);\n\n box-sizing: border-box;\n\n flex-grow: 1;\n}\n.response-description-markdown {\n max-height: 3lh;\n}\n\n.response-description-markdown :deep(*) {\n margin: 0;\n}\n.schema-type {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n background: var(--scalar-background-3);\n padding: 2px 4px;\n border-radius: 4px;\n margin-right: 4px;\n}\n.schema-example {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n}\n\n.example-response-tab {\n display: block;\n margin: 6px;\n}\n\n.scalar-card-checkbox {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n min-height: 17px;\n cursor: pointer;\n user-select: none;\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-normal);\n color: var(--scalar-color-2);\n width: fit-content;\n white-space: nowrap;\n gap: 6px;\n padding: 7px 6px;\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:focus-visible)\n .scalar-card-checkbox-checkmark {\n outline: 1px solid var(--scalar-color-accent);\n}\n.scalar-card-checkbox:hover {\n color: var(--scalar-color--1);\n}\n.scalar-card-checkbox .scalar-card-checkbox-input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.scalar-card-checkbox-checkmark {\n height: 16px;\n width: 16px;\n border-radius: var(--scalar-radius);\n background-color: transparent;\n background-color: var(--scalar-background-3);\n box-shadow: inset 0 0 0 var(--scalar-border-width) var(--scalar-border-color);\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:checked) {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark {\n background-color: var(--scalar-button-1);\n box-shadow: none;\n}\n\n.scalar-card-checkbox-checkmark:after {\n content: '';\n position: absolute;\n display: none;\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark:after {\n display: block;\n}\n\n.scalar-card-checkbox .scalar-card-checkbox-checkmark:after {\n right: 11.5px;\n top: 12.5px;\n width: 5px;\n height: 9px;\n border: solid 1px var(--scalar-button-1-color);\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(45deg);\n}\n</style>\n"],"mappings":""}
@@ -6,12 +6,14 @@ import ExampleResponseTabList_default from "./ExampleResponseTabList.vue.js";
6
6
  import { normalizeMimeTypeObject } from "./helpers/normalize-mime-type-object.js";
7
7
  import { hasResponseContent } from "./helpers/has-response-content.js";
8
8
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, toValue, unref, useId, vModelCheckbox, watch, withCtx, withDirectives } from "vue";
9
- import { ScalarCard, ScalarCardFooter, ScalarCardSection, ScalarIcon, ScalarMarkdown } from "@scalar/components";
10
9
  import { useClipboard } from "@scalar/use-hooks/useClipboard";
11
10
  import { getExample } from "@scalar/workspace-store/request-example";
12
11
  import { ExamplePicker } from "@scalar/api-client/blocks/operation-code-sample";
12
+ import { ScalarMarkdown } from "@scalar/components/markdown";
13
+ import { ScalarIcon } from "@scalar/components/icon";
13
14
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
14
15
  import { objectKeys } from "@scalar/helpers/object/object-keys";
16
+ import { ScalarCard, ScalarCardFooter, ScalarCardSection } from "@scalar/components/card";
15
17
  //#region src/features/example-responses/ExampleResponses.vue?vue&type=script&setup=true&lang.ts
16
18
  var _hoisted_1 = {
17
19
  key: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResponses.vue.script.js","names":[],"sources":["../../../src/features/example-responses/ExampleResponses.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ExamplePicker } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n ScalarIcon,\n ScalarMarkdown,\n} from '@scalar/components'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExample } from '@scalar/workspace-store/request-example'\nimport type {\n MediaTypeObject,\n ResponsesObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, toValue, useId, watch } from 'vue'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport ExampleSchema from '@/features/example-responses/ExampleSchema.vue'\n\nimport ExampleResponse from './ExampleResponse.vue'\nimport ExampleResponseTab from './ExampleResponseTab.vue'\nimport ExampleResponseTabList from './ExampleResponseTabList.vue'\nimport { hasResponseContent } from './helpers/has-response-content'\nimport { normalizeMimeTypeObject } from './helpers/normalize-mime-type-object'\n\n/**\n * TODO: copyToClipboard isn't using the right content if there are multiple examples\n */\n\nconst { responses } = defineProps<{\n responses: ResponsesObject\n}>()\n\nconst id = useId()\nconst { copyToClipboard } = useClipboard()\n\n// Bring the status codes in the right order.\nconst orderedStatusCodes = computed<string[]>(() =>\n Object.keys(responses ?? {}).sort(),\n)\n\n// Filter to only valid response keys that should render in the example responses panel\nconst statusCodesWithContent = computed<string[]>(() =>\n orderedStatusCodes.value.filter((statusCode) =>\n hasResponseContent(getResolvedRef(responses?.[statusCode]), statusCode),\n ),\n)\n\n// Keep track of the current selected tab\nconst selectedResponseIndex = ref<number>(0)\n\n/**\n * Clamp the selected index when the filtered list shrinks.\n * Without this, the index can become out of bounds and cause a mismatch\n * between the visible tabs and the displayed content.\n *\n * We also reset `selectedExampleKey` to match the behavior of `changeTab`,\n * since the new response may not have the same example keys.\n */\nwatch(statusCodesWithContent, (codes) => {\n if (codes.length === 0) {\n selectedResponseIndex.value = 0\n selectedExampleKey.value = ''\n } else if (selectedResponseIndex.value >= codes.length) {\n selectedResponseIndex.value = codes.length - 1\n selectedExampleKey.value = ''\n }\n})\n\n// Return the whole response object\nconst currentResponse = computed(() => {\n const currentStatusCode =\n toValue(statusCodesWithContent)[toValue(selectedResponseIndex)] ?? ''\n\n return getResolvedRef(responses?.[currentStatusCode])\n})\n\nconst currentResponseContent = computed<MediaTypeObject | undefined>(() => {\n const normalizedContent = normalizeMimeTypeObject(\n currentResponse.value?.content,\n )\n\n /** All the keys of the normalized content */\n const keys = objectKeys(normalizedContent ?? {})\n return normalizedContent?.[keys[0] ?? '']\n})\n\nconst hasMultipleExamples = computed<boolean>(\n () =>\n !!currentResponseContent.value?.examples &&\n Object.keys(currentResponseContent.value?.examples ?? {}).length > 1,\n)\n\nconst selectedExampleKey = ref<string>(\n Object.keys(currentResponseContent.value?.examples ?? {})[0] ?? '',\n)\n\n/** Get the current example to display */\nconst currentExample = computed(() => {\n if (!currentResponseContent.value) {\n return undefined\n }\n\n // When multiple examples exist and one is selected, we access it directly\n if (hasMultipleExamples.value && selectedExampleKey.value) {\n return currentResponseContent.value.examples?.[selectedExampleKey.value]\n }\n\n // Otherwise, we use getExample with an undefined exampleKey to handle fallbacks\n return getExample(currentResponseContent.value, undefined, undefined)\n})\n\nconst changeTab = (index: number) => {\n selectedResponseIndex.value = index\n selectedExampleKey.value = ''\n}\n\nconst showSchema = ref(false)\n</script>\n<template>\n <ScalarCard\n v-if=\"statusCodesWithContent.length\"\n aria-label=\"Example Responses\"\n class=\"response-card\"\n role=\"region\">\n <ExampleResponseTabList @change=\"changeTab\">\n <ExampleResponseTab\n v-for=\"statusCode in statusCodesWithContent\"\n :key=\"statusCode\"\n :aria-controls=\"id\">\n <ScreenReader>Status:</ScreenReader>\n {{ statusCode }}\n </ExampleResponseTab>\n\n <template #actions>\n <button\n v-if=\"currentResponseContent?.example\"\n class=\"code-copy\"\n type=\"button\"\n @click=\"() => copyToClipboard(currentResponseContent?.example)\">\n <ScalarIcon\n icon=\"Clipboard\"\n width=\"12px\" />\n </button>\n <label\n v-if=\"currentResponseContent?.schema\"\n class=\"scalar-card-checkbox\">\n Show Schema\n <input\n v-model=\"showSchema\"\n :aria-controls=\"id\"\n class=\"scalar-card-checkbox-input\"\n type=\"checkbox\" />\n <span class=\"scalar-card-checkbox-checkmark\" />\n </label>\n </template>\n </ExampleResponseTabList>\n <ScalarCardSection class=\"grid flex-1\">\n <!-- Schema -->\n <ExampleSchema\n v-if=\"currentResponseContent?.schema && showSchema\"\n :id=\"id\"\n :schema=\"currentResponseContent?.schema\" />\n\n <!-- Example -->\n <ExampleResponse\n v-else\n :id=\"id\"\n :example=\"currentExample\"\n :response=\"currentResponseContent\" />\n </ScalarCardSection>\n <ScalarCardFooter\n v-if=\"currentResponse?.description || hasMultipleExamples\"\n class=\"response-card-footer\">\n <ExamplePicker\n v-if=\"hasMultipleExamples\"\n v-model=\"selectedExampleKey\"\n class=\"response-example-selector px-0\"\n :examples=\"currentResponseContent?.examples\" />\n <div class=\"response-description\">\n <ScalarMarkdown\n v-if=\"currentResponse?.description\"\n class=\"response-description-markdown\"\n :value=\"currentResponse.description\" />\n </div>\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n\n<style scoped>\n.response-card {\n font-size: var(--scalar-font-size-3);\n}\n\n.code-copy {\n display: flex;\n align-items: center;\n justify-content: center;\n appearance: none;\n -webkit-appearance: none;\n outline: none;\n background: transparent;\n cursor: pointer;\n color: var(--scalar-color-3);\n border: none;\n padding: 0;\n margin-right: 12px;\n}\n.code-copy:hover {\n color: var(--scalar-color-1);\n}\n.code-copy svg {\n width: 13px;\n height: 13px;\n}\n.response-card-footer {\n display: flex;\n flex-direction: row-reverse;\n flex-wrap: wrap;\n justify-content: start;\n flex-shrink: 0;\n padding: 7px 12px;\n column-gap: 8px;\n}\n.response-example-selector {\n flex-shrink: 0;\n margin: -4px;\n}\n.response-description {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-small);\n color: var(--scalar-color--1);\n\n box-sizing: border-box;\n\n flex-grow: 1;\n}\n.response-description-markdown {\n max-height: 3lh;\n}\n\n.response-description-markdown :deep(*) {\n margin: 0;\n}\n.schema-type {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n background: var(--scalar-background-3);\n padding: 2px 4px;\n border-radius: 4px;\n margin-right: 4px;\n}\n.schema-example {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n}\n\n.example-response-tab {\n display: block;\n margin: 6px;\n}\n\n.scalar-card-checkbox {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n min-height: 17px;\n cursor: pointer;\n user-select: none;\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-normal);\n color: var(--scalar-color-2);\n width: fit-content;\n white-space: nowrap;\n gap: 6px;\n padding: 7px 6px;\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:focus-visible)\n .scalar-card-checkbox-checkmark {\n outline: 1px solid var(--scalar-color-accent);\n}\n.scalar-card-checkbox:hover {\n color: var(--scalar-color--1);\n}\n.scalar-card-checkbox .scalar-card-checkbox-input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.scalar-card-checkbox-checkmark {\n height: 16px;\n width: 16px;\n border-radius: var(--scalar-radius);\n background-color: transparent;\n background-color: var(--scalar-background-3);\n box-shadow: inset 0 0 0 var(--scalar-border-width) var(--scalar-border-color);\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:checked) {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark {\n background-color: var(--scalar-button-1);\n box-shadow: none;\n}\n\n.scalar-card-checkbox-checkmark:after {\n content: '';\n position: absolute;\n display: none;\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark:after {\n display: block;\n}\n\n.scalar-card-checkbox .scalar-card-checkbox-checkmark:after {\n right: 11.5px;\n top: 12.5px;\n width: 5px;\n height: 9px;\n border: solid 1px var(--scalar-button-1-color);\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(45deg);\n}\n</style>\n"],"mappings":"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"}
1
+ {"version":3,"file":"ExampleResponses.vue.script.js","names":[],"sources":["../../../src/features/example-responses/ExampleResponses.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ExamplePicker } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExample } from '@scalar/workspace-store/request-example'\nimport type {\n MediaTypeObject,\n ResponsesObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, toValue, useId, watch } from 'vue'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport ExampleSchema from '@/features/example-responses/ExampleSchema.vue'\n\nimport ExampleResponse from './ExampleResponse.vue'\nimport ExampleResponseTab from './ExampleResponseTab.vue'\nimport ExampleResponseTabList from './ExampleResponseTabList.vue'\nimport { hasResponseContent } from './helpers/has-response-content'\nimport { normalizeMimeTypeObject } from './helpers/normalize-mime-type-object'\n\n/**\n * TODO: copyToClipboard isn't using the right content if there are multiple examples\n */\n\nconst { responses } = defineProps<{\n responses: ResponsesObject\n}>()\n\nconst id = useId()\nconst { copyToClipboard } = useClipboard()\n\n// Bring the status codes in the right order.\nconst orderedStatusCodes = computed<string[]>(() =>\n Object.keys(responses ?? {}).sort(),\n)\n\n// Filter to only valid response keys that should render in the example responses panel\nconst statusCodesWithContent = computed<string[]>(() =>\n orderedStatusCodes.value.filter((statusCode) =>\n hasResponseContent(getResolvedRef(responses?.[statusCode]), statusCode),\n ),\n)\n\n// Keep track of the current selected tab\nconst selectedResponseIndex = ref<number>(0)\n\n/**\n * Clamp the selected index when the filtered list shrinks.\n * Without this, the index can become out of bounds and cause a mismatch\n * between the visible tabs and the displayed content.\n *\n * We also reset `selectedExampleKey` to match the behavior of `changeTab`,\n * since the new response may not have the same example keys.\n */\nwatch(statusCodesWithContent, (codes) => {\n if (codes.length === 0) {\n selectedResponseIndex.value = 0\n selectedExampleKey.value = ''\n } else if (selectedResponseIndex.value >= codes.length) {\n selectedResponseIndex.value = codes.length - 1\n selectedExampleKey.value = ''\n }\n})\n\n// Return the whole response object\nconst currentResponse = computed(() => {\n const currentStatusCode =\n toValue(statusCodesWithContent)[toValue(selectedResponseIndex)] ?? ''\n\n return getResolvedRef(responses?.[currentStatusCode])\n})\n\nconst currentResponseContent = computed<MediaTypeObject | undefined>(() => {\n const normalizedContent = normalizeMimeTypeObject(\n currentResponse.value?.content,\n )\n\n /** All the keys of the normalized content */\n const keys = objectKeys(normalizedContent ?? {})\n return normalizedContent?.[keys[0] ?? '']\n})\n\nconst hasMultipleExamples = computed<boolean>(\n () =>\n !!currentResponseContent.value?.examples &&\n Object.keys(currentResponseContent.value?.examples ?? {}).length > 1,\n)\n\nconst selectedExampleKey = ref<string>(\n Object.keys(currentResponseContent.value?.examples ?? {})[0] ?? '',\n)\n\n/** Get the current example to display */\nconst currentExample = computed(() => {\n if (!currentResponseContent.value) {\n return undefined\n }\n\n // When multiple examples exist and one is selected, we access it directly\n if (hasMultipleExamples.value && selectedExampleKey.value) {\n return currentResponseContent.value.examples?.[selectedExampleKey.value]\n }\n\n // Otherwise, we use getExample with an undefined exampleKey to handle fallbacks\n return getExample(currentResponseContent.value, undefined, undefined)\n})\n\nconst changeTab = (index: number) => {\n selectedResponseIndex.value = index\n selectedExampleKey.value = ''\n}\n\nconst showSchema = ref(false)\n</script>\n<template>\n <ScalarCard\n v-if=\"statusCodesWithContent.length\"\n aria-label=\"Example Responses\"\n class=\"response-card\"\n role=\"region\">\n <ExampleResponseTabList @change=\"changeTab\">\n <ExampleResponseTab\n v-for=\"statusCode in statusCodesWithContent\"\n :key=\"statusCode\"\n :aria-controls=\"id\">\n <ScreenReader>Status:</ScreenReader>\n {{ statusCode }}\n </ExampleResponseTab>\n\n <template #actions>\n <button\n v-if=\"currentResponseContent?.example\"\n class=\"code-copy\"\n type=\"button\"\n @click=\"() => copyToClipboard(currentResponseContent?.example)\">\n <ScalarIcon\n icon=\"Clipboard\"\n width=\"12px\" />\n </button>\n <label\n v-if=\"currentResponseContent?.schema\"\n class=\"scalar-card-checkbox\">\n Show Schema\n <input\n v-model=\"showSchema\"\n :aria-controls=\"id\"\n class=\"scalar-card-checkbox-input\"\n type=\"checkbox\" />\n <span class=\"scalar-card-checkbox-checkmark\" />\n </label>\n </template>\n </ExampleResponseTabList>\n <ScalarCardSection class=\"grid flex-1\">\n <!-- Schema -->\n <ExampleSchema\n v-if=\"currentResponseContent?.schema && showSchema\"\n :id=\"id\"\n :schema=\"currentResponseContent?.schema\" />\n\n <!-- Example -->\n <ExampleResponse\n v-else\n :id=\"id\"\n :example=\"currentExample\"\n :response=\"currentResponseContent\" />\n </ScalarCardSection>\n <ScalarCardFooter\n v-if=\"currentResponse?.description || hasMultipleExamples\"\n class=\"response-card-footer\">\n <ExamplePicker\n v-if=\"hasMultipleExamples\"\n v-model=\"selectedExampleKey\"\n class=\"response-example-selector px-0\"\n :examples=\"currentResponseContent?.examples\" />\n <div class=\"response-description\">\n <ScalarMarkdown\n v-if=\"currentResponse?.description\"\n class=\"response-description-markdown\"\n :value=\"currentResponse.description\" />\n </div>\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n\n<style scoped>\n.response-card {\n font-size: var(--scalar-font-size-3);\n}\n\n.code-copy {\n display: flex;\n align-items: center;\n justify-content: center;\n appearance: none;\n -webkit-appearance: none;\n outline: none;\n background: transparent;\n cursor: pointer;\n color: var(--scalar-color-3);\n border: none;\n padding: 0;\n margin-right: 12px;\n}\n.code-copy:hover {\n color: var(--scalar-color-1);\n}\n.code-copy svg {\n width: 13px;\n height: 13px;\n}\n.response-card-footer {\n display: flex;\n flex-direction: row-reverse;\n flex-wrap: wrap;\n justify-content: start;\n flex-shrink: 0;\n padding: 7px 12px;\n column-gap: 8px;\n}\n.response-example-selector {\n flex-shrink: 0;\n margin: -4px;\n}\n.response-description {\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-small);\n color: var(--scalar-color--1);\n\n box-sizing: border-box;\n\n flex-grow: 1;\n}\n.response-description-markdown {\n max-height: 3lh;\n}\n\n.response-description-markdown :deep(*) {\n margin: 0;\n}\n.schema-type {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n background: var(--scalar-background-3);\n padding: 2px 4px;\n border-radius: 4px;\n margin-right: 4px;\n}\n.schema-example {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n}\n\n.example-response-tab {\n display: block;\n margin: 6px;\n}\n\n.scalar-card-checkbox {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n min-height: 17px;\n cursor: pointer;\n user-select: none;\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-normal);\n color: var(--scalar-color-2);\n width: fit-content;\n white-space: nowrap;\n gap: 6px;\n padding: 7px 6px;\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:focus-visible)\n .scalar-card-checkbox-checkmark {\n outline: 1px solid var(--scalar-color-accent);\n}\n.scalar-card-checkbox:hover {\n color: var(--scalar-color--1);\n}\n.scalar-card-checkbox .scalar-card-checkbox-input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n.scalar-card-checkbox-checkmark {\n height: 16px;\n width: 16px;\n border-radius: var(--scalar-radius);\n background-color: transparent;\n background-color: var(--scalar-background-3);\n box-shadow: inset 0 0 0 var(--scalar-border-width) var(--scalar-border-color);\n}\n.scalar-card-checkbox:has(.scalar-card-checkbox-input:checked) {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark {\n background-color: var(--scalar-button-1);\n box-shadow: none;\n}\n\n.scalar-card-checkbox-checkmark:after {\n content: '';\n position: absolute;\n display: none;\n}\n\n.scalar-card-checkbox\n .scalar-card-checkbox-input:checked\n ~ .scalar-card-checkbox-checkmark:after {\n display: block;\n}\n\n.scalar-card-checkbox .scalar-card-checkbox-checkmark:after {\n right: 11.5px;\n top: 12.5px;\n width: 5px;\n height: 9px;\n border: solid 1px var(--scalar-button-1-color);\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(45deg);\n}\n</style>\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSchema.vue.d.ts","sourceRoot":"","sources":["../../../src/features/example-responses/ExampleSchema.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAGtF,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;CACpC,CAAC;AAsFF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"ExampleSchema.vue.d.ts","sourceRoot":"","sources":["../../../src/features/example-responses/ExampleSchema.vue"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAGtF,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;CACpC,CAAC;AAsFF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSchema.vue.js","names":[],"sources":["../../../src/features/example-responses/ExampleSchema.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getResolvedRefDeep } from '@scalar/api-client/blocks/operation-code-sample'\nimport { ScalarCodeBlock, ScalarVirtualText } from '@scalar/components'\nimport { prettyPrintJson } from '@scalar/helpers/json/pretty-print-json'\nimport type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\nimport { computed } from 'vue'\n\nconst { id, schema } = defineProps<{\n id: string\n schema: ReferenceType<SchemaObject>\n}>()\n\nconst schemaContent = computed(() => {\n if (!schema) {\n return undefined\n }\n\n return prettyPrintJson(getResolvedRefDeep(schema))\n})\n\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualizeSchema = computed(() => {\n return (schemaContent.value?.length ?? 0) > VIRTUALIZATION_THRESHOLD\n})\n</script>\n\n<template>\n <ScalarCodeBlock\n v-if=\"!shouldVirtualizeSchema\"\n :id=\"id\"\n class=\"bg-b-2\"\n lang=\"json\"\n :prettyPrintedContent=\"schemaContent ?? ''\" />\n <ScalarVirtualText\n v-else\n :id=\"id\"\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"schemaContent ?? ''\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ExampleSchema.vue.js","names":[],"sources":["../../../src/features/example-responses/ExampleSchema.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getResolvedRefDeep } from '@scalar/api-client/blocks/operation-code-sample'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarVirtualText } from '@scalar/components/virtual-text'\nimport { prettyPrintJson } from '@scalar/helpers/json/pretty-print-json'\nimport type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\nimport { computed } from 'vue'\n\nconst { id, schema } = defineProps<{\n id: string\n schema: ReferenceType<SchemaObject>\n}>()\n\nconst schemaContent = computed(() => {\n if (!schema) {\n return undefined\n }\n\n return prettyPrintJson(getResolvedRefDeep(schema))\n})\n\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualizeSchema = computed(() => {\n return (schemaContent.value?.length ?? 0) > VIRTUALIZATION_THRESHOLD\n})\n</script>\n\n<template>\n <ScalarCodeBlock\n v-if=\"!shouldVirtualizeSchema\"\n :id=\"id\"\n class=\"bg-b-2\"\n lang=\"json\"\n :prettyPrintedContent=\"schemaContent ?? ''\" />\n <ScalarVirtualText\n v-else\n :id=\"id\"\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"schemaContent ?? ''\" />\n</template>\n"],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import { computed, createBlock, defineComponent, openBlock, unref } from "vue";
2
- import { ScalarCodeBlock, ScalarVirtualText } from "@scalar/components";
3
2
  import { getResolvedRefDeep } from "@scalar/api-client/blocks/operation-code-sample";
3
+ import { ScalarCodeBlock } from "@scalar/components/code-block";
4
+ import { ScalarVirtualText } from "@scalar/components/virtual-text";
4
5
  import { prettyPrintJson } from "@scalar/helpers/json/pretty-print-json";
5
6
  //#region src/features/example-responses/ExampleSchema.vue?vue&type=script&setup=true&lang.ts
6
7
  var VIRTUALIZATION_THRESHOLD = 2e4;
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSchema.vue.script.js","names":[],"sources":["../../../src/features/example-responses/ExampleSchema.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getResolvedRefDeep } from '@scalar/api-client/blocks/operation-code-sample'\nimport { ScalarCodeBlock, ScalarVirtualText } from '@scalar/components'\nimport { prettyPrintJson } from '@scalar/helpers/json/pretty-print-json'\nimport type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\nimport { computed } from 'vue'\n\nconst { id, schema } = defineProps<{\n id: string\n schema: ReferenceType<SchemaObject>\n}>()\n\nconst schemaContent = computed(() => {\n if (!schema) {\n return undefined\n }\n\n return prettyPrintJson(getResolvedRefDeep(schema))\n})\n\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualizeSchema = computed(() => {\n return (schemaContent.value?.length ?? 0) > VIRTUALIZATION_THRESHOLD\n})\n</script>\n\n<template>\n <ScalarCodeBlock\n v-if=\"!shouldVirtualizeSchema\"\n :id=\"id\"\n class=\"bg-b-2\"\n lang=\"json\"\n :prettyPrintedContent=\"schemaContent ?? ''\" />\n <ScalarVirtualText\n v-else\n :id=\"id\"\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"schemaContent ?? ''\" />\n</template>\n"],"mappings":";;;;;AAqBA,IAAM,2BAA2B;;;;;;;;EARjC,MAAM,gBAAgB,eAAe;AACnC,OAAI,CAAC,QAAA,OACH;AAGF,UAAO,gBAAgB,mBAAmB,QAAA,OAAO,CAAA;IAClD;EAID,MAAM,yBAAyB,eAAe;AAC5C,WAAQ,cAAc,OAAO,UAAU,KAAK;IAC7C;;WAKU,uBAAA,SAAA,WAAA,EADT,YAKgD,MAAA,gBAAA,EAAA;;IAH7C,IAAI,QAAA;IACL,OAAM;IACN,MAAK;IACJ,sBAAsB,cAAA,SAAa;gEACtC,YAMgC,MAAA,kBAAA,EAAA;;IAJ7B,IAAI,QAAA;IACL,gBAAe;IACf,cAAa;IACZ,YAAY;IACZ,MAAM,cAAA,SAAa"}
1
+ {"version":3,"file":"ExampleSchema.vue.script.js","names":[],"sources":["../../../src/features/example-responses/ExampleSchema.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getResolvedRefDeep } from '@scalar/api-client/blocks/operation-code-sample'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarVirtualText } from '@scalar/components/virtual-text'\nimport { prettyPrintJson } from '@scalar/helpers/json/pretty-print-json'\nimport type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/schema'\nimport { computed } from 'vue'\n\nconst { id, schema } = defineProps<{\n id: string\n schema: ReferenceType<SchemaObject>\n}>()\n\nconst schemaContent = computed(() => {\n if (!schema) {\n return undefined\n }\n\n return prettyPrintJson(getResolvedRefDeep(schema))\n})\n\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualizeSchema = computed(() => {\n return (schemaContent.value?.length ?? 0) > VIRTUALIZATION_THRESHOLD\n})\n</script>\n\n<template>\n <ScalarCodeBlock\n v-if=\"!shouldVirtualizeSchema\"\n :id=\"id\"\n class=\"bg-b-2\"\n lang=\"json\"\n :prettyPrintedContent=\"schemaContent ?? ''\" />\n <ScalarVirtualText\n v-else\n :id=\"id\"\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"schemaContent ?? ''\" />\n</template>\n"],"mappings":";;;;;;AAsBA,IAAM,2BAA2B;;;;;;;;EARjC,MAAM,gBAAgB,eAAe;AACnC,OAAI,CAAC,QAAA,OACH;AAGF,UAAO,gBAAgB,mBAAmB,QAAA,OAAO,CAAA;IAClD;EAID,MAAM,yBAAyB,eAAe;AAC5C,WAAQ,cAAc,OAAO,UAAU,KAAK;IAC7C;;WAKU,uBAAA,SAAA,WAAA,EADT,YAKgD,MAAA,gBAAA,EAAA;;IAH7C,IAAI,QAAA;IACL,OAAM;IACN,MAAK;IACJ,sBAAsB,cAAA,SAAa;gEACtC,YAMgC,MAAA,kBAAA,EAAA;;IAJ7B,IAAI,QAAA;IACL,gBAAe;IACf,cAAa;IACZ,YAAY;IACZ,MAAM,cAAA,SAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"Contact.vue.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva } from '@scalar/components'\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport type { ContactObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Contact.vue.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport { cva } from '@scalar/use-hooks/useBindCx'\nimport type { ContactObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref } from "vue";
2
- import { cva } from "@scalar/components";
3
2
  import { ScalarIconEnvelopeSimple } from "@scalar/icons";
3
+ import { cva } from "@scalar/use-hooks/useBindCx";
4
4
  //#region src/features/info-object/Contact.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = {
6
6
  key: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Contact.vue.script.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva } from '@scalar/components'\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport type { ContactObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAKA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,MAAM,EACJ,MAAM,6BACP,EACF;GACF,CAAA;;UAQiB,QAAA,SAAA,WAAA,EACd,mBAgBM,OAhBN,YAgBM,CAbI,QAAA,OAAO,SAAA,WAAA,EADf,mBAQI,KAAA;;IAND,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,MAAA,CAAA,CAAA;IACf,MAAI,UAAY,QAAA,OAAO;OACxB,YAEgC,MAAA,yBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAuD,QAAvD,YAAuD,gBAApB,QAAA,MAAM,KAAI,EAAA,EAAA,CAAA,EAAA,IAAA,WAAA,IAGlC,QAAA,OAAO,QAAA,WAAA,EADpB,mBAIO,QAAA;;IAFJ,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,OAAA,CAAA,CAAA;sBACb,QAAA,MAAM,KAAI,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"Contact.vue.script.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport { cva } from '@scalar/use-hooks/useBindCx'\nimport type { ContactObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAKA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,MAAM,EACJ,MAAM,6BACP,EACF;GACF,CAAA;;UAQiB,QAAA,SAAA,WAAA,EACd,mBAgBM,OAhBN,YAgBM,CAbI,QAAA,OAAO,SAAA,WAAA,EADf,mBAQI,KAAA;;IAND,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,MAAA,CAAA,CAAA;IACf,MAAI,UAAY,QAAA,OAAO;OACxB,YAEgC,MAAA,yBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAuD,QAAvD,YAAuD,gBAApB,QAAA,MAAM,KAAI,EAAA,EAAA,CAAA,EAAA,IAAA,WAAA,IAGlC,QAAA,OAAO,QAAA,WAAA,EADpB,mBAIO,QAAA;;IAFJ,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,OAAA,CAAA,CAAA;sBACb,QAAA,MAAM,KAAI,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1,6 +1,7 @@
1
+ import type { AsyncApiLicenseObject } from '@scalar/types/asyncapi/3.1';
1
2
  import type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
3
  type __VLS_Props = {
3
- value?: LicenseObject;
4
+ value?: LicenseObject | AsyncApiLicenseObject;
4
5
  };
5
6
  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>;
6
7
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"License.vue.d.ts","sourceRoot":"","sources":["../../../src/features/info-object/License.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAEjG,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAC;AAoGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"License.vue.d.ts","sourceRoot":"","sources":["../../../src/features/info-object/License.vue"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAEjG,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,aAAa,GAAG,qBAAqB,CAAA;CAC9C,CAAC;AAoGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"License.vue.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: LicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n v-if=\"value?.url\"\n :href=\"value.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || value.identifier || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"License.vue.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport type { AsyncApiLicenseObject } from '@scalar/types/asyncapi/3.1'\nimport type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: LicenseObject | AsyncApiLicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.url\"\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n :href=\"value.url\"\n rel=\"noopener noreferrer\"\n target=\"_blank\">\n <ScalarIconGavel\n class=\"size-3 text-current\"\n weight=\"bold\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || ('identifier' in value && value.identifier) || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n class=\"size-3 text-current\"\n weight=\"bold\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":""}
@@ -14,14 +14,14 @@ var License_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
14
14
  key: 0,
15
15
  class: "text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none",
16
16
  href: __props.value.url,
17
- target: "_blank",
18
- rel: "noopener noreferrer"
17
+ rel: "noopener noreferrer",
18
+ target: "_blank"
19
19
  }, [createVNode(unref(ScalarIconGavel), {
20
- weight: "bold",
21
- class: "size-3 text-current"
22
- }), createElementVNode("span", _hoisted_3, toDisplayString(__props.value?.name || __props.value.identifier || __props.value.url), 1)], 8, _hoisted_2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarIconGavel), {
23
- weight: "bold",
24
- class: "size-3 text-current"
20
+ class: "size-3 text-current",
21
+ weight: "bold"
22
+ }), createElementVNode("span", _hoisted_3, toDisplayString(__props.value?.name || "identifier" in __props.value && __props.value.identifier || __props.value.url), 1)], 8, _hoisted_2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarIconGavel), {
23
+ class: "size-3 text-current",
24
+ weight: "bold"
25
25
  }), createElementVNode("span", _hoisted_4, toDisplayString(__props.value?.name), 1)], 64))]);
26
26
  };
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"License.vue.script.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: LicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n v-if=\"value?.url\"\n :href=\"value.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || value.identifier || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;uBAUE,mBAqBM,OArBN,YAqBM,CAjBI,QAAA,OAAO,OAAA,WAAA,EAFf,mBAYI,KAAA;;IAXF,OAAM;IAEL,MAAM,QAAA,MAAM;IACb,QAAO;IACP,KAAI;OACJ,YAEgC,MAAA,gBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAES,QAFT,YAES,gBADP,QAAA,OAAO,QAAQ,QAAA,MAAM,cAAc,QAAA,MAAM,IAAG,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,KAAA,WAAA,EAGhD,mBAKW,UAAA,EAAA,KAAA,GAAA,EAAA,CAJT,YAEgC,MAAA,gBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAwD,QAAxD,YAAwD,gBAArB,QAAA,OAAO,KAAI,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"License.vue.script.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport type { AsyncApiLicenseObject } from '@scalar/types/asyncapi/3.1'\nimport type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: LicenseObject | AsyncApiLicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.url\"\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n :href=\"value.url\"\n rel=\"noopener noreferrer\"\n target=\"_blank\">\n <ScalarIconGavel\n class=\"size-3 text-current\"\n weight=\"bold\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || ('identifier' in value && value.identifier) || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n class=\"size-3 text-current\"\n weight=\"bold\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;uBAWE,mBAqBM,OArBN,YAqBM,CAlBI,QAAA,OAAO,OAAA,WAAA,EADf,mBAYI,KAAA;;IAVF,OAAM;IACL,MAAM,QAAA,MAAM;IACb,KAAI;IACJ,QAAO;OACP,YAEkB,MAAA,gBAAA,EAAA;IADhB,OAAM;IACN,QAAO;OACT,mBAES,QAFT,YAES,gBADP,QAAA,OAAO,QAAI,gBAAqB,QAAA,SAAS,QAAA,MAAM,cAAe,QAAA,MAAM,IAAG,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,KAAA,WAAA,EAG3E,mBAKW,UAAA,EAAA,KAAA,GAAA,EAAA,CAJT,YAEkB,MAAA,gBAAA,EAAA;IADhB,OAAM;IACN,QAAO;OACT,mBAAwD,QAAxD,YAAwD,gBAArB,QAAA,OAAO,KAAI,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSelector.vue.js","names":[],"sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n options: { label: string; id: string }[]\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\nconst formattedOptions = computed(() =>\n props.options.map((o) => ({ id: o.id, label: o.label })),\n)\n\nconst selected = computed(() =>\n formattedOptions.value.find((o) => o.id === props.modelValue),\n)\n</script>\n\n<template>\n <div\n v-if=\"options.length > 1\"\n class=\"document-selector px-3 pt-3\">\n <ScalarListbox\n v-slot=\"{ open }\"\n :modelValue=\"selected\"\n :options=\"formattedOptions\"\n resize\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <button\n class=\"group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium\"\n type=\"button\">\n <span class=\"overflow-hidden text-base text-ellipsis\">\n {{ selected?.label || 'Select API' }}\n </span>\n <ScalarIconCaretDown\n class=\"size-3 text-current transition-transform\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </button>\n </ScalarListbox>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"DocumentSelector.vue.js","names":[],"sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n options: { label: string; id: string }[]\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\nconst formattedOptions = computed(() =>\n props.options.map((o) => ({ id: o.id, label: o.label })),\n)\n\nconst selected = computed(() =>\n formattedOptions.value.find((o) => o.id === props.modelValue),\n)\n</script>\n\n<template>\n <div\n v-if=\"options.length > 1\"\n class=\"document-selector px-3 pt-3\">\n <ScalarListbox\n v-slot=\"{ open }\"\n :modelValue=\"selected\"\n :options=\"formattedOptions\"\n resize\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <button\n class=\"group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium\"\n type=\"button\">\n <span class=\"overflow-hidden text-base text-ellipsis\">\n {{ selected?.label || 'Select API' }}\n </span>\n <ScalarIconCaretDown\n class=\"size-3 text-current transition-transform\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </button>\n </ScalarListbox>\n </div>\n</template>\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
2
- import { ScalarListbox } from "@scalar/components";
3
2
  import { ScalarIconCaretDown } from "@scalar/icons";
3
+ import { ScalarListbox } from "@scalar/components/listbox";
4
4
  //#region src/features/multiple-documents/DocumentSelector.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = {
6
6
  key: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSelector.vue.script.js","names":[],"sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n options: { label: string; id: string }[]\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\nconst formattedOptions = computed(() =>\n props.options.map((o) => ({ id: o.id, label: o.label })),\n)\n\nconst selected = computed(() =>\n formattedOptions.value.find((o) => o.id === props.modelValue),\n)\n</script>\n\n<template>\n <div\n v-if=\"options.length > 1\"\n class=\"document-selector px-3 pt-3\">\n <ScalarListbox\n v-slot=\"{ open }\"\n :modelValue=\"selected\"\n :options=\"formattedOptions\"\n resize\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <button\n class=\"group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium\"\n type=\"button\">\n <span class=\"overflow-hidden text-base text-ellipsis\">\n {{ selected?.label || 'Select API' }}\n </span>\n <ScalarIconCaretDown\n class=\"size-3 text-current transition-transform\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </button>\n </ScalarListbox>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAIb,MAAM,mBAAmB,eACvB,MAAM,QAAQ,KAAK,OAAO;GAAE,IAAI,EAAE;GAAI,OAAO,EAAE;GAAO,EAAE,CAC1D;EAEA,MAAM,WAAW,eACf,iBAAiB,MAAM,MAAM,MAAM,EAAE,OAAO,MAAM,WAAW,CAC/D;;UAKU,QAAA,QAAQ,SAAM,KAAA,WAAA,EADtB,mBAqBM,OArBN,YAqBM,CAlBJ,YAiBgB,MAAA,cAAA,EAAA;IAfb,YAAY,SAAA;IACZ,SAAS,iBAAA;IACV,QAAA;IACC,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,GAAE;;sBAWhD,EAfC,WAAI,CAKd,mBAUS,UAVT,YAUS,CAPP,mBAEO,QAFP,YAEO,gBADF,SAAA,OAAU,SAAK,aAAA,EAAA,EAAA,EAEpB,YAGkB,MAAA,oBAAA,EAAA;KAFhB,OAAK,eAAA,CAAC,4CAA0C,EAAA,cACxB,MAAI,CAAA,CAAA;KAC5B,QAAO"}
1
+ {"version":3,"file":"DocumentSelector.vue.script.js","names":[],"sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n options: { label: string; id: string }[]\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\nconst formattedOptions = computed(() =>\n props.options.map((o) => ({ id: o.id, label: o.label })),\n)\n\nconst selected = computed(() =>\n formattedOptions.value.find((o) => o.id === props.modelValue),\n)\n</script>\n\n<template>\n <div\n v-if=\"options.length > 1\"\n class=\"document-selector px-3 pt-3\">\n <ScalarListbox\n v-slot=\"{ open }\"\n :modelValue=\"selected\"\n :options=\"formattedOptions\"\n resize\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <button\n class=\"group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium\"\n type=\"button\">\n <span class=\"overflow-hidden text-base text-ellipsis\">\n {{ selected?.label || 'Select API' }}\n </span>\n <ScalarIconCaretDown\n class=\"size-3 text-current transition-transform\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </button>\n </ScalarListbox>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAIb,MAAM,mBAAmB,eACvB,MAAM,QAAQ,KAAK,OAAO;GAAE,IAAI,EAAE;GAAI,OAAO,EAAE;GAAO,EAAE,CAC1D;EAEA,MAAM,WAAW,eACf,iBAAiB,MAAM,MAAM,MAAM,EAAE,OAAO,MAAM,WAAW,CAC/D;;UAKU,QAAA,QAAQ,SAAM,KAAA,WAAA,EADtB,mBAqBM,OArBN,YAqBM,CAlBJ,YAiBgB,MAAA,cAAA,EAAA;IAfb,YAAY,SAAA;IACZ,SAAS,iBAAA;IACV,QAAA;IACC,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,GAAE;;sBAWhD,EAfC,WAAI,CAKd,mBAUS,UAVT,YAUS,CAPP,mBAEO,QAFP,YAEO,gBADF,SAAA,OAAU,SAAK,aAAA,EAAA,EAAA,EAEpB,YAGkB,MAAA,oBAAA,EAAA;KAFhB,OAAK,eAAA,CAAC,4CAA0C,EAAA,cACxB,MAAI,CAAA,CAAA;KAC5B,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpecificationExtension.vue.js","names":[],"sources":["../../../src/features/specification-extension/SpecificationExtension.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport { computed } from 'vue'\n\nimport { usePluginManager } from '@/plugins'\n\nconst { value } = defineProps<{\n /**\n * Any value that can contain OpenAPI specification extensions.\n */\n value: Record<string, unknown> | undefined\n}>()\n\nconst { getSpecificationExtensions } = usePluginManager()\n\n/**\n * Extract registered OpenAPI extension names\n */\nfunction getCustomExtensionNames(\n value: Record<string, any> | undefined,\n): `x-${string}`[] {\n return Object.keys(value ?? {}).filter((item) =>\n item.startsWith('x-'),\n ) as `x-${string}`[]\n}\n\n/**\n * Get the components for the specification extensions\n */\nfunction getCustomOpenApiExtensionComponents(extensionNames: `x-${string}`[]) {\n return extensionNames\n .flatMap((name) => getSpecificationExtensions(name))\n .filter((extension) => extension.component)\n}\n\n/**\n * Get the names of custom extensions from the provided value.\n */\nconst customExtensionNames = computed(() => getCustomExtensionNames(value))\n\n/**\n * Get the components for the custom extensions.\n */\nconst customExtensions = computed(() =>\n getCustomOpenApiExtensionComponents(customExtensionNames.value),\n)\n</script>\n\n<template>\n <template v-if=\"typeof value === 'object' && customExtensions.length\">\n <div class=\"text-base\">\n <template v-for=\"extension in customExtensions\">\n <ScalarErrorBoundary>\n <template v-if=\"extension.renderer\">\n <!-- Custom rendering -->\n <component\n :is=\"extension.renderer\"\n v-bind=\"{\n [extension.name]: value?.[extension.name],\n component: extension.component,\n }\" />\n </template>\n <template v-else>\n <!-- Vue rendering -->\n <component\n :is=\"extension.component\"\n v-bind=\"{ [extension.name]: value?.[extension.name] }\" />\n </template>\n </ScalarErrorBoundary>\n </template>\n </div>\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SpecificationExtension.vue.js","names":[],"sources":["../../../src/features/specification-extension/SpecificationExtension.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { computed } from 'vue'\n\nimport { usePluginManager } from '@/plugins'\n\nconst { value } = defineProps<{\n /**\n * Any value that can contain OpenAPI specification extensions.\n */\n value: Record<string, unknown> | undefined\n}>()\n\nconst { getSpecificationExtensions } = usePluginManager()\n\n/**\n * Extract registered OpenAPI extension names\n */\nfunction getCustomExtensionNames(\n value: Record<string, any> | undefined,\n): `x-${string}`[] {\n return Object.keys(value ?? {}).filter((item) =>\n item.startsWith('x-'),\n ) as `x-${string}`[]\n}\n\n/**\n * Get the components for the specification extensions\n */\nfunction getCustomOpenApiExtensionComponents(extensionNames: `x-${string}`[]) {\n return extensionNames\n .flatMap((name) => getSpecificationExtensions(name))\n .filter((extension) => extension.component)\n}\n\n/**\n * Get the names of custom extensions from the provided value.\n */\nconst customExtensionNames = computed(() => getCustomExtensionNames(value))\n\n/**\n * Get the components for the custom extensions.\n */\nconst customExtensions = computed(() =>\n getCustomOpenApiExtensionComponents(customExtensionNames.value),\n)\n</script>\n\n<template>\n <template v-if=\"typeof value === 'object' && customExtensions.length\">\n <div class=\"text-base\">\n <template v-for=\"extension in customExtensions\">\n <ScalarErrorBoundary>\n <template v-if=\"extension.renderer\">\n <!-- Custom rendering -->\n <component\n :is=\"extension.renderer\"\n v-bind=\"{\n [extension.name]: value?.[extension.name],\n component: extension.component,\n }\" />\n </template>\n <template v-else>\n <!-- Vue rendering -->\n <component\n :is=\"extension.component\"\n v-bind=\"{ [extension.name]: value?.[extension.name] }\" />\n </template>\n </ScalarErrorBoundary>\n </template>\n </div>\n </template>\n</template>\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { usePluginManager } from "../../plugins/hooks/usePluginManager.js";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, unref, withCtx } from "vue";
3
- import { ScalarErrorBoundary } from "@scalar/components";
3
+ import { ScalarErrorBoundary } from "@scalar/components/error-boundary";
4
4
  //#region src/features/specification-extension/SpecificationExtension.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = {
6
6
  key: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"SpecificationExtension.vue.script.js","names":[],"sources":["../../../src/features/specification-extension/SpecificationExtension.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport { computed } from 'vue'\n\nimport { usePluginManager } from '@/plugins'\n\nconst { value } = defineProps<{\n /**\n * Any value that can contain OpenAPI specification extensions.\n */\n value: Record<string, unknown> | undefined\n}>()\n\nconst { getSpecificationExtensions } = usePluginManager()\n\n/**\n * Extract registered OpenAPI extension names\n */\nfunction getCustomExtensionNames(\n value: Record<string, any> | undefined,\n): `x-${string}`[] {\n return Object.keys(value ?? {}).filter((item) =>\n item.startsWith('x-'),\n ) as `x-${string}`[]\n}\n\n/**\n * Get the components for the specification extensions\n */\nfunction getCustomOpenApiExtensionComponents(extensionNames: `x-${string}`[]) {\n return extensionNames\n .flatMap((name) => getSpecificationExtensions(name))\n .filter((extension) => extension.component)\n}\n\n/**\n * Get the names of custom extensions from the provided value.\n */\nconst customExtensionNames = computed(() => getCustomExtensionNames(value))\n\n/**\n * Get the components for the custom extensions.\n */\nconst customExtensions = computed(() =>\n getCustomOpenApiExtensionComponents(customExtensionNames.value),\n)\n</script>\n\n<template>\n <template v-if=\"typeof value === 'object' && customExtensions.length\">\n <div class=\"text-base\">\n <template v-for=\"extension in customExtensions\">\n <ScalarErrorBoundary>\n <template v-if=\"extension.renderer\">\n <!-- Custom rendering -->\n <component\n :is=\"extension.renderer\"\n v-bind=\"{\n [extension.name]: value?.[extension.name],\n component: extension.component,\n }\" />\n </template>\n <template v-else>\n <!-- Vue rendering -->\n <component\n :is=\"extension.component\"\n v-bind=\"{ [extension.name]: value?.[extension.name] }\" />\n </template>\n </ScalarErrorBoundary>\n </template>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;EAaA,MAAM,EAAE,+BAA+B,kBAAiB;;;;EAKxD,SAAS,wBACP,OACiB;AACjB,UAAO,OAAO,KAAK,SAAS,EAAE,CAAC,CAAC,QAAQ,SACtC,KAAK,WAAW,KAAK,CACtB;;;;;EAMH,SAAS,oCAAoC,gBAAiC;AAC5E,UAAO,eACJ,SAAS,SAAS,2BAA2B,KAAK,CAAA,CAClD,QAAQ,cAAc,UAAU,UAAS;;;;;EAM9C,MAAM,uBAAuB,eAAe,wBAAwB,QAAA,MAAM,CAAA;;;;EAK1E,MAAM,mBAAmB,eACvB,oCAAoC,qBAAqB,MAAM,CACjE;;iBAIyB,QAAA,UAAK,YAAiB,iBAAA,MAAiB,UAAA,WAAA,EAC5D,mBAoBM,OApBN,YAoBM,EAAA,UAAA,KAAA,EAnBJ,mBAkBW,UAAA,MAAA,WAlBmB,iBAAA,QAAb,cAAS;wBACxB,YAgBsB,MAAA,oBAAA,EAAA,MAAA;4BAPT,CARK,UAAU,YAAA,WAAA,EAExB,YAKO,wBAJA,UAAU,SAAQ,EADzB,WAKO;;;;OAHsB,UAAU,OAAO,QAAA,QAAQ,UAAU;iBAAkC,UAAU;oCAO5G,YAE2D,wBADpD,UAAU,UAAS,EAD1B,WAE2D;;;WAA9C,UAAU,OAAO,QAAA,QAAQ,UAAU,OAAI,CAAA,EAAA,MAAA,GAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"SpecificationExtension.vue.script.js","names":[],"sources":["../../../src/features/specification-extension/SpecificationExtension.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { computed } from 'vue'\n\nimport { usePluginManager } from '@/plugins'\n\nconst { value } = defineProps<{\n /**\n * Any value that can contain OpenAPI specification extensions.\n */\n value: Record<string, unknown> | undefined\n}>()\n\nconst { getSpecificationExtensions } = usePluginManager()\n\n/**\n * Extract registered OpenAPI extension names\n */\nfunction getCustomExtensionNames(\n value: Record<string, any> | undefined,\n): `x-${string}`[] {\n return Object.keys(value ?? {}).filter((item) =>\n item.startsWith('x-'),\n ) as `x-${string}`[]\n}\n\n/**\n * Get the components for the specification extensions\n */\nfunction getCustomOpenApiExtensionComponents(extensionNames: `x-${string}`[]) {\n return extensionNames\n .flatMap((name) => getSpecificationExtensions(name))\n .filter((extension) => extension.component)\n}\n\n/**\n * Get the names of custom extensions from the provided value.\n */\nconst customExtensionNames = computed(() => getCustomExtensionNames(value))\n\n/**\n * Get the components for the custom extensions.\n */\nconst customExtensions = computed(() =>\n getCustomOpenApiExtensionComponents(customExtensionNames.value),\n)\n</script>\n\n<template>\n <template v-if=\"typeof value === 'object' && customExtensions.length\">\n <div class=\"text-base\">\n <template v-for=\"extension in customExtensions\">\n <ScalarErrorBoundary>\n <template v-if=\"extension.renderer\">\n <!-- Custom rendering -->\n <component\n :is=\"extension.renderer\"\n v-bind=\"{\n [extension.name]: value?.[extension.name],\n component: extension.component,\n }\" />\n </template>\n <template v-else>\n <!-- Vue rendering -->\n <component\n :is=\"extension.component\"\n v-bind=\"{ [extension.name]: value?.[extension.name] }\" />\n </template>\n </ScalarErrorBoundary>\n </template>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;EAaA,MAAM,EAAE,+BAA+B,kBAAiB;;;;EAKxD,SAAS,wBACP,OACiB;AACjB,UAAO,OAAO,KAAK,SAAS,EAAE,CAAC,CAAC,QAAQ,SACtC,KAAK,WAAW,KAAK,CACtB;;;;;EAMH,SAAS,oCAAoC,gBAAiC;AAC5E,UAAO,eACJ,SAAS,SAAS,2BAA2B,KAAK,CAAA,CAClD,QAAQ,cAAc,UAAU,UAAS;;;;;EAM9C,MAAM,uBAAuB,eAAe,wBAAwB,QAAA,MAAM,CAAA;;;;EAK1E,MAAM,mBAAmB,eACvB,oCAAoC,qBAAqB,MAAM,CACjE;;iBAIyB,QAAA,UAAK,YAAiB,iBAAA,MAAiB,UAAA,WAAA,EAC5D,mBAoBM,OApBN,YAoBM,EAAA,UAAA,KAAA,EAnBJ,mBAkBW,UAAA,MAAA,WAlBmB,iBAAA,QAAb,cAAS;wBACxB,YAgBsB,MAAA,oBAAA,EAAA,MAAA;4BAPT,CARK,UAAU,YAAA,WAAA,EAExB,YAKO,wBAJA,UAAU,SAAQ,EADzB,WAKO;;;;OAHsB,UAAU,OAAO,QAAA,QAAQ,UAAU;iBAAkC,UAAU;oCAO5G,YAE2D,wBADpD,UAAU,UAAS,EAD1B,WAE2D;;;WAA9C,UAAU,OAAO,QAAA,QAAQ,UAAU,OAAI,CAAA,EAAA,MAAA,GAAA,EAAA,CAAA"}