@redocly/asyncapi-docs 0.5.0-rc.8 → 0.5.0-rc.9

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,3 @@
1
+ import { type TFunction } from '@redocly/theme/core/openapi';
2
+ export declare function useTranslate(): TFunction;
1
3
  export declare const ApiInfo: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- var f=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var x=(o,n)=>{for(var e in n)f(o,e,{get:n[e],enumerable:!0})},h=(o,n,e,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of d(n))!u.call(o,a)&&a!==e&&f(o,a,{get:()=>n[a],enumerable:!(s=l(n,a))||s.enumerable});return o};var k=o=>h(f({},"__esModule",{value:!0}),o);var D={};x(D,{ApiInfo:()=>A});module.exports=k(D);var r=require("react/jsx-runtime"),c=require("jotai"),t=require("@redocly/openapi-docs"),p=require("@redocly/theme/components/OpenApiDocs/hooks/AfterOpenApiDescription"),m=require("./common"),i=require("../jotai-store/app");const A=()=>{const o=(0,c.useAtomValue)(i.definitionAtom),n=(0,c.useAtomValue)(i.routingBasePathAtom),e=(0,c.useAtomValue)(i.markdocOptionsAtom),s=(0,t.saveTextBeforeHeading)((0,t.getValueFromMdParsedExtension)(o.info,"description")||"");return(0,r.jsxs)(t.Section,{sectionId:n,children:[(0,r.jsxs)(m.ApiHeader,{children:[o.info.title," ",o.info.version]}),s&&(0,r.jsx)(t.Markdown,{source:s,markdocOptions:e}),(0,r.jsx)(H,{Hook:p.AfterOpenApiDescription,props:{info:o.info}}),o.info.externalDocs&&(0,r.jsx)(m.ExternalDocumentationWrapper,{children:(0,r.jsx)(t.ExternalDocumentation,{externalDocs:o.info.externalDocs})})]})};function H(o){if(!o.Hook)return null;const n=o.Hook(o.props),e=n&&n.html;return e?(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:e}}):n}0&&(module.exports={ApiInfo});
1
+ var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var A=(o,t)=>{for(var a in t)d(o,a,{get:t[a],enumerable:!0})},k=(o,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of x(t))!h.call(o,n)&&n!==a&&d(o,n,{get:()=>t[n],enumerable:!(s=u(t,n))||s.enumerable});return o};var D=o=>k(d({},"__esModule",{value:!0}),o);var j={};A(j,{ApiInfo:()=>g,useTranslate:()=>l});module.exports=D(j);var r=require("react/jsx-runtime"),m=require("jotai"),e=require("@redocly/openapi-docs"),f=require("@redocly/theme/core/openapi"),c=require("./common"),i=require("../jotai-store/app"),p=require("./Metadata");function l(){const{translate:o}=(0,f.useThemeHooks)().useTranslate();return o}const g=()=>{const o=(0,m.useAtomValue)(i.definitionAtom),t=(0,m.useAtomValue)(i.routingBasePathAtom),a=(0,m.useAtomValue)(i.markdocOptionsAtom),s=l(),n=(0,e.saveTextBeforeHeading)((0,e.getValueFromMdParsedExtension)(o.info,"description")||"");return(0,r.jsxs)(e.Section,{sectionId:t,children:[(0,r.jsxs)(c.ApiHeader,{children:[o.info.title," ",o.info.version]}),n&&(0,r.jsx)(e.Markdown,{source:n,markdocOptions:a}),o.info.externalDocs&&(0,r.jsx)(c.ExternalDocumentationWrapper,{children:(0,r.jsx)(e.ExternalDocumentation,{externalDocs:o.info.externalDocs})}),(0,r.jsx)(p.Metadata,{metadata:o.info["x-metadata"],translate:s})]})};0&&(module.exports={ApiInfo,useTranslate});
@@ -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
+ var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var m=(t,r)=>{for(var n in r)c(t,n,{get:r[n],enumerable:!0})},u=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of f(r))!h.call(t,i)&&i!==n&&c(t,i,{get:()=>r[i],enumerable:!(o=s(r,i))||o.enumerable});return t};var j=t=>u(c({},"__esModule",{value:!0}),t);var y={};m(y,{Metadata:()=>x});module.exports=j(y);var e=require("react/jsx-runtime"),l=require("react"),d=require("@redocly/theme/components/Markdown/Markdown"),p=require("@redocly/theme/components/Typography/H3"),a=require("@redocly/theme/core/openapi");const M=["title","description"];function b([t,r]){return M.includes(t)?null:Array.isArray(r)?{key:t,value:r.filter(n=>typeof n!="object").join(", ")}:typeof r=="object"?null:{key:t,value:r}}function x({metadata:t,translate:r}){const n=(0,l.useMemo)(()=>Object.entries(t||{}).map(b).filter(a.isNotNull),[t]);return t?(0,e.jsxs)(d.Markdown,{children:[(0,e.jsx)(p.H3,{children:r("openapi.info.metadata.title","Metadata")}),(0,e.jsxs)("table",{className:"md",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{children:[(0,e.jsx)("th",{scope:"col",children:r("openapi.key","Key")}),(0,e.jsx)("th",{scope:"col",children:r("openapi.value","Value")})]})}),(0,e.jsx)("tbody",{children:n.map(({key:o,value:i})=>(0,e.jsxs)("tr",{children:[(0,e.jsx)("td",{children:o}),(0,e.jsx)("td",{children:typeof i=="string"&&i.match(/^https?:\/\//)?(0,e.jsx)("a",{href:i,target:"_blank",rel:"noreferrer",children:i}):String(i)})]},o))})]})]}):null}0&&(module.exports={Metadata});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/asyncapi-docs",
3
- "version": "0.5.0-rc.8",
3
+ "version": "0.5.0-rc.9",
4
4
  "description": "Async API docs for Redocly Realm",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",
@@ -40,8 +40,8 @@
40
40
  "styled-components": "5.3.11",
41
41
  "web-vitals": "3.3.1",
42
42
  "@redocly/config": "0.26.3-rc.1",
43
- "@redocly/openapi-docs": "3.12.0-rc.7",
44
- "@redocly/theme": "0.56.0-rc.2"
43
+ "@redocly/theme": "0.56.0-rc.2",
44
+ "@redocly/openapi-docs": "3.12.0-rc.7"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^19.1.0"