@scalar/api-reference 1.57.4 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/browser/chunks/AgentScalarChatInterface-DIIVMX31.js +27 -0
  3. package/dist/browser/chunks/ScalarTextInput.vue-DDsQgpOo.js +27 -0
  4. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +15 -0
  5. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +15 -0
  6. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +15 -0
  7. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +15 -0
  8. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +15 -0
  9. package/dist/browser/chunks/browser-67K6wmG9.js +129 -0
  10. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +15 -0
  11. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +15 -0
  12. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +15 -0
  13. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +15 -0
  14. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +15 -0
  15. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +15 -0
  16. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +15 -0
  17. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +15 -0
  18. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +15 -0
  19. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +15 -0
  20. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +15 -0
  21. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +15 -0
  22. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +15 -0
  23. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +15 -0
  24. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +15 -0
  25. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +15 -0
  26. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +15 -0
  27. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +15 -0
  28. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +15 -0
  29. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +15 -0
  30. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +15 -0
  31. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +15 -0
  32. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +15 -0
  33. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +15 -0
  34. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +15 -0
  35. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +15 -0
  36. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +15 -0
  37. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +15 -0
  38. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +15 -0
  39. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +15 -0
  40. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +15 -0
  41. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +15 -0
  42. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +15 -0
  43. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +15 -0
  44. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +15 -0
  45. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +15 -0
  46. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +15 -0
  47. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +15 -0
  48. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +15 -0
  49. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +15 -0
  50. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +15 -0
  51. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +15 -0
  52. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +15 -0
  53. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +15 -0
  54. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +15 -0
  55. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +15 -0
  56. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +15 -0
  57. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +15 -0
  58. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +15 -0
  59. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +15 -0
  60. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +15 -0
  61. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +15 -0
  62. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +15 -0
  63. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +15 -0
  64. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +15 -0
  65. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +15 -0
  66. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +15 -0
  67. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +15 -0
  68. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +15 -0
  69. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +15 -0
  70. package/dist/browser/chunks/modal-BA6EnLMO.js +15 -0
  71. package/dist/browser/chunks/modal-DW-P3H1k.js +66 -0
  72. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +15 -0
  73. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +15 -0
  74. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +15 -0
  75. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +15 -0
  76. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +15 -0
  77. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +15 -0
  78. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +15 -0
  79. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +15 -0
  80. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +15 -0
  81. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +15 -0
  82. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +15 -0
  83. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +15 -0
  84. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +15 -0
  85. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +15 -0
  86. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +17 -0
  87. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +15 -0
  88. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +15 -0
  89. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +15 -0
  90. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +15 -0
  91. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +15 -0
  92. package/dist/browser/chunks/vendor-Ad2vN5Ro.js +333 -0
  93. package/dist/browser/standalone.esm.js +1852 -0
  94. package/dist/browser/standalone.js +253 -255
  95. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  96. package/dist/components/ApiReference.vue.js +1 -1
  97. package/dist/components/ApiReference.vue.js.map +1 -1
  98. package/dist/components/ApiReference.vue.script.js +61 -26
  99. package/dist/components/ApiReference.vue.script.js.map +1 -1
  100. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts +16 -0
  101. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -0
  102. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js +7 -0
  103. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -0
  104. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +164 -0
  105. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -0
  106. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +14 -0
  107. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -0
  108. package/dist/components/Content/AsyncApi/Channel.vue.js +9 -0
  109. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -0
  110. package/dist/components/Content/AsyncApi/Channel.vue.script.js +108 -0
  111. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -0
  112. package/dist/components/Content/AsyncApi/index.d.ts +2 -0
  113. package/dist/components/Content/AsyncApi/index.d.ts.map +1 -0
  114. package/dist/components/Content/Content.vue.d.ts +3 -3
  115. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  116. package/dist/components/Content/Content.vue.js.map +1 -1
  117. package/dist/components/Content/Content.vue.script.js +19 -3
  118. package/dist/components/Content/Content.vue.script.js.map +1 -1
  119. package/dist/components/Content/Models/ModelTag.vue.d.ts +2 -0
  120. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  121. package/dist/components/Content/Models/ModelTag.vue.js.map +1 -1
  122. package/dist/components/Content/Models/ModelTag.vue.script.js +11 -12
  123. package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
  124. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -1
  125. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  126. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  127. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +4 -2
  128. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  129. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  130. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  131. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +4 -6
  132. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  133. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -1
  134. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  135. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +40 -25
  136. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  137. package/dist/components/index.js +1 -1
  138. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  139. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  140. package/dist/features/Operation/components/ParameterListItem.vue.script.js +9 -9
  141. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  142. package/dist/features/Search/components/SearchButton.vue.d.ts +4 -1
  143. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  144. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  145. package/dist/features/Search/components/SearchButton.vue.script.js +7 -8
  146. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  147. package/dist/features/Search/components/SearchModal.vue.d.ts +4 -1
  148. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  149. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  150. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  151. package/dist/features/Search/components/SearchModal.vue.script.js +5 -2
  152. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  153. package/dist/features/Search/components/SearchResult.vue.d.ts +2 -0
  154. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  155. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  156. package/dist/features/Search/components/SearchResult.vue.script.js +8 -6
  157. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  158. package/dist/features/Search/helpers/create-search-index.d.ts +9 -1
  159. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  160. package/dist/features/Search/helpers/create-search-index.js +27 -8
  161. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  162. package/dist/features/Search/hooks/useSearchIndex.d.ts +4 -2
  163. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  164. package/dist/features/Search/hooks/useSearchIndex.js +4 -3
  165. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  166. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts +1 -1
  167. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  168. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  169. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +11 -9
  170. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  171. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  172. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  173. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +9 -1
  174. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  175. package/dist/helpers/get-async-api-model-schema.d.ts +15 -0
  176. package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -0
  177. package/dist/helpers/get-async-api-model-schema.js +32 -0
  178. package/dist/helpers/get-async-api-model-schema.js.map +1 -0
  179. package/dist/helpers/id-routing.d.ts +18 -0
  180. package/dist/helpers/id-routing.d.ts.map +1 -1
  181. package/dist/helpers/id-routing.js +41 -1
  182. package/dist/helpers/id-routing.js.map +1 -1
  183. package/dist/plugins/index.d.ts +1 -1
  184. package/dist/plugins/index.js +1 -1
  185. package/dist/plugins/{persistance-plugin.d.ts → persistence-plugin.d.ts} +2 -8
  186. package/dist/plugins/persistence-plugin.d.ts.map +1 -0
  187. package/dist/plugins/{persistance-plugin.js → persistence-plugin.js} +4 -13
  188. package/dist/plugins/persistence-plugin.js.map +1 -0
  189. package/dist/standalone.esm.d.ts +4 -0
  190. package/dist/standalone.esm.d.ts.map +1 -0
  191. package/dist/style.css +110 -98
  192. package/dist/vue-styles.css +104 -96
  193. package/package.json +20 -18
  194. package/dist/browser/webpack-stats.json +0 -1
  195. package/dist/plugins/persistance-plugin.d.ts.map +0 -1
  196. package/dist/plugins/persistance-plugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAkQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AAmUJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AA8TJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectProperties.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n\n if ('$ref' in property && typeof property.$ref === 'string') {\n return getResolvedRef(property) as SchemaObject\n }\n\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :description=\"getPropertyDescription(property)\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :description=\"getPropertyDescription(property)\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":""}
@@ -2,7 +2,6 @@ import { isTypeObject } from "./helpers/is-type-object.js";
2
2
  import { sortPropertyNames } from "./helpers/sort-property-names.js";
3
3
  import SchemaProperty_default from "./SchemaProperty.vue.js";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, renderList, unref } from "vue";
5
- import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
5
  import { resolve } from "@scalar/workspace-store/resolve";
7
6
  //#region src/components/Content/Schema/SchemaObjectProperties.vue?vue&type=script&setup=true&lang.ts
8
7
  var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -67,7 +66,6 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
67
66
  */
68
67
  const getPropertySchema = (property) => {
69
68
  if (!property) return;
70
- if ("$ref" in property && typeof property.$ref === "string") return getResolvedRef(property);
71
69
  return resolve.schema(property);
72
70
  };
73
71
  const getPropertyDescription = (property) => {
@@ -97,6 +95,7 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
97
95
  compact: __props.compact,
98
96
  compositionPath: __props.compositionPath,
99
97
  compositionPathSegment: property,
98
+ description: getPropertyDescription(__props.schema.properties[property]),
100
99
  discriminator: __props.discriminator,
101
100
  eventBus: __props.eventBus,
102
101
  hideHeading: __props.hideHeading,
@@ -105,7 +104,6 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
105
104
  name: property,
106
105
  options: __props.options,
107
106
  required: __props.schema.required?.includes(property),
108
- description: getPropertyDescription(__props.schema.properties[property]),
109
107
  schema: getPropertySchema(__props.schema.properties[property]),
110
108
  schemaContext: __props.schemaContext
111
109
  }, null, 8, [
@@ -113,6 +111,7 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
113
111
  "compact",
114
112
  "compositionPath",
115
113
  "compositionPathSegment",
114
+ "description",
116
115
  "discriminator",
117
116
  "eventBus",
118
117
  "hideHeading",
@@ -121,7 +120,6 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
121
120
  "name",
122
121
  "options",
123
122
  "required",
124
- "description",
125
123
  "schema",
126
124
  "schemaContext"
127
125
  ]);
@@ -133,6 +131,7 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
133
131
  compact: __props.compact,
134
132
  compositionPath: __props.compositionPath,
135
133
  compositionPathSegment: key,
134
+ description: getPropertyDescription(property),
136
135
  discriminator: __props.discriminator,
137
136
  eventBus: __props.eventBus,
138
137
  hideHeading: __props.hideHeading,
@@ -140,7 +139,6 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
140
139
  level: __props.level,
141
140
  name: key,
142
141
  options: __props.options,
143
- description: getPropertyDescription(property),
144
142
  schema: getPropertySchema(property),
145
143
  schemaContext: __props.schemaContext
146
144
  }, null, 8, [
@@ -148,6 +146,7 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
148
146
  "compact",
149
147
  "compositionPath",
150
148
  "compositionPathSegment",
149
+ "description",
151
150
  "discriminator",
152
151
  "eventBus",
153
152
  "hideHeading",
@@ -155,7 +154,6 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
155
154
  "level",
156
155
  "name",
157
156
  "options",
158
- "description",
159
157
  "schema",
160
158
  "schemaContext"
161
159
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectProperties.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n\n if ('$ref' in property && typeof property.$ref === 'string') {\n return getResolvedRef(property) as SchemaObject\n }\n\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :description=\"getPropertyDescription(property)\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],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,OAAO,wBAAA,WAAA,EAC7C,YA0BmC,wBAAA;;KAzBhC,YAAA,QAAA;KACA,SAAA,QAAA;KACA,iBAAiB,QAAA;KACjB,wBAAiC,4BAAuC,QAAA,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMtH,eAAA,QAAA;KACA,UAAU,QAAA;KACV,aAAA,QAAA;KACA,gBAAA,QAAA;KACA,OAAA,QAAA;KACA,MAAe,4BAAuC,QAAA,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMrG,gBAAA;KACC,SAAS,QAAA;KACT,mBAAmB,yBAAA;KACnB,QAAQ,6BAA6B,QAAA,OAAO,qBAAoB;KAChE,eAAe,QAAA;KAChB,SAAQ"}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :description=\"getPropertyDescription(property)\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAmCA,MAAM,mBAAmB,eACvB,kBAAkB,QAAA,QAAQ,QAAA,eAAe,QAAA,QAAQ,CACnD;;;;;;;EAQA,MAAM,+BACJ,uBAIA,mBACG;GACH,MAAM,uBACJ,OAAO,0BAA0B,YAC7B,wBACA,QAAQ,OAAO,sBAAqB;AAE1C,OACE,OAAO,yBAAyB,YAChC,OAAO,qBAAqB,kCAAkC,YAC9D,qBAAqB,8BAA8B,MAAM,CAAC,SAAS,EAEnE,QAAO,GAAG,qBAAqB,8BAA8B,MAAM;AAIrE,OAAI,gBAAgB;IAClB,MAAM,WAAW,QAAQ,OAAO,eAAc;AAC9C,QAAI,UAAU,MACZ,QAAO,SAAS;;AAIpB,UAAO;;;;;;;;;EAUT,MAAM,wBACJ,mBACyB;AACzB,OAAI,CAAC,eACH;GAGF,MAAM,WAAW,QAAQ,OAAO,eAAc;AAC9C,OACE,YACA,UAAU,YACV,MAAM,QAAQ,SAAS,KAAK,IAC5B,SAAS,KAAK,SAAS,EAEvB,QAAO,SAAS;;;EAOpB,MAAM,2BAA2B,eAAe;AAC9C,OAAI,CAAC,aAAa,QAAA,OAAO,IAAI,CAAC,QAAA,O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Q,QAAA,OAAO,kBAAiB,GAAA,CAAzD,KAAK,cAAQ;yBADvB,YAgBmC,wBAAA;MAd3B;MACL,YAAA,QAAA;MACA,SAAA,QAAA;MACA,iBAAiB,QAAA;MACjB,wBAAwB;MACxB,aAAa,uBAAuB,SAAQ;MAC5C,eAAA,QAAA;MACA,UAAU,QAAA;MACV,aAAA,QAAA;MACA,gBAAgB,QAAA;MAChB,OAAA,QAAA;MACA,MAAM;MACN,SAAS,QAAA;MACT,QAAQ,kBAAkB,SAAQ;MAClC,eAAe,QAAA;;;;;;;;;;;;;;;;;;IAIJ,MAAA,aAAY,CAAC,QAAA,OAAM,IAAK,QAAA,OAAO,wBAAA,WAAA,EAC7C,YA0BmC,wBAAA;;KAzBhC,YAAA,QAAA;KACA,SAAA,QAAA;KACA,iBAAiB,QAAA;KACjB,wBAAiC,4BAAuC,QAAA,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMtH,eAAA,QAAA;KACA,UAAU,QAAA;KACV,aAAA,QAAA;KACA,gBAAA,QAAA;KACA,OAAA,QAAA;KACA,MAAe,4BAAuC,QAAA,OAAO,sBAAgC,QAAA,OAAO,cAAA;KAMrG,gBAAA;KACC,SAAS,QAAA;KACT,mBAAmB,yBAAA;KACnB,QAAQ,6BAA6B,QAAA,OAAO,qBAAoB;KAChE,eAAe,QAAA;KAChB,SAAQ"}
@@ -5,7 +5,8 @@ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/o
5
5
  *
6
6
  * @param schemas - Array of OpenAPI schema objects to merge
7
7
  * @param rootSchema - Optional root schema to merge with the result
8
+ * @param seenRefs - `$ref` strings already being merged higher in the call stack
8
9
  * @returns Merged schema object
9
10
  */
10
- export declare const mergeAllOfSchemas: (schemas: SchemaObject | undefined, rootSchema?: SchemaObject) => SchemaObject;
11
+ export declare const mergeAllOfSchemas: (schemas: SchemaObject | undefined, rootSchema?: SchemaObject, seenRefs?: Set<string>) => SchemaObject;
11
12
  //# sourceMappingURL=merge-all-of-schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"merge-all-of-schemas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,YAAY,GAAG,SAAS,EAAE,aAAa,YAAY,KAAG,YA+ChG,CAAA"}
1
+ {"version":3,"file":"merge-all-of-schemas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,YAAY,GAAG,SAAS,EACjC,aAAa,YAAY,EACzB,WAAU,GAAG,CAAC,MAAM,CAAa,KAChC,YA+CF,CAAA"}
@@ -9,9 +9,10 @@ import { objectKeys } from "@scalar/helpers/object/object-keys";
9
9
  *
10
10
  * @param schemas - Array of OpenAPI schema objects to merge
11
11
  * @param rootSchema - Optional root schema to merge with the result
12
+ * @param seenRefs - `$ref` strings already being merged higher in the call stack
12
13
  * @returns Merged schema object
13
14
  */
14
- var mergeAllOfSchemas = (schemas, rootSchema) => {
15
+ var mergeAllOfSchemas = (schemas, rootSchema, seenRefs = /* @__PURE__ */ new Set()) => {
15
16
  if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) return rootSchema || {};
16
17
  const result = {};
17
18
  const { allOf: _, ...baseSchema } = schemas;
@@ -19,14 +20,14 @@ var mergeAllOfSchemas = (schemas, rootSchema) => {
19
20
  if (!_schema || typeof _schema !== "object") continue;
20
21
  const schema = resolve.schema(_schema);
21
22
  if (schema.allOf) {
22
- mergeSchemaIntoResult(result, mergeAllOfSchemas(schema));
23
+ mergeSchemaIntoResult(result, mergeAllOfSchemas(schema, void 0, seenRefs), false, seenRefs);
23
24
  continue;
24
25
  }
25
- mergeSchemaIntoResult(result, schema);
26
+ mergeSchemaIntoResult(result, schema, false, seenRefs);
26
27
  }
27
- if (Object.keys(baseSchema).length > 0) mergeSchemaIntoResult(result, baseSchema, true);
28
- if (rootSchema && typeof rootSchema === "object") if (rootSchema.allOf) mergeSchemaIntoResult(result, mergeAllOfSchemas(rootSchema), true);
29
- else mergeSchemaIntoResult(result, rootSchema, true);
28
+ if (Object.keys(baseSchema).length > 0) mergeSchemaIntoResult(result, baseSchema, true, seenRefs);
29
+ if (rootSchema && typeof rootSchema === "object") if (rootSchema.allOf) mergeSchemaIntoResult(result, mergeAllOfSchemas(rootSchema, void 0, seenRefs), true, seenRefs);
30
+ else mergeSchemaIntoResult(result, rootSchema, true, seenRefs);
30
31
  return result;
31
32
  };
32
33
  /**
@@ -37,7 +38,7 @@ var mergeAllOfSchemas = (schemas, rootSchema) => {
37
38
  * @param schema - The source schema object to merge from
38
39
  * @param override - Whether to override existing properties (default: false)
39
40
  */
40
- var mergeSchemaIntoResult = (result, schema, override = false) => {
41
+ var mergeSchemaIntoResult = (result, schema, override = false, seenRefs = /* @__PURE__ */ new Set()) => {
41
42
  const schemaKeys = objectKeys(schema);
42
43
  if (schemaKeys.length === 0) return;
43
44
  for (const key of schemaKeys) {
@@ -49,7 +50,7 @@ var mergeSchemaIntoResult = (result, schema, override = false) => {
49
50
  } else if (key === "properties") {
50
51
  if (value && typeof value === "object") {
51
52
  if (!result.properties) result.properties = {};
52
- mergePropertiesIntoResult(result.properties, value);
53
+ mergePropertiesIntoResult(result.properties, value, seenRefs);
53
54
  }
54
55
  } else if (key === "items") {
55
56
  const items = resolve.schema(value);
@@ -57,14 +58,14 @@ var mergeSchemaIntoResult = (result, schema, override = false) => {
57
58
  if (isArraySchema(schema)) {
58
59
  if (!result.items) result.items = {};
59
60
  if (items.allOf) {
60
- const mergedItems = mergeAllOfSchemas(items);
61
+ const mergedItems = mergeAllOfSchemas(items, void 0, seenRefs);
61
62
  Object.assign(result.items, mergedItems);
62
- } else mergeItemsIntoResult(getResolvedRef(result.items), items);
63
+ } else mergeItemsIntoResult(getResolvedRef(result.items), items, seenRefs);
63
64
  } else if (items.allOf) {
64
- const mergedItems = mergeAllOfSchemas(items);
65
+ const mergedItems = mergeAllOfSchemas(items, void 0, seenRefs);
65
66
  if ("properties" in mergedItems) {
66
67
  if (!("properties" in result)) result.properties = {};
67
- "properties" in result && mergePropertiesIntoResult(result.properties, mergedItems.properties);
68
+ "properties" in result && mergePropertiesIntoResult(result.properties, mergedItems.properties, seenRefs);
68
69
  }
69
70
  } else if (!("items" in result)) result.items = items;
70
71
  }
@@ -75,7 +76,7 @@ var mergeSchemaIntoResult = (result, schema, override = false) => {
75
76
  if (!("properties" in result)) result.properties = {};
76
77
  for (const _option of value) {
77
78
  const option = resolve.schema(_option);
78
- if (option && "properties" in option && "properties" in result) mergePropertiesIntoResult(result.properties, option.properties);
79
+ if (option && "properties" in option && "properties" in result) mergePropertiesIntoResult(result.properties, option.properties, seenRefs);
79
80
  }
80
81
  }
81
82
  } else if (key === "allOf") continue;
@@ -85,7 +86,7 @@ var mergeSchemaIntoResult = (result, schema, override = false) => {
85
86
  /**
86
87
  * Efficiently merges properties into a result object without creating new objects.
87
88
  */
88
- var mergePropertiesIntoResult = (result, properties) => {
89
+ var mergePropertiesIntoResult = (result, properties, seenRefs = /* @__PURE__ */ new Set()) => {
89
90
  const propertyKeys = Object.keys(properties ?? {});
90
91
  if (!properties || !result || propertyKeys.length === 0) return;
91
92
  for (const key of propertyKeys) {
@@ -99,22 +100,28 @@ var mergePropertiesIntoResult = (result, properties) => {
99
100
  continue;
100
101
  }
101
102
  if (!result[key]) {
102
- if (schema.allOf) result[key] = mergeAllOfSchemas(schema);
103
+ if (schema.allOf) result[key] = mergeAllOfSchemas(schema, void 0, seenRefs);
103
104
  else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) result[key] = {
104
105
  ...schema,
105
- items: mergeAllOfSchemas(resolve.schema(schema.items))
106
+ items: mergeAllOfSchemas(resolve.schema(schema.items), void 0, seenRefs)
106
107
  };
107
108
  else if (properties[key]) result[key] = properties[key];
108
109
  continue;
109
110
  }
110
111
  const existing = resolve.schema(result[key]);
111
- if (schema.allOf) result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] });
112
+ const schemaRef = schema.$ref;
113
+ if (typeof schemaRef === "string" && seenRefs.has(schemaRef)) {
114
+ result[key] = existing;
115
+ continue;
116
+ }
117
+ const nextSeenRefs = typeof schemaRef === "string" ? new Set(seenRefs).add(schemaRef) : seenRefs;
118
+ if (schema.allOf) result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] }, void 0, nextSeenRefs);
112
119
  else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {
113
120
  const existingItems = resolve.schema(existing.items);
114
121
  result[key] = {
115
122
  ...existing,
116
123
  type: "array",
117
- items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items)) : resolve.schema(schema.items)
124
+ items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items), nextSeenRefs) : resolve.schema(schema.items)
118
125
  };
119
126
  } else if ("properties" in existing && "properties" in schema) {
120
127
  const merged = {
@@ -122,7 +129,7 @@ var mergePropertiesIntoResult = (result, properties) => {
122
129
  ...schema
123
130
  };
124
131
  merged.properties = { ...existing.properties };
125
- mergePropertiesIntoResult(merged.properties, schema.properties);
132
+ mergePropertiesIntoResult(merged.properties, schema.properties, nextSeenRefs);
126
133
  result[key] = merged;
127
134
  } else result[key] = {
128
135
  ...schema,
@@ -133,31 +140,39 @@ var mergePropertiesIntoResult = (result, properties) => {
133
140
  /**
134
141
  * Efficiently merges array items into a result object.
135
142
  */
136
- var mergeItemsIntoResult = (result, items) => {
143
+ var mergeItemsIntoResult = (result, items, seenRefs = /* @__PURE__ */ new Set()) => {
137
144
  if (items.allOf || result.allOf) {
138
145
  const allOfSchemas = [];
139
146
  if (result.allOf) for (const schema of result.allOf) allOfSchemas.push(resolve.schema(schema));
140
147
  else allOfSchemas.push(result);
141
148
  if (items.allOf) for (const schema of items.allOf) allOfSchemas.push(resolve.schema(schema));
142
149
  else allOfSchemas.push(items);
143
- const merged = mergeAllOfSchemas({ allOf: allOfSchemas });
150
+ const merged = mergeAllOfSchemas({ allOf: allOfSchemas }, void 0, seenRefs);
144
151
  Object.assign(result, merged);
145
152
  return;
146
153
  }
147
154
  Object.assign(result, items);
148
- if ("properties" in result && "properties" in items) mergePropertiesIntoResult(result.properties, items.properties);
155
+ if ("properties" in result && "properties" in items) mergePropertiesIntoResult(result.properties, items.properties, seenRefs);
149
156
  };
150
157
  /**
151
158
  * Helper function for merging items that returns a new object.
152
159
  */
153
- var mergeItems = (existing, incoming) => {
160
+ var mergeItems = (existing, incoming, seenRefs = /* @__PURE__ */ new Set()) => {
161
+ const incomingRef = incoming.$ref;
162
+ if (typeof incomingRef === "string") {
163
+ if (seenRefs.has(incomingRef)) return existing;
164
+ return mergeItemsInner(existing, incoming, new Set(seenRefs).add(incomingRef));
165
+ }
166
+ return mergeItemsInner(existing, incoming, seenRefs);
167
+ };
168
+ var mergeItemsInner = (existing, incoming, seenRefs = /* @__PURE__ */ new Set()) => {
154
169
  if (existing.allOf || incoming.allOf) {
155
170
  const allOfSchemas = [];
156
171
  if (existing.allOf) for (const schema of existing.allOf) allOfSchemas.push(resolve.schema(schema));
157
172
  else allOfSchemas.push(existing);
158
173
  if (incoming.allOf) for (const schema of incoming.allOf) allOfSchemas.push(resolve.schema(schema));
159
174
  else allOfSchemas.push(incoming);
160
- return mergeAllOfSchemas({ allOf: allOfSchemas });
175
+ return mergeAllOfSchemas({ allOf: allOfSchemas }, void 0, seenRefs);
161
176
  }
162
177
  const merged = {
163
178
  ...existing,
@@ -165,7 +180,7 @@ var mergeItems = (existing, incoming) => {
165
180
  };
166
181
  if ("properties" in existing && "properties" in incoming) {
167
182
  merged.properties = { ...existing.properties };
168
- mergePropertiesIntoResult(merged.properties, incoming.properties);
183
+ mergePropertiesIntoResult(merged.properties, incoming.properties, seenRefs);
169
184
  }
170
185
  return merged;
171
186
  };
@@ -1 +1 @@
1
- {"version":3,"file":"merge-all-of-schemas.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Merges multiple OpenAPI schema objects into a single schema object.\n * Handles nested allOf compositions and merges properties recursively.\n *\n * @param schemas - Array of OpenAPI schema objects to merge\n * @param rootSchema - Optional root schema to merge with the result\n * @returns Merged schema object\n */\nexport const mergeAllOfSchemas = (schemas: SchemaObject | undefined, rootSchema?: SchemaObject): SchemaObject => {\n // Handle max depth, empty or invalid input\n if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) {\n return rootSchema || ({} as SchemaObject)\n }\n\n // Initialize result object once\n const result = {} as SchemaObject\n\n // Extract base schema properties (everything except allOf)\n const { allOf: _, ...baseSchema } = schemas\n\n // Process allOf schemas first\n for (const _schema of schemas.allOf) {\n if (!_schema || typeof _schema !== 'object') {\n continue\n }\n\n // Resolve ref if present\n const schema = resolve.schema(_schema)\n\n // Handle nested allOf recursively\n if (schema.allOf) {\n const nestedMerged = mergeAllOfSchemas(schema)\n mergeSchemaIntoResult(result, nestedMerged)\n continue\n }\n\n mergeSchemaIntoResult(result, schema)\n }\n\n // Apply base schema properties with precedence over allOf properties\n if (Object.keys(baseSchema).length > 0) {\n mergeSchemaIntoResult(result, baseSchema, true)\n }\n\n // Process root schema last if provided\n if (rootSchema && typeof rootSchema === 'object') {\n if (rootSchema.allOf) {\n const nestedMerged = mergeAllOfSchemas(rootSchema)\n mergeSchemaIntoResult(result, nestedMerged, true)\n } else {\n mergeSchemaIntoResult(result, rootSchema, true)\n }\n }\n\n return result\n}\n\n/**\n * Efficiently merges a source schema into a target result object.\n * Handles all schema merging logic in a single optimized function.\n *\n * @param result - The target schema object to merge into\n * @param schema - The source schema object to merge from\n * @param override - Whether to override existing properties (default: false)\n */\nconst mergeSchemaIntoResult = (result: SchemaObject, schema: SchemaObject, override: boolean = false): void => {\n // Early return if schema is empty\n const schemaKeys = objectKeys(schema)\n if (schemaKeys.length === 0) {\n return\n }\n\n // Loop through all schema properties and handle them appropriately\n for (const key of schemaKeys) {\n const value = getResolvedRef(schema[key]) as any\n\n if (value === undefined) {\n continue\n }\n\n // Required\n if ((key as string) === 'required') {\n // Merge required fields with deduplication\n if (Array.isArray(value) && value.length > 0) {\n // @ts-expect-error\n if (result.required?.length) {\n // @ts-expect-error\n result.required = [...new Set([...result.required, ...value])]\n } else {\n // @ts-expect-error\n result.required = value.slice()\n }\n }\n }\n // Properties\n else if ((key as string) === 'properties') {\n // Merge properties recursively\n if (value && typeof value === 'object') {\n // @ts-expect-error\n if (!result.properties) {\n // @ts-expect-error\n result.properties = {}\n }\n\n // @ts-expect-error\n mergePropertiesIntoResult(result.properties, value)\n }\n }\n // Items\n else if ((key as string) === 'items') {\n // Handle items (for both arrays and objects with items)\n const items = resolve.schema(value)\n if (items) {\n if (isArraySchema(schema)) {\n // @ts-expect-error\n if (!result.items) {\n // @ts-expect-error\n result.items = {}\n }\n\n // Handle allOf within array items\n if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items)\n // @ts-expect-error\n Object.assign(result.items, mergedItems)\n } else {\n // @ts-expect-error\n mergeItemsIntoResult(getResolvedRef(result.items), items)\n }\n }\n // For non-array types with items.allOf, merge into properties\n else if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items)\n if ('properties' in mergedItems) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n\n 'properties' in result && mergePropertiesIntoResult(result.properties, mergedItems.properties)\n }\n }\n // For non-array types without allOf, still set items if not already set\n else if (!('items' in result)) {\n // @ts-expect-error\n result.items = items\n }\n }\n }\n // Enum\n else if (key === 'enum') {\n if (Array.isArray(value) && value.length > 0) {\n result.enum = [...new Set([...(result.enum || []), ...value])]\n }\n }\n // OneOf/AnyOf\n else if (key === 'oneOf' || key === 'anyOf') {\n // Merge oneOf/anyOf subschema\n if (Array.isArray(value)) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n for (const _option of value) {\n const option = resolve.schema(_option)\n if (option && 'properties' in option && 'properties' in result) {\n mergePropertiesIntoResult(result.properties, option.properties)\n }\n }\n }\n }\n // Skip allOf as it's handled at a higher level\n else if (key === 'allOf') {\n continue\n }\n // For all other properties, preserve the first occurrence or override if specified\n else {\n if (override || result[key] === undefined) {\n result[key] = value\n }\n }\n }\n}\n\n/**\n * Efficiently merges properties into a result object without creating new objects.\n */\nconst mergePropertiesIntoResult = (\n result: Extract<SchemaObject, { type: 'object' }>['properties'],\n properties: Extract<SchemaObject, { type: 'object' }>['properties'],\n): void => {\n const propertyKeys = Object.keys(properties ?? {})\n if (!properties || !result || propertyKeys.length === 0) {\n return\n }\n\n for (const key of propertyKeys) {\n const schema = resolve.schema(properties[key])\n if (!schema) {\n delete result[key]\n continue\n }\n\n if (typeof schema !== 'object') {\n result[key] = schema\n continue\n }\n\n if (!result[key]) {\n // Handle new property with allOf\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas(schema)\n } else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) {\n result[key] = {\n ...schema,\n items: mergeAllOfSchemas(resolve.schema(schema.items)),\n }\n } else if (properties[key]) {\n result[key] = properties[key]\n }\n continue\n }\n\n // Merge existing property\n const existing = resolve.schema(result[key])\n\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] } as SchemaObject)\n } else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {\n const existingItems = resolve.schema(existing.items)\n result[key] = {\n ...existing,\n type: 'array',\n items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items)) : resolve.schema(schema.items),\n }\n } else {\n // Create merged object with properties handled separately\n if ('properties' in existing && 'properties' in schema) {\n const merged = { ...existing, ...schema }\n merged.properties = { ...existing.properties }\n mergePropertiesIntoResult(merged.properties, schema.properties)\n result[key] = merged\n }\n // Simple merge without property recursion\n else {\n result[key] = { ...schema, ...existing }\n }\n }\n }\n}\n\n/**\n * Efficiently merges array items into a result object.\n */\nconst mergeItemsIntoResult = (result: SchemaObject, items: SchemaObject): void => {\n // Handle allOf in items\n if (items.allOf || result.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (result.allOf) {\n for (const schema of result.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(result)\n }\n\n if (items.allOf) {\n for (const schema of items.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(items)\n }\n\n const merged = mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject)\n Object.assign(result, merged)\n return\n }\n\n // Regular merge\n Object.assign(result, items)\n\n // Merge properties if both have them\n if ('properties' in result && 'properties' in items) {\n mergePropertiesIntoResult(result.properties, items.properties)\n }\n}\n\n/**\n * Helper function for merging items that returns a new object.\n */\nconst mergeItems = (existing: SchemaObject, incoming: SchemaObject): SchemaObject => {\n // Handle allOf in either schema\n if (existing.allOf || incoming.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (existing.allOf) {\n for (const schema of existing.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(existing)\n }\n\n if (incoming.allOf) {\n for (const schema of incoming.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(incoming)\n }\n\n return mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject)\n }\n\n const merged = { ...existing, ...incoming }\n\n // Recursively merge properties if both have properties\n if ('properties' in existing && 'properties' in incoming) {\n // @ts-expect-error\n merged.properties = { ...existing.properties }\n // @ts-expect-error\n mergePropertiesIntoResult(merged.properties, incoming.properties)\n }\n\n return merged as SchemaObject\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,qBAAqB,SAAmC,eAA4C;AAE/G,KAAI,CAAC,SAAS,OAAO,UAAU,CAAC,MAAM,QAAQ,QAAQ,MAAM,CAC1D,QAAO,cAAe,EAAE;CAI1B,MAAM,SAAS,EAAE;CAGjB,MAAM,EAAE,OAAO,GAAG,GAAG,eAAe;AAGpC,MAAK,MAAM,WAAW,QAAQ,OAAO;AACnC,MAAI,CAAC,WAAW,OAAO,YAAY,SACjC;EAIF,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAGtC,MAAI,OAAO,OAAO;AAEhB,yBAAsB,QADD,kBAAkB,OAAO,CACH;AAC3C;;AAGF,wBAAsB,QAAQ,OAAO;;AAIvC,KAAI,OAAO,KAAK,WAAW,CAAC,SAAS,EACnC,uBAAsB,QAAQ,YAAY,KAAK;AAIjD,KAAI,cAAc,OAAO,eAAe,SACtC,KAAI,WAAW,MAEb,uBAAsB,QADD,kBAAkB,WAAW,EACN,KAAK;KAEjD,uBAAsB,QAAQ,YAAY,KAAK;AAInD,QAAO;;;;;;;;;;AAWT,IAAM,yBAAyB,QAAsB,QAAsB,WAAoB,UAAgB;CAE7G,MAAM,aAAa,WAAW,OAAO;AACrC,KAAI,WAAW,WAAW,EACxB;AAIF,MAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,eAAe,OAAO,KAAK;AAEzC,MAAI,UAAU,KAAA,EACZ;AAIF,MAAK,QAAmB;OAElB,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,EAEzC,KAAI,OAAO,UAAU,OAEnB,QAAO,WAAW,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,OAAO,UAAU,GAAG,MAAM,CAAC,CAAC;OAG9D,QAAO,WAAW,MAAM,OAAO;aAK3B,Q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,MAAM,UAAU,OAAO,MAC1B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,OAAO;AAG3B,MAAI,MAAM,MACR,MAAK,MAAM,UAAU,MAAM,MACzB,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,MAAM;EAG1B,MAAM,SAAS,kBAAkB,EAAE,OAAO,cAAc,CAAiB;AACzE,SAAO,OAAO,QAAQ,OAAO;AAC7B;;AAIF,QAAO,OAAO,QAAQ,MAAM;AAG5B,KAAI,gBAAgB,UAAU,gBAAgB,MAC5C,2BAA0B,OAAO,YAAY,MAAM,WAAW;;;;;AAOlE,IAAM,cAAc,UAAwB,aAAyC;AAEnF,KAAI,SAAS,SAAS,SAAS,OAAO;EAEpC,MAAM,eAA+B,EAAE;AAEvC,MAAI,SAAS,MACX,MAAK,MAAM,UAAU,SAAS,MAC5B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,SAAS;AAG7B,MAAI,SAAS,MACX,MAAK,MAAM,UAAU,SAAS,MAC5B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,SAAS;AAG7B,SAAO,kBAAkB,EAAE,OAAO,cAAc,CAAiB;;CAGnE,MAAM,SAAS;EAAE,GAAG;EAAU,GAAG;EAAU;AAG3C,KAAI,gBAAgB,YAAY,gBAAgB,UAAU;AAExD,SAAO,aAAa,EAAE,GAAG,SAAS,YAAY;AAE9C,4BAA0B,OAAO,YAAY,SAAS,WAAW;;AAGnE,QAAO"}
1
+ {"version":3,"file":"merge-all-of-schemas.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Merges multiple OpenAPI schema objects into a single schema object.\n * Handles nested allOf compositions and merges properties recursively.\n *\n * @param schemas - Array of OpenAPI schema objects to merge\n * @param rootSchema - Optional root schema to merge with the result\n * @param seenRefs - `$ref` strings already being merged higher in the call stack\n * @returns Merged schema object\n */\nexport const mergeAllOfSchemas = (\n schemas: SchemaObject | undefined,\n rootSchema?: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n // Handle max depth, empty or invalid input\n if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) {\n return rootSchema || ({} as SchemaObject)\n }\n\n // Initialize result object once\n const result = {} as SchemaObject\n\n // Extract base schema properties (everything except allOf)\n const { allOf: _, ...baseSchema } = schemas\n\n // Process allOf schemas first\n for (const _schema of schemas.allOf) {\n if (!_schema || typeof _schema !== 'object') {\n continue\n }\n\n // Resolve ref if present\n const schema = resolve.schema(_schema)\n\n // Handle nested allOf recursively\n if (schema.allOf) {\n const nestedMerged = mergeAllOfSchemas(schema, undefined, seenRefs)\n mergeSchemaIntoResult(result, nestedMerged, false, seenRefs)\n continue\n }\n\n mergeSchemaIntoResult(result, schema, false, seenRefs)\n }\n\n // Apply base schema properties with precedence over allOf properties\n if (Object.keys(baseSchema).length > 0) {\n mergeSchemaIntoResult(result, baseSchema, true, seenRefs)\n }\n\n // Process root schema last if provided\n if (rootSchema && typeof rootSchema === 'object') {\n if (rootSchema.allOf) {\n const nestedMerged = mergeAllOfSchemas(rootSchema, undefined, seenRefs)\n mergeSchemaIntoResult(result, nestedMerged, true, seenRefs)\n } else {\n mergeSchemaIntoResult(result, rootSchema, true, seenRefs)\n }\n }\n\n return result\n}\n\n/**\n * Efficiently merges a source schema into a target result object.\n * Handles all schema merging logic in a single optimized function.\n *\n * @param result - The target schema object to merge into\n * @param schema - The source schema object to merge from\n * @param override - Whether to override existing properties (default: false)\n */\nconst mergeSchemaIntoResult = (\n result: SchemaObject,\n schema: SchemaObject,\n override: boolean = false,\n seenRefs: Set<string> = new Set(),\n): void => {\n // Early return if schema is empty\n const schemaKeys = objectKeys(schema)\n if (schemaKeys.length === 0) {\n return\n }\n\n // Loop through all schema properties and handle them appropriately\n for (const key of schemaKeys) {\n const value = getResolvedRef(schema[key]) as any\n\n if (value === undefined) {\n continue\n }\n\n // Required\n if ((key as string) === 'required') {\n // Merge required fields with deduplication\n if (Array.isArray(value) && value.length > 0) {\n // @ts-expect-error\n if (result.required?.length) {\n // @ts-expect-error\n result.required = [...new Set([...result.required, ...value])]\n } else {\n // @ts-expect-error\n result.required = value.slice()\n }\n }\n }\n // Properties\n else if ((key as string) === 'properties') {\n // Merge properties recursively\n if (value && typeof value === 'object') {\n // @ts-expect-error\n if (!result.properties) {\n // @ts-expect-error\n result.properties = {}\n }\n\n // @ts-expect-error\n mergePropertiesIntoResult(result.properties, value, seenRefs)\n }\n }\n // Items\n else if ((key as string) === 'items') {\n // Handle items (for both arrays and objects with items)\n const items = resolve.schema(value)\n if (items) {\n if (isArraySchema(schema)) {\n // @ts-expect-error\n if (!result.items) {\n // @ts-expect-error\n result.items = {}\n }\n\n // Handle allOf within array items\n if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items, undefined, seenRefs)\n // @ts-expect-error\n Object.assign(result.items, mergedItems)\n } else {\n // @ts-expect-error\n mergeItemsIntoResult(getResolvedRef(result.items), items, seenRefs)\n }\n }\n // For non-array types with items.allOf, merge into properties\n else if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items, undefined, seenRefs)\n if ('properties' in mergedItems) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n\n 'properties' in result && mergePropertiesIntoResult(result.properties, mergedItems.properties, seenRefs)\n }\n }\n // For non-array types without allOf, still set items if not already set\n else if (!('items' in result)) {\n // @ts-expect-error\n result.items = items\n }\n }\n }\n // Enum\n else if (key === 'enum') {\n if (Array.isArray(value) && value.length > 0) {\n result.enum = [...new Set([...(result.enum || []), ...value])]\n }\n }\n // OneOf/AnyOf\n else if (key === 'oneOf' || key === 'anyOf') {\n // Merge oneOf/anyOf subschema\n if (Array.isArray(value)) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n for (const _option of value) {\n const option = resolve.schema(_option)\n if (option && 'properties' in option && 'properties' in result) {\n mergePropertiesIntoResult(result.properties, option.properties, seenRefs)\n }\n }\n }\n }\n // Skip allOf as it's handled at a higher level\n else if (key === 'allOf') {\n continue\n }\n // For all other properties, preserve the first occurrence or override if specified\n else {\n if (override || result[key] === undefined) {\n result[key] = value\n }\n }\n }\n}\n\n/**\n * Efficiently merges properties into a result object without creating new objects.\n */\nconst mergePropertiesIntoResult = (\n result: Extract<SchemaObject, { type: 'object' }>['properties'],\n properties: Extract<SchemaObject, { type: 'object' }>['properties'],\n seenRefs: Set<string> = new Set(),\n): void => {\n const propertyKeys = Object.keys(properties ?? {})\n if (!properties || !result || propertyKeys.length === 0) {\n return\n }\n\n for (const key of propertyKeys) {\n const schema = resolve.schema(properties[key])\n if (!schema) {\n delete result[key]\n continue\n }\n\n if (typeof schema !== 'object') {\n result[key] = schema\n continue\n }\n\n if (!result[key]) {\n // Handle new property with allOf\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas(schema, undefined, seenRefs)\n } else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) {\n result[key] = {\n ...schema,\n items: mergeAllOfSchemas(resolve.schema(schema.items), undefined, seenRefs),\n }\n } else if (properties[key]) {\n result[key] = properties[key]\n }\n continue\n }\n\n // Merge existing property\n const existing = resolve.schema(result[key])\n\n // Break self-referential cycles: when this property's `$ref` is already\n // being merged higher in the call stack, keep the partially merged existing\n // schema instead of recursing into it again. This mirrors the guard in\n // `mergeItems` and covers schemas that point back at themselves through a\n // plain object property (e.g. a tree node whose `parent` $refs the node).\n const schemaRef = (schema as { $ref?: string }).$ref\n if (typeof schemaRef === 'string' && seenRefs.has(schemaRef)) {\n result[key] = existing\n continue\n }\n const nextSeenRefs = typeof schemaRef === 'string' ? new Set(seenRefs).add(schemaRef) : seenRefs\n\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] } as SchemaObject, undefined, nextSeenRefs)\n } else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {\n const existingItems = resolve.schema(existing.items)\n result[key] = {\n ...existing,\n type: 'array',\n items: existingItems\n ? mergeItems(existingItems, resolve.schema(schema.items), nextSeenRefs)\n : resolve.schema(schema.items),\n }\n } else {\n // Create merged object with properties handled separately\n if ('properties' in existing && 'properties' in schema) {\n const merged = { ...existing, ...schema }\n merged.properties = { ...existing.properties }\n mergePropertiesIntoResult(merged.properties, schema.properties, nextSeenRefs)\n result[key] = merged\n }\n // Simple merge without property recursion\n else {\n result[key] = { ...schema, ...existing }\n }\n }\n }\n}\n\n/**\n * Efficiently merges array items into a result object.\n */\nconst mergeItemsIntoResult = (result: SchemaObject, items: SchemaObject, seenRefs: Set<string> = new Set()): void => {\n // Handle allOf in items\n if (items.allOf || result.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (result.allOf) {\n for (const schema of result.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(result)\n }\n\n if (items.allOf) {\n for (const schema of items.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(items)\n }\n\n const merged = mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject, undefined, seenRefs)\n Object.assign(result, merged)\n return\n }\n\n // Regular merge\n Object.assign(result, items)\n\n // Merge properties if both have them\n if ('properties' in result && 'properties' in items) {\n mergePropertiesIntoResult(result.properties, items.properties, seenRefs)\n }\n}\n\n/**\n * Helper function for merging items that returns a new object.\n */\nconst mergeItems = (\n existing: SchemaObject,\n incoming: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n const incomingRef = (incoming as { $ref?: string }).$ref\n\n if (typeof incomingRef === 'string') {\n if (seenRefs.has(incomingRef)) {\n return existing\n }\n return mergeItemsInner(existing, incoming, new Set(seenRefs).add(incomingRef))\n }\n\n return mergeItemsInner(existing, incoming, seenRefs)\n}\n\nconst mergeItemsInner = (\n existing: SchemaObject,\n incoming: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n // Handle allOf in either schema\n if (existing.allOf || incoming.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (existing.allOf) {\n for (const schema of existing.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(existing)\n }\n\n if (incoming.allOf) {\n for (const schema of incoming.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(incoming)\n }\n\n return mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject, undefined, seenRefs)\n }\n\n const merged = { ...existing, ...incoming }\n\n // Recursively merge properties if both have properties\n if ('properties' in existing && 'properties' in incoming) {\n // @ts-expect-error\n merged.properties = { ...existing.properties }\n // @ts-expect-error\n mergePropertiesIntoResult(merged.properties, incoming.properties, seenRefs)\n }\n\n return merged as SchemaObject\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,IAAa,qBACX,SACA,YACA,2BAAwB,IAAI,KAAK,KAChB;AAEjB,KAAI,CAAC,SAAS,OAAO,UAAU,CAAC,MAAM,QAAQ,QAAQ,MAAM,CAC1D,QAAO,cAAe,EAAE;CAI1B,MAAM,SAAS,EAAE;CAGjB,MAAM,EAAE,OAAO,GAAG,GAAG,eAAe;AAGpC,MAAK,MAAM,WAAW,QAAQ,OAAO;AACnC,MAAI,CAAC,WAAW,OAAO,YAAY,SACjC;EAIF,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAGtC,MAAI,OAAO,OAAO;AAEhB,yBAAsB,QADD,kBAAkB,QAAQ,KAAA,GAAW,SAAS,EACvB,OAAO,SAAS;AAC5D;;AAGF,wBAAsB,Q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./ClassicHeader.vue.js";
2
2
  import SectionContainer_default from "./Section/SectionContainer.vue.js";
3
- import Auth_default from "./Content/Auth/Auth.vue.js";
4
3
  import SchemaHeading_default from "./Content/Schema/SchemaHeading.vue.js";
5
4
  import SchemaProperty_default from "./Content/Schema/SchemaProperty.vue.js";
6
5
  import Schema_default from "./Content/Schema/Schema.vue.js";
@@ -11,6 +10,7 @@ import HttpMethod_default from "./HttpMethod/HttpMethod.vue.js";
11
10
  import OperationsList_default from "./OperationsList/OperationsList.vue.js";
12
11
  import Tag_default from "./Content/Tags/Tag.vue.js";
13
12
  import Lazy_default from "./Lazy/Lazy.vue.js";
13
+ import Auth_default from "./Content/Auth/Auth.vue.js";
14
14
  import TraversedEntry_default from "./Content/Operations/TraversedEntry.vue.js";
15
15
  import RenderPlugins_default from "./RenderPlugins/RenderPlugins.vue.js";
16
16
  import SectionFlare_default from "./SectionFlare/SectionFlare.vue.js";
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import ParameterListItem_vue_vue_type_script_setup_true_lang_default from "./ParameterListItem.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/features/Operation/components/ParameterListItem.vue
5
- var ParameterListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ParameterListItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d8e5b2a3"]]);
5
+ var ParameterListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ParameterListItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ca54f4ef"]]);
6
6
  //#endregion
7
7
  export { ParameterListItem_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterListItem.vue.js","names":[],"sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport {\n ScalarMarkdown,\n ScalarMarkdownSummary,\n} from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n ParameterObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nimport { getRefName } from '@/components/Content/Schema/helpers/get-ref-name'\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\nimport Headers from './Headers.vue'\nimport { getParameterExamples } from './helpers/get-parameter-examples'\n\nconst { name, parameter, options, collapsableItems } = defineProps<{\n parameter: ParameterObject | ResponseObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n collapsableItems?: boolean\n options: Pick<\n OperationProps['options'],\n 'hideModels' | 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy'\n >\n}>()\n\n/** Whether the markdown summary is being truncated */\nconst truncated = ref(false)\n\n/** Responses and params may both have a schema */\nconst schema = computed<SchemaObject | null>(() =>\n 'schema' in parameter && parameter.schema\n ? getResolvedRef(parameter.schema)\n : null,\n)\n\n/** Response and params may both have content */\nconst content = computed(() => {\n if (!('content' in parameter) || !parameter.content) {\n return null\n }\n const keys = Object.keys(parameter.content)\n if (keys.length === 0) {\n return null\n }\n return parameter.content\n})\n\nconst selectedContentType = ref<string>(\n Object.keys(content.value || {})[0] ?? '',\n)\n\n/** Response headers */\nconst headers = computed<ResponseObject['headers'] | null>(() =>\n 'headers' in parameter && parameter.headers ? parameter.headers : null,\n)\n\n/** Raw schema (possibly with $ref) for the selected content type or param. */\nconst baseSchema = computed(() =>\n content.value\n ? content.value?.[selectedContentType.value]?.schema\n : 'schema' in parameter && parameter.schema\n ? parameter.schema\n : null,\n)\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst schemaModelName = computed(() => {\n const raw = baseSchema.value\n if (!raw) {\n return null\n }\n\n if ('$ref' in raw) {\n return getRefName(raw.$ref)\n }\n\n return null\n})\n\n/** Computed value from the combined schema param and content param */\nconst value = computed(() => {\n const base = baseSchema.value\n const resolvedBase = content.value ? getResolvedRef(base) : schema.value\n\n const deprecated =\n 'deprecated' in parameter ? parameter.deprecated : schema.value?.deprecated\n\n /** Combine param/content/schema examples while ignoring undefined values. */\n const examples = getParameterExamples({\n parameter,\n schemaExamples: schema.value?.examples,\n contentExamples: content.value?.[selectedContentType.value]?.examples,\n })\n\n return {\n ...resolvedBase,\n deprecated: deprecated,\n examples,\n } as SchemaObject\n})\n\n/**\n * Determines whether this parameter item should be rendered as a collapsible disclosure.\n * Only collapses when collapsableItems is enabled and the parameter has additional\n * content to display (content types, headers, or schema details).\n */\nconst shouldCollapse = computed<boolean>(() =>\n Boolean(content.value || headers.value || schema.value || truncated.value),\n)\n</script>\n<template>\n <li class=\"parameter-item group/parameter-item\">\n <Disclosure v-slot=\"{ open }\">\n <component\n :is=\"shouldCollapse ? DisclosureButton : 'div'\"\n v-if=\"collapsableItems\"\n class=\"parameter-item-trigger\"\n :class=\"{ 'parameter-item-trigger-open': open }\">\n <div class=\"parameter-item-name min-w-0\">\n <ScalarIconCaretRight\n v-if=\"shouldCollapse\"\n class=\"parameter-item-icon size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': open }\"\n weight=\"bold\" />\n <div>\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </div>\n </div>\n <ScalarMarkdownSummary\n v-if=\"!open && parameter.description\"\n v-model:truncated=\"truncated\"\n class=\"parameter-item-description-summary min-w-0 flex-1\"\n controlled\n :value=\"parameter.description\" />\n <div\n v-else\n class=\"flex-1\" />\n </component>\n <div\n v-if=\"shouldCollapse && content\"\n class=\"absolute top-[calc(10px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center text-base\"\n :class=\"{\n 'opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100':\n !open,\n }\">\n <div\n class=\"from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent\" />\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"content\" />\n </div>\n <DisclosurePanel\n class=\"parameter-item-container parameter-item-container-markdown\"\n :static=\"!collapsableItems\">\n <ScalarMarkdown\n v-if=\"collapsableItems && parameter.description\"\n class=\"parameter-item-description\"\n :value=\"parameter.description\" />\n <!-- Headers -->\n <Headers\n v-if=\"headers\"\n :breadcrumb=\"breadcrumb\"\n :eventBus=\"eventBus\"\n :headers=\"headers\"\n :orderRequiredPropertiesFirst=\"options.orderRequiredPropertiesFirst\"\n :orderSchemaPropertiesBy=\"options.orderSchemaPropertiesBy\" />\n\n <!-- Schema -->\n <SchemaProperty\n is=\"div\"\n :breadcrumb=\"breadcrumb\"\n compact\n :description=\"collapsableItems ? '' : parameter.description\"\n :eventBus=\"eventBus\"\n :hideWriteOnly=\"true\"\n :modelName=\"schemaModelName\"\n :name=\"collapsableItems ? '' : name\"\n :noncollapsible=\"true\"\n :options=\"{\n hideWriteOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :required=\"'required' in parameter && parameter.required\"\n :schema=\"value\" />\n </DisclosurePanel>\n </Disclosure>\n </li>\n</template>\n\n<style scoped>\n.parameter-item {\n display: flex;\n flex-direction: column;\n position: relative;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item:last-of-type .parameter-schema {\n padding-bottom: 0;\n}\n\n.parameter-item-container {\n padding: 0;\n}\n\n.parameter-item-headers {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item-name {\n position: relative;\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n overflow-wrap: break-word;\n}\n\n.parameter-item-description,\n.parameter-item-description-summary {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n}\n\n.parameter-item-description-summary.parameter-item-description-summary > * {\n --markdown-line-height: var(--scalar-line-height-5);\n}\n\n/* Match font size of markdown for property-detail-value since first child within accordian is displayed as if it were in the markdown section */\n.parameter-item-trigger\n ~ .parameter-item-container\n :deep(.property--level-0 > .property-heading .property-detail-value) {\n font-size: var(--scalar-micro);\n}\n\n.parameter-item-required-optional {\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n margin-right: 6px;\n position: relative;\n}\n\n.parameter-item--required {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-orange);\n}\n\n.parameter-item-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n line-height: 1.4;\n}\n\n.parameter-item-description :deep(p) {\n margin-top: 4px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n}\n\n.parameter-schema {\n padding-bottom: 9px;\n margin-top: 3px;\n}\n\n.parameter-item-trigger {\n display: flex;\n align-items: baseline;\n line-height: var(--scalar-line-height-5);\n gap: 6px;\n flex-wrap: wrap;\n padding: 10px 0;\n outline: none;\n}\n\n.parameter-item-trigger-open {\n padding-bottom: 0;\n}\n\n.parameter-item-icon {\n color: var(--scalar-color-3);\n left: -19px;\n top: 0.5lh;\n translate: 0 -50%;\n position: absolute;\n}\n\n.parameter-item-trigger:hover .parameter-item-icon,\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n color: var(--scalar-color-1);\n}\n\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n outline: 1px solid var(--scalar-color-accent);\n outline-offset: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ParameterListItem.vue.js","names":[],"sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport {\n ScalarMarkdown,\n ScalarMarkdownSummary,\n} from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n ParameterObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nimport { getRefName } from '@/components/Content/Schema/helpers/get-ref-name'\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\nimport Headers from './Headers.vue'\nimport { getParameterExamples } from './helpers/get-parameter-examples'\n\nconst { name, parameter, options, collapsableItems } = defineProps<{\n parameter: ParameterObject | ResponseObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n collapsableItems?: boolean\n options: Pick<\n OperationProps['options'],\n 'hideModels' | 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy'\n >\n}>()\n\n/** Whether the markdown summary is being truncated */\nconst truncated = ref(false)\n\n/** Responses and params may both have a schema */\nconst schema = computed<SchemaObject | null>(() =>\n 'schema' in parameter && parameter.schema\n ? getResolvedRef(parameter.schema)\n : null,\n)\n\n/** Response and params may both have content */\nconst content = computed(() => {\n if (!('content' in parameter) || !parameter.content) {\n return null\n }\n const keys = Object.keys(parameter.content)\n if (keys.length === 0) {\n return null\n }\n return parameter.content\n})\n\nconst selectedContentType = ref<string>(\n Object.keys(content.value || {})[0] ?? '',\n)\n\n/** Response headers */\nconst headers = computed<ResponseObject['headers'] | null>(() =>\n 'headers' in parameter && parameter.headers ? parameter.headers : null,\n)\n\n/** Raw schema (possibly with $ref) for the selected content type or param. */\nconst baseSchema = computed(() =>\n content.value\n ? content.value?.[selectedContentType.value]?.schema\n : 'schema' in parameter && parameter.schema\n ? parameter.schema\n : null,\n)\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst schemaModelName = computed(() => {\n const raw = baseSchema.value\n if (!raw) {\n return null\n }\n\n if ('$ref' in raw) {\n return getRefName(raw.$ref)\n }\n\n return null\n})\n\n/** Computed value from the combined schema param and content param */\nconst value = computed(() => {\n const base = baseSchema.value\n const resolvedBase = content.value ? getResolvedRef(base) : schema.value\n\n const deprecated =\n 'deprecated' in parameter ? parameter.deprecated : schema.value?.deprecated\n\n /** Combine param/content/schema examples while ignoring undefined values. */\n const examples = getParameterExamples({\n parameter,\n schemaExamples: schema.value?.examples,\n contentExamples: content.value?.[selectedContentType.value]?.examples,\n })\n\n return {\n ...resolvedBase,\n deprecated: deprecated,\n examples,\n } as SchemaObject\n})\n\n/**\n * Determines whether this parameter item should be rendered as a collapsible disclosure.\n * Only collapses when collapsableItems is enabled and the parameter has additional\n * content to display (content types, headers, or schema details).\n */\nconst shouldCollapse = computed<boolean>(() =>\n Boolean(content.value || headers.value || schema.value || truncated.value),\n)\n</script>\n<template>\n <li class=\"parameter-item group/parameter-item\">\n <Disclosure v-slot=\"{ open }\">\n <component\n :is=\"shouldCollapse ? DisclosureButton : 'div'\"\n v-if=\"collapsableItems\"\n class=\"parameter-item-trigger\"\n :class=\"{ 'parameter-item-trigger-open': open }\">\n <div class=\"parameter-item-name min-w-0\">\n <ScalarIconCaretRight\n v-if=\"shouldCollapse\"\n class=\"parameter-item-icon size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': open }\"\n weight=\"bold\" />\n <div>\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </div>\n </div>\n <ScalarMarkdownSummary\n v-if=\"!open && parameter.description\"\n v-model:truncated=\"truncated\"\n class=\"parameter-item-description-summary min-w-0 flex-1\"\n controlled\n :value=\"parameter.description\" />\n <div\n v-else\n class=\"flex-1\" />\n </component>\n <DisclosurePanel\n class=\"parameter-item-container parameter-item-container-markdown\"\n :static=\"!collapsableItems\">\n <ScalarMarkdown\n v-if=\"collapsableItems && parameter.description\"\n class=\"parameter-item-description\"\n :value=\"parameter.description\" />\n <!-- Headers -->\n <Headers\n v-if=\"headers\"\n :breadcrumb=\"breadcrumb\"\n :eventBus=\"eventBus\"\n :headers=\"headers\"\n :orderRequiredPropertiesFirst=\"options.orderRequiredPropertiesFirst\"\n :orderSchemaPropertiesBy=\"options.orderSchemaPropertiesBy\" />\n\n <!-- Schema -->\n <SchemaProperty\n is=\"div\"\n :breadcrumb=\"breadcrumb\"\n compact\n :description=\"collapsableItems ? '' : parameter.description\"\n :eventBus=\"eventBus\"\n :hideWriteOnly=\"true\"\n :modelName=\"schemaModelName\"\n :name=\"collapsableItems ? '' : name\"\n :noncollapsible=\"true\"\n :options=\"{\n hideWriteOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :required=\"'required' in parameter && parameter.required\"\n :schema=\"value\" />\n </DisclosurePanel>\n <div\n v-if=\"shouldCollapse && content\"\n class=\"absolute top-[calc(10px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center text-base\"\n :class=\"{\n 'opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100':\n !open,\n }\">\n <div\n class=\"from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent\" />\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"content\" />\n </div>\n </Disclosure>\n </li>\n</template>\n\n<style scoped>\n.parameter-item {\n display: flex;\n flex-direction: column;\n position: relative;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item:last-of-type .parameter-schema {\n padding-bottom: 0;\n}\n\n.parameter-item-container {\n padding: 0;\n}\n\n.parameter-item-headers {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item-name {\n position: relative;\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n overflow-wrap: break-word;\n}\n\n.parameter-item-description,\n.parameter-item-description-summary {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n}\n\n.parameter-item-description-summary.parameter-item-description-summary > * {\n --markdown-line-height: var(--scalar-line-height-5);\n}\n\n/* Match font size of markdown for property-detail-value since first child within accordian is displayed as if it were in the markdown section */\n.parameter-item-trigger\n ~ .parameter-item-container\n :deep(.property--level-0 > .property-heading .property-detail-value) {\n font-size: var(--scalar-micro);\n}\n\n.parameter-item-required-optional {\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n margin-right: 6px;\n position: relative;\n}\n\n.parameter-item--required {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-orange);\n}\n\n.parameter-item-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n line-height: 1.4;\n}\n\n.parameter-item-description :deep(p) {\n margin-top: 4px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n}\n\n.parameter-schema {\n padding-bottom: 9px;\n margin-top: 3px;\n}\n\n.parameter-item-trigger {\n display: flex;\n align-items: baseline;\n line-height: var(--scalar-line-height-5);\n gap: 6px;\n flex-wrap: wrap;\n padding: 10px 0;\n outline: none;\n}\n\n.parameter-item-trigger-open {\n padding-bottom: 0;\n}\n\n.parameter-item-icon {\n color: var(--scalar-color-3);\n left: -19px;\n top: 0.5lh;\n translate: 0 -50%;\n position: absolute;\n}\n\n.parameter-item-trigger:hover .parameter-item-icon,\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n color: var(--scalar-color-1);\n}\n\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n outline: 1px solid var(--scalar-color-accent);\n outline-offset: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":""}
@@ -96,14 +96,6 @@ var ParameterListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
96
96
  }, null, 8, ["truncated", "value"])) : (openBlock(), createElementBlock("div", _hoisted_3))]),
97
97
  _: 2
98
98
  }, 1032, ["class"])) : createCommentVNode("", true),
99
- shouldCollapse.value && content.value ? (openBlock(), createElementBlock("div", {
100
- key: 1,
101
- class: normalizeClass(["absolute top-[calc(10px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center text-base", { "opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100": !open }])
102
- }, [_cache[2] || (_cache[2] = createElementVNode("div", { class: "from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent" }, null, -1)), createVNode(ContentTypeSelect_default, {
103
- modelValue: selectedContentType.value,
104
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedContentType.value = $event),
105
- content: content.value
106
- }, null, 8, ["modelValue", "content"])], 2)) : createCommentVNode("", true),
107
99
  createVNode(unref(DisclosurePanel), {
108
100
  class: "parameter-item-container parameter-item-container-markdown",
109
101
  static: !__props.collapsableItems
@@ -157,7 +149,15 @@ var ParameterListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
157
149
  ])
158
150
  ]),
159
151
  _: 1
160
- }, 8, ["static"])
152
+ }, 8, ["static"]),
153
+ shouldCollapse.value && content.value ? (openBlock(), createElementBlock("div", {
154
+ key: 1,
155
+ class: normalizeClass(["absolute top-[calc(10px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center text-base", { "opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100": !open }])
156
+ }, [_cache[2] || (_cache[2] = createElementVNode("div", { class: "from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent" }, null, -1)), createVNode(ContentTypeSelect_default, {
157
+ modelValue: selectedContentType.value,
158
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedContentType.value = $event),
159
+ content: content.value
160
+ }, null, 8, ["modelValue", "content"])], 2)) : createCommentVNode("", true)
161
161
  ]),
162
162
  _: 1
163
163
  })]);