@redocly/asyncapi-docs 1.1.0-next.0 → 1.1.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 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonSchema=l;const e=require("react/jsx-runtime"),s=require("@redocly/openapi-docs");function l({options:u,schemaResolved:n,schema:r,slug:c,onOneOfChange:d}){var o,i,t;if(!r&&!n)return null;const p={openapi:"3.0.0",info:{version:"1",description:"test",title:"test"},paths:{},"x-root":((i=(o=n?.components)===null||o===void 0?void 0:o.schemas)===null||i===void 0?void 0:i.__root)||r,components:{schemas:Object.assign({},(t=n?.components)===null||t===void 0?void 0:t.schemas)}};return(0,e.jsx)(s.StoreProvider,{options:u,definition:p,children:(0,e.jsx)(s.RedocSchema,{pointer:"#/x-root",slug:c,onOneOfChange:d})})}
1
+ "use strict";var _=exports&&exports.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonSchema=a;const r=require("react/jsx-runtime"),s=require("@redocly/openapi-docs"),p=_(require("styled-components"));function a({options:i,schemaResolved:n,schema:u,slug:d,onOneOfChange:c}){var t,o,e;if(!u&&!n)return null;const l={openapi:"3.0.0",info:{version:"1",description:"test",title:"test"},paths:{},"x-root":((o=(t=n?.components)===null||t===void 0?void 0:t.schemas)===null||o===void 0?void 0:o.__root)||u,components:{schemas:Object.assign({},(e=n?.components)===null||e===void 0?void 0:e.schemas)}};return(0,r.jsx)(f,{children:(0,r.jsx)(s.StoreProvider,{options:i,definition:l,children:(0,r.jsx)(s.RedocSchema,{pointer:"#/x-root",slug:d,onOneOfChange:c})})})}const f=p.default.div`
2
+ & > div > div {
3
+ padding-left: 0;
4
+ padding-right: 0;
5
+ }
6
+ `;
@@ -1,7 +1,7 @@
1
- "use strict";var C=exports&&exports.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),R=exports&&exports.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),U=exports&&exports.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&C(n,e,t);return R(n,e),n},V=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Operation=void 0;const s=require("react/jsx-runtime"),l=V(require("styled-components")),b=require("jotai"),u=require("@redocly/openapi-docs"),c=require("@redocly/theme"),f=U(require("react")),W=require("react-router-dom"),p=require("./common"),$=require("./OperationBinding"),y=require("../jotai-store/app"),D=require("../hooks"),F=require("../utils");exports.Operation=f.default.memo(({operation:e,dataSectionId:n,headerRow:t,id:r,showDivider:o})=>{var v,h,m,_;const w=(0,b.useAtomValue)(y.layoutAtom),g=(0,b.useAtomValue)(y.routingBasePathAtom),d=(0,b.useAtomValue)(y.definitionAtom),M=w===c.LayoutVariant.STACKED,{getProtocolLabel:k}=(0,D.useProtocolLabels)(),q=(0,D.useTelemetry)(),P=(0,f.useMemo)(()=>Object.entries(e?.bindings||{}).map(([i,a])=>({key:i,value:a})),[e?.bindings]),B=(0,f.useMemo)(()=>{var i;return(i=e?.["x-badges"])===null||i===void 0?void 0:i.map(a=>Object.assign(Object.assign({},a),{position:a.position||"after"}))},[e]),A=(0,W.useNavigate)(),H=(0,f.useCallback)(i=>{var a,j;const x=(j=Object.entries(((a=d?.components)===null||a===void 0?void 0:a.messages)||{}).find(([X,z])=>(0,F.isEqual)(z,i)))===null||j===void 0?void 0:j[0];if(!x||!n)return;const L=n.substring(1).split("/operations")[0],T=(0,c.combineUrls)(g,(0,u.makeDeepLink)(L,`messages&m=${x}`));q.send({type:"asyncapi_docs.message.clicked",payload:{message:x}}),A(T)},[n,(v=d?.components)===null||v===void 0?void 0:v.messages,A,g,q]);return e?(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(I,{sectionId:(0,c.combineUrls)(g,n),"data-component-name":"Operation/Operation",hasHeader:!!t,children:[t,(0,s.jsxs)(u.Row,{layout:w,children:[(0,s.jsxs)(J,{isStacked:M,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(p.ActionTag,{color:e.action,children:k(e.action)}),(0,s.jsxs)(S,{children:[(0,s.jsx)(u.CustomBadges,{badges:B,children:e.title||r}),(0,s.jsx)(p.ShareLink,{to:(0,c.combineUrls)(g,n),"aria-label":`link to ${e.title||r}`})]}),(0,s.jsx)(p.Information,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),((h=e.messages)===null||h===void 0?void 0:h.length)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(E,{children:"Messages"}),(0,s.jsx)(N,{children:(m=e.messages)===null||m===void 0?void 0:m.map((i,a)=>(0,s.jsxs)(Q,{icon:null,onClick:()=>H(i),children:[i.title||i.name,(0,s.jsx)(c.ArrowUpRightIcon,{size:"12px"})]},a))})]}),e.reply&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(S,{children:"Reply"}),(0,s.jsxs)(K,{children:[e.reply.address&&(0,s.jsxs)(O,{children:[(0,s.jsx)("span",{children:"Address: "}),(0,s.jsx)("span",{children:e.reply.address.location})]}),e.reply.channel&&(0,s.jsxs)(O,{children:[(0,s.jsx)("span",{children:"Topic: "}),(0,s.jsx)("span",{children:e.reply.channel.address})]}),!!(!((_=e.reply.messages)===null||_===void 0)&&_.length)&&(0,s.jsxs)(O,{children:[(0,s.jsx)("span",{children:"Messages: "}),(0,s.jsx)("span",{children:e.reply.messages.map(i=>i.title||i.name).join(", ")})]})]})]})]}),o&&(0,s.jsx)(G,{})]}),(0,s.jsx)(u.OperationSamplesPanel,{isStacked:M,className:"panel-container-response-samples",children:!!P.length&&(0,s.jsx)($.OperationBinding,{binding:P[0],id:n})})]})]})}):null});const I=(0,l.default)(u.Section)`
1
+ "use strict";var T=exports&&exports.__createBinding||(Object.create?function(e,n,r,a){a===void 0&&(a=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,a,o)}:function(e,n,r,a){a===void 0&&(a=r),e[a]=n[r]}),z=exports&&exports.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),R=exports&&exports.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&T(n,e,r);return z(n,e),n},U=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Operation=void 0;const s=require("react/jsx-runtime"),l=U(require("styled-components")),x=require("jotai"),u=require("@redocly/openapi-docs"),c=require("@redocly/theme"),f=R(require("react")),V=require("react-router-dom"),v=require("./common"),W=require("./OperationBinding"),y=require("../jotai-store/app"),S=require("../hooks"),$=require("../utils");exports.Operation=f.default.memo(({operation:e,dataSectionId:n,headerRow:r,id:a,showDivider:o})=>{var h,m,_,j;const w=(0,x.useAtomValue)(y.layoutAtom),p=(0,x.useAtomValue)(y.routingBasePathAtom),d=(0,x.useAtomValue)(y.definitionAtom),M=w===c.LayoutVariant.STACKED,{getProtocolLabel:B}=(0,S.useProtocolLabels)(),q=(0,S.useTelemetry)(),P=(0,f.useMemo)(()=>Object.entries(e?.bindings||{}).map(([i,t])=>({key:i,value:t})),[e?.bindings]),H=(0,f.useMemo)(()=>{var i;return(i=e?.["x-badges"])===null||i===void 0?void 0:i.map(t=>Object.assign(Object.assign({},t),{position:t.position||"after"}))},[e]),A=(0,V.useNavigate)(),b=(0,f.useCallback)(i=>{var t,g;return(g=Object.entries(((t=d?.components)===null||t===void 0?void 0:t.messages)||{}).find(([D,L])=>(0,$.isEqual)(L,i)))===null||g===void 0?void 0:g[0]},[(h=d?.components)===null||h===void 0?void 0:h.messages]),C=(0,f.useCallback)(i=>{const t=b(i);if(!t||!n)return;const g=n.substring(1).split("/operations")[0],D=(0,c.combineUrls)(p,(0,u.makeDeepLink)(g,`messages&m=${t}`));q.send({type:"asyncapi_docs.message.clicked",payload:{message:t}}),A(D)},[n,b,A,p,q]);return e?(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(F,{sectionId:(0,c.combineUrls)(p,n),"data-component-name":"Operation/Operation",hasHeader:!!r,children:[r,(0,s.jsxs)(u.Row,{layout:w,children:[(0,s.jsxs)(G,{isStacked:M,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(v.ActionTag,{color:e.action,children:B(e.action)}),(0,s.jsxs)(k,{children:[(0,s.jsx)(u.CustomBadges,{badges:H,children:e.title||a}),(0,s.jsx)(v.ShareLink,{to:(0,c.combineUrls)(p,n),"aria-label":`link to ${e.title||a}`})]}),(0,s.jsx)(v.Information,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),((m=e.messages)===null||m===void 0?void 0:m.length)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(I,{children:"Messages"}),(0,s.jsx)(E,{children:(_=e.messages)===null||_===void 0?void 0:_.map((i,t)=>(0,s.jsxs)(J,{icon:null,onClick:()=>C(i),children:[i.title||i.name||b(i),(0,s.jsx)(c.ArrowUpRightIcon,{size:"12px"})]},t))})]}),e.reply&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k,{children:"Reply"}),(0,s.jsxs)(K,{children:[e.reply.address&&(0,s.jsxs)(O,{children:[(0,s.jsx)("span",{children:"Address: "}),(0,s.jsx)("span",{children:e.reply.address.location})]}),e.reply.channel&&(0,s.jsxs)(O,{children:[(0,s.jsx)("span",{children:"Topic: "}),(0,s.jsx)("span",{children:e.reply.channel.address})]}),!!(!((j=e.reply.messages)===null||j===void 0)&&j.length)&&(0,s.jsxs)(O,{children:[(0,s.jsx)("span",{children:"Messages: "}),(0,s.jsx)("span",{children:e.reply.messages.map(i=>i.title||i.name).join(", ")})]})]})]})]}),o&&(0,s.jsx)(N,{})]}),(0,s.jsx)(u.OperationSamplesPanel,{isStacked:M,className:"panel-container-response-samples",children:!!P.length&&(0,s.jsx)(W.OperationBinding,{binding:P[0],id:n})})]})]})}):null});const F=(0,l.default)(u.Section)`
2
2
  padding: var(--spacing-lg) 0;
3
3
  scroll-margin-top: ${e=>e.hasHeader?"calc(var(--navbar-height) - var(--spacing-xl)*2)":"var(--navbar-height)"} !important;
4
- `,S=(0,l.default)(c.H4)`
4
+ `,k=(0,l.default)(c.H4)`
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,11 +17,11 @@
17
17
  visibility: visible;
18
18
  }
19
19
  }
20
- `,E=(0,l.default)(c.H4)`
20
+ `,I=(0,l.default)(c.H4)`
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
- `,N=l.default.div`
24
+ `,E=l.default.div`
25
25
  display: flex;
26
26
  flex-direction: row;
27
27
  flex-wrap: wrap;
@@ -35,11 +35,11 @@
35
35
  & > span:first-child {
36
36
  font-weight: var(--font-weight-medium);
37
37
  }
38
- `,G=l.default.div`
38
+ `,N=l.default.div`
39
39
  border-bottom: 1px solid var(--border-color-secondary);
40
- `,J=(0,l.default)(u.SamplesMiddlePanel)`
40
+ `,G=(0,l.default)(u.SamplesMiddlePanel)`
41
41
  display: flex;
42
42
  justify-content: space-between;
43
- `,Q=(0,l.default)(p.TagWithIcon)`
43
+ `,J=(0,l.default)(v.TagWithIcon)`
44
44
  cursor: pointer;
45
45
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/asyncapi-docs",
3
- "version": "1.1.0-next.0",
3
+ "version": "1.1.0-next.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/config": "0.26.4",
43
- "@redocly/openapi-docs": "3.12.0-next.17",
44
- "@redocly/theme": "0.56.0-next.8"
42
+ "@redocly/config": "0.27.0",
43
+ "@redocly/openapi-docs": "3.12.0-next.19",
44
+ "@redocly/theme": "0.56.0-next.10"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^19.1.0"