@redocly/asyncapi-docs 1.7.0-next.6 → 1.7.0-next.8

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.
@@ -1 +1,3 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useAtomValue as t}from"jotai";import{useCallback as p,memo as c}from"react";import{ThreePanelLayout as f}from"@redocly/theme/layouts/ThreePanelLayout";import{RightPanel as u}from"./RightPanel.js";import{TagBlock as d}from"./TagBlock.js";import{ApiInfo as h}from"./ApiInfo.js";import{ChannelSection as A}from"./ChannelSection.js";import{MarkdownSection as g}from"./MarkdownSection.js";import{SectionWrapper as y}from"./common/index.js";import{layoutAtom as k,routingBasePathAtom as v,definitionAtom as x}from"../jotai-store/app.js";import{useAutoScroll as P}from"../hooks/index.js";const N=c(({apiItems:n})=>{const a=t(v),i=t(x);P(a);const l=t(k),m=p(o=>o?.type==="tag"?r(d,{tag:o},o.link):o?.type==="channel"?r(A,{item:o},o.link):null,[]);return e(f,{className:"api-content",id:"api-content",layout:l,collapsedSidebar:!0,children:[e(y,{rightPanel:r(u,{info:i.info,servers:i.servers}),children:[r(h,{}),n.filter(({type:o})=>o==="markdown").map((o,s)=>r(g,{item:o},s))]}),n.map(m)]})});export{N as AsyncApiDocs};
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useAtomValue as t}from"jotai";import{useCallback as p,memo as c}from"react";import f from"styled-components";import{ThreePanelLayout as u}from"@redocly/theme/layouts/ThreePanelLayout";import{RightPanel as d}from"./RightPanel.js";import{TagBlock as g}from"./TagBlock.js";import{ApiInfo as h}from"./ApiInfo.js";import{ChannelSection as v}from"./ChannelSection.js";import{MarkdownSection as y}from"./MarkdownSection.js";import{SectionWrapper as A}from"./common/index.js";import{layoutAtom as k,routingBasePathAtom as x,definitionAtom as S}from"../jotai-store/app.js";import{useAutoScroll as P}from"../hooks/index.js";const R=c(({apiItems:n})=>{const a=t(x),i=t(S);P(a);const l=t(k),m=p(o=>o?.type==="tag"?r(g,{tag:o},o.link):o?.type==="channel"?r(v,{item:o},o.link):null,[]);return e(u,{className:"api-content",id:"api-content",layout:l,collapsedSidebar:!0,children:[e(j,{rightPanel:r(d,{info:i.info,servers:i.servers}),children:[r(h,{}),n.filter(({type:o})=>o==="markdown").map((o,s)=>r(y,{item:o},s))]}),n.map(m)]})}),j=f(A)`
2
+ padding-bottom: var(--spacing-xl);
3
+ `;export{R as AsyncApiDocs};
@@ -1 +1 @@
1
- export declare const Breadcrumbs: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
1
+ export declare const Breadcrumbs: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
@@ -1,7 +1,7 @@
1
- import{jsx as r}from"react/jsx-runtime";import a from"styled-components";import{memo as e}from"react";import{Breadcrumbs as t}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";const n=e(()=>r(o,{children:r(t,{})})),o=a.div`
1
+ import{jsx as r}from"react/jsx-runtime";import t from"styled-components";import{memo as o}from"react";import{Breadcrumbs as m}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{useThemeHooks as n}from"@redocly/theme/core/hooks";const g=o(()=>{const{useBreadcrumbs:a}=n(),{breadcrumbs:e}=a();return e.length===0?null:r(i,{children:r(m,{})})}),i=t.div`
2
2
  padding-top: var(--panel-gap-vertical);
3
3
  padding-bottom: var(--panel-gap-vertical);
4
4
  padding-left: calc(var(--panel-gap-horizontal) * 2);
5
5
  padding-right: var(--panel-gap-horizontal);
6
6
  height: var(--navbar-height);
7
- `;export{n as Breadcrumbs};
7
+ `;export{g as Breadcrumbs};
@@ -1,4 +1,4 @@
1
- import{jsx as i,jsxs as s}from"react/jsx-runtime";import{useMemo as a,memo as A}from"react";import l from"styled-components";import{useAtomValue as h}from"jotai";import{Row as f,SamplesMiddlePanel as b,OperationSamplesPanel as C,Section as L,CustomBadges as _}from"@redocly/openapi-docs";import{LayoutVariant as I}from"@redocly/config";import{H2 as w}from"@redocly/theme/components/Typography/H2";import{LinkIcon as B}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{CurveAutoColonIcon as D}from"@redocly/theme/icons/CurveAutoColonIcon/CurveAutoColonIcon";import{combineUrls as H}from"@redocly/theme/core/openapi";import{PageActions as M}from"@redocly/theme/components/PageActions/PageActions";import{layoutAtom as N,routingBasePathAtom as T,definitionAtom as W}from"../jotai-store/app.js";import{TagWithIcon as V,Information as $,ActionTag as z,ShareLink as E}from"./common/index.js";import{ChannelParameters as K}from"./ChannelParameters.js";import{ServersListPanel as R}from"./ServersListPanel.js";import{ChannelBinding as U}from"./ChannelBinding.js";import{MessageSection as q}from"./MessageSection.js";import{OperationSection as k}from"./OperationSection.js";import{useProtocolLabels as F}from"../hooks/index.js";const be=A(({item:r})=>{var p;const d=h(N),j=h(T),t=h(W),c=d===I.STACKED,e=(p=t.channels)===null||p===void 0?void 0:p[r.id],{getProtocolLabel:x}=F(e?.bindings),m=a(()=>Object.entries(t.servers||{}).map(([n,o])=>({key:n,value:o})).filter(({value:n})=>{var o;return(o=e?.servers)===null||o===void 0?void 0:o.some(P=>P.host===n.host)}),[e?.servers,t.servers]),S=a(()=>Object.entries(e?.bindings||{}).map(([n,o])=>({key:n,value:o})),[e?.bindings]),y=a(()=>Object.entries(e?.messages||{}).map(([n,o])=>({key:n,value:o})),[e?.messages]),v=a(()=>r.items.filter(n=>{var o;return n.action==="send"&&((o=t.operations)===null||o===void 0?void 0:o[n.id])}),[t.operations,r.items]),u=a(()=>r.items.filter(n=>{var o;return n.action==="receive"&&((o=t.operations)===null||o===void 0?void 0:o[n.id])}),[t.operations,r.items]),O=a(()=>{var n;return(n=e?.["x-badges"])===null||n===void 0?void 0:n.map(o=>Object.assign(Object.assign({},o),{position:o.position||"after"}))},[e]);if(!e)return null;const g=H(j,r.dataSectionId);return s(G,{children:[s(J,{sectionId:g,children:[i(f,{layout:d,children:i(b,{compact:!0,className:"api-info",isStacked:c,children:i(z,{color:x("channel").toLowerCase(),children:x("channel")})})}),s(f,{layout:d,children:[s(b,{compact:!0,className:"api-info",isStacked:c,children:[s(X,{children:[s(Q,{children:[i(_,{badges:O,children:e?.title||e?.address||r.id}),i(E,{to:g,"aria-label":`link to ${r.label}`})]}),i(M,{pageSlug:g})]}),e.address&&s(V,{icon:i(D,{size:"14px"}),children:["name: ",i("span",{children:e.address})]}),i($,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),e.parameters&&i(K,{parameters:e.parameters,id:r.link})]}),s(C,{isStacked:c,className:"panel-container-response-samples",children:[!!m?.length&&i(R,{servers:m,hideHeader:!0}),!!S.length&&i(U,{binding:S[0]})]})]}),y.length>0?i(q,{messages:y,id:r.link}):null]}),v.length>0?i(k,{operations:v,type:"send",id:r.link}):null,u.length>0&&v.length>0?i(f,{layout:d,children:i(b,{isStacked:c,children:i(Y,{})})}):null,u.length>0?i(k,{operations:u,type:"receive",id:r.link}):null]})}),G=l.div`
1
+ import{jsx as i,jsxs as s}from"react/jsx-runtime";import{useMemo as t,memo as A}from"react";import l from"styled-components";import{useAtomValue as h}from"jotai";import{Row as f,SamplesMiddlePanel as b,OperationSamplesPanel as C,Section as L,CustomBadges as _}from"@redocly/openapi-docs";import{LayoutVariant as I}from"@redocly/config";import{H2 as w}from"@redocly/theme/components/Typography/H2";import{LinkIcon as B}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{CurveAutoColonIcon as D}from"@redocly/theme/icons/CurveAutoColonIcon/CurveAutoColonIcon";import{combineUrls as H}from"@redocly/theme/core/openapi";import{PageActions as M}from"@redocly/theme/components/PageActions/PageActions";import{layoutAtom as N,routingBasePathAtom as T,definitionAtom as W}from"../jotai-store/app.js";import{TagWithIcon as V,Information as $,ActionTag as z,ShareLink as E}from"./common/index.js";import{ChannelParameters as K}from"./ChannelParameters.js";import{ServersListPanel as R}from"./ServersListPanel.js";import{ChannelBinding as U}from"./ChannelBinding.js";import{MessageSection as q}from"./MessageSection.js";import{OperationSection as k}from"./OperationSection.js";import{useProtocolLabels as F}from"../hooks/index.js";const be=A(({item:r})=>{var p;const d=h(N),j=h(T),a=h(W),c=d===I.STACKED,e=(p=a.channels)===null||p===void 0?void 0:p[r.id],{getProtocolLabel:x}=F(e?.bindings),m=t(()=>Object.entries(a.servers||{}).map(([n,o])=>({key:n,value:o})).filter(({value:n})=>{var o;return(o=e?.servers)===null||o===void 0?void 0:o.some(P=>P.host===n.host)}),[e?.servers,a.servers]),S=t(()=>Object.entries(e?.bindings||{}).map(([n,o])=>({key:n,value:o})),[e?.bindings]),y=t(()=>Object.entries(e?.messages||{}).map(([n,o])=>({key:n,value:o})),[e?.messages]),v=t(()=>r.items.filter(n=>{var o;return n.action==="send"&&((o=a.operations)===null||o===void 0?void 0:o[n.id])}),[a.operations,r.items]),u=t(()=>r.items.filter(n=>{var o;return n.action==="receive"&&((o=a.operations)===null||o===void 0?void 0:o[n.id])}),[a.operations,r.items]),O=t(()=>{var n;return(n=e?.["x-badges"])===null||n===void 0?void 0:n.map(o=>Object.assign(Object.assign({},o),{position:o.position||"after"}))},[e]);if(!e)return null;const g=H(j,r.dataSectionId);return s(G,{children:[s(J,{sectionId:g,children:[i(f,{layout:d,children:i(b,{className:"api-info",isStacked:c,children:i(z,{color:x("channel").toLowerCase(),children:x("channel")})})}),s(f,{layout:d,children:[s(b,{className:"api-info",isStacked:c,children:[s(X,{children:[s(Q,{children:[i(_,{badges:O,children:e?.title||e?.address||r.id}),i(E,{to:g,"aria-label":`link to ${r.label}`})]}),i(M,{pageSlug:g})]}),e.address&&s(V,{icon:i(D,{size:"14px"}),children:["name: ",i("span",{children:e.address})]}),i($,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),e.parameters&&i(K,{parameters:e.parameters,id:r.link})]}),s(C,{isStacked:c,className:"panel-container-response-samples",children:[!!m?.length&&i(R,{servers:m,hideHeader:!0}),!!S.length&&i(U,{binding:S[0]})]})]}),y.length>0?i(q,{messages:y,id:r.link}):null]}),v.length>0?i(k,{operations:v,type:"send",id:r.link}):null,u.length>0&&v.length>0?i(f,{layout:d,children:i(b,{isStacked:c,children:i(Y,{})})}):null,u.length>0?i(k,{operations:u,type:"receive",id:r.link}):null]})}),G=l.div`
2
2
  width: 100%;
3
3
 
4
4
  &:not(:last-child) {
@@ -6,7 +6,9 @@ import{jsx as i,jsxs as s}from"react/jsx-runtime";import{useMemo as a,memo as A}
6
6
  }
7
7
  `,J=l(L)`
8
8
  padding: var(--spacing-xxl) 0 var(--spacing-base);
9
- scroll-margin-top: calc(var(--navbar-height) - var(--spacing-base)) !important;
9
+ scroll-margin-top: calc(
10
+ var(--navbar-height) + var(--banner-height) - var(--spacing-base)
11
+ ) !important;
10
12
  `,Q=l(w)`
11
13
  margin: 0 0 var(--spacing-xs) 0;
12
14
  display: flex;
@@ -1,3 +1,3 @@
1
- import{jsx as t,Fragment as l,jsxs as f}from"react/jsx-runtime";import{useAtomValue as s}from"jotai";import g from"styled-components";import{Markdown as i,Section as h}from"@redocly/openapi-docs";import{combineUrls as c}from"@redocly/theme/core/openapi";import{generateAst as m}from"../utils/index.js";import{markdocOptionsAtom as k,routingBasePathAtom as S}from"../jotai-store/app.js";const w=({item:o})=>{const a=s(k),n=s(S),d=m(o.ast);return f(l,{children:[t(e,{sectionId:c(n,o.dataSectionId),children:t(i,{ast:d,markdocOptions:a})}),o.items.map(r=>{const p=m(r.ast);return t(e,{sectionId:c(n,r.dataSectionId),children:t(i,{ast:p,markdocOptions:a})},r.link)})]})},e=g(h)`
2
- scroll-margin-top: calc(var(--navbar-height)) !important;
1
+ import{jsx as t,Fragment as l,jsxs as h}from"react/jsx-runtime";import{useAtomValue as s}from"jotai";import g from"styled-components";import{Markdown as i,Section as f}from"@redocly/openapi-docs";import{combineUrls as e}from"@redocly/theme/core/openapi";import{generateAst as c}from"../utils/index.js";import{markdocOptionsAtom as k,routingBasePathAtom as S}from"../jotai-store/app.js";const w=({item:o})=>{const a=s(k),n=s(S),d=c(o.ast);return h(l,{children:[t(m,{sectionId:e(n,o.dataSectionId),children:t(i,{ast:d,markdocOptions:a})}),o.items.map(r=>{const p=c(r.ast);return t(m,{sectionId:e(n,r.dataSectionId),children:t(i,{ast:p,markdocOptions:a})},r.link)})]})},m=g(f)`
2
+ scroll-margin-top: calc(var(--navbar-height) + var(--banner-height)) !important;
3
3
  `;export{w as MarkdownSection};
@@ -1,6 +1,6 @@
1
- import{jsx as i,jsxs as r,Fragment as f}from"react/jsx-runtime";import l from"styled-components";import{useAtomValue as u}from"jotai";import{Row as W,SamplesMiddlePanel as I,OperationSamplesPanel as R,Section as $,makeDeepLink as E,CustomBadges as F}from"@redocly/openapi-docs";import{LayoutVariant as K}from"@redocly/config";import{useMemo as O,useCallback as P,memo as N}from"react";import{useNavigate as U}from"react-router-dom";import{H4 as y}from"@redocly/theme/components/Typography/H4";import{ArrowUpRightIcon as V}from"@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon";import{LinkIcon as q}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{combineUrls as C}from"@redocly/theme/core/openapi";import{PageActions as G}from"@redocly/theme/components/PageActions/PageActions";import{TagWithIcon as J,Information as Q,ActionTag as X,ShareLink as Y}from"./common/index.js";import{OperationBinding as Z}from"./OperationBinding.js";import{layoutAtom as ee,routingBasePathAtom as ie,definitionAtom as se}from"../jotai-store/app.js";import{useProtocolLabels as ne,useTelemetry as re}from"../hooks/index.js";import{isEqual as le}from"../utils/index.js";const De=N(({operation:e,dataSectionId:t,headerRow:x,id:k,showDivider:H})=>{var c,d,m,p;const w=u(ee),g=u(ie),a=u(se),S=w===K.STACKED,{getProtocolLabel:L}=ne(),_=re(),j=O(()=>Object.entries(e?.bindings||{}).map(([s,n])=>({key:s,value:n})),[e?.bindings]),T=O(()=>{var s;return(s=e?.["x-badges"])===null||s===void 0?void 0:s.map(n=>Object.assign(Object.assign({},n),{position:n.position||"after"}))},[e]),A=U(),v=P(s=>{var n,o;return(o=Object.entries(((n=a?.components)===null||n===void 0?void 0:n.messages)||{}).find(([M,B])=>le(B,s)))===null||o===void 0?void 0:o[0]},[(c=a?.components)===null||c===void 0?void 0:c.messages]),z=P(s=>{const n=v(s);if(!n||!t)return;const o=t.substring(1).split("/operations")[0],M=C(g,E(o,`messages&m=${n}`));_.sendAsyncapiDocsMessageClickedMessage({message:n}),A(M)},[t,v,A,g,_]);if(!e)return null;const h=C(g,t);return i(f,{children:r(ae,{sectionId:h,"data-component-name":"Operation/Operation",hasHeader:!!x,children:[x,r(W,{layout:w,children:[r(me,{isStacked:S,children:[r("div",{children:[r(ge,{children:[r("div",{children:[i(X,{color:e.action,children:L(e.action)}),r(D,{children:[i(F,{badges:T,children:e.title||k}),i(Y,{to:h,"aria-label":`link to ${e.title||k}`})]})]}),i(G,{pageSlug:h})]}),i(Q,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),((d=e.messages)===null||d===void 0?void 0:d.length)&&r(f,{children:[i(te,{children:"Messages"}),i(oe,{children:(m=e.messages)===null||m===void 0?void 0:m.map((s,n)=>r(pe,{icon:null,onClick:()=>z(s),children:[s.title||s.name||v(s),i(V,{size:"12px"})]},n))})]}),e.reply&&r(f,{children:[i(D,{children:"Reply"}),r(ce,{children:[e.reply.address&&r(b,{children:[i("span",{children:"Address: "}),i("span",{children:e.reply.address.location})]}),e.reply.channel&&r(b,{children:[i("span",{children:"Topic: "}),i("span",{children:e.reply.channel.address})]}),!!(!((p=e.reply.messages)===null||p===void 0)&&p.length)&&r(b,{children:[i("span",{children:"Messages: "}),i("span",{children:e.reply.messages.map(s=>s.title||s.name).join(", ")})]})]})]})]}),H&&i(de,{})]}),i(R,{isStacked:S,className:"panel-container-response-samples",children:!!j.length&&i(Z,{binding:j[0],id:t})})]})]})})}),ae=l($)`
1
+ import{jsx as i,jsxs as r,Fragment as f}from"react/jsx-runtime";import l from"styled-components";import{useAtomValue as u}from"jotai";import{Row as W,SamplesMiddlePanel as I,OperationSamplesPanel as R,Section as $,makeDeepLink as E,CustomBadges as F}from"@redocly/openapi-docs";import{LayoutVariant as K}from"@redocly/config";import{useMemo as O,useCallback as P,memo as N}from"react";import{useNavigate as U}from"react-router-dom";import{H4 as y}from"@redocly/theme/components/Typography/H4";import{ArrowUpRightIcon as V}from"@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon";import{LinkIcon as q}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{combineUrls as C}from"@redocly/theme/core/openapi";import{PageActions as G}from"@redocly/theme/components/PageActions/PageActions";import{TagWithIcon as J,Information as Q,ActionTag as X,ShareLink as Y}from"./common/index.js";import{OperationBinding as Z}from"./OperationBinding.js";import{layoutAtom as ee,routingBasePathAtom as ie,definitionAtom as ne}from"../jotai-store/app.js";import{useProtocolLabels as se,useTelemetry as re}from"../hooks/index.js";import{isEqual as le}from"../utils/index.js";const De=N(({operation:e,dataSectionId:t,headerRow:x,id:k,showDivider:H})=>{var c,d,m,p;const w=u(ee),g=u(ie),a=u(ne),S=w===K.STACKED,{getProtocolLabel:L}=se(),_=re(),j=O(()=>Object.entries(e?.bindings||{}).map(([n,s])=>({key:n,value:s})),[e?.bindings]),T=O(()=>{var n;return(n=e?.["x-badges"])===null||n===void 0?void 0:n.map(s=>Object.assign(Object.assign({},s),{position:s.position||"after"}))},[e]),A=U(),v=P(n=>{var s,o;return(o=Object.entries(((s=a?.components)===null||s===void 0?void 0:s.messages)||{}).find(([M,B])=>le(B,n)))===null||o===void 0?void 0:o[0]},[(c=a?.components)===null||c===void 0?void 0:c.messages]),z=P(n=>{const s=v(n);if(!s||!t)return;const o=t.substring(1).split("/operations")[0],M=C(g,E(o,`messages&m=${s}`));_.sendAsyncapiDocsMessageClickedMessage({message:s}),A(M)},[t,v,A,g,_]);if(!e)return null;const h=C(g,t);return i(f,{children:r(ae,{sectionId:h,"data-component-name":"Operation/Operation",hasHeader:!!x,children:[x,r(W,{layout:w,children:[r(me,{isStacked:S,children:[r("div",{children:[r(ge,{children:[r("div",{children:[i(X,{color:e.action,children:L(e.action)}),r(D,{children:[i(F,{badges:T,children:e.title||k}),i(Y,{to:h,"aria-label":`link to ${e.title||k}`})]})]}),i(G,{pageSlug:h})]}),i(Q,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),((d=e.messages)===null||d===void 0?void 0:d.length)&&r(f,{children:[i(te,{children:"Messages"}),i(oe,{children:(m=e.messages)===null||m===void 0?void 0:m.map((n,s)=>r(pe,{icon:null,onClick:()=>z(n),children:[n.title||n.name||v(n),i(V,{size:"12px"})]},s))})]}),e.reply&&r(f,{children:[i(D,{children:"Reply"}),r(ce,{children:[e.reply.address&&r(b,{children:[i("span",{children:"Address: "}),i("span",{children:e.reply.address.location})]}),e.reply.channel&&r(b,{children:[i("span",{children:"Topic: "}),i("span",{children:e.reply.channel.address})]}),!!(!((p=e.reply.messages)===null||p===void 0)&&p.length)&&r(b,{children:[i("span",{children:"Messages: "}),i("span",{children:e.reply.messages.map(n=>n.title||n.name).join(", ")})]})]})]})]}),H&&i(de,{})]}),i(R,{isStacked:S,className:"panel-container-response-samples",children:!!j.length&&i(Z,{binding:j[0],id:t})})]})]})})}),ae=l($)`
2
2
  padding: var(--spacing-lg) 0;
3
- scroll-margin-top: ${e=>e.hasHeader?"calc(var(--navbar-height) - var(--spacing-xl)*2)":"var(--navbar-height)"} !important;
3
+ scroll-margin-top: ${e=>e.hasHeader?"calc(var(--navbar-height) + var(--banner-height) - var(--spacing-xl)*2)":"calc(var(--navbar-height) + var(--banner-height))"} !important;
4
4
  `,D=l(y)`
5
5
  font-size: var(--font-size-lg);
6
6
  font-weight: var(--font-weight-semibold);
@@ -1,5 +1,5 @@
1
1
  import{jsx as o,jsxs as l,Fragment as A}from"react/jsx-runtime";import d from"styled-components";import{useAtomValue as m}from"jotai";import{Row as D,SamplesMiddlePanel as L,Markdown as P,ExternalDocumentation as E,Section as M,saveTextBeforeHeading as W,getValueFromMdParsedExtension as $}from"@redocly/openapi-docs";import{LayoutVariant as j}from"@redocly/config";import{useLocation as I,useNavigate as F}from"react-router-dom";import{useMemo as b,useCallback as H,memo as O}from"react";import{H2 as T}from"@redocly/theme/components/Typography/H2";import{Button as V}from"@redocly/theme/components/Button/Button";import{breakpoints as N}from"@redocly/theme/core/openapi";import{LinkIcon as z}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{combineUrls as S}from"@redocly/theme/core/openapi";import{PageActions as K}from"@redocly/theme/components/PageActions/PageActions";import{layoutAtom as R,routingBasePathAtom as U,definitionAtom as q,markdocOptionsAtom as G}from"../jotai-store/app.js";import{ExternalDocumentationWrapper as J,ShareLink as Q,SectionWrapper as X}from"./common/index.js";import{ItemsNavigation as Y}from"./ItemsNavigation.js";import{ChannelSection as Z}from"./ChannelSection.js";import{MarkdownSection as nn}from"./MarkdownSection.js";const Bn=O(({tag:n})=>{var c,p,u,v;const h=m(R),f=m(U),t=m(q),y=m(G),k=I(),x=F(),e=!!(!((c=n.items)===null||c===void 0)&&c.length),w=h===j.STACKED,r=(u=(p=t?.components)===null||p===void 0?void 0:p.tags)===null||u===void 0?void 0:u[n.label],B=b(()=>{var i,a;return e?(a=(i=t?.channels)===null||i===void 0?void 0:i[n.items[0].id])===null||a===void 0?void 0:a.bindings:void 0},[e,t?.channels,n.items]),s=b(()=>{if(!e)return!1;const i=k.pathname;return i.endsWith(n.link||"")||n.items.some(a=>a.link&&i.toLowerCase().includes(a.link.toLowerCase()))},[e,k.pathname,n.link,n.items]),C=H(()=>{n.link&&x(n.link)},[x,n.link]),_=W($(r,"description")||""),g=S(f,n.link);return l(A,{children:[o(on,{expanded:e&&!s,sectionId:S(f,n.dataSectionId),children:l(tn,{expanded:s,children:[l(D,{layout:h,children:[l(L,{fullWidth:!e,isStacked:w,children:[l(rn,{children:[n.label,o(Q,{to:g,"aria-label":`link to ${n.label}`}),o(K,{pageSlug:g})]}),r?.description&&o(P,{source:_,markdocOptions:y}),r?.externalDocs&&o(J,{children:o(E,{externalDocs:r.externalDocs})})]}),e&&n.items&&o(Y,{items:n.items,firstChannelBinding:B})]}),e&&!s&&o(en,{type:"button",variant:"text",size:"medium",onClick:C,children:"+ Show"})]})}),s&&((v=n.items)===null||v===void 0?void 0:v.map(i=>i.type==="channel"?o(Z,{item:i},i.link):i.type==="markdown"?o(X,{children:o(nn,{item:i})},i.link):null))]})}),on=d(M)`
2
- scroll-margin-top: calc(var(--navbar-height)) !important;
2
+ scroll-margin-top: calc(var(--navbar-height) + var(--banner-height)) !important;
3
3
  `,tn=d.div`
4
4
  padding-bottom: ${({expanded:n})=>n?"var(--spacing-xxl)":""};
5
5
  padding-bottom: ${({expanded:n})=>n?"var(--spacing-xxl)":""};
@@ -1,6 +1,7 @@
1
1
  type SectionWrapperProps = {
2
2
  children: React.ReactNode;
3
3
  rightPanel?: React.ReactNode;
4
+ className?: string;
4
5
  };
5
- export declare const SectionWrapper: ({ children, rightPanel }: SectionWrapperProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const SectionWrapper: ({ children, rightPanel, className }: SectionWrapperProps) => import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useAtomValue as s}from"jotai";import{SectionContainer as i,Row as l,SamplesMiddlePanel as m}from"@redocly/openapi-docs";import{layoutAtom as c}from"../../jotai-store/app.js";const f=({children:r,rightPanel:e})=>{const t=s(c);return a(l,{layout:t,children:[o(i,{layout:t,children:o(m,{compact:!0,fullWidth:!0,isStacked:t==="stacked",children:r})}),e]})};export{f as SectionWrapper};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useAtomValue as l}from"jotai";import{SectionContainer as i,Row as m,SamplesMiddlePanel as n}from"@redocly/openapi-docs";import{layoutAtom as c}from"../../jotai-store/app.js";const x=({children:e,rightPanel:r,className:s})=>{const o=l(c);return a(m,{layout:o,className:s,children:[t(i,{layout:o,children:t(n,{fullWidth:!0,isStacked:o==="stacked",children:e})}),r]})};export{x as SectionWrapper};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/asyncapi-docs",
3
- "version": "1.7.0-next.6",
3
+ "version": "1.7.0-next.8",
4
4
  "description": "Async API docs for Redocly Realm",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -39,9 +39,9 @@
39
39
  "react-router-dom": "^6.21.1",
40
40
  "styled-components": "5.3.11",
41
41
  "web-vitals": "3.3.1",
42
- "@redocly/config": "0.41.2",
43
- "@redocly/openapi-docs": "3.18.0-next.6",
44
- "@redocly/theme": "0.62.0-next.4"
42
+ "@redocly/config": "0.41.4",
43
+ "@redocly/openapi-docs": "3.18.0-next.8",
44
+ "@redocly/theme": "0.62.0-next.5"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "19.2.4"