@redocly/openapi-docs 3.12.0-next.15 → 3.12.0-next.17
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 +766 -750
- package/lib/components/ExpandAllButton/ExpandAllButton.js +2 -2
- package/lib/components/RequestSamples/Example.js +1 -1
- package/lib/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/common/panels.js +8 -12
- package/package.json +4 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{useAtom as d}from"jotai";import{MaximizeIcon as m}from"@redocly/theme/icons/MaximizeIcon/MaximizeIcon";import{Button as c}from"@redocly/theme/components/Button/Button";import{operationStore as x}from"../../jotai/operation.js";import{useTelemetry as u,useTranslate as f}from"../../hooks/index.js";import{styled as A}from"../../styled-components.js";const
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{useAtom as d}from"jotai";import{MaximizeIcon as m}from"@redocly/theme/icons/MaximizeIcon/MaximizeIcon";import{Button as c}from"@redocly/theme/components/Button/Button";import{operationStore as x}from"../../jotai/operation.js";import{useTelemetry as u,useTranslate as f}from"../../hooks/index.js";import{styled as A}from"../../styled-components.js";const j=({operationPointer:a,type:o,onPanelToggle:r})=>{const t=f(),[l,s]=d(x(a)),p=u(),i=()=>{const e=!l[o].expandedAll;p.send({type:"openapi_docs.expand_collapse_all.clicked",payload:{isExpanded:e}}),s({[o]:{expandedAll:e}}),r?.(e,o==="request"?"request":"responses")};return n(g,{icon:n(m,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:i,children:l[o].expandedAll?t("openapi.collapseAll","Collapse all"):t("openapi.expandAll","Expand all")})},g=A(c)`
|
|
2
2
|
margin-left: auto;
|
|
3
|
-
`;export{
|
|
3
|
+
`;export{j as ExpandAllButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as c,Fragment as f,jsxs as h}from"react/jsx-runtime";import{memo as u}from"react";import{useAtom as E}from"jotai";import{ExampleSwitch as g,useExampleKey as
|
|
1
|
+
import{jsx as c,Fragment as f,jsxs as h}from"react/jsx-runtime";import{memo as u}from"react";import{useAtom as E}from"jotai";import{ExampleSwitch as g,useExampleKey as d}from"../Samples/index.js";import{useActivateExample as O,useTelemetry as j}from"../../hooks/index.js";import{operationStore as y}from"../../jotai/operation.js";function _({mediaType:o,mediaContent:p,renderSample:n}){const r=j(),m=o.operation.pointer,[l,x]=E(y(m)),a=o.examples||{},e=Object.keys(a),i=O(p),{exampleKey:s}=d(o.operation,a);return!e.length||e.length===1?n():h(f,{children:[c(g,{examples:a,exampleKey:s,onChange:t=>{r.send({type:"openapi_docs.examples_switcher.clicked",payload:{example:t,numberOfExamples:e.length}}),x({...l,activeExampleName:t,activeOneOf:{[m]:e.indexOf(t)},requestValues:{body:null}}),i(t)}}),n(s)]})}const N=u(_);export{N as Example};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as o,jsxs as D}from"react/jsx-runtime";import{memo as
|
|
1
|
+
import{jsx as o,jsxs as D}from"react/jsx-runtime";import{memo as T,useCallback as k,useMemo as A}from"react";import{useAtomValue as y,useAtom as M}from"jotai";import{PanelHeader as U}from"@redocly/theme/components/Panel/PanelHeader";import{PayloadSamples as W}from"../PayloadSamples/index.js";import{CodeSample as B}from"./CodeSample.js";import{useCodeSamples as F}from"./useCodeSamples.js";import{isPayloadSample as H}from"../../models/index.js";import{createCodeSampleCopyEvent as O,createLanguageSwitchEvent as V}from"../../events/index.js";import{globalStoreAtom as $}from"../../jotai/store.js";import{ServerListDropdown as z}from"../ServerListDropdown/index.js";import{LanguageDropdown as G}from"../Language/index.js";import{activeMimeNameAtom as J,languageAtom as K}from"../../jotai/app.js";import{Replay as L}from"../Replay/index.js";import{CodeBlockPanel as w}from"../common/index.js";import{useActiveWithFallback as Q,useTelemetry as X}from"../../hooks/index.js";import{operationStore as Y}from"../../jotai/operation.js";import{styled as v}from"../../styled-components.js";function Z({operation:a,disableFooter:P,onPanelToggle:S,...p}){const c=X(),[{activeLanguage:q,languages:m},R]=M(K),{samples:n}=F(a),{parser:d,options:{events:s,corsProxyUrl:g,hideReplay:_}}=y($),i=!P&&!a.isWebhook&&!_&&!a.hideReplay,t=!!m?.length,u=Q(n,q),E=e=>{R(e),c.send({type:"openapi_docs.select_language.clicked",payload:{language:e}});const r=m?.find(l=>l.key===e);if(s?.codeSamplesLanguageSwitch&&r){const l=V({operation:a,sample:{lang:r.lang,label:r.title}});s.codeSamplesLanguageSwitch(l)}},h=y(J),{activeExampleName:x}=y(Y(a.pointer)),f=k(({lang:e,title:r})=>()=>{const l=O({operation:a,label:r,lang:e,type:"request",activeMimeName:h,activeExampleName:x});c.send({type:"openapi_docs.copy_code_snippet.clicked",payload:{snippetType:"request",language:e}}),s?.codeSamplesCopy?.(l)},[a,c,s,h,x]),b=k(e=>{S?.(e,"request-samples")},[S]),C=()=>D(I,{isExpandable:!1,withReplay:!t&&i,children:[o(ee,{operation:a}),t&&o(G,{activeTab:u,samples:n,onChange:E}),!t&&i&&o(L,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})]}),j=A(()=>{if(i&&t)return o(ae,{children:o(L,{operation:a,corsProxyUrl:g,fullOpenApi:d.definition})})},[i,t,a,g,d.definition]),N=A(()=>n.map(e=>e.key===u?o("div",{children:H(e)?o(W,{content:e.requestBodyContent,onCopyClick:f(e),onPanelToggle:b,...p}):o(B,{lang:e.lang,source:e.source,externalSample:e,operation:a,onCopyClick:f(e),...p})},e.key+a.id):null),[u,f,b,a,p,n]);return m&&!n.length?o(w,{className:"panel-request-samples",header:C,isExpandable:!1,expanded:!1}):n.length?o(w,{className:"panel-request-samples",header:C,footer:j,isExpandable:!1,children:N}):null}const xe=T(Z),I=v(U)`
|
|
2
2
|
flex-wrap: nowrap;
|
|
3
3
|
${({withReplay:a})=>a&&"padding: var(--spacing-xs) var(--spacing-sm);"}
|
|
4
4
|
`,ee=v(z)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{memo as b,useCallback as i}from"react";import{useAtomValue as n}from"jotai";import{PayloadSamples as h,StyledCodeBlock as v}from"../PayloadSamples/index.js";import{createCodeSampleCopyEvent as k}from"../../events/index.js";import{globalOptionsAtom as T}from"../../jotai/store.js";import{Summary as g}from"./Summary.js";import{Tabs as x}from"../Tabs/index.js";import{CodeBlockPanel as N}from"../common/index.js";import{useTelemetry as _,useTranslate as A}from"../../hooks/index.js";import{activeMimeNameAtom as E}from"../../jotai/app.js";import{operationStore as P}from"../../jotai/operation.js";function R({operation:o,activeResponseTab:d,onTabChange:y,onPanelToggle:a}){const m=_(),{events:p}=n(T),f=A(),u=o.responses.filter(e=>e.content?.hasSample??!1),s=o.responses.map(({code:e})=>({key:e,title:e})),r=s?.find(({key:e})=>e===d)||s?.[0],l=n(E),{activeExampleName:c}=n(P(o.pointer)),C=i(()=>{m.send({type:"openapi_docs.copy_code_snippet.clicked",payload:{
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{memo as b,useCallback as i}from"react";import{useAtomValue as n}from"jotai";import{PayloadSamples as h,StyledCodeBlock as v}from"../PayloadSamples/index.js";import{createCodeSampleCopyEvent as k}from"../../events/index.js";import{globalOptionsAtom as T}from"../../jotai/store.js";import{Summary as g}from"./Summary.js";import{Tabs as x}from"../Tabs/index.js";import{CodeBlockPanel as N}from"../common/index.js";import{useTelemetry as _,useTranslate as A}from"../../hooks/index.js";import{activeMimeNameAtom as E}from"../../jotai/app.js";import{operationStore as P}from"../../jotai/operation.js";function R({operation:o,activeResponseTab:d,onTabChange:y,onPanelToggle:a}){const m=_(),{events:p}=n(T),f=A(),u=o.responses.filter(e=>e.content?.hasSample??!1),s=o.responses.map(({code:e})=>({key:e,title:e})),r=s?.find(({key:e})=>e===d)||s?.[0],l=n(E),{activeExampleName:c}=n(P(o.pointer)),C=i(()=>{m.send({type:"openapi_docs.copy_code_snippet.clicked",payload:{snippetType:"response"}});const e=k({operation:o,type:"response",activeMimeName:l,activeExampleName:c});p?.codeSamplesCopy?.(e)},[m,o,p,l,c]),S=i(e=>{a?.(e,"response-samples")},[a]);return u.length?t(N,{className:"panel-response-samples",header:()=>t(g,{tabs:t(x,{tabs:s,activeTab:r,onChange:e=>y(e.key)})}),isExpandable:!1,children:o.responses.map(e=>e.code===r.key?t("div",{children:e?.content?.hasSample?t(h,{content:e.content,onCopyClick:C,onPanelToggle:S}):t(v,{source:f("openapi.noResponseContent","No content")})},e.code):null)}):null}const J=b(R);export{J as ResponseSamples};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{useState as f,useEffect as h}from"react";import{MimeLabel as x,Container as v,Select as b}from"../common/index.js";import{SelectOrLabel as y}from"../SelectOrLabel/index.js";import{normalizeText as S}from"../../utils/index.js";import{useTelemetry as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{useState as f,useEffect as h}from"react";import{MimeLabel as x,Container as v,Select as b}from"../common/index.js";import{SelectOrLabel as y}from"../SelectOrLabel/index.js";import{normalizeText as S}from"../../utils/index.js";import{useTelemetry as g}from"../../hooks/index.js";const I=({exampleKey:a,examples:s,onChange:m,className:c})=>{const i=g(),t=Object.keys(s),o=a?t.indexOf(a):0,[p,l]=f(o>-1?o:0);h(()=>l(o>-1?o:0),[a,o]);const r=t.map((e,d)=>({value:S(s[e].summary)||e,idx:d})),u=({idx:e})=>{i.send({type:"openapi_docs.examples_switcher.clicked",payload:{example:t[e],numberOfExamples:t.length}}),l(e),m(t[e])};return r.length<2?null:n(v,{"data-testid":"example-switch",className:c,children:n(y,{Select:b,Label:x,variant:"dark",fullWidth:!0,options:r,value:r[p]?.value,onChange:u})})};export{I as ExampleSwitch};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{css as o}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
|
|
2
|
-
${({compact:a,isStacked:i,fullWidth:e})=>{const
|
|
1
|
+
import{css as o}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:i,fullWidth:e})=>{const n=a?0:"var(--spacing-vertical)";return o`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
width: 100%;
|
|
6
|
-
padding: ${
|
|
6
|
+
padding: ${n} var(--panel-gap-horizontal);
|
|
7
7
|
|
|
8
8
|
&:empty {
|
|
9
9
|
display: none;
|
|
@@ -19,20 +19,16 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
19
19
|
|
|
20
20
|
@media print {
|
|
21
21
|
width: 100%;
|
|
22
|
-
padding-top: ${
|
|
23
|
-
padding-bottom: ${
|
|
22
|
+
padding-top: ${n};
|
|
23
|
+
padding-bottom: ${n};
|
|
24
24
|
}
|
|
25
25
|
`}};
|
|
26
|
-
& & {
|
|
27
|
-
padding-left: 0;
|
|
28
|
-
padding-right: 0;
|
|
29
|
-
}
|
|
30
26
|
|
|
31
27
|
&:last-child > ${d} :last-child,
|
|
32
28
|
${d} article :last-child {
|
|
33
29
|
margin-bottom: 0;
|
|
34
30
|
}
|
|
35
|
-
`,w=
|
|
31
|
+
`,w=r.div.attrs(a=>({[c]:a.sectionId,id:a.id}))`
|
|
36
32
|
z-index: 0;
|
|
37
33
|
padding: 0;
|
|
38
34
|
width: 100%;
|
|
@@ -75,7 +71,7 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
75
71
|
${l} {
|
|
76
72
|
position: relative;
|
|
77
73
|
}
|
|
78
|
-
`,x=
|
|
74
|
+
`,x=r.div`
|
|
79
75
|
color: var(--panel-samples-text-color);
|
|
80
76
|
width: 100%;
|
|
81
77
|
height: fit-content;
|
|
@@ -105,7 +101,7 @@ import{css as o}from"styled-components";import{LayoutVariant as p}from"@redocly/
|
|
|
105
101
|
padding-top: var(--spacing-vertical);
|
|
106
102
|
padding-bottom: var(--spacing-vertical);
|
|
107
103
|
}
|
|
108
|
-
`,y=
|
|
104
|
+
`,y=r.div`
|
|
109
105
|
display: flex;
|
|
110
106
|
flex-direction: column;
|
|
111
107
|
justify-content: space-between;
|
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.17",
|
|
4
4
|
"description": "Redocly OpenAPI Docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@markdoc/markdoc": "0.5.2",
|
|
24
|
-
"@redocly/openapi-core": "2.0.
|
|
24
|
+
"@redocly/openapi-core": "2.0.2",
|
|
25
25
|
"deepmerge": "^4.2.2",
|
|
26
26
|
"dompurify": "3.2.6",
|
|
27
27
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"util": "~0.12.5",
|
|
38
38
|
"web-vitals": "3.3.1",
|
|
39
39
|
"@redocly/config": "0.26.4",
|
|
40
|
-
"@redocly/replay": "0.15.0-next.
|
|
40
|
+
"@redocly/replay": "0.15.0-next.11"
|
|
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.8"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|