@stainless-api/docs 0.1.0-beta.98 → 1.0.0-beta.140
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/CHANGELOG.md +404 -0
- package/ambient.d.ts +6 -0
- package/eslint-suppressions.json +22 -6
- package/{eslint.config.js → eslint.config.ts} +1 -7
- package/package.json +57 -40
- package/plugin/assets/languages/php.svg +4 -0
- package/plugin/buildAlgoliaIndex.ts +6 -12
- package/plugin/components/SDKSelect.astro +0 -6
- package/plugin/components/SnippetCode.tsx +6 -37
- package/plugin/components/search/SearchAlgolia.astro +1 -1
- package/plugin/components/search/SearchIsland.tsx +19 -13
- package/plugin/generateAPIReferenceLink.ts +0 -40
- package/plugin/globalJs/ai-dropdown-options.ts +26 -13
- package/plugin/globalJs/code-snippets.ts +5 -5
- package/plugin/globalJs/copy.ts +20 -91
- package/plugin/globalJs/navigation.ts +13 -13
- package/plugin/globalJs/summary-selection-tweak.ts +29 -0
- package/plugin/index.ts +107 -163
- package/plugin/languages.ts +2 -1
- package/plugin/loadPluginConfig.ts +50 -153
- package/plugin/markdown/highlighter.ts +100 -0
- package/plugin/markdown/index.ts +39 -0
- package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +2 -0
- package/plugin/react/Routing.tsx +10 -244
- package/plugin/referencePlaceholderUtils.ts +1 -1
- package/plugin/replaceSidebarPlaceholderMiddleware.ts +1 -1
- package/plugin/routes/Docs.astro +3 -1
- package/plugin/routes/Overview.astro +14 -7
- package/plugin/routes/llms.ts +186 -0
- package/plugin/routes/markdown.ts +62 -13
- package/plugin/sidebar-utils/sidebar-builder.ts +38 -12
- package/plugin/specs/defaultSpecLoader.ts +192 -0
- package/plugin/specs/fetchSpecSSR.ts +1 -1
- package/plugin/specs/utils.ts +86 -0
- package/shared/conditionalIntegration.ts +28 -0
- package/shared/getProsePages.ts +6 -7
- package/shared/virtualModule.ts +1 -26
- package/stl-docs/aiChatExamples.ts +31 -0
- package/stl-docs/chat/docs-chat-handler.ts +17 -0
- package/stl-docs/chat/hook.ts +225 -0
- package/stl-docs/chat/schemas.ts +27 -0
- package/stl-docs/chat/ui/AiChat.module.css +591 -0
- package/stl-docs/chat/ui/AiChat.tsx +175 -0
- package/stl-docs/chat/ui/Trigger.tsx +154 -0
- package/stl-docs/chat/ui/components/ChatControls.tsx +51 -0
- package/stl-docs/chat/ui/components/ChatEmpty.tsx +42 -0
- package/stl-docs/chat/ui/components/ChatLog.tsx +93 -0
- package/stl-docs/chat/ui/components/ChatMessage.tsx +47 -0
- package/stl-docs/chat/ui/components/CodeBlock.tsx +33 -0
- package/stl-docs/chat/ui/components/MessageFeedback.tsx +106 -0
- package/stl-docs/chat/ui/components/Table.tsx +15 -0
- package/stl-docs/chat/ui/components/ToolCall.tsx +34 -0
- package/stl-docs/chat/ui/components/hljs-github.css +81 -0
- package/stl-docs/chat/ui/scroll-manager.ts +86 -0
- package/stl-docs/chat/ui/types.ts +45 -0
- package/stl-docs/components/AiChatIsland.tsx +10 -12
- package/stl-docs/components/ContentPanel.astro +9 -0
- package/stl-docs/components/Footer.astro +89 -0
- package/stl-docs/components/Header.astro +0 -5
- package/stl-docs/components/PageFrame.astro +23 -8
- package/stl-docs/components/PageSidebar.astro +11 -0
- package/stl-docs/components/StainlessLogo.svg +4 -0
- package/stl-docs/components/TwoColumnContent.astro +2 -0
- package/stl-docs/components/headers/DefaultHeader.astro +6 -8
- package/stl-docs/components/headers/StackedHeader.astro +5 -53
- package/stl-docs/components/mintlify-compat/Accordion.astro +2 -2
- package/stl-docs/components/mintlify-compat/AccordionGroup.astro +0 -4
- package/stl-docs/components/mintlify-compat/Columns.astro +2 -2
- package/stl-docs/components/mintlify-compat/Frame.astro +2 -2
- package/stl-docs/components/mintlify-compat/Tab.astro +2 -2
- package/stl-docs/components/mintlify-compat/callouts/Callout.astro +2 -2
- package/stl-docs/components/mintlify-compat/callouts/Check.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Danger.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Info.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Note.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Tip.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Warning.astro +0 -4
- package/stl-docs/components/nav-tabs/NavDropdown.astro +12 -7
- package/stl-docs/components/nav-tabs/NavTabs.astro +5 -3
- package/stl-docs/components/nav-tabs/buildNavLinks.ts +2 -0
- package/stl-docs/components/pagination/Pagination.astro +4 -2
- package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +2 -2
- package/stl-docs/components/pagination/PaginationLinkQuiet.astro +2 -2
- package/stl-docs/components/pagination/util.ts +3 -3
- package/stl-docs/components/sidebars/BaseSidebar.astro +72 -1
- package/stl-docs/disableCalloutSyntax.ts +1 -1
- package/stl-docs/fonts.ts +5 -5
- package/stl-docs/index.ts +76 -53
- package/stl-docs/loadStlDocsConfig.ts +38 -8
- package/stl-docs/og-image/components/OpenGraphFunctionSignature.tsx +64 -0
- package/stl-docs/og-image/components/OpenGraphImage.tsx +126 -0
- package/stl-docs/og-image/config.ts +56 -0
- package/stl-docs/og-image/image-gen/generate-api-reference-og-image.tsx +188 -0
- package/stl-docs/og-image/image-gen/generate-og-image.tsx +119 -0
- package/stl-docs/og-image/image-gen/get-logo-url.ts +47 -0
- package/stl-docs/og-image/index.ts +135 -0
- package/stl-docs/og-image/routes/add-og-image.ts +45 -0
- package/stl-docs/og-image/routes/get-api-reference-og-image.ts +36 -0
- package/stl-docs/og-image/routes/get-og-image.ts +28 -0
- package/stl-docs/og-image/theme.ts +43 -0
- package/stl-docs/og-image/utils.ts +14 -0
- package/stl-docs/proseDocSync.test.ts +74 -0
- package/stl-docs/proseDocSync.ts +344 -0
- package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +4 -12
- package/stl-docs/schema-extension.ts +12 -0
- package/stl-docs/tabsMiddleware.ts +1 -1
- package/styles/overrides.css +2 -14
- package/styles/page.css +210 -71
- package/styles/sidebar.css +30 -17
- package/styles/sl-variables.css +3 -8
- package/styles/stldocs-variables.css +2 -2
- package/styles/toc.css +8 -0
- package/tsconfig.json +1 -1
- package/virtual-module.d.ts +35 -11
- package/playground-virtual-modules.d.ts +0 -96
- package/plugin/globalJs/create-playground.shim.ts +0 -3
- package/plugin/globalJs/playground-data.shim.ts +0 -1
- package/plugin/globalJs/playground-data.ts +0 -14
- package/plugin/specs/FileCache.ts +0 -99
- package/plugin/specs/generateSpec.ts +0 -112
- package/plugin/specs/index.ts +0 -132
- package/plugin/specs/inputResolver.ts +0 -146
- package/plugin/specs/worker.ts +0 -199
- package/plugin/vendor/preview.worker.docs.js +0 -26108
- package/plugin/vendor/templates/cli.md +0 -1
- package/plugin/vendor/templates/go.md +0 -316
- package/plugin/vendor/templates/java.md +0 -89
- package/plugin/vendor/templates/kotlin.md +0 -89
- package/plugin/vendor/templates/node.md +0 -235
- package/plugin/vendor/templates/python.md +0 -251
- package/plugin/vendor/templates/ruby.md +0 -147
- package/plugin/vendor/templates/terraform.md +0 -60
- package/plugin/vendor/templates/typescript.md +0 -319
- package/scripts/vendor_deps.ts +0 -50
- package/stl-docs/components/ClientRouterHead.astro +0 -41
- package/stl-docs/components/content-panel/ContentPanel.astro +0 -42
- package/stl-docs/components/headers/SplashMobileMenuToggle.astro +0 -65
- package/stl-docs/proseSearchIndexing.ts +0 -606
package/styles/page.css
CHANGED
|
@@ -1,69 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.page > header .stl-secondary-nav-tabs {
|
|
4
|
-
max-width: var(--sl-page-max-width);
|
|
5
|
-
margin: 0 auto;
|
|
1
|
+
:root {
|
|
2
|
+
--stl-page-max-width: 90rem;
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/* 0.75rem at 25rem width (phone); 1.5rem at 72rem width (desktop) */
|
|
5
|
+
--_stl-page-min-padding-mobile-rem: 0.75;
|
|
6
|
+
--_stl-page-min-padding-desktop-rem: 1.5;
|
|
7
|
+
--_stl-page-min-padding-slope: (
|
|
8
|
+
(var(--_stl-page-min-padding-desktop-rem) - var(--_stl-page-min-padding-mobile-rem)) / (72 - 25)
|
|
9
|
+
);
|
|
10
|
+
--stl-page-min-padding: clamp(
|
|
11
|
+
var(--_stl-page-min-padding-mobile-rem) * 1rem,
|
|
12
|
+
var(--_stl-page-min-padding-slope) * (100vw - 25rem) + var(--_stl-page-min-padding-mobile-rem) * 1rem,
|
|
13
|
+
var(--_stl-page-min-padding-desktop-rem) * 1rem
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
--stl-content-max-width: 52rem;
|
|
17
|
+
--stl-content-padding: 2rem;
|
|
18
|
+
--stl-two-column-content-max-width: 80rem;
|
|
19
|
+
|
|
20
|
+
--stl-sidebar-width: 16.5rem;
|
|
21
|
+
--stl-nav-height: 3.5rem; /* has to be statically sized in order to correctly position the viewport-end grid area :( */
|
|
22
|
+
--stl-nav-gap: 0.5rem;
|
|
23
|
+
|
|
24
|
+
--stl-page-width: min(var(--stl-page-max-width), 100vw);
|
|
25
|
+
--vw: calc(var(--stl-page-width) / 100);
|
|
26
|
+
|
|
27
|
+
scroll-padding-top: calc(var(--stl-nav-height) + 1rem);
|
|
28
|
+
}
|
|
29
|
+
@media (min-width: 50rem) {
|
|
30
|
+
:root:has(.stl-secondary-nav-tabs) {
|
|
31
|
+
--stl-nav-height: 5.5rem;
|
|
32
|
+
header {
|
|
33
|
+
padding-top: 0.25rem;
|
|
34
|
+
}
|
|
9
35
|
}
|
|
10
36
|
}
|
|
11
37
|
|
|
38
|
+
/* Grid layout */
|
|
39
|
+
|
|
12
40
|
.page {
|
|
13
|
-
|
|
14
|
-
max-width: var(--sl-page-max-width);
|
|
41
|
+
display: grid;
|
|
15
42
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
43
|
+
/* TODO: verify that env-safe-area-inset is behaving as we expect */
|
|
44
|
+
--stl-viewport-width: calc(
|
|
45
|
+
100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) -
|
|
46
|
+
var(--stl-chat-panel-width, 0px)
|
|
47
|
+
);
|
|
48
|
+
--stl-page-gutter-left: calc(
|
|
49
|
+
env(safe-area-inset-left, 0px) +
|
|
50
|
+
max(var(--stl-page-min-padding), (var(--stl-viewport-width) - var(--stl-page-max-width)) / 2)
|
|
51
|
+
);
|
|
52
|
+
--stl-page-gutter-right: calc(
|
|
53
|
+
env(safe-area-inset-right, 0px) +
|
|
54
|
+
max(var(--stl-page-min-padding), (var(--stl-viewport-width) - var(--stl-page-max-width)) / 2)
|
|
55
|
+
);
|
|
19
56
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
57
|
+
/* prettier-ignore */
|
|
58
|
+
grid:
|
|
59
|
+
/* header + content have two identical columns because in mobile layout the menu trigger takes up the latter */
|
|
60
|
+
' gutter-left header header header header gutter-right chat' var(--stl-nav-height) /* nav */
|
|
61
|
+
' gutter-left sidebar content content toc gutter-right chat' calc(100dvh - var(--stl-nav-height)) /* viewport (above the fold) */
|
|
62
|
+
[viewport-end]
|
|
63
|
+
' gutter-left . content content . gutter-right . ' auto /* rest of page height */
|
|
64
|
+
/ var(--stl-page-gutter-left) var(--stl-sidebar-width) minmax(0, 1fr) auto auto var(--stl-page-gutter-right) auto;
|
|
25
65
|
}
|
|
26
66
|
|
|
27
|
-
|
|
28
|
-
|
|
67
|
+
.page > main,
|
|
68
|
+
.page > .sidebar > .sidebar-pane,
|
|
69
|
+
.page > .right-sidebar-panel nav {
|
|
70
|
+
padding-block-start: 1rem;
|
|
29
71
|
}
|
|
30
72
|
|
|
31
|
-
|
|
32
|
-
.page .sidebar-pane {
|
|
33
|
-
left: unset;
|
|
34
|
-
}
|
|
35
|
-
/* on desktop, adjust sidebar so that its _text content_ aligns with the page left edge.
|
|
36
|
-
* padding (visible on hover) bleeds out beyond the page left edge, covered by --stl-ui-page-padding-inline */
|
|
37
|
-
.sidebar-pane {
|
|
38
|
-
/* 12px comes from --stl-sidebar-item-padding-inline (which is unfortunately defined deeper than
|
|
39
|
-
this component). Please keep in sync. */
|
|
40
|
-
margin-inline-start: calc(-1 * (var(--sl-sidebar-pad-x) + 12px));
|
|
41
|
-
}
|
|
73
|
+
/* Sticky header and tabs */
|
|
42
74
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
75
|
+
.page > header {
|
|
76
|
+
grid-area: header;
|
|
77
|
+
margin-left: calc(-1 * var(--stl-page-gutter-left));
|
|
78
|
+
margin-right: calc(-1 * var(--stl-page-gutter-right));
|
|
79
|
+
padding-left: var(--stl-page-gutter-left);
|
|
80
|
+
padding-right: var(--stl-page-gutter-right);
|
|
81
|
+
}
|
|
48
82
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
83
|
+
header {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
border-bottom: 1px solid var(--stl-color-border-faint);
|
|
87
|
+
position: sticky;
|
|
88
|
+
top: 0;
|
|
89
|
+
z-index: 10;
|
|
90
|
+
background: var(--stl-color-background);
|
|
52
91
|
}
|
|
53
92
|
|
|
54
|
-
.
|
|
55
|
-
.
|
|
56
|
-
|
|
93
|
+
@layer starlight.core {
|
|
94
|
+
header > .header {
|
|
95
|
+
all: revert-layer;
|
|
57
96
|
}
|
|
58
97
|
}
|
|
59
98
|
|
|
60
|
-
.
|
|
99
|
+
header > .header {
|
|
100
|
+
flex: 1;
|
|
61
101
|
display: flex;
|
|
102
|
+
gap: var(--stl-nav-gap);
|
|
62
103
|
align-items: center;
|
|
63
104
|
justify-content: space-between;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.header site-search > button {
|
|
108
|
+
@media (min-width: 50rem) {
|
|
109
|
+
margin-inline: 2rem;
|
|
110
|
+
flex: 1 1 12rem;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.header .right-group {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: stretch;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Sticky sidebar and toc. Outer wrapper “sticks” to top of page, subgrid pushes child down below header */
|
|
120
|
+
.page > .sidebar {
|
|
121
|
+
grid-area: sidebar;
|
|
122
|
+
/* sidebar should bleed to left edge of page in case people want to color it */
|
|
123
|
+
margin-left: calc(-1 * var(--stl-page-gutter-left));
|
|
124
|
+
padding-left: var(--stl-page-gutter-left);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.page > .right-sidebar-panel {
|
|
128
|
+
grid-area: toc;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.page > .sidebar,
|
|
132
|
+
.page > .right-sidebar-panel {
|
|
133
|
+
align-self: start;
|
|
134
|
+
grid-row-start: header-start;
|
|
135
|
+
display: grid;
|
|
136
|
+
grid-template-rows: subgrid;
|
|
137
|
+
grid-template-columns: subgrid;
|
|
138
|
+
position: sticky;
|
|
139
|
+
top: 0;
|
|
140
|
+
}
|
|
141
|
+
.page > .sidebar > .sidebar-pane,
|
|
142
|
+
.page > .right-sidebar-panel > starlight-toc {
|
|
143
|
+
grid-area: inherit;
|
|
144
|
+
grid-row-start: header-end;
|
|
145
|
+
overflow-y: auto;
|
|
146
|
+
overflow-x: clip;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Page content */
|
|
150
|
+
|
|
151
|
+
.page > main {
|
|
152
|
+
grid-area: content;
|
|
153
|
+
width: 100%;
|
|
154
|
+
max-width: min(var(--stl-content-max-width), 100%);
|
|
155
|
+
justify-self: center;
|
|
156
|
+
padding-inline: var(--stl-content-padding);
|
|
67
157
|
}
|
|
68
158
|
|
|
69
159
|
.stl-page-nav-container {
|
|
@@ -71,47 +161,96 @@
|
|
|
71
161
|
align-items: center;
|
|
72
162
|
justify-content: space-between;
|
|
73
163
|
gap: 1rem;
|
|
74
|
-
padding: 1rem 0 0 0;
|
|
75
164
|
flex-wrap: wrap;
|
|
76
165
|
}
|
|
77
166
|
|
|
78
|
-
.
|
|
79
|
-
|
|
167
|
+
.mobile-preferences {
|
|
168
|
+
margin-top: 1rem;
|
|
169
|
+
display: flex;
|
|
170
|
+
justify-content: flex-end;
|
|
80
171
|
}
|
|
81
172
|
|
|
82
|
-
|
|
83
|
-
|
|
173
|
+
/* Two-column layouts go wider */
|
|
174
|
+
.page > main:where(:has(.stldocs-method-double-pane)) {
|
|
175
|
+
max-width: min(var(--stl-two-column-content-max-width), 100%);
|
|
176
|
+
padding-inline-start: clamp(
|
|
177
|
+
var(--stl-content-padding),
|
|
178
|
+
var(--stl-page-gutter-right) - env(safe-area-inset-right, 0px),
|
|
179
|
+
var(--stl-content-padding) * 2
|
|
180
|
+
);
|
|
181
|
+
padding-inline-end: 0;
|
|
84
182
|
}
|
|
85
183
|
|
|
86
|
-
|
|
87
|
-
max-width: var(--sl-content-width);
|
|
88
|
-
}
|
|
184
|
+
/* Responsive page layout */
|
|
89
185
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
186
|
+
/* On smaller screens, the main panel takes up the full width and the TOC is hidden */
|
|
187
|
+
@media not (min-width: 72rem) {
|
|
188
|
+
.page > main {
|
|
189
|
+
/* right edge of content goes up to right gutter to align with header */
|
|
190
|
+
padding-inline-end: 0;
|
|
191
|
+
max-width: 100%;
|
|
93
192
|
}
|
|
94
193
|
|
|
95
|
-
.
|
|
96
|
-
|
|
194
|
+
.page > .right-sidebar-panel {
|
|
195
|
+
display: none;
|
|
97
196
|
}
|
|
98
197
|
}
|
|
99
198
|
|
|
100
|
-
|
|
199
|
+
/* On mobile screens, the sidebar and nav links collapse */
|
|
200
|
+
@media not (min-width: 50rem) {
|
|
201
|
+
header {
|
|
202
|
+
padding-top: 0;
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-template-columns: subgrid;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
header > .header {
|
|
208
|
+
grid-column: span 2;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Sidebar moves to cover content area, hidden by default */
|
|
101
212
|
:root {
|
|
102
|
-
--
|
|
213
|
+
--stl-sidebar-width: 0px;
|
|
214
|
+
}
|
|
215
|
+
.page > .sidebar,
|
|
216
|
+
.page > .sidebar.hidden {
|
|
217
|
+
display: contents;
|
|
218
|
+
}
|
|
219
|
+
.page > .sidebar > .sidebar-pane {
|
|
220
|
+
visibility: hidden;
|
|
221
|
+
grid-area: content;
|
|
222
|
+
grid-row-end: viewport-end;
|
|
223
|
+
z-index: 9;
|
|
224
|
+
/* extend to right edge of page */
|
|
225
|
+
margin-inline-end: calc(-1 * var(--stl-page-gutter-right));
|
|
226
|
+
padding-inline-end: var(--stl-page-gutter-right);
|
|
227
|
+
border-inline-end: 0;
|
|
228
|
+
}
|
|
229
|
+
.page > .sidebar > starlight-menu-button[aria-expanded='true'] ~ .sidebar-pane {
|
|
230
|
+
visibility: visible;
|
|
103
231
|
}
|
|
104
|
-
}
|
|
105
232
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
233
|
+
/* left padding becomes the left gutter when there’s no sidebar */
|
|
234
|
+
.page > main {
|
|
235
|
+
padding-inline-start: 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Sidebar menu button moves to end of header; takes up space in layout (not absolutely positioned as in starlight) */
|
|
239
|
+
.sidebar starlight-menu-button {
|
|
240
|
+
grid-column: span 1 / content-end;
|
|
241
|
+
grid-row: header;
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
position: sticky;
|
|
245
|
+
top: 0;
|
|
246
|
+
padding-left: var(--stl-nav-gap);
|
|
247
|
+
z-index: 11;
|
|
248
|
+
}
|
|
249
|
+
.sidebar starlight-menu-button button {
|
|
250
|
+
position: static;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.header .right-group {
|
|
254
|
+
display: none;
|
|
116
255
|
}
|
|
117
256
|
}
|
package/styles/sidebar.css
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.sidebar .sidebar-pane .sidebar-content {
|
|
4
|
-
* {
|
|
5
|
-
all: revert-layer;
|
|
6
|
-
&::before,
|
|
7
|
-
&::after {
|
|
8
|
-
all: revert-layer;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.sidebar-pane {
|
|
1
|
+
.page > .sidebar > .sidebar-pane {
|
|
2
|
+
padding-inline-end: 1rem;
|
|
15
3
|
border-inline-end: 1px solid var(--stl-color-border-faint);
|
|
4
|
+
padding-block-end: calc(2rem + env(safe-area-inset-bottom));
|
|
5
|
+
|
|
6
|
+
/* make sure the sidebar doesn’t get clipped on the left by overflow */
|
|
7
|
+
margin-inline-start: calc(-1 * var(--stl-page-gutter-left));
|
|
8
|
+
padding-inline-start: var(--stl-page-gutter-left);
|
|
9
|
+
|
|
10
|
+
background-color: var(--stl-color-background);
|
|
11
|
+
/* work around chrome bug where the background-color isn’t getting painted in the overscroll? */
|
|
12
|
+
background-image: linear-gradient(to bottom, var(--stl-color-background), var(--stl-color-background));
|
|
13
|
+
background-attachment: fixed;
|
|
14
|
+
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 1rem;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
@media (min-width: 50rem) {
|
|
21
|
+
.page > .sidebar :is(.stl-sdk-select, .stldocs-sidebar) {
|
|
22
|
+
/* align left edge of text with container */
|
|
23
|
+
margin-inline-start: calc(-1 * var(--stldocs-sidebar-item-padding-inline));
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
.stl-sidebar-header-links {
|
|
@@ -36,3 +40,12 @@
|
|
|
36
40
|
display: none;
|
|
37
41
|
}
|
|
38
42
|
}
|
|
43
|
+
|
|
44
|
+
/* No sidebar on splash pages */
|
|
45
|
+
.page > .sidebar.hidden {
|
|
46
|
+
/* Note: on mobile, this will be overridden to display: contents; in order to show the mobile menu */
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
:root:has(.page > .sidebar.hidden) {
|
|
50
|
+
--stl-sidebar-width: 0px;
|
|
51
|
+
}
|
package/styles/sl-variables.css
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--sl-color-bg-table-row: #ffffff0a;
|
|
3
3
|
--sl-button-border-radius: 8px;
|
|
4
|
-
--sl-content-width: 52rem;
|
|
5
|
-
--sl-nav-pad-y: 0.5rem;
|
|
6
|
-
--sl-nav-height: 56px;
|
|
7
|
-
--sl-sidebar-width: 19rem;
|
|
8
4
|
--sl-button-size: 32px;
|
|
9
5
|
--sl-button-padding-x: 0.75rem;
|
|
10
6
|
--sl-button-padding-y: 0.5rem;
|
|
11
7
|
--sl-button-icon-offset: 0.2rem;
|
|
12
|
-
|
|
8
|
+
|
|
9
|
+
/* TODO: remove --sl-nav-height dependencies */
|
|
10
|
+
--sl-nav-height: 56px;
|
|
13
11
|
|
|
14
12
|
--sl-nav-gap: 0.5rem;
|
|
15
13
|
--sl-icon-color: var(--stl-color-foreground);
|
|
16
|
-
--sl-page-max-width: unset;
|
|
17
|
-
|
|
18
|
-
--sl-content-pad-x: 1rem;
|
|
19
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@import '@stainless-api/docs-ui/styles/variables.css';
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
--stldocs-content-width: var(--
|
|
5
|
-
--stldocs-content-padding:
|
|
4
|
+
--stldocs-content-width: var(--stl-content-max-width);
|
|
5
|
+
--stldocs-content-padding-inline: 0;
|
|
6
6
|
}
|
package/styles/toc.css
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
.right-sidebar-panel {
|
|
2
2
|
font-size: var(--stl-typography-scale-sm);
|
|
3
|
+
overflow-wrap: break-word;
|
|
4
|
+
|
|
5
|
+
nav {
|
|
6
|
+
width: calc(16 * var(--vw));
|
|
7
|
+
min-width: 14ch;
|
|
8
|
+
}
|
|
3
9
|
|
|
4
10
|
nav > ul {
|
|
5
11
|
padding-top: 0;
|
|
@@ -17,6 +23,7 @@
|
|
|
17
23
|
color: var(--stl-color-foreground-reduced);
|
|
18
24
|
position: relative;
|
|
19
25
|
font-size: inherit;
|
|
26
|
+
text-decoration: none;
|
|
20
27
|
|
|
21
28
|
&:hover {
|
|
22
29
|
text-decoration: underline;
|
|
@@ -45,5 +52,6 @@
|
|
|
45
52
|
line-height: 150%;
|
|
46
53
|
text-decoration: none;
|
|
47
54
|
font-weight: 400;
|
|
55
|
+
margin-bottom: 0.5em;
|
|
48
56
|
}
|
|
49
57
|
}
|
package/tsconfig.json
CHANGED
package/virtual-module.d.ts
CHANGED
|
@@ -15,12 +15,14 @@ declare module 'virtual:stl-starlight-virtual-module' {
|
|
|
15
15
|
export const CONTENT_PANEL_LAYOUT: 'double-pane' | 'single-pane';
|
|
16
16
|
export const EXPERIMENTAL_COLLAPSIBLE_SNIPPETS: boolean | undefined;
|
|
17
17
|
export const EXPERIMENTAL_COLLAPSIBLE_METHOD_DESCRIPTIONS: boolean | undefined;
|
|
18
|
-
export const EXPERIMENTAL_PLAYGROUNDS: boolean | undefined;
|
|
19
18
|
export const EXPERIMENTAL_REQUEST_BUILDER: boolean | undefined;
|
|
20
19
|
export const PROPERTY_SETTINGS: PropertySettingsType;
|
|
21
20
|
export const MIDDLEWARE: StlStarlightMiddleware;
|
|
22
21
|
export const ENABLE_CONTEXT_MENU: boolean;
|
|
22
|
+
export const CONTEXT_MENU_ENABLE_THIRD_PARTY: boolean;
|
|
23
23
|
export const STAINLESS_PROJECT: string | undefined;
|
|
24
|
+
export const LLMS_TXT_DESCRIPTION: string | null;
|
|
25
|
+
export const LLMS_TXT_DETAIL_THRESHOLD: number;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
declare module 'virtual:stl-docs-virtual-module' {
|
|
@@ -52,25 +54,27 @@ declare module 'virtual:stl-docs-virtual-module' {
|
|
|
52
54
|
export const API_REFERENCE_BASE_PATH: string;
|
|
53
55
|
export const ENABLE_PROSE_MARKDOWN_RENDERING: boolean;
|
|
54
56
|
export const ENABLE_CONTEXT_MENU: boolean;
|
|
57
|
+
export const CONTEXT_MENU_ENABLE_THIRD_PARTY: boolean;
|
|
55
58
|
export const RENDER_PAGE_DESCRIPTIONS: boolean;
|
|
59
|
+
export const LINK_GROUP_TITLES_TO_OVERVIEW_PAGES: boolean;
|
|
56
60
|
export const FONTS: {
|
|
57
61
|
primary?: FontConfig;
|
|
58
62
|
heading?: FontConfig;
|
|
59
63
|
mono?: FontConfig;
|
|
60
64
|
additional?: FontConfig[];
|
|
61
65
|
};
|
|
66
|
+
export const RENDER_CREDITS: boolean;
|
|
67
|
+
export const SITE_TITLE: string;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
declare module 'virtual:stl-docs
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export default AiChatComponent;
|
|
73
|
-
export const STAINLESS_PROJECT: string | undefined;
|
|
70
|
+
declare module 'virtual:stl-docs-ai-chat' {
|
|
71
|
+
export const AI_CHAT_HANDLER: import('./stl-docs/chat/docs-chat-handler').DocsChatHandler | undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare module 'virtual:stl-docs-ai-chat-examples' {
|
|
75
|
+
import type { ExamplePrompt } from './stl-docs/chat/ui/types';
|
|
76
|
+
|
|
77
|
+
export const examples: ExamplePrompt[] | undefined;
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
declare module 'virtual:stainless-apis-manifest' {
|
|
@@ -98,3 +102,23 @@ declare module 'virtual:stl-starlight-reference-sidebars' {
|
|
|
98
102
|
|
|
99
103
|
export const sidebars: GeneratedSidebarDef[];
|
|
100
104
|
}
|
|
105
|
+
|
|
106
|
+
declare module 'virtual:stainless-docs/docs-og-image' {
|
|
107
|
+
import type { StarlightUserConfig } from '@astrojs/starlight/types';
|
|
108
|
+
|
|
109
|
+
export const LOGO: StarlightUserConfig['logo'];
|
|
110
|
+
export const OG_IMAGE_OPTIONS: import('./stl-docs/og-image/config').OGImageConfig | undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare module 'virtual:stainless-docs/docs-og-image/components/OpenGraphImage' {
|
|
114
|
+
const OpenGraphImage: typeof import('./stl-docs/og-image/components/OpenGraphImage').default;
|
|
115
|
+
export default OpenGraphImage;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare module 'virtual:stainless-docs/docs-og-image/components/OpenGraphFunctionSignature' {
|
|
119
|
+
const OpenGraphFunctionSignature: typeof import('./stl-docs/og-image/components/OpenGraphFunctionSignature').default;
|
|
120
|
+
export default OpenGraphFunctionSignature;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare const __STLDOCS_HAS_API_REFERENCE__: boolean;
|
|
124
|
+
declare const __STLDOCS_ENABLE_AI_CHAT__: boolean;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
declare module 'virtual:stl-playground/typescript.json' {
|
|
2
|
-
const data: {
|
|
3
|
-
links: [string, string][];
|
|
4
|
-
files: [string, string][];
|
|
5
|
-
} | null;
|
|
6
|
-
export { data as default };
|
|
7
|
-
}
|
|
8
|
-
declare module 'virtual:stl-playground/python.json' {
|
|
9
|
-
const data: { files: Record<string, string>; wheel: string } | null;
|
|
10
|
-
export { data as default };
|
|
11
|
-
}
|
|
12
|
-
declare module 'virtual:stl-playground/auth.json' {
|
|
13
|
-
const data:
|
|
14
|
-
| ({
|
|
15
|
-
type: 'http_bearer' | 'query' | 'header' | 'oauth2' | 'http_basic' | 'http_digest';
|
|
16
|
-
description?: string;
|
|
17
|
-
name: string;
|
|
18
|
-
title: string;
|
|
19
|
-
header: string | undefined;
|
|
20
|
-
example: string | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
opts: {
|
|
23
|
-
name: string;
|
|
24
|
-
type: 'string' | 'number' | 'boolean' | 'null' | 'integer';
|
|
25
|
-
nullable: boolean;
|
|
26
|
-
description?: string | undefined;
|
|
27
|
-
example?: unknown;
|
|
28
|
-
default?: unknown;
|
|
29
|
-
read_env?: string | undefined;
|
|
30
|
-
auth?:
|
|
31
|
-
| {
|
|
32
|
-
security_scheme: string;
|
|
33
|
-
role?: 'value' | 'password' | 'username' | 'client_id' | 'client_secret' | undefined;
|
|
34
|
-
}
|
|
35
|
-
| undefined;
|
|
36
|
-
}[];
|
|
37
|
-
})[]
|
|
38
|
-
| null;
|
|
39
|
-
export { data as default };
|
|
40
|
-
}
|
|
41
|
-
declare module 'virtual:stl-playground/data' {
|
|
42
|
-
import type { Config } from 'virtual:stl-playground/create';
|
|
43
|
-
declare const data: Config;
|
|
44
|
-
export { data as default };
|
|
45
|
-
}
|
|
46
|
-
declare module 'virtual:stl-playground/create' {
|
|
47
|
-
export type PlaygroundLanguage = 'python' | 'typescript' | 'http';
|
|
48
|
-
export type Config = {
|
|
49
|
-
wheelUrl: string;
|
|
50
|
-
pyTypes: {
|
|
51
|
-
files: Record<string, string>;
|
|
52
|
-
wheel: string;
|
|
53
|
-
} | null;
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
-
HIGHLIGHT_THEMES: any;
|
|
56
|
-
tsTypes: {
|
|
57
|
-
links: [string, string][];
|
|
58
|
-
files: [string, string][];
|
|
59
|
-
} | null;
|
|
60
|
-
authData:
|
|
61
|
-
| ({
|
|
62
|
-
type: 'http_bearer' | 'query' | 'header' | 'oauth2' | 'http_basic' | 'http_digest';
|
|
63
|
-
description?: string;
|
|
64
|
-
name: string;
|
|
65
|
-
title: string;
|
|
66
|
-
header: string | undefined;
|
|
67
|
-
example: string | undefined;
|
|
68
|
-
} & {
|
|
69
|
-
opts: {
|
|
70
|
-
name: string;
|
|
71
|
-
type: 'string' | 'number' | 'boolean' | 'null' | 'integer';
|
|
72
|
-
nullable: boolean;
|
|
73
|
-
description?: string | undefined;
|
|
74
|
-
example?: unknown;
|
|
75
|
-
default?: unknown;
|
|
76
|
-
read_env?: string | undefined;
|
|
77
|
-
auth?:
|
|
78
|
-
| {
|
|
79
|
-
security_scheme: string;
|
|
80
|
-
role?: 'value' | 'password' | 'username' | 'client_id' | 'client_secret' | undefined;
|
|
81
|
-
}
|
|
82
|
-
| undefined;
|
|
83
|
-
}[];
|
|
84
|
-
})[]
|
|
85
|
-
| null;
|
|
86
|
-
};
|
|
87
|
-
export function createPlayground(
|
|
88
|
-
props: {
|
|
89
|
-
lang: PlaygroundLanguage;
|
|
90
|
-
doc: string;
|
|
91
|
-
/** div.stl-snippet-request-container */
|
|
92
|
-
container: HTMLElement;
|
|
93
|
-
onLanguageSelect: (value: string) => void;
|
|
94
|
-
} & Config,
|
|
95
|
-
): () => Promise<void>;
|
|
96
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import wheelUrl from 'virtual:stl-playground/python/wheel.whl?url';
|
|
2
|
-
import pyTypes from 'virtual:stl-playground/python.json';
|
|
3
|
-
import tsTypes from 'virtual:stl-playground/typescript.json';
|
|
4
|
-
import authData from 'virtual:stl-playground/auth.json';
|
|
5
|
-
import { HIGHLIGHT_THEMES } from 'virtual:stl-starlight-virtual-module';
|
|
6
|
-
import { Config } from 'virtual:stl-playground/create';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
wheelUrl,
|
|
10
|
-
pyTypes,
|
|
11
|
-
tsTypes,
|
|
12
|
-
authData,
|
|
13
|
-
HIGHLIGHT_THEMES,
|
|
14
|
-
} satisfies Config;
|