@stainless-api/docs-ui 0.1.0-beta.8 → 0.1.0-beta.80
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/chunk-BYypO7fO.js +18 -0
- package/dist/components/MaskedInput.d.ts +14 -0
- package/dist/components/MaskedInput.js +76 -0
- package/dist/components/breadcrumbs.d.ts +25 -0
- package/dist/components/breadcrumbs.js +64 -0
- package/dist/components/icons.d.ts +65 -0
- package/dist/components/icons.js +941 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +75 -0
- package/dist/components/method.d.ts +59 -0
- package/dist/components/method.js +97 -0
- package/dist/components/overview.d.ts +39 -0
- package/dist/components/overview.js +139 -0
- package/dist/components/primitives.d.ts +107 -0
- package/dist/components/primitives.js +253 -0
- package/dist/components/properties.d.ts +54 -0
- package/dist/components/properties.js +140 -0
- package/dist/components/sdk-sidebar.d.ts +15 -0
- package/dist/components/sdk-sidebar.js +52 -0
- package/dist/components/sdk.d.ts +128 -0
- package/dist/components/sdk.js +490 -0
- package/dist/components/snippets.d.ts +71 -0
- package/dist/components/snippets.js +184 -0
- package/dist/components/stl-sidebar.d.ts +58 -0
- package/dist/components/stl-sidebar.js +114 -0
- package/dist/contexts/component-generics.d.ts +30 -0
- package/dist/contexts/component-generics.js +33 -0
- package/dist/contexts/component-types.d.ts +8 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +21 -0
- package/dist/contexts/component.js +24 -0
- package/dist/contexts/docs.d.ts +62 -0
- package/dist/contexts/docs.js +91 -0
- package/dist/contexts/index.d.ts +13 -0
- package/dist/contexts/index.js +45 -0
- package/dist/contexts/markdown.d.ts +22 -0
- package/dist/contexts/markdown.js +49 -0
- package/dist/contexts/navigation.d.ts +29 -0
- package/dist/contexts/navigation.js +24 -0
- package/dist/contexts/use-components.d.ts +6 -0
- package/dist/contexts/use-components.js +8 -0
- package/dist/index-pvh-w1xa.d.ts +1776 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -7542
- package/dist/languages/cli.d.ts +38 -0
- package/dist/languages/cli.js +167 -0
- package/dist/languages/csharp.d.ts +42 -0
- package/dist/languages/csharp.js +284 -0
- package/dist/languages/go.d.ts +40 -0
- package/dist/languages/go.js +304 -0
- package/dist/languages/http.d.ts +46 -0
- package/dist/languages/http.js +391 -0
- package/dist/languages/index.d.ts +51 -0
- package/dist/languages/index.js +33 -0
- package/dist/languages/java.d.ts +43 -0
- package/dist/languages/java.js +404 -0
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- package/dist/languages/python.d.ts +40 -0
- package/dist/languages/python.js +270 -0
- package/dist/languages/ruby.d.ts +40 -0
- package/dist/languages/ruby.js +388 -0
- package/dist/languages/terraform.d.ts +48 -0
- package/dist/languages/terraform.js +244 -0
- package/dist/languages/typescript.d.ts +40 -0
- package/dist/languages/typescript.js +450 -0
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +80 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +41 -0
- package/dist/markdown/printer.d.ts +13 -0
- package/dist/markdown/printer.js +76 -0
- package/dist/markdown/utils.d.ts +21 -0
- package/dist/markdown/utils.js +31 -0
- package/dist/routing.d.ts +61 -0
- package/dist/routing.js +176 -150
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +167 -0
- package/dist/style.d.ts +177 -0
- package/dist/style.js +178 -0
- package/dist/styles/main.css +788 -752
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +326 -458
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +32 -41
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +192 -270
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +182 -69
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/variables.css +28 -89
- package/dist/styles/variables.js +0 -0
- package/dist/styles.css +3333 -0
- package/dist/styles.mjs +1 -0
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +54 -0
- package/package.json +74 -22
- package/dist/mcp.js +0 -16003
- package/dist/styles/snippets.css +0 -132
- package/src/components/breadcrumbs.tsx +0 -94
- package/src/components/chat.tsx +0 -154
- package/src/components/dropdown.tsx +0 -91
- package/src/components/icons.tsx +0 -584
- package/src/components/index.ts +0 -9
- package/src/components/method.tsx +0 -146
- package/src/components/overview.tsx +0 -160
- package/src/components/primitives.tsx +0 -284
- package/src/components/properties.tsx +0 -130
- package/src/components/scripts/dropdown.ts +0 -78
- package/src/components/sdk.tsx +0 -403
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -180
- package/src/contexts/component-generics.tsx +0 -48
- package/src/contexts/component-types.tsx +0 -5
- package/src/contexts/component.tsx +0 -32
- package/src/contexts/docs.tsx +0 -75
- package/src/contexts/index.tsx +0 -17
- package/src/contexts/markdown.tsx +0 -43
- package/src/contexts/navigation.tsx +0 -44
- package/src/contexts/search.tsx +0 -28
- package/src/contexts/use-components.tsx +0 -4
- package/src/index.ts +0 -6
- package/src/languages/go.tsx +0 -281
- package/src/languages/http.tsx +0 -321
- package/src/languages/index.ts +0 -26
- package/src/languages/java.tsx +0 -358
- package/src/languages/python.tsx +0 -255
- package/src/languages/ruby.tsx +0 -320
- package/src/languages/typescript.tsx +0 -393
- package/src/markdown/index.ts +0 -107
- package/src/markdown/md.ts +0 -45
- package/src/markdown/utils.ts +0 -49
- package/src/routing.ts +0 -238
- package/src/search/form.tsx +0 -127
- package/src/search/index.tsx +0 -1
- package/src/search/indexer.ts +0 -246
- package/src/search/mcp.ts +0 -61
- package/src/search/printer.tsx +0 -86
- package/src/search/providers/algolia.ts +0 -88
- package/src/search/providers/fuse.ts +0 -19
- package/src/search/providers/pagefind.ts +0 -17
- package/src/search/providers/walker.ts +0 -30
- package/src/search/results.tsx +0 -182
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -196
- package/src/styles/main.css +0 -986
- package/src/styles/primitives.css +0 -580
- package/src/styles/resets.css +0 -39
- package/src/styles/search.css +0 -341
- package/src/styles/sidebar.css +0 -85
- package/src/styles/snippets.css +0 -130
- package/src/styles/variables.css +0 -86
- package/src/utils.ts +0 -41
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!no_symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __exportAll as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputProps } from "./primitives.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/MaskedInput.d.ts
|
|
5
|
+
declare const MaskedInput: ({
|
|
6
|
+
left,
|
|
7
|
+
right,
|
|
8
|
+
defaultValue,
|
|
9
|
+
value,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
}: InputProps) => react_jsx_runtime0.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { MaskedInput };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import style_default from "../style.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/MaskedInput.tsx
|
|
6
|
+
const getMaskedParts = (text) => {
|
|
7
|
+
if (!text) return {
|
|
8
|
+
prefix: "",
|
|
9
|
+
maskedSecret: ""
|
|
10
|
+
};
|
|
11
|
+
const percentLength = Math.min(Math.floor(text.length * .3), 8);
|
|
12
|
+
const nonAlphaMatches = [...text.substring(0, percentLength).matchAll(/[^a-zA-Z0-9]/g)];
|
|
13
|
+
let prefixEnd = 0;
|
|
14
|
+
if (nonAlphaMatches.length > 0) prefixEnd = nonAlphaMatches.at(-1).index + 1;
|
|
15
|
+
else prefixEnd = percentLength;
|
|
16
|
+
return {
|
|
17
|
+
prefix: text.substring(0, prefixEnd),
|
|
18
|
+
maskedSecret: "•".repeat(text.length - prefixEnd)
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const MaskedInput = function Input({ left, right, defaultValue, value, ref, ...props }) {
|
|
22
|
+
const initialValue = (value ?? defaultValue ?? "").toString();
|
|
23
|
+
const [displayValue, setDisplayValue] = React$1.useState(initialValue);
|
|
24
|
+
const inputRef = React$1.useRef(null);
|
|
25
|
+
React$1.useImperativeHandle(ref, () => inputRef.current);
|
|
26
|
+
const updateDisplayValue = () => {
|
|
27
|
+
if (inputRef.current) setDisplayValue(inputRef.current.value);
|
|
28
|
+
};
|
|
29
|
+
const handleBlur = (e) => {
|
|
30
|
+
updateDisplayValue();
|
|
31
|
+
inputRef.current?.scrollTo({
|
|
32
|
+
behavior: "instant",
|
|
33
|
+
left: 0,
|
|
34
|
+
top: 0
|
|
35
|
+
});
|
|
36
|
+
props.onBlur?.(e);
|
|
37
|
+
};
|
|
38
|
+
const { prefix, maskedSecret } = getMaskedParts(displayValue);
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: style_default.Input,
|
|
41
|
+
children: [
|
|
42
|
+
left,
|
|
43
|
+
/* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: style_default.MaskedInputWrapper,
|
|
45
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
46
|
+
...props,
|
|
47
|
+
ref: inputRef,
|
|
48
|
+
defaultValue,
|
|
49
|
+
value,
|
|
50
|
+
onBlur: handleBlur,
|
|
51
|
+
onScroll: (e) => {
|
|
52
|
+
if (!e.currentTarget.matches(":focus")) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
inputRef.current?.scrollTo({
|
|
55
|
+
behavior: "instant",
|
|
56
|
+
left: 0,
|
|
57
|
+
top: 0
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: style_default.MaskedInputDisplay,
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
children: [prefix, /* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: style_default.MaskedInputObscured,
|
|
66
|
+
children: maskedSecret
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
}),
|
|
70
|
+
right
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { MaskedInput };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { v as Spec } from "../index-pvh-w1xa.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/breadcrumbs.d.ts
|
|
5
|
+
type Breadcrumb = {
|
|
6
|
+
title: string;
|
|
7
|
+
href: string;
|
|
8
|
+
};
|
|
9
|
+
type BreadcrumbConfig = {
|
|
10
|
+
includeCurrentPage?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare function generateApiBreadcrumbs(fullPath: string, spec: any, basePath: string): Breadcrumb[] | null;
|
|
13
|
+
declare function SDKBreadcrumbs({
|
|
14
|
+
spec,
|
|
15
|
+
currentPath,
|
|
16
|
+
basePath,
|
|
17
|
+
config
|
|
18
|
+
}: {
|
|
19
|
+
spec: Spec;
|
|
20
|
+
currentPath: string;
|
|
21
|
+
basePath?: string;
|
|
22
|
+
config?: BreadcrumbConfig | null;
|
|
23
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { SDKBreadcrumbs, generateApiBreadcrumbs };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import "../use-strict-context-L0c8JKg4.js";
|
|
2
|
+
import style_default from "../style.js";
|
|
3
|
+
import { Languages } from "../routing.js";
|
|
4
|
+
import { Join } from "./primitives.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronRight } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/breadcrumbs.tsx
|
|
9
|
+
function generateApiBreadcrumbs(fullPath, spec, basePath) {
|
|
10
|
+
const cleanBasePath = basePath.replace(/\/+$/, "");
|
|
11
|
+
const cleanPath = fullPath.replace(/\/+$/, "");
|
|
12
|
+
if (!cleanPath.startsWith(cleanBasePath)) return null;
|
|
13
|
+
const rest = cleanPath.slice(cleanBasePath.length).split("/").filter(Boolean);
|
|
14
|
+
const breadcrumbs = [];
|
|
15
|
+
let href = cleanBasePath;
|
|
16
|
+
let i = 0;
|
|
17
|
+
if (Languages.includes(rest[0])) {
|
|
18
|
+
href += `/${rest[0]}`;
|
|
19
|
+
i++;
|
|
20
|
+
}
|
|
21
|
+
breadcrumbs.push({
|
|
22
|
+
title: "API Reference",
|
|
23
|
+
href
|
|
24
|
+
});
|
|
25
|
+
let currentSpec = spec;
|
|
26
|
+
while (i < rest.length) {
|
|
27
|
+
const idType = rest[i];
|
|
28
|
+
const idValue = rest[i + 1];
|
|
29
|
+
if (!idType || !idValue || !currentSpec?.[idType]?.[idValue]) break;
|
|
30
|
+
currentSpec = currentSpec[idType][idValue];
|
|
31
|
+
href += `/${idType}/${idValue}`;
|
|
32
|
+
const title = (idType === "methods" ? currentSpec.summary : currentSpec.title) ?? idValue;
|
|
33
|
+
breadcrumbs.push({
|
|
34
|
+
title,
|
|
35
|
+
href
|
|
36
|
+
});
|
|
37
|
+
i += 2;
|
|
38
|
+
}
|
|
39
|
+
return breadcrumbs;
|
|
40
|
+
}
|
|
41
|
+
function SDKBreadcrumbs({ spec, currentPath, basePath = "/api", config = { includeCurrentPage: false } }) {
|
|
42
|
+
const breadcrumbs = generateApiBreadcrumbs(currentPath, spec, basePath);
|
|
43
|
+
if (!breadcrumbs || breadcrumbs.length === 0) return null;
|
|
44
|
+
if (!config?.includeCurrentPage && breadcrumbs.length > 1) breadcrumbs.pop();
|
|
45
|
+
const items = breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: style_default.BreadcrumbsItem,
|
|
47
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
48
|
+
href: crumb.href,
|
|
49
|
+
className: style_default.BreadcrumbsLink,
|
|
50
|
+
children: crumb.title
|
|
51
|
+
})
|
|
52
|
+
}, index));
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
className: style_default.Breadcrumbs,
|
|
55
|
+
children: /* @__PURE__ */ jsx(Join, {
|
|
56
|
+
limit: breadcrumbs.length,
|
|
57
|
+
items,
|
|
58
|
+
children: /* @__PURE__ */ jsx(ChevronRight, {})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { SDKBreadcrumbs, generateApiBreadcrumbs };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/icons.d.ts
|
|
4
|
+
declare function CSharpIcon({
|
|
5
|
+
className
|
|
6
|
+
}: {
|
|
7
|
+
className?: string;
|
|
8
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function GoIcon({
|
|
10
|
+
className
|
|
11
|
+
}: {
|
|
12
|
+
className?: string;
|
|
13
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare function JavaIcon({
|
|
15
|
+
className
|
|
16
|
+
}: {
|
|
17
|
+
className?: string;
|
|
18
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
declare function KotlinIcon({
|
|
20
|
+
className
|
|
21
|
+
}: {
|
|
22
|
+
className?: string;
|
|
23
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare function PythonIcon({
|
|
25
|
+
className
|
|
26
|
+
}: {
|
|
27
|
+
className?: string;
|
|
28
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
29
|
+
declare function RubyIcon({
|
|
30
|
+
className
|
|
31
|
+
}: {
|
|
32
|
+
className?: string;
|
|
33
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
34
|
+
declare function TerraformIcon({
|
|
35
|
+
className
|
|
36
|
+
}: {
|
|
37
|
+
className?: string;
|
|
38
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
39
|
+
declare function TypescriptIcon({
|
|
40
|
+
className
|
|
41
|
+
}: {
|
|
42
|
+
className?: string;
|
|
43
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
44
|
+
declare function CurlIcon({
|
|
45
|
+
className
|
|
46
|
+
}: {
|
|
47
|
+
className?: string;
|
|
48
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
49
|
+
declare function PowershellIcon({
|
|
50
|
+
className
|
|
51
|
+
}: {
|
|
52
|
+
className?: string;
|
|
53
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
54
|
+
declare function CLIIcon({
|
|
55
|
+
className
|
|
56
|
+
}: {
|
|
57
|
+
className?: string;
|
|
58
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
59
|
+
declare function PHPIcon({
|
|
60
|
+
className
|
|
61
|
+
}: {
|
|
62
|
+
className?: string;
|
|
63
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PHPIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };
|