@stainless-api/docs-ui 0.1.0-beta.86 → 0.1.0-beta.87

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 (39) hide show
  1. package/dist/components/index.d.ts +2 -2
  2. package/dist/components/sdk.d.ts +1 -1
  3. package/dist/components/snippets.d.ts +1 -1
  4. package/dist/contexts/component-types.d.ts +1 -1
  5. package/dist/contexts/component.d.ts +1 -1
  6. package/dist/contexts/docs.d.ts +1 -1
  7. package/dist/contexts/index.d.ts +5 -5
  8. package/dist/contexts/index.js +3 -2
  9. package/dist/contexts/markdown.d.ts +2 -2
  10. package/dist/contexts/markdown.js +28 -13
  11. package/dist/contexts/navigation.d.ts +1 -1
  12. package/dist/contexts/use-components.d.ts +1 -1
  13. package/dist/docs-BomxNGuD.d.ts +62 -0
  14. package/dist/{index-HcWFtzlc.d.ts → index-gGDaf6FK.d.ts} +2 -2
  15. package/dist/index-uRQlPa4x.d.ts +464 -0
  16. package/dist/index.d.ts +2 -2
  17. package/dist/languages/cli.d.ts +1 -1
  18. package/dist/languages/csharp.d.ts +1 -1
  19. package/dist/languages/go.d.ts +1 -1
  20. package/dist/languages/http.d.ts +1 -1
  21. package/dist/languages/index.d.ts +1 -1
  22. package/dist/languages/java.d.ts +1 -1
  23. package/dist/languages/php.d.ts +1 -1
  24. package/dist/languages/python.d.ts +1 -1
  25. package/dist/languages/ruby.d.ts +1 -1
  26. package/dist/languages/terraform.d.ts +1 -1
  27. package/dist/languages/typescript.d.ts +1 -1
  28. package/dist/markdown/printer.d.ts +1 -1
  29. package/dist/markdown/utils.d.ts +2 -2
  30. package/dist/markdown-Cwdboi_V.d.ts +33 -0
  31. package/dist/navigation-22WDJvRF.d.ts +29 -0
  32. package/dist/routing-C_fawH40.d.ts +61 -0
  33. package/dist/routing.d.ts +1 -1
  34. package/dist/sdk-Cx2Z7bDk.d.ts +128 -0
  35. package/dist/spec.d.ts +3 -3
  36. package/dist/styles/main.css +16 -5
  37. package/dist/styles.css +16 -5
  38. package/package.json +4 -4
  39. package/dist/markdown-ClGRntP5.d.ts +0 -22
@@ -0,0 +1,61 @@
1
+ import { d as Method, f as Model, h as Resource, v as Spec } from "./index-DFr9Mesr.js";
2
+
3
+ //#region src/routing.d.ts
4
+ declare namespace routing_d_exports {
5
+ export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateMissingRouteList, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
6
+ }
7
+ declare const Languages: readonly ["http", "node", "python", "go", "typescript", "terraform", "ruby", "java", "kotlin", "csharp", "php", "cli"];
8
+ declare const SupportedLanguageSyntaxes: string[];
9
+ type DocsLanguage = (typeof Languages)[number];
10
+ declare const LanguageNames: Record<DocsLanguage, string>;
11
+ declare function getLanguageSnippet(language: DocsLanguage): "cli.default" | "csharp.default" | "go.default" | "http.curl" | "java.default" | "kotlin.default" | "node.default" | "php.default" | "python.default" | "ruby.default" | "terraform.default" | "typescript.default";
12
+ declare function isSupportedLanguage(language: string): language is DocsLanguage;
13
+ type ParsedStainlessPath = ReturnType<typeof parseStainlessPath>;
14
+ declare function parseStainlessPath(stainlessPath: string): {
15
+ resource: string[] | null;
16
+ method: string | null;
17
+ model: string | null;
18
+ routable: string | undefined;
19
+ } | null;
20
+ declare function trimStainlessPath(stainlessPath: string): string;
21
+ declare function getResource(stainlessPath: string): string | undefined;
22
+ declare function parseRoute(basePath: string, route: string): {
23
+ stainlessPath: string;
24
+ language: DocsLanguage;
25
+ };
26
+ declare function generateRoute(basePath: string, language: string, stainlessPath: string): string | null;
27
+ type SpecTreeEntry = {
28
+ data: Method | Resource | Model;
29
+ path: string[];
30
+ };
31
+ declare function walkTree(spec: Spec, includeModels?: boolean): Generator<SpecTreeEntry, void, any>;
32
+ type RouteEntry = {
33
+ title: string;
34
+ kind: SpecTreeEntry['data']['kind'];
35
+ language: DocsLanguage;
36
+ stainlessPath: string;
37
+ slug: string;
38
+ };
39
+ declare function generateRouteList({
40
+ spec,
41
+ languages,
42
+ excludeLanguages
43
+ }: {
44
+ spec: Spec;
45
+ languages?: DocsLanguage[];
46
+ excludeLanguages?: DocsLanguage[];
47
+ }): RouteEntry[];
48
+ declare function generateMissingRouteList({
49
+ spec,
50
+ basePath
51
+ }: {
52
+ spec: Spec;
53
+ basePath: string;
54
+ }): string[];
55
+ type ResourceOrMethod = Resource | Method;
56
+ declare function findNavigationPath(items: ResourceOrMethod[], target: string): string[] | undefined;
57
+ declare function expandToElement(el: HTMLElement | null): void;
58
+ declare function scrollToPath(stainlessPath: string): void;
59
+ declare function updateHistory(basePath: string, language: DocsLanguage, stainlessPath: string): void;
60
+ //#endregion
61
+ export { walkTree as S, parseStainlessPath as _, RouteEntry as a, trimStainlessPath as b, expandToElement as c, generateRoute as d, generateRouteList as f, parseRoute as g, isSupportedLanguage as h, ParsedStainlessPath as i, findNavigationPath as l, getResource as m, LanguageNames as n, SpecTreeEntry as o, getLanguageSnippet as p, Languages as r, SupportedLanguageSyntaxes as s, DocsLanguage as t, generateMissingRouteList as u, routing_d_exports as v, updateHistory as x, scrollToPath as y };
package/dist/routing.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { S as walkTree, _ as parseStainlessPath, a as RouteEntry, b as trimStainlessPath, c as expandToElement, d as generateRoute, f as generateRouteList, g as parseRoute, h as isSupportedLanguage, i as ParsedStainlessPath, l as findNavigationPath, m as getResource, n as LanguageNames, o as SpecTreeEntry, p as getLanguageSnippet, r as Languages, s as SupportedLanguageSyntaxes, t as DocsLanguage, u as generateMissingRouteList, x as updateHistory, y as scrollToPath } from "./routing-yTSG7nWM.js";
1
+ import { S as walkTree, _ as parseStainlessPath, a as RouteEntry, b as trimStainlessPath, c as expandToElement, d as generateRoute, f as generateRouteList, g as parseRoute, h as isSupportedLanguage, i as ParsedStainlessPath, l as findNavigationPath, m as getResource, n as LanguageNames, o as SpecTreeEntry, p as getLanguageSnippet, r as Languages, s as SupportedLanguageSyntaxes, t as DocsLanguage, u as generateMissingRouteList, x as updateHistory, y as scrollToPath } from "./routing-C_fawH40.js";
2
2
  export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateMissingRouteList, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
@@ -0,0 +1,128 @@
1
+ import { _ as SnippetLanguage, c as ID, d as Method, f as Model, o as HasStainlessPath, t as BaseDeclaration } from "./index-DFr9Mesr.js";
2
+ import { t as DocsLanguage } from "./routing-C_fawH40.js";
3
+ import * as React$1 from "react";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
+
6
+ //#region src/components/sdk.d.ts
7
+ type PropertyModelContextType = {
8
+ modelPath?: string;
9
+ propertyPath?: string;
10
+ };
11
+ declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
12
+ declare function usePropertyModel(): PropertyModelContextType;
13
+ type ReferenceNestingContextType = string[];
14
+ declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
15
+ declare function useReferenceNesting(): ReferenceNestingContextType;
16
+ type DeclarationParentsContextType = ReadonlySet<string>;
17
+ declare function useDeclarationParents(): DeclarationParentsContextType;
18
+ type SDKSnippetLanguagesType = Record<SnippetLanguage, {
19
+ name: string;
20
+ }>;
21
+ declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
22
+ type TransformRequestSnippetFn = ({
23
+ snippet,
24
+ language
25
+ }: {
26
+ snippet: string;
27
+ language: DocsLanguage;
28
+ }) => string;
29
+ type SDKChildrenProps = {
30
+ paths: ID[];
31
+ expand?: boolean;
32
+ depth?: number;
33
+ };
34
+ declare function SDKChildren({
35
+ paths,
36
+ expand,
37
+ depth
38
+ }: SDKChildrenProps): react_jsx_runtime0.JSX.Element;
39
+ type SDKDeclarationProps = {
40
+ path: string;
41
+ expand?: boolean;
42
+ depth?: number;
43
+ };
44
+ declare function SDKDeclaration({
45
+ path,
46
+ expand,
47
+ depth
48
+ }: SDKDeclarationProps): react_jsx_runtime0.JSX.Element;
49
+ type SDKConstraintsProps = {
50
+ constraints?: Record<string, unknown>;
51
+ };
52
+ declare function SDKConstraints({
53
+ constraints
54
+ }: SDKConstraintsProps): react_jsx_runtime0.JSX.Element | undefined;
55
+ type SDKIconProps = {
56
+ language: SnippetLanguage;
57
+ size?: number;
58
+ };
59
+ declare function SDKIcon({
60
+ language
61
+ }: SDKIconProps): react_jsx_runtime0.JSX.Element | null;
62
+ type SDKRequestTitleProps = {
63
+ snippetLanguage: SnippetLanguage;
64
+ };
65
+ declare function SDKRequestTitle({
66
+ snippetLanguage
67
+ }: SDKRequestTitleProps): react_jsx_runtime0.JSX.Element;
68
+ type SDKExampleProps = {
69
+ method: Partial<Method> & HasStainlessPath;
70
+ transformRequestSnippet?: TransformRequestSnippetFn;
71
+ };
72
+ declare function SDKExample({
73
+ method,
74
+ transformRequestSnippet
75
+ }: SDKExampleProps): react_jsx_runtime0.JSX.Element;
76
+ type SDKMethodProps = {
77
+ method: Method;
78
+ transformRequestSnippet?: TransformRequestSnippetFn;
79
+ };
80
+ declare function SDKMethodHeader({
81
+ method
82
+ }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
83
+ declare function useStreamingResponse(method: BaseDeclaration): ID | undefined;
84
+ declare function SDKMethodInfo({
85
+ method,
86
+ children
87
+ }: SDKMethodProps & {
88
+ children?: React$1.ReactNode;
89
+ }): react_jsx_runtime0.JSX.Element;
90
+ declare function SDKMethodNotImplemented({
91
+ method
92
+ }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
93
+ declare function SDKMethodInfoContent(_props: SDKMethodProps): React$1.ReactNode;
94
+ declare function SDKMethod({
95
+ method,
96
+ transformRequestSnippet
97
+ }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
98
+ type SDKModelProps = {
99
+ model: Model;
100
+ };
101
+ declare function SDKModel({
102
+ model
103
+ }: SDKModelProps): react_jsx_runtime0.JSX.Element | null;
104
+ type SDKReferenceProps = {
105
+ stainlessPath: string;
106
+ children?: React$1.ReactNode;
107
+ };
108
+ declare function SDKReference({
109
+ stainlessPath,
110
+ children
111
+ }: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
112
+ type SDKLanguageBlockProps = {
113
+ language: DocsLanguage;
114
+ version: string;
115
+ install: string;
116
+ links: {
117
+ repo: string;
118
+ docs: string;
119
+ };
120
+ };
121
+ declare function SDKLanguageBlock({
122
+ language,
123
+ version,
124
+ install,
125
+ links
126
+ }: SDKLanguageBlockProps): react_jsx_runtime0.JSX.Element;
127
+ //#endregion
128
+ export { useStreamingResponse as A, SDKRequestTitleProps as C, useDeclarationParents as D, TransformRequestSnippetFn as E, usePropertyModel as O, SDKRequestTitle as S, SDKSnippetLanguagesType as T, SDKMethodNotImplemented as _, ReferenceNestingContextType as a, SDKModelProps as b, SDKConstraintsProps as c, SDKIcon as d, SDKLanguageBlock as f, SDKMethodInfoContent as g, SDKMethodInfo as h, ReferenceNestingContext as i, useReferenceNesting as k, SDKDeclaration as l, SDKMethodHeader as m, PropertyModelContext as n, SDKChildren as o, SDKMethod as p, PropertyModelContextType as r, SDKConstraints as s, DeclarationParentsContextType as t, SDKExample as u, SDKMethodProps as v, SDKSnippetLanguages as w, SDKReference as x, SDKModel as y };
package/dist/spec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { d as Method, f as Model, h as Resource, i as DeclarationNode, v as Spec, y as SpecLanguage } from "./index-DFr9Mesr.js";
2
- import { t as DocsLanguage } from "./routing-yTSG7nWM.js";
2
+ import { t as DocsLanguage } from "./routing-C_fawH40.js";
3
3
 
4
4
  //#region src/spec.d.ts
5
5
  type SecurityScheme = Spec['security_schemes'][number];
@@ -36,13 +36,13 @@ declare function generateNavigation(resource: Partial<Resource>): {
36
36
  declare function generateSpecForResource(spec: Spec, name: string, lang: DocsLanguage, transforms: SpecTransforms): Partial<Spec>;
37
37
  declare function transform(spec: Spec, transforms: SpecTransforms): {
38
38
  name: string;
39
- lang: "http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli";
39
+ lang: "cli" | "csharp" | "go" | "http" | "java" | "kotlin" | "node" | "php" | "python" | "ruby" | "terraform" | "typescript";
40
40
  spec: Partial<Spec>;
41
41
  }[];
42
42
  declare function split(spec: Spec, transforms?: SpecTransforms): {
43
43
  resources: ReturnType<typeof transform>;
44
44
  navigation: {
45
- languages: ("http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli" | "sql" | "openapi")[] | undefined;
45
+ languages: ("cli" | "csharp" | "go" | "http" | "java" | "kotlin" | "node" | "php" | "python" | "ruby" | "terraform" | "typescript" | "sql" | "openapi")[] | undefined;
46
46
  resources: {
47
47
  [k: string]: {
48
48
  title: string | undefined;
@@ -439,8 +439,18 @@
439
439
  border: 1px solid var(--stl-color-border);
440
440
  border-radius: 12px;
441
441
 
442
+ &:is(.stldocs-method-response-column .stldocs-snippet-multi-response) {
443
+ overflow: clip;
444
+
445
+ & .stldocs-snippet {
446
+ padding: 0;
447
+ }
448
+ }
449
+
442
450
  & .stldocs-snippet {
443
451
  background-color: #0000;
452
+ border: none;
453
+ border-radius: 0;
444
454
  }
445
455
 
446
456
  & .stldocs-snippet-code .shiki {
@@ -625,7 +635,7 @@
625
635
  }
626
636
 
627
637
  & .stldocs-snippet-response-pane {
628
- --shiki-background: var(--stl-color-faint-background);
638
+ --shiki-background: transparent;
629
639
  padding: .5rem;
630
640
  display: none;
631
641
 
@@ -703,8 +713,6 @@
703
713
  & .stldocs-snippet-response-tab {
704
714
  border-bottom: 1px solid var(--stl-color-border-faint);
705
715
  gap: .5rem;
706
- margin-inline: -.5rem;
707
- padding-inline: .5rem;
708
716
  display: flex;
709
717
  overflow-x: auto;
710
718
 
@@ -738,8 +746,6 @@
738
746
 
739
747
  &.stldocs-snippet-response-tab-single-return {
740
748
  background-color: var(--stl-color-faint-background);
741
- border-top-left-radius: 12px;
742
- border-top-right-radius: 12px;
743
749
 
744
750
  & .stldocs-snippet-response-tab-item {
745
751
  color: var(--stl-color-foreground-reduced);
@@ -945,6 +951,11 @@
945
951
  padding: 0;
946
952
  display: block;
947
953
  }
954
+
955
+ & .stldocs-snippet-response-tab {
956
+ margin-inline: -.5rem;
957
+ padding-inline: .5rem;
958
+ }
948
959
  }
949
960
 
950
961
  & .stldocs-method-response-column {
package/dist/styles.css CHANGED
@@ -2173,8 +2173,18 @@ a.stl-ui-button {
2173
2173
  border: 1px solid var(--stl-color-border);
2174
2174
  border-radius: 12px;
2175
2175
 
2176
+ &:is(.stldocs-method-response-column .stldocs-snippet-multi-response) {
2177
+ overflow: clip;
2178
+
2179
+ & .stldocs-snippet {
2180
+ padding: 0;
2181
+ }
2182
+ }
2183
+
2176
2184
  & .stldocs-snippet {
2177
2185
  background-color: #0000;
2186
+ border: none;
2187
+ border-radius: 0;
2178
2188
  }
2179
2189
 
2180
2190
  & .stldocs-snippet-code .shiki {
@@ -2359,7 +2369,7 @@ a.stl-ui-button {
2359
2369
  }
2360
2370
 
2361
2371
  & .stldocs-snippet-response-pane {
2362
- --shiki-background: var(--stl-color-faint-background);
2372
+ --shiki-background: transparent;
2363
2373
  padding: .5rem;
2364
2374
  display: none;
2365
2375
 
@@ -2437,8 +2447,6 @@ a.stl-ui-button {
2437
2447
  & .stldocs-snippet-response-tab {
2438
2448
  border-bottom: 1px solid var(--stl-color-border-faint);
2439
2449
  gap: .5rem;
2440
- margin-inline: -.5rem;
2441
- padding-inline: .5rem;
2442
2450
  display: flex;
2443
2451
  overflow-x: auto;
2444
2452
 
@@ -2472,8 +2480,6 @@ a.stl-ui-button {
2472
2480
 
2473
2481
  &.stldocs-snippet-response-tab-single-return {
2474
2482
  background-color: var(--stl-color-faint-background);
2475
- border-top-left-radius: 12px;
2476
- border-top-right-radius: 12px;
2477
2483
 
2478
2484
  & .stldocs-snippet-response-tab-item {
2479
2485
  color: var(--stl-color-foreground-reduced);
@@ -2679,6 +2685,11 @@ a.stl-ui-button {
2679
2685
  padding: 0;
2680
2686
  display: block;
2681
2687
  }
2688
+
2689
+ & .stldocs-snippet-response-tab {
2690
+ margin-inline: -.5rem;
2691
+ padding-inline: .5rem;
2692
+ }
2682
2693
  }
2683
2694
 
2684
2695
  & .stldocs-method-response-column {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stainless-api/docs-ui",
3
3
  "private": false,
4
- "version": "0.1.0-beta.86",
4
+ "version": "0.1.0-beta.87",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -17,7 +17,7 @@
17
17
  "@markdoc/markdoc": "^0.5.6",
18
18
  "clsx": "^2.1.1",
19
19
  "htmlparser2": "^10.1.0",
20
- "lucide-react": "^0.574.0",
20
+ "lucide-react": "^0.577.0",
21
21
  "@stainless-api/ui-primitives": "0.1.0-beta.50"
22
22
  },
23
23
  "devDependencies": {
@@ -30,8 +30,8 @@
30
30
  "react-dom": "^19.2.4",
31
31
  "tsdown": "^0.21.4",
32
32
  "typescript": "5.9.3",
33
- "@stainless/eslint-config": "0.1.0-beta.1",
34
- "@stainless/sdk-json": "^0.1.0-beta.9"
33
+ "@stainless/sdk-json": "^0.1.0-beta.9",
34
+ "@stainless/eslint-config": "0.1.0-beta.1"
35
35
  },
36
36
  "exports": {
37
37
  ".": {
@@ -1,22 +0,0 @@
1
- import * as React$1 from "react";
2
- import * as react_jsx_runtime0 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_runtime0.JSX.Element;
21
- //#endregion
22
- export { useMarkdownContext as a, useHighlight as i, MarkdownProvider as n, useRenderMarkdown as o, MarkdownProviderProps as r, MarkdownContext as t };