apiuikit 1.9.0 → 1.10.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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("react/jsx-runtime"),ne=require("react"),D=require("./index-BaryvbmB.cjs");function Gr(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"]}:Gr(s,e)}return{...t,properties:r}}finally{e.delete(t)}}return t}async function En(t){try{const{generate:e}=await Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs"));return await e(Gr(t),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const rr="",nr=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("react/jsx-runtime"),ne=require("react"),D=require("./index-BxJoqAOy.cjs");function Gr(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"]}:Gr(s,e)}return{...t,properties:r}}finally{e.delete(t)}}return t}async function En(t){try{const{generate:e}=await Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs"));return await e(Gr(t),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const rr="",nr=`
2
2
  `;var E=class{constructor({indent:t,join:e}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=rr,this.lineJoin=nr,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||rr,this.lineJoin=e??nr}},jn=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Pn=function(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.default=t=>Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e));const Cn=jn,kn=Pn,An=Kt.default;var Rn=(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 nr, jsx as Ne } from "react/jsx-runtime";
2
2
  import { useId as kn, useMemo as ze, useState as gt, useEffect as or } from "react";
3
- import { g as An, c as rt, a as Rn, u as Nn, b as ir, e as qn, o as _n, C as Ln, h as In } from "./index-BW_gDunt.js";
3
+ import { g as An, c as rt, a as Rn, u as Nn, b as ir, e as qn, o as _n, C as Ln, h as In } from "./index-BKChiodv.js";
4
4
  function Kr(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,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { d as l } from "./index-BW_gDunt.js";
2
+ import { d as l } from "./index-BKChiodv.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.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-BaryvbmB.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-BxJoqAOy.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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-BaryvbmB.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-BxJoqAOy.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,4 +1,4 @@
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-BW_gDunt.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, 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-BKChiodv.js";
2
2
  export {
3
3
  e as AsyncAPI,
4
4
  n as AsyncAPIInfo,
@@ -3,6 +3,7 @@ import { OpenAPIDocumentData } from '../types/openapi';
3
3
  import { ConfigInterface, MarkdownUrlResolver, SidePanelContainment } from '../config/config';
4
4
  import { ApiuikitPlugin } from '../plugins/types';
5
5
  import { PluginSlotRegistry } from '../plugins/registry';
6
+ import { ResolvedThemeMode } from '../utils/theme';
6
7
  /** Which spec produced the ambient document. The discriminant of DocumentContextValue. */
7
8
  export type SpecType = "asyncapi" | "openapi";
8
9
  interface DocumentContextBase {
@@ -33,6 +34,16 @@ interface DocumentContextBase {
33
34
  pluginSlotRegistry?: PluginSlotRegistry;
34
35
  /** The host's as-given `config` prop, unmerged with defaults. For plugins; prefer the derived fields above for apiuikit's own UI. Theme colors: use the CSS custom properties on the document root (see Plugins docs), not `config.theme`. */
35
36
  config?: ConfigInterface;
37
+ /**
38
+ * Which palette is actually rendering right now ("light" or "dark"),
39
+ * already resolved from `config.theme.mode`/`light`/`dark` and, for
40
+ * `mode: "system"`, the OS preference. Plugins that read raw hex values out
41
+ * of `config.theme` (rather than the CSS custom properties, per the note
42
+ * above) need this to know which of `theme.light`/`theme.dark` is active —
43
+ * `config.theme` alone doesn't say, since both may legitimately be set at
44
+ * once and `mode` decides.
45
+ */
46
+ resolvedMode: ResolvedThemeMode;
36
47
  }
37
48
  export interface AsyncAPIDocumentContextValue extends DocumentContextBase {
38
49
  specType: "asyncapi";
@@ -29,6 +29,7 @@ export declare function useDocumentProviderValue<S extends SpecType, D extends o
29
29
  plugins: ApiuikitPlugin[];
30
30
  pluginSlotRegistry: import('../plugins/registry').PluginSlotRegistry;
31
31
  config: ConfigInterface;
32
+ resolvedMode: import('../utils/theme').ResolvedThemeMode;
32
33
  };
33
34
  themeVars: Record<string, string>;
34
35
  resolvedMode: import('../utils/theme').ResolvedThemeMode;