@stainless-api/docs-ui 0.1.0-beta.60 → 0.1.0-beta.62
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/{breadcrumbs-seA1JsK4.d.ts → breadcrumbs-C14t6IEW.d.ts} +3 -3
- package/dist/{breadcrumbs-BagP1oN2.d.ts → breadcrumbs-IxKxOsE0.d.ts} +1 -1
- package/dist/{breadcrumbs-85Y-pybq.js → breadcrumbs-Q76uwfdC.js} +3 -3
- package/dist/{cli-CoLvH9jq.js → cli-lM9nDBQl.js} +5 -5
- package/dist/{component-CF9lLzZX.js → component-D93BctHn.js} +3 -3
- package/dist/{component-generics-DS5pysMb.d.ts → component-generics-Bd4PJtTE.d.ts} +2 -2
- package/dist/{component-generics-BblkOh-y.d.ts → component-generics-BmJeLTNJ.d.ts} +2 -2
- package/dist/components/MaskedInput.d.ts +3 -3
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +7 -7
- package/dist/components/icons.d.ts +12 -12
- package/dist/components/icons.js +1 -1
- package/dist/components/index.d.ts +11 -10
- package/dist/components/index.js +18 -17
- package/dist/components/method.d.ts +1 -1
- package/dist/components/method.js +8 -8
- package/dist/components/overview.d.ts +1 -1
- package/dist/components/overview.js +9 -9
- package/dist/components/primitives.d.ts +1 -1
- package/dist/components/primitives.js +6 -6
- package/dist/components/properties.d.ts +1 -1
- package/dist/components/properties.js +7 -7
- package/dist/components/sdk-sidebar.d.ts +2 -0
- package/dist/components/sdk-sidebar.js +10 -0
- package/dist/components/sdk.d.ts +2 -2
- package/dist/components/sdk.js +9 -9
- package/dist/components/snippets.d.ts +2 -2
- package/dist/components/snippets.js +7 -7
- package/dist/components/stl-sidebar.d.ts +2 -0
- package/dist/components/stl-sidebar.js +5 -0
- package/dist/{components-Bz5h0Y4x.js → components-DmiarGZ9.js} +15 -14
- package/dist/contexts/component-generics.d.ts +1 -1
- package/dist/contexts/component-generics.js +1 -1
- package/dist/contexts/component-types.d.ts +11 -10
- package/dist/contexts/component.d.ts +14 -13
- package/dist/contexts/component.js +27 -26
- package/dist/contexts/docs.d.ts +2 -2
- package/dist/contexts/docs.js +2 -2
- package/dist/contexts/index.d.ts +17 -16
- package/dist/contexts/index.js +6 -6
- package/dist/contexts/markdown.d.ts +1 -1
- package/dist/contexts/markdown.js +2 -2
- package/dist/contexts/navigation.d.ts +1 -1
- package/dist/contexts/navigation.js +1 -1
- package/dist/contexts/use-components.d.ts +10 -9
- package/dist/contexts/use-components.js +2 -2
- package/dist/{contexts-DZfPd182.js → contexts-DMjqoc7S.js} +6 -5
- package/dist/{csharp-BbNnLZWW.js → csharp-BD37FKH6.js} +4 -4
- package/dist/{docs-Bw-eLYjA.js → docs-6PYi1eEV.js} +5 -1
- package/dist/{docs-DdWB4Wsv.d.ts → docs-Dzjz2m8E.d.ts} +6 -5
- package/dist/{docs-DFS6wkGm.d.ts → docs-cYeV7nR2.d.ts} +5 -4
- package/dist/{go-OFa_5xje.js → go-v-i4WDzK.js} +4 -4
- package/dist/{http-olFAYLFq.js → http-CXjSoAxs.js} +14 -10
- package/dist/{index-BdrPd64A.d.ts → index-6vTGbgXx.d.ts} +35 -35
- package/dist/index-C619u0I1.d.ts +16 -0
- package/dist/index-CiZUWHkc.d.ts +16 -0
- package/dist/{index-Ct7H30x1.d.ts → index-DuHyTVVD.d.ts} +1 -1
- package/dist/{index-CLMudlDX.d.ts → index-wOU588Um.d.ts} +35 -35
- package/dist/index.d.ts +16 -15
- package/dist/index.js +29 -28
- package/dist/{java-Bw0o13Wk.js → java-A6j1NMJ7.js} +5 -5
- package/dist/languages/cli.d.ts +11 -10
- package/dist/languages/cli.js +19 -18
- package/dist/languages/csharp.d.ts +11 -10
- package/dist/languages/csharp.js +7 -7
- package/dist/languages/go.d.ts +11 -10
- package/dist/languages/go.js +7 -7
- package/dist/languages/http.d.ts +11 -10
- package/dist/languages/http.js +18 -17
- package/dist/languages/index.d.ts +11 -10
- package/dist/languages/index.js +26 -25
- package/dist/languages/java.d.ts +11 -10
- package/dist/languages/java.js +7 -7
- package/dist/languages/python.d.ts +11 -10
- package/dist/languages/python.js +7 -7
- package/dist/languages/ruby.d.ts +11 -10
- package/dist/languages/ruby.js +7 -7
- package/dist/languages/typescript.d.ts +11 -10
- package/dist/languages/typescript.js +7 -7
- package/dist/languages-C6gLi0rP.js +28 -0
- package/dist/markdown/index.d.ts +2 -2
- package/dist/markdown/index.js +28 -27
- package/dist/markdown/printer.d.ts +2 -2
- package/dist/markdown/printer.js +29 -28
- package/dist/markdown/utils.d.ts +3 -3
- package/dist/markdown/utils.js +2 -2
- package/dist/{markdown-ZzVcn4kq.js → markdown-DHjcD13O.js} +1 -1
- package/dist/{markdown-Dyn0NA2f.d.ts → markdown-DkGIT8Kx.d.ts} +2 -2
- package/dist/{markdown-DtbgEdDt.d.ts → markdown-DmrCjnT8.d.ts} +2 -2
- package/dist/{method-CxjUvijp.d.ts → method-BlxcOrX4.d.ts} +6 -6
- package/dist/{method-Dktsfckf.js → method-mosT_h9v.js} +3 -3
- package/dist/{navigation-Dk55c7au.d.ts → navigation-865UcdP7.d.ts} +1 -1
- package/dist/{navigation-DLQvobDt.d.ts → navigation-CRKiHkwL.d.ts} +3 -3
- package/dist/{overview-rRsC-Yi_.d.ts → overview-CAxvIfWH.d.ts} +7 -7
- package/dist/{overview-EkRigi6e.js → overview-CDIg0UWY.js} +8 -8
- package/dist/{overview-DVu-9kpm.d.ts → overview-J95gyke9.d.ts} +7 -7
- package/dist/{primitives-DR4XbZ2t.d.ts → primitives-8XXs7qDy.d.ts} +12 -12
- package/dist/{primitives-BVaiiY63.js → primitives-CRiUE1em.js} +6 -6
- package/dist/{primitives-DP-cTr1W.d.ts → primitives-KIlfflF9.d.ts} +12 -12
- package/dist/{properties-Ll927UYJ.d.ts → properties-0U_JmHNb.d.ts} +5 -5
- package/dist/{properties-BHvUHbcf.js → properties-4w8hy0hf.js} +3 -3
- package/dist/{properties-lx53LZPl.d.ts → properties-hAqMR9G-.d.ts} +5 -5
- package/dist/{python-D8NWX7Cb.js → python-CtQJaLw5.js} +4 -4
- package/dist/{routing-Fzn1XfX_.js → routing-D6595ovf.js} +10 -2
- package/dist/{routing-sjrF8U7O.d.ts → routing-DmNHIb6b.d.ts} +13 -3
- package/dist/routing-Wb-T6WOm.d.ts +64 -0
- package/dist/routing.d.ts +2 -2
- package/dist/routing.js +2 -2
- package/dist/{ruby-DOUaLhKJ.js → ruby-DJqEHgOw.js} +5 -5
- package/dist/{sdk-Dhu_gfzq.d.ts → sdk-CoiDgyHc.d.ts} +20 -16
- package/dist/{sdk-DrK2bq-v.js → sdk-DXS8pW0X.js} +48 -18
- package/dist/sdk-sidebar-BoRTRjDJ.d.ts +15 -0
- package/dist/sdk-sidebar-CF3tb0Yl.js +36 -0
- package/dist/sdk-sidebar-CYjEwB-m.d.ts +15 -0
- package/dist/{sdk-DdW_-RBy.d.ts → sdk-swLaCpqB.d.ts} +20 -16
- package/dist/{snippets-Bi0ZADmt.d.ts → snippets-BPK_oVIf.d.ts} +9 -9
- package/dist/{snippets-CocIZMn0.d.ts → snippets-CaCkByky.d.ts} +9 -9
- package/dist/{snippets-D4VhtZIC.js → snippets-bh8lfniq.js} +4 -4
- package/dist/spec.d.ts +2 -2
- package/dist/spec.js +5 -5
- package/dist/stl-sidebar-BQvhLYPO.d.ts +45 -0
- package/dist/stl-sidebar-BSx0HI2z.d.ts +45 -0
- package/dist/stl-sidebar-DdxZx2KK.js +82 -0
- package/dist/{style-TeAZuiHh.js → style-Bxr5gqcM.js} +4 -4
- package/dist/style.d.ts +4 -4
- package/dist/style.js +1 -1
- package/dist/styles/primitives.css +6 -0
- package/dist/styles/resets.css +1 -1
- package/dist/styles/sidebar.css +219 -49
- package/dist/styles.css +231 -50
- package/dist/{typescript-DDa446mB.js → typescript-DA7mcN1t.js} +5 -5
- package/dist/{use-components-Dbin0y07.js → use-components-BUz3GbO4.js} +1 -1
- package/dist/{utils-BoRmEFRn.js → utils-BpKHeVMe.js} +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +3 -3
- package/dist/components/sidebar.d.ts +0 -2
- package/dist/components/sidebar.js +0 -9
- package/dist/index-DTl8aUkb.d.ts +0 -15
- package/dist/index-Dp5biTf5.d.ts +0 -15
- package/dist/languages-DW_T-Th6.js +0 -28
- package/dist/sidebar-BLGIKgRI.js +0 -85
- package/dist/sidebar-CUaX1IBW.d.ts +0 -36
- package/dist/sidebar-DukWbBrE.d.ts +0 -36
- /package/dist/{chunk-Du3t87LU.js → chunk-BN_g-Awi.js} +0 -0
- /package/dist/{component-generics-CmIGbBLq.js → component-generics-POFirVVb.js} +0 -0
- /package/dist/{icons-DMkAA03z.js → icons-BYKn5X8E.js} +0 -0
- /package/dist/{method-C850sHPB.d.ts → method-DzUn_qWF.d.ts} +0 -0
- /package/dist/{navigation-By1sQl6M.js → navigation-aoYZ_tl4.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { u as Method } from "./index-DuHyTVVD.js";
|
|
2
|
+
import { w as TransformRequestSnippetFn } from "./sdk-CoiDgyHc.js";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime56 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/snippets.d.ts
|
|
7
7
|
type SnippetCodeProps = {
|
|
@@ -12,7 +12,7 @@ type SnippetCodeProps = {
|
|
|
12
12
|
declare function SnippetCode({
|
|
13
13
|
content,
|
|
14
14
|
language
|
|
15
|
-
}: SnippetCodeProps):
|
|
15
|
+
}: SnippetCodeProps): react_jsx_runtime56.JSX.Element;
|
|
16
16
|
type SnippetProps = {
|
|
17
17
|
method: Method;
|
|
18
18
|
requestTitle?: React$1.ReactNode;
|
|
@@ -25,29 +25,29 @@ type SnippetContainerProps = {
|
|
|
25
25
|
};
|
|
26
26
|
declare function SnippetContainer({
|
|
27
27
|
children
|
|
28
|
-
}: SnippetContainerProps):
|
|
28
|
+
}: SnippetContainerProps): react_jsx_runtime56.JSX.Element;
|
|
29
29
|
type SnippetRequestContainerProps = {
|
|
30
30
|
children?: React$1.ReactNode;
|
|
31
31
|
signature?: string;
|
|
32
32
|
};
|
|
33
33
|
declare function SnippetRequestContainer({
|
|
34
34
|
children
|
|
35
|
-
}: SnippetRequestContainerProps):
|
|
35
|
+
}: SnippetRequestContainerProps): react_jsx_runtime56.JSX.Element;
|
|
36
36
|
declare function Snippet({
|
|
37
37
|
requestTitle,
|
|
38
38
|
method,
|
|
39
39
|
transformRequestSnippet
|
|
40
|
-
}: SnippetProps):
|
|
40
|
+
}: SnippetProps): react_jsx_runtime56.JSX.Element | null;
|
|
41
41
|
declare function SnippetButtons({
|
|
42
42
|
content
|
|
43
43
|
}: {
|
|
44
44
|
content: string;
|
|
45
|
-
}):
|
|
45
|
+
}): react_jsx_runtime56.JSX.Element;
|
|
46
46
|
declare function SnippetFooter(): React$1.ReactNode;
|
|
47
47
|
declare function SnippetResponse({
|
|
48
48
|
responses
|
|
49
49
|
}: {
|
|
50
50
|
responses: Method['exampleResponses'];
|
|
51
|
-
}):
|
|
51
|
+
}): react_jsx_runtime56.JSX.Element | null;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { SnippetContainer as a, SnippetProps as c, SnippetResponse as d, SnippetCodeProps as i, SnippetRequestContainer as l, SnippetButtons as n, SnippetContainerProps as o, SnippetCode as r, SnippetFooter as s, Snippet as t, SnippetRequestContainerProps as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as useHighlight } from "./markdown-
|
|
3
|
-
import { t as useComponents } from "./use-components-
|
|
4
|
-
import { t as style_default } from "./style-
|
|
1
|
+
import { i as useDeclaration, l as useSnippet, o as useLanguage } from "./docs-6PYi1eEV.js";
|
|
2
|
+
import { r as useHighlight } from "./markdown-DHjcD13O.js";
|
|
3
|
+
import { t as useComponents } from "./use-components-BUz3GbO4.js";
|
|
4
|
+
import { t as style_default } from "./style-Bxr5gqcM.js";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import clsx from "clsx";
|
package/dist/spec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as DocsLanguage } from "./routing-
|
|
1
|
+
import { _ as SpecLanguage, d as Model, g as Spec, i as DeclarationNode, p as Resource, u as Method } from "./index-DuHyTVVD.js";
|
|
2
|
+
import { t as DocsLanguage } from "./routing-Wb-T6WOm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/spec.d.ts
|
|
5
5
|
type SecurityScheme = Spec['security_schemes'][number];
|
package/dist/spec.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as Languages } from "./routing-
|
|
2
|
-
import { r as isResourceEmpty } from "./utils-
|
|
1
|
+
import { n as Languages } from "./routing-D6595ovf.js";
|
|
2
|
+
import { r as isResourceEmpty } from "./utils-BpKHeVMe.js";
|
|
3
3
|
|
|
4
4
|
//#region src/spec.ts
|
|
5
5
|
const defaultTransforms = {
|
|
@@ -90,15 +90,15 @@ function generateSpecForResource(spec, name, lang, transforms) {
|
|
|
90
90
|
security_schemes: spec.security_schemes?.map((scheme) => transforms.securityScheme(scheme)),
|
|
91
91
|
decls: { [lang]: mapEntries({
|
|
92
92
|
input: spec.decls[lang] ?? {},
|
|
93
|
-
filter: (name
|
|
93
|
+
filter: (name) => name.startsWith(resource.stainlessPath) || name.startsWith("(resource) $shared"),
|
|
94
94
|
fn: (decl) => transforms.declaration(decl, lang)
|
|
95
95
|
}) },
|
|
96
96
|
snippets: mapEntries({
|
|
97
97
|
input: spec.snippets,
|
|
98
|
-
filter: (name
|
|
98
|
+
filter: (name) => name.startsWith(lang),
|
|
99
99
|
fn: (snippets) => mapEntries({
|
|
100
100
|
input: snippets,
|
|
101
|
-
filter: (name
|
|
101
|
+
filter: (name) => name.startsWith(resource.stainlessPath),
|
|
102
102
|
fn: (snippet) => transforms.snippet(snippet, lang)
|
|
103
103
|
}) ?? {}
|
|
104
104
|
})
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as react_jsx_runtime27 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/stl-sidebar.d.ts
|
|
4
|
+
declare module 'react' {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
/**
|
|
8
|
+
* Custom element defined by Starlight's <SidebarPersister>.
|
|
9
|
+
*/
|
|
10
|
+
'sl-sidebar-restore': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
interface StlSidebarLink {
|
|
15
|
+
type: 'link';
|
|
16
|
+
label: string;
|
|
17
|
+
isCurrent?: boolean;
|
|
18
|
+
attrs: Record<string, unknown>;
|
|
19
|
+
href?: string;
|
|
20
|
+
stainlessPath?: string;
|
|
21
|
+
}
|
|
22
|
+
interface StlSidebarGroup {
|
|
23
|
+
type: 'group';
|
|
24
|
+
label: string;
|
|
25
|
+
entries: Array<StlSidebarLink | StlSidebarGroup>;
|
|
26
|
+
collapsed: boolean;
|
|
27
|
+
isCurrent?: boolean;
|
|
28
|
+
href?: string;
|
|
29
|
+
stainlessPath?: string;
|
|
30
|
+
}
|
|
31
|
+
type StlSidebarEntry = StlSidebarLink | StlSidebarGroup;
|
|
32
|
+
type StlSidebarProps = {
|
|
33
|
+
entries: StlSidebarEntry[];
|
|
34
|
+
/**
|
|
35
|
+
* If set, add <sl-sidebar-restore> custom elements (as defined by Starlight's SidebarPersister)
|
|
36
|
+
* which are used to save/restore sidebar state.
|
|
37
|
+
*/
|
|
38
|
+
withStarlightRestoration?: boolean;
|
|
39
|
+
};
|
|
40
|
+
declare function StlSidebar({
|
|
41
|
+
entries,
|
|
42
|
+
withStarlightRestoration
|
|
43
|
+
}: StlSidebarProps): react_jsx_runtime27.JSX.Element;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarGroup as r, StlSidebar as t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as react_jsx_runtime62 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/stl-sidebar.d.ts
|
|
4
|
+
declare module 'react' {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
/**
|
|
8
|
+
* Custom element defined by Starlight's <SidebarPersister>.
|
|
9
|
+
*/
|
|
10
|
+
'sl-sidebar-restore': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
interface StlSidebarLink {
|
|
15
|
+
type: 'link';
|
|
16
|
+
label: string;
|
|
17
|
+
isCurrent?: boolean;
|
|
18
|
+
attrs: Record<string, unknown>;
|
|
19
|
+
href?: string;
|
|
20
|
+
stainlessPath?: string;
|
|
21
|
+
}
|
|
22
|
+
interface StlSidebarGroup {
|
|
23
|
+
type: 'group';
|
|
24
|
+
label: string;
|
|
25
|
+
entries: Array<StlSidebarLink | StlSidebarGroup>;
|
|
26
|
+
collapsed: boolean;
|
|
27
|
+
isCurrent?: boolean;
|
|
28
|
+
href?: string;
|
|
29
|
+
stainlessPath?: string;
|
|
30
|
+
}
|
|
31
|
+
type StlSidebarEntry = StlSidebarLink | StlSidebarGroup;
|
|
32
|
+
type StlSidebarProps = {
|
|
33
|
+
entries: StlSidebarEntry[];
|
|
34
|
+
/**
|
|
35
|
+
* If set, add <sl-sidebar-restore> custom elements (as defined by Starlight's SidebarPersister)
|
|
36
|
+
* which are used to save/restore sidebar state.
|
|
37
|
+
*/
|
|
38
|
+
withStarlightRestoration?: boolean;
|
|
39
|
+
};
|
|
40
|
+
declare function StlSidebar({
|
|
41
|
+
entries,
|
|
42
|
+
withStarlightRestoration
|
|
43
|
+
}: StlSidebarProps): react_jsx_runtime62.JSX.Element;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarGroup as r, StlSidebar as t };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { t as useComponents } from "./use-components-BUz3GbO4.js";
|
|
2
|
+
import { t as style_default } from "./style-Bxr5gqcM.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { ChevronRight } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/stl-sidebar.tsx
|
|
8
|
+
function StlSidebarSublist({ entries, entryToIndex }) {
|
|
9
|
+
const Docs = useComponents();
|
|
10
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
11
|
+
className: style_default.SidebarList,
|
|
12
|
+
children: entries.map((entry, index) => {
|
|
13
|
+
const restorePointIndex = entryToIndex?.get(entry);
|
|
14
|
+
const hasLink = !!(entry.href || entry.stainlessPath);
|
|
15
|
+
return /* @__PURE__ */ jsx("li", {
|
|
16
|
+
className: clsx(style_default.SidebarEntry, entry.type === "link" ? style_default.SidebarEntryLink : style_default.SidebarEntryGroup),
|
|
17
|
+
children: entry.type === "link" ? /* @__PURE__ */ jsx(Docs.Link, {
|
|
18
|
+
href: entry.href,
|
|
19
|
+
stainlessPath: entry.stainlessPath,
|
|
20
|
+
"aria-current": entry.isCurrent ? "page" : void 0,
|
|
21
|
+
...entry.attrs,
|
|
22
|
+
children: entry.label
|
|
23
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [hasLink && /* @__PURE__ */ jsx(Docs.Link, {
|
|
24
|
+
href: entry.href,
|
|
25
|
+
stainlessPath: entry.stainlessPath,
|
|
26
|
+
"aria-current": entry.isCurrent ? "page" : void 0,
|
|
27
|
+
children: entry.label
|
|
28
|
+
}), /* @__PURE__ */ jsxs("details", {
|
|
29
|
+
className: style_default.SidebarExpander,
|
|
30
|
+
open: flattenStlSidebar(entry.entries).some((i) => i.isCurrent) || !entry.collapsed,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("summary", {
|
|
33
|
+
className: style_default.ExpanderSummary,
|
|
34
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
35
|
+
"aria-hidden": hasLink ? "true" : void 0,
|
|
36
|
+
children: entry.label
|
|
37
|
+
}), entry.entries.length > 0 && /* @__PURE__ */ jsx(ChevronRight, {
|
|
38
|
+
size: 16,
|
|
39
|
+
strokeWidth: 1,
|
|
40
|
+
className: `${style_default.Icon} ${style_default.ExpanderSummaryIcon}`
|
|
41
|
+
})]
|
|
42
|
+
}),
|
|
43
|
+
restorePointIndex !== void 0 && /* @__PURE__ */ jsx("sl-sidebar-restore", { "data-index": restorePointIndex }),
|
|
44
|
+
entry.entries.length > 0 && /* @__PURE__ */ jsx(StlSidebarSublist, {
|
|
45
|
+
entries: entry.entries,
|
|
46
|
+
entryToIndex
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
})] })
|
|
50
|
+
}, index);
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function StlSidebar({ entries, withStarlightRestoration }) {
|
|
55
|
+
const entryToIndex = withStarlightRestoration ? computeEntryToIndex(entries) : void 0;
|
|
56
|
+
return /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: `${style_default.Root} ${style_default.Sidebar}`,
|
|
58
|
+
children: /* @__PURE__ */ jsx(StlSidebarSublist, {
|
|
59
|
+
entries,
|
|
60
|
+
entryToIndex
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function computeEntryToIndex(allEntries) {
|
|
65
|
+
const entryToIndex = /* @__PURE__ */ new Map();
|
|
66
|
+
let currentIndex = 0;
|
|
67
|
+
function addEntries(entries) {
|
|
68
|
+
for (const entry of entries) if (entry.type === "group") {
|
|
69
|
+
entryToIndex.set(entry, currentIndex);
|
|
70
|
+
currentIndex++;
|
|
71
|
+
addEntries(entry.entries);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
addEntries(allEntries);
|
|
75
|
+
return entryToIndex;
|
|
76
|
+
}
|
|
77
|
+
function flattenStlSidebar(sidebar) {
|
|
78
|
+
return sidebar.flatMap((entry) => entry.type === "group" ? flattenStlSidebar(entry.entries) : entry);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { StlSidebar as t };
|
|
@@ -129,13 +129,13 @@ var style_default = {
|
|
|
129
129
|
Model: "stldocs-model",
|
|
130
130
|
Root: "stldocs-root",
|
|
131
131
|
Sidebar: "stldocs-sidebar",
|
|
132
|
-
|
|
133
|
-
SidebarResourceTitle: "stldocs-sidebar-resource-title",
|
|
134
|
-
SidebarMethod: "stldocs-sidebar-method",
|
|
135
|
-
SidebarItemTitle: "stldocs-sidebar-resource-title",
|
|
132
|
+
SidebarList: "stldocs-sidebar-list",
|
|
136
133
|
SidebarExpander: "stldocs-sidebar-expander",
|
|
137
134
|
SidebarExpanderSummary: "stldocs-sidebar-expander-summary",
|
|
138
135
|
SidebarExpanderContent: "stldocs-sidebar-expander-content",
|
|
136
|
+
SidebarEntry: "stldocs-sidebar-entry",
|
|
137
|
+
SidebarEntryLink: "stldocs-sidebar-entry-link",
|
|
138
|
+
SidebarEntryGroup: "stldocs-sidebar-entry-group",
|
|
139
139
|
SearchForm: "stldocs-search-form",
|
|
140
140
|
SearchModal: "stldocs-search-modal",
|
|
141
141
|
SearchFilter: "stldocs-search-filter",
|
package/dist/style.d.ts
CHANGED
|
@@ -129,13 +129,13 @@ declare const _default: {
|
|
|
129
129
|
readonly Model: "stldocs-model";
|
|
130
130
|
readonly Root: "stldocs-root";
|
|
131
131
|
readonly Sidebar: "stldocs-sidebar";
|
|
132
|
-
readonly
|
|
133
|
-
readonly SidebarResourceTitle: "stldocs-sidebar-resource-title";
|
|
134
|
-
readonly SidebarMethod: "stldocs-sidebar-method";
|
|
135
|
-
readonly SidebarItemTitle: "stldocs-sidebar-resource-title";
|
|
132
|
+
readonly SidebarList: "stldocs-sidebar-list";
|
|
136
133
|
readonly SidebarExpander: "stldocs-sidebar-expander";
|
|
137
134
|
readonly SidebarExpanderSummary: "stldocs-sidebar-expander-summary";
|
|
138
135
|
readonly SidebarExpanderContent: "stldocs-sidebar-expander-content";
|
|
136
|
+
readonly SidebarEntry: "stldocs-sidebar-entry";
|
|
137
|
+
readonly SidebarEntryLink: "stldocs-sidebar-entry-link";
|
|
138
|
+
readonly SidebarEntryGroup: "stldocs-sidebar-entry-group";
|
|
139
139
|
readonly SearchForm: "stldocs-search-form";
|
|
140
140
|
readonly SearchModal: "stldocs-search-modal";
|
|
141
141
|
readonly SearchFilter: "stldocs-search-filter";
|
package/dist/style.js
CHANGED
package/dist/styles/resets.css
CHANGED
package/dist/styles/sidebar.css
CHANGED
|
@@ -1,80 +1,250 @@
|
|
|
1
1
|
.stldocs-sidebar {
|
|
2
2
|
font-family: var(--stl-typography-font);
|
|
3
3
|
font-size: var(--stl-typography-scale-sm);
|
|
4
|
+
/* Remove background color from stldocs-root reset. */
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
--stldocs-sidebar-item-padding-inline: 12px;
|
|
7
|
+
--stldocs-sidebar-item-padding-block: 6px;
|
|
8
|
+
--stldocs-sidebar-indent: 12px;
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
ul,
|
|
11
|
+
summary {
|
|
12
|
+
list-style-type: none;
|
|
8
13
|
}
|
|
9
14
|
|
|
10
|
-
.stldocs-
|
|
11
|
-
|
|
15
|
+
.stldocs-expander-summary,
|
|
16
|
+
.stldocs-sidebar-entry-group > a {
|
|
17
|
+
font-weight: 500;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
|
-
.stldocs-
|
|
15
|
-
.stldocs-sidebar-method {
|
|
16
|
-
padding: 6px;
|
|
20
|
+
.stldocs-expander-summary {
|
|
17
21
|
display: flex;
|
|
18
|
-
|
|
22
|
+
align-items: center;
|
|
23
|
+
user-select: none;
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
.stldocs-expander-summary-icon {
|
|
26
|
+
margin-left: 4px;
|
|
27
|
+
opacity: 0.65;
|
|
28
|
+
transition:
|
|
29
|
+
opacity 0.1s ease-out,
|
|
30
|
+
transform 0.1s ease-out;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
background-color: var(--stl-color-background-hover);
|
|
24
35
|
}
|
|
25
36
|
}
|
|
37
|
+
|
|
38
|
+
span[aria-hidden='true'] {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
26
41
|
}
|
|
27
42
|
|
|
28
|
-
.stldocs-sidebar-
|
|
29
|
-
|
|
43
|
+
.stldocs-sidebar-entry-group {
|
|
44
|
+
position: relative;
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
/* Anchor is positioned over the <details>. */
|
|
47
|
+
> a {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
padding-block: var(--stldocs-sidebar-item-padding-block);
|
|
53
|
+
padding-inline: var(--stldocs-sidebar-item-padding-inline);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.stldocs-sidebar-expander[open] > .stldocs-expander-summary .stldocs-expander-summary-icon {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
transform: rotate(90deg);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* List items. */
|
|
63
|
+
.stldocs-sidebar-entry,
|
|
64
|
+
.stldocs-expander-summary {
|
|
65
|
+
margin: 0;
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.stldocs-expander-summary,
|
|
70
|
+
.stldocs-sidebar-entry-link a {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
padding: var(--stldocs-sidebar-item-padding-block) var(--stldocs-sidebar-item-padding-inline);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.stldocs-sidebar-entry-link a:hover {
|
|
76
|
+
color: var(--stl-color-foreground);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.stldocs-sidebar-entry-link a {
|
|
80
|
+
color: var(--stl-color-foreground-reduced);
|
|
81
|
+
font-weight: 400;
|
|
82
|
+
display: flex;
|
|
83
|
+
text-decoration: none;
|
|
84
|
+
span {
|
|
85
|
+
font-weight: inherit;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
text-decoration: underline;
|
|
90
|
+
text-decoration-color: var(--stl-color-foreground-reduced);
|
|
91
|
+
}
|
|
92
|
+
&[aria-current='page'] {
|
|
33
93
|
font-weight: 500;
|
|
94
|
+
color: var(--stl-color-foreground);
|
|
34
95
|
}
|
|
35
96
|
}
|
|
36
97
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
98
|
+
/* When the sidebar entry has a link, disable pointer events on the <details> text
|
|
99
|
+
so that they pass through to the <a>. */
|
|
100
|
+
.stldocs-sidebar-entry-group:has(> a) .stldocs-expander-summary > span {
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
}
|
|
41
103
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
104
|
+
.stldocs-sidebar-entry-link:has(> a:is(:hover, [aria-current='page'])),
|
|
105
|
+
.stldocs-sidebar-entry-group:has(> a:is(:hover, [aria-current='page']))
|
|
106
|
+
> .stldocs-sidebar-expander
|
|
107
|
+
> .stldocs-expander-summary,
|
|
108
|
+
.stldocs-expander-summary:hover {
|
|
109
|
+
background-color: var(--stl-color-background-hover);
|
|
110
|
+
}
|
|
45
111
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
112
|
+
/* Nested list items have flat left edge. */
|
|
113
|
+
.stldocs-sidebar-list .stldocs-sidebar-list :is(.stldocs-expander-summary, .stldocs-sidebar-entry) {
|
|
114
|
+
border-start-start-radius: 0;
|
|
115
|
+
border-end-start-radius: 0;
|
|
116
|
+
}
|
|
50
117
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
118
|
+
.stldocs-sidebar-list {
|
|
119
|
+
padding: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.stldocs-sidebar-list .stldocs-sidebar-list .stldocs-sidebar-entry {
|
|
123
|
+
border-inline-start: 1px solid var(--stl-color-border-faint);
|
|
124
|
+
margin-inline-start: var(--stldocs-sidebar-indent);
|
|
125
|
+
&:has(> a[aria-current='page']) {
|
|
126
|
+
border-inline-start: 2px solid var(--stl-color-accent-border-strong);
|
|
127
|
+
& > a {
|
|
128
|
+
margin-left: -1px;
|
|
54
129
|
}
|
|
55
130
|
}
|
|
131
|
+
}
|
|
56
132
|
|
|
57
|
-
|
|
58
|
-
&[data-open='true'] {
|
|
59
|
-
& > .stldocs-expander-summary {
|
|
60
|
-
.stldocs-type-preview-content {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
|
133
|
+
/* Method & resource icons. */
|
|
63
134
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
135
|
+
a[data-stldocs-method],
|
|
136
|
+
a[data-stldocs-resource] {
|
|
137
|
+
--stldocs-sidebar-icon-size-outer: 18px;
|
|
138
|
+
--stldocs-sidebar-icon-margin: 8px;
|
|
139
|
+
}
|
|
140
|
+
a[data-stldocs-method] {
|
|
141
|
+
--stldocs-sidebar-icon-size-inner: 16px;
|
|
142
|
+
--stldocs-sidebar-icon-color-inverse-background: var(--stldocs-sidebar-icon-color);
|
|
68
143
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
144
|
+
&[data-stldocs-method='get'] {
|
|
145
|
+
--stldocs-sidebar-icon-color: var(--stl-color-green-foreground);
|
|
146
|
+
--stldocs-sidebar-icon-color-border: var(--stl-color-green-border);
|
|
147
|
+
--stldocs-sidebar-icon-color-background: var(--stl-color-green-muted-background);
|
|
148
|
+
--stldocs-sidebar-icon-color-background-hover: var(--stl-color-green-muted-background-hover);
|
|
149
|
+
--stldocs-sidebar-icon-color-inverse-background: var(--stl-color-green-inverse-background);
|
|
150
|
+
--stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-green-inverse-foreground);
|
|
151
|
+
}
|
|
152
|
+
&[data-stldocs-method='post'] {
|
|
153
|
+
--stldocs-sidebar-icon-color: var(--stl-color-blue-foreground);
|
|
154
|
+
--stldocs-sidebar-icon-color-border: var(--stl-color-blue-border);
|
|
155
|
+
--stldocs-sidebar-icon-color-background: var(--stl-color-blue-muted-background);
|
|
156
|
+
--stldocs-sidebar-icon-color-background-hover: var(--stl-color-blue-muted-background-hover);
|
|
157
|
+
--stldocs-sidebar-icon-color-inverse-background: var(--stl-color-blue-inverse-background);
|
|
158
|
+
--stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-blue-inverse-foreground);
|
|
159
|
+
}
|
|
160
|
+
&[data-stldocs-method='patch'],
|
|
161
|
+
&[data-stldocs-method='put'] {
|
|
162
|
+
--stldocs-sidebar-icon-color: var(--stl-color-orange-foreground);
|
|
163
|
+
--stldocs-sidebar-icon-color-border: var(--stl-color-orange-border);
|
|
164
|
+
--stldocs-sidebar-icon-color-background: var(--stl-color-orange-muted-background);
|
|
165
|
+
--stldocs-sidebar-icon-color-background-hover: var(--stl-color-orange-muted-background-hover);
|
|
166
|
+
--stldocs-sidebar-icon-color-inverse-background: var(--stl-color-orange-inverse-background);
|
|
167
|
+
--stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-orange-inverse-foreground);
|
|
168
|
+
}
|
|
169
|
+
&[data-stldocs-method='delete'] {
|
|
170
|
+
--stldocs-sidebar-icon-color: var(--stl-color-red-foreground);
|
|
171
|
+
--stldocs-sidebar-icon-color-border: var(--stl-color-red-border);
|
|
172
|
+
--stldocs-sidebar-icon-color-background: var(--stl-color-red-muted-background);
|
|
173
|
+
--stldocs-sidebar-icon-color-background-hover: var(--stl-color-red-muted-background-hover);
|
|
174
|
+
--stldocs-sidebar-icon-color-inverse-background: var(--stl-color-red-inverse-background);
|
|
175
|
+
--stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-red-inverse-foreground);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&[data-stldocs-method='get'] {
|
|
179
|
+
--stldocs-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 7 7 17"/><path d="M17 17H7V7"/></svg>');
|
|
180
|
+
}
|
|
181
|
+
&[data-stldocs-method='post'],
|
|
182
|
+
&[data-stldocs-method='put'],
|
|
183
|
+
&[data-stldocs-method='patch'] {
|
|
184
|
+
--stldocs-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>');
|
|
185
|
+
}
|
|
186
|
+
&[data-stldocs-method='delete'] {
|
|
187
|
+
--stldocs-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>');
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
a[data-stldocs-resource] {
|
|
192
|
+
/* not yet implemented in markup */
|
|
193
|
+
--stldocs-sidebar-icon-color: var(--stl-color-foreground-muted);
|
|
194
|
+
--stldocs-sidebar-icon-color-border: var(--stl-color-border);
|
|
195
|
+
--stldocs-sidebar-icon-color-background: var(--stl-color-faint-background);
|
|
196
|
+
--stldocs-sidebar-icon-color-background-hover: var(--stl-color-faint-background-hover);
|
|
197
|
+
--stldocs-sidebar-icon-color-inverse-background: var(--stl-color-inverse-background);
|
|
198
|
+
--stldocs-sidebar-icon-color-inverse-foreground: var(--stl-color-inverse-foreground);
|
|
199
|
+
|
|
200
|
+
--stldocs-sidebar-icon-size-inner: 14px;
|
|
201
|
+
--stldocs-sidebar-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/></svg>');
|
|
202
|
+
}
|
|
74
203
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
204
|
+
a[data-stldocs-method],
|
|
205
|
+
a[data-stldocs-resource] {
|
|
206
|
+
display: flex;
|
|
207
|
+
gap: var(--stldocs-sidebar-icon-margin);
|
|
208
|
+
align-items: center;
|
|
209
|
+
position: relative;
|
|
210
|
+
|
|
211
|
+
&::before,
|
|
212
|
+
&::after {
|
|
213
|
+
content: '';
|
|
214
|
+
width: var(--stldocs-sidebar-icon-size-outer);
|
|
215
|
+
height: var(--stldocs-sidebar-icon-size-outer);
|
|
216
|
+
display: block;
|
|
217
|
+
}
|
|
218
|
+
&::before {
|
|
219
|
+
border-radius: 4px;
|
|
220
|
+
background-color: var(--stldocs-sidebar-icon-color-background);
|
|
221
|
+
flex: 0 0 auto;
|
|
222
|
+
border: 1px solid var(--stldocs-sidebar-icon-color-border, transparent);
|
|
223
|
+
}
|
|
224
|
+
/* yuck (we can clean this up once we are changing sidebar markup) */
|
|
225
|
+
&::after {
|
|
226
|
+
background-color: var(--stldocs-sidebar-icon-color);
|
|
227
|
+
mask-image: var(--stldocs-sidebar-icon-url);
|
|
228
|
+
mask-size: var(--stldocs-sidebar-icon-size-inner) var(--stldocs-sidebar-icon-size-inner);
|
|
229
|
+
mask-repeat: no-repeat;
|
|
230
|
+
mask-position: center;
|
|
231
|
+
position: absolute;
|
|
232
|
+
left: var(--stldocs-sidebar-item-padding-inline);
|
|
233
|
+
top: 50%;
|
|
234
|
+
transform: translateY(-50%);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&:hover {
|
|
238
|
+
&::before {
|
|
239
|
+
background-color: var(--stldocs-sidebar-icon-color-background-hover);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
&[aria-current='page'] {
|
|
243
|
+
&::before {
|
|
244
|
+
background-color: var(--stldocs-sidebar-icon-color-inverse-background);
|
|
245
|
+
}
|
|
246
|
+
&::after {
|
|
247
|
+
background-color: var(--stldocs-sidebar-icon-color-inverse-foreground);
|
|
78
248
|
}
|
|
79
249
|
}
|
|
80
250
|
}
|