@stainless-api/docs-ui 0.1.0-beta.83 → 0.1.0-beta.85
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.
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/method.js +1 -1
- package/dist/components/overview.js +1 -1
- package/dist/components/primitives.d.ts +2 -2
- package/dist/components/primitives.js +4 -4
- package/dist/components/properties.js +1 -1
- package/dist/components/sdk-sidebar.js +1 -1
- package/dist/components/sdk.d.ts +1 -1
- package/dist/components/sdk.js +15 -18
- package/dist/components/snippets.js +1 -1
- package/dist/components/stl-sidebar.js +1 -1
- package/dist/contexts/component-generics.js +1 -1
- package/dist/contexts/component.js +1 -1
- package/dist/contexts/docs.d.ts +1 -1
- package/dist/contexts/index.js +1 -1
- package/dist/contexts/markdown.js +4 -4
- package/dist/contexts/navigation.js +8 -9
- package/dist/contexts/use-components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/languages/cli.js +5 -5
- package/dist/languages/csharp.js +3 -3
- package/dist/languages/go.js +1 -1
- package/dist/languages/http.js +3 -3
- package/dist/languages/index.js +1 -1
- package/dist/languages/java.js +1 -1
- package/dist/languages/php.js +1 -1
- package/dist/languages/python.js +2 -2
- package/dist/languages/ruby.js +1 -1
- package/dist/languages/terraform.js +1 -1
- package/dist/languages/typescript.js +1 -1
- package/dist/markdown/index.js +8 -4
- package/dist/markdown/printer.js +1 -1
- package/dist/routing.d.ts +1 -1
- package/dist/spec.d.ts +2 -2
- package/dist/styles/primitives.css +7 -0
- package/dist/styles.css +7 -0
- package/dist/{use-strict-context-L0c8JKg4.js → use-strict-context-Clb6Yjly.js} +1 -1
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ const getMaskedParts = (text) => {
|
|
|
10
10
|
};
|
|
11
11
|
const percentLength = Math.min(Math.floor(text.length * .3), 8);
|
|
12
12
|
const nonAlphaMatches = [...text.substring(0, percentLength).matchAll(/[^a-zA-Z0-9]/g)];
|
|
13
|
-
let prefixEnd
|
|
13
|
+
let prefixEnd;
|
|
14
14
|
if (nonAlphaMatches.length > 0) prefixEnd = nonAlphaMatches.at(-1).index + 1;
|
|
15
15
|
else prefixEnd = percentLength;
|
|
16
16
|
return {
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { Property, PropertyDescription, PropertyTitle, PropertyToggle } from "./properties.js";
|
|
4
4
|
import { Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute } from "./method.js";
|
|
5
5
|
import { Badge, Expander, Input, Join, Link, ListView, Markdown, ToggleButton, Tooltip, VirtualExpander } from "./primitives.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useDeclaration, useLanguage, useSpec } from "../contexts/docs.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
|
@@ -58,7 +58,7 @@ type TooltipProps = {
|
|
|
58
58
|
declare function Tooltip({
|
|
59
59
|
content,
|
|
60
60
|
children
|
|
61
|
-
}: TooltipProps): string | number | bigint | boolean |
|
|
61
|
+
}: TooltipProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
62
62
|
type LinkProps = {
|
|
63
63
|
stainlessPath?: string;
|
|
64
64
|
scroll?: boolean;
|
|
@@ -69,7 +69,7 @@ declare function Link({
|
|
|
69
69
|
scroll,
|
|
70
70
|
children,
|
|
71
71
|
...props
|
|
72
|
-
}: LinkProps): string | number | bigint | boolean |
|
|
72
|
+
}: LinkProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
73
73
|
type InputProps = {
|
|
74
74
|
left?: ReactNode;
|
|
75
75
|
right?: ReactNode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useLanguage, useSettings } from "../contexts/docs.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useNavigation } from "../contexts/navigation.js";
|
|
4
4
|
import { useRenderMarkdown } from "../contexts/markdown.js";
|
|
5
5
|
import "../contexts/index.js";
|
|
6
6
|
import style_default from "../style.js";
|
|
7
7
|
import { generateRoute } from "../routing.js";
|
|
8
|
-
import { Fragment, createContext,
|
|
8
|
+
import { Fragment, createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
import { MinusIcon, PlusIcon } from "lucide-react";
|
|
@@ -102,12 +102,12 @@ function Badge({ id, children }) {
|
|
|
102
102
|
}
|
|
103
103
|
const TooltipNestingContext = createContext(false);
|
|
104
104
|
function Tooltip({ content, children }) {
|
|
105
|
-
if (
|
|
105
|
+
if (use(TooltipNestingContext)) return children;
|
|
106
106
|
return /* @__PURE__ */ jsxs("span", {
|
|
107
107
|
className: style_default.Tooltip,
|
|
108
108
|
children: [/* @__PURE__ */ jsx("span", {
|
|
109
109
|
className: style_default.TooltipContent,
|
|
110
|
-
children: /* @__PURE__ */ jsx(TooltipNestingContext
|
|
110
|
+
children: /* @__PURE__ */ jsx(TooltipNestingContext, {
|
|
111
111
|
value: true,
|
|
112
112
|
children: content
|
|
113
113
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useIgnoredResources, useLanguage, useSettings } from "../contexts/docs.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
package/dist/components/sdk.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ type SDKReferenceProps = {
|
|
|
108
108
|
declare function SDKReference({
|
|
109
109
|
stainlessPath,
|
|
110
110
|
children
|
|
111
|
-
}: SDKReferenceProps): string | number | bigint | boolean |
|
|
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
112
|
type SDKLanguageBlockProps = {
|
|
113
113
|
language: DocsLanguage;
|
|
114
114
|
version: string;
|
package/dist/components/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useAvailableLanguages, useContentPanelLayout, useDeclaration, useLanguage, useSettings, useSnippetIds, useSnippetResponse, useSpec } from "../contexts/docs.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useNavigation } from "../contexts/navigation.js";
|
|
4
4
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
@@ -15,11 +15,11 @@ import { Button, Callout } from "@stainless-api/ui-primitives";
|
|
|
15
15
|
//#region src/components/sdk.tsx
|
|
16
16
|
const PropertyModelContext = React$1.createContext({});
|
|
17
17
|
function usePropertyModel() {
|
|
18
|
-
return React$1.
|
|
18
|
+
return React$1.use(PropertyModelContext);
|
|
19
19
|
}
|
|
20
20
|
const ReferenceNestingContext = React$1.createContext([]);
|
|
21
21
|
function useReferenceNesting() {
|
|
22
|
-
return React$1.
|
|
22
|
+
return React$1.use(ReferenceNestingContext);
|
|
23
23
|
}
|
|
24
24
|
const DeclarationParentsContext = React$1.createContext(/* @__PURE__ */ new Set());
|
|
25
25
|
const AddToDeclarationParents = ({ id, children }) => /* @__PURE__ */ jsx(DeclarationParentsContext, {
|
|
@@ -27,7 +27,7 @@ const AddToDeclarationParents = ({ id, children }) => /* @__PURE__ */ jsx(Declar
|
|
|
27
27
|
children
|
|
28
28
|
});
|
|
29
29
|
function useDeclarationParents() {
|
|
30
|
-
return React$1.
|
|
30
|
+
return React$1.use(DeclarationParentsContext);
|
|
31
31
|
}
|
|
32
32
|
const SDKSnippetLanguages = {
|
|
33
33
|
"node.default": { name: "TypeScript" },
|
|
@@ -151,7 +151,7 @@ function SDKDeclaration({ path, expand, depth = 0 }) {
|
|
|
151
151
|
const refId = "type" in decl && decl.type !== void 0 && typeof decl.type !== "string" && "$ref" in decl.type ? decl.type["$ref"] : void 0;
|
|
152
152
|
if (refId && refId !== path && !nesting.includes(refId)) return /* @__PURE__ */ jsx(AddToDeclarationParents, {
|
|
153
153
|
id: path,
|
|
154
|
-
children: /* @__PURE__ */ jsx(ReferenceNestingContext
|
|
154
|
+
children: /* @__PURE__ */ jsx(ReferenceNestingContext, {
|
|
155
155
|
value: [...nesting, refId],
|
|
156
156
|
children: /* @__PURE__ */ jsx(SDKDeclaration, {
|
|
157
157
|
path: refId,
|
|
@@ -188,19 +188,16 @@ function SDKDeclaration({ path, expand, depth = 0 }) {
|
|
|
188
188
|
})] })
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
|
-
if ("modelPath" in decl) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
children:
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
})
|
|
202
|
-
});
|
|
203
|
-
}
|
|
191
|
+
if ("modelPath" in decl) return /* @__PURE__ */ jsx(AddToDeclarationParents, {
|
|
192
|
+
id: path,
|
|
193
|
+
children: /* @__PURE__ */ jsx(PropertyModelContext, {
|
|
194
|
+
value: {
|
|
195
|
+
modelPath: decl.modelPath,
|
|
196
|
+
propertyPath: decl.stainlessPath
|
|
197
|
+
},
|
|
198
|
+
children: content
|
|
199
|
+
})
|
|
200
|
+
});
|
|
204
201
|
return /* @__PURE__ */ jsx(AddToDeclarationParents, {
|
|
205
202
|
id: path,
|
|
206
203
|
children: content
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useDeclaration, useLanguage, useSnippet, useSnippetIds, useSnippetResponse } from "../contexts/docs.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useHighlight } from "../contexts/markdown.js";
|
|
4
4
|
import "../contexts/index.js";
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../use-strict-context-
|
|
1
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
2
2
|
import { ComponentProvider as ComponentProvider$1, customizeComponents } from "./component-generics.js";
|
|
3
3
|
import { t as components_exports } from "../components/index.js";
|
|
4
4
|
import { t as languages_exports } from "../languages/index.js";
|
package/dist/contexts/docs.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ declare function useDeclaration<Required extends boolean>(stainlessPath: string,
|
|
|
47
47
|
declare function useAvailableLanguages(stainlessPath: string): SpecLanguage[];
|
|
48
48
|
declare function useIgnoredResources(): string[];
|
|
49
49
|
declare function useResource(name: string): Resource | undefined;
|
|
50
|
-
declare function useLanguage(): "
|
|
50
|
+
declare function useLanguage(): "cli" | "csharp" | "go" | "http" | "java" | "kotlin" | "node" | "php" | "python" | "ruby" | "terraform" | "typescript";
|
|
51
51
|
declare function useContentPanelLayout(): ContentPanelLayout;
|
|
52
52
|
type DocsProviderProps = DocsContextType & {
|
|
53
53
|
children: React$1.ReactNode;
|
package/dist/contexts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { DocsProvider, useAvailableLanguages, useContentPanelLayout, useDeclaration, useDocs, useIgnoredResources, useLanguage, useResource, useSettings, useSnippet, useSnippetIds, useSnippetResponse, useSnippets, useSpec } from "./docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { ComponentProvider, customizeComponents, useComponentContext, useComponents } from "./component-generics.js";
|
|
5
5
|
import { NavigationProvider, useNavigation } from "./navigation.js";
|
|
6
6
|
import { MarkdownContext, MarkdownProvider, useHighlight, useMarkdownContext, useRenderMarkdown } from "./markdown.js";
|
|
@@ -12,9 +12,9 @@ const MarkdownContext = React$1.createContext({
|
|
|
12
12
|
highlight: (content) => content,
|
|
13
13
|
render: (content) => content
|
|
14
14
|
});
|
|
15
|
-
const useMarkdownContext = () => React$1.
|
|
15
|
+
const useMarkdownContext = () => React$1.use(MarkdownContext);
|
|
16
16
|
function useRenderMarkdown(content) {
|
|
17
|
-
const { render } = React$1.
|
|
17
|
+
const { render } = React$1.use(MarkdownContext);
|
|
18
18
|
return React$1.useMemo(() => {
|
|
19
19
|
if (!content) return void 0;
|
|
20
20
|
const rendered = render(content);
|
|
@@ -22,7 +22,7 @@ function useRenderMarkdown(content) {
|
|
|
22
22
|
}, [content, render]);
|
|
23
23
|
}
|
|
24
24
|
function useHighlight(content, language) {
|
|
25
|
-
const { highlight } = React$1.
|
|
25
|
+
const { highlight } = React$1.use(MarkdownContext);
|
|
26
26
|
const defaultLanguage = useLanguage();
|
|
27
27
|
const lang = language ?? defaultLanguage;
|
|
28
28
|
return React$1.useMemo(() => {
|
|
@@ -36,7 +36,7 @@ function useHighlight(content, language) {
|
|
|
36
36
|
]);
|
|
37
37
|
}
|
|
38
38
|
function MarkdownProvider({ render, highlight, children }) {
|
|
39
|
-
return /* @__PURE__ */ jsx(MarkdownContext
|
|
39
|
+
return /* @__PURE__ */ jsx(MarkdownContext, {
|
|
40
40
|
value: {
|
|
41
41
|
render,
|
|
42
42
|
highlight
|
|
@@ -5,17 +5,16 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
const Defaults = { basePath: "/" };
|
|
6
6
|
const NavigationContext = React$1.createContext(Defaults);
|
|
7
7
|
function useNavigation() {
|
|
8
|
-
return React$1.
|
|
8
|
+
return React$1.use(NavigationContext);
|
|
9
9
|
}
|
|
10
10
|
function NavigationProvider({ basePath, selectedPath, onNavigate, children }) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
value,
|
|
11
|
+
return /* @__PURE__ */ jsx(NavigationContext, {
|
|
12
|
+
value: {
|
|
13
|
+
...Defaults,
|
|
14
|
+
onNavigate,
|
|
15
|
+
basePath,
|
|
16
|
+
selectedPath
|
|
17
|
+
},
|
|
19
18
|
children
|
|
20
19
|
});
|
|
21
20
|
}
|
package/dist/index.js
CHANGED
package/dist/languages/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
|
@@ -152,14 +152,14 @@ function Declaration({ decl }) {
|
|
|
152
152
|
children: decl.type
|
|
153
153
|
}) : /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
|
|
154
154
|
] })] });
|
|
155
|
-
case "CLIFunction": return /* @__PURE__ */
|
|
155
|
+
case "CLIFunction": return /* @__PURE__ */ jsxs("span", {
|
|
156
156
|
className: style_default.TextIdentifier,
|
|
157
157
|
children: [decl.name, "()"]
|
|
158
|
-
})
|
|
159
|
-
case "CLIStdin": return /* @__PURE__ */ jsx(
|
|
158
|
+
});
|
|
159
|
+
case "CLIStdin": return /* @__PURE__ */ jsx("span", {
|
|
160
160
|
className: style_default.TextIdentifier,
|
|
161
161
|
children: "stdin"
|
|
162
|
-
})
|
|
162
|
+
});
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
package/dist/languages/csharp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
|
@@ -211,13 +211,13 @@ function Declaration({ decl }) {
|
|
|
211
211
|
const Lang = useLanguageComponents();
|
|
212
212
|
if (!decl) return null;
|
|
213
213
|
switch (decl.kind) {
|
|
214
|
-
case "CSharpDeclConst": return /* @__PURE__ */ jsx(
|
|
214
|
+
case "CSharpDeclConst": return /* @__PURE__ */ jsx(Docs.Tooltip, {
|
|
215
215
|
content: JSON.stringify(decl.value),
|
|
216
216
|
children: /* @__PURE__ */ jsx("span", {
|
|
217
217
|
className: style_default.TextIdentifier,
|
|
218
218
|
children: decl.ident
|
|
219
219
|
})
|
|
220
|
-
})
|
|
220
|
+
});
|
|
221
221
|
case "CSharpDeclType": {
|
|
222
222
|
const keyword = decl.type.kind === "CSharpTypeEnum" ? "enum" : "class";
|
|
223
223
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
package/dist/languages/go.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
package/dist/languages/http.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { useAvailableLanguages, useDeclaration, useLanguage, useSpec } from "../contexts/docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { useNavigation } from "../contexts/navigation.js";
|
|
5
5
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
6
6
|
import { useComponents } from "../contexts/use-components.js";
|
|
@@ -35,10 +35,10 @@ const constStyle = {
|
|
|
35
35
|
boolean: style_default.LiteralBoolean
|
|
36
36
|
};
|
|
37
37
|
function Identifier({ name }) {
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
+
return /* @__PURE__ */ jsx("span", {
|
|
39
39
|
className: style_default.TextIdentifier,
|
|
40
40
|
children: /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(name) ? name : JSON.stringify(name)
|
|
41
|
-
})
|
|
41
|
+
});
|
|
42
42
|
}
|
|
43
43
|
function TypePreview({ path }) {
|
|
44
44
|
const spec = useSpec();
|
package/dist/languages/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { t as typescript_exports } from "./typescript.js";
|
|
4
4
|
import { t as java_exports } from "./java.js";
|
|
5
5
|
import { t as go_exports } from "./go.js";
|
package/dist/languages/java.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { useLanguage } from "../contexts/docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
6
6
|
import style_default from "../style.js";
|
package/dist/languages/php.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
package/dist/languages/python.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import "../use-strict-context-
|
|
2
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
3
3
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
4
4
|
import { useComponents } from "../contexts/use-components.js";
|
|
5
5
|
import style_default from "../style.js";
|
|
@@ -261,7 +261,7 @@ function Declaration({ decl }) {
|
|
|
261
261
|
children: "…"
|
|
262
262
|
})
|
|
263
263
|
] });
|
|
264
|
-
case "PythonDeclType": return /* @__PURE__ */ jsx(
|
|
264
|
+
case "PythonDeclType": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
|
|
265
265
|
case "PythonDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
|
|
266
266
|
}
|
|
267
267
|
}
|
package/dist/languages/ruby.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { useDeclaration, useLanguage, useSpec } from "../contexts/docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
6
6
|
import style_default from "../style.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { useDeclaration } from "../contexts/docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
6
6
|
import style_default from "../style.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { useDeclaration, useLanguage, useSpec } from "../contexts/docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
5
|
import { useComponents } from "../contexts/use-components.js";
|
|
6
6
|
import style_default from "../style.js";
|
package/dist/markdown/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../use-strict-context-
|
|
1
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
2
2
|
import { code, fence, heading, item, list, paragraph, parse, strong, text } from "./md.js";
|
|
3
3
|
import { getCustomSnippetTitle, getDecl, getSnippets, stripMarkup } from "./utils.js";
|
|
4
4
|
import { declaration as declaration$1, methodSignature, t as printer_exports } from "./printer.js";
|
|
@@ -9,16 +9,20 @@ function declaration(env, decl) {
|
|
|
9
9
|
const content = declaration$1(env.language, decl);
|
|
10
10
|
return paragraph(code(stripMarkup(content)));
|
|
11
11
|
}
|
|
12
|
-
function renderChildren(env, children, nesting =
|
|
12
|
+
function renderChildren(env, children, nesting = /* @__PURE__ */ new Set()) {
|
|
13
13
|
return list(...children.map((child) => renderDecl(env, child, nesting)));
|
|
14
14
|
}
|
|
15
|
-
function renderDecl(env, path, nesting =
|
|
15
|
+
function renderDecl(env, path, nesting = /* @__PURE__ */ new Set()) {
|
|
16
16
|
const decl = getDecl(env, path);
|
|
17
17
|
const item$1 = item(declaration(env, decl));
|
|
18
|
+
const effectivePath = ("modelPath" in decl && decl["modelPath"] ? `${decl.modelPath} > (schema)` : null) ?? decl.stainlessPath;
|
|
18
19
|
const hasChildren = "children" in decl && decl.children && decl.children.length > 0;
|
|
19
20
|
const showModelProps = !("modelPath" in decl && decl["modelPath"]) || env.options.includeModelProperties;
|
|
20
21
|
if ("docstring" in decl && decl.docstring) item$1.children.push(...parse(decl.docstring));
|
|
21
|
-
if (hasChildren && showModelProps && !nesting.
|
|
22
|
+
if (hasChildren && showModelProps && !nesting.has(effectivePath)) {
|
|
23
|
+
nesting.add(effectivePath);
|
|
24
|
+
item$1.push(renderChildren(env, decl.children ?? [], nesting));
|
|
25
|
+
}
|
|
22
26
|
return item$1;
|
|
23
27
|
}
|
|
24
28
|
function renderMethod(env, method) {
|
package/dist/markdown/printer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
2
|
import { DocsProvider } from "../contexts/docs.js";
|
|
3
|
-
import "../use-strict-context-
|
|
3
|
+
import "../use-strict-context-Clb6Yjly.js";
|
|
4
4
|
import { useLanguageComponents } from "../contexts/index.js";
|
|
5
5
|
import style_default from "../style.js";
|
|
6
6
|
import { ComponentProvider } from "../contexts/component.js";
|
package/dist/routing.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const Languages: readonly ["http", "node", "python", "go", "typescript",
|
|
|
8
8
|
declare const SupportedLanguageSyntaxes: string[];
|
|
9
9
|
type DocsLanguage = (typeof Languages)[number];
|
|
10
10
|
declare const LanguageNames: Record<DocsLanguage, string>;
|
|
11
|
-
declare function getLanguageSnippet(language: DocsLanguage): "
|
|
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
12
|
declare function isSupportedLanguage(language: string): language is DocsLanguage;
|
|
13
13
|
type ParsedStainlessPath = ReturnType<typeof parseStainlessPath>;
|
|
14
14
|
declare function parseStainlessPath(stainlessPath: string): {
|
package/dist/spec.d.ts
CHANGED
|
@@ -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: "
|
|
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: ("
|
|
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;
|
|
@@ -194,6 +194,13 @@
|
|
|
194
194
|
margin-left: calc(-1 * var(--stldocs-expander-margin-shift));
|
|
195
195
|
padding-right: var(--stldocs-expander-right-margin);
|
|
196
196
|
}
|
|
197
|
+
/* move margin to .stldocs-property parent where possible to fix safari subgrid bug */
|
|
198
|
+
.stldocs-property:has(> .stldocs-expander) {
|
|
199
|
+
margin-left: calc(-1 * var(--stldocs-expander-margin-shift));
|
|
200
|
+
& > .stldocs-expander {
|
|
201
|
+
margin-left: 0;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
197
204
|
}
|
|
198
205
|
}
|
|
199
206
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1586,6 +1586,13 @@ a.stl-ui-button {
|
|
|
1586
1586
|
margin-left: calc(-1 * var(--stldocs-expander-margin-shift));
|
|
1587
1587
|
padding-right: var(--stldocs-expander-right-margin);
|
|
1588
1588
|
}
|
|
1589
|
+
/* move margin to .stldocs-property parent where possible to fix safari subgrid bug */
|
|
1590
|
+
.stldocs-property:has(> .stldocs-expander) {
|
|
1591
|
+
margin-left: calc(-1 * var(--stldocs-expander-margin-shift));
|
|
1592
|
+
& > .stldocs-expander {
|
|
1593
|
+
margin-left: 0;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1589
1596
|
}
|
|
1590
1597
|
}
|
|
1591
1598
|
}
|
|
@@ -5,7 +5,7 @@ function createStrictContext(displayName) {
|
|
|
5
5
|
const Context = React.createContext(null);
|
|
6
6
|
Context.displayName = displayName;
|
|
7
7
|
function useStrictContext() {
|
|
8
|
-
const context = React.
|
|
8
|
+
const context = React.use(Context);
|
|
9
9
|
if (context === null) throw new Error(`use${displayName} must be used within a ${displayName}Provider`);
|
|
10
10
|
return context;
|
|
11
11
|
}
|
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.
|
|
4
|
+
"version": "0.1.0-beta.85",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "tsdown",
|
|
87
87
|
"clean": "rm -rf dist",
|
|
88
|
-
"lint": "eslint .",
|
|
88
|
+
"lint": "eslint --flag unstable_native_nodejs_ts_config .",
|
|
89
89
|
"check:types": "tsc --noEmit"
|
|
90
90
|
}
|
|
91
91
|
}
|