@stainless-api/docs-ui 0.1.0-beta.73 → 0.1.0-beta.75
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-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
- package/dist/components/MaskedInput.d.ts +3 -3
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.d.ts +24 -1
- package/dist/components/breadcrumbs.js +62 -7
- package/dist/components/icons.d.ts +18 -13
- package/dist/components/icons.js +940 -2
- package/dist/components/index.d.ts +16 -14
- package/dist/components/index.js +72 -18
- package/dist/components/method.d.ts +58 -1
- package/dist/components/method.js +95 -8
- package/dist/components/overview.d.ts +38 -1
- package/dist/components/overview.js +137 -9
- package/dist/components/primitives.d.ts +104 -1
- package/dist/components/primitives.js +250 -6
- package/dist/components/properties.d.ts +53 -1
- package/dist/components/properties.js +138 -7
- package/dist/components/sdk-sidebar.d.ts +14 -1
- package/dist/components/sdk-sidebar.js +50 -8
- package/dist/components/sdk.d.ts +121 -1
- package/dist/components/sdk.js +405 -8
- package/dist/components/snippets.d.ts +70 -13
- package/dist/components/snippets.js +182 -7
- package/dist/components/stl-sidebar.d.ts +57 -1
- package/dist/components/stl-sidebar.js +105 -3
- package/dist/contexts/component-generics.d.ts +29 -1
- package/dist/contexts/component-generics.js +31 -1
- package/dist/contexts/component-types.d.ts +4 -15
- package/dist/contexts/component.d.ts +7 -17
- package/dist/contexts/component.js +22 -28
- package/dist/contexts/docs.d.ts +61 -1
- package/dist/contexts/docs.js +89 -1
- package/dist/contexts/index.d.ts +13 -14
- package/dist/contexts/index.js +44 -6
- package/dist/contexts/markdown.d.ts +21 -1
- package/dist/contexts/markdown.js +47 -2
- package/dist/contexts/navigation.d.ts +28 -1
- package/dist/contexts/navigation.js +22 -1
- package/dist/contexts/use-components.d.ts +1 -13
- package/dist/contexts/use-components.js +6 -2
- package/dist/{index-HDt5wRiR.d.ts → index-Cl6Gny0o.d.ts} +37 -2
- package/dist/index.d.ts +4 -14
- package/dist/index.js +7 -30
- package/dist/languages/cli.d.ts +38 -14
- package/dist/languages/cli.js +166 -20
- package/dist/languages/csharp.d.ts +42 -14
- package/dist/languages/csharp.js +283 -8
- package/dist/languages/go.d.ts +40 -14
- package/dist/languages/go.js +303 -8
- package/dist/languages/http.d.ts +46 -14
- package/dist/languages/http.js +390 -19
- package/dist/languages/index.d.ts +51 -14
- package/dist/languages/index.js +32 -28
- package/dist/languages/java.d.ts +43 -14
- package/dist/languages/java.js +403 -8
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- package/dist/languages/python.d.ts +40 -14
- package/dist/languages/python.js +269 -8
- package/dist/languages/ruby.d.ts +40 -14
- package/dist/languages/ruby.js +387 -8
- package/dist/languages/terraform.d.ts +48 -14
- package/dist/languages/terraform.js +243 -8
- package/dist/languages/typescript.d.ts +40 -14
- package/dist/languages/typescript.js +449 -8
- package/dist/markdown/index.d.ts +1 -2
- package/dist/markdown/index.js +1 -28
- package/dist/markdown/printer.d.ts +2 -2
- package/dist/markdown/printer.js +6 -30
- package/dist/markdown/utils.d.ts +3 -3
- package/dist/routing.d.ts +61 -2
- package/dist/routing.js +205 -2
- package/dist/spec.d.ts +2 -2
- package/dist/spec.js +2 -2
- package/dist/style.js +176 -1
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +53 -2
- package/package.json +3 -3
- package/dist/breadcrumbs-Dei_5sHd.d.ts +0 -25
- package/dist/breadcrumbs-oUp-6oJK.js +0 -63
- package/dist/cli-BX9ofVCR.js +0 -166
- package/dist/component-Dl5ZEHxB.js +0 -23
- package/dist/component-generics-C9ALAcZI.d.ts +0 -30
- package/dist/component-generics-POFirVVb.js +0 -45
- package/dist/components-DQPlXEwE.js +0 -72
- package/dist/contexts-_NNW5yqC.js +0 -44
- package/dist/csharp-sn5CJu9t.js +0 -283
- package/dist/docs-YgoQ3bzY.js +0 -81
- package/dist/docs-x-kfjRMc.d.ts +0 -66
- package/dist/go-BoaAVmP0.js +0 -303
- package/dist/http-Ccj1dOvE.js +0 -389
- package/dist/icons-BYKn5X8E.js +0 -885
- package/dist/index-OCM-LZIo.d.ts +0 -428
- package/dist/java-BiLRuLuD.js +0 -403
- package/dist/languages-COjc0Nwx.js +0 -30
- package/dist/markdown-BszOPZhh.d.ts +0 -22
- package/dist/markdown-Cq3XEhrR.js +0 -49
- package/dist/method-DjzVBzZe.js +0 -96
- package/dist/method-KkWyhvKa.d.ts +0 -59
- package/dist/navigation-BZjwfN2P.d.ts +0 -29
- package/dist/navigation-aoYZ_tl4.js +0 -24
- package/dist/overview-BNmMeDUE.d.ts +0 -39
- package/dist/overview-Clq5psZe.js +0 -138
- package/dist/primitives-B8OnSXRP.d.ts +0 -105
- package/dist/primitives-BBUs_flm.js +0 -250
- package/dist/properties-BhlRtWo4.d.ts +0 -54
- package/dist/properties-DQU0NBzb.js +0 -138
- package/dist/python-nqOBH7GS.js +0 -269
- package/dist/routing-GvhEMw6E.js +0 -205
- package/dist/routing-qJMPICGo.d.ts +0 -61
- package/dist/ruby-BBc8HdIt.js +0 -387
- package/dist/sdk-C8C6IRQp.d.ts +0 -122
- package/dist/sdk-DzCHhEoX.js +0 -405
- package/dist/sdk-sidebar-CkjSLggl.js +0 -50
- package/dist/sdk-sidebar-lgNmf-ns.d.ts +0 -15
- package/dist/snippets-CLpNVNlA.js +0 -181
- package/dist/stl-sidebar-8jF9cdnn.d.ts +0 -58
- package/dist/stl-sidebar-DC5UOJiT.js +0 -106
- package/dist/style-DJIYkFhO.js +0 -178
- package/dist/terraform-DVx2ea2h.js +0 -243
- package/dist/typescript-Cmk-jBBw.js +0 -449
- package/dist/use-components-BUz3GbO4.js +0 -7
- package/dist/utils-D6zJxUZ9.js +0 -54
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React$1 from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/contexts/navigation.tsx
|
|
5
|
-
const Defaults = { basePath: "/" };
|
|
6
|
-
const NavigationContext = React$1.createContext(Defaults);
|
|
7
|
-
function useNavigation() {
|
|
8
|
-
return React$1.useContext(NavigationContext);
|
|
9
|
-
}
|
|
10
|
-
function NavigationProvider({ basePath, selectedPath, onNavigate, children }) {
|
|
11
|
-
const value = {
|
|
12
|
-
...Defaults,
|
|
13
|
-
onNavigate,
|
|
14
|
-
basePath,
|
|
15
|
-
selectedPath
|
|
16
|
-
};
|
|
17
|
-
return /* @__PURE__ */ jsx(NavigationContext.Provider, {
|
|
18
|
-
value,
|
|
19
|
-
children
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export { useNavigation as n, NavigationProvider as t };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { d as Method, m as Resource } from "./index-HDt5wRiR.js";
|
|
2
|
-
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/components/overview.d.ts
|
|
5
|
-
type SDKResourceProps = {
|
|
6
|
-
resource: Resource;
|
|
7
|
-
parents?: Resource[];
|
|
8
|
-
};
|
|
9
|
-
declare function SDKResourceHeader({
|
|
10
|
-
resource,
|
|
11
|
-
parents
|
|
12
|
-
}: SDKResourceProps): react_jsx_runtime25.JSX.Element | null;
|
|
13
|
-
type SDKMethodSummaryProps = {
|
|
14
|
-
method: Method;
|
|
15
|
-
};
|
|
16
|
-
declare function SDKMethodSummary({
|
|
17
|
-
method
|
|
18
|
-
}: SDKMethodSummaryProps): react_jsx_runtime25.JSX.Element;
|
|
19
|
-
declare function SDKResource({
|
|
20
|
-
resource,
|
|
21
|
-
parents,
|
|
22
|
-
showModels
|
|
23
|
-
}: SDKResourceProps & {
|
|
24
|
-
showModels?: boolean;
|
|
25
|
-
}): react_jsx_runtime25.JSX.Element;
|
|
26
|
-
type SDKOverviewProps = {
|
|
27
|
-
resource: Resource;
|
|
28
|
-
};
|
|
29
|
-
declare function SDKOverview({
|
|
30
|
-
resource
|
|
31
|
-
}: SDKOverviewProps): react_jsx_runtime25.JSX.Element;
|
|
32
|
-
type SDKRootProps = {
|
|
33
|
-
stainlessPath: string;
|
|
34
|
-
};
|
|
35
|
-
declare function SDKRoot({
|
|
36
|
-
stainlessPath
|
|
37
|
-
}: SDKRootProps): react_jsx_runtime25.JSX.Element | null;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { SDKResource as a, SDKRoot as c, SDKOverviewProps as i, SDKRootProps as l, SDKMethodSummaryProps as n, SDKResourceHeader as o, SDKOverview as r, SDKResourceProps as s, SDKMethodSummary as t };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { i as useDeclaration, m as useSpec, s as useLanguage } from "./docs-YgoQ3bzY.js";
|
|
2
|
-
import { n as useLanguageComponents } from "./contexts-_NNW5yqC.js";
|
|
3
|
-
import { t as useComponents } from "./use-components-BUz3GbO4.js";
|
|
4
|
-
import { t as style_default } from "./style-DJIYkFhO.js";
|
|
5
|
-
import { i as PropertyToggle } from "./properties-DQU0NBzb.js";
|
|
6
|
-
import { p as parseStainlessPath } from "./routing-GvhEMw6E.js";
|
|
7
|
-
import { s as Markdown } from "./primitives-BBUs_flm.js";
|
|
8
|
-
import { r as getResourceFromSpec, t as flatResources } from "./utils-D6zJxUZ9.js";
|
|
9
|
-
import * as React$1 from "react";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { ChevronRight } from "lucide-react";
|
|
12
|
-
|
|
13
|
-
//#region src/components/overview.tsx
|
|
14
|
-
function SDKResourceHeader({ resource, parents }) {
|
|
15
|
-
const segments = parents?.map((parent, index) => /* @__PURE__ */ jsxs("span", {
|
|
16
|
-
className: style_default.ResourceTitleSegment,
|
|
17
|
-
children: [parent.title, index < parents.length && /* @__PURE__ */ jsx(ChevronRight, {
|
|
18
|
-
size: 16,
|
|
19
|
-
className: style_default.Icon
|
|
20
|
-
})]
|
|
21
|
-
}, parent.stainlessPath));
|
|
22
|
-
if (!segments && !resource.description) return null;
|
|
23
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className: style_default.ResourceHeader,
|
|
25
|
-
children: [segments && /* @__PURE__ */ jsxs("h4", {
|
|
26
|
-
id: resource.stainlessPath,
|
|
27
|
-
className: style_default.ResourceTitle,
|
|
28
|
-
children: [segments, /* @__PURE__ */ jsx("span", {
|
|
29
|
-
className: style_default.ResourceTitleSegment,
|
|
30
|
-
children: resource.title
|
|
31
|
-
})]
|
|
32
|
-
}), resource.description && /* @__PURE__ */ jsx("div", {
|
|
33
|
-
className: style_default.ResourceDescription,
|
|
34
|
-
children: /* @__PURE__ */ jsx(Markdown, { content: resource.description })
|
|
35
|
-
})]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function SDKMethodSummary({ method }) {
|
|
39
|
-
const Docs = useComponents();
|
|
40
|
-
const Lang = useLanguageComponents();
|
|
41
|
-
const decl = useDeclaration(method.stainlessPath, true);
|
|
42
|
-
return /* @__PURE__ */ jsx(Docs.MethodHeader, {
|
|
43
|
-
level: "h5",
|
|
44
|
-
title: /* @__PURE__ */ jsx(Docs.Link, {
|
|
45
|
-
stainlessPath: method.stainlessPath,
|
|
46
|
-
children: method.summary || method.title
|
|
47
|
-
}),
|
|
48
|
-
signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
|
|
49
|
-
badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
|
|
50
|
-
id: "deprecated",
|
|
51
|
-
children: "Deprecated"
|
|
52
|
-
}),
|
|
53
|
-
children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
|
|
54
|
-
httpMethod: method.httpMethod,
|
|
55
|
-
endpoint: method.endpoint.split(" ", 2).at(-1)
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function SDKResource({ resource, parents, showModels }) {
|
|
60
|
-
const Docs = useComponents();
|
|
61
|
-
const Lang = useLanguageComponents();
|
|
62
|
-
const language = useLanguage();
|
|
63
|
-
const spec = useSpec();
|
|
64
|
-
const methods = Object.values(resource.methods).filter((method) => spec?.decls?.[language]?.[method.stainlessPath]);
|
|
65
|
-
const models = Object.values(resource.models).filter((model) => spec?.decls?.[language]?.[`${model.stainlessPath} > (schema)`]);
|
|
66
|
-
return /* @__PURE__ */ jsx("div", {
|
|
67
|
-
className: style_default.Resource,
|
|
68
|
-
"data-stl-resource-language": language,
|
|
69
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
70
|
-
className: style_default.ResourceContent,
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ jsx(Docs.SDKResourceHeader, {
|
|
73
|
-
resource,
|
|
74
|
-
parents
|
|
75
|
-
}),
|
|
76
|
-
Lang.Resource && /* @__PURE__ */ jsx(Lang.Resource, { resource }),
|
|
77
|
-
methods.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
78
|
-
className: style_default.ResourceContentGroup,
|
|
79
|
-
children: methods.map((method) => /* @__PURE__ */ jsx("div", {
|
|
80
|
-
className: style_default.MethodSummary,
|
|
81
|
-
children: /* @__PURE__ */ jsx(Docs.SDKMethodSummary, { method })
|
|
82
|
-
}, method.stainlessPath))
|
|
83
|
-
}),
|
|
84
|
-
showModels !== false && models.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
85
|
-
className: style_default.ResourceContentGroup,
|
|
86
|
-
"data-stldocs-property-group": "models",
|
|
87
|
-
children: [/* @__PURE__ */ jsxs("h5", {
|
|
88
|
-
className: style_default.ResourceContentGroupModelTitle,
|
|
89
|
-
children: ["Models", /* @__PURE__ */ jsx(PropertyToggle, { target: "models" })]
|
|
90
|
-
}), models.map((model) => /* @__PURE__ */ jsx(Docs.SDKModel, { model }, model.stainlessPath))]
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function SDKOverview({ resource }) {
|
|
97
|
-
const { SDKResource } = useComponents();
|
|
98
|
-
const nested = React$1.useMemo(() => flatResources(resource.subresources, [resource]), [resource]);
|
|
99
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
100
|
-
className: style_default.Overview,
|
|
101
|
-
children: [
|
|
102
|
-
/* @__PURE__ */ jsx("div", {
|
|
103
|
-
className: style_default.OverviewHeader,
|
|
104
|
-
children: /* @__PURE__ */ jsx("h1", { children: resource.title })
|
|
105
|
-
}),
|
|
106
|
-
/* @__PURE__ */ jsx(SDKResource, { resource }),
|
|
107
|
-
nested.map((props, index) => /* @__PURE__ */ jsx(SDKResource, { ...props }, index))
|
|
108
|
-
]
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function SDKRoot({ stainlessPath }) {
|
|
112
|
-
const spec = useSpec();
|
|
113
|
-
const Docs = useComponents();
|
|
114
|
-
const parsed = parseStainlessPath(stainlessPath);
|
|
115
|
-
const resource = spec && getResourceFromSpec(stainlessPath, spec);
|
|
116
|
-
if (!resource || !parsed) {
|
|
117
|
-
console.warn(`Could not find resource or parsed path for '${stainlessPath}'`);
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
if (parsed.method) {
|
|
121
|
-
const method = resource.methods[parsed.method];
|
|
122
|
-
if (!method) {
|
|
123
|
-
console.warn(`Method '${parsed.method}' not found in resource '${resource.stainlessPath}'`);
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
return /* @__PURE__ */ jsx("div", {
|
|
127
|
-
className: style_default.Root,
|
|
128
|
-
children: /* @__PURE__ */ jsx(Docs.SDKMethod, { method })
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return /* @__PURE__ */ jsx("div", {
|
|
132
|
-
className: style_default.Root,
|
|
133
|
-
children: /* @__PURE__ */ jsx(Docs.SDKOverview, { resource })
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
//#endregion
|
|
138
|
-
export { SDKRoot as a, SDKResourceHeader as i, SDKOverview as n, SDKResource as r, SDKMethodSummary as t };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as react0 from "react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
import * as react_jsx_runtime30 from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/components/primitives.d.ts
|
|
6
|
-
type JoinProps = {
|
|
7
|
-
items: ReactNode[];
|
|
8
|
-
limit?: number;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
};
|
|
11
|
-
declare function Join({
|
|
12
|
-
items,
|
|
13
|
-
limit,
|
|
14
|
-
children
|
|
15
|
-
}: JoinProps): react_jsx_runtime30.JSX.Element[];
|
|
16
|
-
type ExpanderProps = {
|
|
17
|
-
id?: string;
|
|
18
|
-
open?: boolean;
|
|
19
|
-
summary: ReactNode;
|
|
20
|
-
virtual?: boolean;
|
|
21
|
-
muted?: boolean;
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
};
|
|
24
|
-
declare function Expander({
|
|
25
|
-
id,
|
|
26
|
-
open,
|
|
27
|
-
summary,
|
|
28
|
-
virtual,
|
|
29
|
-
muted,
|
|
30
|
-
children
|
|
31
|
-
}: ExpanderProps): react_jsx_runtime30.JSX.Element;
|
|
32
|
-
declare function VirtualExpander({
|
|
33
|
-
id,
|
|
34
|
-
open: isOpen,
|
|
35
|
-
muted,
|
|
36
|
-
summary,
|
|
37
|
-
children
|
|
38
|
-
}: Omit<ExpanderProps, 'virtual'>): react_jsx_runtime30.JSX.Element;
|
|
39
|
-
declare function Markdown({
|
|
40
|
-
content
|
|
41
|
-
}: {
|
|
42
|
-
content: string;
|
|
43
|
-
}): "" | react_jsx_runtime30.JSX.Element | undefined;
|
|
44
|
-
type BadgeProps = {
|
|
45
|
-
id: string;
|
|
46
|
-
children?: ReactNode;
|
|
47
|
-
};
|
|
48
|
-
declare function Badge({
|
|
49
|
-
id,
|
|
50
|
-
children
|
|
51
|
-
}: BadgeProps): react_jsx_runtime30.JSX.Element;
|
|
52
|
-
type TooltipProps = {
|
|
53
|
-
content: ReactNode;
|
|
54
|
-
children: ReactNode;
|
|
55
|
-
};
|
|
56
|
-
declare function Tooltip({
|
|
57
|
-
content,
|
|
58
|
-
children
|
|
59
|
-
}: TooltipProps): string | number | bigint | boolean | react_jsx_runtime30.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
60
|
-
type LinkProps = {
|
|
61
|
-
stainlessPath?: string;
|
|
62
|
-
scroll?: boolean;
|
|
63
|
-
children?: ReactNode;
|
|
64
|
-
} & React.HTMLProps<HTMLAnchorElement>;
|
|
65
|
-
declare function Link({
|
|
66
|
-
stainlessPath,
|
|
67
|
-
scroll,
|
|
68
|
-
children,
|
|
69
|
-
...props
|
|
70
|
-
}: LinkProps): string | number | bigint | boolean | react_jsx_runtime30.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
71
|
-
type InputProps = {
|
|
72
|
-
left?: ReactNode;
|
|
73
|
-
right?: ReactNode;
|
|
74
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
75
|
-
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
76
|
-
declare function Input({
|
|
77
|
-
left,
|
|
78
|
-
right,
|
|
79
|
-
ref,
|
|
80
|
-
className,
|
|
81
|
-
...props
|
|
82
|
-
}: InputProps): react_jsx_runtime30.JSX.Element;
|
|
83
|
-
type ToggleButtonProps = {
|
|
84
|
-
children?: ReactNode;
|
|
85
|
-
selected?: boolean;
|
|
86
|
-
} & React.ComponentProps<'button'>;
|
|
87
|
-
declare function ToggleButton({
|
|
88
|
-
children,
|
|
89
|
-
selected,
|
|
90
|
-
ref,
|
|
91
|
-
...props
|
|
92
|
-
}: ToggleButtonProps): react_jsx_runtime30.JSX.Element;
|
|
93
|
-
type ListViewProps<TItem> = {
|
|
94
|
-
items: Array<TItem>;
|
|
95
|
-
itemDelegate: (item: TItem, selected: boolean) => React.ReactNode;
|
|
96
|
-
onSelectListItem?: (item: TItem) => void;
|
|
97
|
-
} & React.HTMLAttributes<HTMLDivElement>;
|
|
98
|
-
declare function ListView<TItem>({
|
|
99
|
-
items,
|
|
100
|
-
itemDelegate,
|
|
101
|
-
onSelectListItem,
|
|
102
|
-
...rest
|
|
103
|
-
}: ListViewProps<TItem>): react_jsx_runtime30.JSX.Element;
|
|
104
|
-
//#endregion
|
|
105
|
-
export { Join as a, ListViewProps as c, ToggleButtonProps as d, Tooltip as f, InputProps as i, Markdown as l, Expander as n, Link as o, VirtualExpander as p, Input as r, ListView as s, Badge as t, ToggleButton as u };
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { l as useSettings, s as useLanguage } from "./docs-YgoQ3bzY.js";
|
|
2
|
-
import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
|
|
3
|
-
import { a as useRenderMarkdown } from "./markdown-Cq3XEhrR.js";
|
|
4
|
-
import { t as style_default } from "./style-DJIYkFhO.js";
|
|
5
|
-
import { s as generateRoute } from "./routing-GvhEMw6E.js";
|
|
6
|
-
import { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import clsx from "clsx";
|
|
9
|
-
import { MinusIcon, PlusIcon } from "lucide-react";
|
|
10
|
-
|
|
11
|
-
//#region src/components/primitives.tsx
|
|
12
|
-
function Join({ items, limit, children }) {
|
|
13
|
-
return (limit && items.length > limit + 1 ? [...items.slice(0, limit), /* @__PURE__ */ jsxs("span", {
|
|
14
|
-
className: style_default.Truncation,
|
|
15
|
-
children: [items.length - limit, " more"]
|
|
16
|
-
}, "truncation")] : items).map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [!!index && children, item] }, `iterator:${index}`));
|
|
17
|
-
}
|
|
18
|
-
function Expander({ id, open, summary, virtual, muted, children }) {
|
|
19
|
-
const virtualExpanders = useSettings()?.virtualExpanders;
|
|
20
|
-
if (virtual || virtualExpanders) return /* @__PURE__ */ jsx(VirtualExpander, {
|
|
21
|
-
summary,
|
|
22
|
-
open,
|
|
23
|
-
muted,
|
|
24
|
-
id,
|
|
25
|
-
children
|
|
26
|
-
}, open ? "open" : "closed");
|
|
27
|
-
return /* @__PURE__ */ jsxs("details", {
|
|
28
|
-
className: style_default.Expander,
|
|
29
|
-
open,
|
|
30
|
-
"data-stldocs-expander-muted": muted,
|
|
31
|
-
"data-stldocs-expander-initial-state": open,
|
|
32
|
-
children: [/* @__PURE__ */ jsxs("summary", {
|
|
33
|
-
className: style_default.ExpanderSummary,
|
|
34
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
-
className: style_default.ExpanderSummaryIcon,
|
|
36
|
-
children: [/* @__PURE__ */ jsx(PlusIcon, {
|
|
37
|
-
size: 16,
|
|
38
|
-
strokeWidth: 1,
|
|
39
|
-
className: style_default.Icon
|
|
40
|
-
}), /* @__PURE__ */ jsx(MinusIcon, {
|
|
41
|
-
size: 16,
|
|
42
|
-
strokeWidth: 1,
|
|
43
|
-
className: style_default.Icon
|
|
44
|
-
})]
|
|
45
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
46
|
-
className: style_default.ExpanderSummaryContent,
|
|
47
|
-
children: summary
|
|
48
|
-
})]
|
|
49
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
50
|
-
className: style_default.ExpanderContent,
|
|
51
|
-
id,
|
|
52
|
-
children
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function VirtualExpander({ id, open: isOpen, muted, summary, children }) {
|
|
57
|
-
const [open, setOpen] = useState(isOpen ?? false);
|
|
58
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
59
|
-
className: style_default.Expander,
|
|
60
|
-
"data-open": open,
|
|
61
|
-
"data-stldocs-expander-muted": muted,
|
|
62
|
-
"data-stldocs-expander-initial-state": open,
|
|
63
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
64
|
-
className: style_default.ExpanderSummary,
|
|
65
|
-
onClick: () => setOpen(!open),
|
|
66
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
67
|
-
className: style_default.ExpanderSummaryIcon,
|
|
68
|
-
children: [/* @__PURE__ */ jsx(PlusIcon, {
|
|
69
|
-
size: 16,
|
|
70
|
-
className: style_default.Icon
|
|
71
|
-
}), /* @__PURE__ */ jsx(MinusIcon, {
|
|
72
|
-
size: 16,
|
|
73
|
-
className: style_default.Icon
|
|
74
|
-
})]
|
|
75
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
76
|
-
className: style_default.ExpanderSummaryContent,
|
|
77
|
-
children: summary
|
|
78
|
-
})]
|
|
79
|
-
}), open && /* @__PURE__ */ jsx("div", {
|
|
80
|
-
className: style_default.ExpanderContent,
|
|
81
|
-
id,
|
|
82
|
-
children
|
|
83
|
-
})]
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function Markdown({ content }) {
|
|
87
|
-
const rendered = useRenderMarkdown(content);
|
|
88
|
-
return rendered && /* @__PURE__ */ jsx("div", {
|
|
89
|
-
className: clsx(style_default.Markdown, style_default.Content, "stl-ui-prose"),
|
|
90
|
-
dangerouslySetInnerHTML: { __html: rendered }
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function Badge({ id, children }) {
|
|
94
|
-
return /* @__PURE__ */ jsx("span", {
|
|
95
|
-
className: style_default.Badge,
|
|
96
|
-
"data-badge-id": id,
|
|
97
|
-
children: children ?? id
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
const TooltipNestingContext = createContext(false);
|
|
101
|
-
function Tooltip({ content, children }) {
|
|
102
|
-
if (useContext(TooltipNestingContext)) return children;
|
|
103
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
104
|
-
className: style_default.Tooltip,
|
|
105
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
106
|
-
className: style_default.TooltipContent,
|
|
107
|
-
children: /* @__PURE__ */ jsx(TooltipNestingContext.Provider, {
|
|
108
|
-
value: true,
|
|
109
|
-
children: content
|
|
110
|
-
})
|
|
111
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
112
|
-
className: style_default.TooltipHost,
|
|
113
|
-
children
|
|
114
|
-
})]
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
function Link({ stainlessPath, scroll = true, children, ...props }) {
|
|
118
|
-
const { basePath, onNavigate } = useNavigation();
|
|
119
|
-
const language = useLanguage();
|
|
120
|
-
const href = useMemo(() => {
|
|
121
|
-
if (props.href) return props.href;
|
|
122
|
-
if (stainlessPath && basePath) return generateRoute(basePath, language, stainlessPath);
|
|
123
|
-
}, [
|
|
124
|
-
basePath,
|
|
125
|
-
language,
|
|
126
|
-
stainlessPath,
|
|
127
|
-
props.href
|
|
128
|
-
]);
|
|
129
|
-
const handleClick = useCallback((e) => {
|
|
130
|
-
if (props.onClick) props.onClick(e);
|
|
131
|
-
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
132
|
-
if (href && stainlessPath) onNavigate?.(e, {
|
|
133
|
-
href,
|
|
134
|
-
language,
|
|
135
|
-
stainlessPath,
|
|
136
|
-
scroll
|
|
137
|
-
});
|
|
138
|
-
}, [
|
|
139
|
-
href,
|
|
140
|
-
scroll,
|
|
141
|
-
onNavigate,
|
|
142
|
-
language,
|
|
143
|
-
props,
|
|
144
|
-
stainlessPath
|
|
145
|
-
]);
|
|
146
|
-
if (!href) return children;
|
|
147
|
-
return /* @__PURE__ */ jsx("a", {
|
|
148
|
-
href,
|
|
149
|
-
onClick: handleClick,
|
|
150
|
-
...props,
|
|
151
|
-
children
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
function Input({ left, right, ref, className, ...props }) {
|
|
155
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
156
|
-
className: clsx(style_default.Input, props.disabled && style_default.InputDisabled, className),
|
|
157
|
-
children: [
|
|
158
|
-
left,
|
|
159
|
-
/* @__PURE__ */ jsx("input", {
|
|
160
|
-
...props,
|
|
161
|
-
ref,
|
|
162
|
-
className: style_default.InputTextField
|
|
163
|
-
}),
|
|
164
|
-
right
|
|
165
|
-
]
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
function ToggleButton({ children, selected, ref, ...props }) {
|
|
169
|
-
return /* @__PURE__ */ jsx("button", {
|
|
170
|
-
...props,
|
|
171
|
-
ref,
|
|
172
|
-
className: style_default.ToggleButton,
|
|
173
|
-
"data-stldocs-toggle-selected": selected,
|
|
174
|
-
children
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
function ListView({ items, itemDelegate, onSelectListItem, ...rest }) {
|
|
178
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
179
|
-
const [keyboardIndex, setKeyboardIndex] = useState(0);
|
|
180
|
-
const listRef = useRef(null);
|
|
181
|
-
const itemRef = useRef(null);
|
|
182
|
-
const handleSelect = useCallback(() => {
|
|
183
|
-
const item = items[selectedIndex];
|
|
184
|
-
if (item) onSelectListItem?.(item);
|
|
185
|
-
}, [
|
|
186
|
-
items,
|
|
187
|
-
selectedIndex,
|
|
188
|
-
onSelectListItem
|
|
189
|
-
]);
|
|
190
|
-
useEffect(() => {
|
|
191
|
-
const ac = new AbortController();
|
|
192
|
-
document.addEventListener("keydown", (ev) => {
|
|
193
|
-
switch (ev.key) {
|
|
194
|
-
case "ArrowUp": {
|
|
195
|
-
ev.preventDefault();
|
|
196
|
-
const value = Math.max(0, selectedIndex - 1);
|
|
197
|
-
setSelectedIndex(value);
|
|
198
|
-
setKeyboardIndex(value);
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
case "ArrowDown": {
|
|
202
|
-
ev.preventDefault();
|
|
203
|
-
const value = Math.min(items.length, selectedIndex + 1);
|
|
204
|
-
setSelectedIndex(value);
|
|
205
|
-
setKeyboardIndex(value);
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
case "Enter":
|
|
209
|
-
ev.preventDefault();
|
|
210
|
-
handleSelect();
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
}, { signal: ac.signal });
|
|
214
|
-
return () => ac.abort();
|
|
215
|
-
}, [
|
|
216
|
-
items,
|
|
217
|
-
selectedIndex,
|
|
218
|
-
handleSelect
|
|
219
|
-
]);
|
|
220
|
-
useEffect(() => {
|
|
221
|
-
if (!keyboardIndex || !itemRef.current || !listRef.current) {
|
|
222
|
-
listRef?.current?.scroll(0, 0);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const selectedBounds = itemRef.current.getBoundingClientRect();
|
|
226
|
-
const listBounds = listRef.current.getBoundingClientRect();
|
|
227
|
-
if (selectedBounds.top < listBounds.top || selectedBounds.bottom > listBounds.bottom) itemRef.current.scrollIntoView({ block: "nearest" });
|
|
228
|
-
}, [
|
|
229
|
-
keyboardIndex,
|
|
230
|
-
items,
|
|
231
|
-
listRef
|
|
232
|
-
]);
|
|
233
|
-
return /* @__PURE__ */ jsx("div", {
|
|
234
|
-
ref: listRef,
|
|
235
|
-
className: style_default.ListView,
|
|
236
|
-
tabIndex: 0,
|
|
237
|
-
...rest,
|
|
238
|
-
children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
|
|
239
|
-
ref: index === selectedIndex ? itemRef : null,
|
|
240
|
-
className: style_default.ListViewItem,
|
|
241
|
-
"data-stldocs-listview-selected": index === selectedIndex,
|
|
242
|
-
onClick: handleSelect,
|
|
243
|
-
onMouseEnter: () => setSelectedIndex(index),
|
|
244
|
-
children: itemDelegate(item, index === selectedIndex)
|
|
245
|
-
}, index))
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
//#endregion
|
|
250
|
-
export { Link as a, ToggleButton as c, Join as i, Tooltip as l, Expander as n, ListView as o, Input as r, Markdown as s, Badge as t, VirtualExpander as u };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import * as react_jsx_runtime40 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/components/properties.d.ts
|
|
5
|
-
type PropertyToggleProps = {
|
|
6
|
-
target: string;
|
|
7
|
-
};
|
|
8
|
-
declare function PropertyToggle({
|
|
9
|
-
target
|
|
10
|
-
}: PropertyToggleProps): react_jsx_runtime40.JSX.Element;
|
|
11
|
-
type PropertyDescriptionProps = {
|
|
12
|
-
description?: string;
|
|
13
|
-
};
|
|
14
|
-
declare function PropertyDescription({
|
|
15
|
-
description
|
|
16
|
-
}: PropertyDescriptionProps): react_jsx_runtime40.JSX.Element | undefined;
|
|
17
|
-
type PropertyTitleProps = {
|
|
18
|
-
title?: string;
|
|
19
|
-
};
|
|
20
|
-
declare function PropertyTitle({
|
|
21
|
-
title
|
|
22
|
-
}: PropertyTitleProps): react_jsx_runtime40.JSX.Element | undefined;
|
|
23
|
-
type PropertyProps = {
|
|
24
|
-
id?: string;
|
|
25
|
-
name?: ReactNode;
|
|
26
|
-
typeName?: ReactNode;
|
|
27
|
-
badges?: ReactNode;
|
|
28
|
-
type?: ReactNode;
|
|
29
|
-
description?: string;
|
|
30
|
-
title?: string;
|
|
31
|
-
expand?: boolean;
|
|
32
|
-
deprecated?: boolean | string;
|
|
33
|
-
additional?: ReactNode;
|
|
34
|
-
declaration?: ReactNode;
|
|
35
|
-
constraints?: ReactNode;
|
|
36
|
-
children?: ReactNode;
|
|
37
|
-
};
|
|
38
|
-
declare function Property({
|
|
39
|
-
id,
|
|
40
|
-
name,
|
|
41
|
-
typeName,
|
|
42
|
-
badges,
|
|
43
|
-
type,
|
|
44
|
-
declaration,
|
|
45
|
-
description,
|
|
46
|
-
title,
|
|
47
|
-
deprecated,
|
|
48
|
-
expand,
|
|
49
|
-
additional,
|
|
50
|
-
constraints,
|
|
51
|
-
children
|
|
52
|
-
}: PropertyProps): react_jsx_runtime40.JSX.Element | null;
|
|
53
|
-
//#endregion
|
|
54
|
-
export { PropertyTitle as a, PropertyToggleProps as c, PropertyProps as i, PropertyDescription as n, PropertyTitleProps as o, PropertyDescriptionProps as r, PropertyToggle as s, Property as t };
|