@redocly/openapi-docs 3.12.0-next.20 → 3.12.0-next.22
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 +1811 -1725
- package/lib/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/components/ApiInfo/styled.js +6 -5
- package/lib/components/OperationItem/OperationItem.js +5 -5
- package/lib/components/TagItem/TagItem.js +8 -7
- package/lib/components/common/panels.js +16 -10
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useAtomValue as h}from"jotai";import{LayoutVariant as g}from"@redocly/config";import{AfterOpenApiTitle as D}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiTitle";import{PageActions as k}from"@redocly/theme/components/PageActions/PageActions";import{SamplesMiddlePanel as S,Row as M}from"../common/index.js";import{ExternalDocumentation as T}from"../ExternalDocumentation/index.js";import{Markdown as s}from"../Markdown/index.js";import{ApiHeader as j}from"./styled.js";import{globalStoreAtom as v}from"../../jotai/store.js";import{saveTextBeforeHeading as y}from"../../utils/saveTextBeforeHeading.js";import{getValueFromMdParsedExtension as m}from"../../utils/helpers.js";import{RenderHook as H}from"../RenderHook/index.js";import{Metadata as P}from"./Metadata.js";import{useTranslate as E}from"../../hooks/index.js";function z({item:l,layout:e}){const p=E(),{options:{unstable_hooks:d,hideInfoMetadata:c,routingBasePath:f},parser:{definition:u}}=h(v),o=l.infoDefinition;if(!o)return null;const i=y(m(o,"description")||""),a=m(o,"summary")||void 0,n=u?.externalDocs||o?.externalDocs,x=o.version&&t("span",{children:["(",o.version,")"]})||null,A=e===g.STACKED;return r(M,{layout:e,children:t(S,{fullWidth:!0,className:"api-info",isStacked:A,children:[t(j,{children:[o.title," ",x,r(k,{pageSlug:f})]}),r(H,{Hook:D||d?.AfterApiTitle,props:{info:o}}),a&&r(s,{source:a,"data-role":"redoc-summary"}),i&&r(s,{source:i,"data-role":"redoc-description"}),n&&r(T,{externalDocs:n}),!c&&r(P,{metadata:o["x-metadata"],translate:p})]})})}export{z as ApiInfo};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import{H1 as
|
|
1
|
+
import{H1 as e}from"@redocly/theme/components/Typography/H1";import{Markdown as n}from"@redocly/theme/components/Markdown/Markdown";import{styled as o}from"../../styled-components.js";const t=15,p=o(e)`
|
|
2
|
+
display: flex;
|
|
2
3
|
margin-top: 0;
|
|
3
4
|
margin-bottom: 0;
|
|
4
|
-
& + ${
|
|
5
|
+
& + ${n} {
|
|
5
6
|
margin-top: var(--h1-margin-bottom);
|
|
6
7
|
}
|
|
7
|
-
`,
|
|
8
|
+
`,l=o.span`
|
|
8
9
|
&::before {
|
|
9
10
|
content: '|';
|
|
10
11
|
display: inline-block;
|
|
@@ -16,11 +17,11 @@ import{H1 as n}from"@redocly/theme/components/Typography/H1";import{Markdown as
|
|
|
16
17
|
&:last-child::after {
|
|
17
18
|
display: none;
|
|
18
19
|
}
|
|
19
|
-
`,
|
|
20
|
+
`,d=o.div`
|
|
20
21
|
overflow: hidden;
|
|
21
22
|
`,m=o.div`
|
|
22
23
|
display: flex;
|
|
23
24
|
flex-wrap: wrap;
|
|
24
25
|
// hide separator on new lines: idea from https://stackoverflow.com/a/31732902/1749888
|
|
25
26
|
margin-left: -${t}px;
|
|
26
|
-
`;export{p as ApiHeader,
|
|
27
|
+
`;export{p as ApiHeader,l as InfoSpan,m as InfoSpanBox,d as InfoSpanBoxWrap};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as V}from"react/jsx-runtime";import{memo as K,useState as F,useCallback as j,useMemo as L}from"react";import{useAtomValue as g}from"jotai";import{LayoutVariant as $}from"@redocly/config";import{AfterOpenApiOperation as z}from"@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiOperation";import{BeforeOpenApiOperation as G}from"@redocly/theme/components/OpenApiDocs/hooks/BeforeOpenApiOperation";import{PageActions as J}from"@redocly/theme/components/PageActions/PageActions";import{Feedback as Q}from"@redocly/theme/components/Feedback/Feedback";import{SamplesMiddlePanel as r,SamplesPanel as U,ShareLink as X,Row as B,CustomBadges as Y}from"../common/index.js";import{CallbacksList as Z}from"../Callbacks/index.js";import{CallbackSamples as ee}from"../CallbackSamples/index.js";import{RequestSamples as ae}from"../RequestSamples/index.js";import{OperationResponseList as te}from"../Responses/index.js";import{ResponseSamples as oe}from"../ResponseSamples/index.js";import{makeDeepLink as ne,joinWithSeparator as se}from"../../services/index.js";import{layoutAtom as re,userClaimsAtom as ie}from"../../jotai/app.js";import{globalOptionsAtom as le,globalStoreAtom as ce}from"../../jotai/store.js";import{getOperation as pe}from"../../models/operation.js";import{RenderHook as I}from"../RenderHook/index.js";import{Heading as de,Title as me}from"../common/OperationItemTitle.js";import{LinkToField as ge}from"../common/LinkToField.js";import{RequestDetails as ke}from"../Request/RequestDetails.js";import{StyledBadge as W}from"../common/Badges.js";import{useTranslate as ue}from"../../hooks/index.js";import{styled as k}from"../../styled-components.js";import{createPanelToggleEvent as be}from"../../events/index.js";function fe({item:{operationDefinition:S,parent:v,href:u}}){const s=ue(),{parser:y,options:l}=g(ce),{events:x}=g(le),T=g(ie),n=g(re),[c,H]=F(),{unstable_hooks:C,feedback:p}=l,a=L(()=>pe(y,S,v,l,u,void 0,T),[u,S,l,v,y,T]),{name:O,deprecated:_,isWebhook:q,badges:D}=a||{},o=n===$.STACKED,A=p?.type||"sentiment",R=p?.hide!==!0,b=se(l.routingBasePath,a.href),[f,E]=F(null),P=j(m=>{c!==m&&H(m)},[c]),d=j((m,w)=>{if(!w)return;const N=be({operation:a,isExpanded:m,panelType:w});x?.panelToggle?.(N)},[x,a]),M=L(()=>R?e(he,{children:e(Q,{type:A,settings:p.settings,path:b})}):null,[R,A,p.settings,b]);return t(Se,{layout:n,children:[e(i,{layout:n,children:t(r,{isStacked:o,children:[e(I,{Hook:G||C?.BeforeOperation,props:{operation:a}}),t(de,{"data-testid":"operation-item-header",children:[e(X,{to:u,"aria-label":`link to ${O}`}),e(Y,{badges:D,children:O}),_&&e(W,{deprecated:!0,children:s("openapi.badges.deprecated","Deprecated")}),q&&e(W,{children:s("openapi.badges.webhook","Webhook")}),e(J,{pageSlug:b})]})]})}),t(i,{layout:n,children:[e(r,{isStacked:o,children:e(ke,{operation:a,translate:s,onPanelToggle:d})}),e(h,{isStacked:o,"data-testid":"samples-block",className:"panel-container-request-samples",children:e(ae,{operation:a,onPanelToggle:d})})]}),t(i,{layout:n,children:[e(r,{isStacked:o,children:a.responses?.length?e(te,{responses:a.responses,operationId:a.id,operationPointer:a.pointer,callbackId:a.callbackId,activeResponseTab:c,onTabChange:P,onPanelToggle:d}):null}),e(h,{isStacked:o,"data-testid":"samples-block",className:"panel-container-response-samples",children:e(oe,{operation:a,activeResponseTab:c,onTabChange:P,onPanelToggle:d})})]}),t(i,{layout:n,children:[t(r,{isStacked:o,children:[a.callbacks?.length?t(V,{children:[t(me,{children:[e(ge,{to:ne(a.id,"callbacks")}),s("openapi.callbacks","Callbacks")]}),e(Z,{callbacks:a.callbacks,onExpand:E,selectedCallback:f})]}):null,e(I,{Hook:z||C?.AfterOperation,props:{operation:a}})]}),f?e(h,{isStacked:o,"data-testid":"samples-block",children:e(ee,{callback:f,translate:s})}):null]}),e(i,{layout:n,children:e(r,{isStacked:o,fullWidth:!0,children:M})})]})}const ze=K(fe),h=k(U)`
|
|
2
2
|
margin-left: auto;
|
|
3
3
|
--code-block-padding: var(--spacing-xs) 0 var(--spacing-xs) 20px;
|
|
4
|
-
`,
|
|
4
|
+
`,he=k.div`
|
|
5
5
|
& > div {
|
|
6
6
|
flex: 1 1 auto;
|
|
7
7
|
display: flex;
|
|
@@ -12,10 +12,10 @@ import{jsx as e,jsxs as t,Fragment as N}from"react/jsx-runtime";import{memo as V
|
|
|
12
12
|
width: 100%;
|
|
13
13
|
max-width: var(--feedback-width);
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,Se=k(B)`
|
|
16
16
|
flex-direction: column;
|
|
17
17
|
align-items: flex-start;
|
|
18
18
|
padding: var(--spacing-base) 0 calc(var(--spacing-xl) + var(--spacing-xs));
|
|
19
|
-
`,
|
|
19
|
+
`,i=k(B)`
|
|
20
20
|
margin: calc(var(--spacing-unit) * 2) 0;
|
|
21
|
-
`;export{
|
|
21
|
+
`;export{ze as OperationItem,h as OperationSamplesPanel};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as o}from"react/jsx-runtime";import{memo as h,useCallback as v}from"react";import{useNavigate as x}from"react-router-dom";import{useAtomValue as b}from"jotai";import{LayoutVariant as k}from"@redocly/config";import{breakpoints as y}from"@redocly/theme/core/openapi";import{Button as S}from"@redocly/theme/components/Button/Button";import{PageActions as w}from"@redocly/theme/components/PageActions/PageActions";import{H2 as C}from"@redocly/theme/components/Typography/H2";import{LinkIcon as j}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{Row as A,SamplesMiddlePanel as I,ShareLink as T}from"../common/index.js";import{Markdown as $}from"../Markdown/index.js";import{OperationsNavigation as B}from"./OperationsNavigation.js";import{layoutAtom as L}from"../../jotai/app.js";import{useTranslate as H}from"../../hooks/index.js";import{styled as n}from"../../styled-components.js";function M({item:t,routingBasePath:m="",isExpanded:e}){const p=H(),{description:d,name:s,href:g}=t,c=x(),l=b(L),i=m+t.href,u=v(()=>{c(i)},[c,i]),r=!!t.items.length,f=l===k.STACKED;return o(N,{expanded:e,children:[o(A,{layout:l,children:[o(I,{fullWidth:!r,isStacked:f,children:[o(V,{children:[a(T,{to:g,"aria-label":`link to ${s}`}),s,a(w,{pageSlug:i})]}),a($,{source:d})]}),r&&a(B,{items:t.items,routingBasePath:m})]}),r&&!e&&o(P,{type:"button",variant:"text",size:"medium",onClick:u,children:["+ ",p("openapi.actions.show","Show")]})]})}const Z=h(M),N=n.div`
|
|
2
2
|
padding-top: var(--spacing-lg);
|
|
3
|
-
padding-bottom: ${({expanded:
|
|
4
|
-
`,
|
|
3
|
+
padding-bottom: ${({expanded:t})=>t?"var(--spacing-xxl)":""};
|
|
4
|
+
`,P=n(S)`
|
|
5
5
|
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
6
6
|
width: calc(100% - var(--spacing-xl) * 2);
|
|
7
7
|
|
|
8
|
-
@media screen and (min-width: ${
|
|
8
|
+
@media screen and (min-width: ${y.medium}) {
|
|
9
9
|
--button-margin-md: calc(var(--spacing-xl) * 2);
|
|
10
10
|
|
|
11
11
|
margin-left: var(--button-margin-md);
|
|
12
12
|
margin-right: var(--button-margin-md);
|
|
13
13
|
width: calc(100% - var(--button-margin-md) * 2);
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,V=n(C)`
|
|
16
|
+
display: flex;
|
|
16
17
|
:hover {
|
|
17
|
-
${
|
|
18
|
+
${j} {
|
|
18
19
|
opacity: 1;
|
|
19
20
|
visibility: visible;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
`;export{
|
|
23
|
+
`;export{Z as TagItem,M as TagItemComponent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{css as
|
|
2
|
-
${({compact:a,isStacked:
|
|
1
|
+
import{css as i}from"styled-components";import{LayoutVariant as p}from"@redocly/config";import{H2 as l}from"@redocly/theme/components/Typography/H2";import{Markdown as d}from"@redocly/theme/components/Markdown/Markdown";import{breakpoints as t}from"@redocly/theme/core/openapi";import{SECTION_ATTR as c}from"../../constants.js";import{styled as r}from"../../styled-components.js";const f=r.div`
|
|
2
|
+
${({compact:a,isStacked:o,fullWidth:e})=>{const n=a?0:"var(--spacing-vertical)";return i`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
width: 100%;
|
|
@@ -10,11 +10,11 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
@media screen and (min-width: ${t.large}) {
|
|
13
|
-
width: ${e||
|
|
14
|
-
padding-left: ${
|
|
15
|
-
padding-right: ${
|
|
13
|
+
width: ${e||o?"100%":"calc(100% - var(--panel-samples-width))"};
|
|
14
|
+
padding-left: ${o?"var(--panel-gap-horizontal)":"calc(var(--panel-gap-horizontal) * 2)"};
|
|
15
|
+
padding-right: ${o?"var(--panel-gap-vertical)":"var(--panel-gap-horizontal)"};
|
|
16
16
|
padding-top: 0;
|
|
17
|
-
padding-bottom: ${
|
|
17
|
+
padding-bottom: ${o?"var(--spacing-vertical)":0};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@media print {
|
|
@@ -24,16 +24,22 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
24
24
|
}
|
|
25
25
|
`}};
|
|
26
26
|
|
|
27
|
+
${({compact:a})=>a&&i`
|
|
28
|
+
& & {
|
|
29
|
+
padding-left: 0;
|
|
30
|
+
padding-right: 0;
|
|
31
|
+
}
|
|
32
|
+
`}
|
|
33
|
+
|
|
27
34
|
&:last-child > ${d} :last-child,
|
|
28
35
|
${d} article :last-child {
|
|
29
36
|
margin-bottom: 0;
|
|
30
37
|
}
|
|
31
38
|
`,w=r.div.attrs(a=>({[c]:a.sectionId,id:a.id}))`
|
|
32
|
-
z-index: 0;
|
|
33
39
|
padding: 0;
|
|
34
40
|
width: 100%;
|
|
35
41
|
|
|
36
|
-
${({expanded:a})=>a&&
|
|
42
|
+
${({expanded:a})=>a&&i`
|
|
37
43
|
background-color: var(--layer-color);
|
|
38
44
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
39
45
|
--code-block-bg-color: var(--bg-color);
|
|
@@ -47,7 +53,7 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
47
53
|
@media screen and (min-width: ${t.medium}) {
|
|
48
54
|
padding-top: var(--spacing-xs);
|
|
49
55
|
|
|
50
|
-
${({expanded:a})=>!a&&
|
|
56
|
+
${({expanded:a})=>!a&&i`
|
|
51
57
|
padding-bottom: var(--spacing-xs);
|
|
52
58
|
`}
|
|
53
59
|
}
|
|
@@ -56,7 +62,7 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
56
62
|
padding: 0;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
|
-
${({underlined:a})=>a&&
|
|
65
|
+
${({underlined:a})=>a&&i`
|
|
60
66
|
position: relative;
|
|
61
67
|
|
|
62
68
|
&:not(:last-of-type):after {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.12.0-next.
|
|
3
|
+
"version": "3.12.0-next.22",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -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/config": "0.
|
|
40
|
-
"@redocly/replay": "0.15.0-next.
|
|
39
|
+
"@redocly/config": "0.28.0",
|
|
40
|
+
"@redocly/replay": "0.15.0-next.16"
|
|
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.56.0-next.
|
|
77
|
+
"@redocly/theme": "0.56.0-next.13"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|