apiuikit 2.0.0 → 2.1.0

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.
Files changed (36) hide show
  1. package/dist/{CodeSamples-ILzruYIb.cjs → CodeSamples-5FoT0ZpU.cjs} +1 -1
  2. package/dist/{CodeSamples-DqJT72uU.js → CodeSamples-GTPVAAJ5.js} +1 -1
  3. package/dist/{LogoExtension-pwW1l7NO.cjs → LogoExtension-CbdKkZJ6.cjs} +1 -1
  4. package/dist/{LogoExtension-yx9jporL.js → LogoExtension-DuIqK_Wj.js} +1 -1
  5. package/dist/apiuikit.cjs.js +1 -1
  6. package/dist/apiuikit.es.js +44 -39
  7. package/dist/components/ItemCard.d.ts +16 -0
  8. package/dist/containers/AsyncAPI/AsyncAPI.d.ts +15 -12
  9. package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +18 -12
  10. package/dist/containers/Messages/MessageCard.d.ts +15 -0
  11. package/dist/containers/OpenAPI/OpenAPI.d.ts +16 -12
  12. package/dist/containers/OpenAPI/OpenAPIRenderer.d.ts +18 -12
  13. package/dist/containers/Operation/OperationCard.d.ts +13 -0
  14. package/dist/containers/Operation/OperationHeader.d.ts +18 -0
  15. package/dist/containers/Path/Endpoint.d.ts +23 -0
  16. package/dist/containers/Path/EndpointHeader.d.ts +21 -0
  17. package/dist/containers/Schema/SchemaCard.d.ts +18 -0
  18. package/dist/helpers/findItem.d.ts +21 -0
  19. package/dist/helpers/openapiParameters.d.ts +5 -0
  20. package/dist/{index-DNsQrlh-.cjs → index-0u301gJq.cjs} +78 -78
  21. package/dist/{index-CfELqow6.cjs → index-BNwl4VfM.cjs} +1 -1
  22. package/dist/{index-Dbr8eb7Z.js → index-CT7jUAdL.js} +4260 -4006
  23. package/dist/{index-CI3MIo1V.cjs → index-CpdbrwV-.cjs} +1 -1
  24. package/dist/{index-BI2__AB3.js → index-D8Euqzmz.js} +1 -1
  25. package/dist/{index-6q1VqGzf.js → index-DRBkON8k.js} +1 -1
  26. package/dist/index.d.ts +6 -6
  27. package/dist/{protoToJsonSchema-CbZrqF4-.js → protoToJsonSchema-CpU-wRjQ.js} +1 -1
  28. package/dist/{protoToJsonSchema-QVW5EW0-.cjs → protoToJsonSchema-DcX8BXD3.cjs} +1 -1
  29. package/dist/{protobufSchemaParser-BEVutm25.cjs → protobufSchemaParser-C0ip1oHD.cjs} +1 -1
  30. package/dist/{protobufSchemaParser-CtnNrHbS.js → protobufSchemaParser-ZdCXJyvr.js} +2 -2
  31. package/dist/public/createSectionRoot.d.ts +2 -1
  32. package/dist/public/openapiSections.d.ts +95 -10
  33. package/dist/public/schemasSection.d.ts +42 -8
  34. package/dist/public/sections.d.ts +79 -11
  35. package/dist/public/useNotFoundWarning.d.ts +7 -0
  36. package/package.json +17 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const be=require("react/jsx-runtime"),oe=require("react"),Q=require("./index-DNsQrlh-.cjs");function Dr(t,e=new Set){if(e.has(t))return t;if(t.type==="object"&&t.properties&&typeof t.properties=="object"){e.add(t);try{const r={};for(const[n,s]of Object.entries(t.properties)){const o=/id$/i.test(n)&&s.type==="string"&&!s.format&&!s.examples,a=s.type==="string"&&!s.format&&!s.examples&&!s.enum;r[n]=o?{...s,format:"uuid"}:a?{...s,examples:["string"]}:Dr(s,e)}return{...t,properties:r}}finally{e.delete(t)}}return t}async function An(t){try{const{generate:e}=await Promise.resolve().then(()=>require("./index-Ccy_JZ0T.cjs"));return await e(Dr(t),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const ir="",ar=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const be=require("react/jsx-runtime"),oe=require("react"),Q=require("./index-0u301gJq.cjs");function Dr(t,e=new Set){if(e.has(t))return t;if(t.type==="object"&&t.properties&&typeof t.properties=="object"){e.add(t);try{const r={};for(const[n,s]of Object.entries(t.properties)){const o=/id$/i.test(n)&&s.type==="string"&&!s.format&&!s.examples,a=s.type==="string"&&!s.format&&!s.examples&&!s.enum;r[n]=o?{...s,format:"uuid"}:a?{...s,examples:["string"]}:Dr(s,e)}return{...t,properties:r}}finally{e.delete(t)}}return t}async function An(t){try{const{generate:e}=await Promise.resolve().then(()=>require("./index-Ccy_JZ0T.cjs"));return await e(Dr(t),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const ir="",ar=`
2
2
  `;var j=class{constructor({indent:t,join:e}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=ir,this.lineJoin=ar,this.indentLine=(r,n=0)=>`${this.indentationCharacter.repeat(n)}${r}`,this.unshift=(r,n)=>{const s=this.indentLine(r,n);this.code.unshift(s)},this.push=(r,n)=>{const s=this.indentLine(r,n);this.code.push(s)},this.pushToLast=r=>{this.code||this.push(r);const n=`${this.code[this.code.length-1]}${r}`;this.code[this.code.length-1]=n},this.blank=()=>{this.code.push("")},this.join=()=>{const r=this.code.join(this.lineJoin);return this.postProcessors.reduce((n,s)=>s(n),r)},this.addPostProcessor=r=>{this.postProcessors=[...this.postProcessors,r]},this.indentationCharacter=t||ir,this.lineJoin=e??ar}},Rn=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},qn=function(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")},Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.default=t=>Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e));const Nn=Rn,_n=qn,Ln=Yt.default;var In=(t,e,r)=>{const n=[];return(function s(o,a,i){a=a||{},a.indent=a.indent||" ",i=i||"";let c;a.inlineCharacterLimit===void 0?c={newLine:`
3
3
  `,newLineOrSpace:`
4
4
  `,pad:i,indent:i+a.indent}:c={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const l=f=>{if(a.inlineCharacterLimit===void 0)return f;const u=f.replace(new RegExp(c.newLine,"g"),"").replace(new RegExp(c.newLineOrSpace,"g")," ").replace(new RegExp(c.pad+"|"+c.indent,"g"),"");return u.length<=a.inlineCharacterLimit?u:f.replace(new RegExp(c.newLine+"|"+c.newLineOrSpace,"g"),`
@@ -1,6 +1,6 @@
1
1
  import { jsxs as ar, jsx as Ne } from "react/jsx-runtime";
2
2
  import { useId as _n, useMemo as Ve, useState as gt, useEffect as sr } from "react";
3
- import { g as Ln, c as nt, a as In, u as Un, b as cr, e as Fn, o as Mn, C as Hn, h as Bn } from "./index-Dbr8eb7Z.js";
3
+ import { g as Ln, c as nt, a as In, u as Un, b as cr, e as Fn, o as Mn, C as Hn, h as Bn } from "./index-CT7jUAdL.js";
4
4
  function Zr(t, e = /* @__PURE__ */ new Set()) {
5
5
  if (e.has(t)) return t;
6
6
  if (t.type === "object" && t.properties && typeof t.properties == "object") {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-DNsQrlh-.cjs");function n({value:e}){const o=t.resolveLogo(e);return o?r.jsx("img",{src:o.url,alt:o.altText??"logo",style:o.backgroundColor?{backgroundColor:o.backgroundColor}:void 0,className:"max-h-24 max-w-24 object-contain"}):null}exports.default=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-0u301gJq.cjs");function n({value:e}){const o=t.resolveLogo(e);return o?r.jsx("img",{src:o.url,alt:o.altText??"logo",style:o.backgroundColor?{backgroundColor:o.backgroundColor}:void 0,className:"max-h-24 max-w-24 object-contain"}):null}exports.default=n;
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { d as l } from "./index-Dbr8eb7Z.js";
2
+ import { d as l } from "./index-CT7jUAdL.js";
3
3
  function e({ value: r }) {
4
4
  const o = l(r);
5
5
  return o ? /* @__PURE__ */ t(
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DNsQrlh-.cjs");exports.AsyncAPI=e.AsyncAPI;exports.AsyncAPIInfo=e.AsyncAPIInfo;exports.AsyncAPIMessages=e.AsyncAPIMessages;exports.AsyncAPIOperations=e.AsyncAPIOperations;exports.AsyncAPIProvider=e.AsyncAPIProvider;exports.AsyncAPIRenderer=e.AsyncAPIRenderer;exports.AsyncAPISchemas=e.AsyncAPISchemas;exports.AsyncAPIServers=e.AsyncAPIServers;exports.ErrorBoundary=e.ErrorBoundary;exports.OpenAPI=e.OpenAPI;exports.OpenAPIEndpoints=e.OpenAPIEndpoints;exports.OpenAPIInfo=e.OpenAPIInfo;exports.OpenAPIProvider=e.OpenAPIProvider;exports.OpenAPIRenderer=e.OpenAPIRenderer;exports.OpenAPISchemas=e.OpenAPISchemas;exports.OpenAPIServers=e.OpenAPIServers;exports.OpenAPIWebhooks=e.OpenAPIWebhooks;exports.PluginSlot=e.PluginSlot;exports.SchemaTab=e.SchemaTabs;exports.SchemaTree=e.SchemaTree;exports.Schemas=e.Schemas;exports.asyncApiOperationToMarkdown=e.asyncApiOperationToMarkdown;exports.asyncApiToMarkdown=e.asyncApiToMarkdown;exports.default=e.AsyncAPI;exports.defaultConfig=e.defaultConfig;exports.documentToLlmsTxt=e.documentToLlmsTxt;exports.documentToMarkdown=e.documentToMarkdown;exports.listDocumentTargets=e.listDocumentTargets;exports.markdownForLlm=e.markdownForLlm;exports.openApiEndpointToMarkdown=e.openApiEndpointToMarkdown;exports.openApiToMarkdown=e.openApiToMarkdown;exports.parseAndRender=e.parseAndRender;exports.parseAndRenderOpenAPI=e.parseAndRender$1;exports.targetSlug=e.targetSlug;exports.useAsyncAPIDocument=e.useAsyncAPIDocument;exports.useAsyncAPIDocumentContext=e.useAsyncAPIDocumentContext;exports.useDocumentContext=e.useDocumentContext;exports.useOpenAPIDocumentContext=e.useOpenAPIDocumentContext;exports.useOperationTabPlugins=e.useOperationTabPlugins;exports.usePluginSlot=e.usePluginSlot;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-0u301gJq.cjs");exports.AsyncAPI=e.AsyncAPI;exports.AsyncAPIInfo=e.AsyncAPIInfo;exports.AsyncAPIMessage=e.AsyncAPIMessage;exports.AsyncAPIMessages=e.AsyncAPIMessages;exports.AsyncAPIOperation=e.AsyncAPIOperation;exports.AsyncAPIOperations=e.AsyncAPIOperations;exports.AsyncAPIProvider=e.AsyncAPIProvider;exports.AsyncAPIRenderer=e.AsyncAPIRenderer;exports.AsyncAPISchemas=e.AsyncAPISchemas;exports.AsyncAPIServers=e.AsyncAPIServers;exports.ErrorBoundary=e.ErrorBoundary;exports.OpenAPI=e.OpenAPI;exports.OpenAPIEndpoint=e.OpenAPIEndpoint;exports.OpenAPIEndpoints=e.OpenAPIEndpoints;exports.OpenAPIInfo=e.OpenAPIInfo;exports.OpenAPIProvider=e.OpenAPIProvider;exports.OpenAPIRenderer=e.OpenAPIRenderer;exports.OpenAPISchemas=e.OpenAPISchemas;exports.OpenAPIServers=e.OpenAPIServers;exports.OpenAPIWebhook=e.OpenAPIWebhook;exports.OpenAPIWebhooks=e.OpenAPIWebhooks;exports.PluginSlot=e.PluginSlot;exports.Schema=e.Schema;exports.SchemaTab=e.SchemaTabs;exports.SchemaTree=e.SchemaTree;exports.Schemas=e.Schemas;exports.asyncApiOperationToMarkdown=e.asyncApiOperationToMarkdown;exports.asyncApiToMarkdown=e.asyncApiToMarkdown;exports.default=e.AsyncAPI;exports.defaultConfig=e.defaultConfig;exports.documentToLlmsTxt=e.documentToLlmsTxt;exports.documentToMarkdown=e.documentToMarkdown;exports.listDocumentTargets=e.listDocumentTargets;exports.markdownForLlm=e.markdownForLlm;exports.openApiEndpointToMarkdown=e.openApiEndpointToMarkdown;exports.openApiToMarkdown=e.openApiToMarkdown;exports.parseAndRender=e.parseAndRender;exports.parseAndRenderOpenAPI=e.parseAndRender$1;exports.targetSlug=e.targetSlug;exports.useAsyncAPIDocument=e.useAsyncAPIDocument;exports.useAsyncAPIDocumentContext=e.useAsyncAPIDocumentContext;exports.useDocumentContext=e.useDocumentContext;exports.useOpenAPIDocumentContext=e.useOpenAPIDocumentContext;exports.useOperationTabPlugins=e.useOperationTabPlugins;exports.usePluginSlot=e.usePluginSlot;
@@ -1,43 +1,48 @@
1
- import { A as e, f as n, j as o, k as A, l as r, m as t, n as P, p, E as c, O as I, q as d, s as u, t as m, v as i, w as y, x as O, y as l, P as T, S, z as g, B as k, D as f, F as w, A as M, G as h, H as x, I as D, J as v, K as R, o as C, L as E, M as b, N as L, Q as B, R as F, T as W, u as j, U as q, V as z, W as G } from "./index-Dbr8eb7Z.js";
1
+ import { A as e, f as n, j as o, k as A, l as r, m as t, n as P, p, q as c, s as I, E as d, O as u, t as i, v as m, w as O, x as y, y as l, z as S, B as T, D as g, F as k, P as h, S as M, G as f, H as w, I as x, J as D, K as v, A as E, L as R, M as b, N as C, Q as L, R as W, o as B, T as F, U as j, V as q, W as z, Y as G, Z as H, u as J, _ as K, $ as N, a0 as Q } from "./index-CT7jUAdL.js";
2
2
  export {
3
3
  e as AsyncAPI,
4
4
  n as AsyncAPIInfo,
5
- o as AsyncAPIMessages,
6
- A as AsyncAPIOperations,
7
- r as AsyncAPIProvider,
8
- t as AsyncAPIRenderer,
9
- P as AsyncAPISchemas,
10
- p as AsyncAPIServers,
11
- c as ErrorBoundary,
12
- I as OpenAPI,
13
- d as OpenAPIEndpoints,
14
- u as OpenAPIInfo,
15
- m as OpenAPIProvider,
16
- i as OpenAPIRenderer,
17
- y as OpenAPISchemas,
18
- O as OpenAPIServers,
19
- l as OpenAPIWebhooks,
20
- T as PluginSlot,
21
- S as SchemaTab,
22
- g as SchemaTree,
23
- k as Schemas,
24
- f as asyncApiOperationToMarkdown,
25
- w as asyncApiToMarkdown,
26
- M as default,
27
- h as defaultConfig,
28
- x as documentToLlmsTxt,
29
- D as documentToMarkdown,
30
- v as listDocumentTargets,
31
- R as markdownForLlm,
32
- C as openApiEndpointToMarkdown,
33
- E as openApiToMarkdown,
34
- b as parseAndRender,
35
- L as parseAndRenderOpenAPI,
36
- B as targetSlug,
37
- F as useAsyncAPIDocument,
38
- W as useAsyncAPIDocumentContext,
39
- j as useDocumentContext,
40
- q as useOpenAPIDocumentContext,
41
- z as useOperationTabPlugins,
42
- G as usePluginSlot
5
+ o as AsyncAPIMessage,
6
+ A as AsyncAPIMessages,
7
+ r as AsyncAPIOperation,
8
+ t as AsyncAPIOperations,
9
+ P as AsyncAPIProvider,
10
+ p as AsyncAPIRenderer,
11
+ c as AsyncAPISchemas,
12
+ I as AsyncAPIServers,
13
+ d as ErrorBoundary,
14
+ u as OpenAPI,
15
+ i as OpenAPIEndpoint,
16
+ m as OpenAPIEndpoints,
17
+ O as OpenAPIInfo,
18
+ y as OpenAPIProvider,
19
+ l as OpenAPIRenderer,
20
+ S as OpenAPISchemas,
21
+ T as OpenAPIServers,
22
+ g as OpenAPIWebhook,
23
+ k as OpenAPIWebhooks,
24
+ h as PluginSlot,
25
+ M as Schema,
26
+ f as SchemaTab,
27
+ w as SchemaTree,
28
+ x as Schemas,
29
+ D as asyncApiOperationToMarkdown,
30
+ v as asyncApiToMarkdown,
31
+ E as default,
32
+ R as defaultConfig,
33
+ b as documentToLlmsTxt,
34
+ C as documentToMarkdown,
35
+ L as listDocumentTargets,
36
+ W as markdownForLlm,
37
+ B as openApiEndpointToMarkdown,
38
+ F as openApiToMarkdown,
39
+ j as parseAndRender,
40
+ q as parseAndRenderOpenAPI,
41
+ z as targetSlug,
42
+ G as useAsyncAPIDocument,
43
+ H as useAsyncAPIDocumentContext,
44
+ J as useDocumentContext,
45
+ K as useOpenAPIDocumentContext,
46
+ N as useOperationTabPlugins,
47
+ Q as usePluginSlot
43
48
  };
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ interface ItemCardProps {
3
+ /** The item's identity row: what the list's side panel shows as its title. */
4
+ title: ReactNode;
5
+ /** Rendered at the end of the title row, e.g. the Try-it button. */
6
+ headerActions?: ReactNode;
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * The inline frame a single-item section (one endpoint, one operation) renders
11
+ * its detail in: the same header row and body padding as SidePanel, laid out
12
+ * in the page flow instead of a drawer, so the detail reads identically in
13
+ * both places.
14
+ */
15
+ export default function ItemCard({ title, headerActions, children }: ItemCardProps): import('react').JSX.Element;
16
+ export {};
@@ -5,28 +5,31 @@ import { ErrorInfo, ReactNode } from 'react';
5
5
  import { ApiuikitPlugin } from '../../plugins/types';
6
6
  import { LayoutProps } from './Layout';
7
7
  export interface IAsyncAPIProps {
8
- /** A pre-resolved AsyncAPI 3.0 document object, or one that still contains `$ref`s. */
8
+ /** The parsed AsyncAPI JSON, for example a JSON file you imported. `$ref`s in the object are resolved for you. */
9
9
  asyncapi: AsyncAPIDocumentData;
10
- /** UI configuration: theme, which sections to show, sidebar options, and more. */
10
+ /** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
11
11
  config?: ConfigInterface;
12
- /** Third-party plugins (e.g. a "try it out" panel) to render into this document's extension slots. */
12
+ /** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
13
13
  plugins?: ApiuikitPlugin[];
14
- /** Promise that `asyncapi` is already fully dereferenced upstream. Verified rather than trusted: `$ref`s left in place are still resolved either way, with a console warning that the promise was false. */
14
+ /**
15
+ * Pass `"resolved"` when the document is already fully dereferenced.
16
+ * Leftover `$ref`s are still resolved, and a warning is logged.
17
+ * See [Without Parser](https://apiuikit.com/docs/no-parser).
18
+ */
15
19
  kind?: "resolved";
16
- /** Custom UI shown if rendering this document throws. Defaults to a built-in fallback. */
20
+ /** UI shown if rendering throws. A built-in fallback is used when this is omitted. */
17
21
  errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
18
- /** Called once when a render error is caught, e.g. to report it to your own logging/telemetry. */
22
+ /** Called when rendering throws, for example to report it to your own logging. */
19
23
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
20
- /** Selection (nav tab + operation/message/schema/server key) to seed on mount, e.g. parsed from a URL. Applied once. */
24
+ /** Which tab and item to select on first render, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
21
25
  initialLocation?: LayoutProps["initialLocation"];
22
- /** Fired whenever the selected tab/item changes, e.g. to keep a URL in sync. */
26
+ /** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
23
27
  onLocationChange?: LayoutProps["onLocationChange"];
24
28
  }
25
29
  /**
26
- * Renders a full AsyncAPI documentation page: sidebar navigation, search,
27
- * servers, operations, messages, and schemas. Pass a pre-resolved (or
28
- * `$ref`-carrying) document object; for raw YAML/JSON strings, use
29
- * `AsyncAPIRenderer` instead, which parses first.
30
+ * A full AsyncAPI documentation page: sidebar, search, servers, operations,
31
+ * messages, and schemas. Pass `asyncapi` the parsed JSON. For a YAML or JSON
32
+ * string, use AsyncAPIRenderer, which parses the text first.
30
33
  */
31
34
  declare const AsyncAPI: (props: IAsyncAPIProps) => import('react').JSX.Element;
32
35
  export default AsyncAPI;
@@ -4,28 +4,34 @@ import { ErrorBoundaryFallbackRenderer } from '../../components/ErrorBoundary';
4
4
  import { ErrorInfo, ReactNode } from 'react';
5
5
  import { ApiuikitPlugin } from '../../plugins/types';
6
6
  interface AsyncAPIRendererProps {
7
- /** Raw AsyncAPI document as a YAML or JSON string, parsed and validated internally via `@asyncapi/parser`. */
7
+ /** The AsyncAPI document as a YAML or JSON string. It is parsed before the page renders. */
8
8
  raw: string;
9
- /** UI configuration: theme, which sections to show, sidebar options, and more. */
9
+ /** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
10
10
  config?: ConfigInterface;
11
- /** Third-party plugins (e.g. a "try it out" panel) to render into this document's extension slots. */
11
+ /** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
12
12
  plugins?: ApiuikitPlugin[];
13
- /** Called with the parser's diagnostics (errors/warnings) after each parse attempt. */
13
+ /**
14
+ * Called with parser errors and warnings after each parse.
15
+ * A document that fails to parse does not render a page; this is where you hear about it.
16
+ * See [With Parser](https://apiuikit.com/docs/with-parser).
17
+ */
14
18
  onDiagnostics?: (diagnostics: unknown[]) => void;
15
- /** Custom UI shown if rendering the parsed document throws. Defaults to a built-in fallback. */
19
+ /** UI shown if rendering the parsed document throws. A built-in fallback is used when this is omitted. */
16
20
  errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
17
- /** Called once when a render error is caught. Parse failures arrive via `onDiagnostics` instead: an error boundary only sees synchronous render errors. */
21
+ /**
22
+ * Called when rendering throws, for example to report it to your own logging.
23
+ * Parse failures are reported through `onDiagnostics` instead.
24
+ */
18
25
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
19
- /** Selection (nav tab + operation/message/schema/server key) to seed once the parsed document first mounts, e.g. parsed from a URL. */
26
+ /** Which tab and item to select once the parsed document first renders, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
20
27
  initialLocation?: IAsyncAPIProps["initialLocation"];
21
- /** Fired whenever the selected tab/item changes, e.g. to keep a URL in sync. */
28
+ /** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
22
29
  onLocationChange?: IAsyncAPIProps["onLocationChange"];
23
30
  }
24
31
  /**
25
- * Parses a raw AsyncAPI YAML/JSON string (via `@asyncapi/parser`) and renders
26
- * the same full documentation page as `AsyncAPI`. Use this when you have a
27
- * document as text rather than a pre-parsed object, e.g. user-entered or
28
- * loaded from a file at runtime.
32
+ * The same full AsyncAPI page as AsyncAPI, starting from the document as text.
33
+ * Pass `raw` a YAML or JSON string. Parser errors and warnings are handed to
34
+ * `onDiagnostics`.
29
35
  */
30
36
  export declare function AsyncAPIRenderer({ raw, config, plugins, onDiagnostics, errorFallback, onError, initialLocation, onLocationChange, }: AsyncAPIRendererProps): import('react').JSX.Element | null;
31
37
  export {};
@@ -0,0 +1,15 @@
1
+ import { SectionLayout } from '../../components/Section';
2
+ import { MessageObject } from '../../types/asyncapi/MessageObject';
3
+ interface MessageCardProps {
4
+ messageKey: string;
5
+ message: MessageObject;
6
+ layout?: SectionLayout;
7
+ }
8
+ /**
9
+ * One `components.messages` entry rendered on its own: the same name, key,
10
+ * summary and badges a row of the Messages table shows, with its details
11
+ * (description, payload/headers, tags) open from the start — a lone message
12
+ * has no list to keep compact.
13
+ */
14
+ export default function MessageCard({ messageKey, message, layout }: MessageCardProps): import('react').JSX.Element;
15
+ export {};
@@ -5,28 +5,32 @@ import { ErrorInfo, ReactNode } from 'react';
5
5
  import { ApiuikitPlugin } from '../../plugins/types';
6
6
  import { OpenAPILayoutProps } from './Layout';
7
7
  export interface IOpenAPIProps {
8
- /** A pre-resolved OpenAPI 3.0/3.1 document object, or one that still contains `$ref`s. */
8
+ /** The parsed OpenAPI JSON, for example a JSON file you imported. `$ref`s in the object are resolved for you. */
9
9
  openapi: OpenAPIDocumentData;
10
- /** UI configuration: theme, which sections to show, sidebar options, and more. */
10
+ /** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
11
11
  config?: ConfigInterface;
12
- /** Third-party plugins (e.g. a "try it out" panel) to render into this document's extension slots. */
12
+ /** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
13
13
  plugins?: ApiuikitPlugin[];
14
- /** Promise that `openapi` is already fully dereferenced upstream. Verified rather than trusted: `$ref`s left in place are still resolved either way, with a console warning that the promise was false. */
14
+ /**
15
+ * Pass `"resolved"` when the document is already fully dereferenced.
16
+ * Leftover `$ref`s are still resolved, and a warning is logged.
17
+ * See [Without Parser](https://apiuikit.com/docs/no-parser).
18
+ */
15
19
  kind?: "resolved";
16
- /** Custom UI shown if rendering this document throws. Defaults to a built-in fallback. */
20
+ /** UI shown if rendering throws. A built-in fallback is used when this is omitted. */
17
21
  errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
18
- /** Called once when a render error is caught, e.g. to report it to your own logging/telemetry. */
22
+ /** Called when rendering throws, for example to report it to your own logging. */
19
23
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
20
- /** Selection (nav tab + endpoint/webhook/schema/server key) to seed on mount, e.g. parsed from a URL. Applied once. */
24
+ /** Which tab and item to select on first render, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
21
25
  initialLocation?: OpenAPILayoutProps["initialLocation"];
22
- /** Fired whenever the selected tab/item changes, e.g. to keep a URL in sync. */
26
+ /** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
23
27
  onLocationChange?: OpenAPILayoutProps["onLocationChange"];
24
28
  }
25
29
  /**
26
- * Renders a full OpenAPI documentation page: sidebar navigation, search,
27
- * servers, endpoints, and schemas. Pass a pre-resolved (or `$ref`-carrying)
28
- * document object; for raw YAML/JSON strings, use `OpenAPIRenderer` instead,
29
- * which parses first.
30
+ * A full OpenAPI documentation page: sidebar, search, servers, endpoints, and
31
+ * schemas. Webhooks appear when the document declares them. Pass `openapi` the
32
+ * parsed JSON. For a YAML or JSON string, use OpenAPIRenderer, which parses
33
+ * the text first.
30
34
  */
31
35
  declare const OpenAPI: (props: IOpenAPIProps) => import('react').JSX.Element;
32
36
  export default OpenAPI;
@@ -4,28 +4,34 @@ import { ErrorBoundaryFallbackRenderer } from '../../components/ErrorBoundary';
4
4
  import { ErrorInfo, ReactNode } from 'react';
5
5
  import { ApiuikitPlugin } from '../../plugins/types';
6
6
  interface OpenAPIRendererProps {
7
- /** Raw OpenAPI document as a YAML or JSON string, parsed and validated internally via `@readme/openapi-parser`. */
7
+ /** The OpenAPI document as a YAML or JSON string. It is parsed before the page renders. */
8
8
  raw: string;
9
- /** UI configuration: theme, which sections to show, sidebar options, and more. */
9
+ /** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
10
10
  config?: ConfigInterface;
11
- /** Third-party plugins (e.g. a "try it out" panel) to render into this document's extension slots. */
11
+ /** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
12
12
  plugins?: ApiuikitPlugin[];
13
- /** Called with the parser's diagnostics (errors/warnings) after each parse attempt. */
13
+ /**
14
+ * Called with parser errors and warnings after each parse.
15
+ * A document that fails to parse does not render a page; this is where you hear about it.
16
+ * See [With Parser](https://apiuikit.com/docs/with-parser).
17
+ */
14
18
  onDiagnostics?: (diagnostics: unknown[]) => void;
15
- /** Custom UI shown if rendering the parsed document throws. Defaults to a built-in fallback. */
19
+ /** UI shown if rendering the parsed document throws. A built-in fallback is used when this is omitted. */
16
20
  errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
17
- /** Called once when a render error is caught. Parse failures arrive via `onDiagnostics` instead: an error boundary only sees synchronous render errors. */
21
+ /**
22
+ * Called when rendering throws, for example to report it to your own logging.
23
+ * Parse failures are reported through `onDiagnostics` instead.
24
+ */
18
25
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
19
- /** Selection (nav tab + endpoint/webhook/schema/server key) to seed once the parsed document first mounts, e.g. parsed from a URL. */
26
+ /** Which tab and item to select once the parsed document first renders, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
20
27
  initialLocation?: IOpenAPIProps["initialLocation"];
21
- /** Fired whenever the selected tab/item changes, e.g. to keep a URL in sync. */
28
+ /** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
22
29
  onLocationChange?: IOpenAPIProps["onLocationChange"];
23
30
  }
24
31
  /**
25
- * Parses a raw OpenAPI YAML/JSON string (via `@readme/openapi-parser`) and
26
- * renders the same full documentation page as `OpenAPI`. Use this when you
27
- * have a document as text rather than a pre-parsed object, e.g. user-entered
28
- * or loaded from a file at runtime.
32
+ * The same full OpenAPI page as OpenAPI, starting from the document as text.
33
+ * Pass `raw` a YAML or JSON string. Parser errors and warnings are handed to
34
+ * `onDiagnostics`.
29
35
  */
30
36
  export declare function OpenAPIRenderer({ raw, config, plugins, onDiagnostics, errorFallback, onError, initialLocation, onLocationChange, }: OpenAPIRendererProps): import('react').JSX.Element | null;
31
37
  export {};
@@ -0,0 +1,13 @@
1
+ import { SectionLayout } from '../../components/Section';
2
+ import { Operation as OperationType } from '../../types/asyncapi/Operation';
3
+ interface OperationCardProps {
4
+ operationKey: string;
5
+ op: OperationType;
6
+ layout?: SectionLayout;
7
+ }
8
+ /**
9
+ * One AsyncAPI operation rendered inline: the header and detail the list's
10
+ * side panel shows for it (Operations.tsx), framed as a card in the page flow.
11
+ */
12
+ export default function OperationCard({ operationKey, op, layout }: OperationCardProps): import('react').JSX.Element;
13
+ export {};
@@ -0,0 +1,18 @@
1
+ import { Operation as OperationType } from '../../types/asyncapi/Operation';
2
+ /**
3
+ * An operation's identity: action badge and channel address. Shared by the
4
+ * list's side-panel title (Operations.tsx) and the inline single-operation
5
+ * card. Falls back to the operation key for a channel without an address.
6
+ */
7
+ export declare function OperationTitle({ op, operationKey }: {
8
+ op: OperationType;
9
+ operationKey: string;
10
+ }): import('react').JSX.Element;
11
+ /**
12
+ * The built-in WebSocket Try-it button for an operation, or nothing while
13
+ * `show.tryIt` is off. The button itself renders nothing for an operation
14
+ * with no WebSocket server, so non-WS documents get an unchanged header.
15
+ */
16
+ export declare function OperationHeaderActions({ operationKey }: {
17
+ operationKey: string;
18
+ }): import('react').JSX.Element | null;
@@ -0,0 +1,23 @@
1
+ import { SectionLayout } from '../../components/Section';
2
+ import { HttpMethod, OpenAPIPathItemData, OpenAPISecuritySchemeData } from '../../types/openapi';
3
+ interface EndpointProps {
4
+ method: HttpMethod;
5
+ path: string;
6
+ /** The Path Item `path` lives under; its shared parameters merge into the operation's. */
7
+ pathItem: OpenAPIPathItemData;
8
+ /** Every path in the same list, so response links can tell whether their target operationId exists. */
9
+ paths: Record<string, OpenAPIPathItemData | undefined>;
10
+ security?: Array<Record<string, string[]>>;
11
+ securitySchemes?: Record<string, OpenAPISecuritySchemeData>;
12
+ /** Prefix for DOM anchor ids — "webhook" for webhooks, as in Paths.tsx. */
13
+ idPrefix?: string;
14
+ /** Called when a response link to another operation is followed. Without it, links render as plain text. */
15
+ onNavigate?: (operationId: string) => void;
16
+ layout?: SectionLayout;
17
+ }
18
+ /**
19
+ * One endpoint (or webhook) rendered inline: the header and detail the list's
20
+ * side panel shows for it (Paths.tsx), framed as a card in the page flow.
21
+ */
22
+ export default function Endpoint({ method, path, pathItem, paths, security, securitySchemes, idPrefix, onNavigate, layout, }: EndpointProps): import('react').JSX.Element | null;
23
+ export {};
@@ -0,0 +1,21 @@
1
+ import { HttpMethod, OpenAPIParameterData } from '../../types/openapi';
2
+ /**
3
+ * An endpoint's identity: method badge, path, query-parameter chip. The path
4
+ * keeps the room and clips to a single line (its ellipsis peeks the whole
5
+ * thing); the query parameters — the part that actually ran the header long —
6
+ * sit beside it as a chip. Shared by the list's side-panel title (Paths.tsx)
7
+ * and the inline single-endpoint card (Endpoint.tsx).
8
+ */
9
+ export declare function EndpointTitle({ method, path, parameters, }: {
10
+ method: HttpMethod;
11
+ path: string;
12
+ parameters: OpenAPIParameterData[];
13
+ }): import('react').JSX.Element;
14
+ /**
15
+ * The built-in Try-it button for an endpoint, or nothing while `show.tryIt`
16
+ * is off or the ambient document isn't an OpenAPI one.
17
+ */
18
+ export declare function EndpointHeaderActions({ method, path }: {
19
+ method: HttpMethod;
20
+ path: string;
21
+ }): import('react').JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { ResolvedSchemaInput } from '../../helpers/schemaFormat';
2
+ interface SchemaCardProps {
3
+ schemaName: string;
4
+ /** The entry after resolveSchemaInput — multi-format wrappers normalized for rendering. */
5
+ resolved: ResolvedSchemaInput;
6
+ /** DOM id for search/sidebar anchors. The list uses `schema-<name>`; a standalone card has none by default so it can't collide with the list's. */
7
+ anchorId?: string;
8
+ /** Highlights the card, and lets `focusTarget` reach into its tree. */
9
+ selected?: boolean;
10
+ /** The precisely-matched nested node search navigated to, if any — see Layout.tsx. */
11
+ focusTarget?: {
12
+ tokens: string[];
13
+ id: string;
14
+ } | null;
15
+ }
16
+ /** One `components.schemas` entry: name, description, badges, and its tree. */
17
+ export default function SchemaCard({ schemaName, resolved, anchorId, selected, focusTarget }: SchemaCardProps): import('react').JSX.Element;
18
+ export {};
@@ -0,0 +1,21 @@
1
+ import { HttpMethod, OpenAPIPathItemData } from '../types/openapi';
2
+ /** How a single-endpoint section names its endpoint: by `operationId`, or by method + path. */
3
+ export type EndpointSelector = {
4
+ operationId: string;
5
+ } | {
6
+ method: HttpMethod;
7
+ path: string;
8
+ };
9
+ export interface FoundEndpoint {
10
+ method: HttpMethod;
11
+ path: string;
12
+ pathItem: OpenAPIPathItemData;
13
+ }
14
+ /**
15
+ * Finds one endpoint in a `paths` (or `webhooks`) map. Method matching is
16
+ * case-insensitive, since `"GET"` is what people tend to type and the map
17
+ * keys are lowercase. Returns null when nothing matches.
18
+ */
19
+ export declare function findEndpoint(paths: Record<string, OpenAPIPathItemData | undefined>, selector: EndpointSelector): FoundEndpoint | null;
20
+ /** A readable form of a selector, for "not found" warnings. */
21
+ export declare function describeEndpointSelector(selector: EndpointSelector): string;
@@ -0,0 +1,5 @@
1
+ import { ChannelAddressParameterDetail } from '../components/ChannelAddress';
2
+ import { QueryParameterDetail } from '../components/QueryParameters';
3
+ import { OpenAPIParameterData } from '../types/openapi';
4
+ export declare function toChannelAddressParameters(parameters: OpenAPIParameterData[]): Record<string, ChannelAddressParameterDetail>;
5
+ export declare function toQueryParameters(parameters: OpenAPIParameterData[]): QueryParameterDetail[];