@redocly/openapi-docs 3.12.0 → 3.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/dist/redocly-openapi-docs.min.js +753 -750
  2. package/lib/components/ApiInfo/ApiInfo.js +29 -1
  3. package/lib/components/ApiInfo/Metadata.js +29 -1
  4. package/lib/components/ApiInfo/index.js +2 -1
  5. package/lib/components/ApiInfo/styled.js +16 -8
  6. package/lib/components/CallbackSamples/CallbackSamples.js +25 -4
  7. package/lib/components/CallbackSamples/index.js +2 -1
  8. package/lib/components/Callbacks/CallbackDetails.js +17 -3
  9. package/lib/components/Callbacks/CallbackOperation.js +24 -3
  10. package/lib/components/Callbacks/CallbackSummary.js +19 -3
  11. package/lib/components/Callbacks/CallbacksList.js +16 -1
  12. package/lib/components/Callbacks/index.js +4 -1
  13. package/lib/components/Callbacks/styled.js +6 -3
  14. package/lib/components/Content/Content.js +10 -1
  15. package/lib/components/Content/index.js +2 -1
  16. package/lib/components/Content/useAutoScroll.js +50 -1
  17. package/lib/components/ContentItem/ContentItem.js +31 -1
  18. package/lib/components/ContentItem/index.js +2 -1
  19. package/lib/components/ContentItem/useIsExpanded.js +33 -1
  20. package/lib/components/ContentItems/ContentItems.js +19 -1
  21. package/lib/components/ContentItems/Items.js +13 -1
  22. package/lib/components/ContentItems/VirtualList.js +35 -1
  23. package/lib/components/ContentItems/helpers.js +49 -1
  24. package/lib/components/ContentItems/index.js +2 -1
  25. package/lib/components/ContentItems/useScrollOnRender.js +26 -1
  26. package/lib/components/Discriminator/Discriminator.js +27 -2
  27. package/lib/components/Discriminator/index.js +2 -1
  28. package/lib/components/Download/DownloadSpecification.js +46 -4
  29. package/lib/components/Download/index.js +2 -1
  30. package/lib/components/Download/types.js +2 -0
  31. package/lib/components/Download/useDownloadInfo.js +42 -1
  32. package/lib/components/ErrorBoundary/ErrorBoundary.js +22 -2
  33. package/lib/components/ErrorBoundary/index.js +2 -1
  34. package/lib/components/ExpandAllButton/ExpandAllButton.js +31 -2
  35. package/lib/components/ExpandAllButton/index.js +2 -1
  36. package/lib/components/ExternalDocumentation/ExternalDocumentation.js +18 -4
  37. package/lib/components/ExternalDocumentation/index.js +2 -1
  38. package/lib/components/Language/LanguageDropdown.js +21 -1
  39. package/lib/components/Language/LanguageItem.js +33 -1
  40. package/lib/components/Language/LanguageList.js +93 -1
  41. package/lib/components/Language/_tests_/LanguageDropdown.test.js +23 -1
  42. package/lib/components/Language/constants.js +3 -1
  43. package/lib/components/Language/index.js +4 -1
  44. package/lib/components/Language/styled.js +29 -15
  45. package/lib/components/Markdown/Markdown.js +64 -1
  46. package/lib/components/Markdown/index.js +3 -1
  47. package/lib/components/Markdown/types.js +2 -0
  48. package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +51 -1
  49. package/lib/components/MediaTypeSwitch/index.js +2 -1
  50. package/lib/components/OperationItem/Description.js +9 -1
  51. package/lib/components/OperationItem/OperationItem.js +70 -5
  52. package/lib/components/OperationItem/_tests_/OperationItem.test.js +70 -1
  53. package/lib/components/OperationItem/_tests_/__mocks__/mock-intersection-observer.js +40 -1
  54. package/lib/components/OperationItem/index.js +2 -1
  55. package/lib/components/OperationItem/types.js +2 -0
  56. package/lib/components/Overlay.js +48 -3
  57. package/lib/components/Overview/Overview.js +20 -1
  58. package/lib/components/Overview/index.js +2 -1
  59. package/lib/components/PageFooter/PageFooter.js +19 -1
  60. package/lib/components/PageFooter/index.js +2 -1
  61. package/lib/components/Panel/ResponsePanel.js +12 -6
  62. package/lib/components/Panel/Trigger.js +4 -2
  63. package/lib/components/Panel/index.js +3 -1
  64. package/lib/components/PanelItem/PanelItem.js +6 -1
  65. package/lib/components/PanelItem/index.js +3 -1
  66. package/lib/components/PanelItem/styled.js +20 -10
  67. package/lib/components/PayloadSamples/Example.js +6 -1
  68. package/lib/components/PayloadSamples/ExampleValue.js +30 -1
  69. package/lib/components/PayloadSamples/MediaTypeSamples.js +36 -2
  70. package/lib/components/PayloadSamples/PayloadSamples.js +26 -1
  71. package/lib/components/PayloadSamples/index.js +7 -1
  72. package/lib/components/PayloadSamples/styled.js +9 -4
  73. package/lib/components/PayloadSamples/types.js +2 -0
  74. package/lib/components/PropertyDetails/DescriptionEnums.js +19 -3
  75. package/lib/components/PropertyDetails/EnumValues.js +37 -1
  76. package/lib/components/PropertyDetails/Examples.js +26 -1
  77. package/lib/components/PropertyDetails/Extensions.js +17 -2
  78. package/lib/components/PropertyDetails/FieldDetail.js +15 -2
  79. package/lib/components/PropertyDetails/FieldDetails.js +51 -6
  80. package/lib/components/PropertyDetails/Pattern.js +21 -1
  81. package/lib/components/PropertyDetails/PlusCircleIcon.js +10 -4
  82. package/lib/components/PropertyDetails/PropertyDetails.js +22 -5
  83. package/lib/components/PropertyDetails/SchemaTypeInfo.js +10 -2
  84. package/lib/components/PropertyDetails/SimpleEnums.js +13 -2
  85. package/lib/components/PropertyDetails/cycleColorsByLevel.js +18 -1
  86. package/lib/components/PropertyDetails/index.js +4 -1
  87. package/lib/components/PropertyDetails/styled.js +15 -7
  88. package/lib/components/PropertyDetails/types.js +2 -0
  89. package/lib/components/RedoclyOpenAPIDocs/Providers.js +114 -1
  90. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +57 -1
  91. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +86 -1
  92. package/lib/components/RedoclyOpenAPIDocs/index.js +5 -1
  93. package/lib/components/RedoclyOpenAPIDocs/styled.js +4 -2
  94. package/lib/components/RedoclyOpenAPIDocs/types.js +2 -0
  95. package/lib/components/RedoclyOpenAPIDocs/utils.js +33 -1
  96. package/lib/components/RenderHook/RenderHook.js +17 -1
  97. package/lib/components/RenderHook/index.js +2 -1
  98. package/lib/components/Replay/EmbeddedReplay.js +41 -3
  99. package/lib/components/Replay/Replay.js +99 -1
  100. package/lib/components/Replay/index.js +3 -1
  101. package/lib/components/Replay/utils.js +208 -1
  102. package/lib/components/Request/RequestDetails.js +33 -2
  103. package/lib/components/Request/types.js +2 -0
  104. package/lib/components/RequestParameters/Body.js +8 -1
  105. package/lib/components/RequestParameters/ParametersGroup.js +19 -4
  106. package/lib/components/RequestParameters/RequestParameters.js +40 -1
  107. package/lib/components/RequestParameters/index.js +4 -1
  108. package/lib/components/RequestSamples/CodeSample.js +55 -2
  109. package/lib/components/RequestSamples/Example.js +37 -1
  110. package/lib/components/RequestSamples/RequestSamples.js +89 -5
  111. package/lib/components/RequestSamples/index.js +3 -1
  112. package/lib/components/RequestSamples/useCodeSamples.js +92 -1
  113. package/lib/components/ResponseSamples/ResponseSamples.js +47 -1
  114. package/lib/components/ResponseSamples/Summary.js +9 -1
  115. package/lib/components/ResponseSamples/index.js +2 -1
  116. package/lib/components/Responses/OperationResponseList.js +42 -2
  117. package/lib/components/Responses/ResponseDetails.js +18 -1
  118. package/lib/components/Responses/ResponseHeaders.js +15 -1
  119. package/lib/components/Responses/index.js +6 -1
  120. package/lib/components/Responses/styled.js +14 -6
  121. package/lib/components/Responses/types.js +2 -0
  122. package/lib/components/RightPanel/RightPanel.js +21 -1
  123. package/lib/components/RightPanel/index.js +2 -1
  124. package/lib/components/Samples/ExampleSwitch.js +33 -1
  125. package/lib/components/Samples/index.js +3 -1
  126. package/lib/components/Samples/use-example-key.js +12 -1
  127. package/lib/components/Schema/ArraySchema.js +45 -1
  128. package/lib/components/Schema/ObjectSchema.js +29 -1
  129. package/lib/components/Schema/OneOfSchema.js +47 -3
  130. package/lib/components/Schema/RecursiveSchema.js +10 -1
  131. package/lib/components/Schema/Schema.js +63 -2
  132. package/lib/components/Schema/SubSchema.js +20 -1
  133. package/lib/components/Schema/helpers.js +16 -1
  134. package/lib/components/Schema/index.js +5 -1
  135. package/lib/components/Schema/types.js +2 -0
  136. package/lib/components/Schema/useOneOfLocationIdx.js +11 -1
  137. package/lib/components/SchemaDefinition/SchemaDefinition.js +65 -2
  138. package/lib/components/SchemaDefinition/index.js +2 -1
  139. package/lib/components/SectionContent/SectionContent.js +49 -6
  140. package/lib/components/SectionContent/index.js +2 -1
  141. package/lib/components/SectionItem/SectionItem.js +14 -1
  142. package/lib/components/SectionItem/index.js +2 -1
  143. package/lib/components/Security/Divider.js +9 -2
  144. package/lib/components/Security/OAuthFlow.js +11 -1
  145. package/lib/components/Security/OAuthScopes.js +59 -9
  146. package/lib/components/Security/Security.js +15 -1
  147. package/lib/components/Security/SecurityButton.js +31 -7
  148. package/lib/components/Security/SecurityFlow.js +28 -4
  149. package/lib/components/Security/SecurityModal.js +34 -5
  150. package/lib/components/Security/SecuritySchemeItem.js +15 -4
  151. package/lib/components/Security/helper.js +16 -1
  152. package/lib/components/Security/index.js +11 -1
  153. package/lib/components/Security/styled.js +6 -3
  154. package/lib/components/SelectOrLabel/SelectOrLabel.js +12 -2
  155. package/lib/components/SelectOrLabel/index.js +2 -1
  156. package/lib/components/ServerList/ServerList.js +36 -10
  157. package/lib/components/ServerList/index.js +2 -1
  158. package/lib/components/ServerList/types.js +2 -0
  159. package/lib/components/ServerListDropdown/ServerListDropdown.js +54 -1
  160. package/lib/components/ServerListDropdown/index.js +2 -1
  161. package/lib/components/ServerListDropdown/styled.js +15 -6
  162. package/lib/components/SideMenu/SideMenu.js +13 -2
  163. package/lib/components/SideMenu/hooks/useMenuItems.js +110 -1
  164. package/lib/components/SideMenu/index.js +2 -1
  165. package/lib/components/SideMenu/types.js +2 -0
  166. package/lib/components/StickySidebar/SidebarActions.js +14 -2
  167. package/lib/components/StickySidebar/StickyResponsiveSidebar.js +37 -7
  168. package/lib/components/StickySidebar/index.js +2 -1
  169. package/lib/components/Tabs/Tabs.js +16 -5
  170. package/lib/components/Tabs/index.js +3 -1
  171. package/lib/components/Tabs/useTabsState.js +22 -1
  172. package/lib/components/TagItem/OperationNavigationItems.js +18 -4
  173. package/lib/components/TagItem/OperationsNavigation.js +46 -2
  174. package/lib/components/TagItem/TagItem.js +40 -7
  175. package/lib/components/TagItem/index.js +2 -1
  176. package/lib/components/TagItem/styled.js +5 -2
  177. package/lib/components/TagItem/types.js +2 -0
  178. package/lib/components/ViewNested/ViewNested.js +42 -9
  179. package/lib/components/ViewNested/index.js +2 -1
  180. package/lib/components/common/Badges.js +21 -5
  181. package/lib/components/common/BodyContent/BodyContent.js +31 -4
  182. package/lib/components/common/BodyContent/index.js +2 -1
  183. package/lib/components/common/ClearButton/ClearButton.js +5 -1
  184. package/lib/components/common/ClearButton/index.js +3 -1
  185. package/lib/components/common/ClearButton/styled.js +5 -2
  186. package/lib/components/common/ClearButton/types.js +2 -0
  187. package/lib/components/common/CodeBlockPanel.js +7 -3
  188. package/lib/components/common/ConstraintsView.js +14 -2
  189. package/lib/components/common/Dropdown/Dropdown.js +22 -4
  190. package/lib/components/common/Dropdown/index.js +2 -1
  191. package/lib/components/common/ExpandableExample/ExpandableExample.js +24 -3
  192. package/lib/components/common/ExpandableExample/index.js +2 -1
  193. package/lib/components/common/Extensions.js +17 -2
  194. package/lib/components/common/Fields/fields-layout.js +76 -51
  195. package/lib/components/common/Fields/fields.js +39 -17
  196. package/lib/components/common/Fields/index.js +3 -1
  197. package/lib/components/common/LinkToField.js +33 -6
  198. package/lib/components/common/OperationItemTitle.js +12 -6
  199. package/lib/components/common/SchemaSelection/SchemaSelection.js +51 -1
  200. package/lib/components/common/SchemaSelection/index.js +2 -1
  201. package/lib/components/common/Select/Select.js +21 -1
  202. package/lib/components/common/Select/index.js +3 -1
  203. package/lib/components/common/Select/styled.js +17 -9
  204. package/lib/components/common/Select/types.js +2 -0
  205. package/lib/components/common/Skeleton/LanguageListSkeleton.js +16 -6
  206. package/lib/components/common/Skeleton/Skeleton.js +15 -5
  207. package/lib/components/common/Skeleton/index.js +3 -1
  208. package/lib/components/common/headers.js +4 -2
  209. package/lib/components/common/index.js +14 -1
  210. package/lib/components/common/linkify.js +28 -4
  211. package/lib/components/common/mixins.js +4 -2
  212. package/lib/components/common/panels.js +52 -29
  213. package/lib/components/common/schema.js +16 -8
  214. package/lib/components/common/styled.js +15 -7
  215. package/lib/components/index.js +25 -1
  216. package/lib/components/pluggable/RedocExample.js +20 -1
  217. package/lib/components/pluggable/RedocSchema.js +22 -1
  218. package/lib/components/pluggable/index.js +3 -1
  219. package/lib/components/pluggable/styled.components.js +9 -4
  220. package/lib/constants.js +30 -1
  221. package/lib/empty.js +7 -1
  222. package/lib/events/codeSampleCopy.js +19 -1
  223. package/lib/events/creator.js +5 -1
  224. package/lib/events/index.js +8 -1
  225. package/lib/events/languageSwitch.js +18 -1
  226. package/lib/events/panelToggle.js +16 -1
  227. package/lib/events/serverSwitch.js +13 -1
  228. package/lib/events/tryItOpen.js +12 -1
  229. package/lib/events/tryItSent.js +12 -1
  230. package/lib/events/types.js +11 -1
  231. package/lib/hoc/types.js +2 -0
  232. package/lib/hoc/utils.js +4 -1
  233. package/lib/hoc/withRouter.js +17 -1
  234. package/lib/hoc/withStore.js +28 -1
  235. package/lib/hooks/index.js +9 -1
  236. package/lib/hooks/useActivateExample.js +35 -1
  237. package/lib/hooks/useActiveWithFallback.js +12 -1
  238. package/lib/hooks/useContentItems.js +10 -1
  239. package/lib/hooks/useLicense.js +17 -1
  240. package/lib/hooks/usePerformanceMetrics.js +26 -1
  241. package/lib/hooks/useRouter.js +17 -1
  242. package/lib/hooks/useTelemetry.js +5 -1
  243. package/lib/hooks/useTranslate.js +6 -1
  244. package/lib/hooks/useUppercase2LowercaseRedirect.js +12 -1
  245. package/lib/icons/CSharpIcon/CSharpIcon.js +7 -1
  246. package/lib/icons/CSharpIcon/index.js +2 -1
  247. package/lib/icons/CurlIcon/CurlIcon.js +8 -2
  248. package/lib/icons/CurlIcon/index.js +2 -1
  249. package/lib/icons/GOIcon/GOIcon.js +7 -1
  250. package/lib/icons/GOIcon/index.js +2 -1
  251. package/lib/icons/JavaIcon/JavaIcon.js +7 -1
  252. package/lib/icons/JavaIcon/index.js +2 -1
  253. package/lib/icons/JavaScriptIcon/JavaScriptIcon.js +7 -1
  254. package/lib/icons/JavaScriptIcon/index.js +2 -1
  255. package/lib/icons/NodeJSIcon/NodeJSIcon.js +7 -1
  256. package/lib/icons/NodeJSIcon/index.js +2 -1
  257. package/lib/icons/PHPIcon/PHPIcon.js +7 -1
  258. package/lib/icons/PHPIcon/index.js +2 -1
  259. package/lib/icons/PayloadIcon/PayloadIcon.js +7 -1
  260. package/lib/icons/PayloadIcon/index.js +2 -1
  261. package/lib/icons/PythonIcon/PythonIcon.js +7 -1
  262. package/lib/icons/PythonIcon/index.js +2 -1
  263. package/lib/icons/RIcon/RIcon.js +7 -1
  264. package/lib/icons/RIcon/index.js +2 -1
  265. package/lib/icons/RubyIcon/RubyIcon.js +7 -1
  266. package/lib/icons/RubyIcon/index.js +2 -1
  267. package/lib/index.js +49 -1
  268. package/lib/jotai/app.js +113 -1
  269. package/lib/jotai/operation.js +28 -1
  270. package/lib/jotai/replay.js +5 -1
  271. package/lib/jotai/store.js +8 -1
  272. package/lib/jotai/use-write-atom.js +9 -1
  273. package/lib/models/callback.js +28 -1
  274. package/lib/models/code-sample-options.js +2 -0
  275. package/lib/models/example.js +17 -1
  276. package/lib/models/field.js +109 -1
  277. package/lib/models/group.js +38 -1
  278. package/lib/models/index.js +14 -1
  279. package/lib/models/mediaContent.js +26 -1
  280. package/lib/models/mediaType.js +153 -1
  281. package/lib/models/operation.js +166 -1
  282. package/lib/models/request.js +25 -1
  283. package/lib/models/response.js +46 -1
  284. package/lib/models/schema.js +474 -2
  285. package/lib/models/security.js +84 -1
  286. package/lib/models/tab.js +2 -0
  287. package/lib/models/types.js +2 -0
  288. package/lib/services/OpenAPIParser.js +321 -1
  289. package/lib/services/check.js +104 -1
  290. package/lib/services/code-samples/constants.js +16 -1
  291. package/lib/services/code-samples/generator.js +540 -1
  292. package/lib/services/code-samples/httpsnippet/helpers/code-builder.js +252 -3
  293. package/lib/services/code-samples/httpsnippet/helpers/code-helpers.js +90 -2
  294. package/lib/services/code-samples/httpsnippet/helpers/constants.js +28 -1
  295. package/lib/services/code-samples/httpsnippet/helpers/lodash-int.js +173 -1
  296. package/lib/services/code-samples/httpsnippet/helpers/mocks/code-helpers-mock.js +76 -37
  297. package/lib/services/code-samples/httpsnippet/helpers/reducer.js +16 -1
  298. package/lib/services/code-samples/httpsnippet/helpers/shell.js +20 -1
  299. package/lib/services/code-samples/httpsnippet/helpers/string-utility.js +19 -1
  300. package/lib/services/code-samples/httpsnippet/index.js +166 -1
  301. package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.js +2340 -146
  302. package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +227 -2
  303. package/lib/services/code-samples/httpsnippet/targets/csharp/index.js +11 -1
  304. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/httpclient.js +185 -2
  305. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/index.js +11 -1
  306. package/lib/services/code-samples/httpsnippet/targets/go/index.js +11 -1
  307. package/lib/services/code-samples/httpsnippet/targets/go/native.js +222 -3
  308. package/lib/services/code-samples/httpsnippet/targets/index.js +28 -1
  309. package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +184 -3
  310. package/lib/services/code-samples/httpsnippet/targets/java/index.js +11 -1
  311. package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +223 -2
  312. package/lib/services/code-samples/httpsnippet/targets/java8/index.js +11 -1
  313. package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +147 -1
  314. package/lib/services/code-samples/httpsnippet/targets/javascript/index.js +11 -1
  315. package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +199 -1
  316. package/lib/services/code-samples/httpsnippet/targets/node/index.js +11 -1
  317. package/lib/services/code-samples/httpsnippet/targets/php/curl.js +203 -5
  318. package/lib/services/code-samples/httpsnippet/targets/php/index.js +11 -1
  319. package/lib/services/code-samples/httpsnippet/targets/php/types.js +2 -0
  320. package/lib/services/code-samples/httpsnippet/targets/php/utils.js +106 -5
  321. package/lib/services/code-samples/httpsnippet/targets/python/index.js +11 -1
  322. package/lib/services/code-samples/httpsnippet/targets/python/requests.js +185 -6
  323. package/lib/services/code-samples/httpsnippet/targets/r/httr.js +111 -1
  324. package/lib/services/code-samples/httpsnippet/targets/r/index.js +11 -1
  325. package/lib/services/code-samples/httpsnippet/targets/r/utils.js +18 -6
  326. package/lib/services/code-samples/httpsnippet/targets/ruby/index.js +11 -1
  327. package/lib/services/code-samples/httpsnippet/targets/ruby/native.js +169 -1
  328. package/lib/services/code-samples/httpsnippet/targets/shell/curl.js +94 -6
  329. package/lib/services/code-samples/httpsnippet/targets/shell/index.js +11 -1
  330. package/lib/services/code-samples/index.js +3 -1
  331. package/lib/services/code-samples/types.js +2 -0
  332. package/lib/services/config-options/helpers.js +49 -1
  333. package/lib/services/config-options/index.js +3 -1
  334. package/lib/services/config-options/normalizeOptions.js +83 -1
  335. package/lib/services/config-options/types.js +2 -0
  336. package/lib/services/history/helpers.js +63 -1
  337. package/lib/services/history/index.js +2 -1
  338. package/lib/services/index.js +9 -1
  339. package/lib/services/menu/builder.js +47 -1
  340. package/lib/services/menu/index.js +2 -1
  341. package/lib/services/menu/markdown.js +93 -1
  342. package/lib/services/menu/operation.js +50 -1
  343. package/lib/services/menu/tags.js +166 -1
  344. package/lib/services/types.js +2 -0
  345. package/lib/services/utils.js +83 -1
  346. package/lib/standalone.js +68 -1
  347. package/lib/styled-components.js +6 -1
  348. package/lib/types/app.js +2 -0
  349. package/lib/types/index.js +4 -1
  350. package/lib/types/open-api.js +2 -0
  351. package/lib/types/security.js +2 -0
  352. package/lib/utils/JsonPointer.js +84 -1
  353. package/lib/utils/areArraysEqual.js +4 -1
  354. package/lib/utils/argValuesHelpers.js +35 -1
  355. package/lib/utils/compose.js +2 -1
  356. package/lib/utils/configure-helpers.js +223 -1
  357. package/lib/utils/convertSwagger2OpenAPI.js +14 -1
  358. package/lib/utils/cookies.js +73 -1
  359. package/lib/utils/debounce.js +22 -1
  360. package/lib/utils/debug.js +11 -1
  361. package/lib/utils/dom.js +65 -1
  362. package/lib/utils/environments.js +13 -1
  363. package/lib/utils/helpers.js +222 -12
  364. package/lib/utils/index.js +25 -1
  365. package/lib/utils/isMobile.js +13 -1
  366. package/lib/utils/loadAndBundleSpec.js +32 -1
  367. package/lib/utils/local-storage.js +12 -1
  368. package/lib/utils/object.js +31 -1
  369. package/lib/utils/openapi.js +592 -1
  370. package/lib/utils/parameters.js +13 -1
  371. package/lib/utils/path.js +22 -1
  372. package/lib/utils/queryString.js +60 -1
  373. package/lib/utils/replaceVariables.js +14 -1
  374. package/lib/utils/saveTextBeforeHeading.js +35 -1
  375. package/lib/utils/security-details.js +49 -1
  376. package/lib/utils/session-storage.js +12 -1
  377. package/lib/utils/simplifyAstStructure.js +22 -1
  378. package/lib/utils/sort.js +21 -1
  379. package/lib/utils/string.js +65 -1
  380. package/lib/utils/telemetry.js +7 -1
  381. package/lib/utils/test-utils.js +26 -1
  382. package/lib/utils/theme-helpers.js +24 -3
  383. package/lib/utils/url.js +38 -1
  384. package/package.json +4 -4
@@ -1,5 +1,66 @@
1
- import{jsx as r}from"react/jsx-runtime";import{memo as S}from"react";import{useAtomValue as g}from"jotai";import{useLocation as I}from"react-router-dom";import{ArraySchema as b}from"./ArraySchema.js";import{ObjectSchema as p}from"./ObjectSchema.js";import{OneOfSchema as C}from"./OneOfSchema.js";import{RecursiveSchema as s}from"./RecursiveSchema.js";import{operationStore as j}from"../../jotai/operation.js";import{FieldDetails as A}from"../PropertyDetails/index.js";import{pathIncludesLink as P}from"../../utils/index.js";import{styled as k}from"../../styled-components.js";function w({schema:e,onDiscriminatorChange:u,onOneOfChange:n,...o}){const{activeOneOf:d}=g(j(e?.operationPointer||"")),h=I();if(!e)return null;const{type:t,oneOf:i,discriminatorProp:f,isCircular:O}=e;if(O)return r(s,{schema:e});if(f!==void 0){if(!i||!i.length)return console.warn(`Looks like you are using discriminator wrong: you don't have any definition inherited from the ${e.title}`),null;const m=i.findIndex((N,v)=>P(h,`d=${v}`)),l=m===-1?0:m,y=d[e.pointer]!==void 0?d[e.pointer]:l,a=i[y];return a?.isCircular?r(s,{schema:a}):r(p,{...o,schema:a,discriminator:{fieldName:f,parentSchema:e,activeOneOfIdx:l,onChange:u},onOneOfChange:n})}if(i!==void 0&&i.length>1)return r(C,{...o,schema:e,onChange:n});const c=Array.isArray(t)?t:[t];if(c.includes("object")){if(e.fields?.length)return r(p,{...o,schema:e,onOneOfChange:n})}else if(c.includes("array"))return r(b,{...o,schema:e,onOneOfChange:n});const x={schema:e,name:"",description:e.description,required:!1,deprecated:!1};return r(L,{children:r(A,{field:x,fieldParentsName:o.fieldParentsName})})}const H=S(w),L=k.div`
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useAtomValue } from 'jotai';
4
+ import { useLocation } from 'react-router-dom';
5
+ import { ArraySchema } from './ArraySchema.js';
6
+ import { ObjectSchema } from './ObjectSchema.js';
7
+ import { OneOfSchema } from './OneOfSchema.js';
8
+ import { RecursiveSchema } from './RecursiveSchema.js';
9
+ import { operationStore } from '../../jotai/operation.js';
10
+ import { FieldDetails } from '../PropertyDetails/index.js';
11
+ import { pathIncludesLink } from '../../utils/index.js';
12
+ import { styled } from '../../styled-components.js';
13
+ function SchemaComponent({ schema, onDiscriminatorChange, onOneOfChange, ...rest }) {
14
+ const { activeOneOf } = useAtomValue(operationStore(schema?.operationPointer || ''));
15
+ const location = useLocation();
16
+ if (!schema) {
17
+ return null;
18
+ }
19
+ const { type, oneOf, discriminatorProp, isCircular } = schema;
20
+ if (isCircular) {
21
+ return _jsx(RecursiveSchema, { schema: schema });
22
+ }
23
+ if (discriminatorProp !== undefined) {
24
+ if (!oneOf || !oneOf.length) {
25
+ console.warn(`Looks like you are using discriminator wrong: you don't have any definition inherited from the ${schema.title}`);
26
+ return null;
27
+ }
28
+ const locationOneOfIdx = oneOf.findIndex((_, index) => pathIncludesLink(location, `d=${index}`));
29
+ const activeOneOfIdx = locationOneOfIdx === -1 ? 0 : locationOneOfIdx;
30
+ const activeSchemaIndex = activeOneOf[schema.pointer] !== undefined ? activeOneOf[schema.pointer] : activeOneOfIdx;
31
+ const activeSchema = oneOf[activeSchemaIndex];
32
+ return activeSchema?.isCircular ? (_jsx(RecursiveSchema, { schema: activeSchema })) : (_jsx(ObjectSchema, { ...rest, schema: activeSchema, discriminator: {
33
+ fieldName: discriminatorProp,
34
+ parentSchema: schema,
35
+ activeOneOfIdx: activeOneOfIdx,
36
+ onChange: onDiscriminatorChange,
37
+ }, onOneOfChange: onOneOfChange }));
38
+ }
39
+ if (oneOf !== undefined && oneOf.length > 1) {
40
+ return (_jsx(OneOfSchema, { ...rest, schema: schema, onChange: onOneOfChange }));
41
+ }
42
+ const types = Array.isArray(type) ? type : [type];
43
+ if (types.includes('object')) {
44
+ if (schema.fields?.length) {
45
+ return _jsx(ObjectSchema, { ...rest, schema: schema, onOneOfChange: onOneOfChange });
46
+ }
47
+ }
48
+ else if (types.includes('array')) {
49
+ return _jsx(ArraySchema, { ...rest, schema: schema, onOneOfChange: onOneOfChange });
50
+ }
51
+ const field = {
52
+ schema,
53
+ name: '',
54
+ description: schema.description,
55
+ required: false,
56
+ deprecated: false,
57
+ };
58
+ return (_jsx(Wrapper, { children: _jsx(FieldDetails, { field: field, fieldParentsName: rest.fieldParentsName }) }));
59
+ }
60
+ export const Schema = memo(SchemaComponent);
61
+ const Wrapper = styled.div `
2
62
  width: 100%;
3
63
  padding: var(--spacing-xxs) 0;
4
64
  border-bottom: 1px solid var(--border-color-primary);
5
- `;export{H as Schema};
65
+ `;
66
+ //# sourceMappingURL=Schema.js.map
@@ -1 +1,20 @@
1
- import{jsx as u}from"react/jsx-runtime";import{memo as S}from"react";import{useLocation as y}from"react-router-dom";import{useAtomValue as b}from"jotai/index";import{pathIncludesLink as h}from"../../utils/index.js";import{operationStore as A}from"../../jotai/operation.js";import{extractTypeFromDeepLink as T}from"./helpers.js";import{ViewNested as $}from"../ViewNested/index.js";import{useTranslate as w}from"../../hooks/index.js";function N({expandByDefault:t,deepLink:e,level:r,expandable:a=!1,isNestedArray:n=!1,isArray:m="",propertyLength:o="",children:p,operationPointer:s}){const i=w(),c=y(),l=h(c,e),f=T(e),x=b(A(s||"")),d=`${i("openapi.actions.show","Show")} ${Number(o)===1?"":o} ${m&&"array "}${o!==1?"properties":"property"}`;return u($,{expandByDefault:t||l,level:r,isNestedArray:n,expandable:a,expandText:d,children:p,expandedAll:x[f]?.expandedAll})}const L=S(N);export{L as SubSchema};
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useLocation } from 'react-router-dom';
4
+ import { useAtomValue } from 'jotai/index';
5
+ import { pathIncludesLink } from '../../utils/index.js';
6
+ import { operationStore } from '../../jotai/operation.js';
7
+ import { extractTypeFromDeepLink } from './helpers.js';
8
+ import { ViewNested } from '../ViewNested/index.js';
9
+ import { useTranslate } from '../../hooks/index.js';
10
+ function SubSchemaComponent({ expandByDefault, deepLink, level, expandable = false, isNestedArray = false, isArray = '', propertyLength = '', children, operationPointer, }) {
11
+ const translate = useTranslate();
12
+ const location = useLocation();
13
+ const expandByLocation = pathIncludesLink(location, deepLink);
14
+ const type = extractTypeFromDeepLink(deepLink);
15
+ const operationState = useAtomValue(operationStore(operationPointer || ''));
16
+ const expandText = `${translate('openapi.actions.show', 'Show')} ${Number(propertyLength) === 1 ? '' : propertyLength} ${isArray && 'array '}${propertyLength !== 1 ? 'properties' : 'property'}`;
17
+ return (_jsx(ViewNested, { expandByDefault: expandByDefault || expandByLocation, level: level, isNestedArray: isNestedArray, expandable: expandable, expandText: expandText, children: children, expandedAll: operationState[type]?.expandedAll }));
18
+ }
19
+ export const SubSchema = memo(SubSchemaComponent);
20
+ //# sourceMappingURL=SubSchema.js.map
@@ -1 +1,16 @@
1
- import{isUndefined as o}from"@redocly/theme/core/openapi";const i=e=>{if(!e)return"";const t=e.match(/t=(request|response)/);return t?t[1]:""},u=4;function f({schemasExpansionLevel:e,level:t,required:n}){const r=Number(t)-1;return o(e)?!!n&&u>=r:e>=r}export{i as extractTypeFromDeepLink,f as getExpandByDefault};
1
+ import { isUndefined } from '@redocly/theme/core/openapi';
2
+ export const extractTypeFromDeepLink = (str) => {
3
+ if (!str)
4
+ return '';
5
+ const match = str.match(/t=(request|response)/);
6
+ return match ? match[1] : '';
7
+ };
8
+ const DEFAULT_REQUIRE_EXPAND_LEVEL = 4;
9
+ export function getExpandByDefault({ schemasExpansionLevel, level, required, }) {
10
+ const normalizedLevel = Number(level) - 1;
11
+ if (!isUndefined(schemasExpansionLevel)) {
12
+ return schemasExpansionLevel >= normalizedLevel;
13
+ }
14
+ return Boolean(required) && DEFAULT_REQUIRE_EXPAND_LEVEL >= normalizedLevel;
15
+ }
16
+ //# sourceMappingURL=helpers.js.map
@@ -1 +1,5 @@
1
- import{Schema as m}from"./Schema.js";import{ObjectSchema as a}from"./ObjectSchema.js";import{OneOfSchema as f}from"./OneOfSchema.js";import{ArraySchema as h}from"./ArraySchema.js";export{h as ArraySchema,a as ObjectSchema,f as OneOfSchema,m as Schema};
1
+ export { Schema } from './Schema.js';
2
+ export { ObjectSchema } from './ObjectSchema.js';
3
+ export { OneOfSchema } from './OneOfSchema.js';
4
+ export { ArraySchema } from './ArraySchema.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -1 +1,11 @@
1
- import{useLocation as s}from"react-router-dom";import{useMemo as r}from"react";const i=/(?=oneof=)/g;function m(o,n){const t=s();return r(()=>o.findIndex((c,e)=>t.hash.split(i)[n]?.includes(`oneof=${e}`)),[n,t.hash,o])}export{m as useOneOfLocationIdx};
1
+ import { useLocation } from 'react-router-dom';
2
+ import { useMemo } from 'react';
3
+ const OneOfLocationRegex = /(?=oneof=)/g;
4
+ export function useOneOfLocationIdx(oneOf, level) {
5
+ const location = useLocation();
6
+ return useMemo(() => oneOf.findIndex((_, index) => {
7
+ const result = location.hash.split(OneOfLocationRegex);
8
+ return result[level]?.includes(`oneof=${index}`);
9
+ }), [level, location.hash, oneOf]);
10
+ }
11
+ //# sourceMappingURL=useOneOfLocationIdx.js.map
@@ -1,3 +1,66 @@
1
- import{jsx as o,jsxs as S}from"react/jsx-runtime";import{memo as g,useCallback as A,useMemo as C}from"react";import{LayoutVariant as j}from"@redocly/config";import{useAtom as k,useAtomValue as x}from"jotai";import{useWriteAtom as T}from"../../jotai/use-write-atom.js";import{SamplesMiddlePanel as D,SamplesPanel as E,Row as N,Section as b,CodeBlockPanel as P}from"../common/index.js";import{getMediaType as w}from"../../models/index.js";import{MediaTypeSamples as I}from"../PayloadSamples/index.js";import{Schema as V}from"../Schema/index.js";import{Markdown as W}from"../Markdown/index.js";import{layoutAtom as _}from"../../jotai/app.js";import{globalStoreAtom as $}from"../../jotai/store.js";import{operationStore as O}from"../../jotai/operation.js";import{styled as B}from"../../styled-components.js";const K=(t,i)=>{if(!t)return{};const n={schema:{$ref:t}};return i&&(n.examples={example:{$ref:i}}),n};function L({schemaRef:t,exampleRef:i,showReadOnly:n=!0,showWriteOnly:v=!1}){const s=x(_),{parser:c,options:p}=x($),l=T(),e=C(()=>w(c,"json",!1,K(t,i),p,{operation:{pointer:"SchemaDefinitionComponent"}}),[i,p,c,t]),[f,d]=k(O(e.operation?.pointer)),y=A(r=>{if(!e.schema)return;const a=e.schema,u=a.oneOf;if(u&&e?.examples&&Object.keys(e?.examples).includes(r)){const m=u.findIndex(M=>M.title===r);m!==-1&&a&&l(O(a.operationPointer),{activeExampleName:a.oneOf?.[m]?.title,activeOneOf:{[a.pointer]:m}})}f.activeExampleName!==r&&d({activeExampleName:r})},[e?.examples,e.schema,f.activeExampleName,d,l]),h=s===j.STACKED;return o(b,{children:S(N,{layout:s,children:[S(D,{isStacked:h,children:[e.schema?.description&&o(q,{children:o(W,{source:e.schema?.description})}),o(V,{skipWriteOnly:!v,skipReadOnly:!n,schema:e.schema,level:1})]}),o(E,{isStacked:h,children:o(P,{className:"panel-response-samples",children:o(I,{mediaType:e,onChange:y})})})]})})}const ie=g(L),q=B.div`
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useCallback, useMemo } from 'react';
3
+ import { LayoutVariant } from '@redocly/config';
4
+ import { useAtom, useAtomValue } from 'jotai';
5
+ import { useWriteAtom } from '../../jotai/use-write-atom.js';
6
+ import { SamplesMiddlePanel, SamplesPanel, Row, Section, CodeBlockPanel } from '../common/index.js';
7
+ import { getMediaType } from '../../models/index.js';
8
+ import { MediaTypeSamples } from '../PayloadSamples/index.js';
9
+ import { Schema } from '../Schema/index.js';
10
+ import { Markdown } from '../Markdown/index.js';
11
+ import { layoutAtom } from '../../jotai/app.js';
12
+ import { globalStoreAtom } from '../../jotai/store.js';
13
+ import { operationStore } from '../../jotai/operation.js';
14
+ import { styled } from '../../styled-components.js';
15
+ const getMediaTypeInfo = (schemaRef, exampleRef) => {
16
+ if (!schemaRef) {
17
+ return {};
18
+ }
19
+ const info = {
20
+ schema: { $ref: schemaRef },
21
+ };
22
+ if (exampleRef) {
23
+ info.examples = { example: { $ref: exampleRef } };
24
+ }
25
+ return info;
26
+ };
27
+ function SchemaDefinitionComponent({ schemaRef, exampleRef, showReadOnly = true, showWriteOnly = false, }) {
28
+ const layout = useAtomValue(layoutAtom);
29
+ const { parser, options } = useAtomValue(globalStoreAtom);
30
+ const writeAtom = useWriteAtom();
31
+ const mediaModel = useMemo(() => getMediaType(parser, 'json', false, getMediaTypeInfo(schemaRef, exampleRef), options, {
32
+ operation: { pointer: 'SchemaDefinitionComponent' },
33
+ }), [exampleRef, options, parser, schemaRef]);
34
+ const [operationState, setOperation] = useAtom(operationStore(mediaModel.operation?.pointer));
35
+ const handleMediaTypeChange = useCallback((key) => {
36
+ if (!mediaModel.schema)
37
+ return;
38
+ const schema = mediaModel.schema;
39
+ const schemaOneOf = schema.oneOf;
40
+ if (schemaOneOf && mediaModel?.examples && Object.keys(mediaModel?.examples).includes(key)) {
41
+ const activeOneOfIndex = schemaOneOf.findIndex((schema) => schema.title === key);
42
+ if (activeOneOfIndex !== -1 && schema) {
43
+ writeAtom(operationStore(schema.operationPointer), {
44
+ activeExampleName: schema.oneOf?.[activeOneOfIndex]?.title,
45
+ activeOneOf: { [schema.pointer]: activeOneOfIndex },
46
+ });
47
+ }
48
+ }
49
+ if (operationState.activeExampleName !== key) {
50
+ setOperation({ activeExampleName: key });
51
+ }
52
+ }, [
53
+ mediaModel?.examples,
54
+ mediaModel.schema,
55
+ operationState.activeExampleName,
56
+ setOperation,
57
+ writeAtom,
58
+ ]);
59
+ const isStacked = layout === LayoutVariant.STACKED;
60
+ return (_jsx(Section, { children: _jsxs(Row, { layout: layout, children: [_jsxs(SamplesMiddlePanel, { isStacked: isStacked, children: [mediaModel.schema?.description && (_jsx(Description, { children: _jsx(Markdown, { source: mediaModel.schema?.description }) })), _jsx(Schema, { skipWriteOnly: !showWriteOnly, skipReadOnly: !showReadOnly, schema: mediaModel.schema, level: 1 })] }), _jsx(SamplesPanel, { isStacked: isStacked, children: _jsx(CodeBlockPanel, { className: "panel-response-samples", children: _jsx(MediaTypeSamples, { mediaType: mediaModel, onChange: handleMediaTypeChange }) }) })] }) }));
61
+ }
62
+ export const SchemaDefinition = memo(SchemaDefinitionComponent);
63
+ const Description = styled.div `
2
64
  margin-bottom: var(--spacing-vertical);
3
- `;export{ie as SchemaDefinition};
65
+ `;
66
+ //# sourceMappingURL=SchemaDefinition.js.map
@@ -1 +1,2 @@
1
- import{SchemaDefinition as o}from"./SchemaDefinition.js";export{o as SchemaDefinition};
1
+ export { SchemaDefinition } from './SchemaDefinition.js';
2
+ //# sourceMappingURL=index.js.map
@@ -1,13 +1,56 @@
1
- import{jsx as t,jsxs as s,Fragment as x}from"react/jsx-runtime";import{useMemo as p}from"react";import{useAtomValue as d}from"jotai";import{LayoutVariant as c}from"@redocly/config";import{breakpoints as k}from"@redocly/theme/core/openapi";import{OpenApiHeader as u}from"@redocly/theme/components/OpenApiDocs/hooks/OpenApiHeader";import{PageFooter as v}from"../PageFooter/index.js";import{globalOptionsAtom as b}from"../../jotai/store.js";import{RenderHook as y}from"../RenderHook/index.js";import{RightPanel as C}from"../RightPanel/index.js";import{layoutAtom as w}from"../../jotai/app.js";import{Row as B,SamplesMiddlePanel as j,SamplesPanel as M}from"../common/index.js";import{Items as f}from"../ContentItems/Items.js";import{ContentItem as g}from"../ContentItem/index.js";import{styled as m}from"../../styled-components.js";function G({items:e,hideFooterAndHeader:n}){const{unstable_hooks:{MiddlePanelHeader:a},routingBasePath:i}=d(b),l=d(w),o=l===c.STACKED,P=p(()=>n?null:t(h,{isStacked:o,children:t(v,{})}),[n,o]),S=p(()=>n||!u&&!a?null:t(h,{isStacked:o,children:a?t(y,{Hook:a,props:void 0}):t(u,{})}),[a,n,o]);return e.length===0?null:s(x,{children:[S,s(B,{layout:l,children:[t(R,{layout:l,children:e.filter(({type:r})=>r==="section").map(r=>t(g,{item:r,routingBasePath:i,children:t(f,{items:r.items,routingBasePath:i})},r.id))}),t(_,{isStacked:o,tabIndex:0,children:t(C,{item:e[0]})})]}),e.filter(({type:r})=>r!=="section").map(r=>t(g,{item:r,routingBasePath:i,children:t(f,{items:r.items,routingBasePath:i})},r.id)),P]})}const h=m(j)`
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { useAtomValue } from 'jotai';
4
+ import { LayoutVariant } from '@redocly/config';
5
+ import { breakpoints } from '@redocly/theme/core/openapi';
6
+ import { OpenApiHeader } from '@redocly/theme/components/OpenApiDocs/hooks/OpenApiHeader';
7
+ import { PageFooter } from '../PageFooter/index.js';
8
+ import { globalOptionsAtom } from '../../jotai/store.js';
9
+ import { RenderHook } from '../RenderHook/index.js';
10
+ import { RightPanel } from '../RightPanel/index.js';
11
+ import { layoutAtom } from '../../jotai/app.js';
12
+ import { Row, SamplesMiddlePanel, SamplesPanel } from '../common/index.js';
13
+ import { Items } from '../ContentItems/Items.js';
14
+ import { ContentItem } from '../ContentItem/index.js';
15
+ import { styled } from '../../styled-components.js';
16
+ export function SectionContent({ items, hideFooterAndHeader, }) {
17
+ const { unstable_hooks: { MiddlePanelHeader }, routingBasePath, } = useAtomValue(globalOptionsAtom);
18
+ const layout = useAtomValue(layoutAtom);
19
+ const isStacked = layout === LayoutVariant.STACKED;
20
+ const renderFooter = useMemo(() => {
21
+ if (hideFooterAndHeader) {
22
+ return null;
23
+ }
24
+ return (_jsx(MiddlePanelWrapper, { isStacked: isStacked, children: _jsx(PageFooter, {}) }));
25
+ }, [hideFooterAndHeader, isStacked]);
26
+ const renderHeader = useMemo(() => {
27
+ if (hideFooterAndHeader || (!OpenApiHeader && !MiddlePanelHeader)) {
28
+ return null;
29
+ }
30
+ return (_jsx(MiddlePanelWrapper, { isStacked: isStacked, children: MiddlePanelHeader ? (_jsx(RenderHook, { Hook: MiddlePanelHeader, props: undefined })) : (_jsx(OpenApiHeader, {})) }));
31
+ }, [MiddlePanelHeader, hideFooterAndHeader, isStacked]);
32
+ if (items.length === 0) {
33
+ return null;
34
+ }
35
+ return (_jsxs(_Fragment, { children: [renderHeader, _jsxs(Row, { layout: layout, children: [_jsx(SectionContainer, { layout: layout, children: items
36
+ .filter(({ type }) => type === 'section')
37
+ .map((item) => (_jsx(ContentItem, { item: item, routingBasePath: routingBasePath, children: _jsx(Items, { items: item.items, routingBasePath: routingBasePath }) }, item.id))) }), _jsx(RightPanelContainer, { isStacked: isStacked, tabIndex: 0, children: _jsx(RightPanel, { item: items[0] }) })] }), items
38
+ .filter(({ type }) => type !== 'section')
39
+ .map((item) => (_jsx(ContentItem, { item: item, routingBasePath: routingBasePath, children: _jsx(Items, { items: item.items, routingBasePath: routingBasePath }) }, item.id))), renderFooter] }));
40
+ }
41
+ const MiddlePanelWrapper = styled(SamplesMiddlePanel) `
2
42
  align-self: flex-start;
3
43
  padding-top: var(--panel-gap-vertical);
4
44
  padding-bottom: var(--panel-gap-vertical);
5
- `,R=m.div`
45
+ `;
46
+ export const SectionContainer = styled.div `
6
47
  width: 100%;
7
48
 
8
- @media screen and (min-width: ${k.large}) {
9
- width: ${({layout:e})=>e===c.STACKED?"100%":"calc(100% - var(--panel-samples-width))"};
49
+ @media screen and (min-width: ${breakpoints.large}) {
50
+ width: ${({ layout }) => layout === LayoutVariant.STACKED ? '100%' : 'calc(100% - var(--panel-samples-width))'};
10
51
  }
11
- `,_=m(M)`
52
+ `;
53
+ export const RightPanelContainer = styled(SamplesPanel) `
12
54
  margin: var(--spacing-base) 0;
13
- `;export{_ as RightPanelContainer,R as SectionContainer,G as SectionContent};
55
+ `;
56
+ //# sourceMappingURL=SectionContent.js.map
@@ -1 +1,2 @@
1
- import{SectionContent as e,SectionContainer as o,RightPanelContainer as i}from"./SectionContent.js";export{i as RightPanelContainer,o as SectionContainer,e as SectionContent};
1
+ export { SectionContent, SectionContainer, RightPanelContainer } from './SectionContent.js';
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1,14 @@
1
- import{jsx as t,Fragment as l,jsxs as p}from"react/jsx-runtime";import{memo as d}from"react";import{LayoutVariant as u}from"@redocly/config";import{SamplesMiddlePanel as a,Row as f}from"../common/index.js";import{Markdown as h}from"../Markdown/index.js";import{ExternalDocumentation as x}from"../ExternalDocumentation/index.js";function S({item:o,layout:s}){const{externalDocs:r,ast:c,description:i}=o,e=s===u.STACKED,n=!o.parent||o.parent.type!=="tag";return p(l,{children:[t(h,{ast:c,source:i,htmlWrap:m=>t(a,{compact:!0,fullWidth:n,isStacked:e,children:m})}),r&&t(f,{children:t(a,{compact:!0,fullWidth:n,isStacked:e,children:t(x,{externalDocs:r})})})]})}const _=d(S);export{_ as SectionItem};
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { LayoutVariant } from '@redocly/config';
4
+ import { SamplesMiddlePanel, Row } from '../common/index.js';
5
+ import { Markdown } from '../Markdown/index.js';
6
+ import { ExternalDocumentation } from '../ExternalDocumentation/index.js';
7
+ function SectionItemComponent({ item, layout }) {
8
+ const { externalDocs, ast, description } = item;
9
+ const isStacked = layout === LayoutVariant.STACKED;
10
+ const isFullWidth = !item.parent || item.parent.type !== 'tag';
11
+ return (_jsxs(_Fragment, { children: [_jsx(Markdown, { ast: ast, source: description, htmlWrap: (component) => (_jsx(SamplesMiddlePanel, { compact: true, fullWidth: isFullWidth, isStacked: isStacked, children: component })) }), externalDocs && (_jsx(Row, { children: _jsx(SamplesMiddlePanel, { compact: true, fullWidth: isFullWidth, isStacked: isStacked, children: _jsx(ExternalDocumentation, { externalDocs: externalDocs }) }) }))] }));
12
+ }
13
+ export const SectionItem = memo(SectionItemComponent);
14
+ //# sourceMappingURL=SectionItem.js.map
@@ -1 +1,2 @@
1
- import{SectionItem as t}from"./SectionItem.js";export{t as SectionItem};
1
+ export { SectionItem } from './SectionItem.js';
2
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,10 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";import{styled as s}from"../../styled-components.js";import{Tag as a}from"./styled.js";function d({label:i}){return e(n,{children:[r(a,{className:"tag-grey",children:i})," ",r("hr",{})]})}const n=s.div`
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { styled } from '../../styled-components.js';
3
+ import { Tag } from './styled.js';
4
+ export function Divider({ label }) {
5
+ return (_jsxs(Wrapper, { children: [_jsx(Tag, { className: "tag-grey", children: label }), " ", _jsx("hr", {})] }));
6
+ }
7
+ const Wrapper = styled.div `
2
8
  font-size: var(--font-size-sm);
3
9
  width: 100%;
4
10
  display: flex;
@@ -11,4 +17,5 @@ import{jsx as r,jsxs as e}from"react/jsx-runtime";import{styled as s}from"../../
11
17
  width: 100%;
12
18
  margin-left: var(--spacing-xs);
13
19
  }
14
- `;export{d as Divider};
20
+ `;
21
+ //# sourceMappingURL=Divider.js.map
@@ -1 +1,11 @@
1
- import{jsx as e,Fragment as a,jsxs as n}from"react/jsx-runtime";import{memo as i}from"react";import{SecuritySchemeItem as o}from"./SecuritySchemeItem.js";import{StyledLink as l}from"./styled.js";import{useTranslate as m}from"../../hooks/index.js";function s({flow:r}){const t=m();return n(a,{children:[e(o,{label:`${t("openapi.authorizationUrl","Authorization URL")}:`,value:r?.authorizationUrl&&e(l,{target:"_blank",rel:"noopener noreferrer",href:r?.authorizationUrl,children:r?.authorizationUrl})}),e(o,{label:`${t("openapi.tokenUrl","Token URL")}:`,value:r?.tokenUrl}),e(o,{label:`${t("openapi.refreshUrl","Refresh URL")}:`,value:r?.refreshUrl})]})}const f=i(s);export{f as OAuthFlow};
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { SecuritySchemeItem } from './SecuritySchemeItem.js';
4
+ import { StyledLink } from './styled.js';
5
+ import { useTranslate } from '../../hooks/index.js';
6
+ function OAuthFlowComponent({ flow }) {
7
+ const translate = useTranslate();
8
+ return (_jsxs(_Fragment, { children: [_jsx(SecuritySchemeItem, { label: `${translate('openapi.authorizationUrl', 'Authorization URL')}:`, value: flow?.['authorizationUrl'] && (_jsx(StyledLink, { target: "_blank", rel: "noopener noreferrer", href: flow?.['authorizationUrl'], children: flow?.['authorizationUrl'] })) }), _jsx(SecuritySchemeItem, { label: `${translate('openapi.tokenUrl', 'Token URL')}:`, value: flow?.['tokenUrl'] }), _jsx(SecuritySchemeItem, { label: `${translate('openapi.refreshUrl', 'Refresh URL')}:`, value: flow?.refreshUrl })] }));
9
+ }
10
+ export const OAuthFlow = memo(OAuthFlowComponent);
11
+ //# sourceMappingURL=OAuthFlow.js.map
@@ -1,4 +1,48 @@
1
- import{jsx as r,Fragment as p,jsxs as c}from"react/jsx-runtime";import{memo as S,useState as v}from"react";import{ChevronRightIcon as b}from"@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";import{Markdown as d}from"../Markdown/index.js";import{SecuritySchemeItem as a}from"./SecuritySchemeItem.js";import{Tag as m}from"./styled.js";import{useTranslate as l}from"../../hooks/index.js";import{getOptionalScopes as O,getRequiredScopes as x}from"./helper.js";import{styled as i}from"../../styled-components.js";function y({id:e,securities:t,flows:n}){const o=x(e,t);return c(p,{children:[r(w,{flows:n,requiredScopes:o}),r(q,{flows:n,requiredScopes:o})]})}function q({flows:e,requiredScopes:t}){return e&&Object.keys(e).map(n=>r(j,{flow:e[n],requiredScopes:t},n))}function j({flow:e,requiredScopes:t}){const n=l(),[o,h]=v(!1),f=Object.keys(e?.scopes||{}),u=O(t,f);return u.length===0?null:c(p,{children:[r(a,{label:c(A,{onClick:()=>{h(s=>!s)},children:[n(o?"openapi.hideOptionalScopes":"openapi.showOptionalScopes",o?"Hide optional scopes":"Show optional scopes"),r(C,{isOpen:o,children:r(b,{size:"var(--font-size-base)",color:"var(--tree-content-color-default)"})})]}),value:" "}),r(z,{isOpen:o,children:u.map(s=>r(a,{label:r(g,{className:"tag-grey",children:s}),value:r(d,{source:e?.scopes[s]||""})},s))})]})}function w({requiredScopes:e,flows:t}){const n=l();return e.length===0?null:t&&Object.keys(t).length>0?Object.keys(t).map(o=>r(k,{flow:t[o],requiredScopes:e},o)):r(a,{label:n("openapi.requiredScopes","Required scopes"),value:r(R,{children:e.map(o=>r(m,{className:"tag-grey",children:o},o))})})}function k({flow:e,requiredScopes:t}){const n=l();return c(p,{children:[r(a,{label:n("openapi.requiredScopes","Required scopes"),value:" "}),t.map(o=>r(a,{label:r(g,{className:"tag-grey",children:o}),value:r(d,{source:e?.scopes[o]||""})},o))]})}const g=i(m)`
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useState } from 'react';
3
+ import { ChevronRightIcon } from '@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon';
4
+ import { Markdown } from '../Markdown/index.js';
5
+ import { SecuritySchemeItem } from './SecuritySchemeItem.js';
6
+ import { Tag } from './styled.js';
7
+ import { useTranslate } from '../../hooks/index.js';
8
+ import { getOptionalScopes, getRequiredScopes } from './helper.js';
9
+ import { styled } from '../../styled-components.js';
10
+ function OAuthScopesComponent({ id, securities, flows }) {
11
+ const requiredScopes = getRequiredScopes(id, securities);
12
+ return (_jsxs(_Fragment, { children: [_jsx(OAuthRequiredScopes, { flows: flows, requiredScopes: requiredScopes }), _jsx(OAuthOptionalScopes, { flows: flows, requiredScopes: requiredScopes })] }));
13
+ }
14
+ function OAuthOptionalScopes({ flows, requiredScopes }) {
15
+ return (flows &&
16
+ Object.keys(flows).map((type) => (_jsx(OAuthOptionalScope, { flow: flows[type], requiredScopes: requiredScopes }, type))));
17
+ }
18
+ function OAuthOptionalScope({ flow, requiredScopes, }) {
19
+ const translate = useTranslate();
20
+ const [showScopes, setShowScopes] = useState(false);
21
+ const flowScopes = Object.keys(flow?.scopes || {});
22
+ const optionalScopes = getOptionalScopes(requiredScopes, flowScopes);
23
+ if (optionalScopes.length === 0) {
24
+ return null;
25
+ }
26
+ const toggleScopes = () => {
27
+ setShowScopes((prevShowScopes) => !prevShowScopes);
28
+ };
29
+ return (_jsxs(_Fragment, { children: [_jsx(SecuritySchemeItem, { label: _jsxs(ScopeHeader, { onClick: toggleScopes, children: [translate(showScopes ? 'openapi.hideOptionalScopes' : 'openapi.showOptionalScopes', showScopes ? 'Hide optional scopes' : 'Show optional scopes'), _jsx(AnimatedChevronWrapper, { isOpen: showScopes, children: _jsx(ChevronRightIcon, { size: "var(--font-size-base)", color: "var(--tree-content-color-default)" }) })] }), value: " " }), _jsx(ScopesListWrapper, { isOpen: showScopes, children: optionalScopes.map((scope) => (_jsx(SecuritySchemeItem, { label: _jsx(StyledTag, { className: "tag-grey", children: scope }), value: _jsx(Markdown, { source: flow?.scopes[scope] || '' }) }, scope))) })] }));
30
+ }
31
+ function OAuthRequiredScopes({ requiredScopes, flows }) {
32
+ const translate = useTranslate();
33
+ if (requiredScopes.length === 0) {
34
+ return null;
35
+ }
36
+ if (flows && Object.keys(flows).length > 0) {
37
+ return Object.keys(flows).map((type) => (_jsx(OAuthRequiredScope, { flow: flows[type], requiredScopes: requiredScopes }, type)));
38
+ }
39
+ return (_jsx(SecuritySchemeItem, { label: translate('openapi.requiredScopes', 'Required scopes'), value: _jsx(Row, { children: requiredScopes.map((scope) => (_jsx(Tag, { className: "tag-grey", children: scope }, scope))) }) }));
40
+ }
41
+ function OAuthRequiredScope({ flow, requiredScopes, }) {
42
+ const translate = useTranslate();
43
+ return (_jsxs(_Fragment, { children: [_jsx(SecuritySchemeItem, { label: translate('openapi.requiredScopes', 'Required scopes'), value: " " }), requiredScopes.map((scope) => (_jsx(SecuritySchemeItem, { label: _jsx(StyledTag, { className: "tag-grey", children: scope }), value: _jsx(Markdown, { source: flow?.scopes[scope] || '' }) }, scope)))] }));
44
+ }
45
+ const StyledTag = styled(Tag) `
2
46
  font-family: var(--font-family-base);
3
47
  font-size: var(--font-size-base);
4
48
  line-height: var(--line-height-base);
@@ -6,28 +50,34 @@ import{jsx as r,Fragment as p,jsxs as c}from"react/jsx-runtime";import{memo as S
6
50
  padding: 0 var(--spacing-xs);
7
51
  border: var(--tag-border-width) var(--tag-border-style) var(--tag-bg-color);
8
52
  border-radius: var(--tag-border-radius);
9
- `,A=i.div`
53
+ `;
54
+ const ScopeHeader = styled.div `
10
55
  cursor: pointer;
11
56
  display: flex;
12
57
  gap: var(--spacing-xxs);
13
58
  align-items: center;
14
59
  user-select: none;
15
- `,R=i.div`
60
+ `;
61
+ const Row = styled.div `
16
62
  display: flex;
17
63
  flex-wrap: wrap;
18
64
  gap: var(--spacing-xxs);
19
65
  word-break: normal;
20
- `,z=i.div`
21
- max-height: ${e=>e.isOpen?"1000px":"0"};
22
- opacity: ${e=>e.isOpen?"1":"0"};
66
+ `;
67
+ const ScopesListWrapper = styled.div `
68
+ max-height: ${(props) => (props.isOpen ? '1000px' : '0')};
69
+ opacity: ${(props) => (props.isOpen ? '1' : '0')};
23
70
  overflow: hidden;
24
71
  transition:
25
72
  max-height 0.5s ease-in-out,
26
73
  opacity 0.5s ease-in-out;
27
- `,C=i.span`
74
+ `;
75
+ const AnimatedChevronWrapper = styled.span `
28
76
  display: inline-flex;
29
77
  align-items: center;
30
78
  justify-content: center;
31
- transform: ${e=>e.isOpen?"rotate(90deg)":"rotate(0deg)"};
79
+ transform: ${(props) => (props.isOpen ? 'rotate(90deg)' : 'rotate(0deg)')};
32
80
  transition: transform 0.5s ease-in-out;
33
- `,B=S(y);export{B as OAuthScopes};
81
+ `;
82
+ export const OAuthScopes = memo(OAuthScopesComponent);
83
+ //# sourceMappingURL=OAuthScopes.js.map
@@ -1 +1,15 @@
1
- import{jsx as r,Fragment as i,jsxs as s}from"react/jsx-runtime";import{useState as l}from"react";import{Portal as n}from"@redocly/theme/components/Portal/Portal";import{useModalScrollLock as m}from"@redocly/theme/core/openapi";import{SecurityButton as a}from"./SecurityButton.js";import{SecurityModal as u}from"./SecurityModal.js";function j({securities:o}){const[t,e]=l(!1);return m(t),o.length?s(i,{children:[r(a,{securities:o,onClick:()=>e(!0)}),t&&r(n,{mountId:"api-content",children:r(u,{securities:o,onClose:()=>e(!1)})})]}):null}export{j as Security};
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Portal } from '@redocly/theme/components/Portal/Portal';
4
+ import { useModalScrollLock } from '@redocly/theme/core/openapi';
5
+ import { SecurityButton } from './SecurityButton.js';
6
+ import { SecurityModal } from './SecurityModal.js';
7
+ export function Security({ securities }) {
8
+ const [isModalVisible, setIsModalVisible] = useState(false);
9
+ useModalScrollLock(isModalVisible);
10
+ if (!securities.length) {
11
+ return null;
12
+ }
13
+ return (_jsxs(_Fragment, { children: [_jsx(SecurityButton, { securities: securities, onClick: () => setIsModalVisible(true) }), isModalVisible && (_jsx(Portal, { mountId: "api-content", children: _jsx(SecurityModal, { securities: securities, onClose: () => setIsModalVisible(false) }) }))] }));
14
+ }
15
+ //# sourceMappingURL=Security.js.map
@@ -1,8 +1,27 @@
1
- import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Fragment as c}from"react";import{SecurityIcon as v}from"@redocly/theme/icons/SecurityIcon/SecurityIcon";import{Panel as f}from"@redocly/theme/components/Panel/Panel";import{Button as h}from"@redocly/theme/components/Button/Button";import{useTranslate as g}from"../../hooks/index.js";import{styled as e}from"../../styled-components.js";function T({securities:o,onClick:p}){const n=g();return r(y,{header:()=>t(b,{children:[r(v,{}),r(w,{children:n("openapi.security","Security")}),r(x,{onClick:p,variant:"link",children:n("openapi.viewSecurityDetails","View details")})]}),isExpandable:!1,children:r(S,{children:o.map((a,i)=>{const s=o.length>1&&a.schemes.length>1,m=a.schemes.map(({id:l},u)=>t(c,{children:[l,u<a.schemes.length-1&&r(d,{children:" and "})]},l));return t(c,{children:[s?"(":"",m,s?")":"",i<o.length-1&&r(d,{children:" or "})]},i)})})})}const y=e(f)`
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ import { SecurityIcon } from '@redocly/theme/icons/SecurityIcon/SecurityIcon';
4
+ import { Panel } from '@redocly/theme/components/Panel/Panel';
5
+ import { Button } from '@redocly/theme/components/Button/Button';
6
+ import { useTranslate } from '../../hooks/index.js';
7
+ import { styled } from '../../styled-components.js';
8
+ export function SecurityButton({ securities, onClick }) {
9
+ const translate = useTranslate();
10
+ const securityHeader = () => {
11
+ return (_jsxs(SecurityHeader, { children: [_jsx(SecurityIcon, {}), _jsx(Title, { children: translate('openapi.security', 'Security') }), _jsx(ViewDetailsButton, { onClick: onClick, variant: "link", children: translate('openapi.viewSecurityDetails', 'View details') })] }));
12
+ };
13
+ return (_jsx(SecurityPanel, { header: securityHeader, isExpandable: false, children: _jsx(SecurityList, { children: securities.map((security, secIndex) => {
14
+ const isMultiple = securities.length > 1 && security.schemes.length > 1;
15
+ const schemeNodes = security.schemes.map(({ id }, index) => (_jsxs(Fragment, { children: [id, index < security.schemes.length - 1 && _jsx(Conjunction, { children: " and " })] }, id)));
16
+ return (_jsxs(Fragment, { children: [isMultiple ? '(' : '', schemeNodes, isMultiple ? ')' : '', secIndex < securities.length - 1 && _jsx(Conjunction, { children: " or " })] }, secIndex));
17
+ }) }) }));
18
+ }
19
+ const SecurityPanel = styled(Panel) `
2
20
  margin-top: var(--spacing-base);
3
21
  border: var(--panel-border);
4
22
  border-radius: var(--panel-border-radius);
5
- `,b=e.div`
23
+ `;
24
+ const SecurityHeader = styled.div `
6
25
  display: flex;
7
26
  align-items: center;
8
27
  justify-content: space-between;
@@ -12,19 +31,24 @@ import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Fragment as c}from"reac
12
31
  background-color: var(--layer-color);
13
32
  border-bottom: var(--panel-border);
14
33
  border-radius: var(--panel-border-radius) var(--panel-border-radius) 0 0;
15
- `,x=e(h)`
34
+ `;
35
+ const ViewDetailsButton = styled(Button) `
16
36
  margin-left: auto;
17
37
  font-size: var(--font-size-sm);
18
- `,w=e.span`
38
+ `;
39
+ const Title = styled.span `
19
40
  font-family: var(--font-family-base);
20
41
  font-weight: var(--font-weight-medium);
21
42
  color: var(--text-color-primary);
22
- `,S=e.div`
43
+ `;
44
+ const SecurityList = styled.div `
23
45
  flex: 1;
24
46
  text-overflow: ellipsis;
25
47
  overflow: hidden;
26
48
  padding: var(--spacing-xs) var(--spacing-sm);
27
49
  color: var(--text-color-primary);
28
- `,d=e.span`
50
+ `;
51
+ const Conjunction = styled.span `
29
52
  color: var(--text-color-description);
30
- `;export{T as SecurityButton};
53
+ `;
54
+ //# sourceMappingURL=SecurityButton.js.map
@@ -1,16 +1,40 @@
1
- import{jsx as r,Fragment as p,jsxs as i}from"react/jsx-runtime";import{SecuritySchemeItem as a}from"./SecuritySchemeItem.js";import{titleize as v}from"../../utils/index.js";import{OAuthFlow as g}from"./OAuthFlow.js";import{StyledLink as w}from"./styled.js";import{Markdown as x}from"../Markdown/index.js";import{useTranslate as S}from"../../hooks/index.js";import{OAuthScopes as y}from"./OAuthScopes.js";import{styled as m}from"../../styled-components.js";function K({type:o,bearerFormat:c,name:d,flows:t,openIdConnectUrl:n,description:h,id:l,securities:u,in:f}){const e=S();if(!o||!l)return null;const b={http:i(p,{children:[r(a,{label:e("openapi.httpAuthorizationScheme","HTTP Authorization Scheme"),value:o}),r(a,{label:e("openapi.bearerFormat","Bearer Format"),value:c})]}),apiKey:r(a,{label:`${v(f||"")} ${e("openapi.parameterName","parameter name")}:`,value:d}),oauth2:i(p,{children:[r(a,{label:e("openapi.flowType","Flow type"),value:o}),t&&Object.keys(t).map(s=>r(g,{flow:t[s]},s))]}),openIdConnect:r(a,{label:e("openapi.connectUrl","Connect URL"),value:n&&r(w,{target:"_blank",rel:"noopener noreferrer",href:n,children:n})})};return i(F,{children:[r(T,{children:l}),r(x,{source:h}),i(z,{children:[b[o]||null,r(y,{id:l,securities:u,flows:t})]})]})}const F=m.div`
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SecuritySchemeItem } from './SecuritySchemeItem.js';
3
+ import { titleize } from '../../utils/index.js';
4
+ import { OAuthFlow } from './OAuthFlow.js';
5
+ import { StyledLink } from './styled.js';
6
+ import { Markdown } from '../Markdown/index.js';
7
+ import { useTranslate } from '../../hooks/index.js';
8
+ import { OAuthScopes } from './OAuthScopes.js';
9
+ import { styled } from '../../styled-components.js';
10
+ export function SecurityFlow({ type, bearerFormat, name, flows, openIdConnectUrl, description, id, securities, in: apiKeyIn, }) {
11
+ const translate = useTranslate();
12
+ if (!type || !id)
13
+ return null;
14
+ const schemaType = {
15
+ http: (_jsxs(_Fragment, { children: [_jsx(SecuritySchemeItem, { label: translate('openapi.httpAuthorizationScheme', 'HTTP Authorization Scheme'), value: type }), _jsx(SecuritySchemeItem, { label: translate('openapi.bearerFormat', 'Bearer Format'), value: bearerFormat })] })),
16
+ apiKey: (_jsx(SecuritySchemeItem, { label: `${titleize(apiKeyIn || '')} ${translate('openapi.parameterName', 'parameter name')}:`, value: name })),
17
+ oauth2: (_jsxs(_Fragment, { children: [_jsx(SecuritySchemeItem, { label: translate('openapi.flowType', 'Flow type'), value: type }), flows && Object.keys(flows).map((type) => _jsx(OAuthFlow, { flow: flows[type] }, type))] })),
18
+ openIdConnect: (_jsx(SecuritySchemeItem, { label: translate('openapi.connectUrl', 'Connect URL'), value: openIdConnectUrl && (_jsx(StyledLink, { target: "_blank", rel: "noopener noreferrer", href: openIdConnectUrl, children: openIdConnectUrl })) })),
19
+ };
20
+ return (_jsxs(Wrapper, { children: [_jsx(TitleSchema, { children: id }), _jsx(Markdown, { source: description }), _jsxs(List, { children: [schemaType[type] || null, _jsx(OAuthScopes, { id: id, securities: securities, flows: flows })] })] }));
21
+ }
22
+ const Wrapper = styled.div `
2
23
  background: var(--layer-color);
3
24
  padding: var(--spacing-base);
4
25
  border-radius: var(--border-radius);
5
26
  border: 1px solid var(--border-color-secondary);
6
27
  width: 100%;
7
28
  margin-top: var(--spacing-base);
8
- `,z=m.div`
29
+ `;
30
+ const List = styled.div `
9
31
  width: 100%;
10
32
  margin-top: var(--spacing-md);
11
- `,T=m.p`
33
+ `;
34
+ const TitleSchema = styled.p `
12
35
  font-size: var(--font-size-base);
13
36
  margin: 0 0 var(--spacing-xs);
14
37
  text-transform: capitalize;
15
38
  font-weight: var(--font-weight-semibold);
16
- `;export{K as SecurityFlow};
39
+ `;
40
+ //# sourceMappingURL=SecurityFlow.js.map