fumadocs-openapi 12.5.4 → 12.5.6

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 (135) hide show
  1. package/css/generated/shared.css +1 -1
  2. package/dist/.translations/index.d.ts +6 -3
  3. package/dist/.translations/keys.js +6 -2
  4. package/dist/_virtual/_rolldown/runtime.js +1 -2
  5. package/dist/generate-file.d.ts +1 -3
  6. package/dist/generate-file.js +3 -3
  7. package/dist/i18n.d.ts +1 -3
  8. package/dist/i18n.js +1 -2
  9. package/dist/index.browser.d.ts +0 -2
  10. package/dist/index.browser.js +1 -2
  11. package/dist/node_modules/.pnpm/fast-content-type-parse@4.0.1/node_modules/fast-content-type-parse/index.js +1 -2
  12. package/dist/node_modules/.pnpm/xml-js@1.6.11/node_modules/xml-js/lib/array-helper.js +1 -2
  13. package/dist/node_modules/.pnpm/xml-js@1.6.11/node_modules/xml-js/lib/js2xml.js +1 -2
  14. package/dist/node_modules/.pnpm/xml-js@1.6.11/node_modules/xml-js/lib/options-helper.js +1 -2
  15. package/dist/operation.d.ts +1 -3
  16. package/dist/operation.js +1 -2
  17. package/dist/packages/shared-api/dist/.translations/index.d.ts +2 -5
  18. package/dist/packages/shared-api/dist/.translations/keys.js +2 -2
  19. package/dist/packages/shared-api/dist/auto-anchor/index.js +1 -2
  20. package/dist/packages/shared-api/dist/codegen.d.ts +0 -3
  21. package/dist/packages/shared-api/dist/codegen.js +1 -2
  22. package/dist/packages/shared-api/dist/components/badge.js +1 -2
  23. package/dist/packages/shared-api/dist/components/collapsible.js +1 -2
  24. package/dist/packages/shared-api/dist/components/copy-typescript.js +1 -2
  25. package/dist/packages/shared-api/dist/components/defaults.d.ts +2 -4
  26. package/dist/packages/shared-api/dist/components/defaults.js +21 -21
  27. package/dist/packages/shared-api/dist/components/dialog.js +1 -2
  28. package/dist/packages/shared-api/dist/components/example.js +3 -3
  29. package/dist/packages/shared-api/dist/components/playground/fields.js +27 -9
  30. package/dist/packages/shared-api/dist/components/playground/json-editor.js +1 -2
  31. package/dist/packages/shared-api/dist/components/playground/panels.js +1 -2
  32. package/dist/packages/shared-api/dist/components/playground/param-input.js +1 -2
  33. package/dist/packages/shared-api/dist/components/playground/result.js +1 -2
  34. package/dist/packages/shared-api/dist/components/playground/schema.js +1 -2
  35. package/dist/packages/shared-api/dist/components/playground/server-select.js +1 -2
  36. package/dist/packages/shared-api/dist/components/schema/client.d.ts +1 -4
  37. package/dist/packages/shared-api/dist/components/schema/client.js +3 -2
  38. package/dist/packages/shared-api/dist/components/schema/index.d.ts +0 -3
  39. package/dist/packages/shared-api/dist/components/schema/index.js +1 -2
  40. package/dist/packages/shared-api/dist/components/segmented.js +1 -2
  41. package/dist/packages/shared-api/dist/components/select-tab.js +1 -2
  42. package/dist/packages/shared-api/dist/components/select.js +1 -2
  43. package/dist/packages/shared-api/dist/components/spinner.js +1 -2
  44. package/dist/packages/shared-api/dist/i18n.js +1 -2
  45. package/dist/packages/shared-api/dist/source.d.ts +1 -4
  46. package/dist/packages/shared-api/dist/source.js +1 -2
  47. package/dist/packages/shared-api/dist/utils/document-cache.js +1 -2
  48. package/dist/packages/shared-api/dist/utils/id-to-title.js +1 -2
  49. package/dist/packages/shared-api/dist/utils/is-plain-object.js +1 -2
  50. package/dist/packages/shared-api/dist/utils/url.js +1 -2
  51. package/dist/packages/shared-api/dist/utils/use-query.js +1 -2
  52. package/dist/packages/shared-api/dist/utils/use-server-store.js +1 -2
  53. package/dist/playground/auth.d.ts +2 -2
  54. package/dist/playground/auth.js +1 -2
  55. package/dist/playground/fetcher.d.ts +1 -3
  56. package/dist/playground/fetcher.js +1 -2
  57. package/dist/playground/use-playground.d.ts +1 -3
  58. package/dist/playground/use-playground.js +1 -2
  59. package/dist/requests/generators/all.d.ts +1 -3
  60. package/dist/requests/generators/all.js +1 -2
  61. package/dist/requests/generators/csharp.d.ts +1 -3
  62. package/dist/requests/generators/csharp.js +1 -2
  63. package/dist/requests/generators/curl.d.ts +1 -3
  64. package/dist/requests/generators/curl.js +1 -2
  65. package/dist/requests/generators/go.d.ts +1 -3
  66. package/dist/requests/generators/go.js +1 -2
  67. package/dist/requests/generators/index.d.ts +1 -3
  68. package/dist/requests/generators/index.js +1 -2
  69. package/dist/requests/generators/java.d.ts +1 -3
  70. package/dist/requests/generators/java.js +1 -2
  71. package/dist/requests/generators/javascript.d.ts +1 -3
  72. package/dist/requests/generators/javascript.js +1 -2
  73. package/dist/requests/generators/python.d.ts +1 -3
  74. package/dist/requests/generators/python.js +1 -2
  75. package/dist/requests/generators/rust.d.ts +1 -3
  76. package/dist/requests/generators/rust.js +1 -2
  77. package/dist/requests/media/adapter.d.ts +0 -2
  78. package/dist/requests/media/adapter.js +1 -2
  79. package/dist/requests/media/encode.d.ts +1 -3
  80. package/dist/requests/media/encode.js +1 -2
  81. package/dist/requests/media/resolve-adapter.d.ts +1 -3
  82. package/dist/requests/media/resolve-adapter.js +1 -2
  83. package/dist/requests/string-utils.js +1 -2
  84. package/dist/requests/types.d.ts +1 -3
  85. package/dist/server/index.d.ts +0 -2
  86. package/dist/server/index.js +1 -2
  87. package/dist/server/oauth.d.ts +1 -3
  88. package/dist/server/oauth.js +1 -2
  89. package/dist/server/proxy.d.ts +0 -2
  90. package/dist/server/proxy.js +8 -4
  91. package/dist/types/openapi.d.ts +1 -3
  92. package/dist/types.d.ts +1 -3
  93. package/dist/ui/base.d.ts +1 -6
  94. package/dist/ui/base.js +1 -2
  95. package/dist/ui/components/codeblock.js +1 -2
  96. package/dist/ui/components/endpoint.js +1 -2
  97. package/dist/ui/components/heading.js +1 -2
  98. package/dist/ui/components/markdown.js +1 -2
  99. package/dist/ui/components/method-label.js +1 -2
  100. package/dist/ui/components/schema.js +1 -2
  101. package/dist/ui/index.d.ts +0 -2
  102. package/dist/ui/index.js +1 -2
  103. package/dist/ui/operation/index.js +14 -5
  104. package/dist/ui/operation/usage-tabs.js +12 -5
  105. package/dist/ui/playground/client.d.ts +6 -5
  106. package/dist/ui/playground/client.js +1 -2
  107. package/dist/ui/playground/components/auth.js +1 -2
  108. package/dist/ui/playground/components/request-panel.d.ts +8 -0
  109. package/dist/ui/playground/components/request-panel.js +18 -8
  110. package/dist/ui/playground/components/response-panel.js +1 -2
  111. package/dist/ui/playground/components/result-display.d.ts +1 -3
  112. package/dist/ui/playground/components/result-display.js +1 -2
  113. package/dist/ui/playground/components/server-select.js +1 -2
  114. package/dist/ui/playground/components/url-bar.js +1 -2
  115. package/dist/ui/scalar/client.js +1 -2
  116. package/dist/ui/scalar/index.d.ts +1 -3
  117. package/dist/ui/scalar/index.js +1 -2
  118. package/dist/utils/create-page.d.ts +10 -9
  119. package/dist/utils/create-page.js +14 -8
  120. package/dist/utils/document/dereference.d.ts +1 -3
  121. package/dist/utils/document/dereference.js +1 -2
  122. package/dist/utils/document/load.js +1 -2
  123. package/dist/utils/get-example-requests.js +4 -4
  124. package/dist/utils/pages/builder.d.ts +0 -2
  125. package/dist/utils/pages/builder.js +1 -2
  126. package/dist/utils/pages/preset-auto.d.ts +0 -2
  127. package/dist/utils/pages/preset-auto.js +1 -2
  128. package/dist/utils/pages/to-static-data.d.ts +1 -3
  129. package/dist/utils/pages/to-static-data.js +1 -2
  130. package/dist/utils/pages/to-text.d.ts +1 -3
  131. package/dist/utils/pages/to-text.js +1 -2
  132. package/dist/utils/schema.js +1 -2
  133. package/dist/utils/use-server.d.ts +0 -2
  134. package/dist/utils/use-server.js +1 -2
  135. package/package.json +12 -13
@@ -7,7 +7,7 @@ import { useTranslations } from "@fuma-translate/react";
7
7
  import { Check, Clipboard } from "lucide-react";
8
8
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
9
9
  import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
10
- //#region ../shared-api/dist/components/example.js
10
+ // ../shared-api/dist/components/example.js
11
11
  const selectedCodeUsages = /* @__PURE__ */ new Map();
12
12
  const listeners = /* @__PURE__ */ new Set();
13
13
  function subscribe(listener) {
@@ -94,7 +94,7 @@ function ExampleHeader({ title, description, copy, className, children }) {
94
94
  });
95
95
  }
96
96
  /** a single item is a plain label */
97
- function ExampleSelect({ items, value, onValueChange, align = "end", className }) {
97
+ function ExampleSelect({ items, value, onValueChange, align = "end", className, "aria-label": ariaLabel }) {
98
98
  if (items.length === 1) return /* @__PURE__ */ jsx("span", {
99
99
  className: "px-2 text-fd-muted-foreground",
100
100
  children: items[0].label
@@ -104,6 +104,7 @@ function ExampleSelect({ items, value, onValueChange, align = "end", className }
104
104
  value,
105
105
  onValueChange: (v) => v !== null && onValueChange(v),
106
106
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
107
+ "aria-label": ariaLabel,
107
108
  className: cn("h-7 w-fit max-w-40 shrink-0 gap-1.5 border-0 bg-transparent px-2 py-0 text-[0.8125rem] font-medium text-fd-muted-foreground hover:text-fd-accent-foreground focus:ring-0 focus-visible:ring-2 data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground", className),
108
109
  children: /* @__PURE__ */ jsx(SelectValue, { className: "min-w-0 truncate" })
109
110
  }), /* @__PURE__ */ jsx(SelectContent, {
@@ -121,5 +122,4 @@ function ExampleSelect({ items, value, onValueChange, align = "end", className }
121
122
  })]
122
123
  });
123
124
  }
124
- //#endregion
125
125
  export { ExampleHeader, ExampleSelect, captionCodeBlock, cardCodeBlock, exampleActions, exampleCardClassName, exampleCodeBlock, selectCodeUsage, titleBarClassName, useCodeUsageId };
@@ -13,7 +13,7 @@ import { Select } from "@base-ui/react/select";
13
13
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
14
14
  import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
15
15
  import { Popover } from "@base-ui/react/popover";
16
- //#region ../shared-api/dist/components/playground/fields.js
16
+ // ../shared-api/dist/components/playground/fields.js
17
17
  /** the type of a field, at the end of its cell like a unit */
18
18
  const typeClassName = "flex shrink-0 items-center pe-1 font-mono text-xs text-fd-muted-foreground";
19
19
  /** holds the actions of field, reserved in tables so their types align, an end padding when stacked */
@@ -27,6 +27,25 @@ function getType(field) {
27
27
  function typeLabel(field, alias = false) {
28
28
  return field.const !== void 0 ? JSON.stringify(field.const) : stringify(field, { alias });
29
29
  }
30
+ /** a union of `const` members, an `enum` whose values are named by their `title` */
31
+ function isConstUnion(union) {
32
+ return union !== void 0 && union.length > 0 && union.every((item) => typeof item === "object" && item.const !== void 0);
33
+ }
34
+ /** the values of a field rendered as a select */
35
+ function getOptions(field) {
36
+ const union = field.anyOf ?? field.oneOf;
37
+ if (isConstUnion(union)) return union.map((item) => ({
38
+ value: item.const,
39
+ label: item.title ?? valueLabel(item.const)
40
+ }));
41
+ return (field.const !== void 0 ? [field.const] : field.enum)?.map((value) => ({
42
+ value,
43
+ label: valueLabel(value)
44
+ }));
45
+ }
46
+ function valueLabel(value) {
47
+ return typeof value === "string" ? value : JSON.stringify(value);
48
+ }
30
49
  /**
31
50
  * Resolve the unions and multiple types of a field from its value, like `useFieldInfo()` does initially.
32
51
  */
@@ -80,7 +99,7 @@ function SchemaSwitch({ fieldName, schema, depth = 0, children }) {
80
99
  info.oneOf,
81
100
  info.selectedType
82
101
  ]);
83
- if (member === void 0) return children(field, null);
102
+ if (member === void 0 || isConstUnion(union)) return children(field, null);
84
103
  let selector = null;
85
104
  if (union && union.length > 1) selector = /* @__PURE__ */ jsx(TypeSelect, {
86
105
  value: String(info.oneOf),
@@ -273,7 +292,7 @@ function ValueRow({ fieldName, field, type, end, required, marked = required, na
273
292
  /** the type in the cell of a primitive field, its selector when it has multiple */
274
293
  function cellType(field, selector) {
275
294
  if (selector) return selector;
276
- if (field.enum === void 0 && field.const === void 0 && field.type !== "null") return typeLabel(field);
295
+ if (field.type !== "null" && !getOptions(field)) return typeLabel(field);
277
296
  }
278
297
  /** the input of a primitive field */
279
298
  function FieldValue({ id, fieldName, field, required = false }) {
@@ -306,12 +325,12 @@ function FieldValue({ id, fieldName, field, required = false }) {
306
325
  })
307
326
  ]
308
327
  });
309
- const options = field.const !== void 0 ? [field.const] : field.enum;
328
+ const options = getOptions(field);
310
329
  if (options && options.length > 0) {
311
- const idx = options.indexOf(value);
312
- const items = options.map((item, i) => ({
330
+ const idx = options.findIndex((option) => option.value === value);
331
+ const items = options.map((option, i) => ({
313
332
  value: String(i),
314
- label: typeof item === "string" ? item : JSON.stringify(item)
333
+ label: option.label
315
334
  }));
316
335
  if (!required) items.push({
317
336
  value: "-1",
@@ -324,7 +343,7 @@ function FieldValue({ id, fieldName, field, required = false }) {
324
343
  id,
325
344
  items,
326
345
  value: idx !== -1 ? String(idx) : required ? null : "-1",
327
- onValueChange: (v) => setValue(v === "-1" ? void 0 : options[Number(v)]),
346
+ onValueChange: (v) => setValue(v === "-1" ? void 0 : options[Number(v)].value),
328
347
  placeholder: t("Select")
329
348
  });
330
349
  }
@@ -711,5 +730,4 @@ function FieldMarkdown({ md }) {
711
730
  const { Markdown } = useSchemaContext();
712
731
  return Markdown ? /* @__PURE__ */ jsx(Markdown, { md }) : md;
713
732
  }
714
- //#endregion
715
733
  export { CellSelect, CheckRow, FieldRow, FieldRows, LinkRow, Row, SelectRow, TextRow, ValueRow, getNestedFields, getRemoval, resolveField };
@@ -2,7 +2,7 @@
2
2
  import { useState } from "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { useDataEngine, useFieldValue } from "@fumari/stf";
5
- //#region ../shared-api/dist/components/playground/json-editor.js
5
+ // ../shared-api/dist/components/playground/json-editor.js
6
6
  function JsonEditor({ fieldName }) {
7
7
  const engine = useDataEngine();
8
8
  const [value] = useFieldValue(fieldName);
@@ -50,5 +50,4 @@ function JsonEditor({ fieldName }) {
50
50
  function formatJson(value) {
51
51
  return JSON.stringify(value ?? {}, null, 2);
52
52
  }
53
- //#endregion
54
53
  export { JsonEditor };
@@ -13,7 +13,7 @@ import { stringifyFieldKey } from "@fumari/stf/lib/utils";
13
13
  import { useTranslations } from "@fuma-translate/react";
14
14
  import { ArrowLeft, ChevronRight, SendHorizontal } from "lucide-react";
15
15
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
16
- //#region ../shared-api/dist/components/playground/panels.js
16
+ // ../shared-api/dist/components/playground/panels.js
17
17
  const motionClassNames = {
18
18
  forward: "motion-safe:starting:translate-x-6",
19
19
  back: "motion-safe:starting:-translate-x-6",
@@ -326,5 +326,4 @@ function SendingOverlay() {
326
326
  children: [/* @__PURE__ */ jsx(Spinner, { className: "size-3.5" }), t("Sending request...")]
327
327
  });
328
328
  }
329
- //#endregion
330
329
  export { Crumb, FieldPanel, OverviewLayer, Panel, PanelHeader, PanelNav, Placeholder, RequestExampleSelect, Section, SendButton, SendShortcut, SendingOverlay, ViewSwitch, iconButtonClassName, panelCodeBlock, panelTopCodeBlock, useFieldStack };
@@ -3,7 +3,7 @@ import { cn } from "../../utils/cn.js";
3
3
  import { useResolvedSchema } from "./schema.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useFieldValue } from "@fumari/stf";
6
- //#region ../shared-api/dist/components/playground/param-input.js
6
+ // ../shared-api/dist/components/playground/param-input.js
7
7
  const className = "mx-px rounded-md bg-fd-primary/10 px-1.5 py-0.5 text-fd-primary outline-none transition-colors placeholder:text-fd-primary/50 hover:bg-fd-primary/15 focus-visible:bg-fd-primary/15 focus-visible:ring-2 focus-visible:ring-fd-primary/30";
8
8
  /** a parameter of a URL edited in place, like `{id}` of `/users/{id}` */
9
9
  function ParamInput({ fieldName, name, schema = true, description }) {
@@ -50,5 +50,4 @@ function ParamInput({ fieldName, name, schema = true, description }) {
50
50
  className
51
51
  });
52
52
  }
53
- //#endregion
54
53
  export { ParamInput };
@@ -6,7 +6,7 @@ import { Fragment, useState } from "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useTranslations } from "@fuma-translate/react";
8
8
  import { X } from "lucide-react";
9
- //#region ../shared-api/dist/components/playground/result.js
9
+ // ../shared-api/dist/components/playground/result.js
10
10
  function ClearButton({ onClick, className }) {
11
11
  const t = useTranslations({ note: "playground result display" });
12
12
  return /* @__PURE__ */ jsx("button", {
@@ -183,5 +183,4 @@ function ResponseView({ status, duration, size, url, headers, warning = false, a
183
183
  })
184
184
  });
185
185
  }
186
- //#endregion
187
186
  export { RequestError, ResponseView };
@@ -3,7 +3,7 @@ import { dereference, matches, matchesType, mergeAllOf, sample } from "@fumadocs
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { useDataEngine, useFieldValue, useNamespace } from "@fumari/stf";
5
5
  import { stringifyFieldKey } from "@fumari/stf/lib/utils";
6
- //#region ../shared-api/dist/components/playground/schema.js
6
+ // ../shared-api/dist/components/playground/schema.js
7
7
  const SchemaContext = createContext(void 0);
8
8
  const anyFields = {
9
9
  type: [
@@ -110,5 +110,4 @@ function getUnion(schema) {
110
110
  if (schema.anyOf) return [schema.anyOf, "anyOf"];
111
111
  if (schema.oneOf) return [schema.oneOf, "oneOf"];
112
112
  }
113
- //#endregion
114
113
  export { SchemaProvider, anyFields, useFieldInfo, useResolvedSchema, useSchemaContext, useSchemaUtils };
@@ -7,7 +7,7 @@ import { StfProvider, useFieldValue, useListener, useStf } from "@fumari/stf";
7
7
  import { useTranslations } from "@fuma-translate/react";
8
8
  import { Check, ChevronDown } from "lucide-react";
9
9
  import { Popover } from "@base-ui/react/popover";
10
- //#region ../shared-api/dist/components/playground/server-select.js
10
+ // ../shared-api/dist/components/playground/server-select.js
11
11
  /**
12
12
  * Selects the server in a popover, `children` goes below its options, like `<ServerVariables />`.
13
13
  */
@@ -126,5 +126,4 @@ function VariableInput({ fieldName, variable }) {
126
126
  className: cn("h-8 w-full rounded-md border bg-fd-secondary px-2 font-mono text-[0.8125rem] text-fd-secondary-foreground outline-none placeholder:text-fd-muted-foreground focus-visible:ring-2 focus-visible:ring-fd-ring", example === void 0 && "placeholder:font-sans")
127
127
  });
128
128
  }
129
- //#endregion
130
129
  export { ServerPopover, ServerVariables };
@@ -1,7 +1,5 @@
1
1
  import { ReactNode } from "react";
2
2
  import { SchemaUIGeneratedData } from "@fumadocs/json-schema/react";
3
- //#region ../shared-api/dist/components/schema/client.d.ts
4
- //#region src/components/schema/client.d.ts
5
3
  export interface SchemaUIProps {
6
4
  /** anchor ID of the root schema, links to a property are resolved against it */
7
5
  rootId: string;
@@ -13,5 +11,4 @@ export interface SchemaUIProps {
13
11
  /** actions of the root schema, like copying its type definitions */
14
12
  actions?: ReactNode;
15
13
  generated: SchemaUIGeneratedData;
16
- }
17
- //#endregion
14
+ }
@@ -11,7 +11,7 @@ import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
11
11
  import { flushSync } from "react-dom";
12
12
  import { Menu } from "@base-ui/react/menu";
13
13
  import { SchemaUIProvider, useSchemaUI } from "@fumadocs/json-schema/react/client";
14
- //#region ../shared-api/dist/components/schema/client.js
14
+ // ../shared-api/dist/components/schema/client.js
15
15
  const TypeContext = createContext(null);
16
16
  const typeClassName = "font-mono text-xs text-fd-muted-foreground";
17
17
  const crumbClassName = "truncate rounded-md px-1.5 py-1 text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring data-popup-open:bg-fd-accent";
@@ -295,6 +295,7 @@ function formatName(name) {
295
295
  return match ? `[${match[1]}]` : name;
296
296
  }
297
297
  function UnionSelect({ union: { schema, value, select } }) {
298
+ const t = useTranslations({ note: "schema UI" });
298
299
  const items = schema.items.map((item) => ({
299
300
  label: item.name,
300
301
  value: item.$type
@@ -304,6 +305,7 @@ function UnionSelect({ union: { schema, value, select } }) {
304
305
  value,
305
306
  onValueChange: (v) => v && select(v),
306
307
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
308
+ "aria-label": t("Schema variant"),
307
309
  className: "h-7 w-auto min-w-0 gap-1 border-0 bg-transparent px-1.5 py-0 text-[0.8125rem] font-medium text-fd-foreground hover:bg-fd-accent focus:ring-0 focus-visible:ring-2 focus-visible:ring-inset data-popup-open:bg-fd-accent",
308
310
  children: /* @__PURE__ */ jsx(SelectValue, { className: "truncate" })
309
311
  }), /* @__PURE__ */ jsx(SelectContent, { children: items.map((item) => /* @__PURE__ */ jsx(SelectItem, {
@@ -483,5 +485,4 @@ function OpenTag({ label, value, open: { name, $ref } }) {
483
485
  ]
484
486
  });
485
487
  }
486
- //#endregion
487
488
  export { SchemaUI };
@@ -1,9 +1,6 @@
1
1
  import { SchemaUIProps } from "./client.js";
2
2
  import { GenerateSchemaUIOptions } from "@fumadocs/json-schema/react";
3
- //#region ../shared-api/dist/components/schema/index.d.ts
4
- //#region src/components/schema/index.d.ts
5
3
  export interface SchemaUIOptions extends Omit<GenerateSchemaUIOptions, 'translations'> {
6
4
  client: Omit<SchemaUIProps, 'generated'>;
7
5
  }
8
- //#endregion
9
6
  export type { SchemaUIProps };
@@ -4,7 +4,7 @@ import { useMemo } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { useTranslations } from "@fuma-translate/react";
6
6
  import { generateSchemaUI } from "@fumadocs/json-schema/react";
7
- //#region ../shared-api/dist/components/schema/index.js
7
+ // ../shared-api/dist/components/schema/index.js
8
8
  function Schema({ client, ...options }) {
9
9
  const translations = useTranslations().translations;
10
10
  const generated = useMemo(() => generateSchemaUI({
@@ -24,5 +24,4 @@ function Schema({ client, ...options }) {
24
24
  generated
25
25
  });
26
26
  }
27
- //#endregion
28
27
  export { Schema, SchemaUI };
@@ -2,7 +2,7 @@
2
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 ../shared-api/dist/components/segmented.js
5
+ // ../shared-api/dist/components/segmented.js
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 />` */
@@ -17,5 +17,4 @@ function SegmentedList({ items, className, ...props }) {
17
17
  }, item.value)), /* @__PURE__ */ jsx(Tabs.Indicator, { className: "absolute top-(--active-tab-top) left-0 -z-1 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) rounded-md bg-fd-background shadow-sm ring-1 ring-fd-border transition-[translate,width] duration-250 ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none dark:bg-fd-accent" })]
18
18
  });
19
19
  }
20
- //#endregion
21
20
  export { Segmented, SegmentedList, SegmentedPanel };
@@ -4,7 +4,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
4
4
  import { AnchorSection, useAnchorLink } from "../auto-anchor/index.js";
5
5
  import { createContext, use, useMemo, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- //#region ../shared-api/dist/components/select-tab.js
7
+ // ../shared-api/dist/components/select-tab.js
8
8
  const Context = createContext(null);
9
9
  function SelectTabs({ defaultValue, children }) {
10
10
  const [value, setValue] = useState(defaultValue ?? null);
@@ -50,5 +50,4 @@ function SelectTabTrigger({ items, className, ...props }) {
50
50
  }, value)) })]
51
51
  });
52
52
  }
53
- //#endregion
54
53
  export { SelectTab, SelectTabTrigger, SelectTabs };
@@ -3,7 +3,7 @@ import "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Check, ChevronDown } from "lucide-react";
5
5
  import { Select } from "@base-ui/react/select";
6
- //#region ../shared-api/dist/components/select.js
6
+ // ../shared-api/dist/components/select.js
7
7
  const Select$2 = Select.Root;
8
8
  Select.Group;
9
9
  const SelectValue = Select.Value;
@@ -71,5 +71,4 @@ function SelectItem({ className, children, description, ref, ...props }) {
71
71
  })]
72
72
  });
73
73
  }
74
- //#endregion
75
74
  export { Select$2 as Select, SelectContent, SelectItem, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue };
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../utils/cn.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { Loader2Icon } from "lucide-react";
4
- //#region ../shared-api/dist/components/spinner.js
4
+ // ../shared-api/dist/components/spinner.js
5
5
  function Spinner({ className, ...props }) {
6
6
  return /* @__PURE__ */ jsx(Loader2Icon, {
7
7
  role: "status",
@@ -10,5 +10,4 @@ function Spinner({ className, ...props }) {
10
10
  ...props
11
11
  });
12
12
  }
13
- //#endregion
14
13
  export { Spinner };
@@ -1,7 +1,6 @@
1
1
  import keys_default from "./.translations/keys.js";
2
- //#region ../shared-api/dist/i18n.js
2
+ // ../shared-api/dist/i18n.js
3
3
  function apiDocsTranslations() {
4
4
  return { keys: keys_default };
5
5
  }
6
- //#endregion
7
6
  export { apiDocsTranslations };
@@ -1,11 +1,8 @@
1
1
  import { MetaData, PageData } from "fumadocs-core/source";
2
- //#region ../shared-api/dist/source.d.ts
3
- //#region src/source.d.ts
4
2
  export interface SourceOptions {
5
3
  baseDir?: string;
6
4
  /** Generate `meta.json` files */
7
5
  meta?: boolean | {
8
6
  folderStyle?: 'folder' | 'separator';
9
7
  };
10
- }
11
- //#endregion
8
+ }
@@ -1,6 +1,6 @@
1
1
  import * as path from "node:path";
2
2
  import { PathUtils } from "fumadocs-core/source";
3
- //#region ../shared-api/dist/source.js
3
+ // ../shared-api/dist/source.js
4
4
  /** convert output entries into virtual files for `loader()` */
5
5
  function toVirtualFiles(entries, { baseDir = "", meta = false }, toPage) {
6
6
  const { folderStyle = "folder" } = typeof meta === "object" ? meta : {};
@@ -46,5 +46,4 @@ function getMetaPages(entries, parent, folderStyle) {
46
46
  }
47
47
  return pages;
48
48
  }
49
- //#endregion
50
49
  export { getMetaPages, toVirtualFiles };
@@ -1,4 +1,4 @@
1
- //#region ../shared-api/dist/utils/document-cache.js
1
+ // ../shared-api/dist/utils/document-cache.js
2
2
  /** Browsers load each document once per session, servers cache documents themselves. */
3
3
  function createDocumentCache() {
4
4
  const cache = /* @__PURE__ */ new Map();
@@ -12,5 +12,4 @@ function createDocumentCache() {
12
12
  return promise;
13
13
  };
14
14
  }
15
- //#endregion
16
15
  export { createDocumentCache };
@@ -1,4 +1,4 @@
1
- //#region ../shared-api/dist/utils/id-to-title.js
1
+ // ../shared-api/dist/utils/id-to-title.js
2
2
  function idToTitle(id) {
3
3
  let result = [];
4
4
  for (const c of id) if (result.length === 0) result.push(c.toLocaleUpperCase());
@@ -8,5 +8,4 @@ function idToTitle(id) {
8
8
  else result.push(c);
9
9
  return result.join("");
10
10
  }
11
- //#endregion
12
11
  export { idToTitle };
@@ -1,8 +1,7 @@
1
- //#region ../shared-api/dist/utils/is-plain-object.js
1
+ // ../shared-api/dist/utils/is-plain-object.js
2
2
  function isPlainObject(value) {
3
3
  if (typeof value !== "object" || value === null) return false;
4
4
  const prototype = Object.getPrototypeOf(value);
5
5
  return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;
6
6
  }
7
- //#endregion
8
7
  export { isPlainObject };
@@ -1,4 +1,4 @@
1
- //#region ../shared-api/dist/utils/url.js
1
+ // ../shared-api/dist/utils/url.js
2
2
  function joinURL(base, pathname) {
3
3
  if (pathname.startsWith("/")) pathname = pathname.slice(1);
4
4
  if (base.endsWith("/")) base = base.slice(0, -1);
@@ -9,5 +9,4 @@ function resolveServerUrl(template, variables) {
9
9
  for (const [key, value] of Object.entries(variables)) template = template.replaceAll(`{${key}}`, value);
10
10
  return template;
11
11
  }
12
- //#endregion
13
12
  export { joinURL, resolveServerUrl };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useMemo, useRef, useState } from "react";
3
- //#region ../shared-api/dist/utils/use-query.js
3
+ // ../shared-api/dist/utils/use-query.js
4
4
  function useQuery(fn) {
5
5
  const [loading, setLoading] = useState(false);
6
6
  const [data, setData] = useState();
@@ -35,5 +35,4 @@ function useQuery(fn) {
35
35
  loading
36
36
  ]);
37
37
  }
38
- //#endregion
39
38
  export { useQuery };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { isPlainObject } from "./is-plain-object.js";
3
3
  import { useEffect, useMemo, useRef, useState } from "react";
4
- //#region ../shared-api/dist/utils/use-server-store.js
4
+ // ../shared-api/dist/utils/use-server-store.js
5
5
  /**
6
6
  * The selected server of an API page, persisted in `localStorage`.
7
7
  */
@@ -52,5 +52,4 @@ function useServerStore({ storageKey, keyOf, resolve, defaultKey }) {
52
52
  storageKey
53
53
  ]);
54
54
  }
55
- //#endregion
56
55
  export { useServerStore };
@@ -3,7 +3,6 @@ import { OAuthFlows, OperationObject, SecuritySchemeObject } from "../types.js";
3
3
  import { FC, ReactNode } from "react";
4
4
  import { JsonSchema } from "@fumadocs/json-schema";
5
5
  import { DataEngine, FieldKey, Stf } from "@fumari/stf";
6
- //#region src/playground/auth.d.ts
7
6
  /** how token requests authenticate the client */
8
7
  interface OAuthClient {
9
8
  client_id: string;
@@ -155,6 +154,8 @@ export interface AuthRenderProps {
155
154
  description?: string;
156
155
  schema?: Exclude<JsonSchema, boolean>;
157
156
  path?: string;
157
+ /** after the input, like a button filling the value */
158
+ end?: ReactNode;
158
159
  }>;
159
160
  /** a row opening `component` in a panel */
160
161
  Panel: FC<{
@@ -203,5 +204,4 @@ export interface AuthFieldsOptions {
203
204
  * The auth fields of an API playground: the values it persists, and the request data they encode into.
204
205
  */
205
206
  export declare function useAuthFields(engine: DataEngine, { operation, providers, transform }?: AuthFieldsOptions): AuthFields;
206
- //#endregion
207
207
  export {};
@@ -8,7 +8,7 @@ import { createContext, use, useCallback, useEffect, useMemo, useState, useSyncE
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useListener, useStf } from "@fumari/stf";
10
10
  import { arrayStartsWith, objectGet } from "@fumari/stf/lib/utils";
11
- //#region src/playground/auth.tsx
11
+ // src/playground/auth.tsx
12
12
  const pendingFlowKey = "fumadocs-openapi-flow";
13
13
  function leavePage(url, flow, redirectUrl) {
14
14
  sessionStorage.setItem(pendingFlowKey, JSON.stringify(flow));
@@ -470,5 +470,4 @@ function useAuthFields(engine, { operation, providers, transform } = {}) {
470
470
  }, [page, fields])
471
471
  };
472
472
  }
473
- //#endregion
474
473
  export { PlaygroundAuthProvider, finishOAuthFlow, requestOAuthToken, useAuthFields, useAuthRedirect, useOpenIdConnectFlows, usePlaygroundAuth };
@@ -1,7 +1,6 @@
1
1
  import { RequestData } from "../requests/types.js";
2
2
  import { MediaAdapter } from "../requests/media/adapter.js";
3
3
  import { Awaitable } from "../types.js";
4
- //#region src/playground/fetcher.d.ts
5
4
  export type FetchResult = FetchResponseResult | FetchErrorResult;
6
5
  export interface FetchErrorResult {
7
6
  type: 'client_error';
@@ -48,5 +47,4 @@ export interface BrowserFetcherOptions {
48
47
  */
49
48
  onRequestInit?: (requestInit: RequestInit) => Awaitable<RequestInit>;
50
49
  }
51
- export declare function createBrowserFetcher(adapters: Record<string, MediaAdapter>, { proxyUrl, proxyForwardCookie, requestTimeout, onRequestInit }?: BrowserFetcherOptions): Fetcher;
52
- //#endregion
50
+ export declare function createBrowserFetcher(adapters: Record<string, MediaAdapter>, { proxyUrl, proxyForwardCookie, requestTimeout, onRequestInit }?: BrowserFetcherOptions): Fetcher;
@@ -1,6 +1,6 @@
1
1
  import { resolveMediaAdapter } from "../requests/media/resolve-adapter.js";
2
2
  import { require_fast_content_type_parse } from "../node_modules/.pnpm/fast-content-type-parse@4.0.1/node_modules/fast-content-type-parse/index.js";
3
- //#region src/playground/fetcher.ts
3
+ // src/playground/fetcher.ts
4
4
  var import_fast_content_type_parse = require_fast_content_type_parse();
5
5
  /**
6
6
  * The URL requesting `url` through the proxy of `createProxy()`, `url` itself without a proxy.
@@ -90,5 +90,4 @@ function getFileName(headers) {
90
90
  }
91
91
  return name?.replace(/^.*[/\\]/, "") || void 0;
92
92
  }
93
- //#endregion
94
93
  export { createBrowserFetcher, proxied };
@@ -2,7 +2,6 @@ import { BrowserFetcherOptions, FetchResult } from "./fetcher.js";
2
2
  import { AuthField, AuthProvider, AuthRequirement, OAuthFlowInput, OAuthFlowType } from "./auth.js";
3
3
  import { JsonSchema } from "@fumadocs/json-schema";
4
4
  import { Stf } from "@fumari/stf";
5
- //#region src/playground/use-playground.d.ts
6
5
  export interface PlaygroundOptions {
7
6
  /** handle security schemes, before the built-in providers */
8
7
  authProviders?: AuthProvider[];
@@ -60,5 +59,4 @@ export interface Playground {
60
59
  *
61
60
  * Edits are synced to the example request, so code usages follow them.
62
61
  */
63
- export declare function usePlayground({ authProviders, transformAuthInputs, fetchOptions }?: PlaygroundOptions): Playground;
64
- //#endregion
62
+ export declare function usePlayground({ authProviders, transformAuthInputs, fetchOptions }?: PlaygroundOptions): Playground;
@@ -9,7 +9,7 @@ import { requestOAuthToken, useAuthFields, usePlaygroundAuth } from "./auth.js";
9
9
  import { useOpenAPI } from "../utils/create-page.js";
10
10
  import { useEffect, useEffectEvent, useMemo, useState } from "react";
11
11
  import { DataEngine } from "@fumari/stf";
12
- //#region src/playground/use-playground.tsx
12
+ // src/playground/use-playground.tsx
13
13
  /** the form of a playground, its `auth` is the auth values of page */
14
14
  var PlaygroundForm = class extends DataEngine {
15
15
  constructor(defaultValues, auth) {
@@ -163,5 +163,4 @@ function usePlayground({ authProviders, transformAuthInputs, fetchOptions } = {}
163
163
  }
164
164
  };
165
165
  }
166
- //#endregion
167
166
  export { usePlayground };
@@ -1,4 +1,2 @@
1
1
  import { CodeUsageGeneratorRegistry } from "./index.js";
2
- //#region src/requests/generators/all.d.ts
3
- export declare function registerDefault(registry: CodeUsageGeneratorRegistry): CodeUsageGeneratorRegistry;
4
- //#endregion
2
+ export declare function registerDefault(registry: CodeUsageGeneratorRegistry): CodeUsageGeneratorRegistry;
@@ -5,7 +5,7 @@ import { java } from "./java.js";
5
5
  import { javascript } from "./javascript.js";
6
6
  import { python } from "./python.js";
7
7
  import { rust } from "./rust.js";
8
- //#region src/requests/generators/all.ts
8
+ // src/requests/generators/all.ts
9
9
  function registerDefault(registry) {
10
10
  registry.add("curl", curl);
11
11
  registry.add("js", javascript);
@@ -16,5 +16,4 @@ function registerDefault(registry) {
16
16
  registry.add("rust", rust);
17
17
  return registry;
18
18
  }
19
- //#endregion
20
19
  export { registerDefault };
@@ -1,4 +1,2 @@
1
1
  import { CodeUsageGenerator } from "./index.js";
2
- //#region src/requests/generators/csharp.d.ts
3
- export declare const csharp: CodeUsageGenerator;
4
- //#endregion
2
+ export declare const csharp: CodeUsageGenerator;
@@ -1,6 +1,6 @@
1
1
  import { cookieString, doubleQuote } from "../string-utils.js";
2
2
  import { generateBodyExample } from "../media/adapter.js";
3
- //#region src/requests/generators/csharp.ts
3
+ // src/requests/generators/csharp.ts
4
4
  const csharp = {
5
5
  label: "C#",
6
6
  lang: "csharp",
@@ -27,5 +27,4 @@ const csharp = {
27
27
  return s.join("\n");
28
28
  }
29
29
  };
30
- //#endregion
31
30
  export { csharp };
@@ -1,4 +1,2 @@
1
1
  import { CodeUsageGenerator } from "./index.js";
2
- //#region src/requests/generators/curl.d.ts
3
- export declare const curl: CodeUsageGenerator;
4
- //#endregion
2
+ export declare const curl: CodeUsageGenerator;
@@ -1,7 +1,7 @@
1
1
  import { shellQuote } from "../../packages/shared-api/dist/codegen.js";
2
2
  import { inputToString } from "../string-utils.js";
3
3
  import { resolveMediaType } from "../media/resolve-adapter.js";
4
- //#region src/requests/generators/curl.ts
4
+ // src/requests/generators/curl.ts
5
5
  const curl = {
6
6
  label: "cURL",
7
7
  lang: "bash",
@@ -21,5 +21,4 @@ const curl = {
21
21
  return s.join(" \\\n ");
22
22
  }
23
23
  };
24
- //#endregion
25
24
  export { curl };