fumadocs-openapi 10.1.4 → 10.2.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.
Files changed (38) hide show
  1. package/dist/playground/client.js +2 -2
  2. package/dist/playground/components/inputs.js +2 -2
  3. package/dist/playground/components/oauth-dialog.js +1 -1
  4. package/dist/playground/components/server-select.js +1 -1
  5. package/dist/playground/status-info.js +1 -1
  6. package/dist/scalar/client.js +1 -1
  7. package/dist/server/source-api.d.ts +5 -1
  8. package/dist/server/source-api.d.ts.map +1 -1
  9. package/dist/server/source-api.js +25 -20
  10. package/dist/ui/api-page.d.ts +1 -1
  11. package/dist/ui/api-page.d.ts.map +1 -1
  12. package/dist/ui/components/accordion.js +3 -3
  13. package/dist/ui/components/dialog.js +2 -2
  14. package/dist/ui/components/input.js +1 -1
  15. package/dist/ui/components/method-label.js +1 -1
  16. package/dist/ui/components/select.js +2 -2
  17. package/dist/ui/icons.d.ts +49 -0
  18. package/dist/ui/icons.d.ts.map +1 -0
  19. package/dist/ui/icons.js +281 -0
  20. package/dist/ui/operation/client.js +2 -2
  21. package/dist/ui/operation/index.js +1 -1
  22. package/dist/ui/schema/client.d.ts.map +1 -1
  23. package/dist/ui/schema/client.js +21 -21
  24. package/dist/ui/schema/index.d.ts.map +1 -1
  25. package/dist/ui/schema/index.js +12 -19
  26. package/dist/utils/cn.d.ts +2 -0
  27. package/dist/utils/cn.d.ts.map +1 -0
  28. package/dist/utils/cn.js +1 -0
  29. package/dist/utils/pages/to-static-data.d.ts +10 -0
  30. package/dist/utils/pages/to-static-data.d.ts.map +1 -0
  31. package/dist/utils/pages/to-static-data.js +41 -0
  32. package/dist/utils/pages/to-text.d.ts.map +1 -1
  33. package/dist/utils/pages/to-text.js +2 -33
  34. package/dist/utils/schema-to-string.js +3 -3
  35. package/package.json +7 -6
  36. package/dist/icons.d.ts +0 -2
  37. package/dist/icons.d.ts.map +0 -1
  38. package/dist/icons.js +0 -1
@@ -10,10 +10,10 @@ import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
10
10
  import { MethodLabel } from '../ui/components/method-label.js';
11
11
  import { useQuery } from '../utils/use-query.js';
12
12
  import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from 'fumadocs-ui/components/ui/collapsible';
13
- import { X, ChevronDown, LoaderCircle } from '../icons.js';
13
+ import { X, ChevronDown, LoaderCircle } from '../ui/icons.js';
14
14
  import { encodeRequestData } from '../requests/media/encode.js';
15
15
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
16
- import { cn } from 'fumadocs-ui/utils/cn';
16
+ import { cn } from '../utils/cn.js';
17
17
  import { SchemaProvider, useResolvedSchema, } from '../playground/schema.js';
18
18
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../ui/components/select.js';
19
19
  import { labelVariants } from '../ui/components/input.js';
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useState, } from 'react';
4
- import { ChevronDown, Plus, Trash2, X } from '../../icons.js';
4
+ import { ChevronDown, Plus, Trash2, X } from '../../ui/icons.js';
5
5
  import { useController, useFieldArray, useFormContext } from 'react-hook-form';
6
6
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../ui/components/select.js';
7
7
  import { Input, labelVariants } from '../../ui/components/input.js';
8
8
  import { getDefaultValue } from '../get-default-values.js';
9
- import { cn } from 'fumadocs-ui/utils/cn';
9
+ import { cn } from '../../utils/cn.js';
10
10
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
11
11
  import { FormatFlags, schemaToString } from '../../utils/schema-to-string.js';
12
12
  import { anyFields, useFieldInfo, useResolvedSchema, useSchemaScope, } from '../../playground/schema.js';
@@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';
4
4
  import { Input, labelVariants } from '../../ui/components/input.js';
5
5
  import { useQuery } from '../../utils/use-query.js';
6
6
  import { useEffect, useState } from 'react';
7
- import { cn } from 'fumadocs-ui/utils/cn';
7
+ import { cn } from '../../utils/cn.js';
8
8
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
9
9
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../ui/components/select.js';
10
10
  const FlowTypes = {
@@ -4,7 +4,7 @@ import { useApiContext, useServerSelectContext } from '../../ui/contexts/api.js'
4
4
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../ui/components/select.js';
5
5
  import { Input, labelVariants } from '../../ui/components/input.js';
6
6
  import { useEffect, useState, useEffectEvent, } from 'react';
7
- import { cn } from 'fumadocs-ui/utils/cn';
7
+ import { cn } from '../../utils/cn.js';
8
8
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from '../../ui/components/dialog.js';
9
9
  import { resolveServerUrl, withBase } from '../../utils/url.js';
10
10
  import { FormProvider, useController, useForm } from 'react-hook-form';
@@ -1,4 +1,4 @@
1
- import { CircleCheck, CircleX } from '../icons.js';
1
+ import { CircleCheck, CircleX } from '../ui/icons.js';
2
2
  const statusMap = {
3
3
  400: { description: 'Bad Request', color: 'text-red-500', icon: CircleX },
4
4
  401: {
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from 'fumadocs-ui/utils/cn';
3
+ import { cn } from '../utils/cn.js';
4
4
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
5
5
  import { ApiClientModalProvider, useApiClientModal, } from '@scalar/api-client-react';
6
6
  import { MethodLabel } from '../ui/components/method-label.js';
@@ -2,6 +2,8 @@ import type { LoaderPlugin, MetaData, PageData, PageTreeTransformer, Source } fr
2
2
  import type { OpenAPIServer } from '../server/create.js';
3
3
  import type { SchemaToPagesOptions } from '../utils/pages/preset-auto.js';
4
4
  import type { ApiPageProps } from '../ui/api-page.js';
5
+ import type { StructuredData } from 'fumadocs-core/mdx-plugins';
6
+ import type { TOCItemType } from 'fumadocs-core/toc';
5
7
  declare module 'fumadocs-core/source' {
6
8
  interface PageData {
7
9
  /**
@@ -20,11 +22,13 @@ export interface InternalOpenAPIMeta {
20
22
  export declare function openapiPlugin(): LoaderPlugin;
21
23
  interface OpenAPIPageData extends PageData {
22
24
  getAPIPageProps: () => ApiPageProps;
25
+ structuredData: StructuredData;
26
+ toc: TOCItemType[];
23
27
  }
24
28
  /**
25
29
  * Generate virtual pages for Fumadocs Source API
26
30
  */
27
- export declare function openapiSource(from: OpenAPIServer, options?: SchemaToPagesOptions & {
31
+ export declare function openapiSource(server: OpenAPIServer, options?: SchemaToPagesOptions & {
28
32
  baseDir?: string;
29
33
  }): Promise<Source<{
30
34
  metaData: MetaData;
@@ -1 +1 @@
1
- {"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,MAAM,EAEP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAiB,QAAQ;QACvB;;WAEG;QACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;KAChC;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,CAqC5C;AAED,UAAU,eAAgB,SAAQ,QAAQ;IACxC,eAAe,EAAE,MAAM,YAAY,CAAC;CACrC;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,aAAa,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AAE,MAAM,CAAC;CACb,GACL,OAAO,CACR,MAAM,CAAC;IACL,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC,CACH,CAyCA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,mBAAmB,CAExD"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MethodLabel } from '../ui/components/method-label.js';
3
+ import { toStaticData } from '../utils/pages/to-static-data.js';
3
4
  /**
4
5
  * Fumadocs Source API integration, pass this to `plugins` array in `loader()`.
5
6
  */
@@ -31,32 +32,36 @@ export function openapiPlugin() {
31
32
  /**
32
33
  * Generate virtual pages for Fumadocs Source API
33
34
  */
34
- export async function openapiSource(from, options = {}) {
35
+ export async function openapiSource(server, options = {}) {
35
36
  const { baseDir = '' } = options;
36
37
  const { createAutoPreset } = await import('../utils/pages/preset-auto.js');
37
38
  const { fromServer } = await import('../utils/pages/builder.js');
38
39
  const { toBody } = await import('../utils/pages/to-body.js');
39
40
  const files = [];
40
- const entries = await fromServer(from, createAutoPreset(options));
41
- for (const entry of Object.values(entries).flat()) {
42
- files.push({
43
- type: 'page',
44
- path: `${baseDir}/${entry.path}`,
45
- data: {
46
- ...entry.info,
47
- getAPIPageProps() {
48
- const props = toBody(entry);
49
- props.showDescription ?? (props.showDescription = true);
50
- return props;
41
+ const entries = await fromServer(server, createAutoPreset(options));
42
+ for (const [schemaId, list] of Object.entries(entries)) {
43
+ const dereferenced = (await server.getSchema(schemaId)).dereferenced;
44
+ for (const entry of list) {
45
+ const props = toBody(entry);
46
+ props.showDescription ?? (props.showDescription = true);
47
+ files.push({
48
+ type: 'page',
49
+ path: `${baseDir}/${entry.path}`,
50
+ data: {
51
+ ...entry.info,
52
+ getAPIPageProps() {
53
+ return props;
54
+ },
55
+ ...toStaticData(props, dereferenced),
56
+ _openapi: {
57
+ method: entry.type === 'operation' || entry.type === 'webhook'
58
+ ? entry.item.method
59
+ : undefined,
60
+ webhook: entry.type === 'webhook',
61
+ },
51
62
  },
52
- _openapi: {
53
- method: entry.type === 'operation' || entry.type === 'webhook'
54
- ? entry.item.method
55
- : undefined,
56
- webhook: entry.type === 'webhook',
57
- },
58
- },
59
- });
63
+ });
64
+ }
60
65
  }
61
66
  return {
62
67
  files,
@@ -54,7 +54,7 @@ export interface CreateAPIPageOptions {
54
54
  /**
55
55
  * @param generators - codegens for API example usages
56
56
  */
57
- renderAPIExampleUsageTabs?: (generators: CodeUsageGenerator<unknown>[], ctx: RenderContext) => Awaitable<ReactNode>;
57
+ renderAPIExampleUsageTabs?: (generators: CodeUsageGenerator[], ctx: RenderContext) => Awaitable<ReactNode>;
58
58
  /**
59
59
  * renderer of the entire page's layout (containing all operations & webhooks UI)
60
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"api-page.d.ts","sourceRoot":"","sources":["../../src/ui/api-page.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAmB,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAcjE,OAAO,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,CAAC;YACb,MAAM,EAAE,iBAAiB,CAAC;YAC1B,GAAG,EAAE,aAAa,CAAC;SACpB,KAAK,SAAS,CAAC,SAAS,CAAC,CAAC;KAC5B,CAAC;IAEF,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,MAAM,GAAG,iBAAiB,CAAC;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAE7B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC;CACjC;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,oBAAyB,GACjC,EAAE,CAAC,YAAY,CAAC,CAoFlB"}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as Primitive from '@radix-ui/react-accordion';
4
- import { ChevronRight } from '../../icons.js';
5
- import { cn } from 'fumadocs-ui/utils/cn';
4
+ import { ChevronRight } from '../../ui/icons.js';
5
+ import { cn } from '../../utils/cn.js';
6
6
  export function Accordions(props) {
7
7
  return (_jsx(Primitive.Root, { ...props, className: cn('divide-y divide-fd-border', props.className) }));
8
8
  }
@@ -16,5 +16,5 @@ export function AccordionHeader(props) {
16
16
  return (_jsx(Primitive.Header, { ...props, className: cn('not-prose flex py-2 text-fd-foreground font-medium', props.className), children: props.children }));
17
17
  }
18
18
  export function AccordionTrigger(props) {
19
- return (_jsxs(Primitive.Trigger, { ...props, className: cn('flex flex-1 items-center gap-1 text-start group/accordion focus-visible:outline-none', props.className), children: [_jsx(ChevronRight, { className: "size-3.5 text-fd-muted-foreground shrink-0 transition-transform group-data-[state=open]/accordion:rotate-90" }), props.children] }));
19
+ return (_jsxs(Primitive.Trigger, { ...props, className: cn('flex flex-1 items-center gap-1 text-start group/accordion focus-visible:outline-none', props.className), children: [_jsx(ChevronRight, { className: "size-3.5 text-fd-muted-foreground shrink-0 transition-transform group-focus-visible/accordion:text-fd-primary group-data-[state=open]/accordion:rotate-90" }), props.children] }));
20
20
  }
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from 'react';
4
4
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
- import { X } from '../../icons.js';
6
- import { cn } from 'fumadocs-ui/utils/cn';
5
+ import { X } from '../../ui/icons.js';
6
+ import { cn } from '../../utils/cn.js';
7
7
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
8
8
  const Dialog = DialogPrimitive.Root;
9
9
  const DialogTrigger = DialogPrimitive.Trigger;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
- import { cn } from 'fumadocs-ui/utils/cn';
3
+ import { cn } from '../../utils/cn.js';
4
4
  import { cva } from 'class-variance-authority';
5
5
  export const labelVariants = cva('text-xs font-medium text-fd-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70');
6
6
  const Input = React.forwardRef(({ className, type, ...props }, ref) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cva } from 'class-variance-authority';
3
- import { cn } from 'fumadocs-ui/utils/cn';
3
+ import { cn } from '../../utils/cn.js';
4
4
  export const badgeVariants = cva('font-mono font-medium', {
5
5
  variants: {
6
6
  color: {
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as SelectPrimitive from '@radix-ui/react-select';
3
- import { Check, ChevronDown, ChevronUp } from '../../icons.js';
3
+ import { Check, ChevronDown, ChevronUp } from '../../ui/icons.js';
4
4
  import { forwardRef } from 'react';
5
- import { cn } from 'fumadocs-ui/utils/cn';
5
+ import { cn } from '../../utils/cn.js';
6
6
  const Select = SelectPrimitive.Root;
7
7
  const SelectGroup = SelectPrimitive.Group;
8
8
  const SelectValue = SelectPrimitive.Value;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @license lucide-react - ISC
3
+ *
4
+ * All copyright belongs to https://github.com/lucide-icons/lucide, we bundle it as part of library to avoid upstream issues.
5
+ */
6
+ import { type ComponentProps } from 'react';
7
+ type SVGElementType = 'circle' | 'ellipse' | 'g' | 'line' | 'path' | 'polygon' | 'polyline' | 'rect';
8
+ export interface LucideProps extends ComponentProps<'svg'> {
9
+ size?: string | number;
10
+ }
11
+ export type IconNode = [
12
+ elementName: SVGElementType,
13
+ attrs: Record<string, string>
14
+ ][];
15
+ export declare const ChevronDown: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
16
+ export declare const Languages: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
17
+ export declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
18
+ export declare const ChevronsUpDown: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
19
+ export declare const Search: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
20
+ export declare const ExternalLink: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
21
+ export declare const Moon: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
22
+ export declare const Sun: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
23
+ export declare const Airplay: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
24
+ export declare const Menu: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
25
+ export declare const X: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
26
+ export declare const LoaderCircle: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
27
+ export declare const CircleCheck: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
28
+ export declare const CircleX: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
29
+ export declare const Check: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
30
+ export declare const TriangleAlert: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
31
+ export declare const Info: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
32
+ export declare const Copy: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
33
+ export declare const Clipboard: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
34
+ export declare const FileText: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
35
+ export declare const Hash: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
36
+ export declare const Text: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
37
+ export declare const File: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
38
+ export declare const Folder: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
39
+ export declare const FolderOpen: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
40
+ export declare const Star: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
41
+ export declare const Link: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
42
+ export declare const Edit: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
43
+ export declare const ChevronRight: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
44
+ export declare const ChevronLeft: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
45
+ export declare const Plus: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
46
+ export declare const Trash2: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
47
+ export declare const ChevronUp: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
48
+ export {};
49
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/ui/icons.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAC;AAcvE,KAAK,cAAc,GACf,QAAQ,GACR,SAAS,GACT,GAAG,GACH,MAAM,GACN,MAAM,GAC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AEH,eAAO,MAAM,IAAI,oHAQf,CAAC;AAEH,eAAO,MAAM,IAAI,oHAef,CAAC;AAEH,eAAO,MAAM,IAAI,oHAef,CAAC;AAEH,eAAO,MAAM,YAAY,oHAEvB,CAAC;AAEH,eAAO,MAAM,WAAW,oHAEtB,CAAC;AAEH,eAAO,MAAM,IAAI,oHAGf,CAAC;AAEH,eAAO,MAAM,MAAM,oHAMjB,CAAC;AAEH,eAAO,MAAM,SAAS,oHAEpB,CAAC"}
@@ -0,0 +1,281 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @license lucide-react - ISC
4
+ *
5
+ * All copyright belongs to https://github.com/lucide-icons/lucide, we bundle it as part of library to avoid upstream issues.
6
+ */
7
+ import { createElement, forwardRef } from 'react';
8
+ const defaultAttributes = {
9
+ xmlns: 'http://www.w3.org/2000/svg',
10
+ width: 24,
11
+ height: 24,
12
+ viewBox: '0 0 24 24',
13
+ fill: 'none',
14
+ stroke: 'currentColor',
15
+ strokeWidth: 2,
16
+ strokeLinecap: 'round',
17
+ strokeLinejoin: 'round',
18
+ };
19
+ const createLucideIcon = (iconName, iconNode) => {
20
+ const Component = forwardRef(({ size = 24, color = 'currentColor', children, ...props }, ref) => {
21
+ return (_jsxs("svg", { ref: ref, ...defaultAttributes, width: size, height: size, stroke: color, ...props, children: [iconNode.map(([tag, attr]) => createElement(tag, attr)), children] }));
22
+ });
23
+ Component.displayName = iconName;
24
+ return Component;
25
+ };
26
+ export const ChevronDown = createLucideIcon('chevron-down', [
27
+ ['path', { d: 'm6 9 6 6 6-6', key: 'qrunsl' }],
28
+ ]);
29
+ export const Languages = createLucideIcon('languages', [
30
+ ['path', { d: 'm5 8 6 6', key: '1wu5hv' }],
31
+ ['path', { d: 'm4 14 6-6 2-3', key: '1k1g8d' }],
32
+ ['path', { d: 'M2 5h12', key: 'or177f' }],
33
+ ['path', { d: 'M7 2h1', key: '1t2jsx' }],
34
+ ['path', { d: 'm22 22-5-10-5 10', key: 'don7ne' }],
35
+ ['path', { d: 'M14 18h6', key: '1m8k6r' }],
36
+ ]);
37
+ export const Sidebar = createLucideIcon('panel-left', [
38
+ [
39
+ 'rect',
40
+ { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' },
41
+ ],
42
+ ['path', { d: 'M9 3v18', key: 'fh3hqa' }],
43
+ ]);
44
+ export const ChevronsUpDown = createLucideIcon('chevrons-up-down', [
45
+ ['path', { d: 'm7 15 5 5 5-5', key: '1hf1tw' }],
46
+ ['path', { d: 'm7 9 5-5 5 5', key: 'sgt6xg' }],
47
+ ]);
48
+ export const Search = createLucideIcon('search', [
49
+ ['circle', { cx: '11', cy: '11', r: '8', key: '4ej97u' }],
50
+ ['path', { d: 'm21 21-4.3-4.3', key: '1qie3q' }],
51
+ ]);
52
+ export const ExternalLink = createLucideIcon('external-link', [
53
+ ['path', { d: 'M15 3h6v6', key: '1q9fwt' }],
54
+ ['path', { d: 'M10 14 21 3', key: 'gplh6r' }],
55
+ [
56
+ 'path',
57
+ {
58
+ d: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6',
59
+ key: 'a6xqqp',
60
+ },
61
+ ],
62
+ ]);
63
+ export const Moon = createLucideIcon('moon', [
64
+ ['path', { d: 'M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z', key: 'a7tn18' }],
65
+ ]);
66
+ export const Sun = createLucideIcon('sun', [
67
+ ['circle', { cx: '12', cy: '12', r: '4', key: '4exip2' }],
68
+ ['path', { d: 'M12 2v2', key: 'tus03m' }],
69
+ ['path', { d: 'M12 20v2', key: '1lh1kg' }],
70
+ ['path', { d: 'm4.93 4.93 1.41 1.41', key: '149t6j' }],
71
+ ['path', { d: 'm17.66 17.66 1.41 1.41', key: 'ptbguv' }],
72
+ ['path', { d: 'M2 12h2', key: '1t8f8n' }],
73
+ ['path', { d: 'M20 12h2', key: '1q8mjw' }],
74
+ ['path', { d: 'm6.34 17.66-1.41 1.41', key: '1m8zz5' }],
75
+ ['path', { d: 'm19.07 4.93-1.41 1.41', key: '1shlcs' }],
76
+ ]);
77
+ export const Airplay = createLucideIcon('airplay', [
78
+ [
79
+ 'path',
80
+ {
81
+ d: 'M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1',
82
+ key: 'ns4c3b',
83
+ },
84
+ ],
85
+ ['path', { d: 'm12 15 5 6H7Z', key: '14qnn2' }],
86
+ ]);
87
+ export const Menu = createLucideIcon('menu', [
88
+ ['line', { x1: '4', x2: '20', y1: '12', y2: '12', key: '1e0a9i' }],
89
+ ['line', { x1: '4', x2: '20', y1: '6', y2: '6', key: '1owob3' }],
90
+ ['line', { x1: '4', x2: '20', y1: '18', y2: '18', key: 'yk5zj1' }],
91
+ ]);
92
+ export const X = createLucideIcon('x', [
93
+ ['path', { d: 'M18 6 6 18', key: '1bl5f8' }],
94
+ ['path', { d: 'm6 6 12 12', key: 'd8bk6v' }],
95
+ ]);
96
+ export const LoaderCircle = createLucideIcon('loader-circle', [
97
+ ['path', { d: 'M21 12a9 9 0 1 1-6.219-8.56', key: '13zald' }],
98
+ ]);
99
+ export const CircleCheck = createLucideIcon('circle-check', [
100
+ ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],
101
+ ['path', { d: 'm9 12 2 2 4-4', key: 'dzmm74' }],
102
+ ]);
103
+ export const CircleX = createLucideIcon('circle-x', [
104
+ ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],
105
+ ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],
106
+ ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],
107
+ ]);
108
+ export const Check = createLucideIcon('check', [
109
+ ['path', { d: 'M20 6 9 17l-5-5', key: '1gmf2c' }],
110
+ ]);
111
+ export const TriangleAlert = createLucideIcon('triangle-alert', [
112
+ [
113
+ 'path',
114
+ {
115
+ d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3',
116
+ key: 'wmoenq',
117
+ },
118
+ ],
119
+ ['path', { d: 'M12 9v4', key: 'juzpu7' }],
120
+ ['path', { d: 'M12 17h.01', key: 'p32p05' }],
121
+ ]);
122
+ export const Info = createLucideIcon('info', [
123
+ ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],
124
+ ['path', { d: 'M12 16v-4', key: '1dtifu' }],
125
+ ['path', { d: 'M12 8h.01', key: 'e9boi3' }],
126
+ ]);
127
+ export const Copy = createLucideIcon('copy', [
128
+ [
129
+ 'rect',
130
+ {
131
+ width: '14',
132
+ height: '14',
133
+ x: '8',
134
+ y: '8',
135
+ rx: '2',
136
+ ry: '2',
137
+ key: '17jyea',
138
+ },
139
+ ],
140
+ [
141
+ 'path',
142
+ {
143
+ d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2',
144
+ key: 'zix9uf',
145
+ },
146
+ ],
147
+ ]);
148
+ export const Clipboard = createLucideIcon('clipboard', [
149
+ [
150
+ 'rect',
151
+ {
152
+ width: '8',
153
+ height: '4',
154
+ x: '8',
155
+ y: '2',
156
+ rx: '1',
157
+ ry: '1',
158
+ key: '1',
159
+ },
160
+ ],
161
+ [
162
+ 'path',
163
+ {
164
+ d: 'M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2',
165
+ key: '2',
166
+ },
167
+ ],
168
+ ]);
169
+ export const FileText = createLucideIcon('file-text', [
170
+ [
171
+ 'path',
172
+ {
173
+ d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z',
174
+ key: '1rqfz7',
175
+ },
176
+ ],
177
+ ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],
178
+ ['path', { d: 'M10 9H8', key: 'b1mrlr' }],
179
+ ['path', { d: 'M16 13H8', key: 't4e002' }],
180
+ ['path', { d: 'M16 17H8', key: 'z1uh3a' }],
181
+ ]);
182
+ export const Hash = createLucideIcon('hash', [
183
+ ['line', { x1: '4', x2: '20', y1: '9', y2: '9', key: '4lhtct' }],
184
+ ['line', { x1: '4', x2: '20', y1: '15', y2: '15', key: 'vyu0kd' }],
185
+ ['line', { x1: '10', x2: '8', y1: '3', y2: '21', key: '1ggp8o' }],
186
+ ['line', { x1: '16', x2: '14', y1: '3', y2: '21', key: 'weycgp' }],
187
+ ]);
188
+ export const Text = createLucideIcon('text', [
189
+ ['path', { d: 'M15 18H3', key: 'olowqp' }],
190
+ ['path', { d: 'M17 6H3', key: '16j9eg' }],
191
+ ['path', { d: 'M21 12H3', key: '2avoz0' }],
192
+ ]);
193
+ export const File = createLucideIcon('file', [
194
+ [
195
+ 'path',
196
+ {
197
+ d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z',
198
+ key: '1rqfz7',
199
+ },
200
+ ],
201
+ ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],
202
+ ]);
203
+ export const Folder = createLucideIcon('folder', [
204
+ [
205
+ 'path',
206
+ {
207
+ d: 'M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z',
208
+ key: '1kt360',
209
+ },
210
+ ],
211
+ ]);
212
+ export const FolderOpen = createLucideIcon('folder-open', [
213
+ [
214
+ 'path',
215
+ {
216
+ d: 'm6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2',
217
+ key: 'usdka0',
218
+ },
219
+ ],
220
+ ]);
221
+ export const Star = createLucideIcon('star', [
222
+ [
223
+ 'path',
224
+ {
225
+ d: 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z',
226
+ key: 'r04s7s',
227
+ },
228
+ ],
229
+ ]);
230
+ export const Link = createLucideIcon('link', [
231
+ [
232
+ 'path',
233
+ {
234
+ d: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71',
235
+ key: '1cjeqo',
236
+ },
237
+ ],
238
+ [
239
+ 'path',
240
+ {
241
+ d: 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',
242
+ key: '19qd67',
243
+ },
244
+ ],
245
+ ]);
246
+ export const Edit = createLucideIcon('square-pen', [
247
+ [
248
+ 'path',
249
+ {
250
+ d: 'M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7',
251
+ key: '1m0v6g',
252
+ },
253
+ ],
254
+ [
255
+ 'path',
256
+ {
257
+ d: 'M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z',
258
+ key: 'ohrbg2',
259
+ },
260
+ ],
261
+ ]);
262
+ export const ChevronRight = createLucideIcon('chevron-right', [
263
+ ['path', { d: 'm9 18 6-6-6-6', key: 'mthhwq' }],
264
+ ]);
265
+ export const ChevronLeft = createLucideIcon('chevron-left', [
266
+ ['path', { d: 'm15 18-6-6 6-6', key: '1wnfg3' }],
267
+ ]);
268
+ export const Plus = createLucideIcon('plus', [
269
+ ['path', { d: 'M5 12h14', key: '1ays0h' }],
270
+ ['path', { d: 'M12 5v14', key: 's699le' }],
271
+ ]);
272
+ export const Trash2 = createLucideIcon('trash-2', [
273
+ ['path', { d: 'M3 6h18', key: 'd0wm0j' }],
274
+ ['path', { d: 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6', key: '4alrt4' }],
275
+ ['path', { d: 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2', key: 'v07s0e' }],
276
+ ['line', { x1: '10', x2: '10', y1: '11', y2: '17', key: '1uufr5' }],
277
+ ['line', { x1: '14', x2: '14', y1: '11', y2: '17', key: 'xtxkd' }],
278
+ ]);
279
+ export const ChevronUp = createLucideIcon('chevron-up', [
280
+ ['path', { d: 'm18 15-6-6-6 6', key: '153udz' }],
281
+ ]);
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCopyButton } from 'fumadocs-ui/utils/use-copy-button';
4
4
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
5
- import { cn } from 'fumadocs-ui/utils/cn';
6
- import { Check, Copy } from '../../icons.js';
5
+ import { cn } from '../../utils/cn.js';
6
+ import { Check, Copy } from '../../ui/icons.js';
7
7
  import { createContext, use, useMemo, useState, } from 'react';
8
8
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../ui/components/select.js';
9
9
  export function CopyResponseTypeScript({ code }) {
@@ -9,7 +9,7 @@ import { getTypescriptSchema } from '../../utils/get-typescript-schema.js';
9
9
  import { CopyResponseTypeScript, SelectTab, SelectTabs, SelectTabTrigger, } from './client.js';
10
10
  import { AccordionContent, AccordionHeader, AccordionItem, Accordions, AccordionTrigger, } from '../../ui/components/accordion.js';
11
11
  import { isMediaTypeSupported } from '../../requests/media/adapter.js';
12
- import { cn } from 'fumadocs-ui/utils/cn';
12
+ import { cn } from '../../utils/cn.js';
13
13
  import { APIPlayground } from '../../playground/index.js';
14
14
  import { getExampleRequests, RequestTabs } from './request-tabs.js';
15
15
  import { UsageTabsProviderLazy } from './usage-tabs/lazy.js';
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/ui/schema/client.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAc,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAuDrE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAEzB,SAAS,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,QAAgB,EAChB,EAAe,EACf,SAAS,GACV,EAAE,aAAa,2CAoBf"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/ui/schema/client.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAc,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAyDrE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAEzB,SAAS,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,QAAgB,EAChB,EAAe,EACf,SAAS,GACV,EAAE,aAAa,2CAoBf"}
@@ -4,12 +4,12 @@ import { createContext, Fragment, use, useCallback, useEffect, useMemo, useRef,
4
4
  import { Tabs, TabsContent, TabsList, TabsTrigger, } from 'fumadocs-ui/components/tabs';
5
5
  import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from 'fumadocs-ui/components/ui/collapsible';
6
6
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
7
- import { ChevronDown } from '../../icons.js';
7
+ import { ChevronDown } from '../../ui/icons.js';
8
8
  import { Badge } from '../../ui/components/method-label.js';
9
9
  import { Popover, PopoverContent, PopoverTrigger, } from 'fumadocs-ui/components/ui/popover';
10
- import { cn } from 'fumadocs-ui/utils/cn';
10
+ import { cn } from '../../utils/cn.js';
11
11
  import { cva } from 'class-variance-authority';
12
- const typeVariants = cva('text-sm text-start text-fd-muted-foreground wrap-anywhere font-mono', {
12
+ const typeVariants = cva('text-sm text-start text-fd-muted-foreground font-mono', {
13
13
  variants: {
14
14
  variant: {
15
15
  trigger: 'underline hover:text-fd-accent-foreground data-[state=open]:text-fd-accent-foreground',
@@ -54,19 +54,14 @@ function SchemaUIProperty({ name, $type, overrides, }) {
54
54
  const { refs } = useData();
55
55
  const schema = refs[$type];
56
56
  let type = schema.typeName;
57
- if (schema.type === 'or' && schema.items.length > 0) {
58
- type = (_jsx("span", { className: cn(typeVariants(), 'flex flex-row gap-2 items-center'), children: schema.items.map((item, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { children: "|" }), renderRef({
59
- pathName: name,
60
- text: item.name,
61
- $ref: item.$type,
62
- })] }, item.$type))) }));
63
- }
64
- if (schema.type === 'and' && schema.items.length > 0) {
65
- type = (_jsx("span", { className: cn(typeVariants(), 'flex flex-row gap-2 items-center'), children: schema.items.map((item, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { children: "&" }), renderRef({
66
- pathName: name,
67
- text: item.name,
68
- $ref: item.$type,
69
- })] }, item.$type))) }));
57
+ if ((schema.type === 'or' || schema.type === 'and') &&
58
+ schema.items.length > 0) {
59
+ type = renderRef({
60
+ text: schema.aliasName,
61
+ pathName: name,
62
+ $ref: $type,
63
+ inlineUnion: true,
64
+ });
70
65
  }
71
66
  if (schema.type === 'object' && schema.props.length > 0) {
72
67
  type = renderRef({
@@ -78,7 +73,7 @@ function SchemaUIProperty({ name, $type, overrides, }) {
78
73
  if (schema.type === 'array') {
79
74
  type = renderRef({
80
75
  text: schema.aliasName,
81
- pathName: _jsxs(_Fragment, { children: [name, "[]"] }),
76
+ pathName: name,
82
77
  $ref: schema.item.$type,
83
78
  });
84
79
  }
@@ -109,19 +104,24 @@ function SchemaUIPopover({ initialPath, }) {
109
104
  return (_jsxs(Fragment, { children: [i > 0 && '.', node] }, i));
110
105
  }) }), _jsx(PropertyContext, { value: context, children: _jsx("div", { ref: ref, className: "px-2", children: _jsx(SchemaUIContent, { "$type": last.$ref }) }) })] }));
111
106
  }
112
- function RootRef({ text, $ref, pathName }) {
107
+ function RootRef({ text, $ref, pathName, inlineUnion }) {
113
108
  const { refs } = useData();
114
109
  const ref = useCallback((element) => {
115
110
  if (!element || element.style.getPropertyValue('--initial-height'))
116
111
  return;
117
112
  element.style.setProperty('--initial-height', `${element.clientHeight}px`);
118
113
  }, []);
114
+ const schema = refs[$ref];
115
+ if (inlineUnion && (schema.type === 'and' || schema.type === 'or')) {
116
+ const sep = schema.type === 'and' ? '&' : '|';
117
+ return (_jsx("span", { className: cn(typeVariants(), 'flex flex-row gap-2 items-center flex-wrap'), children: schema.items.map((item, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { children: sep }), _jsx(RootRef, { pathName: pathName, text: item.name, "$ref": item.$type })] }, item.$type))) }));
118
+ }
119
119
  if (!isExpandable(refs[$ref])) {
120
120
  return _jsx("span", { className: cn(typeVariants()), children: text });
121
121
  }
122
122
  return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { className: cn(typeVariants({ variant: 'trigger' })), children: text }), _jsx(PopoverContent, { ref: ref, className: "w-[600px] min-h-(--initial-height,0) max-h-[460px] p-0", children: _jsx(SchemaUIPopover, { initialPath: [
123
123
  {
124
- name: pathName,
124
+ name: (_jsxs(_Fragment, { children: [pathName, schema.type === 'array' && '[]'] })),
125
125
  $ref: $ref,
126
126
  },
127
127
  ] }) })] }));
@@ -135,10 +135,10 @@ function LinkRef({ $ref, pathName, onInsert, text, }) {
135
135
  onInsert(pathName, $ref);
136
136
  }, children: text }));
137
137
  }
138
- function Property({ name, type, required, deprecated, nested = false, ...props }) {
138
+ function Property({ name, type, required, deprecated, nested = false, className, ...props }) {
139
139
  return (_jsxs("div", { className: cn('text-sm border-t', nested
140
140
  ? 'p-3 border-x bg-fd-card last:rounded-b-xl first:rounded-tr-xl last:border-b'
141
- : 'py-4 first:border-t-0', props.className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-3 not-prose", children: [_jsxs("span", { className: "font-medium font-mono text-fd-primary", children: [name, required ? (_jsx("span", { className: "text-red-400", children: "*" })) : (_jsx("span", { className: "text-fd-muted-foreground", children: "?" }))] }), typeof type === 'string' ? (_jsx("span", { className: "text-sm font-mono text-fd-muted-foreground", children: type })) : (type), deprecated && (_jsx(Badge, { color: "yellow", className: "ms-auto text-xs", children: "Deprecated" }))] }), _jsx("div", { className: "prose-no-margin pt-2.5 empty:hidden", children: props.children })] }));
141
+ : 'py-4 first:border-t-0', className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-3 not-prose", children: [_jsxs("span", { className: "font-medium font-mono text-fd-primary", children: [name, required ? (_jsx("span", { className: "text-red-400", children: "*" })) : (_jsx("span", { className: "text-fd-muted-foreground", children: "?" }))] }), typeof type === 'string' ? (_jsx("span", { className: "text-sm font-mono text-fd-muted-foreground", children: type })) : (type), deprecated && (_jsx(Badge, { color: "yellow", className: "ms-auto text-xs", children: "Deprecated" }))] }), _jsx("div", { className: "prose-no-margin pt-2.5 empty:hidden", children: props.children })] }));
142
142
  }
143
143
  function isExpandable(schema) {
144
144
  return schema.type !== 'primitive';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/schema/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACr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EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL,CACJ,CAAC;AAEJ,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAClC;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,GAAG,OAAO,EACX,EAAE,eAAe,GAAG;IACnB,GAAG,EAAE,aAAa,CAAC;CACpB,8IAWA;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,EAC9C,GAAG,EAAE,aAAa,GACjB,qBAAqB,CA+RvB"}
@@ -127,23 +127,14 @@ export function generateSchemaUI({ root, readOnly, writeOnly }, ctx) {
127
127
  ...base(schema),
128
128
  };
129
129
  refs[id] = out;
130
- const $oneOf = `${id}_oneOf`;
131
- const $anyOf = `${id}_anyOf`;
132
- scanRefs($oneOf, {
133
- ...schema,
134
- anyOf: undefined,
135
- });
136
- scanRefs($anyOf, {
137
- ...schema,
138
- oneOf: undefined,
139
- });
140
- out.items.push({
141
- name: refs[$oneOf].aliasName,
142
- $type: $oneOf,
143
- }, {
144
- name: refs[$anyOf].aliasName,
145
- $type: $anyOf,
146
- });
130
+ for (const omit of ['anyOf', 'oneOf']) {
131
+ const $type = `${id}_omit:${omit}`;
132
+ scanRefs($type, { ...schema, [omit]: undefined });
133
+ out.items.push({
134
+ name: refs[$type].aliasName,
135
+ $type,
136
+ });
137
+ }
147
138
  return;
148
139
  }
149
140
  // display both `oneOf` & `anyOf` as OR for simplified overview
@@ -158,7 +149,8 @@ export function generateSchemaUI({ root, readOnly, writeOnly }, ctx) {
158
149
  for (const item of union) {
159
150
  if (typeof item !== 'object' || !isVisible(item))
160
151
  continue;
161
- const key = `${id}_extends:${getSchemaId(item)}`;
152
+ const itemId = getSchemaId(item);
153
+ const key = `${id}_extends:${itemId}`;
162
154
  scanRefs(key, {
163
155
  ...schema,
164
156
  oneOf: undefined,
@@ -171,7 +163,8 @@ export function generateSchemaUI({ root, readOnly, writeOnly }, ctx) {
171
163
  });
172
164
  out.items.push({
173
165
  $type: key,
174
- name: refs[key].aliasName,
166
+ name: refs[itemId]?.aliasName ??
167
+ schemaToString(item, ctx.schema, FormatFlags.UseAlias),
175
168
  });
176
169
  }
177
170
  return;
@@ -0,0 +1,2 @@
1
+ export { twMerge as cn } from 'tailwind-merge';
2
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export { twMerge as cn } from 'tailwind-merge';
@@ -0,0 +1,10 @@
1
+ import type { NoReference } from '../../utils/schema.js';
2
+ import type { Document } from '../../types.js';
3
+ import type { TOCItemType } from 'fumadocs-core/toc';
4
+ import type { StructuredData } from 'fumadocs-core/mdx-plugins';
5
+ import type { ApiPageProps } from '../../ui/index.js';
6
+ export declare function toStaticData(page: ApiPageProps, dereferenced: NoReference<Document>): {
7
+ toc: TOCItemType[];
8
+ structuredData: StructuredData;
9
+ };
10
+ //# sourceMappingURL=to-static-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-static-data.d.ts","sourceRoot":"","sources":["../../../src/utils/pages/to-static-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,SAAS,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,GAClC;IACD,GAAG,EAAE,WAAW,EAAE,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;CAChC,CA6CA"}
@@ -0,0 +1,41 @@
1
+ import Slugger from 'github-slugger';
2
+ import { idToTitle } from '../../utils/id-to-title.js';
3
+ export function toStaticData(page, dereferenced) {
4
+ const slugger = new Slugger();
5
+ const toc = [];
6
+ const structuredData = { headings: [], contents: [] };
7
+ function pathItem(item, defaultTitle) {
8
+ if (page.showTitle && item.operationId) {
9
+ const title = item.summary ||
10
+ (item.operationId ? idToTitle(item.operationId) : defaultTitle);
11
+ const id = slugger.slug(title);
12
+ toc.push({
13
+ depth: 2,
14
+ title,
15
+ url: `#${id}`,
16
+ });
17
+ structuredData.headings.push({
18
+ content: title,
19
+ id,
20
+ });
21
+ }
22
+ if (item.description)
23
+ structuredData.contents.push({
24
+ content: item.description,
25
+ heading: structuredData.headings.at(-1)?.id,
26
+ });
27
+ }
28
+ for (const item of page.operations ?? []) {
29
+ const operation = dereferenced.paths?.[item.path]?.[item.method];
30
+ if (!operation)
31
+ continue;
32
+ pathItem(operation, item.path);
33
+ }
34
+ for (const item of page.webhooks ?? []) {
35
+ const webhook = dereferenced.webhooks?.[item.name]?.[item.method];
36
+ if (!webhook)
37
+ continue;
38
+ pathItem(webhook, item.name);
39
+ }
40
+ return { toc, structuredData };
41
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"to-text.d.ts","sourceRoot":"","sources":["../../../src/utils/pages/to-text.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,SAAS,CAAC;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IAEJ;;;;OAIG;IACH,WAAW,CAAC,EAAE,CACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,eAAe,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACxC;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,iBAAiB,EAC5B,OAAO,GAAE,kBAAuB,UAqEjC;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CA+BR;AAOD,MAAM,MAAM,eAAe,GACvB;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5B,GACD;IACE,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
1
+ {"version":3,"file":"to-text.d.ts","sourceRoot":"","sources":["../../../src/utils/pages/to-text.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IAEJ;;;;OAIG;IACH,WAAW,CAAC,EAAE,CACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,eAAe,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACxC;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,iBAAiB,EAC5B,OAAO,GAAE,kBAAuB,UAqEjC;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CA+BR;AAED,MAAM,MAAM,eAAe,GACvB;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5B,GACD;IACE,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -1,7 +1,6 @@
1
- import { idToTitle } from '../../utils/id-to-title.js';
2
1
  import { dump } from 'js-yaml';
3
- import Slugger from 'github-slugger';
4
2
  import { removeUndefined } from '../../utils/remove-undefined.js';
3
+ import { toStaticData } from '../../utils/pages/to-static-data.js';
5
4
  export function toText(entry, processed, options = {}) {
6
5
  switch (entry.type) {
7
6
  case 'operation':
@@ -90,7 +89,7 @@ function generatePage(schemaId, processed, pageProps, options, context) {
90
89
  webhook: true,
91
90
  };
92
91
  }
93
- const data = generateStaticData(processed.dereferenced, page);
92
+ const data = toStaticData(page, processed.dereferenced);
94
93
  const content = [];
95
94
  if (options.description && includeDescription)
96
95
  content.push(options.description);
@@ -107,36 +106,6 @@ function generatePage(schemaId, processed, pageProps, options, context) {
107
106
  },
108
107
  }, content.join('\n\n'), options);
109
108
  }
110
- function generateStaticData(dereferenced, props) {
111
- const slugger = new Slugger();
112
- const toc = [];
113
- const structuredData = { headings: [], contents: [] };
114
- for (const item of props.operations ?? []) {
115
- const operation = dereferenced.paths?.[item.path]?.[item.method];
116
- if (!operation)
117
- continue;
118
- if (props.showTitle && operation.operationId) {
119
- const title = operation.summary ||
120
- (operation.operationId ? idToTitle(operation.operationId) : item.path);
121
- const id = slugger.slug(title);
122
- toc.push({
123
- depth: 2,
124
- title,
125
- url: `#${id}`,
126
- });
127
- structuredData.headings.push({
128
- content: title,
129
- id,
130
- });
131
- }
132
- if (operation.description)
133
- structuredData.contents.push({
134
- content: operation.description,
135
- heading: structuredData.headings.at(-1)?.id,
136
- });
137
- }
138
- return { toc, structuredData };
139
- }
140
109
  function pageContent({ showTitle, showDescription, document, webhooks, operations, }) {
141
110
  const propStrs = [`document={${JSON.stringify(document)}}`];
142
111
  // filter extra properties in props
@@ -27,9 +27,9 @@ export function schemaToString(value, ctx, flags = FormatFlags.None) {
27
27
  if ((flags & FormatFlags.UseAlias) === FormatFlags.UseAlias) {
28
28
  if (schema.title)
29
29
  return schema.title;
30
- const ref = ctx?.getRawRef(schema);
31
- if (ref)
32
- return ref.split('/').at(-1);
30
+ const ref = ctx?.getRawRef(schema)?.split('/');
31
+ if (ref && ref.length > 0)
32
+ return ref[ref.length - 1];
33
33
  }
34
34
  if (Array.isArray(schema.type)) {
35
35
  return union(schema.type.map((type) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "10.1.4",
3
+ "version": "10.2.1",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -54,8 +54,8 @@
54
54
  "@radix-ui/react-dialog": "^1.1.15",
55
55
  "@radix-ui/react-select": "^2.2.6",
56
56
  "@radix-ui/react-slot": "^1.2.4",
57
- "@scalar/json-magic": "^0.8.6",
58
- "@scalar/openapi-parser": "0.23.7",
57
+ "@scalar/json-magic": "^0.8.8",
58
+ "@scalar/openapi-parser": "0.23.9",
59
59
  "ajv": "^8.17.1",
60
60
  "class-variance-authority": "^0.7.1",
61
61
  "github-slugger": "^2.0.0",
@@ -66,10 +66,11 @@
66
66
  "react-hook-form": "^7.68.0",
67
67
  "remark": "^15.0.1",
68
68
  "remark-rehype": "^11.1.2",
69
+ "tailwind-merge": "^3.4.0",
69
70
  "xml-js": "^1.6.11"
70
71
  },
71
72
  "devDependencies": {
72
- "@scalar/api-client-react": "^1.3.55",
73
+ "@scalar/api-client-react": "^1.3.58",
73
74
  "@types/js-yaml": "^4.0.9",
74
75
  "@types/node": "24.10.2",
75
76
  "@types/openapi-sampler": "^1.0.3",
@@ -79,8 +80,8 @@
79
80
  "tailwindcss": "^4.1.18",
80
81
  "tsc-alias": "^1.8.16",
81
82
  "eslint-config-custom": "0.0.0",
82
- "fumadocs-ui": "16.2.5",
83
- "fumadocs-core": "16.2.5",
83
+ "fumadocs-ui": "16.3.1",
84
+ "fumadocs-core": "16.3.1",
84
85
  "tsconfig": "0.0.0"
85
86
  },
86
87
  "peerDependencies": {
package/dist/icons.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from 'fumadocs-ui/internal/icons';
2
- //# sourceMappingURL=icons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
package/dist/icons.js DELETED
@@ -1 +0,0 @@
1
- export * from 'fumadocs-ui/internal/icons';