@redocly/openapi-docs 3.12.0 → 3.12.1

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 +3 -3
@@ -1,22 +1,32 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{memo as a}from"react";import{styled as r}from"../../../styled-components.js";const l=r.div`
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { styled } from '../../../styled-components.js';
4
+ const Container = styled.div `
2
5
  width: 100%;
3
6
  display: flex;
4
7
  justify-content: space-between;
5
8
  gap: var(--spacing-xs);
6
9
  padding: var(--spacing-xs) 0;
7
- `,n=r.div`
10
+ `;
11
+ const Item = styled.div `
8
12
  display: flex;
9
13
  flex-direction: column;
10
14
  width: 100%;
11
15
  justify-content: center;
12
16
  align-items: center;
13
17
  gap: var(--spacing-sm);
14
- `,t=r.div`
18
+ `;
19
+ const SkeletonBox = styled.div `
15
20
  display: inline-block;
16
- height: ${({type:o})=>o==="icon"?"var(--control-height-sm)":"calc(var(--control-height-sm) * 0.5)"};
21
+ height: ${({ type }) => type === 'icon' ? 'var(--control-height-sm)' : 'calc(var(--control-height-sm) * 0.5)'};
17
22
  position: relative;
18
23
  overflow: hidden;
19
24
  background-color: var(--layer-color-hover);
20
25
  border-radius: var(--border-radius);
21
- width: ${({type:o})=>o==="icon"?"var(--control-height-sm)":"64px"};
22
- `;function c(){return i(l,{children:[i(n,{children:[e(t,{type:"icon"}),e(t,{type:"label"})]}),i(n,{children:[e(t,{type:"icon"}),e(t,{type:"label"})]}),i(n,{children:[e(t,{type:"icon"}),e(t,{type:"label"})]}),i(n,{children:[e(t,{type:"icon"}),e(t,{type:"label"})]})]})}const h=a(c);export{h as LanguageListSkeleton};
26
+ width: ${({ type }) => (type === 'icon' ? 'var(--control-height-sm)' : '64px')};
27
+ `;
28
+ function LanguageListSkeletonComponent() {
29
+ return (_jsxs(Container, { children: [_jsxs(Item, { children: [_jsx(SkeletonBox, { type: "icon" }), _jsx(SkeletonBox, { type: "label" })] }), _jsxs(Item, { children: [_jsx(SkeletonBox, { type: "icon" }), _jsx(SkeletonBox, { type: "label" })] }), _jsxs(Item, { children: [_jsx(SkeletonBox, { type: "icon" }), _jsx(SkeletonBox, { type: "label" })] }), _jsxs(Item, { children: [_jsx(SkeletonBox, { type: "icon" }), _jsx(SkeletonBox, { type: "label" })] })] }));
30
+ }
31
+ export const LanguageListSkeleton = memo(LanguageListSkeletonComponent);
32
+ //# sourceMappingURL=LanguageListSkeleton.js.map
@@ -1,8 +1,14 @@
1
- import{jsx as r,jsxs as o}from"react/jsx-runtime";import{keyframes as e}from"styled-components";import{H2 as a}from"@redocly/theme/components/Typography/H2";import{Section as n,SamplesMiddlePanel as s}from"../panels.js";import{styled as d}from"../../../styled-components.js";const l=e`
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { keyframes } from 'styled-components';
3
+ import { H2 } from '@redocly/theme/components/Typography/H2';
4
+ import { Section, SamplesMiddlePanel } from '../panels.js';
5
+ import { styled } from '../../../styled-components.js';
6
+ const shimmer = keyframes `
2
7
  100% {
3
8
  transform: translateX(100%);
4
9
  }
5
- `,t=d.div`
10
+ `;
11
+ export const SkeletonBox = styled.div `
6
12
  display: inline-block;
7
13
  height: 1em;
8
14
  position: relative;
@@ -10,7 +16,7 @@ import{jsx as r,jsxs as o}from"react/jsx-runtime";import{keyframes as e}from"sty
10
16
  background-color: var(--bg-color-raised);
11
17
  border-radius: var(--border-radius);
12
18
  margin-top: var(--spacing-base);
13
- width: ${({width:i})=>i||"100%"};
19
+ width: ${({ width }) => width || '100%'};
14
20
 
15
21
  &::after {
16
22
  position: absolute;
@@ -26,7 +32,11 @@ import{jsx as r,jsxs as o}from"react/jsx-runtime";import{keyframes as e}from"sty
26
32
  rgba(255, 255, 255, 0.5) 60%,
27
33
  rgba(255, 255, 255, 0)
28
34
  );
29
- animation: ${l} 2s infinite;
35
+ animation: ${shimmer} 2s infinite;
30
36
  content: '';
31
37
  }
32
- `;function b(){return r(n,{children:o(s,{children:[r(a,{children:r(t,{width:"40%"})}),r(t,{width:"80%"}),r(t,{width:"90%"}),r(t,{width:"83%"}),r(t,{width:"80%"})]})})}export{b as Skeleton,t as SkeletonBox};
38
+ `;
39
+ export function Skeleton() {
40
+ return (_jsx(Section, { children: _jsxs(SamplesMiddlePanel, { children: [_jsx(H2, { children: _jsx(SkeletonBox, { width: "40%" }) }), _jsx(SkeletonBox, { width: "80%" }), _jsx(SkeletonBox, { width: "90%" }), _jsx(SkeletonBox, { width: "83%" }), _jsx(SkeletonBox, { width: "80%" })] }) }));
41
+ }
42
+ //# sourceMappingURL=Skeleton.js.map
@@ -1 +1,3 @@
1
- export*from"./Skeleton.js";export*from"./LanguageListSkeleton.js";
1
+ export * from './Skeleton.js';
2
+ export * from './LanguageListSkeleton.js';
3
+ //# sourceMappingURL=index.js.map
@@ -1,7 +1,9 @@
1
- import{styled as e}from"../../styled-components.js";const t=e.h5`
1
+ import { styled } from '../../styled-components.js';
2
+ export const FieldsGroupHeader = styled.h5 `
2
3
  color: var(--text-color-secondary);
3
4
  font-weight: bold;
4
5
  text-transform: uppercase;
5
6
  font-size: 14px;
6
7
  line-height: 20px;
7
- `;export{t as FieldsGroupHeader};
8
+ `;
9
+ //# sourceMappingURL=headers.js.map
@@ -1 +1,14 @@
1
- import{Select as r}from"./Select/index.js";import{ShareLinkToField as p,generateDeepLink as a}from"./LinkToField.js";import{deprecatedCss as x}from"./mixins.js";import{Container as d,HttpVerb as n,MimeLabel as i}from"./styled.js";import{CodeBlockPanel as k}from"./CodeBlockPanel.js";import{CustomBadges as s,StyledBadge as L,NavigationBadge as S}from"./Badges.js";import{ExpandableExample as C}from"./ExpandableExample/index.js";export*from"./Fields/index.js";export*from"./panels.js";import{FieldsGroupHeader as u}from"./headers.js";import{ShareLink as F,Link as H}from"./linkify.js";export*from"./schema.js";import{Skeleton as D}from"./Skeleton/index.js";export{k as CodeBlockPanel,d as Container,s as CustomBadges,C as ExpandableExample,u as FieldsGroupHeader,n as HttpVerb,H as Link,i as MimeLabel,S as NavigationBadge,r as Select,F as ShareLink,p as ShareLinkToField,D as Skeleton,L as StyledBadge,x as deprecatedCss,a as generateDeepLink};
1
+ export { Select } from './Select/index.js';
2
+ export { ShareLinkToField, generateDeepLink } from './LinkToField.js';
3
+ export { deprecatedCss } from './mixins.js';
4
+ export { Container, HttpVerb, MimeLabel } from './styled.js';
5
+ export { CodeBlockPanel } from './CodeBlockPanel.js';
6
+ export { CustomBadges, StyledBadge, NavigationBadge } from './Badges.js';
7
+ export { ExpandableExample } from './ExpandableExample/index.js';
8
+ export * from './Fields/index.js';
9
+ export * from './panels.js';
10
+ export { FieldsGroupHeader } from './headers.js';
11
+ export { ShareLink, Link } from './linkify.js';
12
+ export * from './schema.js';
13
+ export { Skeleton } from './Skeleton/index.js';
14
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,24 @@
1
- import{jsx as n,jsxs as c}from"react/jsx-runtime";import{useAtomValue as m}from"jotai";import{Link as d}from"react-router-dom";import{LinkIcon as e}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{globalOptionsAtom as h}from"../../jotai/store.js";import{tryDecodeURIComponent as u}from"../../utils/index.js";import{styled as f}from"../../styled-components.js";function k(i){const{routingBasePath:a,unstable_hooks:r,onDeepLinkClick:o}=m(h),t=i.security?r?.replaceSecurityLink?.({securityRequirementId:i.to}):i.to,l=o&&{onClick:s=>{s.preventDefault(),o((a||"")+t)}};return t?n(d,{"aria-label":i["aria-label"]||`link to ${t}`,id:u(i.id||""),className:i.className||"",to:t?.startsWith("#")?t:(a||"")+t,...l,children:i.children}):i.children?c("span",{"aria-label":i["aria-label"]||`link to ${t}`,className:i.className,children:[" ",i.children," "]}):null}const y=f(k)`
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAtomValue } from 'jotai';
3
+ import { Link as LinkRouter } from 'react-router-dom';
4
+ import { LinkIcon } from '@redocly/theme/icons/LinkIcon/LinkIcon';
5
+ import { globalOptionsAtom } from '../../jotai/store.js';
6
+ import { tryDecodeURIComponent } from '../../utils/index.js';
7
+ import { styled } from '../../styled-components.js';
8
+ export function Link(props) {
9
+ const { routingBasePath, unstable_hooks, onDeepLinkClick } = useAtomValue(globalOptionsAtom);
10
+ const link = props.security
11
+ ? unstable_hooks?.replaceSecurityLink?.({ securityRequirementId: props.to })
12
+ : props.to;
13
+ const linkHandler = onDeepLinkClick && {
14
+ onClick: (e) => {
15
+ e.preventDefault();
16
+ onDeepLinkClick((routingBasePath || '') + link);
17
+ },
18
+ };
19
+ return link ? (_jsx(LinkRouter, { "aria-label": props['aria-label'] || `link to ${link}`, id: tryDecodeURIComponent(props.id || ''), className: props.className || '', to: link?.startsWith('#') ? link : (routingBasePath || '') + link, ...linkHandler, children: props.children })) : props.children ? (_jsxs("span", { "aria-label": props['aria-label'] || `link to ${link}`, className: props.className, children: [' ', props.children, ' '] })) : null;
20
+ }
21
+ export const StyledShareLink = styled(Link) `
2
22
  position: absolute;
3
23
  top: 50%;
4
24
  left: 0;
@@ -6,15 +26,19 @@ import{jsx as n,jsxs as c}from"react/jsx-runtime";import{useAtomValue as m}from"
6
26
  padding-right: var(--heading-anchor-offset-right);
7
27
  z-index: 1;
8
28
 
9
- ${e} {
29
+ ${LinkIcon} {
10
30
  opacity: 0;
11
31
  transition:
12
32
  visibility 0.3s linear,
13
33
  opacity 0.3s linear;
14
34
  }
15
35
 
16
- :hover ${e}, :focus ${e} {
36
+ :hover ${LinkIcon}, :focus ${LinkIcon} {
17
37
  visibility: visible;
18
38
  opacity: 1;
19
39
  }
20
- `;function N(i){return n(y,{...i,children:n(e,{size:"13px",color:"--heading-anchor-color"})})}export{k as Link,N as ShareLink,y as StyledShareLink};
40
+ `;
41
+ export function ShareLink(props) {
42
+ return (_jsx(StyledShareLink, { ...props, children: _jsx(LinkIcon, { size: "13px", color: "--heading-anchor-color" }) }));
43
+ }
44
+ //# sourceMappingURL=linkify.js.map
@@ -1,4 +1,6 @@
1
- import{css as e}from"styled-components";const r=e`
1
+ import { css } from 'styled-components';
2
+ export const deprecatedCss = css `
2
3
  text-decoration: line-through;
3
4
  color: var(--schemas-property-deprecated-text-color);
4
- `;export{r as deprecatedCss};
5
+ `;
6
+ //# sourceMappingURL=mixins.js.map
@@ -1,45 +1,63 @@
1
- import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/config";import{H2 as l}from"@redocly/theme/components/Typography/H2";import{Markdown as d}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as t}from"@redocly/theme/core/openapi";import{SECTION_ATTR as c}from"../../constants.js";import{styled as r}from"../../styled-components.js";const f=r.div`
2
- ${({compact:a,isStacked:o,fullWidth:e})=>{const n=a?0:"var(--spacing-vertical)";return i`
1
+ import { css } from 'styled-components';
2
+ import { LayoutVariant } from '@redocly/config';
3
+ import { H2 } from '@redocly/theme/components/Typography/H2';
4
+ import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
5
+ import { breakpoints } from '@redocly/theme/core/openapi';
6
+ import { SECTION_ATTR } from '../../constants.js';
7
+ import { styled } from '../../styled-components.js';
8
+ export const SamplesMiddlePanel = styled.div `
9
+ ${({ compact, isStacked, fullWidth }) => {
10
+ const vPadding = compact ? 0 : 'var(--spacing-vertical)';
11
+ return css `
3
12
  display: flex;
4
13
  flex-direction: column;
5
14
  width: 100%;
6
- padding: ${n} var(--panel-gap-horizontal);
15
+ padding: ${vPadding} var(--panel-gap-horizontal);
7
16
 
8
17
  &:empty {
9
18
  display: none;
10
19
  }
11
20
 
12
- @media screen and (min-width: ${t.large}) {
13
- width: ${e||o?"100%":"calc(100% - var(--panel-samples-width))"};
14
- padding-left: ${o?"var(--panel-gap-horizontal)":"calc(var(--panel-gap-horizontal) * 2)"};
15
- padding-right: ${o?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
21
+ @media screen and (min-width: ${breakpoints.large}) {
22
+ width: ${fullWidth || isStacked ? '100%' : 'calc(100% - var(--panel-samples-width))'};
23
+ padding-left: ${isStacked
24
+ ? 'var(--panel-gap-horizontal)'
25
+ : 'calc(var(--panel-gap-horizontal) * 2)'};
26
+ padding-right: ${isStacked ? 'var(--panel-gap-vertical)' : 'var(--panel-gap-horizontal)'};
16
27
  padding-top: 0;
17
- padding-bottom: ${o?"var(--spacing-vertical)":0};
28
+ padding-bottom: ${isStacked ? 'var(--spacing-vertical)' : 0};
18
29
  }
19
30
 
20
31
  @media print {
21
32
  width: 100%;
22
- padding-top: ${n};
23
- padding-bottom: ${n};
33
+ padding-top: ${vPadding};
34
+ padding-bottom: ${vPadding};
24
35
  }
25
- `}};
36
+ `;
37
+ }};
26
38
 
27
- ${({compact:a})=>a&&i`
39
+ ${({ compact }) => compact &&
40
+ css `
28
41
  & & {
29
42
  padding-left: 0;
30
43
  padding-right: 0;
31
44
  }
32
45
  `}
33
46
 
34
- &:last-child > ${d} :last-child,
35
- ${d} article :last-child {
47
+ &:last-child > ${Markdown} :last-child,
48
+ ${Markdown} article :last-child {
36
49
  margin-bottom: 0;
37
50
  }
38
- `,w=r.div.attrs(a=>({[c]:a.sectionId,id:a.id}))`
51
+ `;
52
+ export const Section = styled.div.attrs((props) => ({
53
+ [SECTION_ATTR]: props.sectionId,
54
+ id: props.id,
55
+ })) `
39
56
  padding: 0;
40
57
  width: 100%;
41
58
 
42
- ${({expanded:a})=>a&&i`
59
+ ${({ expanded }) => expanded &&
60
+ css `
43
61
  background-color: var(--layer-color);
44
62
  border-bottom: 1px solid var(--border-color-secondary);
45
63
  --code-block-bg-color: var(--bg-color);
@@ -50,10 +68,11 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
50
68
  min-height: initial;
51
69
  }
52
70
 
53
- @media screen and (min-width: ${t.medium}) {
71
+ @media screen and (min-width: ${breakpoints.medium}) {
54
72
  padding-top: var(--spacing-xs);
55
73
 
56
- ${({expanded:a})=>!a&&i`
74
+ ${({ expanded }) => !expanded &&
75
+ css `
57
76
  padding-bottom: var(--spacing-xs);
58
77
  `}
59
78
  }
@@ -62,7 +81,8 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
62
81
  padding: 0;
63
82
  }
64
83
 
65
- ${({underlined:a})=>a&&i`
84
+ ${({ underlined }) => underlined &&
85
+ css `
66
86
  position: relative;
67
87
 
68
88
  &:not(:last-of-type):after {
@@ -74,10 +94,11 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
74
94
  border-bottom: 1px solid var(--border-color-primary);
75
95
  }
76
96
  `}
77
- ${l} {
97
+ ${H2} {
78
98
  position: relative;
79
99
  }
80
- `,x=r.div`
100
+ `;
101
+ export const SamplesPanel = styled.div `
81
102
  color: var(--panel-samples-text-color);
82
103
  width: 100%;
83
104
  height: fit-content;
@@ -94,12 +115,12 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
94
115
  display: none;
95
116
  }
96
117
 
97
- @media screen and (min-width: ${t.large}) {
98
- width: ${({isStacked:a})=>a?"100%":"var(--panel-samples-width)"};
118
+ @media screen and (min-width: ${breakpoints.large}) {
119
+ width: ${({ isStacked }) => (isStacked ? '100%' : 'var(--panel-samples-width)')};
99
120
  padding-top: 0;
100
121
  padding-bottom: 0;
101
- padding-left: ${({isStacked:a})=>a?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
102
- padding-right: ${({isStacked:a})=>a?"var(--panel-gap-horizontal)":"calc(var(--panel-gap-horizontal) * 2)"};
122
+ padding-left: ${({ isStacked }) => isStacked ? 'var(--panel-gap-vertical)' : 'var(--panel-gap-horizontal)'};
123
+ padding-right: ${({ isStacked }) => isStacked ? 'var(--panel-gap-horizontal)' : 'calc(var(--panel-gap-horizontal) * 2)'};
103
124
  }
104
125
 
105
126
  @media print {
@@ -107,18 +128,20 @@ import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/
107
128
  padding-top: var(--spacing-vertical);
108
129
  padding-bottom: var(--spacing-vertical);
109
130
  }
110
- `,y=r.div`
131
+ `;
132
+ export const Row = styled.div `
111
133
  display: flex;
112
134
  flex-direction: column;
113
135
  justify-content: space-between;
114
136
  width: 100%;
115
137
  padding: 0;
116
138
 
117
- @media screen and (min-width: ${t.large}) {
118
- flex-direction: ${({layout:a})=>a!==p.STACKED?"row":"column"};
139
+ @media screen and (min-width: ${breakpoints.large}) {
140
+ flex-direction: ${({ layout }) => (layout !== LayoutVariant.STACKED ? 'row' : 'column')};
119
141
  }
120
142
 
121
143
  @media print {
122
144
  flex-direction: column;
123
145
  }
124
- `;export{y as Row,f as SamplesMiddlePanel,x as SamplesPanel,w as Section};
146
+ `;
147
+ //# sourceMappingURL=panels.js.map
@@ -1,4 +1,7 @@
1
- import{css as e}from"styled-components";import{deprecatedCss as t}from"./mixins.js";import{styled as o}from"../../styled-components.js";const a=o.button`
1
+ import { css } from 'styled-components';
2
+ import { deprecatedCss } from './mixins.js';
3
+ import { styled } from '../../styled-components.js';
4
+ export const OneOfButton = styled.button `
2
5
  border: 1px solid var(--schema-buttons-border-color);
3
6
  height: 24px;
4
7
  border-radius: var(--border-radius);
@@ -24,9 +27,10 @@ import{css as e}from"styled-components";import{deprecatedCss as t}from"./mixins.
24
27
  background-color: var(--schema-buttons-bg-color-active);
25
28
  }
26
29
 
27
- ${({deprecated:r})=>r&&t};
30
+ ${({ deprecated }) => deprecated && deprecatedCss};
28
31
 
29
- ${({selected:r})=>r&&e`
32
+ ${({ selected }) => selected &&
33
+ css `
30
34
  border-color: var(--schema-buttons-selected-border-color);
31
35
  background-color: var(--schema-buttons-selected-bg-color);
32
36
  color: var(--schema-buttons-selected-text-color);
@@ -38,19 +42,22 @@ import{css as e}from"styled-components";import{deprecatedCss as t}from"./mixins.
38
42
  background-color: var(--schema-buttons-active-hover-background-color);
39
43
  }
40
44
  `}
41
- `,i=o.div`
45
+ `;
46
+ export const OneOfList = styled.div `
42
47
  display: inline;
43
48
 
44
49
  flex-wrap: wrap;
45
50
  margin: 4px -3px;
46
51
  margin-left: 10px;
47
52
 
48
- ${a} {
53
+ ${OneOfButton} {
49
54
  margin: 2px;
50
55
  }
51
- `,l=o.div`
56
+ `;
57
+ export const Wrapper = styled.div `
52
58
  margin-bottom: 1em;
53
- `,d=o.div`
59
+ `;
60
+ export const SelectionTitle = styled.div `
54
61
  font-size: var(--font-size-sm);
55
62
  line-height: var(--line-height-sm);
56
63
  color: var(--tag-basic-content-color);
@@ -70,4 +77,5 @@ import{css as e}from"styled-components";import{deprecatedCss as t}from"./mixins.
70
77
  bottom: calc(-1 * var(--spacing-xs));
71
78
  left: var(--spacing-xs);
72
79
  }
73
- `;export{a as OneOfButton,i as OneOfList,d as SelectionTitle,l as Wrapper};
80
+ `;
81
+ //# sourceMappingURL=schema.js.map
@@ -1,8 +1,11 @@
1
- import{Tag as o}from"@redocly/theme/components/Tag/Tag";import{styled as r}from"../../styled-components.js";const t=r.div`
1
+ import { Tag } from '@redocly/theme/components/Tag/Tag';
2
+ import { styled } from '../../styled-components.js';
3
+ export const Container = styled.div `
2
4
  display: flex;
3
5
  flex-direction: column;
4
6
  margin: var(--spacing-unit) var(--spacing-md) var(--spacing-sm);
5
- `,i=r(o)`
7
+ `;
8
+ export const HttpVerb = styled(Tag) `
6
9
  text-transform: uppercase;
7
10
  background-color: unset;
8
11
  border: none;
@@ -13,7 +16,8 @@ import{Tag as o}from"@redocly/theme/components/Tag/Tag";import{styled as r}from"
13
16
  font-size: var(--font-size-sm);
14
17
  line-height: var(--line-height-sm);
15
18
  align-self: flex-end;
16
- `,s=r.div`
19
+ `;
20
+ export const MimeLabel = styled.div `
17
21
  background-color: var(--panel-samples-dropdown-bg-color);
18
22
  color: var(--panel-samples-text-color);
19
23
  font-family: inherit;
@@ -23,7 +27,8 @@ import{Tag as o}from"@redocly/theme/components/Tag/Tag";import{styled as r}from"
23
27
  font-size: var(--docs-dropdown-font-size);
24
28
  border: var(--panel-samples-dropdown-border);
25
29
  border-radius: var(--border-radius-md);
26
- `,a=r.span`
30
+ `;
31
+ export const ArrayLabel = styled.span `
27
32
  display: flex;
28
33
  align-items: center;
29
34
  gap: var(--spacing-xs);
@@ -34,7 +39,8 @@ import{Tag as o}from"@redocly/theme/components/Tag/Tag";import{styled as r}from"
34
39
  flex: auto;
35
40
  border-top: 1px solid var(--border-color-primary);
36
41
  }
37
- `,d=r.span`
42
+ `;
43
+ export const LabelValue = styled.span `
38
44
  padding: 0 var(--spacing-xs);
39
45
  border-radius: var(--border-radius);
40
46
  border: 1px solid var(--border-color-secondary);
@@ -42,7 +48,8 @@ import{Tag as o}from"@redocly/theme/components/Tag/Tag";import{styled as r}from"
42
48
  font-size: var(--font-size-sm);
43
49
  line-height: var(--line-height-sm);
44
50
  color: var(--tag-basic-content-color);
45
- `,l=r(a)`
51
+ `;
52
+ export const ArrayClosingLabel = styled(ArrayLabel) `
46
53
  margin-top: 0;
47
54
  margin-left: auto;
48
55
 
@@ -55,4 +62,5 @@ import{Tag as o}from"@redocly/theme/components/Tag/Tag";import{styled as r}from"
55
62
  flex: auto;
56
63
  border-top: 1px solid var(--border-color-primary);
57
64
  }
58
- `;export{l as ArrayClosingLabel,a as ArrayLabel,t as Container,i as HttpVerb,d as LabelValue,s as MimeLabel};
65
+ `;
66
+ //# sourceMappingURL=styled.js.map
@@ -1 +1,25 @@
1
- export*from"./RedoclyOpenAPIDocs/index.js";export*from"./pluggable/index.js";export*from"./common/index.js";export*from"./ApiInfo/index.js";import{SectionItem as x}from"./SectionItem/index.js";import{ContentItem as a}from"./ContentItem/index.js";import{ContentItems as l}from"./ContentItems/index.js";import{Discriminator as I}from"./Discriminator/index.js";export*from"./Schema/index.js";import{OperationItem as S}from"./OperationItem/index.js";export*from"./Markdown/index.js";export*from"./Responses/index.js";export*from"./ResponseSamples/ResponseSamples.js";import{PayloadSamples as y,ExampleValue as D,Example as O,SelectWrapper as P}from"./PayloadSamples/index.js";export*from"./MediaTypeSwitch/index.js";export*from"./RequestParameters/index.js";export*from"./SelectOrLabel/index.js";export*from"./ErrorBoundary/index.js";export*from"./SideMenu/index.js";export*from"./StickySidebar/StickyResponsiveSidebar.js";export*from"./SchemaDefinition/SchemaDefinition.js";export*from"./RequestSamples/RequestSamples.js";export{a as ContentItem,l as ContentItems,I as Discriminator,O as Example,D as ExampleValue,S as OperationItem,y as PayloadSamples,x as SectionItem,P as SelectWrapper};
1
+ export * from './RedoclyOpenAPIDocs/index.js';
2
+ export * from './pluggable/index.js';
3
+ // Common
4
+ export * from './common/index.js';
5
+ // Redoc-lib
6
+ export * from './ApiInfo/index.js';
7
+ export { SectionItem } from './SectionItem/index.js';
8
+ export { ContentItem } from './ContentItem/index.js';
9
+ export { ContentItems } from './ContentItems/index.js';
10
+ export { Discriminator } from './Discriminator/index.js';
11
+ export * from './Schema/index.js';
12
+ export { OperationItem } from './OperationItem/index.js';
13
+ export * from './Markdown/index.js';
14
+ export * from './Responses/index.js';
15
+ export * from './ResponseSamples/ResponseSamples.js';
16
+ export { PayloadSamples, ExampleValue, Example, SelectWrapper } from './PayloadSamples/index.js';
17
+ export * from './MediaTypeSwitch/index.js';
18
+ export * from './RequestParameters/index.js';
19
+ export * from './SelectOrLabel/index.js';
20
+ export * from './ErrorBoundary/index.js';
21
+ export * from './SideMenu/index.js';
22
+ export * from './StickySidebar/StickyResponsiveSidebar.js';
23
+ export * from './SchemaDefinition/SchemaDefinition.js';
24
+ export * from './RequestSamples/RequestSamples.js';
25
+ //# sourceMappingURL=index.js.map
@@ -1 +1,20 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useAtomValue as m}from"jotai";import{getExamples as i}from"../../models/index.js";import{Row as s}from"../common/index.js";import{ExamplesWrap as f}from"./styled.components.js";import{Example as x}from"../PayloadSamples/index.js";import{globalParserAtom as n}from"../../jotai/store.js";import{layoutAtom as c}from"../../jotai/app.js";const j=({pointer:e,mimeType:r,encoding:t})=>{const p=m(n),a=m(c),l=i({parser:p,infoOrRef:{$ref:e},mime:r,encoding:t});return o(s,{layout:a,children:o(f,{children:o(x,{example:l,mimeType:r})})})};export{j as RedocExample};
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAtomValue } from 'jotai';
3
+ import { getExamples } from '../../models/index.js';
4
+ import { Row } from '../common/index.js';
5
+ import { ExamplesWrap } from './styled.components.js';
6
+ import { Example } from '../PayloadSamples/index.js';
7
+ import { globalParserAtom } from '../../jotai/store.js';
8
+ import { layoutAtom } from '../../jotai/app.js';
9
+ export const RedocExample = ({ pointer, mimeType, encoding }) => {
10
+ const parser = useAtomValue(globalParserAtom);
11
+ const layout = useAtomValue(layoutAtom);
12
+ const example = getExamples({
13
+ parser,
14
+ infoOrRef: { $ref: pointer },
15
+ mime: mimeType,
16
+ encoding,
17
+ });
18
+ return (_jsx(Row, { layout: layout, children: _jsx(ExamplesWrap, { children: _jsx(Example, { example: example, mimeType: mimeType }) }) }));
19
+ };
20
+ //# sourceMappingURL=RedocExample.js.map
@@ -1 +1,22 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useAtomValue as n}from"jotai";import{getSchema as p}from"../../models/index.js";import{Row as l}from"../common/index.js";import{FullWidthPanel as h}from"./styled.components.js";import{Schema as f}from"../Schema/index.js";import{globalStoreAtom as d}from"../../jotai/store.js";const A=({pointer:o,schema:r,disableDeepLinks:m,slug:t,onOneOfChange:s})=>{const{options:a,parser:c}=n(d),i=p({parser:c,schemaOrRef:r||{$ref:o},pointer:o||"",options:a,deps:{operation:{pointer:"RedocSchema"}}});return e(l,{children:e(h,{children:e(f,{schema:i,level:1,disableDeepLinks:m,slug:t,onOneOfChange:s})})})};export{A as RedocSchema};
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAtomValue } from 'jotai';
3
+ import { getSchema } from '../../models/index.js';
4
+ import { Row } from '../common/index.js';
5
+ import { FullWidthPanel } from './styled.components.js';
6
+ import { Schema } from '../Schema/index.js';
7
+ import { globalStoreAtom } from '../../jotai/store.js';
8
+ export const RedocSchema = ({ pointer, schema, disableDeepLinks, slug, onOneOfChange, }) => {
9
+ const { options, parser } = useAtomValue(globalStoreAtom);
10
+ const schemaOrRef = schema || { $ref: pointer };
11
+ const schemaModel = getSchema({
12
+ parser,
13
+ schemaOrRef,
14
+ pointer: pointer || '',
15
+ options,
16
+ deps: {
17
+ operation: { pointer: 'RedocSchema' },
18
+ },
19
+ });
20
+ return (_jsx(Row, { children: _jsx(FullWidthPanel, { children: _jsx(Schema, { schema: schemaModel, level: 1, disableDeepLinks: disableDeepLinks, slug: slug, onOneOfChange: onOneOfChange }) }) }));
21
+ };
22
+ //# sourceMappingURL=RedocSchema.js.map
@@ -1 +1,3 @@
1
- import{RedocSchema as m}from"./RedocSchema.js";import{RedocExample as c}from"./RedocExample.js";export{c as RedocExample,m as RedocSchema};
1
+ export { RedocSchema } from './RedocSchema.js';
2
+ export { RedocExample } from './RedocExample.js';
3
+ //# sourceMappingURL=index.js.map
@@ -1,12 +1,17 @@
1
- import{SamplesMiddlePanel as a}from"../common/panels.js";import{styled as r}from"../../styled-components.js";const o=r.div`
1
+ import { SamplesMiddlePanel } from '../common/panels.js';
2
+ import { styled } from '../../styled-components.js';
3
+ export const SamplesWrap = styled.div `
2
4
  padding: calc(var(--spacing-unit) * 4);
3
5
  border-radius: var(--panel-border-radius);
4
6
  border: var(--panel-samples-border);
5
7
  background-color: var(--panel-samples-bg-color);
6
- `,e=r(o)`
8
+ `;
9
+ export const ExamplesWrap = styled(SamplesWrap) `
7
10
  width: 100%;
8
- `,l=r(a)`
11
+ `;
12
+ export const FullWidthPanel = styled(SamplesMiddlePanel) `
9
13
  padding-left: var(--spacing-horizontal);
10
14
  padding-right: var(--spacing-horizontal);
11
15
  width: 100%;
12
- `;export{e as ExamplesWrap,l as FullWidthPanel,o as SamplesWrap};
16
+ `;
17
+ //# sourceMappingURL=styled.components.js.map
package/lib/constants.js CHANGED
@@ -1 +1,30 @@
1
- var t;(function(o){o.ON_DEEP_LINK_CLICK="onDeepLinkClick",o.REQUEST_INTERCEPTOR="requestInterceptor",o.HOOKS="hooks"})(t||(t={}));var E;(function(o){o.OCTET_STREAM="application/octet-stream",o.MULTIPART="multipart/form-data",o.URL_ENCODED="application/x-www-form-urlencoded",o.JSON="application/json",o.XML="application/xml"})(E||(E={}));const O="data-section-id",p="data-field-id",r=0,n="^ {0,3}<!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?-->\\s*$",c="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))",D="(?:"+n+"|"+c+")",T="other",_="webhooks",e={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED"};export{D as COMPONENT_REGEXP,T as DEFAULT_TAG_SLUG,_ as DEFAULT_WEBHOOKS_TAG_NAME,p as FIELD_ATTR,r as GROUP_DEPTH,n as LEGACY_REGEXP,e as LOADING_STATE,c as MDX_COMPONENT_REGEXP,E as MediaTypes,O as SECTION_ATTR,t as WindowReferenceOptions};
1
+ export var WindowReferenceOptions;
2
+ (function (WindowReferenceOptions) {
3
+ WindowReferenceOptions["ON_DEEP_LINK_CLICK"] = "onDeepLinkClick";
4
+ WindowReferenceOptions["REQUEST_INTERCEPTOR"] = "requestInterceptor";
5
+ WindowReferenceOptions["HOOKS"] = "hooks";
6
+ })(WindowReferenceOptions || (WindowReferenceOptions = {}));
7
+ export var MediaTypes;
8
+ (function (MediaTypes) {
9
+ MediaTypes["OCTET_STREAM"] = "application/octet-stream";
10
+ MediaTypes["MULTIPART"] = "multipart/form-data";
11
+ MediaTypes["URL_ENCODED"] = "application/x-www-form-urlencoded";
12
+ MediaTypes["JSON"] = "application/json";
13
+ MediaTypes["XML"] = "application/xml";
14
+ })(MediaTypes || (MediaTypes = {}));
15
+ export const SECTION_ATTR = 'data-section-id';
16
+ export const FIELD_ATTR = 'data-field-id';
17
+ export const GROUP_DEPTH = 0;
18
+ export const LEGACY_REGEXP = '^ {0,3}<!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?-->\\s*$';
19
+ // prettier-ignore
20
+ export const MDX_COMPONENT_REGEXP = '(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>' // with children
21
+ + '|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))'; // self-closing
22
+ export const COMPONENT_REGEXP = '(?:' + LEGACY_REGEXP + '|' + MDX_COMPONENT_REGEXP + ')';
23
+ export const DEFAULT_TAG_SLUG = 'other';
24
+ export const DEFAULT_WEBHOOKS_TAG_NAME = 'webhooks';
25
+ export const LOADING_STATE = {
26
+ NOT_LOADED: 'NOT_LOADED',
27
+ LOADING: 'LOADING',
28
+ LOADED: 'LOADED',
29
+ };
30
+ //# sourceMappingURL=constants.js.map
package/lib/empty.js CHANGED
@@ -1 +1,7 @@
1
- var e={isatty:()=>{},createRequire:()=>{}};export{e as default};
1
+ export default {
2
+ isatty: () => {
3
+ /* nope */
4
+ }, // colorette fix
5
+ createRequire: () => { },
6
+ };
7
+ //# sourceMappingURL=empty.js.map
@@ -1 +1,19 @@
1
- import{createTrackingEvent as m}from"./creator.js";import{AnalyticsEventType as n}from"./types.js";const d=m(n.CodeSampleCopied),l=({operation:e,type:o,lang:t="",label:p="",activeMimeName:a,activeExampleName:r})=>d({resource:"Redocly_CodeSample",action:"CodeSampleCopied",operationId:e.id,operationPath:e.path,operationHttpVerb:e.httpVerb,operationSummary:e.name,exampleId:r,exampleMimeType:a,label:p,lang:t,type:o});export{l as createCodeSampleCopyEvent};
1
+ import { createTrackingEvent } from './creator.js';
2
+ import { AnalyticsEventType } from './types.js';
3
+ const codeSampleCopyEvent = createTrackingEvent(AnalyticsEventType.CodeSampleCopied);
4
+ export const createCodeSampleCopyEvent = ({ operation, type, lang = '', label = '', activeMimeName, activeExampleName, }) => {
5
+ return codeSampleCopyEvent({
6
+ resource: 'Redocly_CodeSample',
7
+ action: 'CodeSampleCopied',
8
+ operationId: operation.id,
9
+ operationPath: operation.path,
10
+ operationHttpVerb: operation.httpVerb,
11
+ operationSummary: operation.name,
12
+ exampleId: activeExampleName,
13
+ exampleMimeType: activeMimeName,
14
+ label,
15
+ lang,
16
+ type,
17
+ });
18
+ };
19
+ //# sourceMappingURL=codeSampleCopy.js.map
@@ -1 +1,5 @@
1
- function r(e){return n=>({...n,eventType:e})}export{r as createTrackingEvent};
1
+ // TODO: Extract
2
+ export function createTrackingEvent(eventType) {
3
+ return (payload) => ({ ...payload, eventType });
4
+ }
5
+ //# sourceMappingURL=creator.js.map