@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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
${
|
|
17
|
+
${l.LinkIcon} {
|
|
18
18
|
opacity: 1;
|
|
19
19
|
visibility: visible;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,F=m.default.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: flex-start;
|
|
25
|
-
`,
|
|
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.
|
|
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/
|
|
43
|
-
"@redocly/
|
|
44
|
-
"@redocly/
|
|
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"
|