@redocly/openapi-docs 3.11.0 → 3.12.0-next.0
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/redocly-openapi-docs.min.js +720 -741
- package/lib/components/Security/OAuthScopes.d.ts +5 -7
- package/lib/components/Security/OAuthScopes.js +9 -9
- package/lib/components/Security/SecurityFlow.js +4 -4
- package/lib/components/Security/helper.d.ts +1 -0
- package/lib/components/Security/helper.js +1 -1
- package/lib/components/Security/index.d.ts +1 -1
- package/lib/components/Security/index.js +1 -1
- package/lib/components/common/Select/styled.d.ts +0 -1
- package/lib/components/common/Select/styled.js +7 -28
- package/package.json +5 -5
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
2
|
import type { OpenAPISecurityScheme } from '../../types/index.js';
|
|
3
3
|
import type { SecurityRequirement } from '../../models/index.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export interface OAuthRequiredScopesProps {
|
|
4
|
+
type Flow = OpenAPISecurityScheme['flows'];
|
|
5
|
+
interface OAuthScopesMainProps {
|
|
8
6
|
id: string;
|
|
9
7
|
securities: SecurityRequirement[];
|
|
10
|
-
|
|
8
|
+
flows?: Flow;
|
|
11
9
|
}
|
|
12
|
-
export declare const
|
|
13
|
-
export
|
|
10
|
+
export declare const OAuthScopes: import("react").NamedExoticComponent<PropsWithChildren<OAuthScopesMainProps>>;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,Fragment as p,jsxs as c}from"react/jsx-runtime";import{memo as S,useState as v}from"react";import{ChevronRightIcon as b}from"@redocly/theme";import{Markdown as d}from"../Markdown/index.js";import{SecuritySchemeItem as a}from"./SecuritySchemeItem.js";import{Tag as m}from"./styled.js";import{useTranslate as l}from"../../hooks/index.js";import{getOptionalScopes as O,getRequiredScopes as x}from"./helper.js";import{styled as i}from"../../styled-components.js";function y({id:e,securities:t,flows:n}){const o=x(e,t);return c(p,{children:[r(w,{flows:n,requiredScopes:o}),r(q,{flows:n,requiredScopes:o})]})}function q({flows:e,requiredScopes:t}){return e&&Object.keys(e).map(n=>r(j,{flow:e[n],requiredScopes:t},n))}function j({flow:e,requiredScopes:t}){const n=l(),[o,h]=v(!1),f=Object.keys(e?.scopes||{}),u=O(t,f);return u.length===0?null:c(p,{children:[r(a,{label:c(A,{onClick:()=>{h(s=>!s)},children:[n(o?"openapi.hideOptionalScopes":"openapi.showOptionalScopes",o?"Hide optional scopes":"Show optional scopes"),r(C,{isOpen:o,children:r(b,{size:"var(--font-size-base)",color:"var(--tree-content-color-default)"})})]}),value:" "}),r(z,{isOpen:o,children:u.map(s=>r(a,{label:r(g,{className:"tag-grey",children:s}),value:r(d,{source:e?.scopes[s]||""})},s))})]})}function w({requiredScopes:e,flows:t}){const n=l();return e.length===0?null:t&&Object.keys(t).length>0?Object.keys(t).map(o=>r(k,{flow:t[o],requiredScopes:e},o)):r(a,{label:n("openapi.requiredScopes","Required scopes"),value:r(R,{children:e.map(o=>r(m,{className:"tag-grey",children:o},o))})})}function k({flow:e,requiredScopes:t}){const n=l();return c(p,{children:[r(a,{label:n("openapi.requiredScopes","Required scopes"),value:" "}),t.map(o=>r(a,{label:r(g,{className:"tag-grey",children:o}),value:r(d,{source:e?.scopes[o]||""})},o))]})}const g=i(m)`
|
|
2
2
|
font-family: var(--font-family-base);
|
|
3
3
|
font-size: var(--font-size-base);
|
|
4
4
|
line-height: var(--line-height-base);
|
|
@@ -6,28 +6,28 @@ import{jsx as e,jsxs as c,Fragment as d}from"react/jsx-runtime";import{memo as m
|
|
|
6
6
|
padding: 0 var(--spacing-xs);
|
|
7
7
|
border: var(--tag-border-width) var(--tag-border-style) var(--tag-bg-color);
|
|
8
8
|
border-radius: var(--tag-border-radius);
|
|
9
|
-
`,
|
|
9
|
+
`,A=i.div`
|
|
10
10
|
cursor: pointer;
|
|
11
11
|
display: flex;
|
|
12
12
|
gap: var(--spacing-xxs);
|
|
13
13
|
align-items: center;
|
|
14
14
|
user-select: none;
|
|
15
|
-
`,
|
|
15
|
+
`,R=i.div`
|
|
16
16
|
display: flex;
|
|
17
17
|
flex-wrap: wrap;
|
|
18
18
|
gap: var(--spacing-xxs);
|
|
19
19
|
word-break: normal;
|
|
20
|
-
`,
|
|
21
|
-
max-height: ${
|
|
22
|
-
opacity: ${
|
|
20
|
+
`,z=i.div`
|
|
21
|
+
max-height: ${e=>e.isOpen?"1000px":"0"};
|
|
22
|
+
opacity: ${e=>e.isOpen?"1":"0"};
|
|
23
23
|
overflow: hidden;
|
|
24
24
|
transition:
|
|
25
25
|
max-height 0.5s ease-in-out,
|
|
26
26
|
opacity 0.5s ease-in-out;
|
|
27
|
-
`,
|
|
27
|
+
`,C=i.span`
|
|
28
28
|
display: inline-flex;
|
|
29
29
|
align-items: center;
|
|
30
30
|
justify-content: center;
|
|
31
|
-
transform: ${
|
|
31
|
+
transform: ${e=>e.isOpen?"rotate(90deg)":"rotate(0deg)"};
|
|
32
32
|
transition: transform 0.5s ease-in-out;
|
|
33
|
-
`,
|
|
33
|
+
`,B=S(y);export{B as OAuthScopes};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,Fragment as p,jsxs as i}from"react/jsx-runtime";import{SecuritySchemeItem as a}from"./SecuritySchemeItem.js";import{titleize as v}from"../../utils/index.js";import{OAuthFlow as g}from"./OAuthFlow.js";import{StyledLink as w}from"./styled.js";import{Markdown as x}from"../Markdown/index.js";import{useTranslate as S}from"../../hooks/index.js";import{OAuthScopes as y}from"./OAuthScopes.js";import{styled as m}from"../../styled-components.js";function K({type:o,bearerFormat:c,name:d,flows:t,openIdConnectUrl:n,description:h,id:l,securities:u,in:f}){const e=S();if(!o||!l)return null;const b={http:i(p,{children:[r(a,{label:e("openapi.httpAuthorizationScheme","HTTP Authorization Scheme"),value:o}),r(a,{label:e("openapi.bearerFormat","Bearer Format"),value:c})]}),apiKey:r(a,{label:`${v(f||"")} ${e("openapi.parameterName","parameter name")}:`,value:d}),oauth2:i(p,{children:[r(a,{label:e("openapi.flowType","Flow type"),value:o}),t&&Object.keys(t).map(s=>r(g,{flow:t[s]},s))]}),openIdConnect:r(a,{label:e("openapi.connectUrl","Connect URL"),value:n&&r(w,{target:"_blank",rel:"noopener noreferrer",href:n,children:n})})};return i(F,{children:[r(T,{children:l}),r(x,{source:h}),i(z,{children:[b[o]||null,r(y,{id:l,securities:u,flows:t})]})]})}const F=m.div`
|
|
2
2
|
background: var(--layer-color);
|
|
3
3
|
padding: var(--spacing-base);
|
|
4
4
|
border-radius: var(--border-radius);
|
|
5
5
|
border: 1px solid var(--border-color-secondary);
|
|
6
6
|
width: 100%;
|
|
7
7
|
margin-top: var(--spacing-base);
|
|
8
|
-
`,
|
|
8
|
+
`,z=m.div`
|
|
9
9
|
width: 100%;
|
|
10
10
|
margin-top: var(--spacing-md);
|
|
11
|
-
`,
|
|
11
|
+
`,T=m.p`
|
|
12
12
|
font-size: var(--font-size-base);
|
|
13
13
|
margin: 0 0 var(--spacing-xs);
|
|
14
14
|
text-transform: capitalize;
|
|
15
15
|
font-weight: var(--font-weight-semibold);
|
|
16
|
-
`;export{
|
|
16
|
+
`;export{K as SecurityFlow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function f(r,o){const e=new Set;return o.forEach(({schemes:t})=>{t.forEach(({id:c,scopes:n})=>{c===r&&n.forEach(a=>e.add(a))})}),Array.from(e)}function i(r,o){const e=new Set(r);return o.filter(t=>!e.has(t))}export{i as getOptionalScopes,f as getRequiredScopes};
|
|
@@ -3,7 +3,7 @@ export { SecurityButton } from './SecurityButton.js';
|
|
|
3
3
|
export { SecurityFlow } from './SecurityFlow.js';
|
|
4
4
|
export { SecuritySchemeItem } from './SecuritySchemeItem.js';
|
|
5
5
|
export { OAuthFlow } from './OAuthFlow.js';
|
|
6
|
-
export {
|
|
6
|
+
export { OAuthScopes } from './OAuthScopes.js';
|
|
7
7
|
export { SecurityModal } from './SecurityModal.js';
|
|
8
8
|
export { Divider } from './Divider.js';
|
|
9
9
|
export * from './helper.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Security as e}from"./Security.js";import{SecurityButton as
|
|
1
|
+
import{Security as e}from"./Security.js";import{SecurityButton as m}from"./SecurityButton.js";import{SecurityFlow as f}from"./SecurityFlow.js";import{SecuritySchemeItem as u}from"./SecuritySchemeItem.js";import{OAuthFlow as i}from"./OAuthFlow.js";import{OAuthScopes as y}from"./OAuthScopes.js";import{SecurityModal as l}from"./SecurityModal.js";import{Divider as w}from"./Divider.js";export*from"./helper.js";export*from"./styled.js";export{w as Divider,i as OAuthFlow,y as OAuthScopes,e as Security,m as SecurityButton,f as SecurityFlow,l as SecurityModal,u as SecuritySchemeItem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as n}from"styled-components";import{ChevronDownIcon as t}from"@redocly/theme";import{Select as i}from"./Select.js";import{styled as e}from"../../../styled-components.js";const r=n`
|
|
2
2
|
background-color: var(--panel-samples-dropdown-bg-color);
|
|
3
3
|
border: var(--panel-samples-dropdown-border);
|
|
4
4
|
color: var(--panel-samples-dropdown-color);
|
|
@@ -8,7 +8,7 @@ import{css as t}from"styled-components";import{ChevronDownIcon as a}from"@redocl
|
|
|
8
8
|
&:focus-within {
|
|
9
9
|
box-shadow: none;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,a=e(i)`
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
outline: none;
|
|
14
14
|
display: inline-block;
|
|
@@ -43,7 +43,7 @@ import{css as t}from"styled-components";import{ChevronDownIcon as a}from"@redocl
|
|
|
43
43
|
box-shadow: none;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
${({variant:o})=>o==="dark"?
|
|
46
|
+
${({variant:o})=>o==="dark"?r:""};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.dropdown-select {
|
|
@@ -62,9 +62,9 @@ import{css as t}from"styled-components";import{ChevronDownIcon as a}from"@redocl
|
|
|
62
62
|
font-size: var(--font-size-base);
|
|
63
63
|
font-family: inherit;
|
|
64
64
|
padding: var(--docs-dropdown-padding);
|
|
65
|
-
${({variant:o})=>o==="dark"?
|
|
65
|
+
${({variant:o})=>o==="dark"?r:""};
|
|
66
66
|
}
|
|
67
|
-
`,c=
|
|
67
|
+
`,c=e(a)`
|
|
68
68
|
svg {
|
|
69
69
|
top: 60%;
|
|
70
70
|
transform: translateY(-60%);
|
|
@@ -82,29 +82,8 @@ import{css as t}from"styled-components";import{ChevronDownIcon as a}from"@redocl
|
|
|
82
82
|
box-shadow: none;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
`,
|
|
86
|
-
svg {
|
|
87
|
-
top: 60%;
|
|
88
|
-
transform: translateY(-60%);
|
|
89
|
-
}
|
|
90
|
-
label {
|
|
91
|
-
${e};
|
|
92
|
-
|
|
93
|
-
border-radius: var(--border-radius-lg);
|
|
94
|
-
margin-left: 5px;
|
|
95
|
-
transition: none;
|
|
96
|
-
min-width: auto;
|
|
97
|
-
background-color: ${({active:o})=>o?"var(--panel-samples-tabs-bg-color-active)":"var(--bg-color-raised)"};
|
|
98
|
-
& {
|
|
99
|
-
&[open],
|
|
100
|
-
&:focus-within,
|
|
101
|
-
&:hover {
|
|
102
|
-
background-color: var(--bg-color-tonal);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
`,h=r(a)`
|
|
85
|
+
`,h=e(t)`
|
|
107
86
|
position: absolute;
|
|
108
87
|
right: 10px;
|
|
109
88
|
top: 10px;
|
|
110
|
-
`;export{h as Arrow,
|
|
89
|
+
`;export{h as Arrow,a as Select,c as SimpleSelect};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0-next.0",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"npm": ">=10.0.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@redocly/theme": ">=0.
|
|
17
|
+
"@redocly/theme": ">=0.56.0-next.0",
|
|
18
18
|
"react": "^19.1.0",
|
|
19
19
|
"react-dom": "^19.1.0",
|
|
20
20
|
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"url-template": "^2.0.8",
|
|
37
37
|
"util": "~0.12.5",
|
|
38
38
|
"web-vitals": "3.3.1",
|
|
39
|
-
"@redocly/
|
|
40
|
-
"@redocly/
|
|
39
|
+
"@redocly/config": "0.26.2",
|
|
40
|
+
"@redocly/replay": "0.15.0-next.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typescript": "5.6.2",
|
|
75
75
|
"url": "~0.11.0",
|
|
76
76
|
"vite": "^6.3.5",
|
|
77
|
-
"@redocly/theme": "0.
|
|
77
|
+
"@redocly/theme": "0.56.0-next.0"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|