@redocly/asyncapi-docs 1.6.1 → 1.7.0-custom.1
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.
- package/lib/RedoclyAsyncAPIDocs.js +1 -1
- package/lib/components/AsyncApiDocs.js +3 -1
- package/lib/components/Breadcrumbs.d.ts +1 -1
- package/lib/components/Breadcrumbs.js +2 -2
- package/lib/components/ChannelBinding.js +1 -1
- package/lib/components/ChannelLinkItem.js +1 -1
- package/lib/components/ChannelSection.js +10 -8
- package/lib/components/MarkdownSection.js +2 -2
- package/lib/components/MessageSection.js +1 -1
- package/lib/components/Metadata.d.ts +8 -0
- package/lib/components/Metadata.js +1 -0
- package/lib/components/Operation.js +11 -11
- package/lib/components/RightPanel.js +5 -1
- package/lib/components/SamplesPanel.js +4 -6
- package/lib/components/TagBlock.js +1 -1
- package/lib/components/common/SectionWrapper.d.ts +2 -1
- package/lib/components/common/SectionWrapper.js +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as f}from"react/jsx-runtime";import{useMemo as
|
|
1
|
+
import{jsx as e,jsxs as f}from"react/jsx-runtime";import{useMemo as b,memo as M}from"react";import{IS_BROWSER as x}from"@redocly/theme/core/utils";import{useMount as D}from"@redocly/theme/core/hooks";import{AppProvider as l}from"./jotai-store/Provider.js";import{AsyncApiDocs as u}from"./components/AsyncApiDocs.js";import{Breadcrumbs as y}from"./components/Breadcrumbs.js";import{AppRouter as O}from"./components/AppRouter.js";import{useTelemetry as R,usePerformanceMetrics as _}from"./hooks/index.js";const C=M(({pageProps:s,document:r,apiItems:i,routingBasePath:c,protocol:o,downloadUrls:m,markdocOptions:p})=>{const n=R(),a=b(()=>({layout:s.apiOptions.layout,protocol:o,routingBasePath:c,downloadUrls:m,definition:r,markdocOptions:p}),[s.apiOptions.layout,o,c,m,r,p]);return _({sendTelemetry:d=>{const t=Object.fromEntries(Object.entries(d).map(([j,A])=>[j.toLowerCase(),A]));n.sendAsyncapiDocsPerformanceMetricsMessage([{object:"metrics",cls:t.cls,lcp:t.lcp,fcp:t.fcp,ttfb:t.ttfb}])}}),D(()=>{n.sendAsyncapiDocsViewedMessage([{object:"view_stats",layout:s.apiOptions.layout,protocol:o||"default"}])}),x?e(l,{store:a,children:f(O,{children:[e(y,{}),e(u,{apiItems:i})]})}):f(l,{store:a,children:[e(y,{}),e(u,{apiItems:i})]})});export{C as RedoclyAsyncAPIDocs};
|
|
@@ -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
|
|
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
|
|
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{
|
|
7
|
+
`;export{g as Breadcrumbs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=function(
|
|
1
|
+
var g=function(i,c){var s={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&c.indexOf(r)<0&&(s[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(i);a<r.length;a++)c.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(i,r[a])&&(s[r[a]]=i[r[a]]);return s};import{jsx as n,jsxs as t,Fragment as u}from"react/jsx-runtime";import{useState as m}from"react";import{JsonViewer as y}from"@redocly/theme/components/JsonViewer/JsonViewer";import{BindingPanel as b,HeaderWrapper as l,TagStyled as d,TopicConfiguration as o,TopicConfigurationWrapper as C,MoreDetailsButton as j}from"./common/index.js";import{useProtocolLabels as x}from"../hooks/index.js";const T=({binding:i})=>{const[c,s]=m(!1),{getProtocolLabel:r}=x({amqp:Object.assign({},i.value||{})}),a=()=>{s(!c)},p=({key:h,value:e})=>{const{bindingVersion:k}=e,f=g(e,["bindingVersion"]);switch(h){case"kafka":return t(u,{children:[e.topic&&t(l,{children:[n("span",{"data-testid":"topic-label",children:"Topic"}),n("span",{children:n(d,{borderless:!0,"data-testid":"topic-value",children:e.topic})})]}),e.partitions&&t(l,{children:[n("span",{"data-testid":"partitions-label",children:"Partitions"}),n("span",{children:n(d,{borderless:!0,color:"blue","data-testid":"partitions-value",children:e.partitions})})]}),e.replicas&&t(l,{children:[n("span",{"data-testid":"replicas-label",children:"Replicas"}),n("span",{children:n(d,{borderless:!0,color:"green","data-testid":"replicas-value",children:e.replicas})})]}),e.topicConfiguration&&t("div",{children:[n(l,{expandable:!0,onClick:a,children:n(j,{expanded:c})}),c&&t(C,{children:[e.topicConfiguration["cleanup.policy"]&&t(o,{children:[n("span",{children:"\u0421leanup policy"}),n("span",{children:O(e.topicConfiguration["cleanup.policy"]).join(", ")})]}),e.topicConfiguration["retention.ms"]&&t(o,{children:[n("span",{children:"Retention, ms"}),n("span",{children:e.topicConfiguration["retention.ms"]})]}),e.topicConfiguration["retention.bytes"]&&t(o,{children:[n("span",{children:"Retention, bytes"}),n("span",{children:e.topicConfiguration["retention.bytes"]})]}),e.topicConfiguration["delete.retention.ms"]&&t(o,{children:[n("span",{children:"Delete retention, ms"}),n("span",{children:e.topicConfiguration["delete.retention.ms"]})]}),e.topicConfiguration["max.message.bytes"]&&t(o,{children:[n("span",{children:"Max message bytes"}),n("span",{children:e.topicConfiguration["max.message.bytes"]})]}),e.topicConfiguration["confluent.key.schema.validation"]&&t(o,{children:[n("span",{children:"Confluent key schema validation"}),n("span",{children:String(e.topicConfiguration["confluent.key.schema.validation"])})]}),e.topicConfiguration["confluent.key.subject.name.strategy"]&&t(o,{children:[n("span",{children:"Confluent key subject name strategy"}),n("span",{children:e.topicConfiguration["confluent.key.subject.name.strategy"]})]}),e.topicConfiguration["confluent.value.schema.validation"]&&t(o,{children:[n("span",{children:"Confluent value schema validation"}),n("span",{children:String(e.topicConfiguration["confluent.value.schema.validation"])})]}),e.topicConfiguration["confluent.value.subject.name.strategy"]&&t(o,{children:[n("span",{children:"Confluent value subject name strategy"}),n("span",{children:e.topicConfiguration["confluent.value.subject.name.strategy"]})]})]})]})]});default:return n(y,{data:f,expandLevel:3,controls:!1})}};return n(b,{header:r("channelBinding"),children:p(i)})};function O(i){return Array.isArray(i)?i:[i]}export{T as ChannelBinding};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useMemo as c}from"react";import{Link as l}from"react-router-dom";import i from"styled-components";import{generateChannelLink as d}from"../utils/index.js";import{ListIcon as m}from"./common/ListIcon.js";import{useTelemetry as p}from"../hooks/index.js";const j=({channel:r,isActive:e})=>{const n=c(()=>d(r),[r]),t=p(),s=()=>{t.sendAsyncapiDocsReferencedInClickedMessage({id:"asyncapi-docs-channel-link",object:"link",uri:`${window.location.href}#asyncapi-docs-channel-link`,referencedIn:r.title||r.address||r.key})};return a(k,{children:[o(m,{size:"22px",color:e?"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})]})},k=i.div`
|
|
1
|
+
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useMemo as c}from"react";import{Link as l}from"react-router-dom";import i from"styled-components";import{generateChannelLink as d}from"../utils/index.js";import{ListIcon as m}from"./common/ListIcon.js";import{useTelemetry as p}from"../hooks/index.js";const j=({channel:r,isActive:e})=>{const n=c(()=>d(r),[r]),t=p(),s=()=>{t.sendAsyncapiDocsReferencedInClickedMessage([{id:"asyncapi-docs-channel-link",object:"link",uri:`${window.location.href}#asyncapi-docs-channel-link`,referencedIn:r.title||r.address||r.key}])};return a(k,{children:[o(m,{size:"22px",color:e?"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})]})},k=i.div`
|
|
2
2
|
padding: var(--spacing-xxs) var(--spacing-md);
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import{jsx as i,jsxs as s}from"react/jsx-runtime";import{useMemo as
|
|
1
|
+
import{jsx as i,jsxs as s}from"react/jsx-runtime";import{useMemo as d,memo as H}from"react";import c from"styled-components";import{useAtomValue as g}from"jotai";import{Row as f,SamplesMiddlePanel as b,OperationSamplesPanel as O,Section as P,CustomBadges as _}from"@redocly/openapi-docs";import{LayoutVariant as L}from"@redocly/config";import{AfterAsyncApiChannelDescription as I}from"@redocly/theme";import{H2 as w}from"@redocly/theme/components/Typography/H2";import{LinkIcon as D}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{CurveAutoColonIcon as B}from"@redocly/theme/icons/CurveAutoColonIcon/CurveAutoColonIcon";import{combineUrls as M}from"@redocly/theme/core/openapi";import{PageActions as T}from"@redocly/theme/components/PageActions/PageActions";import{layoutAtom as N,routingBasePathAtom as R,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 U}from"./ServersListPanel.js";import{ChannelBinding as q}from"./ChannelBinding.js";import{MessageSection as F}from"./MessageSection.js";import{OperationSection as k}from"./OperationSection.js";import{useProtocolLabels as G}from"../hooks/index.js";const xe=H(({item:r})=>{var t;const a=g(N),A=g(R),l=g(W),m=a===L.STACKED,e=(t=l.channels)===null||t===void 0?void 0:t[r.id],{getProtocolLabel:y}=G(e?.bindings),p=d(()=>Object.entries(l.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(C=>C.host===n.host)}),[e?.servers,l.servers]),S=d(()=>Object.entries(e?.bindings||{}).map(([n,o])=>({key:n,value:o})),[e?.bindings]),x=d(()=>Object.entries(e?.messages||{}).map(([n,o])=>({key:n,value:o})),[e?.messages]),v=d(()=>r.items.filter(n=>{var o;return n.action==="send"&&((o=l.operations)===null||o===void 0?void 0:o[n.id])}),[l.operations,r.items]),u=d(()=>r.items.filter(n=>{var o;return n.action==="receive"&&((o=l.operations)===null||o===void 0?void 0:o[n.id])}),[l.operations,r.items]),j=d(()=>{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 h=M(A,r.dataSectionId);return s(Q,{children:[s(X,{sectionId:h,children:[i(f,{layout:a,children:i(b,{className:"api-info",isStacked:m,children:i(z,{color:y("channel").toLowerCase(),children:y("channel")})})}),s(f,{layout:a,children:[s(b,{className:"api-info",isStacked:m,children:[s(Z,{children:[s(Y,{children:[i(_,{badges:j,children:e?.title||e?.address||r.id}),i(E,{to:h,"aria-label":`link to ${r.label}`})]}),i(T,{pageSlug:h})]}),e.address&&s(V,{icon:i(B,{size:"14px"}),children:["name: ",i("span",{children:e.address})]}),i($,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),i(J,{Hook:I,props:{channel:e}}),e.parameters&&i(K,{parameters:e.parameters,id:r.link})]}),s(O,{isStacked:m,className:"panel-container-response-samples",children:[!!p?.length&&i(U,{servers:p,hideHeader:!0}),!!S.length&&i(q,{binding:S[0]})]})]}),x.length>0?i(F,{messages:x,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:a,children:i(b,{isStacked:m,children:i(ee,{})})}):null,u.length>0?i(k,{operations:u,type:"receive",id:r.link}):null]})});function J(r){if(!r.Hook)return null;const t=r.Hook(r.props),a=t&&t.html;return a?i("span",{dangerouslySetInnerHTML:{__html:a}}):t}const Q=c.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
|
+
`,X=c(P)`
|
|
8
8
|
padding: var(--spacing-xxl) 0 var(--spacing-base);
|
|
9
|
-
scroll-margin-top: calc(
|
|
10
|
-
|
|
9
|
+
scroll-margin-top: calc(
|
|
10
|
+
var(--navbar-height) + var(--banner-height) - var(--spacing-base)
|
|
11
|
+
) !important;
|
|
12
|
+
`,Y=c(w)`
|
|
11
13
|
margin: 0 0 var(--spacing-xs) 0;
|
|
12
14
|
display: flex;
|
|
13
15
|
align-items: center;
|
|
14
16
|
gap: var(--spacing-xs);
|
|
15
17
|
flex-wrap: wrap;
|
|
16
18
|
:hover {
|
|
17
|
-
${
|
|
19
|
+
${D} {
|
|
18
20
|
opacity: 1;
|
|
19
21
|
visibility: visible;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
`,
|
|
24
|
+
`,Z=c.div`
|
|
23
25
|
display: flex;
|
|
24
26
|
align-items: flex-start;
|
|
25
|
-
`,
|
|
27
|
+
`,ee=c.div`
|
|
26
28
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
27
|
-
`;export{
|
|
29
|
+
`;export{xe as ChannelSection};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as t,Fragment as l,jsxs as
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import{jsx as a,jsxs as
|
|
1
|
+
import{jsx as a,jsxs as i}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 D,useMemo as c,useRef as J,useState as w,useCallback as A,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 R}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{combineUrls as $}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 se,definitionAtom as ie}from"../jotai-store/app.js";import{Message as le}from"./Message.js";import{getSchema as re,modifyPayload as ce}from"../utils/index.js";import{LinkToField as B}from"./common/index.js";import{useTelemetry as de}from"../hooks/index.js";const me=3,De=Q(({messages:s,id:r})=>{var v;const d=V(),z=c(()=>s.find(e=>C(d,`m=${e.key}`))||s[0],[s,d]),[n,P]=w(z),[g,y]=w(n.value.payload),H=A(e=>{const o=ce(g,e);o&&y(o)},[]),l=b(ie),F=A(()=>{var e;return n.value.examples||[{payload:X.sample(Object.assign({},re(g)),{},!((e=l?.components)===null||e===void 0)&&e.schemas?{components:{schemas:l.components.schemas}}:void 0)}]},[g,n.value.examples,(v=l?.components)===null||v===void 0?void 0:v.schemas]),h=b(ae),m=b(se),k=h===U.STACKED,p=c(()=>s.map(e=>({label:e.value.title||e.value.name||e.key,value:e.key})),[s]),[S,K]=w(!1),M=J(null),x=de();D(()=>{var e;const o=s.find(t=>C(d,`m=${t.key}`));o&&(P(o),!((e=o?.value)===null||e===void 0)&&e.payload&&y(o.value.payload))},[d,s]);const L=A(({value:e})=>{var o;const t=s.find(u=>u.key===e);t&&(x.sendAsyncapiDocsSwitchMessageClickedMessage([{object:"switch_message",message:t.key}]),P(t),!((o=t?.value)===null||o===void 0)&&o.payload&&y(t.value.payload))},[s,x]),T=c(()=>Object.entries(n.value.bindings||{}).map(([e,o])=>({key:e,value:o})),[n.value.bindings]),_=c(()=>$(m,j(r,`messages&m=${n.key}`)),[r,m,n.key]);D(()=>{if(!M.current)return;const e=()=>{var o;const t=(o=M.current)===null||o===void 0?void 0:o.querySelectorAll('button[role="tab"]'),u=Array.from(t||[]).some(E=>E.offsetWidth<E.scrollWidth);u!==S&&K(u)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[S,p]);const N=c(()=>$(m,j(r,"messages")),[r,m]);return i(pe,{"data-component-name":"MessageSection/MessageSection",children:[a(I,{layout:h,children:i(O,{isStacked:k,children:[i(ue,{children:[a(B,{to:N}),"Messages"]}),s.length>1?i(W,{children:["Accepts ",a("span",{children:"one of"})," the following messages:"]}):a(W,{children:"Accepts the following message:"})]})}),i(I,{layout:h,children:[i(O,{isStacked:k,children:[i(fe,{children:[a(B,{to:_}),p.length>me||S?a(G,{options:p,value:n.key,onChange:L}):a(ee,{ref:M,size:"small",value:n.key,options:p,onChange:L})]}),a(le,{message:n.value,sectionId:r,id:n.key,onOneOfChange:H})]}),i(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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TFunction } from '@redocly/theme/core/openapi';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
interface MetadataProps {
|
|
4
|
+
metadata: any;
|
|
5
|
+
translate: TFunction;
|
|
6
|
+
}
|
|
7
|
+
export declare function Metadata({ metadata, translate }: MetadataProps): ReactElement | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useMemo as l}from"react";import{Markdown as a}from"@redocly/theme/components/Markdown/Markdown";import{H3 as d}from"@redocly/theme/components/Typography/H3";import{isNotNull as p}from"@redocly/theme/core/openapi";const s=["title","description"];function f([t,r]){return s.includes(t)?null:Array.isArray(r)?{key:t,value:r.filter(c=>typeof c!="object").join(", ")}:typeof r=="object"?null:{key:t,value:r}}function M({metadata:t,translate:r}){const c=l(()=>Object.entries(t||{}).map(f).filter(p).sort((n,i)=>n.key.localeCompare(i.key)),[t]);return t?o(a,{children:[e(d,{children:r("openapi.info.metadata.title","Metadata")}),o("table",{className:"md",children:[e("thead",{children:o("tr",{children:[e("th",{scope:"col",children:r("openapi.key","Key")}),e("th",{scope:"col",children:r("openapi.value","Value")})]})}),e("tbody",{children:c.map(({key:n,value:i})=>o("tr",{children:[e("td",{children:n}),e("td",{children:typeof i=="string"&&i.match(/^https?:\/\//)?e("a",{href:i,target:"_blank",rel:"noreferrer",children:i}):String(i)})]},n))})]})]}):null}export{M as Metadata};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsx as i,jsxs as r,Fragment as f}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as i,jsxs as r,Fragment as f}from"react/jsx-runtime";import a 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 ae}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),l=u(se),j=w===K.STACKED,{getProtocolLabel:L}=ne(),S=re(),_=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=l?.components)===null||n===void 0?void 0:n.messages)||{}).find(([M,B])=>ae(B,s)))===null||o===void 0?void 0:o[0]},[(c=l?.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}`));S.sendAsyncapiDocsMessageClickedMessage([{object:"message",message:n}]),A(M)},[t,v,A,g,S]);if(!e)return null;const h=C(g,t);return i(f,{children:r(le,{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: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:j,className:"panel-container-response-samples",children:!!_.length&&i(Z,{binding:_[0],id:t})})]})]})})}),le=a($)`
|
|
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;
|
|
4
|
-
`,D=
|
|
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
|
+
`,D=a(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 f}from"react/jsx-runtime";import l from"st
|
|
|
17
17
|
visibility: visible;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,te=
|
|
20
|
+
`,te=a(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=a.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
|
-
`,ce=
|
|
30
|
+
`,ce=a.div`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
padding: var(--spacing-xs) 0;
|
|
34
|
-
`,b=
|
|
34
|
+
`,b=a(y)`
|
|
35
35
|
& > span:first-child {
|
|
36
36
|
font-weight: var(--font-weight-medium);
|
|
37
37
|
}
|
|
38
|
-
`,de=
|
|
38
|
+
`,de=a.div`
|
|
39
39
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
40
|
-
`,me=
|
|
40
|
+
`,me=a(I)`
|
|
41
41
|
display: flex;
|
|
42
42
|
justify-content: space-between;
|
|
43
|
-
`,pe=
|
|
43
|
+
`,pe=a(J)`
|
|
44
44
|
cursor: pointer;
|
|
45
|
-
`,ge=
|
|
45
|
+
`,ge=a.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
`;export{De as Operation};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
import{jsx as o,jsxs as m}from"react/jsx-runtime";import{useAtomValue as d}from"jotai";import{RightPanelContainer as c,Overview as p}from"@redocly/openapi-docs";import{LayoutVariant as v}from"@redocly/config";import{useMemo as u,memo as h}from"react";import{Panel as
|
|
1
|
+
import{jsx as o,jsxs as m}from"react/jsx-runtime";import{useAtomValue as d}from"jotai";import{RightPanelContainer as c,Overview as p}from"@redocly/openapi-docs";import{LayoutVariant as v}from"@redocly/config";import{useMemo as u,memo as h}from"react";import y from"styled-components";import{Panel as r}from"@redocly/theme/components/Panel/Panel";import{Markdown as f}from"@redocly/theme/components/Markdown/Markdown";import{ServersListPanel as w}from"./ServersListPanel.js";import{DownloadSpecification as P}from"./DownloadSpecification.js";import{layoutAtom as x}from"../jotai-store/app.js";import{useTranslate as S}from"../hooks/index.js";const V=h(({info:e,servers:i})=>{const a=S(),t=u(()=>Object.entries(i||{}).map(([l,s])=>({key:l,value:s})),[i]),n=d(x)===v.STACKED;return m(c,{isStacked:n,"data-component-name":"RightPanel/RightPanel",children:[o(r,{className:"panel-download",header:a("asyncapi.download.description.title","Download AsycAPI description"),isExpandable:!1,children:o(P,{})}),(e?.license||e?.contact||e?.termsOfService)&&o(g,{className:"panel-overview",header:a("asyncapi.info.title","Overview"),isExpandable:!1,children:o(f,{children:o(p,{info:e,translate:a})})}),!!t?.length&&o(w,{servers:t,showDetails:!0})]})}),g=y(r)`
|
|
2
|
+
&:has(main > div:empty) {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
`;export{V as RightPanel};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
${
|
|
1
|
+
import{jsx as s,jsxs as p}from"react/jsx-runtime";import r from"styled-components";import{ExampleSwitch as f}from"@redocly/openapi-docs";import{useEffect as h,useMemo as g,useState as u}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 x}from"@redocly/theme/components/Panel/PanelBody";import{PanelHeader as y}from"@redocly/theme/components/Panel/PanelHeader";import{useProtocolLabels as P,useTelemetry as b}from"../hooks/index.js";const $=({examples:e})=>{const[o,a]=u(e[0]),{getProtocolLabel:i}=P(),d=b();h(()=>{a(e[0])},[e,a]);const m=t=>{const n=e?.find(l=>l.name===t);n&&(a(n),d.sendAsyncapiDocsSwitchExampleClickedMessage([{object:"switch_example",example:t,numberOfExamples:e.length}]))},c=g(()=>e?.reduce((t,n,l)=>(t[n.name||`Example ${l+1}`]=Object.assign({},n),t),{}),[e]);return p(j,{className:"panel-messages-samples",header:()=>s(w,{isExpandable:!1,children:i("payload")}),children:[s(f,{examples:c,exampleKey:o?.name,onChange:m}),s(v,{data:o?.payload,expandLevel:3})]})},j=r(E)`
|
|
2
|
+
${x} {
|
|
3
3
|
padding: var(--spacing-sm) 0 0;
|
|
4
4
|
line-height: var(--line-height-md);
|
|
5
5
|
}
|
|
6
|
-
`,
|
|
6
|
+
`,w=r(y)`
|
|
7
7
|
font-weight: var(--font-weight-regular);
|
|
8
|
-
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
`;export{A as SamplesPanel};
|
|
8
|
+
`;export{$ as SamplesPanel};
|
|
@@ -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
|
|
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.
|
|
3
|
+
"version": "1.7.0-custom.1",
|
|
4
4
|
"description": "Async API docs for Redocly Realm",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"esbuild-minify-dir": "^0.0.1",
|
|
27
27
|
"jest-styled-components": "7.2.0",
|
|
28
28
|
"json-schema": "0.4.0",
|
|
29
|
-
"react": "19.2.
|
|
29
|
+
"react": "^19.2.4",
|
|
30
30
|
"tsc-alias": "1.8.16",
|
|
31
31
|
"typescript": "5.9.3",
|
|
32
32
|
"vitest": "4.0.10",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@markdoc/markdoc": "0.5.2",
|
|
37
37
|
"jotai": "^2.11.1",
|
|
38
|
-
"openapi-sampler": "1.
|
|
39
|
-
"react-router-dom": "^6.
|
|
38
|
+
"openapi-sampler": "1.7.0",
|
|
39
|
+
"react-router-dom": "^6.30.3",
|
|
40
40
|
"styled-components": "5.3.11",
|
|
41
41
|
"web-vitals": "3.3.1",
|
|
42
|
-
"@redocly/
|
|
43
|
-
"@redocly/
|
|
44
|
-
"@redocly/theme": "0.
|
|
42
|
+
"@redocly/openapi-docs": "3.18.0-custom.1",
|
|
43
|
+
"@redocly/config": "0.43.0-custom.1",
|
|
44
|
+
"@redocly/theme": "0.62.0-custom.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"react": "19.2.
|
|
47
|
+
"react": "^19.2.4"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"clean": "rm -rf lib",
|
|
51
51
|
"compile": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
52
52
|
"build:minify": "esbuild-minify-dir lib --esm",
|
|
53
|
-
"build:without-minify": "
|
|
54
|
-
"build": "
|
|
53
|
+
"build:without-minify": "pnpm run clean && pnpm run compile",
|
|
54
|
+
"build": "pnpm run clean && pnpm run compile && pnpm run build:minify",
|
|
55
55
|
"watch": "tsc -w -p tsconfig.build.json",
|
|
56
56
|
"test": "vitest run",
|
|
57
57
|
"test:update": "vitest run -u",
|