@redocly/openapi-docs 3.0.0-alpha.46 → 3.0.0-alpha.48
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 +45 -44
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-openapi-docs.min.js +1255 -1611
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/Download/DownloadLink.js +1 -1
- package/lib/components/Endpoint/ServerList.js +1 -1
- package/lib/components/Endpoint/styled.js +2 -2
- package/lib/components/ExternalDocumentation/ExternalDocumentation.js +2 -2
- package/lib/components/Fields/Extensions.js +2 -2
- package/lib/components/Fields/styled.d.ts +1 -2
- package/lib/components/Fields/styled.js +2 -2
- package/lib/components/Markdown/styled.d.ts +0 -8
- package/lib/components/Markdown/styled.js +1 -260
- package/lib/components/PayloadSamples/ExampleValue.js +1 -1
- package/lib/components/PayloadSamples/ExternalExample.js +1 -1
- package/lib/components/RequestSamples/CodeSample.js +1 -1
- package/lib/components/SectionContent/SectionContent.d.ts +2 -1
- package/lib/components/SectionContent/SectionContent.js +1 -1
- package/lib/components/SecurityRequirement/RequirementElement.js +3 -3
- package/lib/components/SecurityRequirement/SecurityDefs.js +1 -1
- package/lib/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib/components/SourceCodeWithFile/SourceCodeWithFile.js +1 -1
- package/lib/components/TagItems/TagItems.js +1 -1
- package/lib/components/common/CheckboxList.js +5 -4
- package/lib/components/common/Fields/fields.js +11 -7
- package/lib/components/rightPanel/ResponseBody.js +1 -1
- package/lib/components/rightPanel/ResponseHeadersList.js +1 -1
- package/lib/components/rightPanel/styled.d.ts +0 -1
- package/lib/components/rightPanel/styled.js +4 -7
- package/lib-esm/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/components/Download/DownloadLink.js +1 -1
- package/lib-esm/components/Endpoint/ServerList.js +1 -1
- package/lib-esm/components/Endpoint/styled.js +2 -2
- package/lib-esm/components/ExternalDocumentation/ExternalDocumentation.js +3 -3
- package/lib-esm/components/Fields/Extensions.js +1 -1
- package/lib-esm/components/Fields/styled.d.ts +1 -2
- package/lib-esm/components/Fields/styled.js +2 -2
- package/lib-esm/components/Markdown/styled.d.ts +0 -8
- package/lib-esm/components/Markdown/styled.js +1 -260
- package/lib-esm/components/PayloadSamples/ExampleValue.js +1 -1
- package/lib-esm/components/PayloadSamples/ExternalExample.js +1 -1
- package/lib-esm/components/RequestSamples/CodeSample.js +1 -1
- package/lib-esm/components/SectionContent/SectionContent.d.ts +2 -1
- package/lib-esm/components/SectionContent/SectionContent.js +1 -1
- package/lib-esm/components/SecurityRequirement/RequirementElement.js +1 -1
- package/lib-esm/components/SecurityRequirement/SecurityDefs.js +1 -1
- package/lib-esm/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib-esm/components/SourceCodeWithFile/SourceCodeWithFile.js +1 -1
- package/lib-esm/components/TagItems/TagItems.js +1 -1
- package/lib-esm/components/common/CheckboxList.js +5 -4
- package/lib-esm/components/common/Fields/fields.js +9 -5
- package/lib-esm/components/rightPanel/ResponseBody.js +1 -1
- package/lib-esm/components/rightPanel/ResponseHeadersList.js +1 -1
- package/lib-esm/components/rightPanel/styled.d.ts +0 -1
- package/lib-esm/components/rightPanel/styled.js +1 -4
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import{asField}from"informed";import{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import{asField}from"informed";import{CodeBlockControls,CodeBlockControlButton}from"@redocly/theme";import React,{useState}from"react";import styled from"styled-components";import{FormError}from"./form";import{Checkbox}from"./Checkbox";const DEFAULT_MAX_ITEMS=11;export const CheckboxListComponent=({items:e,fieldApi:t,validateOnChange:o,maxDisplayedItems:l,showControls:r,trimItemsLength:c})=>{const[a,n]=useState(!0),s=e=>t.getValue().includes(e),i=t.getError(),d=l||11,m=c&&a?e.slice(0,d):e;return React.createElement("div",null,r?React.createElement(CodeBlockControls,{controls:{select:{onClick:()=>{t.setValue(e)},label:"Select all",tooltipText:"Select all checkboxes"},deselect:{onClick:()=>{t.setValue([])},label:"Deselect all",tooltipText:"Deselect all checkboxes"}}}):null,React.createElement(ListWrapper,null,m.map((e=>React.createElement(Checkbox,{fullWidth:!0,id:e,value:e,checked:s(e),label:e,key:e,onChange:e=>{(e=>{const o=e.target.value,l=e.target.checked;t.setTouched(!0);const r=t.getValue()||[];let c;if(l)c=[...r,o];else{const e=r.indexOf(o);c=[...r.slice(0,e),...r.slice(e+1)]}t.setValue(c)})(e),o&&t.validate()}}))),e.length>d&&c?React.createElement(ToggleButton,{onClick:()=>{n((e=>!e))}},a?"Show all":"Collapse"):null),i?React.createElement(FormError,null,i):"")};export const CheckboxList=asField(CheckboxListComponent);const ListWrapper=styled.div`
|
|
2
|
+
padding: 10px;
|
|
3
|
+
background-color: var(--panel-samples-input-background-color);
|
|
4
|
+
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
|
5
|
+
`,ToggleButton=styled(CodeBlockControlButton)`
|
|
5
6
|
float: right;
|
|
6
7
|
`;
|
|
7
8
|
//# sourceMappingURL=CheckboxList.js.map
|
|
@@ -5,8 +5,6 @@ import styled,{css}from"styled-components";import{typography}from"../../../utils
|
|
|
5
5
|
outline: 0;
|
|
6
6
|
cursor: pointer;
|
|
7
7
|
padding: 0 10px 0 0;
|
|
8
|
-
font-family: var(--field-name-font-family);
|
|
9
|
-
font-size: var(--field-name-font-size);
|
|
10
8
|
color: var(--text-color);
|
|
11
9
|
&:focus {
|
|
12
10
|
font-weight: var(--font-weight-bold);
|
|
@@ -21,9 +19,15 @@ import styled,{css}from"styled-components";import{typography}from"../../../utils
|
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
${()=>{const e=getCssVariable("--schema-field-name-word-break");if(["break-all","break-word"].includes(e)){const r=`\n && button {\n max-width: calc(100% - 21px); /* left padding + toggle button width: 16px/2 + 13px */\n text-align: left;\n span {\n white-space: normal;\n word-break: ${e};\n vertical-align: top;\n display: inline-flex;\n }\n }\n `;return css`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
button {
|
|
23
|
+
${typography("schema-property-name")};
|
|
24
|
+
${r};
|
|
25
|
+
}
|
|
26
|
+
`}return css`
|
|
27
|
+
button {
|
|
28
|
+
${typography("schema-property-name")};
|
|
29
|
+
}
|
|
30
|
+
`}};
|
|
27
31
|
`;export const FieldLabel=styled.span`
|
|
28
32
|
vertical-align: middle;
|
|
29
33
|
line-height: 20px;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as React from"react";import{JsonViewer,
|
|
1
|
+
import*as React from"react";import{JsonViewer,CodeBlock,CodeBlockContainer}from"@redocly/theme";import{langFromMime}from"../../utils";import{ResponseHeader}from"./styled";import{SourceCodeWithFile}from"../SourceCodeWithFile";export function ResponseBody({response:e}){return React.createElement(React.Fragment,null,React.createElement(ResponseHeader,null," Body: "),getResponseBody(e))}function getResponseBody(e){return e.body?React.createElement(JsonViewer,{data:e.body,jsonSampleExpandLevel:1}):e.fileInfo?React.createElement(SourceCodeWithFile,{fileInfo:e.fileInfo}):null!==e.data?e.data?React.createElement(CodeBlock,{lang:langFromMime(e.headers["Content-Type"]||"text/plain"),source:e.data,header:{controls:{copy:{}}}}):React.createElement(CodeBlockContainer,{withControls:!0},React.createElement("i",null,"(no content)")):null}
|
|
2
2
|
//# sourceMappingURL=ResponseBody.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{useState}from"react";import styled from"styled-components";import{useRecoilValue}from"recoil";import{ResponseHeader
|
|
1
|
+
import React,{useState}from"react";import styled from"styled-components";import{useRecoilValue}from"recoil";import{CodeBlockContainer}from"@redocly/theme";import{ResponseHeader}from"./styled";import{globalOptionsSelector}from"../../recoil/store";export function ResponseHeadersList({headers:e}){const t=useRecoilValue(globalOptionsSelector),[o,r]=useState(!0),{maxResponseHeadersToShowInTryIt:a}=t,l=Object.keys(e),n=!!a&&l.length>a,s=n&&o?[...l].splice(0,a):[...l];return React.createElement(React.Fragment,null,React.createElement(ResponseHeader,null," Headers: "),React.createElement(CodeBlockContainer,{withControls:!0},s.map((t=>React.createElement("div",{key:t},React.createElement(HeaderName,null,t,":"),React.createElement("code",null,e[t])))),n&&React.createElement(StyledShowMoreLabel,{onClick:()=>{r(!o)}},o?"Show more...":"Hide headers")))}const HeaderName=styled.strong`
|
|
2
2
|
text-transform: capitalize;
|
|
3
3
|
display: inline-block;
|
|
4
4
|
padding-right: 5px;
|
|
@@ -13,6 +13,5 @@ export declare const TryItDropdown: import("styled-components").StyledComponent<
|
|
|
13
13
|
fullWidth?: boolean | undefined;
|
|
14
14
|
variant?: "dark" | "light" | undefined;
|
|
15
15
|
}, never>;
|
|
16
|
-
export declare const PanelPreCodeBlock: import("styled-components").StyledComponent<"pre", any, {}, never>;
|
|
17
16
|
export declare const ResponseHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
17
|
export declare const FlowName: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled,{css,keyframes}from"styled-components";import{
|
|
1
|
+
import styled,{css,keyframes}from"styled-components";import{Dropdown}from"../common/Dropdown";const shake=keyframes`
|
|
2
2
|
10%, 90% {
|
|
3
3
|
transform: translate3d(-1px, 0, 0);
|
|
4
4
|
}
|
|
@@ -83,9 +83,6 @@ import styled,{css,keyframes}from"styled-components";import{PreformattedCodeBloc
|
|
|
83
83
|
border: var(--panel-try-it-dropdown-border);
|
|
84
84
|
color: var(--panel-try-it-dropdown-color);
|
|
85
85
|
}
|
|
86
|
-
`;export const PanelPreCodeBlock=styled(PreformattedCodeBlock)`
|
|
87
|
-
border-top-left-radius: 0;
|
|
88
|
-
border-top-right-radius: 0;
|
|
89
86
|
`;export const ResponseHeader=styled.div`
|
|
90
87
|
margin-bottom: 10px;
|
|
91
88
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.48",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"webpack-dev-server": "^4.9.3",
|
|
120
120
|
"workerize-loader": "github:redocly/workerize-loader#webpack-5-dist",
|
|
121
121
|
"js-yaml": "4.1.0",
|
|
122
|
-
"@redocly/theme": "0.
|
|
122
|
+
"@redocly/theme": "0.17.1"
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"start": "webpack serve --mode=development --hot",
|