mirror of
https://github.com/Redocly/redoc.git
synced 2025-09-24 04:56:39 +03:00
SG-17839 API > Make api docs for the latest version
This commit is contained in:
parent
0b55f34cbf
commit
36232e3d17
|
@ -49,7 +49,7 @@
|
||||||
"stats": "webpack --env production --env standalone --json --profile --mode=production > stats.json",
|
"stats": "webpack --env production --env standalone --json --profile --mode=production > stats.json",
|
||||||
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
|
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
|
||||||
"lint": "eslint --fix 'src/**/*.{js,ts,tsx}' --cache",
|
"lint": "eslint --fix \"src/**/*.{js,ts,tsx}\" --cache",
|
||||||
"benchmark": "node ./benchmark/benchmark.js",
|
"benchmark": "node ./benchmark/benchmark.js",
|
||||||
"start:demo": "webpack serve --hot --config demo/webpack.config.ts --mode=development",
|
"start:demo": "webpack serve --hot --config demo/webpack.config.ts --mode=development",
|
||||||
"build:demo": "webpack --mode=production --config demo/webpack.config.ts",
|
"build:demo": "webpack --mode=production --config demo/webpack.config.ts",
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as React from 'react';
|
||||||
|
|
||||||
import { DropdownOption, DropdownProps } from '../../common-elements/Dropdown';
|
import { DropdownOption, DropdownProps } from '../../common-elements/Dropdown';
|
||||||
import { MediaContentModel, MediaTypeModel, SchemaModel } from '../../services/models';
|
import { MediaContentModel, MediaTypeModel, SchemaModel } from '../../services/models';
|
||||||
import { DropdownLabel, DropdownWrapper } from '../PayloadSamples/styled.elements';
|
// import { DropdownLabel, DropdownWrapper } from '../PayloadSamples/styled.elements';
|
||||||
|
|
||||||
export interface MediaTypeChildProps {
|
export interface MediaTypeChildProps {
|
||||||
schema: SchemaModel;
|
schema: SchemaModel;
|
||||||
|
@ -40,15 +40,15 @@ export class MediaTypesSwitch extends React.Component<MediaTypesSwitchProps> {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const Wrapper = ({ children }) =>
|
const Wrapper = ({ children }) => (this.props.withLabel ? <></> : children);
|
||||||
this.props.withLabel ? (
|
// this.props.withLabel ? (
|
||||||
<DropdownWrapper>
|
// <DropdownWrapper>
|
||||||
<DropdownLabel>Content type</DropdownLabel>
|
// <DropdownLabel>Content type</DropdownLabel>
|
||||||
{children}
|
// {children}
|
||||||
</DropdownWrapper>
|
// </DropdownWrapper>
|
||||||
) : (
|
// ) : (
|
||||||
children
|
// children
|
||||||
);
|
// );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -29,12 +29,9 @@ export const ApiContentWrap = styled.div`
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: calc(100% - ${props => props.theme.sidebar.width});
|
|
||||||
${media.lessThan('small', true)`
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
`};
|
|
||||||
|
|
||||||
contain: layout;
|
contain: layout;
|
||||||
|
padding-left: 260px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const BackgroundStub = styled.div`
|
export const BackgroundStub = styled.div`
|
||||||
|
|
|
@ -7,8 +7,6 @@ import { OptionsContext } from '../OptionsProvider';
|
||||||
import { MenuItems } from './MenuItems';
|
import { MenuItems } from './MenuItems';
|
||||||
|
|
||||||
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
|
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
|
||||||
import { RedocAttribution } from './styled.elements';
|
|
||||||
import RedoclyLogo from './Logo';
|
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class SideMenu extends React.Component<{ menu: MenuStore; className?: string }> {
|
export class SideMenu extends React.Component<{ menu: MenuStore; className?: string }> {
|
||||||
|
@ -27,12 +25,6 @@ export class SideMenu extends React.Component<{ menu: MenuStore; className?: str
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MenuItems items={store.items} onActivate={this.activate} root={true} />
|
<MenuItems items={store.items} onActivate={this.activate} root={true} />
|
||||||
<RedocAttribution>
|
|
||||||
<a target="_blank" rel="noopener noreferrer" href="https://redocly.com/redoc/">
|
|
||||||
<RedoclyLogo />
|
|
||||||
API docs by Redocly
|
|
||||||
</a>
|
|
||||||
</RedocAttribution>
|
|
||||||
</PerfectScrollbarWrap>
|
</PerfectScrollbarWrap>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,12 @@ const StyledStickySidebar = styled.div<{ $open?: boolean }>`
|
||||||
/* contain: strict; TODO: breaks layout since Chrome 80*/
|
/* contain: strict; TODO: breaks layout since Chrome 80*/
|
||||||
|
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
position: sticky;
|
position: fixed;
|
||||||
position: -webkit-sticky;
|
position: -webkit-sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
z-index: 20;
|
||||||
|
|
||||||
${media.lessThan('small')`
|
${media.lessThan('small')`
|
||||||
position: fixed;
|
|
||||||
z-index: 20;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: ${({ theme }) => theme.sidebar.backgroundColor};
|
background: ${({ theme }) => theme.sidebar.backgroundColor};
|
||||||
display: ${props => (props.$open ? 'flex' : 'none')};
|
display: ${props => (props.$open ? 'flex' : 'none')};
|
||||||
|
|
|
@ -222,12 +222,12 @@ export class OperationModel implements IMenuItem {
|
||||||
|
|
||||||
samples = [
|
samples = [
|
||||||
...samples.slice(0, insertInx),
|
...samples.slice(0, insertInx),
|
||||||
{
|
// {
|
||||||
lang: 'payload',
|
// lang: 'payload',
|
||||||
label: 'Payload',
|
// label: 'Payload',
|
||||||
source: '',
|
// source: '',
|
||||||
requestBodyContent,
|
// requestBodyContent,
|
||||||
},
|
// },
|
||||||
...samples.slice(insertInx),
|
...samples.slice(insertInx),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user