@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
4 lines (3 loc) • 1.99 kB
JavaScript
var S=Object.create;var c=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var R=(o,t)=>{for(var n in t)c(o,n,{get:t[n],enumerable:!0})},d=(o,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of j(t))!C.call(o,a)&&a!==n&&c(o,a,{get:()=>t[a],enumerable:!(i=k(t,a))||i.enumerable});return o};var f=(o,t,n)=>(n=o!=null?S(B(o)):{},d(t||!o||!o.__esModule?c(n,"default",{value:o,enumerable:!0}):n,o)),b=o=>d(c({},"__esModule",{value:!0}),o);var z={};R(z,{AsyncApiDocs:()=>w});module.exports=b(z);var s=require("react/jsx-runtime"),u=require("jotai"),l=f(require("react")),y=f(require("styled-components")),r=require("@redocly/openapi-docs"),h=require("@redocly/theme"),g=require("./RightPanel"),I=require("./TagBlock"),v=require("./ChannelSection"),m=require("../jotai/app"),x=require("../hooks");const w=l.default.memo(({definition:o,apiItems:t})=>{const n=(0,u.useAtomValue)(m.routingBasePathAtom);(0,x.useAutoScroll)(n);const i=(0,u.useAtomValue)(m.layoutAtom),a=(0,l.useMemo)(()=>(0,r.addMarkdownItems)((0,r.getValueFromMdParsedExtension)(o.info,"description")||"",void 0,1),[o.info]),p=(0,l.useMemo)(()=>({infoDefinition:o.info,type:"section",id:""}),[o.info]),A=(0,l.useMemo)(()=>[p,...a],[p,a]),P=(0,l.useCallback)(e=>e?.type==="tag"?(0,s.jsx)(I.TagBlock,{tag:e,definition:o},e.link):e?.type==="channel"?(0,s.jsx)(v.ChannelSection,{item:e,definition:o},e.link):null,[o]);return(0,s.jsxs)(h.ThreePanelLayout,{className:"api-content",id:"api-content",layout:i,collapsedSidebar:!0,children:[(0,s.jsx)(r.Section,{sectionId:"/"+n,children:(0,s.jsxs)(M,{layout:i,children:[(0,s.jsx)(r.SectionContainer,{layout:i,children:A.map(e=>(0,s.jsx)(r.ContentItem,{item:e,routingBasePath:"/"+n,layout:i},e.id))}),(0,s.jsx)(g.RightPanel,{info:o.info,servers:o.servers})]})}),t.map(P)]})}),M=(0,y.default)(r.Row)`
font-size: var(--font-size-base);
`;0&&(module.exports={AsyncApiDocs});