Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support of react 18 #2369

Merged
merged 5 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,480 changes: 1,985 additions & 1,495 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
"peerDependencies": {
"core-js": "^3.1.4",
"mobx": "^6.0.4",
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0",
"styled-components": "^4.1.1 || ^5.1.1"
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0",
"styled-components": "^4.1.1 || ^5.1.1 || ^6.0.5"
},
"dependencies": {
"@redocly/openapi-core": "^1.0.0-beta.104",
Expand Down
4 changes: 3 additions & 1 deletion src/common-elements/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export const TypeTitle = styled(FieldLabel)`

export const TypeFormat = TypeName;

export const RequiredLabel = styled(FieldLabel.withComponent('div'))`
export const RequiredLabel = styled(FieldLabel).attrs({
as: 'div',
})`
color: ${props => props.theme.schema.requireLabelColor};
font-size: ${props => props.theme.schema.labelsTextSize};
font-weight: normal;
Expand Down
4 changes: 3 additions & 1 deletion src/common-elements/samples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export const SampleControlsWrap = styled.div`
}
`;

export const StyledPre = styled(PrismDiv.withComponent('pre'))`
export const StyledPre = styled(PrismDiv).attrs({
as: 'pre',
})`
font-family: ${props => props.theme.typography.code.fontFamily};
font-size: ${props => props.theme.typography.code.fontSize};
overflow-x: auto;
Expand Down
5 changes: 4 additions & 1 deletion src/components/Markdown/SanitizedMdBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import * as React from 'react';
import { OptionsConsumer } from '../OptionsProvider';
import { StylingMarkdownProps } from './Markdown';
import { StyledMarkdownBlock } from './styled.elements';
import styled from 'styled-components';

const StyledMarkdownSpan = StyledMarkdownBlock.withComponent('span');
const StyledMarkdownSpan = styled(StyledMarkdownBlock)`
display: inline;
`;

const sanitize = (untrustedSpec, html) => (untrustedSpec ? DOMPurify.sanitize(html) : html);

Expand Down
4 changes: 3 additions & 1 deletion src/components/Responses/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export const ResponseDetailsWrap = styled.div`
padding: 10px;
`;

export const HeadersCaption = styled(UnderlinedHeader.withComponent('caption'))`
export const HeadersCaption = styled(UnderlinedHeader).attrs({
as: 'caption',
})`
text-align: left;
margin-top: 1em;
caption-side: top;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
exports[`Components SchemaView OneOf deprecated should match snapshot 1`] = `
<div>
<span
class="sc-kfYoZR juYXUf"
class="sc-fUnMCh hPwMmL"
>
One of
</span>
<div
class="sc-dlMDgC EoFth"
class="sc-feUZmu bTropM"
>
<button
class="sc-fKgJPI iEPbLk"
class="sc-hzhJZQ ilKqWS"
>
string
</button>
<button
class="sc-fKgJPI bpjiHN"
class="sc-hzhJZQ emRRrf"
>
integer
</button>
</div>
<div>
<span
class="sc-bqGGPW eSYQnm"
class="sc-jEACwC gWyYnj"
type="warning"
>
Deprecated
Expand All @@ -33,18 +33,18 @@ exports[`Components SchemaView OneOf deprecated should match snapshot 1`] = `
<div>
<div>
<span
class="sc-laZMeE sc-iNiQyp jWaWWE jrLlAa"
class="sc-Nxspf sc-cfxfcM cXxAXt jrGEaR"
/>
<span
class="sc-laZMeE sc-jffHpj jWaWWE cThoNa"
class="sc-Nxspf sc-gFAWRd cXxAXt dYzdDr"
>
string
</span>
</div>

<div>
<div
class="sc-iJCRrE sc-ciSkZP jCdxGr lhENGb"
class="sc-eeDRCY sc-eBMEME gTGgei hXXgcw"
/>
</div>
</div>
Expand Down

Large diffs are not rendered by default.

Loading