fumadocs-openapi 12.2.0 → 12.3.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.
- package/css/generated/shared.css +1 -1
- package/dist/.translations/index.d.ts +1 -3
- package/dist/.translations/keys.js +1 -3
- package/dist/packages/shared-api/dist/.translations/index.d.ts +1 -0
- package/dist/packages/shared-api/dist/.translations/keys.js +1 -0
- package/dist/packages/shared-api/dist/auto-anchor/index.js +54 -10
- package/dist/packages/shared-api/dist/components/accordion.js +3 -11
- package/dist/packages/shared-api/dist/components/collapsible.js +16 -0
- package/dist/packages/shared-api/dist/components/schema/client.d.ts +5 -0
- package/dist/packages/shared-api/dist/components/schema/client.js +408 -455
- package/dist/packages/shared-api/dist/components/select-tab.js +7 -12
- package/dist/ui/components/dialog.js +14 -0
- package/dist/ui/components/endpoint.js +11 -8
- package/dist/ui/components/heading.js +1 -1
- package/dist/ui/components/schema.js +1 -1
- package/dist/ui/{playground/components → components}/segmented.js +2 -2
- package/dist/ui/operation/index.js +261 -236
- package/dist/ui/playground/client.js +5 -4
- package/dist/ui/playground/components/fields.js +1 -1
- package/dist/ui/playground/components/request-panel.js +1 -1
- package/dist/ui/playground/components/response-panel.js +1 -1
- package/dist/ui/playground/components/result-display.js +1 -1
- package/dist/ui/playground/components/server-select.js +1 -1
- package/package.json +5 -5
- package/dist/packages/shared-api/dist/auto-anchor/client.js +0 -20
- package/dist/packages/shared-api/dist/components/popover.js +0 -23
- package/dist/packages/shared-api/dist/utils/merge-refs.js +0 -11
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { createContext, use, useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { AnchorSection, useAnchorLink } from "../auto-anchor/index.js";
|
|
5
|
+
import { createContext, use, useMemo, useState } from "react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
//#region ../shared-api/dist/components/select-tab.js
|
|
9
8
|
const Context = createContext(null);
|
|
@@ -19,16 +18,12 @@ function SelectTabs({ defaultValue, children }) {
|
|
|
19
18
|
}
|
|
20
19
|
function SelectTab({ value, anchorSegments, ...props }) {
|
|
21
20
|
const { value: currentValue, setValue } = use(Context);
|
|
22
|
-
const
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (id && anchorIdStartsWith(window.location.hash.slice(1), id)) setValue(value);
|
|
25
|
-
}, [
|
|
26
|
-
id,
|
|
27
|
-
value,
|
|
28
|
-
setValue
|
|
29
|
-
]);
|
|
21
|
+
const ref = useAnchorLink(anchorSegments ?? false, () => setValue(value));
|
|
30
22
|
if (value !== currentValue) return;
|
|
31
|
-
const content = /* @__PURE__ */ jsx("div", {
|
|
23
|
+
const content = /* @__PURE__ */ jsx("div", {
|
|
24
|
+
ref,
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
32
27
|
return anchorSegments ? /* @__PURE__ */ jsx(AnchorSection, {
|
|
33
28
|
segments: anchorSegments,
|
|
34
29
|
children: content
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
5
|
+
//#region src/ui/components/dialog.tsx
|
|
6
|
+
/** the popup of a dialog, a window on larger screens and the full screen on smaller ones */
|
|
7
|
+
function DialogPopup({ className, children }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: "fixed inset-0 z-50 bg-black/40 backdrop-blur-xs transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0" }), /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
9
|
+
className: cn("fixed inset-0 z-50 flex flex-col overflow-hidden bg-fd-background text-fd-foreground outline-none transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:transition-opacity sm:inset-auto sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-2xl sm:border sm:shadow-2xl", className),
|
|
10
|
+
children
|
|
11
|
+
})] });
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DialogPopup };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MethodLabel } from "./method-label.js";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
|
-
import { Fragment } from "react";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
//#region src/ui/components/endpoint.tsx
|
|
6
5
|
function EndpointBar({ method, route, deprecated = false, children, ...props }) {
|
|
@@ -24,13 +23,17 @@ function Route({ route, ...props }) {
|
|
|
24
23
|
return /* @__PURE__ */ jsx("div", {
|
|
25
24
|
...props,
|
|
26
25
|
className: cn("flex min-w-0 items-center overflow-x-auto font-mono text-[0.8125rem] text-nowrap [scrollbar-width:none]", props.className),
|
|
27
|
-
children: route.split(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
children: route.split(/(\{[^}]*\}|\/)/).map((part, index) => {
|
|
27
|
+
if (index % 2 === 0) return part;
|
|
28
|
+
if (part === "/") return /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: "text-fd-muted-foreground",
|
|
30
|
+
children: "/"
|
|
31
|
+
}, index);
|
|
32
|
+
return /* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: "rounded-md bg-fd-primary/10 px-1 text-fd-primary",
|
|
34
|
+
children: part
|
|
35
|
+
}, index);
|
|
36
|
+
})
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
39
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useComponents } from "../../utils/create-page.js";
|
|
3
|
-
import { useAnchorId } from "../../packages/shared-api/dist/auto-anchor/
|
|
3
|
+
import { useAnchorId } from "../../packages/shared-api/dist/auto-anchor/index.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/ui/components/heading.tsx
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useComponents, useRenderContext } from "../../utils/create-page.js";
|
|
3
|
-
import { useAnchorId } from "../../packages/shared-api/dist/auto-anchor/
|
|
3
|
+
import { useAnchorId } from "../../packages/shared-api/dist/auto-anchor/index.js";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/ui/components/schema.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Tabs } from "@base-ui/react/tabs";
|
|
5
|
-
//#region src/ui/
|
|
5
|
+
//#region src/ui/components/segmented.tsx
|
|
6
6
|
const Segmented = Tabs.Root;
|
|
7
7
|
const SegmentedPanel = Tabs.Panel;
|
|
8
8
|
/** a pill switch with a sliding indicator, its panels go in `<SegmentedPanel />` */
|