@stainless-api/docs-ui 0.1.0-beta.7 → 0.1.0-beta.70

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 (215) hide show
  1. package/dist/breadcrumbs-BhYwbXkc.d.ts +25 -0
  2. package/dist/breadcrumbs-Cvm5Ifm7.d.ts +25 -0
  3. package/dist/breadcrumbs-DA4WgDhR.js +63 -0
  4. package/dist/chunk-BN_g-Awi.js +18 -0
  5. package/dist/cli-F3kMmeoJ.js +166 -0
  6. package/dist/component-P9sn5yyG.js +23 -0
  7. package/dist/component-generics-ByGsYTc8.d.ts +30 -0
  8. package/dist/component-generics-POFirVVb.js +45 -0
  9. package/dist/component-generics-zU0Pqx8m.d.ts +30 -0
  10. package/dist/components/MaskedInput.d.ts +14 -0
  11. package/dist/components/MaskedInput.js +76 -0
  12. package/dist/components/breadcrumbs.d.ts +2 -0
  13. package/dist/components/breadcrumbs.js +9 -0
  14. package/dist/components/icons.d.ts +60 -0
  15. package/dist/components/icons.js +3 -0
  16. package/dist/components/index.d.ts +11 -0
  17. package/dist/components/index.js +19 -0
  18. package/dist/components/method.d.ts +2 -0
  19. package/dist/components/method.js +10 -0
  20. package/dist/components/overview.d.ts +2 -0
  21. package/dist/components/overview.js +11 -0
  22. package/dist/components/primitives.d.ts +2 -0
  23. package/dist/components/primitives.js +8 -0
  24. package/dist/components/properties.d.ts +2 -0
  25. package/dist/components/properties.js +9 -0
  26. package/dist/components/sdk-sidebar.d.ts +2 -0
  27. package/dist/components/sdk-sidebar.js +10 -0
  28. package/dist/components/sdk.d.ts +2 -0
  29. package/dist/components/sdk.js +10 -0
  30. package/dist/components/snippets.d.ts +3 -0
  31. package/dist/components/snippets.js +9 -0
  32. package/dist/components/stl-sidebar.d.ts +2 -0
  33. package/dist/components/stl-sidebar.js +5 -0
  34. package/dist/components-w1JmIrB0.js +71 -0
  35. package/dist/contexts/component-generics.d.ts +2 -0
  36. package/dist/contexts/component-generics.js +3 -0
  37. package/dist/contexts/component-types.d.ts +17 -0
  38. package/dist/contexts/component-types.js +0 -0
  39. package/dist/contexts/component.d.ts +30 -0
  40. package/dist/contexts/component.js +30 -0
  41. package/dist/contexts/docs.d.ts +2 -0
  42. package/dist/contexts/docs.js +3 -0
  43. package/dist/contexts/index.d.ts +23 -0
  44. package/dist/contexts/index.js +7 -0
  45. package/dist/contexts/markdown.d.ts +2 -0
  46. package/dist/contexts/markdown.js +4 -0
  47. package/dist/contexts/navigation.d.ts +2 -0
  48. package/dist/contexts/navigation.js +3 -0
  49. package/dist/contexts/use-components.d.ts +15 -0
  50. package/dist/contexts/use-components.js +4 -0
  51. package/dist/contexts-CVj20VV4.js +41 -0
  52. package/dist/csharp-D6_jlynY.js +283 -0
  53. package/dist/docs-BmOB2f-I.js +61 -0
  54. package/dist/docs-g4IPmtZr.d.ts +48 -0
  55. package/dist/docs-z3fl2eW-.d.ts +48 -0
  56. package/dist/go-COaHV3Hc.js +303 -0
  57. package/dist/http-fOPCX17A.js +389 -0
  58. package/dist/icons-BYKn5X8E.js +885 -0
  59. package/dist/index-B8Zys1C2.d.ts +347 -0
  60. package/dist/index-C5Zmb2CI.d.ts +16 -0
  61. package/dist/index-CwjGm9zX.d.ts +1722 -0
  62. package/dist/index-D7PkxNgB.d.ts +16 -0
  63. package/dist/index-DIaM6Ync.d.ts +347 -0
  64. package/dist/index.d.ts +20 -0
  65. package/dist/index.js +32 -7542
  66. package/dist/java-CxGSJVvv.js +403 -0
  67. package/dist/languages/cli.d.ts +12 -0
  68. package/dist/languages/cli.js +21 -0
  69. package/dist/languages/csharp.d.ts +12 -0
  70. package/dist/languages/csharp.js +9 -0
  71. package/dist/languages/go.d.ts +12 -0
  72. package/dist/languages/go.js +9 -0
  73. package/dist/languages/http.d.ts +12 -0
  74. package/dist/languages/http.js +20 -0
  75. package/dist/languages/index.d.ts +12 -0
  76. package/dist/languages/index.js +29 -0
  77. package/dist/languages/java.d.ts +12 -0
  78. package/dist/languages/java.js +9 -0
  79. package/dist/languages/python.d.ts +12 -0
  80. package/dist/languages/python.js +9 -0
  81. package/dist/languages/ruby.d.ts +12 -0
  82. package/dist/languages/ruby.js +9 -0
  83. package/dist/languages/terraform.d.ts +12 -0
  84. package/dist/languages/terraform.js +9 -0
  85. package/dist/languages/typescript.d.ts +12 -0
  86. package/dist/languages/typescript.js +9 -0
  87. package/dist/languages-B6eap2M6.js +30 -0
  88. package/dist/markdown/index.d.ts +12 -0
  89. package/dist/markdown/index.js +107 -0
  90. package/dist/markdown/md.d.ts +15 -0
  91. package/dist/markdown/md.js +41 -0
  92. package/dist/markdown/printer.d.ts +13 -0
  93. package/dist/markdown/printer.js +100 -0
  94. package/dist/markdown/utils.d.ts +21 -0
  95. package/dist/markdown/utils.js +31 -0
  96. package/dist/markdown-CTKHMLVr.js +49 -0
  97. package/dist/markdown-Cdh0TSHp.d.ts +22 -0
  98. package/dist/markdown-Cibv9fDR.d.ts +22 -0
  99. package/dist/method-630cPKDl.d.ts +59 -0
  100. package/dist/method-BPDUyBlD.js +96 -0
  101. package/dist/method-BzkPRXGL.d.ts +59 -0
  102. package/dist/navigation-BW-SBvb4.d.ts +29 -0
  103. package/dist/navigation-DWYqC_HX.d.ts +29 -0
  104. package/dist/navigation-aoYZ_tl4.js +24 -0
  105. package/dist/overview-Cui1XtuC.d.ts +39 -0
  106. package/dist/overview-DFwfIK6k.js +138 -0
  107. package/dist/overview-RXc9iPzz.d.ts +39 -0
  108. package/dist/primitives-DJEqe_r1.js +250 -0
  109. package/dist/primitives-DhGxFYx6.d.ts +105 -0
  110. package/dist/primitives-MsH-h0bU.d.ts +105 -0
  111. package/dist/properties-BnbBKd5a.js +132 -0
  112. package/dist/properties-Bynmj9_H.d.ts +54 -0
  113. package/dist/properties-C9W4QJ_F.d.ts +54 -0
  114. package/dist/python-DsTuWCKE.js +269 -0
  115. package/dist/routing-C64k4fmX.js +205 -0
  116. package/dist/routing-Cm_9XJiQ.d.ts +61 -0
  117. package/dist/routing-utiR5mY3.d.ts +61 -0
  118. package/dist/routing.d.ts +2 -0
  119. package/dist/routing.js +3 -180
  120. package/dist/ruby-BncKp6hd.js +387 -0
  121. package/dist/sdk-BvZeXpsj.d.ts +122 -0
  122. package/dist/sdk-Bw99eXxA.js +399 -0
  123. package/dist/sdk-GMOw94wL.d.ts +122 -0
  124. package/dist/sdk-sidebar-NCBSWuUW.d.ts +15 -0
  125. package/dist/sdk-sidebar-VNY2-O1Y.d.ts +15 -0
  126. package/dist/sdk-sidebar-V_MTkVw8.js +50 -0
  127. package/dist/snippets-BehbU3rt.js +164 -0
  128. package/dist/snippets-Bj7Ey56K.d.ts +53 -0
  129. package/dist/snippets-CQQSDvg2.d.ts +53 -0
  130. package/dist/spec.d.ts +65 -0
  131. package/dist/spec.js +167 -0
  132. package/dist/stl-sidebar-CXzs_shz.d.ts +58 -0
  133. package/dist/stl-sidebar-DSkUHwcU.d.ts +58 -0
  134. package/dist/stl-sidebar-WtimNrk1.js +106 -0
  135. package/dist/style-HpXpcJ9v.js +172 -0
  136. package/dist/style.d.ts +171 -0
  137. package/dist/style.js +3 -0
  138. package/dist/styles/main.css +744 -754
  139. package/dist/styles/main.js +0 -0
  140. package/dist/styles/primitives.css +327 -458
  141. package/dist/styles/primitives.js +0 -0
  142. package/dist/styles/resets.css +32 -41
  143. package/dist/styles/resets.js +0 -0
  144. package/dist/styles/search.css +192 -270
  145. package/dist/styles/search.js +0 -0
  146. package/dist/styles/sidebar.css +170 -69
  147. package/dist/styles/sidebar.js +0 -0
  148. package/dist/styles/variables.css +26 -89
  149. package/dist/styles/variables.js +0 -0
  150. package/dist/styles.css +3273 -0
  151. package/dist/styles.mjs +1 -0
  152. package/dist/terraform-B95X4rNK.js +243 -0
  153. package/dist/typescript-n46M9OtL.js +449 -0
  154. package/dist/use-components-BUz3GbO4.js +7 -0
  155. package/dist/utils-DPbkW1Tz.js +54 -0
  156. package/dist/utils.d.ts +20 -0
  157. package/dist/utils.js +3 -0
  158. package/package.json +74 -22
  159. package/dist/mcp.js +0 -16003
  160. package/dist/styles/snippets.css +0 -132
  161. package/src/components/breadcrumbs.tsx +0 -94
  162. package/src/components/chat.tsx +0 -154
  163. package/src/components/dropdown.tsx +0 -91
  164. package/src/components/icons.tsx +0 -584
  165. package/src/components/index.ts +0 -9
  166. package/src/components/method.tsx +0 -144
  167. package/src/components/overview.tsx +0 -159
  168. package/src/components/primitives.tsx +0 -284
  169. package/src/components/properties.tsx +0 -130
  170. package/src/components/scripts/dropdown.ts +0 -78
  171. package/src/components/sdk.tsx +0 -402
  172. package/src/components/sidebar.tsx +0 -99
  173. package/src/components/snippets.tsx +0 -179
  174. package/src/contexts/component-generics.tsx +0 -48
  175. package/src/contexts/component-types.tsx +0 -5
  176. package/src/contexts/component.tsx +0 -32
  177. package/src/contexts/docs.tsx +0 -75
  178. package/src/contexts/index.tsx +0 -17
  179. package/src/contexts/markdown.tsx +0 -43
  180. package/src/contexts/navigation.tsx +0 -44
  181. package/src/contexts/search.tsx +0 -28
  182. package/src/contexts/use-components.tsx +0 -4
  183. package/src/index.ts +0 -6
  184. package/src/languages/go.tsx +0 -281
  185. package/src/languages/http.tsx +0 -321
  186. package/src/languages/index.ts +0 -26
  187. package/src/languages/java.tsx +0 -358
  188. package/src/languages/python.tsx +0 -255
  189. package/src/languages/ruby.tsx +0 -320
  190. package/src/languages/typescript.tsx +0 -393
  191. package/src/markdown/index.ts +0 -107
  192. package/src/markdown/md.ts +0 -45
  193. package/src/markdown/utils.ts +0 -49
  194. package/src/routing.ts +0 -238
  195. package/src/search/form.tsx +0 -127
  196. package/src/search/index.tsx +0 -1
  197. package/src/search/indexer.ts +0 -246
  198. package/src/search/mcp.ts +0 -61
  199. package/src/search/printer.tsx +0 -86
  200. package/src/search/providers/algolia.ts +0 -88
  201. package/src/search/providers/fuse.ts +0 -19
  202. package/src/search/providers/pagefind.ts +0 -17
  203. package/src/search/providers/walker.ts +0 -30
  204. package/src/search/results.tsx +0 -181
  205. package/src/search/state.ts +0 -64
  206. package/src/search/types.ts +0 -116
  207. package/src/style.ts +0 -197
  208. package/src/styles/main.css +0 -993
  209. package/src/styles/primitives.css +0 -572
  210. package/src/styles/resets.css +0 -47
  211. package/src/styles/search.css +0 -342
  212. package/src/styles/sidebar.css +0 -87
  213. package/src/styles/snippets.css +0 -132
  214. package/src/styles/variables.css +0 -90
  215. package/src/utils.ts +0 -41
@@ -0,0 +1,12 @@
1
+ import "../primitives-MsH-h0bU.js";
2
+ import "../breadcrumbs-BhYwbXkc.js";
3
+ import "../method-BzkPRXGL.js";
4
+ import "../properties-Bynmj9_H.js";
5
+ import "../sdk-GMOw94wL.js";
6
+ import "../snippets-CQQSDvg2.js";
7
+ import "../overview-Cui1XtuC.js";
8
+ import "../sdk-sidebar-VNY2-O1Y.js";
9
+ import "../stl-sidebar-CXzs_shz.js";
10
+ import "../index-D7PkxNgB.js";
11
+ import { At as DeclarationProps, Ft as Type, It as TypeName, Mt as MethodSignatureProps, Nt as Property, Pt as PropertyProps, jt as MethodSignature, kt as Declaration } from "../index-DIaM6Ync.js";
12
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
@@ -0,0 +1,9 @@
1
+ import "../docs-BmOB2f-I.js";
2
+ import "../component-generics-POFirVVb.js";
3
+ import "../navigation-aoYZ_tl4.js";
4
+ import "../markdown-CTKHMLVr.js";
5
+ import "../contexts-CVj20VV4.js";
6
+ import "../use-components-BUz3GbO4.js";
7
+ import { a as TypeName, i as Type, n as MethodSignature, r as Property, t as Declaration } from "../typescript-n46M9OtL.js";
8
+
9
+ export { Declaration, MethodSignature, Property, Type, TypeName };
@@ -0,0 +1,30 @@
1
+ import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
+ import { o as typescript_exports } from "./typescript-n46M9OtL.js";
3
+ import { o as java_exports } from "./java-CxGSJVvv.js";
4
+ import { o as go_exports } from "./go-COaHV3Hc.js";
5
+ import { o as python_exports } from "./python-DsTuWCKE.js";
6
+ import { o as ruby_exports } from "./ruby-BncKp6hd.js";
7
+ import { s as http_exports } from "./http-fOPCX17A.js";
8
+ import { o as csharp_exports } from "./csharp-D6_jlynY.js";
9
+ import { o as cli_exports } from "./cli-F3kMmeoJ.js";
10
+ import { c as terraform_exports } from "./terraform-B95X4rNK.js";
11
+
12
+ //#region src/languages/index.ts
13
+ var languages_exports = /* @__PURE__ */ __exportAll({
14
+ cli: () => cli_exports,
15
+ csharp: () => csharp_exports,
16
+ go: () => go_exports,
17
+ http: () => http_exports,
18
+ java: () => java_exports,
19
+ kotlin: () => kotlin,
20
+ node: () => node,
21
+ python: () => python_exports,
22
+ ruby: () => ruby_exports,
23
+ terraform: () => terraform_exports,
24
+ typescript: () => typescript_exports
25
+ });
26
+ const node = typescript_exports;
27
+ const kotlin = java_exports;
28
+
29
+ //#endregion
30
+ export { languages_exports as n, node as r, kotlin as t };
@@ -0,0 +1,12 @@
1
+ import { d as Method, f as Model, i as DeclarationNode, m as Resource } from "../index-CwjGm9zX.js";
2
+ import "../sdk-GMOw94wL.js";
3
+ import { EnvironmentType } from "./utils.js";
4
+ import { t as printer_d_exports } from "./printer.js";
5
+ import { Node } from "@markdoc/markdoc";
6
+
7
+ //#region src/markdown/index.d.ts
8
+ declare function declaration(env: EnvironmentType, decl: DeclarationNode): Node;
9
+ declare function render(env: EnvironmentType, node: Resource | Method | Model): Node[];
10
+ declare function renderMarkdown(env: EnvironmentType, node: Resource | Method | Model): string;
11
+ //#endregion
12
+ export { declaration, printer_d_exports as printer, render, renderMarkdown };
@@ -0,0 +1,107 @@
1
+ import "../docs-BmOB2f-I.js";
2
+ import "../component-generics-POFirVVb.js";
3
+ import "../navigation-aoYZ_tl4.js";
4
+ import "../markdown-CTKHMLVr.js";
5
+ import "../contexts-CVj20VV4.js";
6
+ import "../use-components-BUz3GbO4.js";
7
+ import "../properties-BnbBKd5a.js";
8
+ import "../method-BPDUyBlD.js";
9
+ import "../primitives-DJEqe_r1.js";
10
+ import "../icons-BYKn5X8E.js";
11
+ import "../sdk-Bw99eXxA.js";
12
+ import "../snippets-BehbU3rt.js";
13
+ import "../overview-DFwfIK6k.js";
14
+ import "../breadcrumbs-DA4WgDhR.js";
15
+ import "../stl-sidebar-WtimNrk1.js";
16
+ import "../sdk-sidebar-V_MTkVw8.js";
17
+ import "../components-w1JmIrB0.js";
18
+ import "../typescript-n46M9OtL.js";
19
+ import "../java-CxGSJVvv.js";
20
+ import "../go-COaHV3Hc.js";
21
+ import "../python-DsTuWCKE.js";
22
+ import "../ruby-BncKp6hd.js";
23
+ import "../http-fOPCX17A.js";
24
+ import "../csharp-D6_jlynY.js";
25
+ import "../cli-F3kMmeoJ.js";
26
+ import "../terraform-B95X4rNK.js";
27
+ import "../languages-B6eap2M6.js";
28
+ import "../component-P9sn5yyG.js";
29
+ import { code, fence, heading, item, list, paragraph, parse, strong, text } from "./md.js";
30
+ import { getDecl, getSnippet, stripMarkup } from "./utils.js";
31
+ import { declaration as declaration$1, methodSignature, t as printer_exports } from "./printer.js";
32
+ import Markdoc from "@markdoc/markdoc";
33
+
34
+ //#region src/markdown/index.ts
35
+ function declaration(env, decl) {
36
+ const content = declaration$1(env.language, decl);
37
+ return paragraph(code(stripMarkup(content)));
38
+ }
39
+ function renderChildren(env, children, nesting = []) {
40
+ return list(...children.map((child) => renderDecl(env, child, nesting)));
41
+ }
42
+ function renderDecl(env, path, nesting = []) {
43
+ const decl = getDecl(env, path);
44
+ const item$1 = item(declaration(env, decl));
45
+ const hasChildren = "children" in decl && decl.children && decl.children.length > 0;
46
+ const showModelProps = !("modelPath" in decl && decl["modelPath"]) || env.options.includeModelProperties;
47
+ if ("docstring" in decl && decl.docstring) item$1.children.push(...parse(decl.docstring));
48
+ if (hasChildren && showModelProps && !nesting.includes(path)) item$1.push(renderChildren(env, decl.children ?? [], [...nesting, path]));
49
+ return item$1;
50
+ }
51
+ function renderMethod(env, method) {
52
+ const decl = getDecl(env, method.stainlessPath);
53
+ if (!decl) return [paragraph(text("The method "), code(method.name), text(" is not available in this language."))];
54
+ const signature = methodSignature(env.language, decl);
55
+ const [httpMethod, endpoint] = method.endpoint.split(" ");
56
+ const output = [
57
+ heading(2, method.title),
58
+ ...env.language === "http" ? [] : [paragraph(code(stripMarkup(signature)))],
59
+ paragraph(strong(text(httpMethod)), text(" "), code(endpoint))
60
+ ];
61
+ if (method.description) output.push(...parse(method.description));
62
+ if (env.language === "http") {
63
+ const p = "paramsChildren" in decl && typeof decl.paramsChildren === "object" ? decl.paramsChildren : {};
64
+ for (const [location, value] of Object.entries(p)) {
65
+ if (value.length < 1) continue;
66
+ output.push(heading(3, [
67
+ text(location.at(0)?.toUpperCase() ?? ""),
68
+ text(location.slice(1)),
69
+ text(" Parameters")
70
+ ]), renderChildren(env, value));
71
+ }
72
+ const bp = "bodyParamsChildren" in decl ? decl.bodyParamsChildren?.["application/json"] : [];
73
+ if (bp && bp.length > 0) output.push(heading(3, "Body Parameters"), renderChildren(env, bp));
74
+ }
75
+ if ("paramsChildren" in decl && Array.isArray(decl.paramsChildren) && decl.paramsChildren.length > 0) output.push(heading(3, "Parameters"), renderChildren(env, decl.paramsChildren));
76
+ if ("responseChildren" in decl && decl.responseChildren && decl.responseChildren.length > 0) output.push(heading(3, "Returns"), renderChildren(env, decl.responseChildren));
77
+ const snippet = getSnippet(env, method.stainlessPath);
78
+ if (snippet) output.push(heading(3, "Example"), fence(env.language, snippet));
79
+ return output;
80
+ }
81
+ function renderModel(env, model) {
82
+ return [heading(3, model.title), list(renderDecl(env, `${model.stainlessPath} > (schema)`))];
83
+ }
84
+ function renderResource(env, resource) {
85
+ const methods = Object.values(resource.methods).filter((method) => getDecl(env, method.stainlessPath)).flatMap((method) => renderMethod(env, method));
86
+ const models = Object.values(resource.models).filter((model) => getDecl(env, `${model.stainlessPath} > (schema)`)).flatMap((model) => renderModel(env, model));
87
+ const doc = [heading(1, resource.title), ...methods];
88
+ if (models.length > 0) doc.push(heading(2, "Domain Types"), ...models);
89
+ if (!env.options.renderNestedResources) return doc;
90
+ const children = Object.values(resource.subresources ?? {}).flatMap((resource) => renderResource(env, resource));
91
+ return [...doc, ...children];
92
+ }
93
+ function render(env, node) {
94
+ switch (node.kind) {
95
+ case "resource": return renderResource(env, node);
96
+ case "http_method": return renderMethod(env, node);
97
+ case "model": return renderModel(env, node);
98
+ }
99
+ }
100
+ function renderMarkdown(env, node) {
101
+ const content = render(env, node);
102
+ const doc = new Markdoc.Ast.Node("document", {}, content);
103
+ return Markdoc.format(doc);
104
+ }
105
+
106
+ //#endregion
107
+ export { declaration, printer_exports as printer, render, renderMarkdown };
@@ -0,0 +1,15 @@
1
+ import { Node } from "@markdoc/markdoc";
2
+
3
+ //#region src/markdown/md.d.ts
4
+ declare function heading(level: number, children: string | Node[]): Node;
5
+ declare function text(content: string): Node;
6
+ declare function code(content: string): Node;
7
+ declare function paragraph(...children: Node[]): Node;
8
+ declare function list(...children: Node[]): Node;
9
+ declare function item(...children: Node[]): Node;
10
+ declare function strong(...children: Node[]): Node;
11
+ declare function inline(...children: Node[]): Node;
12
+ declare function fence(language: string, content: string): Node;
13
+ declare function parse(content: string): Node[];
14
+ //#endregion
15
+ export { code, fence, heading, inline, item, list, paragraph, parse, strong, text };
@@ -0,0 +1,41 @@
1
+ import Markdoc from "@markdoc/markdoc";
2
+
3
+ //#region src/markdown/md.ts
4
+ function heading(level, children) {
5
+ const content = inline(...typeof children === "string" ? [text(children)] : children);
6
+ return new Markdoc.Ast.Node("heading", { level }, [content]);
7
+ }
8
+ function text(content) {
9
+ return new Markdoc.Ast.Node("text", { content });
10
+ }
11
+ function code(content) {
12
+ return new Markdoc.Ast.Node("code", { content });
13
+ }
14
+ function paragraph(...children) {
15
+ const inline = new Markdoc.Ast.Node("inline", {}, children);
16
+ return new Markdoc.Ast.Node("paragraph", {}, [inline]);
17
+ }
18
+ function list(...children) {
19
+ return new Markdoc.Ast.Node("list", { ordered: false }, children);
20
+ }
21
+ function item(...children) {
22
+ return new Markdoc.Ast.Node("item", {}, children);
23
+ }
24
+ function strong(...children) {
25
+ return new Markdoc.Ast.Node("strong", {}, children);
26
+ }
27
+ function inline(...children) {
28
+ return new Markdoc.Ast.Node("inline", {}, children);
29
+ }
30
+ function fence(language, content) {
31
+ return new Markdoc.Ast.Node("fence", {
32
+ language,
33
+ content
34
+ });
35
+ }
36
+ function parse(content) {
37
+ return Markdoc.parse(content).children;
38
+ }
39
+
40
+ //#endregion
41
+ export { code, fence, heading, inline, item, list, paragraph, parse, strong, text };
@@ -0,0 +1,13 @@
1
+ import { i as DeclarationNode, x as Type } from "../index-CwjGm9zX.js";
2
+ import { t as DocsLanguage } from "../routing-Cm_9XJiQ.js";
3
+
4
+ //#region src/markdown/printer.d.ts
5
+ declare namespace printer_d_exports {
6
+ export { declaration, methodSignature, type, typeName };
7
+ }
8
+ declare function typeName(language: DocsLanguage, type: Type): string;
9
+ declare function type(language: DocsLanguage, type: Type): string;
10
+ declare function declaration(language: DocsLanguage, decl: DeclarationNode): string;
11
+ declare function methodSignature(language: DocsLanguage, decl: DeclarationNode): string;
12
+ //#endregion
13
+ export { declaration, methodSignature, printer_d_exports as t, type, typeName };
@@ -0,0 +1,100 @@
1
+ import { t as __exportAll } from "../chunk-BN_g-Awi.js";
2
+ import { t as DocsProvider } from "../docs-BmOB2f-I.js";
3
+ import "../component-generics-POFirVVb.js";
4
+ import "../navigation-aoYZ_tl4.js";
5
+ import "../markdown-CTKHMLVr.js";
6
+ import { n as useLanguageComponents } from "../contexts-CVj20VV4.js";
7
+ import "../use-components-BUz3GbO4.js";
8
+ import { t as style_default } from "../style-HpXpcJ9v.js";
9
+ import "../properties-BnbBKd5a.js";
10
+ import "../method-BPDUyBlD.js";
11
+ import "../primitives-DJEqe_r1.js";
12
+ import "../icons-BYKn5X8E.js";
13
+ import "../sdk-Bw99eXxA.js";
14
+ import "../snippets-BehbU3rt.js";
15
+ import "../overview-DFwfIK6k.js";
16
+ import "../breadcrumbs-DA4WgDhR.js";
17
+ import "../stl-sidebar-WtimNrk1.js";
18
+ import "../sdk-sidebar-V_MTkVw8.js";
19
+ import "../components-w1JmIrB0.js";
20
+ import "../typescript-n46M9OtL.js";
21
+ import "../java-CxGSJVvv.js";
22
+ import "../go-COaHV3Hc.js";
23
+ import "../python-DsTuWCKE.js";
24
+ import "../ruby-BncKp6hd.js";
25
+ import "../http-fOPCX17A.js";
26
+ import "../csharp-D6_jlynY.js";
27
+ import "../cli-F3kMmeoJ.js";
28
+ import "../terraform-B95X4rNK.js";
29
+ import "../languages-B6eap2M6.js";
30
+ import { t as ComponentProvider } from "../component-P9sn5yyG.js";
31
+ import "react";
32
+ import { jsx } from "react/jsx-runtime";
33
+ import { renderToStaticMarkup } from "react-dom/server";
34
+
35
+ //#region src/markdown/printer.tsx
36
+ var printer_exports = /* @__PURE__ */ __exportAll({
37
+ declaration: () => declaration,
38
+ methodSignature: () => methodSignature,
39
+ type: () => type,
40
+ typeName: () => typeName
41
+ });
42
+ function SDKReference({ stainlessPath, children }) {
43
+ if (!stainlessPath) return children;
44
+ return /* @__PURE__ */ jsx("span", {
45
+ className: style_default.TypeReference,
46
+ children
47
+ });
48
+ }
49
+ function Providers({ language, children }) {
50
+ return /* @__PURE__ */ jsx(DocsProvider, {
51
+ spec: null,
52
+ language,
53
+ children: /* @__PURE__ */ jsx(ComponentProvider, {
54
+ components: { SDKReference },
55
+ children
56
+ })
57
+ });
58
+ }
59
+ function RenderType({ type, full }) {
60
+ const { Type, TypeName } = useLanguageComponents();
61
+ return full ? /* @__PURE__ */ jsx(Type, { type }) : /* @__PURE__ */ jsx(TypeName, { type });
62
+ }
63
+ function typeName(language, type) {
64
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
65
+ language,
66
+ children: /* @__PURE__ */ jsx(RenderType, { type })
67
+ }));
68
+ }
69
+ function type(language, type) {
70
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
71
+ language,
72
+ children: /* @__PURE__ */ jsx(RenderType, {
73
+ type,
74
+ full: true
75
+ })
76
+ }));
77
+ }
78
+ function RenderDeclaration({ decl }) {
79
+ const { Declaration } = useLanguageComponents();
80
+ return /* @__PURE__ */ jsx(Declaration, { decl });
81
+ }
82
+ function declaration(language, decl) {
83
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
84
+ language,
85
+ children: /* @__PURE__ */ jsx(RenderDeclaration, { decl })
86
+ }));
87
+ }
88
+ function RenderMethod({ method }) {
89
+ const { MethodSignature } = useLanguageComponents();
90
+ return /* @__PURE__ */ jsx(MethodSignature, { decl: method });
91
+ }
92
+ function methodSignature(language, decl) {
93
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
94
+ language,
95
+ children: /* @__PURE__ */ jsx(RenderMethod, { method: decl })
96
+ }));
97
+ }
98
+
99
+ //#endregion
100
+ export { declaration, methodSignature, printer_exports as t, type, typeName };
@@ -0,0 +1,21 @@
1
+ import { _ as Spec, u as LanguageDeclNodes, v as SpecLanguage } from "../index-CwjGm9zX.js";
2
+ import { t as DocsLanguage } from "../routing-Cm_9XJiQ.js";
3
+ import { w as TransformRequestSnippetFn } from "../sdk-GMOw94wL.js";
4
+
5
+ //#region src/markdown/utils.d.ts
6
+ type EnvironmentType = {
7
+ spec: Spec;
8
+ language: DocsLanguage;
9
+ transforms?: {
10
+ transformRequestSnippet?: TransformRequestSnippetFn;
11
+ };
12
+ options: {
13
+ renderNestedResources?: boolean;
14
+ includeModelProperties?: boolean | 'method-page';
15
+ };
16
+ };
17
+ declare function getDecl(env: EnvironmentType, path: string): LanguageDeclNodes[SpecLanguage] | undefined;
18
+ declare function getSnippet(env: EnvironmentType, path: string): string | undefined;
19
+ declare function stripMarkup(content: string): string;
20
+ //#endregion
21
+ export { EnvironmentType, getDecl, getSnippet, stripMarkup };
@@ -0,0 +1,31 @@
1
+ import { Parser } from "htmlparser2";
2
+
3
+ //#region src/markdown/utils.ts
4
+ function getDecl(env, path) {
5
+ const decl = env.spec?.decls?.[env.language]?.[path];
6
+ if (decl?.kind?.endsWith("Reference")) {
7
+ const refId = "type" in decl && typeof decl["type"] === "object" && "$ref" in decl["type"] ? decl["type"]["$ref"] : null;
8
+ if (refId === path) return decl;
9
+ if (refId) return getDecl(env, refId);
10
+ }
11
+ return decl;
12
+ }
13
+ function getSnippet(env, path) {
14
+ const lang = env.language === "http" ? "http.curl" : `${env.language}.default`;
15
+ let snippet = env.spec?.snippets?.[lang]?.[path];
16
+ if (typeof snippet === "string" && env.transforms?.transformRequestSnippet) snippet = env.transforms.transformRequestSnippet({
17
+ snippet,
18
+ language: env.language
19
+ });
20
+ return snippet;
21
+ }
22
+ function stripMarkup(content) {
23
+ let output = "";
24
+ new Parser({ ontext(content) {
25
+ output += content;
26
+ } }).parseComplete(content);
27
+ return output;
28
+ }
29
+
30
+ //#endregion
31
+ export { getDecl, getSnippet, stripMarkup };
@@ -0,0 +1,49 @@
1
+ import { s as useLanguage } from "./docs-BmOB2f-I.js";
2
+ import * as React$1 from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/markdown.tsx
6
+ const HighlightLanguageMappings = {
7
+ node: "typescript",
8
+ http: "bash",
9
+ cli: "bash"
10
+ };
11
+ const MarkdownContext = React$1.createContext({
12
+ highlight: (content) => content,
13
+ render: (content) => content
14
+ });
15
+ const useMarkdownContext = () => React$1.useContext(MarkdownContext);
16
+ function useRenderMarkdown(content) {
17
+ const { render } = React$1.useContext(MarkdownContext);
18
+ return React$1.useMemo(() => {
19
+ if (!content) return void 0;
20
+ const rendered = render(content);
21
+ return typeof rendered === "string" ? rendered : React$1.use(rendered);
22
+ }, [content, render]);
23
+ }
24
+ function useHighlight(content, language) {
25
+ const { highlight } = React$1.useContext(MarkdownContext);
26
+ const defaultLanguage = useLanguage();
27
+ const lang = language ?? defaultLanguage;
28
+ return React$1.useMemo(() => {
29
+ if (lang === "none") return content;
30
+ const rendered = highlight(content, HighlightLanguageMappings[lang] ?? lang);
31
+ return typeof rendered === "string" ? rendered : React$1.use(rendered);
32
+ }, [
33
+ content,
34
+ highlight,
35
+ lang
36
+ ]);
37
+ }
38
+ function MarkdownProvider({ render, highlight, children }) {
39
+ return /* @__PURE__ */ jsx(MarkdownContext.Provider, {
40
+ value: {
41
+ render,
42
+ highlight
43
+ },
44
+ children
45
+ });
46
+ }
47
+
48
+ //#endregion
49
+ export { useRenderMarkdown as a, useMarkdownContext as i, MarkdownProvider as n, useHighlight as r, MarkdownContext as t };
@@ -0,0 +1,22 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime81 from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/markdown.d.ts
5
+ type MarkdownContext = {
6
+ highlight: (content: string, language: string) => string | Promise<string>;
7
+ render: (content: string) => string | Promise<string>;
8
+ };
9
+ declare const MarkdownContext: React$1.Context<MarkdownContext>;
10
+ declare const useMarkdownContext: () => MarkdownContext;
11
+ declare function useRenderMarkdown(content?: string): string | undefined;
12
+ declare function useHighlight(content: string, language?: string): string;
13
+ type MarkdownProviderProps = MarkdownContext & {
14
+ children: React$1.ReactNode;
15
+ };
16
+ declare function MarkdownProvider({
17
+ render,
18
+ highlight,
19
+ children
20
+ }: MarkdownProviderProps): react_jsx_runtime81.JSX.Element;
21
+ //#endregion
22
+ export { useMarkdownContext as a, useHighlight as i, MarkdownProvider as n, useRenderMarkdown as o, MarkdownProviderProps as r, MarkdownContext as t };
@@ -0,0 +1,22 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime47 from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/markdown.d.ts
5
+ type MarkdownContext = {
6
+ highlight: (content: string, language: string) => string | Promise<string>;
7
+ render: (content: string) => string | Promise<string>;
8
+ };
9
+ declare const MarkdownContext: React$1.Context<MarkdownContext>;
10
+ declare const useMarkdownContext: () => MarkdownContext;
11
+ declare function useRenderMarkdown(content?: string): string | undefined;
12
+ declare function useHighlight(content: string, language?: string): string;
13
+ type MarkdownProviderProps = MarkdownContext & {
14
+ children: React$1.ReactNode;
15
+ };
16
+ declare function MarkdownProvider({
17
+ render,
18
+ highlight,
19
+ children
20
+ }: MarkdownProviderProps): react_jsx_runtime47.JSX.Element;
21
+ //#endregion
22
+ export { useMarkdownContext as a, useHighlight as i, MarkdownProvider as n, useRenderMarkdown as o, MarkdownProviderProps as r, MarkdownContext as t };
@@ -0,0 +1,59 @@
1
+ import * as React$1 from "react";
2
+ import { ReactNode } from "react";
3
+ import * as react_jsx_runtime27 from "react/jsx-runtime";
4
+
5
+ //#region src/components/method.d.ts
6
+ type MethodHeaderProps = {
7
+ title: ReactNode;
8
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
9
+ signature?: ReactNode;
10
+ badges?: ReactNode;
11
+ children?: ReactNode;
12
+ };
13
+ declare function MethodHeader({
14
+ title,
15
+ badges,
16
+ signature,
17
+ children,
18
+ level
19
+ }: MethodHeaderProps): react_jsx_runtime27.JSX.Element;
20
+ type MethodRouteProps = {
21
+ httpMethod?: string;
22
+ endpoint?: string | ReactNode;
23
+ iconOnly?: boolean;
24
+ };
25
+ declare function MethodRoute({
26
+ httpMethod,
27
+ endpoint,
28
+ iconOnly
29
+ }: MethodRouteProps): react_jsx_runtime27.JSX.Element;
30
+ type MethodDescriptionProps = {
31
+ description?: string;
32
+ };
33
+ declare function MethodDescription({
34
+ description
35
+ }: MethodDescriptionProps): react_jsx_runtime27.JSX.Element | undefined;
36
+ type MethodInfoProps = {
37
+ children?: ReactNode;
38
+ parameters?: ReactNode;
39
+ returns?: ReactNode;
40
+ };
41
+ declare function MethodInfo({
42
+ children,
43
+ parameters,
44
+ returns
45
+ }: MethodInfoProps): react_jsx_runtime27.JSX.Element;
46
+ type MethodProps = {
47
+ id?: string;
48
+ header?: ReactNode;
49
+ children?: ReactNode;
50
+ } & React$1.HTMLProps<HTMLDivElement>;
51
+ declare function Method({
52
+ id,
53
+ header,
54
+ children,
55
+ className,
56
+ ...props
57
+ }: MethodProps): react_jsx_runtime27.JSX.Element;
58
+ //#endregion
59
+ export { MethodHeaderProps as a, MethodProps as c, MethodHeader as i, MethodRoute as l, MethodDescription as n, MethodInfo as o, MethodDescriptionProps as r, MethodInfoProps as s, Method as t, MethodRouteProps as u };
@@ -0,0 +1,96 @@
1
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
2
+ import { t as style_default } from "./style-HpXpcJ9v.js";
3
+ import { i as PropertyToggle } from "./properties-BnbBKd5a.js";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import clsx from "clsx";
7
+ import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
8
+ import { FunctionIcon } from "@stainless-api/ui-primitives/icons";
9
+
10
+ //#region src/components/method.tsx
11
+ function MethodHeader({ title, badges, signature, children, level }) {
12
+ const Heading = level ?? "h5";
13
+ return /* @__PURE__ */ jsxs("div", {
14
+ className: style_default.MethodHeader,
15
+ children: [
16
+ /* @__PURE__ */ jsx(Heading, {
17
+ className: style_default.MethodTitle,
18
+ children: title
19
+ }),
20
+ badges && /* @__PURE__ */ jsx("div", {
21
+ className: style_default.MethodBadges,
22
+ children: badges
23
+ }),
24
+ signature,
25
+ children
26
+ ]
27
+ });
28
+ }
29
+ function MethodRoute({ httpMethod, endpoint, iconOnly }) {
30
+ const httpMethodTyped = getHttpMethod(httpMethod);
31
+ return /* @__PURE__ */ jsxs("div", {
32
+ className: style_default.MethodRoute,
33
+ children: [httpMethod ? httpMethodTyped && /* @__PURE__ */ jsx(Badge.HTTP, {
34
+ method: httpMethodTyped,
35
+ iconOnly,
36
+ size: "sm"
37
+ }) : /* @__PURE__ */ jsx(Badge, {
38
+ size: "sm",
39
+ icon: /* @__PURE__ */ jsx(FunctionIcon, {}),
40
+ intent: "info",
41
+ children: !iconOnly && "Function"
42
+ }), endpoint && /* @__PURE__ */ jsx("span", {
43
+ className: style_default.MethodRouteEndpoint,
44
+ children: endpoint
45
+ })]
46
+ });
47
+ }
48
+ function MethodDescription({ description }) {
49
+ const { Markdown } = useComponents();
50
+ if (description) return /* @__PURE__ */ jsx("div", {
51
+ className: style_default.MethodDescription,
52
+ children: /* @__PURE__ */ jsx(Markdown, { content: description })
53
+ });
54
+ }
55
+ function MethodInfo({ children, parameters, returns }) {
56
+ return /* @__PURE__ */ jsxs("div", {
57
+ className: style_default.MethodInfo,
58
+ children: [
59
+ children && /* @__PURE__ */ jsx("div", {
60
+ className: style_default.MethodContent,
61
+ children
62
+ }),
63
+ parameters && /* @__PURE__ */ jsxs("div", {
64
+ className: style_default.MethodInfoSection,
65
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Parameters", /* @__PURE__ */ jsx(PropertyToggle, { target: "parameters" })] }), /* @__PURE__ */ jsx("div", {
66
+ className: style_default.MethodParameters,
67
+ "data-stldocs-property-group": "parameters",
68
+ children: parameters
69
+ })]
70
+ }),
71
+ returns && /* @__PURE__ */ jsxs("div", {
72
+ className: style_default.MethodInfoSection,
73
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Returns", /* @__PURE__ */ jsx(PropertyToggle, { target: "returns" })] }), /* @__PURE__ */ jsx("div", {
74
+ className: style_default.MethodReturns,
75
+ "data-stldocs-property-group": "returns",
76
+ children: returns
77
+ })]
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ function Method({ id, header, children, className, ...props }) {
83
+ return /* @__PURE__ */ jsxs("div", {
84
+ id,
85
+ className: clsx(style_default.Method, className),
86
+ tabIndex: 0,
87
+ ...props,
88
+ children: [header, /* @__PURE__ */ jsx("div", {
89
+ className: style_default.MethodBody,
90
+ children
91
+ })]
92
+ });
93
+ }
94
+
95
+ //#endregion
96
+ export { MethodRoute as a, MethodInfo as i, MethodDescription as n, MethodHeader as r, Method as t };