@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.
- package/dist/console.redocly-openapi-docs.min.js +100 -98
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-openapi-docs.min.js +1021 -1027
- package/lib/components/ApiInfo/ApiInfo.d.ts +4 -1
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ContentItem/ContentItem.d.ts +0 -3
- package/lib/components/ContentItem/ContentItem.js +1 -1
- package/lib/components/ContentItems/ContentItems.d.ts +1 -7
- package/lib/components/ContentItems/ContentItems.js +1 -1
- package/lib/components/ContentItems/helpers.d.ts +9 -0
- package/lib/components/ContentItems/helpers.js +1 -1
- package/lib/components/Fields/FieldDetails.js +1 -1
- package/lib/components/Fields/styled.d.ts +1 -0
- package/lib/components/Fields/styled.js +5 -1
- package/lib/components/OperationItem/OperationItem.js +2 -2
- package/lib/components/OperationParameters/OperationParameters.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/index.d.ts +0 -1
- package/lib/components/RedoclyOpenAPIDocs/index.js +1 -1
- package/lib/components/RedoclyOpenAPIDocs/styled.d.ts +2 -2
- package/lib/components/RedoclyOpenAPIDocs/styled.js +8 -27
- package/lib/components/RedoclyOpenAPIDocs/types.d.ts +5 -4
- package/lib/components/RedoclyOpenAPIDocs/utils.js +1 -1
- package/lib/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib/components/SectionContent/SectionContent.d.ts +1 -2
- package/lib/components/SectionContent/SectionContent.js +1 -1
- package/lib/components/SideMenu/Actions.d.ts +2 -0
- package/lib/components/SideMenu/Actions.js +2 -0
- package/lib/components/SideMenu/MenuItem.d.ts +2 -0
- package/lib/components/SideMenu/MenuItem.js +1 -1
- package/lib/components/SideMenu/MenuItemLink.js +1 -1
- package/lib/components/SideMenu/MenuItems.js +1 -1
- package/lib/components/SideMenu/styled.d.ts +3 -1
- package/lib/components/SideMenu/styled.js +1 -1
- package/lib/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -0
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +6 -6
- package/lib/components/TagItems/TagItems.js +1 -1
- package/lib/components/common/panels.d.ts +1 -1
- package/lib/components/common/panels.js +2 -2
- package/lib/components/index.d.ts +1 -3
- package/lib/components/index.js +1 -1
- package/lib/components/rightPanel/Console/Console.js +1 -1
- package/lib/components/rightPanel/Console/shallowCopyForTryIt.d.ts +2 -0
- package/lib/components/rightPanel/Console/shallowCopyForTryIt.js +2 -0
- package/lib/components/rightPanel/ParameterArray.js +3 -1
- package/lib/components/rightPanel/utils.d.ts +0 -1
- package/lib/components/rightPanel/utils.js +1 -1
- package/lib/constants.d.ts +1 -4
- package/lib/constants.js +1 -1
- package/lib/hoc/types.d.ts +18 -0
- package/lib/hoc/withStore.d.ts +3 -0
- package/lib/hoc/withStore.js +2 -0
- package/lib/index.d.ts +12 -8
- package/lib/index.js +1 -1
- package/lib/models/group.d.ts +1 -1
- package/lib/models/group.js +1 -1
- package/lib/models/index.d.ts +1 -1
- package/lib/models/index.js +1 -1
- package/lib/models/operation.js +1 -1
- package/lib/models/types.d.ts +2 -1
- package/lib/recoil/app.d.ts +3 -1
- package/lib/recoil/app.js +1 -1
- package/lib/services/OpenAPIParser.d.ts +0 -1
- package/lib/services/OpenAPIParser.js +1 -1
- package/lib/services/Options/normalizeOptions.js +1 -1
- package/lib/services/Options/types.d.ts +3 -2
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/history/helpers.js +1 -1
- package/lib/services/menu/builder.js +1 -1
- package/lib/services/menu/markdown.js +1 -1
- package/lib/services/menu/operation.js +1 -1
- package/lib/services/menu/tags.js +1 -1
- package/lib/services/search/DeepSearchStore.js +1 -1
- package/lib/services/types.d.ts +1 -0
- package/lib/services/utils.d.ts +0 -1
- package/lib/services/utils.js +1 -1
- package/lib/standalone.d.ts +1 -1
- package/lib/standalone.js +1 -1
- package/lib/types/open-api.d.ts +0 -1
- package/lib/utils/helpers.js +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/loadAndBundleSpec.d.ts +0 -2
- package/lib/utils/loadAndBundleSpec.js +1 -1
- package/lib/utils/openapi.d.ts +4 -1
- package/lib/utils/openapi.js +1 -1
- package/lib/utils/path.d.ts +2 -1
- package/lib/utils/path.js +1 -1
- package/lib-esm/components/ApiInfo/ApiInfo.d.ts +4 -1
- package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/components/ContentItem/ContentItem.d.ts +0 -3
- package/lib-esm/components/ContentItem/ContentItem.js +1 -1
- package/lib-esm/components/ContentItems/ContentItems.d.ts +1 -7
- package/lib-esm/components/ContentItems/ContentItems.js +1 -1
- package/lib-esm/components/ContentItems/helpers.d.ts +9 -0
- package/lib-esm/components/ContentItems/helpers.js +1 -1
- package/lib-esm/components/Fields/FieldDetails.js +1 -1
- package/lib-esm/components/Fields/styled.d.ts +1 -0
- package/lib-esm/components/Fields/styled.js +4 -0
- package/lib-esm/components/OperationItem/OperationItem.js +2 -2
- package/lib-esm/components/OperationParameters/OperationParameters.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/index.d.ts +0 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/index.js +1 -1
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.d.ts +2 -2
- package/lib-esm/components/RedoclyOpenAPIDocs/styled.js +32 -51
- package/lib-esm/components/RedoclyOpenAPIDocs/types.d.ts +5 -4
- package/lib-esm/components/RedoclyOpenAPIDocs/utils.js +1 -1
- package/lib-esm/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib-esm/components/SectionContent/SectionContent.d.ts +1 -2
- package/lib-esm/components/SectionContent/SectionContent.js +1 -1
- package/lib-esm/components/SideMenu/Actions.d.ts +2 -0
- package/lib-esm/components/SideMenu/Actions.js +2 -0
- package/lib-esm/components/SideMenu/MenuItem.d.ts +2 -0
- package/lib-esm/components/SideMenu/MenuItem.js +1 -1
- package/lib-esm/components/SideMenu/MenuItemLink.js +1 -1
- package/lib-esm/components/SideMenu/MenuItems.js +1 -1
- package/lib-esm/components/SideMenu/styled.d.ts +3 -1
- package/lib-esm/components/SideMenu/styled.js +1 -1
- package/lib-esm/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -0
- package/lib-esm/components/StickySidebar/StickyResponsiveSidebar.js +6 -6
- package/lib-esm/components/TagItems/TagItems.js +1 -1
- package/lib-esm/components/common/panels.d.ts +1 -1
- package/lib-esm/components/common/panels.js +2 -2
- package/lib-esm/components/index.d.ts +1 -3
- package/lib-esm/components/index.js +1 -1
- package/lib-esm/components/rightPanel/Console/Console.js +1 -1
- package/lib-esm/components/rightPanel/Console/shallowCopyForTryIt.d.ts +2 -0
- package/lib-esm/components/rightPanel/Console/shallowCopyForTryIt.js +2 -0
- package/lib-esm/components/rightPanel/ParameterArray.js +3 -1
- package/lib-esm/components/rightPanel/utils.d.ts +0 -1
- package/lib-esm/components/rightPanel/utils.js +1 -1
- package/lib-esm/constants.d.ts +1 -4
- package/lib-esm/constants.js +1 -1
- package/lib-esm/hoc/types.d.ts +18 -0
- package/lib-esm/hoc/withStore.d.ts +3 -0
- package/lib-esm/hoc/withStore.js +2 -0
- package/lib-esm/index.d.ts +12 -8
- package/lib-esm/index.js +1 -1
- package/lib-esm/models/group.d.ts +1 -1
- package/lib-esm/models/group.js +1 -1
- package/lib-esm/models/index.d.ts +1 -1
- package/lib-esm/models/index.js +1 -1
- package/lib-esm/models/operation.js +1 -1
- package/lib-esm/models/types.d.ts +2 -1
- package/lib-esm/recoil/app.d.ts +3 -1
- package/lib-esm/recoil/app.js +1 -1
- package/lib-esm/services/OpenAPIParser.d.ts +0 -1
- package/lib-esm/services/OpenAPIParser.js +1 -1
- package/lib-esm/services/Options/normalizeOptions.js +1 -1
- package/lib-esm/services/Options/types.d.ts +3 -2
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/history/helpers.js +1 -1
- package/lib-esm/services/menu/builder.js +1 -1
- package/lib-esm/services/menu/markdown.js +1 -1
- package/lib-esm/services/menu/operation.js +1 -1
- package/lib-esm/services/menu/tags.js +1 -1
- package/lib-esm/services/search/DeepSearchStore.js +1 -1
- package/lib-esm/services/types.d.ts +1 -0
- package/lib-esm/services/utils.d.ts +0 -1
- package/lib-esm/services/utils.js +1 -1
- package/lib-esm/standalone.d.ts +1 -1
- package/lib-esm/standalone.js +1 -1
- package/lib-esm/types/open-api.d.ts +0 -1
- package/lib-esm/utils/helpers.js +1 -1
- package/lib-esm/utils/index.d.ts +0 -1
- package/lib-esm/utils/index.js +1 -1
- package/lib-esm/utils/loadAndBundleSpec.d.ts +0 -2
- package/lib-esm/utils/loadAndBundleSpec.js +1 -1
- package/lib-esm/utils/openapi.d.ts +4 -1
- package/lib-esm/utils/openapi.js +1 -1
- package/lib-esm/utils/path.d.ts +2 -1
- package/lib-esm/utils/path.js +1 -1
- package/package.json +9 -10
- package/lib/components/ChangeViewButton/ChangeViewButton.d.ts +0 -2
- package/lib/components/ChangeViewButton/ChangeViewButton.js +0 -2
- package/lib/components/ChangeViewButton/index.d.ts +0 -1
- package/lib/components/ChangeViewButton/index.js +0 -2
- package/lib/components/ChangeViewButton/styled.d.ts +0 -4
- package/lib/components/ChangeViewButton/styled.js +0 -18
- package/lib/components/ToggleRightPanelButton/ToggleRightPanelButton.d.ts +0 -2
- package/lib/components/ToggleRightPanelButton/ToggleRightPanelButton.js +0 -2
- package/lib/components/ToggleRightPanelButton/index.d.ts +0 -1
- package/lib/components/ToggleRightPanelButton/index.js +0 -2
- package/lib/components/ToggleRightPanelButton/styled.d.ts +0 -4
- package/lib/components/ToggleRightPanelButton/styled.js +0 -17
- package/lib-esm/components/ChangeViewButton/ChangeViewButton.d.ts +0 -2
- package/lib-esm/components/ChangeViewButton/ChangeViewButton.js +0 -2
- package/lib-esm/components/ChangeViewButton/index.d.ts +0 -1
- package/lib-esm/components/ChangeViewButton/index.js +0 -2
- package/lib-esm/components/ChangeViewButton/styled.d.ts +0 -4
- package/lib-esm/components/ChangeViewButton/styled.js +0 -18
- package/lib-esm/components/ToggleRightPanelButton/ToggleRightPanelButton.d.ts +0 -2
- package/lib-esm/components/ToggleRightPanelButton/ToggleRightPanelButton.js +0 -2
- package/lib-esm/components/ToggleRightPanelButton/index.d.ts +0 -1
- package/lib-esm/components/ToggleRightPanelButton/index.js +0 -2
- package/lib-esm/components/ToggleRightPanelButton/styled.d.ts +0 -4
- 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
|
|
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:
|
|
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:
|
|
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{
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export*from"./RedoclyOpenAPIDocs";export*from"./
|
|
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{
|
|
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:
|
|
29
|
-
max-width: ${
|
|
28
|
+
${({layout:a=LayoutVariant.THREE_PANEL,theme:e,collapsedSidebar:t})=>css`
|
|
29
|
+
max-width: ${a===LayoutVariant.THREE_PANEL?"100%":""};
|
|
30
30
|
|
|
31
|
-
${
|
|
32
|
-
width: calc(100% - var(--sidebar-width));
|
|
33
|
-
max-width: var(--layout-${
|
|
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
|
-
${
|
|
37
|
-
max-width: var(--layout-${
|
|
36
|
+
${e.mediaQueries.medium} {
|
|
37
|
+
max-width: var(--layout-${a}-medium-max-width);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
${
|
|
41
|
-
max-width: var(--layout-${
|
|
40
|
+
${e.mediaQueries.large} {
|
|
41
|
+
max-width: var(--layout-${a}-large-max-width);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
${
|
|
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:
|
|
59
|
-
${
|
|
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
|
-
${
|
|
64
|
+
${a.mediaQueries.print} {
|
|
65
65
|
display: none;
|
|
66
66
|
}
|
|
67
67
|
`}
|
|
68
|
-
`;const getBackgroundStubFixWidth=
|
|
68
|
+
`;const getBackgroundStubFixWidth=a=>css`
|
|
69
69
|
width: calc(
|
|
70
70
|
(
|
|
71
|
-
100% - min(100% - var(--sidebar-width) - var(--layout-controls-width), var(${
|
|
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:
|
|
85
|
-
${
|
|
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
|
-
${
|
|
90
|
+
${a.mediaQueries.large} {
|
|
91
91
|
${getBackgroundStubFixWidth("--layout-three-panel-large-max-width")};
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
${
|
|
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=
|
|
120
|
-
margin: 0 max(calc((100% - var(--panel-samples-width) - var(${
|
|
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:
|
|
112
|
+
${({layout:a})=>{if(a===LayoutVariant.STACKED)return css`
|
|
132
113
|
width: 100%;
|
|
133
114
|
padding-left: var(--spacing-horizontal);
|
|
134
115
|
`}}
|
|
135
|
-
${({showRightPanelToggle:
|
|
136
|
-
${({theme:
|
|
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:
|
|
144
|
-
${({theme:
|
|
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:
|
|
132
|
+
${({showRightPanelToggle:a,layout:e})=>a&&e===LayoutVariant.THREE_PANEL?css`
|
|
152
133
|
margin: 0;
|
|
153
|
-
${({theme:
|
|
134
|
+
${({theme:a})=>a.mediaQueries.small} {
|
|
154
135
|
${getMarginFixesByName("--layout-panel-schemas-small-max-width")};
|
|
155
136
|
}
|
|
156
|
-
${({theme:
|
|
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:
|
|
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
|
-
`:
|
|
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 '
|
|
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
|
|
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{
|
|
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,
|
|
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{
|
|
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
|
+
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
|
|
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:
|
|
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:
|
|
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:
|
|
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,
|
|
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
|