@redocly/asyncapi-docs 1.11.0-next.0 → 1.11.0-next.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,10 +1,10 @@
|
|
|
1
|
-
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useMemo as l}from"react";import{Link as c}from"react-router-dom";import
|
|
1
|
+
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useMemo as l}from"react";import{Link as c}from"react-router-dom";import e from"styled-components";import{generateChannelLink as d}from"../utils/index.js";import{ListIcon as m}from"./common/ListIcon.js";import{useTelemetry as k}from"../hooks/index.js";const u=({channel:r,isActive:i})=>{const n=l(()=>d(r),[r]),t=k(),s=()=>{t.sendReferencedInClickedMessage([{id:"asyncapiDocsChannelLink",object:"link",uri:"urn:redocly:redoc:ui:link:asyncapiDocsChannelLink",referencedIn:r.title||r.address||r.key}])};return a(p,{children:[o(m,{size:"22px",color:i?"var(--color-info-border)":"var(--border-color-primary)",style:{marginRight:"var(--spacing-xs)",flexShrink:0}}),o(v,{to:n,onClick:s,children:r.title||r.address||r.key})]})},p=e.div`
|
|
2
2
|
padding: var(--spacing-xxs) var(--spacing-md);
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
font-size: var(--font-size-md);
|
|
6
6
|
cursor: pointer;
|
|
7
|
-
`,v=
|
|
7
|
+
`,v=e(c)`
|
|
8
8
|
text-decoration: var(--link-decoration);
|
|
9
9
|
color: var(--link-color-primary);
|
|
10
10
|
font-weight: var(--link-font-weight);
|
|
@@ -19,4 +19,4 @@ import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useMemo as l}from"react
|
|
|
19
19
|
color: var(--link-color-primary-hover);
|
|
20
20
|
text-decoration: var(--link-decoration-hover);
|
|
21
21
|
}
|
|
22
|
-
`;export{
|
|
22
|
+
`;export{u as ChannelLinkItem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as a,jsxs as s}from"react/jsx-runtime";import f from"styled-components";import{useAtomValue as b}from"jotai";import{useLocation as V}from"react-router-dom";import{Row as I,SamplesMiddlePanel as O,OperationSamplesPanel as q,Dropdown as G,makeDeepLink as j,pathIncludesLink as C}from"@redocly/openapi-docs";import{LayoutVariant as U}from"@redocly/config";import{useEffect as
|
|
1
|
+
import{jsx as a,jsxs as s}from"react/jsx-runtime";import f from"styled-components";import{useAtomValue as b}from"jotai";import{useLocation as V}from"react-router-dom";import{Row as I,SamplesMiddlePanel as O,OperationSamplesPanel as q,Dropdown as G,makeDeepLink as j,pathIncludesLink as C}from"@redocly/openapi-docs";import{LayoutVariant as U}from"@redocly/config";import{useEffect as B,useMemo as c,useRef as J,useState as w,useCallback as P,memo as Q}from"react";import*as X from"openapi-sampler";import{H4 as Y}from"@redocly/theme/components/Typography/H4";import{Typography as Z}from"@redocly/theme/components/Typography/Typography";import{Segmented as ee}from"@redocly/theme/components/Segmented/Segmented";import{LinkIcon as D}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{combineUrls as R}from"@redocly/theme/core/openapi";import{SamplesPanel as oe}from"./SamplesPanel.js";import{MessageBinding as ne}from"./MessageBinding.js";import{MessageReferences as te}from"./MessageReferences.js";import{layoutAtom as ae,routingBasePathAtom as ie,definitionAtom as se}from"../jotai-store/app.js";import{Message as re}from"./Message.js";import{getSchema as le,modifyPayload as ce}from"../utils/index.js";import{LinkToField as $}from"./common/index.js";import{useTelemetry as de}from"../hooks/index.js";const me=3,Be=Q(({messages:i,id:l})=>{var v;const d=V(),z=c(()=>i.find(e=>C(d,`m=${e.key}`))||i[0],[i,d]),[n,x]=w(z),[g,y]=w(n.value.payload),H=P(e=>{const o=ce(g,e);o&&y(o)},[]),r=b(se),F=P(()=>{var e;return n.value.examples||[{payload:X.sample(Object.assign({},le(g)),{},!((e=r?.components)===null||e===void 0)&&e.schemas?{components:{schemas:r.components.schemas}}:void 0)}]},[g,n.value.examples,(v=r?.components)===null||v===void 0?void 0:v.schemas]),h=b(ae),m=b(ie),k=h===U.STACKED,p=c(()=>i.map(e=>({label:e.value.title||e.value.name||e.key,value:e.key})),[i]),[M,K]=w(!1),S=J(null),A=de();B(()=>{var e;const o=i.find(t=>C(d,`m=${t.key}`));o&&(x(o),!((e=o?.value)===null||e===void 0)&&e.payload&&y(o.value.payload))},[d,i]);const L=P(({value:e})=>{var o;const t=i.find(u=>u.key===e);t&&(A.sendSwitchMessageClickedMessage([{id:"switchMessageButton",object:"button",uri:"urn:redocly:redoc:ui:button:switchMessageButton",message:t.key}]),x(t),!((o=t?.value)===null||o===void 0)&&o.payload&&y(t.value.payload))},[i,A]),T=c(()=>Object.entries(n.value.bindings||{}).map(([e,o])=>({key:e,value:o})),[n.value.bindings]),_=c(()=>R(m,j(l,`messages&m=${n.key}`)),[l,m,n.key]);B(()=>{if(!S.current)return;const e=()=>{var o;const t=(o=S.current)===null||o===void 0?void 0:o.querySelectorAll('button[role="tab"]'),u=Array.from(t||[]).some(E=>E.offsetWidth<E.scrollWidth);u!==M&&K(u)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[M,p]);const N=c(()=>R(m,j(l,"messages")),[l,m]);return s(pe,{"data-component-name":"MessageSection/MessageSection",children:[a(I,{layout:h,children:s(O,{isStacked:k,children:[s(ue,{children:[a($,{to:N}),"Messages"]}),i.length>1?s(W,{children:["Accepts ",a("span",{children:"one of"})," the following messages:"]}):a(W,{children:"Accepts the following message:"})]})}),s(I,{layout:h,children:[s(O,{isStacked:k,children:[s(fe,{children:[a($,{to:_}),p.length>me||M?a(G,{options:p,value:n.key,onChange:L}):a(ee,{ref:S,size:"small",value:n.key,options:p,onChange:L})]}),a(re,{message:n.value,sectionId:l,id:n.key,onOneOfChange:H})]}),s(q,{isStacked:k,className:"panel-container-response-samples",children:[a(oe,{examples:F()}),!!T.length&&a(ne,{binding:T[0],slug:_}),a(te,{messageKey:n.key})]})]})]})}),pe=f.div`
|
|
2
2
|
padding: var(--spacing-xl) 0 0 0;
|
|
3
3
|
`,ue=f(Y)`
|
|
4
4
|
margin: 0 0 var(--spacing-xs) 0;
|
|
@@ -22,4 +22,4 @@ import{jsx as a,jsxs as s}from"react/jsx-runtime";import f from"styled-component
|
|
|
22
22
|
visibility: visible;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
`;export{
|
|
25
|
+
`;export{Be as MessageSection};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsx as i,jsxs as r,Fragment as
|
|
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 L}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 Ce=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),j=w===K.STACKED,{getProtocolLabel:T}=se(),S=re(),_=O(()=>Object.entries(e?.bindings||{}).map(([n,s])=>({key:n,value:s})),[e?.bindings]),z=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]),M=U(),v=P(n=>{var s,o;return(o=Object.entries(((s=a?.components)===null||s===void 0?void 0:s.messages)||{}).find(([A,D])=>le(D,n)))===null||o===void 0?void 0:o[0]},[(c=a?.components)===null||c===void 0?void 0:c.messages]),B=P(n=>{const s=v(n);if(!s||!t)return;const o=t.substring(1).split("/operations")[0],A=L(g,E(o,`messages&m=${s}`));S.sendMessageClickedMessage([{id:"messageLink",object:"link",uri:"urn:redocly:redoc:ui:link:messageLink",message:s}]),M(A)},[t,v,M,g,S]);if(!e)return null;const h=L(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:j,children:[r("div",{children:[r(ge,{children:[r("div",{children:[i(X,{color:e.action,children:T(e.action)}),r(C,{children:[i(F,{badges:z,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:()=>B(n),children:[n.title||n.name||v(n),i(V,{size:"12px"})]},s))})]}),e.reply&&r(f,{children:[i(C,{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:j,className:"panel-container-response-samples",children:!!_.length&&i(Z,{binding:_[0],id:t})})]})]})})}),ae=l($)`
|
|
2
2
|
padding: var(--spacing-lg) 0;
|
|
3
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
|
+
`,C=l(y)`
|
|
5
5
|
font-size: var(--font-size-lg);
|
|
6
6
|
font-weight: var(--font-weight-semibold);
|
|
7
7
|
margin: 0 0 var(--spacing-xxs) 0;
|
|
@@ -17,32 +17,32 @@ import{jsx as i,jsxs as r,Fragment as u}from"react/jsx-runtime";import t from"st
|
|
|
17
17
|
visibility: visible;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,te=l(y)`
|
|
21
21
|
font-size: var(--font-size-base);
|
|
22
22
|
font-weight: var(--font-weight-medium);
|
|
23
23
|
margin: var(--spacing-sm) 0 0 0;
|
|
24
|
-
`,oe=
|
|
24
|
+
`,oe=l.div`
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: row;
|
|
27
27
|
flex-wrap: wrap;
|
|
28
28
|
gap: var(--spacing-xs);
|
|
29
29
|
padding: var(--spacing-xs) 0;
|
|
30
|
-
`,
|
|
30
|
+
`,ce=l.div`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
padding: var(--spacing-xs) 0;
|
|
34
|
-
`,
|
|
34
|
+
`,b=l(y)`
|
|
35
35
|
& > span:first-child {
|
|
36
36
|
font-weight: var(--font-weight-medium);
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,de=l.div`
|
|
39
39
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
40
|
-
`,me=
|
|
40
|
+
`,me=l(I)`
|
|
41
41
|
display: flex;
|
|
42
42
|
justify-content: space-between;
|
|
43
|
-
`,pe=
|
|
43
|
+
`,pe=l(J)`
|
|
44
44
|
cursor: pointer;
|
|
45
|
-
`,ge=
|
|
45
|
+
`,ge=l.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
|
-
`;export{
|
|
48
|
+
`;export{Ce as Operation};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as p}from"react/jsx-runtime";import i from"styled-components";import{ExampleSwitch as u}from"@redocly/openapi-docs";import{useEffect as f,useMemo as h,useState as g}from"react";import{JsonViewer as v}from"@redocly/theme/components/JsonViewer/JsonViewer";import{Panel as E}from"@redocly/theme/components/Panel/Panel";import{PanelBody as b}from"@redocly/theme/components/Panel/PanelBody";import{PanelHeader as x}from"@redocly/theme/components/Panel/PanelHeader";import{useProtocolLabels as w,useTelemetry as y}from"../hooks/index.js";const $=({examples:e})=>{const[o,a]=g(e[0]),{getProtocolLabel:s}=w(),d=y();f(()=>{a(e[0])},[e,a]);const m=t=>{const n=e?.find(l=>l.name===t);n&&(a(n),d.sendSwitchExampleClickedMessage([{id:"switchExampleButton",object:"button",uri:"urn:redocly:redoc:ui:button:switchExampleButton",example:t,numberOfExamples:e.length}]))},c=h(()=>e?.reduce((t,n,l)=>(t[n.name||`Example ${l+1}`]=Object.assign({},n),t),{}),[e]);return p(P,{className:"panel-messages-samples",header:()=>r(j,{isExpandable:!1,children:s("payload")}),children:[r(u,{examples:c,exampleKey:o?.name,onChange:m}),r(v,{data:o?.payload,expandLevel:3})]})},P=i(E)`
|
|
2
2
|
${b} {
|
|
3
3
|
padding: var(--spacing-sm) 0 0;
|
|
4
4
|
line-height: var(--line-height-md);
|
|
5
5
|
}
|
|
6
|
-
`,
|
|
6
|
+
`,j=i(x)`
|
|
7
7
|
font-weight: var(--font-weight-regular);
|
|
8
|
-
`;export{
|
|
8
|
+
`;export{$ as SamplesPanel};
|
package/lib/components/Server.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import r from"styled-components";import{useState as f}from"react";import{DatabaseIcon as u}from"@redocly/theme/icons/DatabaseIcon/DatabaseIcon";import{KafkaIcon as x}from"@redocly/theme/icons/KafkaIcon/KafkaIcon";import{RabbitMQIcon as g}from"@redocly/theme/icons/RabbitMQIcon/RabbitMQIcon";import{CopyButton as h}from"@redocly/theme/components/Buttons/CopyButton";import{Portal as v}from"@redocly/theme/components/Portal/Portal";import{useModalScrollLock as y}from"@redocly/theme/core/hooks";import{Tooltip as b}from"@redocly/theme/components/Tooltip/Tooltip";import{ServerModal as M}from"./ServerModal.js";import{MoreDetailsButton as S,HostList as k}from"./common/index.js";import{useTelemetry as w}from"../hooks/index.js";import{useTranslate as j}from"../hooks/index.js";const G=({server:t,showDetails:s})=>{const[i,a]=f(!1),l=w(),p=j();y(i);const c=o=>{switch(o){case"kafka":return e(x,{size:"20px"});case"amqp":return e(g,{size:"20px"});default:return e(u,{size:"20px"})}},d=()=>{var o;a(!0),l.sendServerModalOpenedMessage([{id:"serverModalButton",object:"button",uri:"urn:redocly:redoc:ui:button:serverModalButton",server:(o=t.key)!==null&&o!==void 0?o:"unknown"}])};return n(I,{"data-component-name":"Server/Server",children:[n(T,{children:[e(B,{children:c(t.value.protocol)}),e(C,{children:t.key})]}),n(z,{children:[e(k,{children:t.value.host.split(" ").map((o,m)=>e("span",{children:o},m))}),e(b,{tip:p("button.copy.tooltipText","Copy to clipboard"),placement:"top",arrowPosition:"right",children:e(h,{data:t.value.host},t.value.host)})]}),s&&e(L,{onClick:d,children:e(S,{expanded:!1})}),i&&e(v,{mountId:"api-content",children:e(M,{server:t,onClose:()=>a(!1)})})]})},I=r.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: var(--spacing-xxs);
|
|
5
5
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
6
|
-
`,
|
|
6
|
+
`,B=r.div`
|
|
7
7
|
width: 20px;
|
|
8
8
|
height: 20px;
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
`,
|
|
12
|
+
`,T=r.div`
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: row;
|
|
15
15
|
align-items: center;
|
|
16
16
|
gap: var(--spacing-xxs);
|
|
17
|
-
`,z=
|
|
17
|
+
`,z=r.span`
|
|
18
18
|
padding-left: var(--spacing-lg);
|
|
19
19
|
min-height: 24px;
|
|
20
20
|
display: flex;
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: space-between;
|
|
23
|
-
`,C=
|
|
23
|
+
`,C=r.span`
|
|
24
24
|
font-weight: var(--font-weight-semibold);
|
|
25
25
|
text-transform: capitalize;
|
|
26
|
-
`,
|
|
26
|
+
`,L=r.div`
|
|
27
27
|
padding-left: var(--spacing-lg);
|
|
28
|
-
`;export{
|
|
28
|
+
`;export{G as Server};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/asyncapi-docs",
|
|
3
|
-
"version": "1.11.0-next.
|
|
3
|
+
"version": "1.11.0-next.2",
|
|
4
4
|
"description": "Async API docs for Redocly Realm",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"@testing-library/jest-dom": "6.6.3",
|
|
19
19
|
"@testing-library/react": "16.3.0",
|
|
20
20
|
"@types/json-schema": "^7.0.15",
|
|
21
|
-
"@types/node": "
|
|
21
|
+
"@types/node": "24.1.0",
|
|
22
22
|
"@types/react": "^19.2.7",
|
|
23
23
|
"@types/styled-components": "5.1.34",
|
|
24
24
|
"@vitest/coverage-v8": "4.0.10",
|
|
25
|
-
"@vitest/ui": "
|
|
25
|
+
"@vitest/ui": "4.0.10",
|
|
26
26
|
"esbuild-minify-dir": "^0.0.1",
|
|
27
27
|
"jest-styled-components": "7.2.0",
|
|
28
28
|
"json-schema": "0.4.0",
|
|
29
29
|
"react": "^19.2.4",
|
|
30
30
|
"tsc-alias": "1.8.16",
|
|
31
|
-
"typescript": "
|
|
31
|
+
"typescript": "6.0.3",
|
|
32
32
|
"vitest": "4.0.10",
|
|
33
33
|
"vitest-fetch-mock": "0.4.5"
|
|
34
34
|
},
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"react-router-dom": "^6.30.3",
|
|
40
40
|
"styled-components": "5.3.11",
|
|
41
41
|
"web-vitals": "3.3.1",
|
|
42
|
-
"@redocly/config": "0.
|
|
43
|
-
"@redocly/openapi-docs": "3.22.0-next.
|
|
44
|
-
"@redocly/redoc-opentelemetry": "0.
|
|
45
|
-
"@redocly/theme": "0.66.0-next.
|
|
42
|
+
"@redocly/config": "0.49.0",
|
|
43
|
+
"@redocly/openapi-docs": "3.22.0-next.2",
|
|
44
|
+
"@redocly/redoc-opentelemetry": "0.2.0",
|
|
45
|
+
"@redocly/theme": "0.66.0-next.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": "^19.2.4"
|