@redocly/asyncapi-docs 1.4.0-rc.1 → 1.4.0-rc.2

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,27 +1,27 @@
1
- var M=Object.create;var b=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var V=(o,s)=>{for(var t in s)b(o,t,{get:s[t],enumerable:!0})},A=(o,s,t,u)=>{if(s&&typeof s=="object"||typeof s=="function")for(let l of T(s))!R.call(o,l)&&l!==t&&b(o,l,{get:()=>s[l],enumerable:!(u=N(s,l))||u.enumerable});return o};var C=(o,s,t)=>(t=o!=null?M(W(o)):{},A(s||!o||!o.__esModule?b(t,"default",{value:o,enumerable:!0}):t,o)),$=o=>A(b({},"__esModule",{value:!0}),o);var G={};V(G,{ChannelSection:()=>z});module.exports=$(G);var i=require("react/jsx-runtime"),c=C(require("react")),m=C(require("styled-components")),f=require("jotai"),a=require("@redocly/openapi-docs"),d=require("@redocly/theme"),v=require("../jotai-store/app"),p=require("./common"),L=require("./ChannelParameters"),_=require("./ServersListPanel"),I=require("./ChannelBinding"),w=require("./MessageSection"),k=require("./OperationSection"),B=require("../hooks");const z=c.default.memo(({item:o})=>{var s;const t=(0,f.useAtomValue)(v.layoutAtom),u=(0,f.useAtomValue)(v.routingBasePathAtom),l=(0,f.useAtomValue)(v.definitionAtom),g=t===d.LayoutVariant.STACKED,e=(s=l.channels)===null||s===void 0?void 0:s[o.id],{getProtocolLabel:j}=(0,B.useProtocolLabels)(e?.bindings),h=(0,c.useMemo)(()=>Object.entries(l.servers||{}).map(([r,n])=>({key:r,value:n})).filter(({value:r})=>{var n;return(n=e?.servers)===null||n===void 0?void 0:n.some(H=>H.host===r.host)}),[e?.servers,l.servers]),O=(0,c.useMemo)(()=>Object.entries(e?.bindings||{}).map(([r,n])=>({key:r,value:n})),[e?.bindings]),P=(0,c.useMemo)(()=>Object.entries(e?.messages||{}).map(([r,n])=>({key:r,value:n})),[e?.messages]),x=(0,c.useMemo)(()=>o.items.filter(r=>{var n;return r.action==="send"&&((n=l.operations)===null||n===void 0?void 0:n[r.id])}),[l.operations,o.items]),S=(0,c.useMemo)(()=>o.items.filter(r=>{var n;return r.action==="receive"&&((n=l.operations)===null||n===void 0?void 0:n[r.id])}),[l.operations,o.items]),D=(0,c.useMemo)(()=>{var r;return(r=e?.["x-badges"])===null||r===void 0?void 0:r.map(n=>Object.assign(Object.assign({},n),{position:n.position||"after"}))},[e]);if(!e)return null;const y=(0,d.combineUrls)(u,o.dataSectionId);return(0,i.jsxs)(E,{children:[(0,i.jsxs)(K,{sectionId:y,children:[(0,i.jsx)(a.Row,{layout:t,children:(0,i.jsx)(a.SamplesMiddlePanel,{compact:!0,className:"api-info",isStacked:g,children:(0,i.jsx)(p.ActionTag,{color:j("channel").toLowerCase(),children:j("channel")})})}),(0,i.jsxs)(a.Row,{layout:t,children:[(0,i.jsxs)(a.SamplesMiddlePanel,{compact:!0,className:"api-info",isStacked:g,children:[(0,i.jsxs)(q,{children:[(0,i.jsxs)(U,{children:[(0,i.jsx)(a.CustomBadges,{badges:D,children:e?.title||e?.address||o.id}),(0,i.jsx)(p.ShareLink,{to:y,"aria-label":`link to ${o.label}`})]}),(0,i.jsx)(d.PageActions,{pageSlug:y})]}),e.address&&(0,i.jsxs)(p.TagWithIcon,{icon:(0,i.jsx)(d.CurveAutoColonIcon,{size:"14px"}),children:["name: ",(0,i.jsx)("span",{children:e.address})]}),(0,i.jsx)(p.Information,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),e.parameters&&(0,i.jsx)(L.ChannelParameters,{parameters:e.parameters,id:o.link})]}),(0,i.jsxs)(a.OperationSamplesPanel,{isStacked:g,className:"panel-container-response-samples",children:[!!h?.length&&(0,i.jsx)(_.ServersListPanel,{servers:h,hideHeader:!0}),!!O.length&&(0,i.jsx)(I.ChannelBinding,{binding:O[0]})]})]}),P.length>0?(0,i.jsx)(w.MessageSection,{messages:P,id:o.link}):null]}),x.length>0?(0,i.jsx)(k.OperationSection,{operations:x,type:"send",id:o.link}):null,S.length>0&&x.length>0?(0,i.jsx)(a.Row,{layout:t,children:(0,i.jsx)(a.SamplesMiddlePanel,{isStacked:g,children:(0,i.jsx)(F,{})})}):null,S.length>0?(0,i.jsx)(k.OperationSection,{operations:S,type:"receive",id:o.link}):null]})}),E=m.default.div`
1
+ var M=Object.create;var f=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var V=(o,r)=>{for(var t in r)f(o,t,{get:r[t],enumerable:!0})},H=(o,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let d of T(r))!W.call(o,d)&&d!==t&&f(o,d,{get:()=>r[d],enumerable:!(u=R(r,d))||u.enumerable});return o};var O=(o,r,t)=>(t=o!=null?M(N(o)):{},H(r||!o||!o.__esModule?f(t,"default",{value:o,enumerable:!0}):t,o)),$=o=>H(f({},"__esModule",{value:!0}),o);var J={};V(J,{ChannelSection:()=>z});module.exports=$(J);var n=require("react/jsx-runtime"),c=O(require("react")),m=O(require("styled-components")),b=require("jotai"),a=require("@redocly/openapi-docs"),l=require("@redocly/theme"),v=require("../jotai-store/app"),p=require("./common"),P=require("./ChannelParameters"),_=require("./ServersListPanel"),L=require("./ChannelBinding"),I=require("./MessageSection"),k=require("./OperationSection"),w=require("../hooks");const z=c.default.memo(({item:o})=>{var r;const t=(0,b.useAtomValue)(v.layoutAtom),u=(0,b.useAtomValue)(v.routingBasePathAtom),d=(0,b.useAtomValue)(v.definitionAtom),h=t===l.LayoutVariant.STACKED,e=(r=d.channels)===null||r===void 0?void 0:r[o.id],{getProtocolLabel:A}=(0,w.useProtocolLabels)(e?.bindings),g=(0,c.useMemo)(()=>Object.entries(d.servers||{}).map(([s,i])=>({key:s,value:i})).filter(({value:s})=>{var i;return(i=e?.servers)===null||i===void 0?void 0:i.some(B=>B.host===s.host)}),[e?.servers,d.servers]),j=(0,c.useMemo)(()=>Object.entries(e?.bindings||{}).map(([s,i])=>({key:s,value:i})),[e?.bindings]),C=(0,c.useMemo)(()=>Object.entries(e?.messages||{}).map(([s,i])=>({key:s,value:i})),[e?.messages]),y=(0,c.useMemo)(()=>o.items.filter(s=>{var i;return s.action==="send"&&((i=d.operations)===null||i===void 0?void 0:i[s.id])}),[d.operations,o.items]),S=(0,c.useMemo)(()=>o.items.filter(s=>{var i;return s.action==="receive"&&((i=d.operations)===null||i===void 0?void 0:i[s.id])}),[d.operations,o.items]),D=(0,c.useMemo)(()=>{var s;return(s=e?.["x-badges"])===null||s===void 0?void 0:s.map(i=>Object.assign(Object.assign({},i),{position:i.position||"after"}))},[e]);if(!e)return null;const x=(0,l.combineUrls)(u,o.dataSectionId);return(0,n.jsxs)(K,{children:[(0,n.jsxs)(U,{sectionId:x,children:[(0,n.jsx)(a.Row,{layout:t,children:(0,n.jsx)(a.SamplesMiddlePanel,{compact:!0,className:"api-info",isStacked:h,children:(0,n.jsx)(p.ActionTag,{color:A("channel").toLowerCase(),children:A("channel")})})}),(0,n.jsxs)(a.Row,{layout:t,children:[(0,n.jsxs)(a.SamplesMiddlePanel,{compact:!0,className:"api-info",isStacked:h,children:[(0,n.jsxs)(F,{children:[(0,n.jsxs)(q,{children:[(0,n.jsx)(a.CustomBadges,{badges:D,children:e?.title||e?.address||o.id}),(0,n.jsx)(p.ShareLink,{to:x,"aria-label":`link to ${o.label}`})]}),(0,n.jsx)(l.PageActions,{pageSlug:x})]}),e.address&&(0,n.jsxs)(p.TagWithIcon,{icon:(0,n.jsx)(l.CurveAutoColonIcon,{size:"14px"}),children:["name: ",(0,n.jsx)("span",{children:e.address})]}),(0,n.jsx)(p.Information,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),(0,n.jsx)(E,{Hook:l.AfterAsyncApiChannelDescription,props:{channel:e}}),e.parameters&&(0,n.jsx)(P.ChannelParameters,{parameters:e.parameters,id:o.link})]}),(0,n.jsxs)(a.OperationSamplesPanel,{isStacked:h,className:"panel-container-response-samples",children:[!!g?.length&&(0,n.jsx)(_.ServersListPanel,{servers:g,hideHeader:!0}),!!j.length&&(0,n.jsx)(L.ChannelBinding,{binding:j[0]})]})]}),C.length>0?(0,n.jsx)(I.MessageSection,{messages:C,id:o.link}):null]}),y.length>0?(0,n.jsx)(k.OperationSection,{operations:y,type:"send",id:o.link}):null,S.length>0&&y.length>0?(0,n.jsx)(a.Row,{layout:t,children:(0,n.jsx)(a.SamplesMiddlePanel,{isStacked:h,children:(0,n.jsx)(G,{})})}):null,S.length>0?(0,n.jsx)(k.OperationSection,{operations:S,type:"receive",id:o.link}):null]})});function E(o){if(!o.Hook)return null;const r=o.Hook(o.props),t=r&&r.html;return t?(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:t}}):r}const K=m.default.div`
2
2
  width: 100%;
3
3
 
4
4
  &:not(:last-child) {
5
5
  border-bottom: 1px solid var(--border-color-primary);
6
6
  }
7
- `,K=(0,m.default)(a.Section)`
7
+ `,U=(0,m.default)(a.Section)`
8
8
  padding: var(--spacing-xxl) 0 var(--spacing-base);
9
9
  scroll-margin-top: calc(var(--navbar-height) - var(--spacing-base)) !important;
10
- `,U=(0,m.default)(d.H2)`
10
+ `,q=(0,m.default)(l.H2)`
11
11
  margin: 0 0 var(--spacing-xs) 0;
12
12
  display: flex;
13
13
  align-items: center;
14
14
  gap: var(--spacing-xs);
15
15
  flex-wrap: wrap;
16
16
  :hover {
17
- ${d.LinkIcon} {
17
+ ${l.LinkIcon} {
18
18
  opacity: 1;
19
19
  visibility: visible;
20
20
  }
21
21
  }
22
- `,q=m.default.div`
22
+ `,F=m.default.div`
23
23
  display: flex;
24
24
  align-items: flex-start;
25
- `,F=m.default.div`
25
+ `,G=m.default.div`
26
26
  border-bottom: 1px solid var(--border-color-secondary);
27
27
  `;0&&(module.exports={ChannelSection});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/asyncapi-docs",
3
- "version": "1.4.0-rc.1",
3
+ "version": "1.4.0-rc.2",
4
4
  "description": "Async API docs for Redocly Realm",
5
5
  "main": "lib/index.js",
6
6
  "module": "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/theme": "0.59.0-rc.1",
43
- "@redocly/openapi-docs": "3.15.0-rc.1",
44
- "@redocly/config": "0.36.0-rc.1"
42
+ "@redocly/config": "0.36.0-rc.1",
43
+ "@redocly/theme": "0.59.0-rc.3",
44
+ "@redocly/openapi-docs": "3.15.0-rc.6"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^19.1.0"