fumadocs-openapi 12.2.0 → 12.4.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 (59) hide show
  1. package/css/generated/shared.css +1 -1
  2. package/dist/.translations/index.d.ts +4 -4
  3. package/dist/.translations/keys.js +4 -4
  4. package/dist/operation.js +4 -4
  5. package/dist/packages/shared-api/dist/.translations/index.d.ts +1 -0
  6. package/dist/packages/shared-api/dist/.translations/keys.js +1 -0
  7. package/dist/packages/shared-api/dist/auto-anchor/index.js +54 -10
  8. package/dist/packages/shared-api/dist/components/accordion.js +3 -11
  9. package/dist/packages/shared-api/dist/components/collapsible.js +16 -0
  10. package/dist/packages/shared-api/dist/components/defaults.js +1 -1
  11. package/dist/packages/shared-api/dist/components/schema/client.d.ts +5 -0
  12. package/dist/packages/shared-api/dist/components/schema/client.js +408 -455
  13. package/dist/packages/shared-api/dist/components/select-tab.js +7 -12
  14. package/dist/playground/auth.d.ts +61 -7
  15. package/dist/playground/auth.js +192 -95
  16. package/dist/playground/fetcher.d.ts +1 -1
  17. package/dist/playground/index.d.ts +2 -2
  18. package/dist/playground/index.js +2 -2
  19. package/dist/playground/use-playground.d.ts +5 -3
  20. package/dist/playground/use-playground.js +22 -10
  21. package/dist/requests/generators/csharp.js +11 -21
  22. package/dist/requests/generators/curl.js +12 -14
  23. package/dist/requests/generators/go.js +22 -33
  24. package/dist/requests/generators/index.d.ts +1 -1
  25. package/dist/requests/generators/java.js +33 -37
  26. package/dist/requests/generators/javascript.js +13 -20
  27. package/dist/requests/generators/python.js +12 -17
  28. package/dist/requests/generators/rust.js +15 -20
  29. package/dist/requests/index.d.ts +1 -1
  30. package/dist/requests/media/adapter.d.ts +0 -1
  31. package/dist/requests/media/adapter.js +50 -42
  32. package/dist/requests/media/encode.d.ts +1 -1
  33. package/dist/requests/media/encode.js +1 -1
  34. package/dist/requests/string-utils.js +14 -6
  35. package/dist/ui/components/dialog.js +14 -0
  36. package/dist/ui/components/endpoint.js +11 -8
  37. package/dist/ui/components/heading.js +1 -1
  38. package/dist/ui/components/schema.js +1 -1
  39. package/dist/ui/{playground/components → components}/segmented.js +2 -2
  40. package/dist/ui/operation/index.js +262 -237
  41. package/dist/ui/operation/request-tabs.js +1 -1
  42. package/dist/ui/operation/response-tabs.js +1 -1
  43. package/dist/ui/operation/usage-tabs.js +1 -1
  44. package/dist/ui/playground/client.d.ts +1 -1
  45. package/dist/ui/playground/client.js +23 -19
  46. package/dist/ui/playground/components/fields.js +36 -15
  47. package/dist/ui/playground/components/oauth-panel.js +71 -21
  48. package/dist/ui/playground/components/request-panel.js +80 -94
  49. package/dist/ui/playground/components/response-panel.js +1 -1
  50. package/dist/ui/playground/components/result-display.js +1 -1
  51. package/dist/ui/playground/components/server-select.js +1 -1
  52. package/dist/utils/create-page.js +2 -2
  53. package/dist/utils/get-example-requests.js +1 -1
  54. package/dist/utils/use-server.d.ts +3 -3
  55. package/dist/utils/use-server.js +2 -2
  56. package/package.json +5 -5
  57. package/dist/packages/shared-api/dist/auto-anchor/client.js +0 -20
  58. package/dist/packages/shared-api/dist/components/popover.js +0 -23
  59. package/dist/packages/shared-api/dist/utils/merge-refs.js +0 -11
@@ -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("/").map((part, index) => /* @__PURE__ */ jsxs(Fragment, { children: [index > 0 && /* @__PURE__ */ jsx("span", {
28
- className: "text-fd-muted-foreground",
29
- children: "/"
30
- }), part.startsWith("{") && part.endsWith("}") ? /* @__PURE__ */ jsx("span", {
31
- className: "rounded-md bg-fd-primary/10 px-1 text-fd-primary",
32
- children: part
33
- }) : part] }, index))
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/client.js";
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/client.js";
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 "../../../utils/cn.js";
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/playground/components/segmented.tsx
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 />` */