@redocly/openapi-docs 3.0.0-alpha.29.alpha.0 → 3.0.0-alpha.31

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 (200) hide show
  1. package/dist/console.redocly-openapi-docs.min.js +100 -98
  2. package/dist/oauth2-redirect.js +1 -1
  3. package/dist/redocly-openapi-docs.min.js +1021 -1027
  4. package/lib/components/ApiInfo/ApiInfo.d.ts +4 -1
  5. package/lib/components/ApiInfo/ApiInfo.js +1 -1
  6. package/lib/components/ContentItem/ContentItem.d.ts +0 -3
  7. package/lib/components/ContentItem/ContentItem.js +1 -1
  8. package/lib/components/ContentItems/ContentItems.d.ts +1 -7
  9. package/lib/components/ContentItems/ContentItems.js +1 -1
  10. package/lib/components/ContentItems/helpers.d.ts +9 -0
  11. package/lib/components/ContentItems/helpers.js +1 -1
  12. package/lib/components/Fields/FieldDetails.js +1 -1
  13. package/lib/components/Fields/styled.d.ts +1 -0
  14. package/lib/components/Fields/styled.js +5 -1
  15. package/lib/components/OperationItem/OperationItem.js +2 -2
  16. package/lib/components/OperationParameters/OperationParameters.js +1 -1
  17. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
  18. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
  19. package/lib/components/RedoclyOpenAPIDocs/index.d.ts +0 -1
  20. package/lib/components/RedoclyOpenAPIDocs/index.js +1 -1
  21. package/lib/components/RedoclyOpenAPIDocs/styled.d.ts +2 -2
  22. package/lib/components/RedoclyOpenAPIDocs/styled.js +8 -27
  23. package/lib/components/RedoclyOpenAPIDocs/types.d.ts +5 -4
  24. package/lib/components/RedoclyOpenAPIDocs/utils.js +1 -1
  25. package/lib/components/SchemaDefinition/SchemaDefinition.js +1 -1
  26. package/lib/components/SectionContent/SectionContent.d.ts +1 -2
  27. package/lib/components/SectionContent/SectionContent.js +1 -1
  28. package/lib/components/SideMenu/Actions.d.ts +2 -0
  29. package/lib/components/SideMenu/Actions.js +2 -0
  30. package/lib/components/SideMenu/MenuItem.d.ts +2 -0
  31. package/lib/components/SideMenu/MenuItem.js +1 -1
  32. package/lib/components/SideMenu/MenuItemLink.js +1 -1
  33. package/lib/components/SideMenu/MenuItems.js +1 -1
  34. package/lib/components/SideMenu/styled.d.ts +3 -1
  35. package/lib/components/SideMenu/styled.js +1 -1
  36. package/lib/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -0
  37. package/lib/components/StickySidebar/StickyResponsiveSidebar.js +6 -6
  38. package/lib/components/TagItems/TagItems.js +1 -1
  39. package/lib/components/common/panels.d.ts +1 -1
  40. package/lib/components/common/panels.js +2 -2
  41. package/lib/components/index.d.ts +1 -3
  42. package/lib/components/index.js +1 -1
  43. package/lib/components/rightPanel/Console/Console.js +1 -1
  44. package/lib/components/rightPanel/Console/shallowCopyForTryIt.d.ts +2 -0
  45. package/lib/components/rightPanel/Console/shallowCopyForTryIt.js +2 -0
  46. package/lib/components/rightPanel/ParameterArray.js +3 -1
  47. package/lib/components/rightPanel/utils.d.ts +0 -1
  48. package/lib/components/rightPanel/utils.js +1 -1
  49. package/lib/constants.d.ts +1 -4
  50. package/lib/constants.js +1 -1
  51. package/lib/hoc/types.d.ts +18 -0
  52. package/lib/hoc/withStore.d.ts +3 -0
  53. package/lib/hoc/withStore.js +2 -0
  54. package/lib/index.d.ts +12 -8
  55. package/lib/index.js +1 -1
  56. package/lib/models/group.d.ts +1 -1
  57. package/lib/models/group.js +1 -1
  58. package/lib/models/index.d.ts +1 -1
  59. package/lib/models/index.js +1 -1
  60. package/lib/models/operation.js +1 -1
  61. package/lib/models/types.d.ts +2 -1
  62. package/lib/recoil/app.d.ts +3 -1
  63. package/lib/recoil/app.js +1 -1
  64. package/lib/services/OpenAPIParser.d.ts +0 -1
  65. package/lib/services/OpenAPIParser.js +1 -1
  66. package/lib/services/Options/normalizeOptions.js +1 -1
  67. package/lib/services/Options/types.d.ts +3 -2
  68. package/lib/services/code-samples/generator.js +1 -1
  69. package/lib/services/history/helpers.js +1 -1
  70. package/lib/services/menu/builder.js +1 -1
  71. package/lib/services/menu/markdown.js +1 -1
  72. package/lib/services/menu/operation.js +1 -1
  73. package/lib/services/menu/tags.js +1 -1
  74. package/lib/services/search/DeepSearchStore.js +1 -1
  75. package/lib/services/types.d.ts +1 -0
  76. package/lib/services/utils.d.ts +0 -1
  77. package/lib/services/utils.js +1 -1
  78. package/lib/standalone.d.ts +1 -1
  79. package/lib/standalone.js +1 -1
  80. package/lib/types/open-api.d.ts +0 -1
  81. package/lib/utils/helpers.js +1 -1
  82. package/lib/utils/index.d.ts +0 -1
  83. package/lib/utils/index.js +1 -1
  84. package/lib/utils/loadAndBundleSpec.d.ts +0 -2
  85. package/lib/utils/loadAndBundleSpec.js +1 -1
  86. package/lib/utils/openapi.d.ts +4 -1
  87. package/lib/utils/openapi.js +1 -1
  88. package/lib/utils/path.d.ts +2 -1
  89. package/lib/utils/path.js +1 -1
  90. package/lib-esm/components/ApiInfo/ApiInfo.d.ts +4 -1
  91. package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
  92. package/lib-esm/components/ContentItem/ContentItem.d.ts +0 -3
  93. package/lib-esm/components/ContentItem/ContentItem.js +1 -1
  94. package/lib-esm/components/ContentItems/ContentItems.d.ts +1 -7
  95. package/lib-esm/components/ContentItems/ContentItems.js +1 -1
  96. package/lib-esm/components/ContentItems/helpers.d.ts +9 -0
  97. package/lib-esm/components/ContentItems/helpers.js +1 -1
  98. package/lib-esm/components/Fields/FieldDetails.js +1 -1
  99. package/lib-esm/components/Fields/styled.d.ts +1 -0
  100. package/lib-esm/components/Fields/styled.js +4 -0
  101. package/lib-esm/components/OperationItem/OperationItem.js +2 -2
  102. package/lib-esm/components/OperationParameters/OperationParameters.js +1 -1
  103. package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
  104. package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
  105. package/lib-esm/components/RedoclyOpenAPIDocs/index.d.ts +0 -1
  106. package/lib-esm/components/RedoclyOpenAPIDocs/index.js +1 -1
  107. package/lib-esm/components/RedoclyOpenAPIDocs/styled.d.ts +2 -2
  108. package/lib-esm/components/RedoclyOpenAPIDocs/styled.js +32 -51
  109. package/lib-esm/components/RedoclyOpenAPIDocs/types.d.ts +5 -4
  110. package/lib-esm/components/RedoclyOpenAPIDocs/utils.js +1 -1
  111. package/lib-esm/components/SchemaDefinition/SchemaDefinition.js +1 -1
  112. package/lib-esm/components/SectionContent/SectionContent.d.ts +1 -2
  113. package/lib-esm/components/SectionContent/SectionContent.js +1 -1
  114. package/lib-esm/components/SideMenu/Actions.d.ts +2 -0
  115. package/lib-esm/components/SideMenu/Actions.js +2 -0
  116. package/lib-esm/components/SideMenu/MenuItem.d.ts +2 -0
  117. package/lib-esm/components/SideMenu/MenuItem.js +1 -1
  118. package/lib-esm/components/SideMenu/MenuItemLink.js +1 -1
  119. package/lib-esm/components/SideMenu/MenuItems.js +1 -1
  120. package/lib-esm/components/SideMenu/styled.d.ts +3 -1
  121. package/lib-esm/components/SideMenu/styled.js +1 -1
  122. package/lib-esm/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -0
  123. package/lib-esm/components/StickySidebar/StickyResponsiveSidebar.js +6 -6
  124. package/lib-esm/components/TagItems/TagItems.js +1 -1
  125. package/lib-esm/components/common/panels.d.ts +1 -1
  126. package/lib-esm/components/common/panels.js +2 -2
  127. package/lib-esm/components/index.d.ts +1 -3
  128. package/lib-esm/components/index.js +1 -1
  129. package/lib-esm/components/rightPanel/Console/Console.js +1 -1
  130. package/lib-esm/components/rightPanel/Console/shallowCopyForTryIt.d.ts +2 -0
  131. package/lib-esm/components/rightPanel/Console/shallowCopyForTryIt.js +2 -0
  132. package/lib-esm/components/rightPanel/ParameterArray.js +3 -1
  133. package/lib-esm/components/rightPanel/utils.d.ts +0 -1
  134. package/lib-esm/components/rightPanel/utils.js +1 -1
  135. package/lib-esm/constants.d.ts +1 -4
  136. package/lib-esm/constants.js +1 -1
  137. package/lib-esm/hoc/types.d.ts +18 -0
  138. package/lib-esm/hoc/withStore.d.ts +3 -0
  139. package/lib-esm/hoc/withStore.js +2 -0
  140. package/lib-esm/index.d.ts +12 -8
  141. package/lib-esm/index.js +1 -1
  142. package/lib-esm/models/group.d.ts +1 -1
  143. package/lib-esm/models/group.js +1 -1
  144. package/lib-esm/models/index.d.ts +1 -1
  145. package/lib-esm/models/index.js +1 -1
  146. package/lib-esm/models/operation.js +1 -1
  147. package/lib-esm/models/types.d.ts +2 -1
  148. package/lib-esm/recoil/app.d.ts +3 -1
  149. package/lib-esm/recoil/app.js +1 -1
  150. package/lib-esm/services/OpenAPIParser.d.ts +0 -1
  151. package/lib-esm/services/OpenAPIParser.js +1 -1
  152. package/lib-esm/services/Options/normalizeOptions.js +1 -1
  153. package/lib-esm/services/Options/types.d.ts +3 -2
  154. package/lib-esm/services/code-samples/generator.js +1 -1
  155. package/lib-esm/services/history/helpers.js +1 -1
  156. package/lib-esm/services/menu/builder.js +1 -1
  157. package/lib-esm/services/menu/markdown.js +1 -1
  158. package/lib-esm/services/menu/operation.js +1 -1
  159. package/lib-esm/services/menu/tags.js +1 -1
  160. package/lib-esm/services/search/DeepSearchStore.js +1 -1
  161. package/lib-esm/services/types.d.ts +1 -0
  162. package/lib-esm/services/utils.d.ts +0 -1
  163. package/lib-esm/services/utils.js +1 -1
  164. package/lib-esm/standalone.d.ts +1 -1
  165. package/lib-esm/standalone.js +1 -1
  166. package/lib-esm/types/open-api.d.ts +0 -1
  167. package/lib-esm/utils/helpers.js +1 -1
  168. package/lib-esm/utils/index.d.ts +0 -1
  169. package/lib-esm/utils/index.js +1 -1
  170. package/lib-esm/utils/loadAndBundleSpec.d.ts +0 -2
  171. package/lib-esm/utils/loadAndBundleSpec.js +1 -1
  172. package/lib-esm/utils/openapi.d.ts +4 -1
  173. package/lib-esm/utils/openapi.js +1 -1
  174. package/lib-esm/utils/path.d.ts +2 -1
  175. package/lib-esm/utils/path.js +1 -1
  176. package/package.json +9 -10
  177. package/lib/components/ChangeViewButton/ChangeViewButton.d.ts +0 -2
  178. package/lib/components/ChangeViewButton/ChangeViewButton.js +0 -2
  179. package/lib/components/ChangeViewButton/index.d.ts +0 -1
  180. package/lib/components/ChangeViewButton/index.js +0 -2
  181. package/lib/components/ChangeViewButton/styled.d.ts +0 -4
  182. package/lib/components/ChangeViewButton/styled.js +0 -18
  183. package/lib/components/ToggleRightPanelButton/ToggleRightPanelButton.d.ts +0 -2
  184. package/lib/components/ToggleRightPanelButton/ToggleRightPanelButton.js +0 -2
  185. package/lib/components/ToggleRightPanelButton/index.d.ts +0 -1
  186. package/lib/components/ToggleRightPanelButton/index.js +0 -2
  187. package/lib/components/ToggleRightPanelButton/styled.d.ts +0 -4
  188. package/lib/components/ToggleRightPanelButton/styled.js +0 -17
  189. package/lib-esm/components/ChangeViewButton/ChangeViewButton.d.ts +0 -2
  190. package/lib-esm/components/ChangeViewButton/ChangeViewButton.js +0 -2
  191. package/lib-esm/components/ChangeViewButton/index.d.ts +0 -1
  192. package/lib-esm/components/ChangeViewButton/index.js +0 -2
  193. package/lib-esm/components/ChangeViewButton/styled.d.ts +0 -4
  194. package/lib-esm/components/ChangeViewButton/styled.js +0 -18
  195. package/lib-esm/components/ToggleRightPanelButton/ToggleRightPanelButton.d.ts +0 -2
  196. package/lib-esm/components/ToggleRightPanelButton/ToggleRightPanelButton.js +0 -2
  197. package/lib-esm/components/ToggleRightPanelButton/index.d.ts +0 -1
  198. package/lib-esm/components/ToggleRightPanelButton/index.js +0 -2
  199. package/lib-esm/components/ToggleRightPanelButton/styled.d.ts +0 -4
  200. package/lib-esm/components/ToggleRightPanelButton/styled.js +0 -17
@@ -1,2 +1,2 @@
1
- import React,{memo,useMemo,useState,useEffect,useCallback}from"react";import{Navigate,Route,Routes}from"react-router-dom";import{Pagination}from"../../services";import{IS_BROWSER}from"../../utils";import{Skeleton}from"../common";import{getNextSectionLink}from"./helpers";import{SectionContent}from"../SectionContent";import{TagItems}from"../TagItems";import{useAutoScroll}from"./useAutoScroll";import{ContentItem}from"../ContentItem";let isInitialHydrate=!0;function ContentItemsComponent({items:e,root:t=!1,pagination:n,showNextButton:o,showApiInfo:a,disablePaginationLoadingAnimation:i}){const[m,r]=useState(IS_BROWSER&&!isInitialHydrate&&!i);useEffect((()=>{const e=setTimeout((()=>{r(!1)}),200);return isInitialHydrate=!1,()=>{clearTimeout(e)}}),[]),useAutoScroll(m);const c=useMemo((()=>e.filter((e=>"group"===e.type))),[e]),l=useMemo((()=>e.filter((e=>"tag"===e.type))),[e]),u=useMemo((()=>e.filter((e=>"operation"===e.type))),[e]),s=useCallback(((e,t)=>null==e?void 0:e.map(((e,a)=>{var i;const m=getNextSectionLink({groupItems:c,groupIdx:t,tagIdx:a});switch(n){case Pagination.Item:return React.createElement(Route,{key:e.id,path:e.id},React.createElement(Route,{index:!0,element:"operation"===e.type?React.createElement(ContentItem,{key:e.id,item:e,pagination:n,showNextButton:o}):React.createElement(TagItems,{tag:e,nextSectionLink:m,pagination:n,showNextButton:o})}),null===(i=e.items)||void 0===i?void 0:i.map((e=>{const i=getNextSectionLink({groupItems:c,groupIdx:t,tagIdx:a});return React.createElement(Route,{key:e.id,path:e.id,element:React.createElement(TagItems,{tag:e,nextSectionLink:i,pagination:n,showNextButton:o})})})));case Pagination.Section:return React.createElement(Route,{key:e.id,path:e.id,element:React.createElement(TagItems,{tag:e,nextSectionLink:m,pagination:n,showNextButton:o})});default:return null}}))),[c,n,o]),p=useMemo((()=>React.createElement(Routes,null,React.createElement(Route,{path:"/",element:React.createElement(SectionContent,{items:e,nextSectionLink:getNextSectionLink({groupItems:c,groupIdx:0,tagIdx:0}),pagination:n,showNextButton:o,showApiInfo:a})}),c.length?c.map(((e,t)=>s(e.items,t))):s(l,0),u.length&&s(u,0),React.createElement(Route,{path:"*",element:React.createElement(Navigate,{to:"/",replace:!0})}))),[c,e,u,n,s,a,o,l]);return t&&!e.length?React.createElement(Routes,null,React.createElement(Route,{path:"*",element:React.createElement(SectionContent,{items:[],pagination:n,showNextButton:o,showApiInfo:a})})):e.length?m?React.createElement("div",{style:{flex:1,width:"100%"}},React.createElement(Skeleton,null)):React.createElement(React.Fragment,null,t?React.createElement(React.Fragment,null,p,n===Pagination.Section&&u.length&&u.map((e=>React.createElement(ContentItem,{key:e.id,item:e,pagination:n,showNextButton:o})))):e.map((e=>React.createElement(ContentItem,{key:e.id,item:e,pagination:n,showNextButton:o})))):null}export const ContentItems=memo(ContentItemsComponent);
1
+ import React,{memo,useMemo,useState,useEffect,useCallback}from"react";import{Navigate,Route,Routes}from"react-router-dom";import{useRecoilValue}from"recoil";import{Pagination}from"../../services";import{IS_BROWSER}from"../../utils";import{Skeleton}from"../common";import{getFirstPageLink,getItemsByType,getNextSectionLink}from"./helpers";import{SectionContent}from"../SectionContent";import{TagItems}from"../TagItems";import{useAutoScroll}from"./useAutoScroll";import{ContentItem}from"../ContentItem";import{globalOptionsSelector}from"../../recoil/store";let isInitialHydrate=!0;function ContentItemsComponent({items:e,root:t=!1}){const{pagination:n,showNextButton:o,disablePaginationLoadingAnimation:a}=useRecoilValue(globalOptionsSelector),[i,m]=useState(IS_BROWSER&&!isInitialHydrate&&!a);useEffect((()=>{const e=setTimeout((()=>{m(!1)}),200);return isInitialHydrate=!1,()=>{clearTimeout(e)}}),[]),useAutoScroll(i);const{groupItems:r,tagItems:c,operationItems:l,rootItem:s}=getItemsByType(e),u=!t||s?"/":getFirstPageLink(e)||"/",g=useCallback(((e,t)=>null==e?void 0:e.map(((e,a)=>{var i;const m=getNextSectionLink({groupItems:r,groupIdx:t,tagIdx:a});switch(n){case Pagination.Item:return React.createElement(Route,{key:e.id,path:e.id},React.createElement(Route,{index:!0,element:"operation"===e.type?React.createElement(ContentItem,{key:e.id,item:e}):React.createElement(TagItems,{tag:e,nextSectionLink:m,pagination:n,showNextButton:o})}),null===(i=e.items)||void 0===i?void 0:i.map((e=>{const i=getNextSectionLink({groupItems:r,groupIdx:t,tagIdx:a});return React.createElement(Route,{key:e.id,path:e.id,element:React.createElement(TagItems,{tag:e,nextSectionLink:i,pagination:n,showNextButton:o})})})));case Pagination.Section:return React.createElement(Route,{key:e.id,path:e.id,element:React.createElement(TagItems,{tag:e,nextSectionLink:m,pagination:n,showNextButton:o})});default:return null}}))),[r,n,o]),p=useMemo((()=>React.createElement(Routes,null,s&&React.createElement(Route,{path:s.href||"/",element:React.createElement(SectionContent,{items:e,nextSectionLink:getNextSectionLink({groupItems:r,groupIdx:0,tagIdx:0}),pagination:n,showNextButton:o})}),r.length?r.map(((e,t)=>g(e.items,t))):g(c,0),l.length&&g(l,0),React.createElement(Route,{path:"*",element:React.createElement(Navigate,{to:u,replace:!0})}))),[s,e,r,n,o,g,c,l,u]);return t&&!e.length?React.createElement(Routes,null,React.createElement(Route,{path:"*",element:React.createElement(SectionContent,{items:e,nextSectionLink:getNextSectionLink({groupItems:r,groupIdx:0,tagIdx:0}),pagination:n,showNextButton:o})})):e.length?i?React.createElement("div",{style:{flex:1,width:"100%"}},React.createElement(Skeleton,null)):React.createElement(React.Fragment,null,t?React.createElement(React.Fragment,null,p,n===Pagination.Section&&!!l.length&&l.map((e=>React.createElement(ContentItem,{key:e.id,item:e})))):e.map((e=>React.createElement(ContentItem,{key:e.id,item:e})))):null}export const ContentItems=memo(ContentItemsComponent);
2
2
  //# sourceMappingURL=ContentItems.js.map
@@ -1,3 +1,4 @@
1
+ import type { IMenuItem } from '../../services/types';
1
2
  import type { ContentItemModel } from '../../models';
2
3
  type GetNextSectionLinkInput = {
3
4
  groupItems: ContentItemModel[];
@@ -8,4 +9,12 @@ export declare function getNextSectionLink({ groupItems, groupIdx, tagIdx }: Get
8
9
  name: string;
9
10
  href?: string;
10
11
  };
12
+ export declare function isRootItem(item: ContentItemModel | IMenuItem): boolean;
13
+ export declare function getItemsByType(items: ContentItemModel[]): {
14
+ groupItems: ContentItemModel[];
15
+ tagItems: ContentItemModel[];
16
+ operationItems: ContentItemModel[];
17
+ rootItem: import("../../models").GroupModel | undefined;
18
+ };
19
+ export declare function getFirstPageLink(items: ContentItemModel[]): string;
11
20
  export {};
@@ -1,2 +1,2 @@
1
- export function getNextSectionLink({groupItems:e,groupIdx:n,tagIdx:t}){var r,i;if(null===(r=e[n])||void 0===r?void 0:r.items[t+1]){const{name:r,href:i}=e[n].items[t+1];return{name:r,href:i}}{const{name:t,href:r}=(null===(i=e[n+1])||void 0===i?void 0:i.items[0])||{};return{name:t,href:r}}}
1
+ import{normalizePath}from"../../utils";export function getNextSectionLink({groupItems:e,groupIdx:t,tagIdx:r}){var o,i;if(null===(o=e[t])||void 0===o?void 0:o.items[r+1]){const{name:o,href:i}=e[t].items[r+1];return{name:o,href:i}}{const{name:r,href:o}=(null===(i=e[t+1])||void 0===i?void 0:i.items[0])||{};return{name:r,href:o}}}export function isRootItem(e){return"section"===e.type&&""===e.id&&"/"===e.href}export function getItemsByType(e){const t=[],r=[],o=[];let i;for(const n of e)switch(n.type){case"group":t.push(n);break;case"tag":r.push(n);break;case"operation":o.push(n);break;case"section":isRootItem(n)&&(i=n)}return{groupItems:t,tagItems:r,operationItems:o,rootItem:i}}export function getFirstPageLink(e){for(const t of e){if("group"===t.type)return getFirstPageLink(t.items);if("tag"===t.type){if(!t.description)return normalizePath(getFirstPageLink(t.items));if(t.href)return normalizePath(t.href)}else if("operation"===t.type||"schema"===t.type)return normalizePath(t.href)}return"/"}
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1,2 +1,2 @@
1
- import React,{memo,useState}from"react";import{useRecoilValue}from"recoil";import{PatternLabel,RecursiveLabel,TypeFormat,TypeName,TypePrefix,TypeTitle,ToggleButton,Badge}from"../common";import{ExternalDocumentation}from"../ExternalDocumentation";import{Markdown}from"../Markdown";import{l}from"../../services";import{FieldDetail}from"./FieldDetail";import{ConstraintsView}from"./ConstraintsView";import{Extensions}from"./Extensions";import{EnumValues}from"./EnumValues";import{Examples,getSerializedValue}from"./Examples";import{TypeWrapper}from"./styled";import{globalOptionsSelector}from"../../recoil/store";const MAX_PATTERN_LENGTH=45;function FieldDetailsComponent({showExamples:e,field:t,renderDiscriminatorSwitch:a}){const[n,r]=useState(!1),{enumSkipQuotes:o,hideSchemaTitles:i,hideSchemaPattern:c}=useRecoilValue(globalOptionsSelector),{schema:m,description:s,example:p,deprecated:u,examples:E}=t,d=Boolean(o)||"header"===t.in;let R=null;if(e&&(void 0!==p||void 0!==E))if(void 0!==E)R=React.createElement(Examples,{field:t});else{const e=!!t.in;R=React.createElement(FieldDetail,{label:"example",value:getSerializedValue(t,t.example),raw:e})}return React.createElement("div",null,React.createElement(TypeWrapper,null,React.createElement(TypePrefix,null,m.typePrefix),React.createElement(TypeName,null,m.displayType),m.displayFormat&&React.createElement(TypeFormat,null," ","<",m.displayFormat,">"," "),m.contentEncoding&&React.createElement(TypeFormat,null," ","<",m.contentEncoding,">"," "),m.contentMediaType&&React.createElement(TypeFormat,null," ","<",m.contentMediaType,">"," "),m.title&&!i&&React.createElement(TypeTitle,null," (",m.title,") "),React.createElement(ConstraintsView,{constraints:m.constraints}),m.pattern&&!c&&React.createElement(React.Fragment,null,React.createElement(PatternLabel,null,n||m.pattern.length<MAX_PATTERN_LENGTH?m.pattern:`${m.pattern.substr(0,MAX_PATTERN_LENGTH)}...`),m.pattern.length>MAX_PATTERN_LENGTH&&React.createElement(ToggleButton,{onClick:()=>{r(!n)}},n?"Hide pattern":"Show pattern"))," ",m.isCircular&&React.createElement(RecursiveLabel,null,l("recursive"))),u&&React.createElement("div",null,React.createElement(Badge,{deprecated:!0,style:{marginLeft:0}}," ",l("deprecated")," ")),React.createElement(FieldDetail,{raw:d,label:"default",value:m.default}),React.createElement("div",null,React.createElement(Markdown,{source:s})),!a&&React.createElement(EnumValues,{type:m.type,values:m["x-enumDescriptions"]||m.enum})," ",R,React.createElement(Extensions,{extensions:Object.assign(Object.assign({},t.extensions),m.extensions)}),m.externalDocs&&React.createElement(ExternalDocumentation,{externalDocs:m.externalDocs,compact:!0}),null==a?void 0:a(),t.const&&React.createElement(FieldDetail,{label:"const",value:t.const})||null)}export const FieldDetails=memo(FieldDetailsComponent);
1
+ import React,{memo,useState}from"react";import{useRecoilValue}from"recoil";import{PatternLabel,RecursiveLabel,TypeFormat,TypeName,TypePrefix,TypeTitle,ToggleButton,Badge}from"../common";import{ExternalDocumentation}from"../ExternalDocumentation";import{Markdown}from"../Markdown";import{l}from"../../services";import{FieldDetail}from"./FieldDetail";import{ConstraintsView}from"./ConstraintsView";import{Extensions}from"./Extensions";import{EnumValues}from"./EnumValues";import{Examples,getSerializedValue}from"./Examples";import{TypeWrapper,FieldDescriptionWrapper}from"./styled";import{globalOptionsSelector}from"../../recoil/store";const MAX_PATTERN_LENGTH=45;function FieldDetailsComponent({showExamples:e,field:t,renderDiscriminatorSwitch:a}){const[n,r]=useState(!1),{enumSkipQuotes:i,hideSchemaTitles:o,hideSchemaPattern:c}=useRecoilValue(globalOptionsSelector),{schema:m,description:s,example:p,deprecated:u,examples:d}=t,E=Boolean(i)||"header"===t.in;let R=null;if(e&&(void 0!==p||void 0!==d))if(void 0!==d)R=React.createElement(Examples,{field:t});else{const e=!!t.in;R=React.createElement(FieldDetail,{label:"example",value:getSerializedValue(t,t.example),raw:e})}return React.createElement("div",null,React.createElement(TypeWrapper,null,React.createElement(TypePrefix,null,m.typePrefix),React.createElement(TypeName,null,m.displayType),m.displayFormat&&React.createElement(TypeFormat,null," ","<",m.displayFormat,">"," "),m.contentEncoding&&React.createElement(TypeFormat,null," ","<",m.contentEncoding,">"," "),m.contentMediaType&&React.createElement(TypeFormat,null," ","<",m.contentMediaType,">"," "),m.title&&!o&&React.createElement(TypeTitle,null," (",m.title,") "),React.createElement(ConstraintsView,{constraints:m.constraints}),m.pattern&&!c&&React.createElement(React.Fragment,null,React.createElement(PatternLabel,null,n||m.pattern.length<MAX_PATTERN_LENGTH?m.pattern:`${m.pattern.substr(0,MAX_PATTERN_LENGTH)}...`),m.pattern.length>MAX_PATTERN_LENGTH&&React.createElement(ToggleButton,{onClick:()=>{r(!n)}},n?"Hide pattern":"Show pattern"))," ",m.isCircular&&React.createElement(RecursiveLabel,null,l("recursive"))),u&&React.createElement("div",null,React.createElement(Badge,{deprecated:!0,style:{marginLeft:0}}," ",l("deprecated")," ")),React.createElement(FieldDetail,{raw:E,label:"default",value:m.default}),React.createElement(FieldDescriptionWrapper,null,React.createElement(Markdown,{source:s})),!a&&React.createElement(EnumValues,{type:m.type,values:m["x-enumDescriptions"]||m.enum})," ",R,React.createElement(Extensions,{extensions:Object.assign(Object.assign({},t.extensions),m.extensions)}),m.externalDocs&&React.createElement(ExternalDocumentation,{externalDocs:m.externalDocs,compact:!0}),null==a?void 0:a(),t.const&&React.createElement(FieldDetail,{label:"const",value:t.const})||null)}export const FieldDetails=memo(FieldDetailsComponent);
2
2
  //# sourceMappingURL=FieldDetails.js.map
@@ -11,3 +11,4 @@ export declare const ExampleDescription: import("styled-components").StyledCompo
11
11
  export declare const ExampleSummary: import("styled-components").StyledComponent<"label", any, {}, never>;
12
12
  export declare const ExampleWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const ExamplesList: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export declare const FieldDescriptionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -22,5 +22,9 @@ import styled from"styled-components";import{StyledMarkdownBlock}from"../Markdow
22
22
  `;export const ExamplesList=styled.div`
23
23
  padding-left: 1.5em;
24
24
  margin-bottom: 1em;
25
+ `;export const FieldDescriptionWrapper=styled.div`
26
+ p {
27
+ word-break: break-all;
28
+ }
25
29
  `;
26
30
  //# sourceMappingURL=styled.js.map
@@ -1,4 +1,4 @@
1
- import React,{memo,useCallback}from"react";import styled from"styled-components";import{useRecoilValue,useSetRecoilState}from"recoil";import{H2,useMount,Feedback}from"@redocly/theme";import{Endpoint}from"../Endpoint";import{Row}from"../common/panels";import{Badge,SamplesMiddlePanel,SamplesPanel,ShareLink}from"../common";import{CallbacksList}from"../Callbacks";import{CallbackSamples}from"../CallbackSamples";import{ExternalDocumentation}from"../ExternalDocumentation";import{Extensions}from"../Fields";import{Markdown}from"../Markdown";import{Parameters}from"../Parameters";import{RequestSamples}from"../RequestSamples";import{OperationResponseList}from"../Responses";import{ResponseSamples}from"../ResponseSamples";import{SecurityRequirements}from"../SecurityRequirement";import{ContentPanel}from"../Panel";import{RenderHook}from"../RenderHook";import{l}from"../../services";import{LayoutVariant}from"../../constants";import{creatPanelToggleEvent}from"../../events";import{showRightPanelToggleSelector,layoutSelector}from"../../recoil/app";import{globalStoreSelector}from"../../recoil/store";import{getOperation}from"../../models/operation";import{operationStore}from"../../recoil/operation";const OperationRow=styled(Row)`
1
+ import React,{memo,useCallback}from"react";import styled from"styled-components";import{useRecoilValue,useSetRecoilState}from"recoil";import{H2,useMount,Feedback,LayoutVariant}from"@redocly/theme";import{Endpoint}from"../Endpoint";import{Row}from"../common/panels";import{Badge,SamplesMiddlePanel,SamplesPanel,ShareLink}from"../common";import{CallbacksList}from"../Callbacks";import{CallbackSamples}from"../CallbackSamples";import{ExternalDocumentation}from"../ExternalDocumentation";import{Extensions}from"../Fields";import{Markdown}from"../Markdown";import{Parameters}from"../Parameters";import{RequestSamples}from"../RequestSamples";import{OperationResponseList}from"../Responses";import{ResponseSamples}from"../ResponseSamples";import{SecurityRequirements}from"../SecurityRequirement";import{ContentPanel}from"../Panel";import{RenderHook}from"../RenderHook";import{l}from"../../services";import{creatPanelToggleEvent}from"../../events";import{showRightPanelToggleSelector,layoutSelector}from"../../recoil/app";import{globalStoreSelector}from"../../recoil/store";import{getOperation}from"../../models/operation";import{operationStore}from"../../recoil/operation";const OperationRow=styled(Row)`
2
2
  flex-direction: column;
3
3
  align-items: flex-start;
4
4
  ${H2} {
@@ -8,5 +8,5 @@ import React,{memo,useCallback}from"react";import styled from"styled-components"
8
8
  margin: calc(var(--spacing-unit) * 2) 0;
9
9
  `,Description=styled.div`
10
10
  margin-bottom: calc(var(--spacing-unit) * 4);
11
- `;function OperationItemComponent({item:{operationDefinition:e,parent:t,href:a}}){var o,n,r;const c=useRecoilValue(layoutSelector),s=useRecoilValue(showRightPanelToggleSelector),{parser:i,options:m}=useRecoilValue(globalStoreSelector),{hooks:p,events:d,feedback:u,showWebhookVerb:R,pathInMiddlePanel:S,expandDefaultRequest:E,expandDefaultResponse:k}=m,y=getOperation(i,e,t,m,a),{name:b,description:f,deprecated:g,externalDocs:v,isWebhook:h,httpVerb:P}=y,O=useSetRecoilState(operationStore(y.pointer)),x=c===LayoutVariant.STACKED||!s;useMount((()=>{O((e=>Object.assign(Object.assign({},e),{activeExampleName:y.activeExampleName,activeServer:y.activeServer})))}));const w=!(!f&&!v),C=useCallback((e=>t=>{var a;const o=creatPanelToggleEvent({operation:y,isExpanded:t,panelType:e});null===(a=null==d?void 0:d.panelToggle)||void 0===a||a.call(d,o)}),[d,y]);return React.createElement(OperationRow,{layout:c},React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},React.createElement(RenderHook,{Hook:null==p?void 0:p.BeforeOperation,props:{operation:y}}),React.createElement(H2,null,React.createElement(ShareLink,{to:a}),React.createElement(RenderHook,{Hook:null==p?void 0:p.BeforeOperationSummary,props:{operation:y}}),b,React.createElement(RenderHook,{Hook:null==p?void 0:p.AfterOperationSummary,props:{operation:y}}),g&&React.createElement(Badge,{deprecated:!0},"Deprecated"),h&&React.createElement(React.Fragment,null,React.createElement(Badge,null,"Webhook"),R&&P&&React.createElement(Badge,null,P.toUpperCase()))),S&&!h&&React.createElement(Endpoint,{operation:y}))),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},w&&React.createElement(Description,null,void 0!==f&&React.createElement(Markdown,{source:f}),v&&React.createElement(ExternalDocumentation,{externalDocs:v}),Object.keys(y.extensions||{}).length?React.createElement(Extensions,{extensions:y.extensions}):null)),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},!S&&!h&&React.createElement(Endpoint,{operation:y})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},React.createElement(SecurityRequirements,{securities:y.security}))),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},(null===(o=y.parameters)||void 0===o?void 0:o.length)||y.requestBody?React.createElement(ContentPanel,{header:l("request"),onToggle:C("request"),expanded:E,className:"panel-request-schemas"},React.createElement(Parameters,{parameters:y.parameters,body:y.requestBody})):null),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},React.createElement(RequestSamples,{operation:y})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},(null===(n=y.responses)||void 0===n?void 0:n.length)?React.createElement(ContentPanel,{header:l("responses"),onToggle:C("responses"),expanded:k,className:"panel-response-schemas"},React.createElement(OperationResponseList,{responses:y.responses,operationPointer:y.pointer})):null),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},React.createElement(ResponseSamples,{operation:y})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},(null===(r=y.callbacks)||void 0===r?void 0:r.length)?React.createElement(ContentPanel,{className:"panel-callback-schemas",header:l("callbacks")},React.createElement(CallbacksList,{callbacks:y.callbacks})):null,React.createElement(RenderHook,{Hook:null==p?void 0:p.AfterOperation,props:{operation:y}})),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},React.createElement(CallbackSamples,{callbacks:y.callbacks})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},!1===(null==u?void 0:u.hide)?React.createElement(Feedback,{type:u.type,settings:u.settings,path:y.href}):null)))}export const OperationItem=memo(OperationItemComponent);
11
+ `;function OperationItemComponent({item:{operationDefinition:e,parent:t,href:a}}){var o,n,r;const c=useRecoilValue(layoutSelector),s=useRecoilValue(showRightPanelToggleSelector),{parser:i,options:m}=useRecoilValue(globalStoreSelector),{hooks:p,events:d,feedback:u,showWebhookVerb:R,pathInMiddlePanel:S,expandDefaultRequest:E,expandDefaultResponse:k}=m,b=getOperation(i,e,t,m,a),{name:y,description:f,deprecated:g,externalDocs:v,isWebhook:h,httpVerb:P}=b,O=useSetRecoilState(operationStore(b.pointer)),x=c===LayoutVariant.STACKED||!s;useMount((()=>{O((e=>Object.assign(Object.assign({},e),{activeExampleName:b.activeExampleName,activeServer:b.activeServer})))}));const w=!(!f&&!v),C=useCallback((e=>t=>{var a;const o=creatPanelToggleEvent({operation:b,isExpanded:t,panelType:e});null===(a=null==d?void 0:d.panelToggle)||void 0===a||a.call(d,o)}),[d,b]);return React.createElement(OperationRow,{layout:c},React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},React.createElement(RenderHook,{Hook:null==p?void 0:p.BeforeOperation,props:{operation:b}}),React.createElement(H2,null,React.createElement(ShareLink,{to:a}),React.createElement(RenderHook,{Hook:null==p?void 0:p.BeforeOperationSummary,props:{operation:b}}),y,React.createElement(RenderHook,{Hook:null==p?void 0:p.AfterOperationSummary,props:{operation:b}}),g&&React.createElement(Badge,{deprecated:!0},"Deprecated"),h&&React.createElement(React.Fragment,null,React.createElement(Badge,null,"Webhook"),R&&P&&React.createElement(Badge,null,P.toUpperCase()))),S&&!h&&React.createElement(Endpoint,{operation:b}))),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},w&&React.createElement(Description,null,void 0!==f&&React.createElement(Markdown,{source:f}),v&&React.createElement(ExternalDocumentation,{externalDocs:v}),Object.keys(b.extensions||{}).length?React.createElement(Extensions,{extensions:b.extensions}):null),React.createElement(SecurityRequirements,{securities:b.security})),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},!S&&!h&&React.createElement(Endpoint,{operation:b})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},(null===(o=b.parameters)||void 0===o?void 0:o.length)||b.requestBody?React.createElement(ContentPanel,{header:l("request"),onToggle:C("request"),expanded:E,className:"panel-request-schemas"},React.createElement(Parameters,{parameters:b.parameters,body:b.requestBody})):null),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},React.createElement(RequestSamples,{operation:b})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},(null===(n=b.responses)||void 0===n?void 0:n.length)?React.createElement(ContentPanel,{header:l("responses"),onToggle:C("responses"),expanded:k,className:"panel-response-schemas"},React.createElement(OperationResponseList,{responses:b.responses,operationPointer:b.pointer})):null),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},React.createElement(ResponseSamples,{operation:b})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},(null===(r=b.callbacks)||void 0===r?void 0:r.length)?React.createElement(ContentPanel,{className:"panel-callback-schemas",header:l("callbacks")},React.createElement(CallbacksList,{callbacks:b.callbacks})):null,React.createElement(RenderHook,{Hook:null==p?void 0:p.AfterOperation,props:{operation:b}})),s?React.createElement(SamplesPanel,{"data-cy":"samples-block"},React.createElement(CallbackSamples,{callbacks:b.callbacks})):null),React.createElement(OperationSubRowStyled,{layout:c},React.createElement(SamplesMiddlePanel,{isStacked:x},!1===(null==u?void 0:u.hide)?React.createElement(Feedback,{type:u.type,settings:u.settings,path:b.href}):null)))}export const OperationItem=memo(OperationItemComponent);
12
12
  //# sourceMappingURL=OperationItem.js.map
@@ -1,2 +1,2 @@
1
- import React,{useMemo,Fragment}from"react";import{dottedString,escapeFormId,get,unescapeFormId}from"../../utils";import{FormLabel,FormControl,FormWarning,GroupLabel,Table}from"../common/form";import{FormTextField}from"../common/TextField";import{ParameterEnumDropdown}from"../rightPanel/ParameterDropdown";import{ParameterArray}from"../rightPanel/ParameterArray";import{SchemaType}from"./types";import{createValidator,getInitialValue,isNotSupported,orderParams,placeholder}from"./utils";const PARAM_PLACES=["path","query","cookie","header"];function FormControlWrapper({id:e,param:r,values:a}){const t=useMemo((()=>createValidator(r)),[r]),m=Array.isArray(r.schema.enum)&&r.schema.enum.length?r.schema.enum:void 0,o=getInitialValue(r.schema),n=e.split(".").map((e=>unescapeFormId(e)));return m?React.createElement(FormControl,null,React.createElement(ParameterEnumDropdown,{initValue:o,paramEnum:m,field:e})):React.createElement(FormTextField,{fullWidth:!0,"data-cy":"parameter-input",id:e,field:e,placeholder:placeholder(r),validate:t,initialValue:o||get(a,n),validateOnBlur:!0,validateOnChange:!0})}export function OperationParameters({values:e,operation:r}){const a=useMemo((()=>orderParams(r.parameters||[])),[r]),t=(r,a,m,o)=>{var n;const l=m?dottedString(m,r.name):r.name,i=isNotSupported(r.schema),c=m?[a,m]:[r.in],p=dottedString(...c,escapeFormId(r.name));return i&&console.warn(`Unsupported parameter definition: "${i}"`),r.schema.type===SchemaType.ARRAY?React.createElement(ParameterArray,{key:p,name:l,param:r,place:a,renderParameter:t}):r.schema.type===SchemaType.OBJECT?null===(n=r.schema.fields)||void 0===n?void 0:n.map((e=>t(e,a,l))):React.createElement(FormControl,{key:p},React.createElement(FormLabel,{required:r.required},o||l,":"),i?React.createElement(FormWarning,null,"Unsupported field schema definition"):React.createElement(FormControlWrapper,{id:p,param:r,values:e}))};return React.createElement(Table,null,PARAM_PLACES.map((e=>{const r=a[e];return r&&r.length?React.createElement(Fragment,{key:e},React.createElement(FormControl,null,React.createElement(GroupLabel,null," # ",e," parameters "),React.createElement("span",null," ")),r.map((r=>t(r,e)))):null})))}
1
+ import React,{useMemo,Fragment}from"react";import{dottedString,escapeFormId,get,unescapeFormId}from"../../utils";import{FormLabel,FormControl,FormWarning,GroupLabel,Table}from"../common/form";import{FormTextField}from"../common/TextField";import{ParameterEnumDropdown}from"../rightPanel/ParameterDropdown";import{ParameterArray}from"../rightPanel/ParameterArray";import{SchemaType}from"./types";import{createValidator,getInitialValue,isNotSupported,orderParams,placeholder}from"./utils";const PARAM_PLACES=["path","query","cookie","header"];function FormControlWrapper({id:e,param:r,values:a}){const t=useMemo((()=>createValidator(r)),[r]),m=Array.isArray(r.schema.enum)&&r.schema.enum.length?r.schema.enum:void 0,o=getInitialValue(r.schema),n=e.split(".").map((e=>unescapeFormId(e)));return m?React.createElement(FormControl,null,React.createElement(ParameterEnumDropdown,{initValue:o,paramEnum:m,field:e})):React.createElement(FormTextField,{fullWidth:!0,"data-cy":"parameter-input",id:e,field:e,placeholder:placeholder(r),validate:t,initialValue:o||get(a,n),validateOnBlur:!0,validateOnChange:!0})}export function OperationParameters({values:e,operation:r}){const a=useMemo((()=>orderParams(r.parameters||[])),[r]),t=(r,a,m,o,n)=>{var l;const i=m?dottedString(m,r.name):r.name,c=isNotSupported(r.schema),p=m?[a,m]:[r.in],d=dottedString(...p,escapeFormId(r.name));c&&console.warn(`Unsupported parameter definition: "${c}"`);return(Array.isArray(r.schema.type)?r.schema.type:[r.schema.type]).includes(SchemaType.ARRAY)?React.createElement(ParameterArray,{key:d,name:i,param:r,place:a,renderParameter:t}):r.schema.type===SchemaType.OBJECT?null===(l=r.schema.fields)||void 0===l?void 0:l.map((e=>t(e,a,i))):React.createElement(FormControl,{key:d},React.createElement(FormLabel,{required:r.required},o||i,": ",n),c?React.createElement(FormWarning,null,"Unsupported field schema definition"):React.createElement(FormControlWrapper,{id:d,param:r,values:e}))};return React.createElement(Table,null,PARAM_PLACES.map((e=>{const r=a[e];return r&&r.length?React.createElement(Fragment,{key:e},React.createElement(FormControl,null,React.createElement(GroupLabel,null," # ",e," parameters "),React.createElement("span",null," ")),r.map((r=>t(r,e)))):null})))}
2
2
  //# sourceMappingURL=OperationParameters.js.map
@@ -1,4 +1,4 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import type { RedoclyOpenAPIDocsProps, RedoclyOpenAPIDocsStandaloneProps } from './types';
3
- export declare function RedoclyOpenAPIDocs({ onLoaded, _forceRenderInfo, children, store, }: PropsWithChildren<RedoclyOpenAPIDocsProps>): JSX.Element | null;
3
+ export declare function RedoclyOpenAPIDocs({ onLoaded, children, store, }: PropsWithChildren<Partial<RedoclyOpenAPIDocsProps>>): JSX.Element | null;
4
4
  export declare function RedoclyOpenAPIDocsStandalone({ definition, definitionUrl, options, activeItemId, activeSampleLanguage, activeDeepLink, }: RedoclyOpenAPIDocsStandaloneProps): JSX.Element;
@@ -1,2 +1,2 @@
1
- import React,{useRef,useCallback,memo}from"react";import{SidebarLogo,GlobalStyle,useMount}from"@redocly/theme";import{useRecoilValue,useRecoilState}from"recoil";import{useLocation}from"react-router-dom";import{LayoutVariant}from"../../constants";import{Search}from"../Search";import{ThemeProviders,AppProvider,StoreProvider}from"./Providers";import{Overlay}from"../Overlay";import{VersionSwitcher}from"../VersionSwitcher";import{BackgroundStub,BackgroundStubFix,ApiContentWrap,ControlsWrap,RedocWrapStyled,CssFixes}from"./styled";import{StickyResponsiveSidebar}from"../StickySidebar";import{DownloadButtonWithLabel}from"../Download";import{ErrorBoundary}from"../ErrorBoundary";import{SideMenu}from"../SideMenu";import{ContentItems}from"../ContentItems";import{ChangeViewButton}from"../ChangeViewButton";import{ToggleRightPanelButton}from"../ToggleRightPanelButton";import{activeVersionIdxSelector,appSessionStore,layoutSelector}from"../../recoil/app";import{globalStore}from"../../recoil/store";import{useContentItems}from"../../hooks";import{withRouter}from"../../hoc/withRouter";import{compose}from"../../utils";import{useLicense}from"../../hooks/useLicense";const RedoclyOpenAPIDocsComponent=compose(withRouter,memo)((({licenseKey:e,onLoaded:o,_forceRenderInfo:t,children:n})=>{var i,r,a,l,c;const s=useRef(null),{pathname:u}=useLocation(),{isValid:m,licenseInfo:d}=useLicense(e);useMount((()=>{null==o||o()}));const{options:{hideDownloadButton:p,hideInfoSection:f,pagination:R,disableSidebar:h,whiteLabel:g,hideLogo:S,hideFab:v,showNextButton:E,scrollYOffset:y,disablePaginationLoadingAnimation:b,routingBasePath:L},options:I,versions:C}=useRecoilValue(globalStore),{showRightPanelToggle:P}=useRecoilValue(appSessionStore),[w,B]=useRecoilState(activeVersionIdxSelector),V=useRecoilValue(layoutSelector),A=useCallback((({idx:e})=>{e&&B(e)}),[B]),k=C[w].parser,{flatItems:x,contentItems:D}=useContentItems({parser:k,options:I});if(!C.length)return null;let T=!f;t&&(T=!0);const O=!T&&null!==p&&!p&&("none"===R||"/"===u||u===L),W=null===(r=null===(i=k.definition)||void 0===i?void 0:i.info)||void 0===r?void 0:r["x-logo"];return React.createElement(ThemeProviders,{options:I},React.createElement(GlobalStyle,null),React.createElement(RedocWrapStyled,{className:"redoc-wrap",ref:s},!m&&React.createElement(Overlay,{licenseInfo:d}),React.createElement(CssFixes,{whiteLabel:g,showRightPanelToggle:P,layout:V}),!h&&React.createElement(StickyResponsiveSidebar,{hideFab:v,scrollYOffset:y,className:"menu-content"},!S&&React.createElement(SidebarLogo,{imageUrl:null==W?void 0:W.url,href:(null==W?void 0:W.href)||(null===(c=null===(l=null===(a=k.definition)||void 0===a?void 0:a.info)||void 0===l?void 0:l.contact)||void 0===c?void 0:c.url),altText:null==W?void 0:W.altText,backgroundColor:null==W?void 0:W.backgroundColor}),C.length>1&&React.createElement(VersionSwitcher,{versions:C,activeVersionIdx:w,onChange:A}),React.createElement(Search,{contentItems:D,flatItems:x,options:I}),React.createElement(SideMenu,{items:m?D:[]})),React.createElement(ApiContentWrap,{className:"api-content",id:"api-content",layout:V===LayoutVariant.THREE_PANEL&&P?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED},P&&V!==LayoutVariant.STACKED&&React.createElement(BackgroundStub,null),O&&React.createElement(DownloadButtonWithLabel,null),React.createElement(ContentItems,{root:!0,items:m?D:[],showNextButton:E,showApiInfo:T,pagination:R,disablePaginationLoadingAnimation:b}),n),React.createElement(ControlsWrap,null,React.createElement(ToggleRightPanelButton,null),React.createElement(ChangeViewButton,null)),P&&V!==LayoutVariant.STACKED&&React.createElement(BackgroundStubFix,null)))}));export function RedoclyOpenAPIDocs({onLoaded:e,_forceRenderInfo:o,children:t,store:n}){var i,r,a;return(null==n?void 0:n.definition)?React.createElement(StoreProvider,Object.assign({},n),React.createElement(RedoclyOpenAPIDocsComponent,{onLoaded:e,_forceRenderInfo:o,basePath:null===(i=n.options)||void 0===i?void 0:i.routingBasePath,licenseKey:null===(r=n.options)||void 0===r?void 0:r.licenseKey,enableRouter:null===(a=n.options)||void 0===a?void 0:a.enableRouter},t)):null}export function RedoclyOpenAPIDocsStandalone({definition:e,definitionUrl:o,options:t={},activeItemId:n,activeSampleLanguage:i,activeDeepLink:r}){const a=React.createElement(AppProvider,{definition:e,definitionUrl:o,options:t,activeItemId:n,activeSampleLanguage:i,activeDeepLink:r},React.createElement(RedoclyOpenAPIDocs,null));return t.disableErrorBoundary?a:React.createElement(ErrorBoundary,null,a)}
1
+ import React,{useRef,memo}from"react";import{SidebarLogo,GlobalStyle,useMount,LayoutVariant}from"@redocly/theme";import{Search}from"../Search";import{ThemeProviders,AppProvider,StoreProvider}from"./Providers";import{Overlay}from"../Overlay";import{VersionSwitcher}from"../VersionSwitcher";import{BackgroundStub,BackgroundStubFix,ApiContentWrap,RedocWrapStyled,CssFixes}from"./styled";import{StickyResponsiveSidebar}from"../StickySidebar";import{ErrorBoundary}from"../ErrorBoundary";import{SideMenu}from"../SideMenu";import{ContentItems}from"../ContentItems";import{useContentItems}from"../../hooks";import{withRouter}from"../../hoc/withRouter";import{withStore}from"../../hoc/withStore";import{compose}from"../../utils";import{useLicense}from"../../hooks/useLicense";const RedoclyOpenAPIDocsComponent=compose(withRouter,withStore,memo)((({licenseKey:e,onLoaded:t,children:o,options:n,versions:r,layout:i,showRightPanelToggle:a,activeVersionIdx:l,onChangeActiveVersion:c,collapsedSidebar:s})=>{var d,m,u,p,v;const f=useRef(null),{isValid:R,licenseInfo:S}=useLicense(e);useMount((()=>{null==t||t()}));const{disableSidebar:h,whiteLabel:y,hideLogo:E,hideFab:b,scrollYOffset:g}=n||{},L=r[l].parser,{flatItems:I,contentItems:C}=useContentItems({parser:L,options:n});if(!r.length)return null;const P=null===(m=null===(d=L.definition)||void 0===d?void 0:d.info)||void 0===m?void 0:m["x-logo"];return React.createElement(ThemeProviders,{options:n},React.createElement(GlobalStyle,null),React.createElement(RedocWrapStyled,{className:"redoc-wrap",ref:f},!R&&React.createElement(Overlay,{licenseInfo:S}),React.createElement(CssFixes,{whiteLabel:y,showRightPanelToggle:a,layout:i}),!h&&React.createElement(StickyResponsiveSidebar,{hideFab:b,scrollYOffset:g,className:"menu-content",collapsedSidebar:!s},!E&&React.createElement(SidebarLogo,{imageUrl:null==P?void 0:P.url,href:(null==P?void 0:P.href)||(null===(v=null===(p=null===(u=L.definition)||void 0===u?void 0:u.info)||void 0===p?void 0:p.contact)||void 0===v?void 0:v.url),altText:null==P?void 0:P.altText,backgroundColor:null==P?void 0:P.backgroundColor}),r.length>1&&React.createElement(VersionSwitcher,{versions:r,activeVersionIdx:l,onChange:c}),React.createElement(Search,{contentItems:C,flatItems:I,options:n}),React.createElement(SideMenu,{items:R?C:[]})),React.createElement(ApiContentWrap,{className:"api-content",id:"api-content",layout:i===LayoutVariant.THREE_PANEL&&a?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED,collapsedSidebar:s},a&&i!==LayoutVariant.STACKED&&React.createElement(BackgroundStub,null),React.createElement(ContentItems,{root:!0,items:R?C:[]}),o),a&&i!==LayoutVariant.STACKED&&React.createElement(BackgroundStubFix,null)))}));export function RedoclyOpenAPIDocs({onLoaded:e,children:t,store:o}){var n,r,i;return(null==o?void 0:o.definition)?React.createElement(StoreProvider,Object.assign({},o),React.createElement(RedoclyOpenAPIDocsComponent,{onLoaded:e,basePath:null===(n=o.options)||void 0===n?void 0:n.routingBasePath,licenseKey:null===(r=o.options)||void 0===r?void 0:r.licenseKey,enableRouter:null===(i=o.options)||void 0===i?void 0:i.enableRouter,portalOptions:null==o?void 0:o.portalOptions},t)):null}export function RedoclyOpenAPIDocsStandalone({definition:e,definitionUrl:t,options:o={},activeItemId:n,activeSampleLanguage:r,activeDeepLink:i}){const a=React.createElement(AppProvider,{definition:e,definitionUrl:t,options:o,activeItemId:n,activeSampleLanguage:r,activeDeepLink:i},React.createElement(RedoclyOpenAPIDocs,null));return o.disableErrorBoundary?a:React.createElement(ErrorBoundary,null,a)}
2
2
  //# sourceMappingURL=RedoclyOpenAPIDocs.js.map
@@ -1,5 +1,4 @@
1
1
  export * from './RedoclyOpenAPIDocs';
2
- export * from './RedoclyOpenAPIDocsMultiStandalone';
3
2
  export * from './Providers';
4
3
  export * from './types';
5
4
  export * from './utils';
@@ -1,2 +1,2 @@
1
- export*from"./RedoclyOpenAPIDocs";export*from"./RedoclyOpenAPIDocsMultiStandalone";export*from"./Providers";export*from"./types";export*from"./utils";
1
+ export*from"./RedoclyOpenAPIDocs";export*from"./Providers";export*from"./types";export*from"./utils";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,13 +1,13 @@
1
+ import { LayoutVariant } from '@redocly/theme';
1
2
  import type { FlattenSimpleInterpolation } from 'styled-components';
2
3
  import type { CssFixesProps } from './types';
3
- import { LayoutVariant } from '../../constants';
4
4
  export declare const RedocWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export declare const ApiContentWrap: import("styled-components").StyledComponent<"div", any, {
6
6
  layout?: LayoutVariant | undefined;
7
+ collapsedSidebar?: boolean | undefined;
7
8
  }, never>;
8
9
  export declare const BackgroundStub: import("styled-components").StyledComponent<"div", any, {}, never>;
9
10
  export declare const BackgroundStubFix: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const ControlsWrap: import("styled-components").StyledComponent<"span", any, {}, never>;
11
11
  export declare const RedocWrapStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
12
12
  export declare const getMarginFixesByName: (variableName: string) => FlattenSimpleInterpolation;
13
13
  export declare const CssFixes: import("styled-components").GlobalStyleComponent<CssFixesProps, import("styled-components").DefaultTheme>;
@@ -1,4 +1,4 @@
1
- import styled,{createGlobalStyle,css}from"styled-components";import{LayoutVariant}from"../../constants";import{SamplesMiddlePanel,SamplesPanel}from"../common/panels";import{NextSectionButtonWrap}from"../NextSectionButton/styled";export const RedocWrap=styled.div`
1
+ import{LayoutVariant}from"@redocly/theme";import styled,{createGlobalStyle,css}from"styled-components";import{SamplesMiddlePanel,SamplesPanel}from"../common/panels";import{NextSectionButtonWrap}from"../NextSectionButton/styled";export const RedocWrap=styled.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  text-align: left;
@@ -25,23 +25,23 @@ import styled,{createGlobalStyle,css}from"styled-components";import{LayoutVarian
25
25
  margin: 0 auto;
26
26
  width: 100%;
27
27
 
28
- ${({layout:e=LayoutVariant.THREE_PANEL,theme:a})=>css`
29
- max-width: ${e===LayoutVariant.THREE_PANEL?"100%":""};
28
+ ${({layout:a=LayoutVariant.THREE_PANEL,theme:e,collapsedSidebar:t})=>css`
29
+ max-width: ${a===LayoutVariant.THREE_PANEL?"100%":""};
30
30
 
31
- ${a.mediaQueries.small} {
32
- width: calc(100% - var(--sidebar-width));
33
- max-width: var(--layout-${e}-small-max-width);
31
+ ${e.mediaQueries.small} {
32
+ width: ${t?"var(--layout-${layout}-small-max-width)":"calc(100% - var(--sidebar-width))"};
33
+ max-width: var(--layout-${a}-small-max-width);
34
34
  }
35
35
 
36
- ${a.mediaQueries.medium} {
37
- max-width: var(--layout-${e}-medium-max-width);
36
+ ${e.mediaQueries.medium} {
37
+ max-width: var(--layout-${a}-medium-max-width);
38
38
  }
39
39
 
40
- ${a.mediaQueries.large} {
41
- max-width: var(--layout-${e}-large-max-width);
40
+ ${e.mediaQueries.large} {
41
+ max-width: var(--layout-${a}-large-max-width);
42
42
  }
43
43
 
44
- ${a.mediaQueries.print} {
44
+ ${e.mediaQueries.print} {
45
45
  width: 100%;
46
46
  padding: 0;
47
47
  }
@@ -55,20 +55,20 @@ import styled,{createGlobalStyle,css}from"styled-components";import{LayoutVarian
55
55
  left: 0;
56
56
  background: var(--panel-samples-block-background-color);
57
57
 
58
- ${({theme:e})=>css`
59
- ${e.mediaQueries[e.showAtBreakpoint.samplesPanel]} {
58
+ ${({theme:a})=>css`
59
+ ${a.mediaQueries[a.showAtBreakpoint.samplesPanel]} {
60
60
  display: initial;
61
61
  left: calc(100% - var(--panel-samples-width));
62
62
  }
63
63
 
64
- ${e.mediaQueries.print} {
64
+ ${a.mediaQueries.print} {
65
65
  display: none;
66
66
  }
67
67
  `}
68
- `;const getBackgroundStubFixWidth=e=>css`
68
+ `;const getBackgroundStubFixWidth=a=>css`
69
69
  width: calc(
70
70
  (
71
- 100% - min(100% - var(--sidebar-width) - var(--layout-controls-width), var(${e})) -
71
+ 100% - min(100% - var(--sidebar-width) - var(--layout-controls-width), var(${a})) -
72
72
  var(--sidebar-width) + var(--layout-controls-width)
73
73
  ) / 2 + 2px /* 2px to account for rounding errors */
74
74
  );
@@ -81,43 +81,24 @@ import styled,{createGlobalStyle,css}from"styled-components";import{LayoutVarian
81
81
  background: var(--panel-samples-block-background-color);
82
82
  width: 0;
83
83
 
84
- ${({theme:e})=>css`
85
- ${e.mediaQueries[e.showAtBreakpoint.samplesPanel]} {
84
+ ${({theme:a})=>css`
85
+ ${a.mediaQueries[a.showAtBreakpoint.samplesPanel]} {
86
86
  display: initial;
87
87
  ${getBackgroundStubFixWidth("--layout-three-panel-medium-max-width")};
88
88
  }
89
89
 
90
- ${e.mediaQueries.large} {
90
+ ${a.mediaQueries.large} {
91
91
  ${getBackgroundStubFixWidth("--layout-three-panel-large-max-width")};
92
92
  }
93
93
 
94
- ${e.mediaQueries.print} {
95
- display: none;
96
- }
97
- `}
98
- `;export const ControlsWrap=styled.span`
99
- position: sticky;
100
- display: none;
101
- flex-direction: column;
102
- justify-content: space-between;
103
- top: calc(var(--navbar-height) + var(--layout-controls-top-offset));
104
- right: 24px;
105
- height: calc(var(--layout-controls-height) * 2 + var(--spacing-unit) * 2);
106
- z-index: 1;
107
-
108
- ${({theme:e})=>css`
109
- ${e.mediaQueries[e.showAtBreakpoint.samplesPanel]} {
110
- display: flex;
111
- }
112
-
113
- ${e.mediaQueries.print} {
94
+ ${a.mediaQueries.print} {
114
95
  display: none;
115
96
  }
116
97
  `}
117
98
  `;export const RedocWrapStyled=styled(RedocWrap)`
118
99
  background-color: var(--background-color);
119
- `;export const getMarginFixesByName=e=>css`
120
- margin: 0 max(calc((100% - var(--panel-samples-width) - var(${e})) / 2), 0);
100
+ `;export const getMarginFixesByName=a=>css`
101
+ margin: 0 max(calc((100% - var(--panel-samples-width) - var(${a})) / 2), 0);
121
102
  `;export const CssFixes=createGlobalStyle`
122
103
  div[data-section-id]::after {
123
104
  content: " ";
@@ -128,40 +109,40 @@ import styled,{createGlobalStyle,css}from"styled-components";import{LayoutVarian
128
109
  }
129
110
 
130
111
  ${SamplesPanel} {
131
- ${({layout:e})=>{if(e===LayoutVariant.STACKED)return css`
112
+ ${({layout:a})=>{if(a===LayoutVariant.STACKED)return css`
132
113
  width: 100%;
133
114
  padding-left: var(--spacing-horizontal);
134
115
  `}}
135
- ${({showRightPanelToggle:e})=>{if(!e)return css`
136
- ${({theme:e})=>e.mediaQueries[e.showAtBreakpoint.samplesPanel]} {
116
+ ${({showRightPanelToggle:a})=>{if(!a)return css`
117
+ ${({theme:a})=>a.mediaQueries[a.showAtBreakpoint.samplesPanel]} {
137
118
  display: none;
138
119
  }
139
120
  `}}
140
121
  }
141
122
 
142
123
  ${BackgroundStub}, ${BackgroundStubFix} {
143
- ${({showRightPanelToggle:e,layout:a})=>{if(!e&&a===LayoutVariant.STACKED)return css`
144
- ${({theme:e})=>e.mediaQueries[e.showAtBreakpoint.samplesPanel]} {
124
+ ${({showRightPanelToggle:a,layout:e})=>{if(!a&&e===LayoutVariant.STACKED)return css`
125
+ ${({theme:a})=>a.mediaQueries[a.showAtBreakpoint.samplesPanel]} {
145
126
  display: none;
146
127
  }
147
128
  `}}
148
129
  }
149
130
 
150
131
  ${SamplesMiddlePanel}, ${NextSectionButtonWrap} {
151
- ${({showRightPanelToggle:e,layout:a})=>e&&a===LayoutVariant.THREE_PANEL?css`
132
+ ${({showRightPanelToggle:a,layout:e})=>a&&e===LayoutVariant.THREE_PANEL?css`
152
133
  margin: 0;
153
- ${({theme:e})=>e.mediaQueries.small} {
134
+ ${({theme:a})=>a.mediaQueries.small} {
154
135
  ${getMarginFixesByName("--layout-panel-schemas-small-max-width")};
155
136
  }
156
- ${({theme:e})=>e.mediaQueries.medium} {
137
+ ${({theme:a})=>a.mediaQueries.medium} {
157
138
  max-width: var(--layout-panel-schemas-medium-max-width);
158
139
  ${getMarginFixesByName("--layout-panel-schemas-medium-max-width")};
159
140
  }
160
- ${({theme:e})=>e.mediaQueries.large} {
141
+ ${({theme:a})=>a.mediaQueries.large} {
161
142
  max-width: var(--layout-panel-schemas-large-max-width);
162
143
  ${getMarginFixesByName("--layout-panel-schemas-large-max-width")};
163
144
  }
164
- `:a!==LayoutVariant.STACKED&&e?void 0:css`
145
+ `:e!==LayoutVariant.STACKED&&a?void 0:css`
165
146
  width: 100%;
166
147
  padding-right: var(--spacing-horizontal);
167
148
  `};
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { LayoutVariant } from 'src/constants';
2
+ import type { LayoutVariant } from '@redocly/theme';
3
3
  import type { CodeSampleConfig, Options, RawOptions, SpecVersions } from '../../services';
4
4
  import type { MediaQueries } from '../../utils';
5
5
  import type { OpenAPIDefinition } from '../../types';
6
- import type { RoutingProps } from '../../hoc/types';
6
+ import type { RoutingProps, StoreProps } from '../../hoc/types';
7
7
  import type { OperationModel } from '../../models';
8
8
  export interface ResolvedTheme {
9
9
  mediaQueries: Omit<MediaQueries, 'print'>;
@@ -12,9 +12,8 @@ export interface ResolvedTheme {
12
12
  samplesPanel: keyof Omit<MediaQueries, 'print'>;
13
13
  };
14
14
  }
15
- export interface RedoclyOpenAPIDocsProps extends RoutingProps {
15
+ export interface RedoclyOpenAPIDocsProps extends RoutingProps, StoreProps {
16
16
  onLoaded?: () => void;
17
- _forceRenderInfo?: boolean;
18
17
  store?: StoreProviderProps;
19
18
  licenseKey?: string;
20
19
  }
@@ -26,6 +25,8 @@ export interface StoreProviderProps {
26
25
  portalOptions?: {
27
26
  defaultMimeType?: string;
28
27
  operation?: OperationModel;
28
+ layout?: LayoutVariant;
29
+ showRightPanelToggle?: boolean;
29
30
  definitionId?: string;
30
31
  };
31
32
  }
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function c(e){try{s(i.next(e))}catch(e){r(e)}}function d(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,d)}s((i=i.apply(e,n||[])).next())}))};import{useRef}from"react";import isDeepEqual from"fast-deep-equal";import{loadAndBundleDefinition,safeSlugify}from"../../utils";export function fixSpec(e){const n=e.components&&e.components.securitySchemes||{};for(const e of Object.keys(n)){const t=n[e];t["x-type"]&&(t.type=t["x-type"]),t["x-scheme"]&&(t.scheme=t["x-scheme"])}}export function loadMany(e){return __awaiter(this,void 0,void 0,(function*(){return yield loadSpecs(e||{}),e}))}export function loadSingle(e,n,t){return __awaiter(this,void 0,void 0,(function*(){let i;if(null==t?void 0:t.skipBundleAndConvert){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');i=e}else i=yield loadAndBundleDefinition(e||n);const o=null==t?void 0:t.unstable_externalDescription;if(o)try{const e=yield fetch(o);i.info.description=yield e.text()}catch(e){console.warn(`Failed to load external description from ${o}: ${e.message}`)}try{fixSpec(i)}catch(e){}return i}))}export function loadAndBundleSpecOrMd(e,n){return e.endsWith(".md")?loadAndBundleDefinition({openapi:"3.0.0",info:{title:n||"",version:"1.0",description:{$ref:e}},paths:{}}):loadAndBundleDefinition(e)}export function loadSpecs({versions:e}){return __awaiter(this,void 0,void 0,(function*(){if(Array.isArray(e))for(const n of e)n.url&&(n.spec=yield loadAndBundleSpecOrMd(n.url))}))}export function useDeepCompareMemoize(e){const n=useRef(),t=useRef(0);return isDeepEqual(e,n.current)||(n.current=e,t.current+=1),[t.current]}export function getMarkdownHeaderId(e){return"string"==typeof e[0]?`section/${safeSlugify(e[0])}`:e.children?getMarkdownHeaderId(e[0]):void 0}
1
+ var __awaiter=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function c(e){try{s(i.next(e))}catch(e){r(e)}}function d(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,d)}s((i=i.apply(e,n||[])).next())}))};import{useRef}from"react";import isDeepEqual from"fast-deep-equal";import{loadAndBundleDefinition}from"../../utils/loadAndBundleSpec";import{safeSlugify}from"../../utils/helpers";export function fixSpec(e){const n=e.components&&e.components.securitySchemes||{};for(const e of Object.keys(n)){const t=n[e];t["x-type"]&&(t.type=t["x-type"]),t["x-scheme"]&&(t.scheme=t["x-scheme"])}}export function loadMany(e){return __awaiter(this,void 0,void 0,(function*(){return yield loadSpecs(e||{}),e}))}export function loadSingle(e,n,t){return __awaiter(this,void 0,void 0,(function*(){let i;if(null==t?void 0:t.skipBundleAndConvert){if(!e)throw new Error('spec must be specified when using "skipBundleAndConvert"');i=e}else i=yield loadAndBundleDefinition(e||n);const o=null==t?void 0:t.unstable_externalDescription;if(o)try{const e=yield fetch(o);i.info.description=yield e.text()}catch(e){console.warn(`Failed to load external description from ${o}: ${e.message}`)}try{fixSpec(i)}catch(e){}return i}))}export function loadAndBundleSpecOrMd(e,n){return e.endsWith(".md")?loadAndBundleDefinition({openapi:"3.0.0",info:{title:n||"",version:"1.0",description:{$ref:e}},paths:{}}):loadAndBundleDefinition(e)}export function loadSpecs({versions:e}){return __awaiter(this,void 0,void 0,(function*(){if(Array.isArray(e))for(const n of e)n.url&&(n.spec=yield loadAndBundleSpecOrMd(n.url))}))}export function useDeepCompareMemoize(e){const n=useRef(),t=useRef(0);return isDeepEqual(e,n.current)||(n.current=e,t.current+=1),[t.current]}export function getMarkdownHeaderId(e){return"string"==typeof e[0]?`section/${safeSlugify(e[0])}`:e.children?getMarkdownHeaderId(e[0]):void 0}
2
2
  //# sourceMappingURL=utils.js.map
@@ -1,4 +1,4 @@
1
- import React,{memo,useCallback,useMemo}from"react";import styled from"styled-components";import{PanelBody}from"@redocly/theme";import{useRecoilState,useRecoilValue}from"recoil";import{setRecoil}from"recoil-nexus";import{SamplesMiddlePanel,SamplesPanel,Row,Section}from"../common";import{getMediaType}from"../../models";import{LayoutVariant}from"../../constants";import{MediaTypeSamples}from"../PayloadSamples";import{Schema}from"../Schema";import{Markdown}from"../Markdown";import{CodePanel}from"../Panel";import{layoutSelector,showRightPanelToggleSelector}from"../../recoil/app";import{globalStoreSelector}from"../../recoil/store";import{operationStore}from"../../recoil/operation";const getMediaTypeInfo=(e,o)=>{if(!e)return{};const a={schema:{$ref:e}};return o&&(a.examples={example:{$ref:o}}),a};function SchemaDefinitionComponent({schemaRef:e,exampleRef:o,showReadOnly:a=!0,showWriteOnly:t=!1}){var l,n,i;const r=useRecoilValue(layoutSelector),{parser:m,options:c}=useRecoilValue(globalStoreSelector),s=useRecoilValue(showRightPanelToggleSelector),p=useMemo((()=>getMediaType(m,"json",!1,getMediaTypeInfo(e,o),c,{operation:{pointer:"SchemaDefinitionComponent"}})),[o,c,m,e]),[d,u]=useRecoilState(operationStore(null===(l=p.operation)||void 0===l?void 0:l.pointer)),f=useCallback((e=>{var o;const a=null===(o=p.schema)||void 0===o?void 0:o.oneOf;if(a&&(null==p?void 0:p.examples)&&Object.keys(null==p?void 0:p.examples).includes(e)){const o=a.findIndex((o=>o.title===e));-1!==o&&p.schema&&setRecoil(operationStore(p.schema.deps.operation.pointer),(e=>{var a,t,l;return Object.assign(Object.assign({},e),{activeExampleName:(null===(l=null===(t=null===(a=p.schema)||void 0===a?void 0:a.oneOf)||void 0===t?void 0:t[o])||void 0===l?void 0:l.title)||e.activeExampleName,activeOneOf:o})}))}d.activeExampleName!==e&&u((o=>Object.assign(Object.assign({},o),{activeExampleName:e})))}),[null==p?void 0:p.examples,p.schema,d.activeExampleName,u]);return React.createElement(Section,null,React.createElement(Row,{layout:r},React.createElement(SamplesMiddlePanel,{isStacked:r===LayoutVariant.STACKED||!s},(null===(n=p.schema)||void 0===n?void 0:n.description)&&React.createElement(Description,null,React.createElement(Markdown,{source:null===(i=p.schema)||void 0===i?void 0:i.description})),React.createElement(StyledPanelBody,{className:"panel-default"},React.createElement(Schema,{skipWriteOnly:!t,skipReadOnly:!a,schema:p.schema}))),s?React.createElement(SamplesPanel,null,React.createElement(CodePanel,{className:"panel-response-samples"},React.createElement(MediaTypeSamples,{mediaType:p,onChange:f}))):null))}export const SchemaDefinition=memo(SchemaDefinitionComponent);const Description=styled.div`
1
+ import React,{memo,useCallback,useMemo}from"react";import styled from"styled-components";import{PanelBody,LayoutVariant}from"@redocly/theme";import{useRecoilState,useRecoilValue}from"recoil";import{setRecoil}from"recoil-nexus";import{SamplesMiddlePanel,SamplesPanel,Row,Section}from"../common";import{getMediaType}from"../../models";import{MediaTypeSamples}from"../PayloadSamples";import{Schema}from"../Schema";import{Markdown}from"../Markdown";import{CodePanel}from"../Panel";import{layoutSelector,showRightPanelToggleSelector}from"../../recoil/app";import{globalStoreSelector}from"../../recoil/store";import{operationStore}from"../../recoil/operation";const getMediaTypeInfo=(e,o)=>{if(!e)return{};const a={schema:{$ref:e}};return o&&(a.examples={example:{$ref:o}}),a};function SchemaDefinitionComponent({schemaRef:e,exampleRef:o,showReadOnly:a=!0,showWriteOnly:t=!1}){var l,n,i;const r=useRecoilValue(layoutSelector),{parser:m,options:c}=useRecoilValue(globalStoreSelector),s=useRecoilValue(showRightPanelToggleSelector),p=useMemo((()=>getMediaType(m,"json",!1,getMediaTypeInfo(e,o),c,{operation:{pointer:"SchemaDefinitionComponent"}})),[o,c,m,e]),[d,u]=useRecoilState(operationStore(null===(l=p.operation)||void 0===l?void 0:l.pointer)),S=useCallback((e=>{var o;const a=null===(o=p.schema)||void 0===o?void 0:o.oneOf;if(a&&(null==p?void 0:p.examples)&&Object.keys(null==p?void 0:p.examples).includes(e)){const o=a.findIndex((o=>o.title===e));-1!==o&&p.schema&&setRecoil(operationStore(p.schema.deps.operation.pointer),(e=>{var a,t,l;return Object.assign(Object.assign({},e),{activeExampleName:(null===(l=null===(t=null===(a=p.schema)||void 0===a?void 0:a.oneOf)||void 0===t?void 0:t[o])||void 0===l?void 0:l.title)||e.activeExampleName,activeOneOf:o})}))}d.activeExampleName!==e&&u((o=>Object.assign(Object.assign({},o),{activeExampleName:e})))}),[null==p?void 0:p.examples,p.schema,d.activeExampleName,u]);return React.createElement(Section,null,React.createElement(Row,{layout:r},React.createElement(SamplesMiddlePanel,{isStacked:r===LayoutVariant.STACKED||!s},(null===(n=p.schema)||void 0===n?void 0:n.description)&&React.createElement(Description,null,React.createElement(Markdown,{source:null===(i=p.schema)||void 0===i?void 0:i.description})),React.createElement(StyledPanelBody,{className:"panel-default"},React.createElement(Schema,{skipWriteOnly:!t,skipReadOnly:!a,schema:p.schema}))),s?React.createElement(SamplesPanel,null,React.createElement(CodePanel,{className:"panel-response-samples"},React.createElement(MediaTypeSamples,{mediaType:p,onChange:S}))):null))}export const SchemaDefinition=memo(SchemaDefinitionComponent);const Description=styled.div`
2
2
  margin-bottom: var(--spacing-vertical);
3
3
  `,StyledPanelBody=styled(PanelBody)`
4
4
  --panel-schemas-body-padding: var(--panel-body-padding);
@@ -9,8 +9,7 @@ interface SectionContentProps {
9
9
  name: string;
10
10
  href?: string;
11
11
  };
12
- showApiInfo: boolean;
13
12
  showNextButton: Options['showNextButton'];
14
13
  }
15
- export declare function SectionContent({ items, pagination, nextSectionLink, showNextButton, showApiInfo, }: SectionContentProps): JSX.Element;
14
+ export declare function SectionContent({ items, pagination, nextSectionLink, showNextButton, }: SectionContentProps): JSX.Element;
16
15
  export {};
@@ -1,2 +1,2 @@
1
- import React,{useMemo}from"react";import{ApiInfo}from"../ApiInfo";import{ContentItem}from"../ContentItem";import{NextSectionButton}from"../NextSectionButton";import{Pagination}from"../../services";export function SectionContent({items:t,pagination:e,nextSectionLink:n,showNextButton:o,showApiInfo:i}){const a=useMemo((()=>e===Pagination.None?t:null==t?void 0:t.filter((t=>"section"===t.type))),[t,e]);return React.createElement(React.Fragment,null,i&&React.createElement(ApiInfo,null),a&&a.map((t=>React.createElement(ContentItem,{key:t.id,item:t,pagination:e,showNextButton:o}))),o&&n&&React.createElement(NextSectionButton,{href:n.href||"",label:n.name,pagination:e}))}
1
+ import React,{useMemo}from"react";import{ContentItem}from"../ContentItem";import{NextSectionButton}from"../NextSectionButton";import{Pagination}from"../../services";export function SectionContent({items:t,pagination:e,nextSectionLink:n,showNextButton:o}){const i=useMemo((()=>e===Pagination.None?t:null==t?void 0:t.filter((t=>"section"===t.type))),[t,e]);return React.createElement(React.Fragment,null,i.map((t=>React.createElement(ContentItem,{key:t.id,item:t}))),o&&n&&React.createElement(NextSectionButton,{href:n.href||"",label:n.name,pagination:e}))}
2
2
  //# sourceMappingURL=SectionContent.js.map
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Actions: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from"react";import{useRecoilState,useRecoilValue}from"recoil";import{SidebarActions,LayoutVariant}from"@redocly/theme";import{collapsedSidebarSelector,layoutSelector,showRightPanelToggleSelector}from"../../recoil/app";import{globalOptionsSelector}from"../../recoil/store";export const Actions=()=>{const{showChangeLayoutButton:e,showRightPanelToggle:o}=useRecoilValue(globalOptionsSelector),[t,a]=useRecoilState(layoutSelector),[l,i]=useRecoilState(showRightPanelToggleSelector),[c,r]=useRecoilState(collapsedSidebarSelector);return React.createElement(React.Fragment,null,React.createElement("div",{"data-component-name":"Sidebar/Actions",style:{position:"sticky",top:"calc(100vh - var(--layout-controls-height) - 20px)"}},React.createElement(SidebarActions,{showChangeLayoutButton:e,showRightPanelToggle:l,layout:t,initialShowRightPanelToggle:o,onChangeRightPanelViewClick:()=>i((e=>!e)),onChangeViewClick:()=>a(t===LayoutVariant.STACKED?LayoutVariant.THREE_PANEL:LayoutVariant.STACKED),collapsedSidebar:c,onChangeCollapseSidebarClick:()=>r((e=>!e)),isOpenapiDocs:!0})))};
2
+ //# sourceMappingURL=Actions.js.map
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { ExtendedMenuItem } from './types';
3
+ import { Pagination } from '../../services';
3
4
  interface MenuItemProps {
4
5
  active?: boolean;
5
6
  item: ExtendedMenuItem;
7
+ pagination?: Pagination;
6
8
  onClick?: () => void;
7
9
  }
8
10
  export declare const MenuItem: React.NamedExoticComponent<React.PropsWithChildren<MenuItemProps>>;
@@ -1,2 +1,2 @@
1
- import React,{memo,useCallback}from"react";import{Badge}from"@redocly/theme";import{MenuItemLi,MenuItemTitle}from"./styled";import{MenuItems}from"./MenuItems";import{MenuItemLink}from"./MenuItemLink";import{MenuOperationItemContent}from"./MenuOperationItemContent";import{ShelfIcon}from"../icons";import{encodeBackSlashes}from"../../utils";import{useMenuItemExpanded}from"./hooks";function MenuItemComponent({item:e,children:t,onClick:n}){var m;const[o,i]=useMenuItemExpanded(e),a=useCallback((()=>{e.href&&e.hasActiveSubItem||i(!o)}),[o,e.href,e.hasActiveSubItem,i]),c=(null===(m=e.items)||void 0===m?void 0:m.length)>0,r=encodeBackSlashes(e.href);return React.createElement(MenuItemLi,{depth:e.depth,"data-item-id":e.id,onClick:n},"operation"===e.type?React.createElement(MenuOperationItemContent,{item:e,to:r,active:e.active},t):React.createElement(MenuItemLink,{to:r,depth:e.depth,type:e.type,hasChildren:c,active:e.active,onClick:a},e.depth>0&&c&&React.createElement(ShelfIcon,{direction:o?"down":"right"})||null,e.isSchema?React.createElement(Badge,{type:"schema"},"schema"):null,React.createElement(MenuItemTitle,{title:e.name},e.name,t)),c&&React.createElement(MenuItems,{expanded:o,items:e.items}))}export const MenuItem=memo(MenuItemComponent);
1
+ import React,{memo,useCallback}from"react";import{Badge}from"@redocly/theme";import{Pagination}from"../../services";import{MenuItemLi,MenuItemTitle}from"./styled";import{MenuItems}from"./MenuItems";import{MenuItemLink}from"./MenuItemLink";import{MenuOperationItemContent}from"./MenuOperationItemContent";import{ShelfIcon}from"../icons";import{encodeBackSlashes}from"../../utils";import{useMenuItemExpanded}from"./hooks";function MenuItemComponent({item:e,children:t,onClick:n,pagination:m}){var i;const[o,a]=useMenuItemExpanded(e),c=getLink(e,m),r=useCallback((()=>{c&&e.hasActiveSubItem||a(!o)}),[c,e.hasActiveSubItem,a,o]),l=(null===(i=e.items)||void 0===i?void 0:i.length)>0;return React.createElement(MenuItemLi,{depth:e.depth,"data-item-id":e.id,onClick:n},"operation"===e.type?React.createElement(MenuOperationItemContent,{item:e,to:c,active:e.active},t):React.createElement(MenuItemLink,{to:c,depth:e.depth,type:e.type,hasChildren:l,active:e.active,onClick:r},e.depth>0&&l&&React.createElement(ShelfIcon,{direction:o?"down":"right"})||null,e.isSchema?React.createElement(Badge,{type:"schema"},"schema"):null,React.createElement(MenuItemTitle,{title:e.name},e.name,t)),l&&React.createElement(MenuItems,{expanded:o,items:e.items}))}export const MenuItem=memo(MenuItemComponent);function getLink(e,t){return"tag"!==e.type||e.description||t!==Pagination.Item?encodeBackSlashes(e.href):""}
2
2
  //# sourceMappingURL=MenuItem.js.map
@@ -1,2 +1,2 @@
1
- import React,{memo}from"react";import{StyledMenuItemLink,MenuItemLabel}from"./styled";function MenuItemLinkComponent({href:e,children:t,to:n,hasChildren:m,deprecated:r,depth:c,active:o,type:a,onClick:i}){return n?React.createElement(StyledMenuItemLink,{$active:o,$hasChildren:m,type:a,deprecated:r,depth:c,to:n,onClick:i},t):React.createElement(MenuItemLabel,{type:a,active:o,deprecated:r,depth:c,href:e},t)}export const MenuItemLink=memo(MenuItemLinkComponent);
1
+ import React,{memo}from"react";import{StyledMenuItemLink,MenuItemLabel}from"./styled";function MenuItemLinkComponent({href:e,children:t,to:n,hasChildren:m,deprecated:r,depth:c,active:i,type:o,onClick:a}){return n?React.createElement(StyledMenuItemLink,{$active:i,$hasChildren:m,type:o,deprecated:r,depth:c,to:n,onClick:a},t):React.createElement(MenuItemLabel,{type:o,active:i,deprecated:r,depth:c,href:e,$hasChildren:m,onClick:a},t)}export const MenuItemLink=memo(MenuItemLinkComponent);
2
2
  //# sourceMappingURL=MenuItemLink.js.map
@@ -1,2 +1,2 @@
1
- import React,{memo}from"react";import{MenuItem}from"./MenuItem";import{MenuItemUl}from"./styled";import{MenuExternalLink}from"./MenuItemEternalLink";function MenuItemsComponents({items:e,root:t,className:n,linksBefore:m=[],linksAfter:r=[],expanded:a=!0,style:i}){return React.createElement(MenuItemUl,{className:n,style:i,expanded:a,role:t?"navigation":void 0},m.map((e=>React.createElement(MenuExternalLink,{key:JSON.stringify(e),link:e}))),e.map((e=>React.createElement(MenuItem,{key:e.id,item:e}))),r.map((e=>React.createElement(MenuExternalLink,{key:JSON.stringify(e),link:e}))))}export const MenuItems=memo(MenuItemsComponents);
1
+ import React,{memo}from"react";import{useRecoilValue}from"recoil";import{MenuItem}from"./MenuItem";import{MenuItemUl}from"./styled";import{MenuExternalLink}from"./MenuItemEternalLink";import{globalOptionsSelector}from"../../recoil/store";import{Pagination}from"../../services";import{isRootItem}from"../ContentItems/helpers";function MenuItemsComponents({items:e,root:t,className:n,linksBefore:o=[],linksAfter:i=[],expanded:m=!0,style:r}){const{pagination:a,hideInfoSection:l}=useRecoilValue(globalOptionsSelector);return React.createElement(MenuItemUl,{className:n,style:r,expanded:m,role:t?"navigation":void 0},o.map((e=>React.createElement(MenuExternalLink,{key:JSON.stringify(e),link:e}))),e.map((e=>l&&a===Pagination.None&&isRootItem(e)?null:React.createElement(MenuItem,{key:e.id,item:e,pagination:a}))),i.map((e=>React.createElement(MenuExternalLink,{key:JSON.stringify(e),link:e}))))}export const MenuItems=memo(MenuItemsComponents);
2
2
  //# sourceMappingURL=MenuItems.js.map
@@ -8,13 +8,15 @@ export declare const MenuItemLi: import("styled-components").StyledComponent<"li
8
8
  export declare const StyledMenuItemLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react-router-dom").LinkProps & import("react").RefAttributes<HTMLAnchorElement>>, any, {
9
9
  role: "menuitem";
10
10
  className: `-depth${number} ` | `-depth${number} active`;
11
+ 'data-cy': string;
11
12
  } & Omit<import("./types").MenuItemLinkProps, "active" | "hasChildren"> & {
12
13
  $active: boolean;
13
14
  $hasChildren: boolean | undefined;
14
- }, "className" | "role">;
15
+ }, "className" | "role" | "data-cy">;
15
16
  export declare const MenuItemLabel: import("styled-components").StyledComponent<any, any, {
16
17
  role: "menuitem";
17
18
  className: `-depth${number} ` | `-depth${number} active`;
19
+ 'data-cy': string;
18
20
  } & Omit<import("./types").MenuItemLinkProps, "active" | "hasChildren"> & {
19
21
  $active: boolean;
20
22
  $hasChildren: boolean | undefined;
@@ -13,7 +13,7 @@ import styled from"styled-components";import{Link}from"react-router-dom";import{
13
13
  text-overflow: ellipsis;
14
14
  padding: 0;
15
15
  ${({depth:e})=>0===e?"margin-top: 10px":""};
16
- `;export const StyledMenuItemLink=styled(Link).attrs((({depth:e,$active:r})=>({role:"menuitem",className:`-depth${e} ${r?"active":""}`})))`
16
+ `;export const StyledMenuItemLink=styled(Link).attrs((({depth:e,$active:r,to:i})=>({role:"menuitem",className:`-depth${e} ${r?"active":""}`,"data-cy":i})))`
17
17
  cursor: pointer;
18
18
  position: relative;
19
19
  margin: ${({depth:e})=>`1px 0 1px calc( var(--sidebar-offset-left) + var(--sidebar-item-nested-offset) * ${e>0?e-1:e})`};
@@ -4,6 +4,7 @@ interface StickySidebarProps {
4
4
  className?: string;
5
5
  scrollYOffset: Options['scrollYOffset'];
6
6
  hideFab: Options['hideFab'];
7
+ collapsedSidebar: boolean;
7
8
  }
8
9
  export declare const StickyResponsiveSidebar: React.NamedExoticComponent<React.PropsWithChildren<StickySidebarProps>>;
9
10
  export {};
@@ -1,8 +1,8 @@
1
- import React,{memo,useRef,useState}from"react";import styled,{css}from"styled-components";import{MobileSidebarButton,useMount,useUnmount}from"@redocly/theme";import{useRecoilState}from"recoil";import{IS_BROWSER}from"../../utils";import{isSidebarOpenedSelector}from"../../recoil/app";let Stickyfill;IS_BROWSER&&(Stickyfill=require("stickyfill"));const stickyfill=Stickyfill&&Stickyfill(),StyledStickySidebar=styled.div`
1
+ import React,{memo,useEffect,useRef,useState}from"react";import styled,{css}from"styled-components";import{MobileSidebarButton,MobileSidebarIcon,useMount,useUnmount}from"@redocly/theme";import{useRecoilState}from"recoil";import{useLocation}from"react-router-dom";import{IS_BROWSER}from"../../utils";import{isSidebarOpenedSelector}from"../../recoil/app";import{Actions}from"../SideMenu/Actions";let Stickyfill;IS_BROWSER&&(Stickyfill=require("stickyfill"));const stickyfill=Stickyfill&&Stickyfill(),StyledStickySidebar=styled.div`
2
2
  overflow: hidden;
3
3
  flex-direction: column;
4
4
  backface-visibility: hidden;
5
- height: 100vh;
5
+ height: ${({offsetTop:e})=>`calc(100vh - ${e})`};
6
6
  top: 0;
7
7
  flex: 0 0 auto;
8
8
  position: fixed;
@@ -10,13 +10,13 @@ import React,{memo,useRef,useState}from"react";import styled,{css}from"styled-co
10
10
  z-index: 2;
11
11
  width: 100%;
12
12
  background: var(--sidebar-background-color);
13
- border-right: 1px solid var(--sidebar-border-color);
13
+ border-right: ${({collapsedSidebar:e})=>e?"1px solid var(--sidebar-border-color)":"auto"};
14
14
 
15
- ${({theme:e})=>css`
15
+ ${({theme:e,collapsedSidebar:t})=>css`
16
16
  ${e.mediaQueries[e.showAtBreakpoint.sidebar]} {
17
17
  position: sticky;
18
18
  z-index: auto;
19
- width: var(--sidebar-width);
19
+ width: ${t?"var(--sidebar-width)":"auto"};
20
20
  display: flex;
21
21
  }
22
22
  ${e.mediaQueries.print} {
@@ -35,5 +35,5 @@ import React,{memo,useRef,useState}from"react";import styled,{css}from"styled-co
35
35
  display: none;
36
36
  }
37
37
  `}
38
- `;function StickyResponsiveSidebarComponent({scrollYOffset:e,hideFab:i,className:t,children:o}){const[r,l]=useState("0px"),s=useRef(null),[n,a]=useRecoilState(isSidebarOpenedSelector);useMount((()=>{stickyfill&&stickyfill.add(s.current);const i=e();l(`${i}px`)})),useUnmount((()=>{stickyfill&&stickyfill.remove(s.current)}));return React.createElement(React.Fragment,null,React.createElement(StyledStickySidebar,{open:n,className:t,style:{top:r,height:`calc(100vh - ${r})`},ref:s},o),!i&&React.createElement(FloatingButton,{opened:n,onClick:()=>{a(!n)}}))}export const StickyResponsiveSidebar=memo(StickyResponsiveSidebarComponent);
38
+ `;function StickyResponsiveSidebarComponent({scrollYOffset:e,hideFab:t,className:i,children:o,collapsedSidebar:r}){const[a,l]=useState("0px"),s=useRef(null),c=useLocation(),[n,d]=useRecoilState(isSidebarOpenedSelector);useEffect((()=>{c.hash&&d(!1)}),[c.pathname,c.hash,d]),useMount((()=>{stickyfill&&stickyfill.add(s.current);const t=e();l(`${t}px`)})),useUnmount((()=>{stickyfill&&stickyfill.remove(s.current)}));return React.createElement(React.Fragment,null,React.createElement(StyledStickySidebar,{open:n,className:i,offsetTop:a,style:{top:a},ref:s,collapsedSidebar:r},r||n?o:null,React.createElement(Actions,null)),!t&&React.createElement(FloatingButton,{opened:n,onClick:()=>{d(!n)}},React.createElement(MobileSidebarIcon,null)))}export const StickyResponsiveSidebar=memo(StickyResponsiveSidebarComponent);
39
39
  //# sourceMappingURL=StickyResponsiveSidebar.js.map
@@ -1,2 +1,2 @@
1
- import React from"react";import{Pagination}from"../../services";import{ContentItem}from"../ContentItem";import{NextSectionButton}from"../NextSectionButton";import{SectionContent}from"../SectionContent";export function TagItems({tag:t,nextSectionLink:e,pagination:n,showNextButton:o}){return React.createElement(React.Fragment,null,React.createElement(ContentItem,{key:t.id,item:t,pagination:n,showNextButton:o,withChildren:n!==Pagination.Item}),n===Pagination.Item&&React.createElement(SectionContent,{items:t.items,pagination:n,showNextButton:!1,showApiInfo:!1}),o&&e&&React.createElement(NextSectionButton,{href:e.href||"",label:e.name,pagination:n}))}
1
+ import React from"react";import{Pagination}from"../../services";import{ContentItem}from"../ContentItem";import{NextSectionButton}from"../NextSectionButton";import{SectionContent}from"../SectionContent";export function TagItems({tag:t,nextSectionLink:e,pagination:n,showNextButton:o}){return React.createElement(React.Fragment,null,React.createElement(ContentItem,{key:t.id,item:t,withChildren:n!==Pagination.Item}),n===Pagination.Item&&React.createElement(SectionContent,{items:t.items||[],pagination:n,showNextButton:!1}),o&&e&&React.createElement(NextSectionButton,{href:e.href||"",label:e.name,pagination:n}))}
2
2
  //# sourceMappingURL=TagItems.js.map
@@ -1,4 +1,4 @@
1
- import { LayoutVariant } from '../../constants';
1
+ import { LayoutVariant } from '@redocly/theme';
2
2
  export declare const SamplesMiddlePanel: import("styled-components").StyledComponent<"div", any, {
3
3
  compact?: boolean | undefined;
4
4
  isStacked?: boolean | undefined;