fumadocs-openapi 9.7.3 → 10.0.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 (151) hide show
  1. package/dist/generate-file.d.ts +3 -4
  2. package/dist/generate-file.d.ts.map +1 -1
  3. package/dist/generate-file.js +4 -34
  4. package/dist/playground/client.d.ts +43 -22
  5. package/dist/playground/client.d.ts.map +1 -1
  6. package/dist/playground/client.js +68 -63
  7. package/dist/playground/{inputs.d.ts → components/inputs.d.ts} +1 -1
  8. package/dist/playground/components/inputs.d.ts.map +1 -0
  9. package/dist/playground/{inputs.js → components/inputs.js} +7 -7
  10. package/dist/playground/components/oauth-dialog.d.ts.map +1 -0
  11. package/dist/playground/components/server-select.d.ts.map +1 -0
  12. package/dist/{ui → playground/components}/server-select.js +6 -7
  13. package/dist/playground/index.d.ts +1 -4
  14. package/dist/playground/index.d.ts.map +1 -1
  15. package/dist/playground/index.js +5 -3
  16. package/dist/playground/lazy.d.ts +2 -0
  17. package/dist/playground/lazy.d.ts.map +1 -0
  18. package/dist/playground/lazy.js +3 -0
  19. package/dist/requests/generators/index.d.ts +2 -2
  20. package/dist/requests/generators/index.d.ts.map +1 -1
  21. package/dist/requests/generators/index.js +6 -0
  22. package/dist/requests/media/adapter.d.ts +0 -6
  23. package/dist/requests/media/adapter.d.ts.map +1 -1
  24. package/dist/scalar/client.d.ts +1 -0
  25. package/dist/scalar/client.d.ts.map +1 -1
  26. package/dist/scalar/client.js +2 -3
  27. package/dist/scalar/index.d.ts +7 -6
  28. package/dist/scalar/index.d.ts.map +1 -1
  29. package/dist/scalar/index.js +17 -1
  30. package/dist/server/create.d.ts +11 -59
  31. package/dist/server/create.d.ts.map +1 -1
  32. package/dist/server/create.js +5 -14
  33. package/dist/server/source-api.d.ts +1 -1
  34. package/dist/server/source-api.d.ts.map +1 -1
  35. package/dist/server/source-api.js +1 -1
  36. package/dist/types.d.ts +12 -4
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/ui/api-page.d.ts +145 -0
  39. package/dist/ui/api-page.d.ts.map +1 -0
  40. package/dist/ui/api-page.js +120 -0
  41. package/dist/ui/client/index.d.ts +29 -0
  42. package/dist/ui/client/index.d.ts.map +1 -0
  43. package/dist/ui/client/index.js +4 -0
  44. package/dist/ui/client/storage-key.d.ts +9 -0
  45. package/dist/ui/client/storage-key.d.ts.map +1 -0
  46. package/dist/ui/client/storage-key.js +12 -0
  47. package/dist/ui/components/method-label.d.ts +1 -1
  48. package/dist/ui/contexts/api.d.ts +12 -10
  49. package/dist/ui/contexts/api.d.ts.map +1 -1
  50. package/dist/ui/contexts/api.js +53 -37
  51. package/dist/ui/contexts/api.lazy.d.ts +2 -0
  52. package/dist/ui/contexts/api.lazy.d.ts.map +1 -0
  53. package/dist/ui/contexts/api.lazy.js +3 -0
  54. package/dist/ui/contexts/operation.d.ts +20 -0
  55. package/dist/ui/contexts/operation.d.ts.map +1 -0
  56. package/dist/ui/contexts/operation.js +48 -0
  57. package/dist/ui/contexts/operation.lazy.d.ts +2 -0
  58. package/dist/ui/contexts/operation.lazy.d.ts.map +1 -0
  59. package/dist/ui/contexts/operation.lazy.js +3 -0
  60. package/dist/ui/index.d.ts +1 -8
  61. package/dist/ui/index.d.ts.map +1 -1
  62. package/dist/ui/index.js +1 -26
  63. package/dist/ui/{select-tabs.d.ts → operation/client.d.ts} +5 -2
  64. package/dist/ui/operation/client.d.ts.map +1 -0
  65. package/dist/ui/{client.js → operation/client.js} +18 -1
  66. package/dist/ui/operation/example-panel/client.d.ts +4 -0
  67. package/dist/ui/operation/example-panel/client.d.ts.map +1 -0
  68. package/dist/ui/operation/example-panel/client.js +50 -0
  69. package/dist/ui/operation/example-panel/index.d.ts +58 -0
  70. package/dist/ui/operation/example-panel/index.d.ts.map +1 -0
  71. package/dist/ui/operation/example-panel/index.js +140 -0
  72. package/dist/ui/operation/example-panel/lazy.d.ts +3 -0
  73. package/dist/ui/operation/example-panel/lazy.d.ts.map +1 -0
  74. package/dist/ui/operation/example-panel/lazy.js +4 -0
  75. package/dist/ui/operation/get-request-data.d.ts.map +1 -0
  76. package/dist/ui/operation/index.d.ts +11 -0
  77. package/dist/ui/operation/index.d.ts.map +1 -0
  78. package/dist/{render → ui}/operation/index.js +50 -24
  79. package/dist/ui/schema/client.d.ts +11 -0
  80. package/dist/ui/schema/client.d.ts.map +1 -0
  81. package/dist/{render → ui}/schema/client.js +22 -12
  82. package/dist/{render/schema/server.d.ts → ui/schema/index.d.ts} +5 -4
  83. package/dist/ui/schema/index.d.ts.map +1 -0
  84. package/dist/{render/schema/server.js → ui/schema/index.js} +11 -5
  85. package/dist/ui/schema/lazy.d.ts +2 -0
  86. package/dist/ui/schema/lazy.d.ts.map +1 -0
  87. package/dist/ui/schema/lazy.js +3 -0
  88. package/dist/utils/get-typescript-schema.d.ts +3 -2
  89. package/dist/utils/get-typescript-schema.d.ts.map +1 -1
  90. package/dist/utils/get-typescript-schema.js +12 -7
  91. package/dist/utils/lazy.d.ts +5 -0
  92. package/dist/utils/lazy.d.ts.map +1 -0
  93. package/dist/utils/lazy.js +12 -0
  94. package/dist/utils/pages/builder.d.ts +1 -1
  95. package/dist/utils/pages/builder.d.ts.map +1 -1
  96. package/dist/utils/pages/to-body.d.ts +2 -3
  97. package/dist/utils/pages/to-body.d.ts.map +1 -1
  98. package/dist/utils/pages/to-body.js +7 -7
  99. package/dist/utils/pages/to-text.d.ts.map +1 -1
  100. package/dist/utils/process-document.d.ts +1 -0
  101. package/dist/utils/process-document.d.ts.map +1 -1
  102. package/dist/utils/process-document.js +7 -2
  103. package/package.json +20 -16
  104. package/dist/playground/auth/oauth-dialog.d.ts.map +0 -1
  105. package/dist/playground/inputs.d.ts.map +0 -1
  106. package/dist/render/api-page.d.ts +0 -33
  107. package/dist/render/api-page.d.ts.map +0 -1
  108. package/dist/render/api-page.js +0 -59
  109. package/dist/render/codeblock.d.ts +0 -9
  110. package/dist/render/codeblock.d.ts.map +0 -1
  111. package/dist/render/codeblock.js +0 -14
  112. package/dist/render/heading.d.ts +0 -4
  113. package/dist/render/heading.d.ts.map +0 -1
  114. package/dist/render/heading.js +0 -6
  115. package/dist/render/markdown.d.ts +0 -5
  116. package/dist/render/markdown.d.ts.map +0 -1
  117. package/dist/render/markdown.js +0 -31
  118. package/dist/render/operation/api-example.d.ts +0 -30
  119. package/dist/render/operation/api-example.d.ts.map +0 -1
  120. package/dist/render/operation/api-example.js +0 -103
  121. package/dist/render/operation/get-request-data.d.ts.map +0 -1
  122. package/dist/render/operation/index.d.ts +0 -27
  123. package/dist/render/operation/index.d.ts.map +0 -1
  124. package/dist/render/renderer.d.ts +0 -79
  125. package/dist/render/renderer.d.ts.map +0 -1
  126. package/dist/render/renderer.js +0 -25
  127. package/dist/render/schema/client.d.ts +0 -18
  128. package/dist/render/schema/client.d.ts.map +0 -1
  129. package/dist/render/schema/index.d.ts +0 -7
  130. package/dist/render/schema/index.d.ts.map +0 -1
  131. package/dist/render/schema/index.js +0 -11
  132. package/dist/render/schema/server.d.ts.map +0 -1
  133. package/dist/render/schema/ui.d.ts +0 -16
  134. package/dist/render/schema/ui.d.ts.map +0 -1
  135. package/dist/render/schema/ui.js +0 -14
  136. package/dist/ui/client.d.ts +0 -4
  137. package/dist/ui/client.d.ts.map +0 -1
  138. package/dist/ui/contexts/code-example.d.ts +0 -24
  139. package/dist/ui/contexts/code-example.d.ts.map +0 -1
  140. package/dist/ui/contexts/code-example.js +0 -97
  141. package/dist/ui/lazy.d.ts +0 -16
  142. package/dist/ui/lazy.d.ts.map +0 -1
  143. package/dist/ui/lazy.js +0 -22
  144. package/dist/ui/select-tabs.d.ts.map +0 -1
  145. package/dist/ui/select-tabs.js +0 -20
  146. package/dist/ui/server-select.d.ts.map +0 -1
  147. /package/dist/playground/{auth → components}/oauth-dialog.d.ts +0 -0
  148. /package/dist/playground/{auth → components}/oauth-dialog.js +0 -0
  149. /package/dist/{ui → playground/components}/server-select.d.ts +0 -0
  150. /package/dist/{render → ui}/operation/get-request-data.d.ts +0 -0
  151. /package/dist/{render → ui}/operation/get-request-data.js +0 -0
@@ -1,20 +1,20 @@
1
- export function toBody(server, entry) {
1
+ export function toBody(entry) {
2
2
  if (entry.type === 'operation')
3
- return server.getAPIPageProps({
3
+ return {
4
4
  hasHead: false,
5
5
  document: entry.schemaId,
6
6
  operations: [entry.item],
7
- });
7
+ };
8
8
  if (entry.type === 'webhook')
9
- return server.getAPIPageProps({
9
+ return {
10
10
  hasHead: false,
11
11
  document: entry.schemaId,
12
12
  webhooks: [entry.item],
13
- });
14
- return server.getAPIPageProps({
13
+ };
14
+ return {
15
15
  hasHead: true,
16
16
  document: entry.schemaId,
17
17
  operations: entry.operations,
18
18
  webhooks: entry.webhooks,
19
- });
19
+ };
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"to-text.d.ts","sourceRoot":"","sources":["../../../src/utils/pages/to-text.ts"],"names":[],"mappings":"AAMA,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;AAEzD,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,WAA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ACpB,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"}
@@ -6,6 +6,7 @@ export type ProcessedDocument = {
6
6
  * dereferenced document
7
7
  */
8
8
  dereferenced: NoReference<Document>;
9
+ _internal_idToSchema: () => Map<string, object>;
9
10
  /**
10
11
  * Get raw object from dereference object
11
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"process-document.d.ts","sourceRoot":"","sources":["../../src/utils/process-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEpC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE/C,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAIF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAqC5B"}
1
+ {"version":3,"file":"process-document.d.ts","sourceRoot":"","sources":["../../src/utils/process-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEpC,oBAAoB,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhD;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE/C,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAIF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAyC5B"}
@@ -36,16 +36,21 @@ export async function processDocument(input) {
36
36
  * Dereferenced value and its original `$ref` value
37
37
  */
38
38
  const dereferenceMap = new WeakMap();
39
+ const serializable = new Map();
39
40
  return {
40
- dereferenced: (await dereference(document, {
41
+ dereferenced: dereference(document, {
41
42
  throwOnError: true,
42
43
  onDereference({ schema, ref }) {
44
+ serializable.set(ref, schema);
43
45
  dereferenceMap.set(schema, ref);
44
46
  },
45
- })).schema,
47
+ }).schema,
46
48
  getRawRef(obj) {
47
49
  return dereferenceMap.get(obj);
48
50
  },
51
+ _internal_idToSchema() {
52
+ return serializable;
53
+ },
49
54
  bundled: document,
50
55
  };
51
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "9.7.3",
3
+ "version": "10.0.1",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -22,13 +22,17 @@
22
22
  "types": "./dist/ui/index.d.ts"
23
23
  },
24
24
  "./ui/client": {
25
- "import": "./dist/ui/client.js",
26
- "types": "./dist/ui/client.d.ts"
25
+ "import": "./dist/ui/client/index.js",
26
+ "types": "./dist/ui/client/index.d.ts"
27
27
  },
28
28
  "./playground": {
29
29
  "import": "./dist/playground/index.js",
30
30
  "types": "./dist/playground/index.d.ts"
31
31
  },
32
+ "./playground/client": {
33
+ "import": "./dist/playground/client.js",
34
+ "types": "./dist/playground/client.d.ts"
35
+ },
32
36
  "./scalar": {
33
37
  "import": "./dist/scalar/index.js",
34
38
  "types": "./dist/scalar/index.d.ts"
@@ -45,13 +49,13 @@
45
49
  "css"
46
50
  ],
47
51
  "dependencies": {
48
- "@fumari/json-schema-to-typescript": "^1.1.3",
52
+ "@fumari/json-schema-to-typescript": "^2.0.0",
49
53
  "@radix-ui/react-accordion": "^1.2.12",
50
54
  "@radix-ui/react-dialog": "^1.1.15",
51
55
  "@radix-ui/react-select": "^2.2.6",
52
- "@radix-ui/react-slot": "^1.2.3",
53
- "@scalar/json-magic": "^0.6.1",
54
- "@scalar/openapi-parser": "0.22.3",
56
+ "@radix-ui/react-slot": "^1.2.4",
57
+ "@scalar/json-magic": "^0.7.0",
58
+ "@scalar/openapi-parser": "0.23.0",
55
59
  "ajv": "^8.17.1",
56
60
  "class-variance-authority": "^0.7.1",
57
61
  "github-slugger": "^2.0.0",
@@ -60,32 +64,32 @@
60
64
  "js-yaml": "^4.1.0",
61
65
  "next-themes": "^0.4.6",
62
66
  "openapi-sampler": "^1.6.2",
63
- "react-hook-form": "^7.65.0",
67
+ "react-hook-form": "^7.66.0",
64
68
  "remark": "^15.0.1",
65
69
  "remark-rehype": "^11.1.2",
66
70
  "tinyglobby": "^0.2.15",
67
71
  "xml-js": "^1.6.11",
68
- "fumadocs-core": "16.0.7",
69
- "fumadocs-ui": "16.0.7"
72
+ "fumadocs-ui": "16.0.8",
73
+ "fumadocs-core": "16.0.8"
70
74
  },
71
75
  "devDependencies": {
72
- "@scalar/api-client-react": "^1.3.46",
76
+ "@scalar/api-client-react": "^1.3.48",
73
77
  "@types/js-yaml": "^4.0.9",
74
- "@types/node": "24.9.2",
78
+ "@types/node": "24.10.0",
75
79
  "@types/openapi-sampler": "^1.0.3",
76
80
  "@types/react": "^19.2.2",
77
81
  "json-schema-typed": "^8.0.1",
78
82
  "openapi-types": "^12.1.3",
79
83
  "tailwindcss": "^4.1.16",
80
84
  "tsc-alias": "^1.8.16",
81
- "eslint-config-custom": "0.0.0",
82
- "tsconfig": "0.0.0"
85
+ "tsconfig": "0.0.0",
86
+ "eslint-config-custom": "0.0.0"
83
87
  },
84
88
  "peerDependencies": {
85
89
  "@scalar/api-client-react": "*",
86
90
  "@types/react": "*",
87
- "react": "18.x.x || 19.x.x",
88
- "react-dom": "18.x.x || 19.x.x"
91
+ "react": "^19.2.0",
92
+ "react-dom": "^19.2.0"
89
93
  },
90
94
  "peerDependenciesMeta": {
91
95
  "@types/react": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauth-dialog.d.ts","sourceRoot":"","sources":["../../../src/playground/auth/oauth-dialog.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAa5D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC,oBAAoB,CAAC;IACzC,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IA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U,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,kDA4KA"}
@@ -1,33 +0,0 @@
1
- import type { RenderContext } from '../types.js';
2
- import type { OpenAPIV3_1 } from 'openapi-types';
3
- import { type ProcessedDocument } from '../utils/process-document.js';
4
- import type { SharedOpenAPIOptions } from '../server/index.js';
5
- export interface ApiPageProps extends SharedOpenAPIOptions {
6
- document: Promise<ProcessedDocument> | string | ProcessedDocument;
7
- hasHead: boolean;
8
- /**
9
- * An array of operations
10
- */
11
- operations?: OperationItem[];
12
- webhooks?: WebhookItem[];
13
- }
14
- export interface WebhookItem {
15
- /**
16
- * webhook name in `webhooks`
17
- */
18
- name: string;
19
- method: OpenAPIV3_1.HttpMethods;
20
- }
21
- export interface OperationItem {
22
- /**
23
- * the path of operation in `paths`
24
- */
25
- path: string;
26
- /**
27
- * the HTTP method of operation
28
- */
29
- method: OpenAPIV3_1.HttpMethods;
30
- }
31
- export declare function APIPage(props: ApiPageProps): Promise<import("react/jsx-runtime").JSX.Element>;
32
- export declare function getContext(schema: ProcessedDocument, options?: SharedOpenAPIOptions): Promise<RenderContext>;
33
- //# sourceMappingURL=api-page.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-page.d.ts","sourceRoot":"","sources":["../../src/render/api-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,MAAM,GAAG,iBAAiB,CAAC;IAClE,OAAO,EAAE,OAAO,CAAC;IAEjB;;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,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,oDAgEhD;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,CA0BxB"}
@@ -1,59 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Slugger from 'github-slugger';
3
- import { Operation } from '../render/operation/index.js';
4
- import { createMethod } from '../utils/schema.js';
5
- import { createRenders } from '../render/renderer.js';
6
- import { processDocumentCached, } from '../utils/process-document.js';
7
- import { defaultAdapters } from '../requests/media/adapter.js';
8
- export async function APIPage(props) {
9
- const { operations, hasHead = true, webhooks } = props;
10
- const processed = typeof props.document === 'string'
11
- ? await processDocumentCached(props.document)
12
- : await props.document;
13
- const ctx = await getContext(processed, props);
14
- const { dereferenced } = processed;
15
- return (_jsxs(ctx.renderer.Root, { ctx: ctx, children: [operations?.map((item) => {
16
- const pathItem = dereferenced.paths?.[item.path];
17
- if (!pathItem)
18
- throw new Error(`[Fumadocs OpenAPI] Path not found in OpenAPI schema: ${item.path}`);
19
- const operation = pathItem[item.method];
20
- if (!operation)
21
- throw new Error(`[Fumadocs OpenAPI] Method ${item.method} not found in operation: ${item.path}`);
22
- const method = createMethod(item.method, pathItem, operation);
23
- return (_jsx(Operation, { method: method, path: item.path, ctx: ctx, hasHead: hasHead }, `${item.path}:${item.method}`));
24
- }), webhooks?.map((item) => {
25
- const webhook = dereferenced.webhooks?.[item.name];
26
- if (!webhook)
27
- throw new Error(`[Fumadocs OpenAPI] Webhook not found in OpenAPI schema: ${item.name}`);
28
- const hook = webhook[item.method];
29
- if (!hook)
30
- throw new Error(`[Fumadocs OpenAPI] Method ${item.method} not found in webhook: ${item.name}`);
31
- const method = createMethod(item.method, webhook, hook);
32
- return (_jsx(Operation, { type: "webhook", method: method, ctx: ctx, path: `/${item.name}`, hasHead: hasHead }, `${item.name}:${item.method}`));
33
- })] }));
34
- }
35
- export async function getContext(schema, options = {}) {
36
- const document = schema.dereferenced;
37
- const servers = document.servers && document.servers.length > 0
38
- ? document.servers
39
- : [{ url: '/' }];
40
- return {
41
- schema,
42
- proxyUrl: options.proxyUrl,
43
- disablePlayground: options.disablePlayground,
44
- showResponseSchema: options.showResponseSchema,
45
- renderer: {
46
- ...createRenders(),
47
- ...options.renderer,
48
- },
49
- shikiOptions: options.shikiOptions,
50
- generateTypeScriptSchema: options.generateTypeScriptSchema,
51
- generateCodeSamples: options.generateCodeSamples,
52
- servers,
53
- mediaAdapters: {
54
- ...defaultAdapters,
55
- ...options.mediaAdapters,
56
- },
57
- slugger: new Slugger(),
58
- };
59
- }
@@ -1,9 +0,0 @@
1
- import { type HTMLAttributes } from 'react';
2
- import type { RenderContext } from '../types.js';
3
- export interface CodeBlockProps extends HTMLAttributes<HTMLElement> {
4
- code: string;
5
- lang: string;
6
- ctx: RenderContext;
7
- }
8
- export declare function CodeBlock({ code, lang, ctx, ...rest }: CodeBlockProps): Promise<import("react/jsx-runtime").JSX.Element>;
9
- //# sourceMappingURL=codeblock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/render/codeblock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,WAAW,CAAC;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,wBAAsB,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,oDAc3E"}
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as Base from 'fumadocs-ui/components/codeblock';
3
- import { highlight } from 'fumadocs-core/highlight';
4
- import { cn } from 'fumadocs-ui/utils/cn';
5
- export async function CodeBlock({ code, lang, ctx, ...rest }) {
6
- const rendered = await highlight(code, {
7
- lang,
8
- ...ctx.shikiOptions,
9
- components: {
10
- pre: (props) => _jsx(Base.Pre, { ...props }),
11
- },
12
- });
13
- return (_jsx(Base.CodeBlock, { className: cn('my-0', rest.className), children: rendered }));
14
- }
@@ -1,4 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { RenderContext } from '../types.js';
3
- export declare function heading(depth: number, text: string, ctx: RenderContext, children?: ReactNode): ReactNode;
4
- //# sourceMappingURL=heading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/render/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,EAClB,QAAQ,GAAE,SAAgB,GACzB,SAAS,CAQX"}
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Heading } from 'fumadocs-ui/components/heading';
3
- export function heading(depth, text, ctx, children = text) {
4
- const id = ctx.slugger.slug(text);
5
- return (_jsx(Heading, { id: id, as: `h${depth.toString()}`, children: children }, id));
6
- }
@@ -1,5 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- export declare function Markdown({ text }: {
3
- text: string;
4
- }): Promise<ReactElement<unknown, string | import("react").JSXElementConstructor<any>>>;
5
- //# sourceMappingURL=markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/render/markdown.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAkC1C,wBAAsB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,uFAMxD"}
@@ -1,31 +0,0 @@
1
- import { rehypeCode, remarkGfm, remarkImage, } from 'fumadocs-core/mdx-plugins';
2
- import defaultMdxComponents from 'fumadocs-ui/mdx';
3
- import { remark } from 'remark';
4
- import remarkRehype from 'remark-rehype';
5
- import { toJsxRuntime } from 'hast-util-to-jsx-runtime';
6
- import * as JsxRuntime from 'react/jsx-runtime';
7
- const processor = remark()
8
- .use(remarkGfm)
9
- .use(remarkImage, { useImport: false })
10
- .use(remarkRehype)
11
- .use(rehypeCode, {
12
- langs: [],
13
- lazy: true,
14
- })
15
- .use(rehypeReact);
16
- function rehypeReact() {
17
- this.compiler = (tree, file) => {
18
- return toJsxRuntime(tree, {
19
- development: false,
20
- filePath: file.path,
21
- ...JsxRuntime,
22
- components: defaultMdxComponents,
23
- });
24
- };
25
- }
26
- export async function Markdown({ text }) {
27
- const out = await processor.process({
28
- value: text,
29
- });
30
- return out.result;
31
- }
@@ -1,30 +0,0 @@
1
- import type { MethodInformation, RenderContext } from '../../types.js';
2
- import { type ReactNode } from 'react';
3
- import { type CodeSample } from '../../render/operation/index.js';
4
- import type { RawRequestData, RequestData } from '../../requests/types.js';
5
- interface CustomProperty {
6
- 'x-codeSamples'?: CodeSample[];
7
- 'x-selectedCodeSample'?: string;
8
- 'x-exclusiveCodeSample'?: string;
9
- }
10
- interface CodeExampleItem {
11
- key: string;
12
- name: string;
13
- description?: string;
14
- data: RawRequestData;
15
- encoded: RequestData;
16
- }
17
- export declare function APIExampleProvider({ examples, method, children, route, }: {
18
- examples: CodeExampleItem[];
19
- method: MethodInformation & CustomProperty;
20
- route: string;
21
- children: ReactNode;
22
- }): import("react/jsx-runtime").JSX.Element;
23
- export declare function getAPIExamples(path: string, method: MethodInformation, ctx: RenderContext): CodeExampleItem[];
24
- export declare function APIExample({ method, examples, ctx, }: {
25
- examples: CodeExampleItem[];
26
- method: MethodInformation & CustomProperty;
27
- ctx: RenderContext;
28
- }): Promise<import("react/jsx-runtime").JSX.Element>;
29
- export {};
30
- //# sourceMappingURL=api-example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-example.d.ts","sourceRoot":"","sources":["../../../src/render/operation/api-example.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAM3D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpE,UAAU,cAAc;IACtB,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAYA;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,aAAa,GACjB,eAAe,EAAE,CA0CnB;AAED,wBAAsB,UAAU,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC;IAC3C,GAAG,EAAE,aAAa,CAAC;CACpB,oDAmCA"}
@@ -1,103 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Markdown } from '../../render/markdown.js';
3
- import { CodeBlock } from '../../render/codeblock.js';
4
- import { CodeExample, CodeExampleProvider } from '../../ui/lazy.js';
5
- import { getPreferredType } from '../../utils/schema.js';
6
- import { getRequestData } from '../../render/operation/get-request-data.js';
7
- import { sample } from 'openapi-sampler';
8
- import { defaultSamples } from '../../requests/generators/index.js';
9
- import { encodeRequestData } from '../../requests/media/encode.js';
10
- export function APIExampleProvider({ examples, method, children, route, }) {
11
- const exclusiveSampleKey = method['x-exclusiveCodeSample'];
12
- return (_jsx(CodeExampleProvider, { initialKey: exclusiveSampleKey, route: route, examples: examples, children: children }));
13
- }
14
- export function getAPIExamples(path, method, ctx) {
15
- const media = method.requestBody
16
- ? getPreferredType(method.requestBody.content)
17
- : null;
18
- const bodyOfType = media ? method.requestBody?.content[media] : null;
19
- if (bodyOfType?.examples) {
20
- const result = [];
21
- for (const [key, value] of Object.entries(bodyOfType.examples)) {
22
- const data = getRequestData(path, method, key, ctx);
23
- result.push({
24
- key,
25
- name: value.summary ?? key,
26
- description: value.description,
27
- data,
28
- encoded: encodeRequestData(data, ctx.mediaAdapters, method.parameters ?? []),
29
- });
30
- }
31
- if (result.length > 0)
32
- return result;
33
- }
34
- const data = getRequestData(path, method, null, ctx);
35
- return [
36
- {
37
- key: '_default',
38
- name: 'Default',
39
- description: bodyOfType?.schema?.description,
40
- data,
41
- encoded: encodeRequestData(data, ctx.mediaAdapters, method.parameters ?? []),
42
- },
43
- ];
44
- }
45
- export async function APIExample({ method, examples, ctx, }) {
46
- const renderer = ctx.renderer;
47
- const generators = dedupe([
48
- ...defaultSamples,
49
- ...(ctx.generateCodeSamples ? await ctx.generateCodeSamples(method) : []),
50
- ...(method['x-codeSamples'] ?? []),
51
- ]).filter((generator) => generator.source !== false);
52
- const exclusiveSampleKey = method['x-exclusiveCodeSample'];
53
- return (_jsxs(renderer.APIExample, { children: [examples.length > 1 && !exclusiveSampleKey && (_jsx(renderer.CodeExampleSelector, { items: examples.map((sample) => ({
54
- title: sample.name,
55
- description: sample.description ? (_jsx(Markdown, { text: sample.description })) : null,
56
- value: sample.key,
57
- })) })), generators.length > 0 && (_jsx(renderer.Requests, { items: generators.map((s) => s.label ?? s.lang), children: generators.map((generator, i) => (_jsx(renderer.Request, { name: generator.label ?? generator.lang, children: _jsx(CodeExample, { ...generator }) }, i))) })), _jsx(ResponseTabs, { operation: method, ctx: ctx })] }));
58
- }
59
- /**
60
- * Remove duplicated labels
61
- */
62
- function dedupe(samples) {
63
- const set = new Set();
64
- const out = [];
65
- for (let i = samples.length - 1; i >= 0; i--) {
66
- const item = samples[i];
67
- if (item.label) {
68
- if (set.has(item.label))
69
- continue;
70
- set.add(item.label);
71
- }
72
- out.unshift(item);
73
- }
74
- return out;
75
- }
76
- function ResponseTabs({ operation, ctx, }) {
77
- const { renderer } = ctx;
78
- if (!operation.responses)
79
- return null;
80
- async function renderResponse(code) {
81
- const response = operation.responses?.[code];
82
- const media = response?.content ? getPreferredType(response.content) : null;
83
- const responseOfType = media ? response?.content?.[media] : null;
84
- let slot = 'Empty';
85
- if (responseOfType?.examples) {
86
- const values = [];
87
- const children = Object.entries(responseOfType.examples).map(([key, sample]) => {
88
- const title = sample?.summary ?? `Example ${key}`;
89
- values.push(title);
90
- return (_jsxs(renderer.ResponseType, { label: title, children: [sample?.description && _jsx(Markdown, { text: sample.description }), _jsx(CodeBlock, { lang: "json", code: JSON.stringify(sample.value, null, 2), ctx: ctx })] }, key));
91
- });
92
- slot = (_jsx(renderer.ResponseTypes, { defaultValue: values[0], children: children }));
93
- }
94
- else if (responseOfType?.example || responseOfType?.schema) {
95
- slot = (_jsx(CodeBlock, { lang: "json", code: JSON.stringify(responseOfType.example ?? sample(responseOfType.schema), null, 2), ctx: ctx }));
96
- }
97
- return _jsx(renderer.Response, { value: code, children: slot });
98
- }
99
- const codes = Object.keys(operation.responses);
100
- if (codes.length === 0)
101
- return null;
102
- return (_jsx(renderer.Responses, { items: codes, children: codes.map((code) => renderResponse(code)) }));
103
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-request-data.d.ts","sourceRoot":"","sources":["../../../src/render/operation/get-request-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,IAAI,EAAE,aAAa,GAClB,cAAc,CAwEhB"}
@@ -1,27 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- import type { MethodInformation, RenderContext } from '../../types.js';
3
- import { type SampleGenerator } from '../../requests/types.js';
4
- export interface CodeSample<T = unknown> {
5
- lang: string;
6
- label?: string;
7
- /**
8
- * either:
9
- * - code
10
- * - a function imported from a file with "use client" directive
11
- * - false (disabled)
12
- */
13
- source?: string | SampleGenerator<T> | false;
14
- /**
15
- * Pass extra context to client-side source generator
16
- */
17
- serverContext?: T;
18
- }
19
- export declare function Operation({ type, path, method, ctx, hasHead, headingLevel, }: {
20
- type?: 'webhook' | 'operation';
21
- path: string;
22
- method: MethodInformation;
23
- ctx: RenderContext;
24
- hasHead?: boolean;
25
- headingLevel?: number;
26
- }): ReactElement;
27
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/operation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAEV,iBAAiB,EACjB,aAAa,EAEd,MAAM,SAAS,CAAC;AAiBjB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAaxD,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAE7C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,CAAC;CACnB;AASD,wBAAgB,SAAS,CAAC,EACxB,IAAkB,EAClB,IAAI,EACJ,MAAM,EACN,GAAG,EACH,OAAO,EACP,YAAgB,GACjB,EAAE;IACD,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,aAAa,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,YAAY,CAiNf"}
@@ -1,79 +0,0 @@
1
- import type { ComponentType, ReactNode } from 'react';
2
- import type { RenderContext } from '../types.js';
3
- import { type APIPlaygroundProps } from '../playground/index.js';
4
- export interface ResponsesProps {
5
- items: string[];
6
- children: ReactNode;
7
- }
8
- export interface ResponseProps {
9
- value: string;
10
- children: ReactNode;
11
- }
12
- export interface APIInfoProps {
13
- method: string;
14
- route: string;
15
- head: ReactNode;
16
- children: ReactNode;
17
- }
18
- export interface PropertyProps {
19
- name: string;
20
- type: ReactNode;
21
- required?: boolean;
22
- deprecated?: boolean;
23
- children?: ReactNode;
24
- nested?: boolean;
25
- }
26
- export interface ObjectCollapsibleProps {
27
- name: string;
28
- children: ReactNode;
29
- }
30
- export interface RequestProps {
31
- name: string;
32
- children: ReactNode;
33
- }
34
- export interface SamplesProps {
35
- items: {
36
- title: string;
37
- description?: ReactNode;
38
- value: string;
39
- }[];
40
- }
41
- export interface ResponseTypeProps {
42
- label: string;
43
- children: ReactNode;
44
- }
45
- export interface RootProps {
46
- ctx: RenderContext;
47
- children: ReactNode;
48
- }
49
- export interface Renderer {
50
- Root: ComponentType<RootProps>;
51
- API: ComponentType<{
52
- children: ReactNode;
53
- }>;
54
- APIInfo: ComponentType<APIInfoProps>;
55
- APIExample: ComponentType<{
56
- children: ReactNode;
57
- }>;
58
- Responses: ComponentType<ResponsesProps>;
59
- Response: ComponentType<ResponseProps>;
60
- CodeExampleSelector: ComponentType<SamplesProps>;
61
- Requests: ComponentType<{
62
- items: string[];
63
- children: ReactNode;
64
- }>;
65
- Request: ComponentType<RequestProps>;
66
- ResponseTypes: ComponentType<{
67
- defaultValue?: string;
68
- children: ReactNode;
69
- }>;
70
- ResponseType: ComponentType<ResponseTypeProps>;
71
- /**
72
- * Collapsible to show object schemas
73
- */
74
- ObjectCollapsible: ComponentType<ObjectCollapsibleProps>;
75
- Property: ComponentType<PropertyProps>;
76
- APIPlayground: ComponentType<APIPlaygroundProps>;
77
- }
78
- export declare function createRenders(): Renderer;
79
- //# sourceMappingURL=renderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/render/renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAStE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,SAAS,CAAC;QACxB,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;C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