@stainless-api/docs 0.1.0-beta.2 → 0.1.0-beta.20
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 +147 -0
- package/components/variables.css +1 -27
- package/eslint-suppressions.json +47 -0
- package/locals.d.ts +14 -0
- package/package.json +30 -27
- package/plugin/buildAlgoliaIndex.ts +29 -4
- package/plugin/cms/server.ts +97 -54
- package/plugin/cms/sidebar-builder.ts +6 -25
- package/plugin/cms/worker.ts +2 -2
- package/plugin/components/SnippetCode.tsx +7 -4
- package/plugin/components/search/SearchAlgolia.astro +0 -7
- package/plugin/components/search/SearchIsland.tsx +30 -17
- package/plugin/generateAPIReferenceLink.ts +1 -1
- package/plugin/globalJs/ai-dropdown-options.ts +161 -0
- package/plugin/globalJs/navigation.ts +0 -23
- package/plugin/helpers/getPageLoadEvent.ts +1 -1
- package/plugin/index.ts +49 -17
- package/plugin/languages.ts +1 -1
- package/plugin/loadPluginConfig.ts +92 -13
- package/plugin/react/Routing.tsx +30 -33
- package/plugin/referencePlaceholderUtils.ts +1 -1
- package/plugin/replaceSidebarPlaceholderMiddleware.ts +4 -0
- package/plugin/routes/Docs.astro +59 -85
- package/plugin/routes/Overview.astro +9 -15
- package/plugin/routes/markdown.ts +1 -1
- package/plugin/vendor/preview.worker.docs.js +6357 -6132
- package/resolveSrcFile.ts +10 -0
- package/shared/getSharedLogger.ts +15 -0
- package/shared/terminalUtils.ts +3 -0
- package/src/content.config.ts +9 -0
- package/stl-docs/components/AIDropdown.tsx +52 -0
- package/stl-docs/components/Head.astro +9 -0
- package/stl-docs/components/Header.astro +3 -2
- package/stl-docs/components/PageTitle.astro +65 -0
- package/stl-docs/components/TableOfContents.astro +34 -0
- package/stl-docs/components/ThemeSelect.astro +4 -2
- package/stl-docs/components/content-panel/ContentPanel.astro +9 -39
- package/stl-docs/components/headers/DefaultHeader.astro +1 -1
- package/stl-docs/components/headers/HeaderLinks.astro +1 -1
- package/stl-docs/components/headers/StackedHeader.astro +30 -25
- package/stl-docs/components/icons/chat-gpt.tsx +17 -0
- package/stl-docs/components/icons/claude.tsx +10 -0
- package/stl-docs/components/icons/markdown.tsx +10 -0
- package/stl-docs/components/index.ts +2 -0
- package/stl-docs/components/mintlify-compat/Accordion.astro +7 -38
- package/stl-docs/components/mintlify-compat/AccordionGroup.astro +9 -23
- package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
- package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
- package/stl-docs/components/mintlify-compat/Step.astro +30 -32
- package/stl-docs/components/mintlify-compat/Steps.astro +8 -10
- package/stl-docs/components/mintlify-compat/callouts/Callout.astro +10 -3
- package/stl-docs/components/mintlify-compat/callouts/Check.astro +7 -3
- package/stl-docs/components/mintlify-compat/callouts/Danger.astro +7 -3
- package/stl-docs/components/mintlify-compat/callouts/Info.astro +7 -3
- package/stl-docs/components/mintlify-compat/callouts/Note.astro +7 -3
- package/stl-docs/components/mintlify-compat/callouts/Tip.astro +7 -3
- package/stl-docs/components/mintlify-compat/callouts/Warning.astro +7 -3
- package/stl-docs/components/mintlify-compat/card.css +33 -35
- package/stl-docs/components/nav-tabs/NavDropdown.astro +1 -1
- package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -7
- package/stl-docs/components/nav-tabs/buildNavLinks.ts +4 -3
- package/stl-docs/components/pagination/HomeLink.astro +10 -0
- package/stl-docs/components/pagination/Pagination.astro +173 -0
- package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
- package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
- package/stl-docs/components/pagination/util.ts +71 -0
- package/stl-docs/components/{Sidebar.astro → sidebars/BaseSidebar.astro} +2 -3
- package/stl-docs/components/sidebars/SDKSelectSidebar.astro +8 -0
- package/stl-docs/disableCalloutSyntax.ts +36 -0
- package/stl-docs/index.ts +76 -13
- package/stl-docs/loadStlDocsConfig.ts +25 -3
- package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +64 -0
- package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +34 -0
- package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
- package/stl-docs/tabsMiddleware.ts +12 -4
- package/styles/code.css +115 -127
- package/styles/fonts.css +24 -9
- package/styles/links.css +10 -49
- package/styles/overrides.css +55 -57
- package/styles/page.css +89 -59
- package/styles/sdk_select.css +6 -7
- package/styles/search.css +65 -67
- package/styles/sidebar.css +199 -128
- package/styles/toc.css +37 -33
- package/theme.css +9 -1
- package/tsconfig.json +2 -5
- package/virtual-module.d.ts +4 -1
- package/plugin/globalJs/ai-dropdown.ts +0 -57
- package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -86
- package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -64
- /package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
const dirName = import.meta.dirname;
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a source file path relative to the stl-starlight package.
|
|
5
|
+
* @param projectPath - The relative path to the source file.
|
|
6
|
+
* @returns The absolute path to the source file.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveSrcFile(...projectPath: string[]) {
|
|
9
|
+
return join(dirName, ...projectPath);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AstroIntegrationLogger } from 'astro';
|
|
2
|
+
|
|
3
|
+
let sharedLogger: AstroIntegrationLogger | null = null;
|
|
4
|
+
|
|
5
|
+
// This is probably temporary, but it's a quick way to share a logger between our many integrations
|
|
6
|
+
// we want to share a logger so they have the same "stainless" label
|
|
7
|
+
|
|
8
|
+
export function setSharedLogger(logger: AstroIntegrationLogger) {
|
|
9
|
+
sharedLogger = logger;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// a fallback is probably not required, but it's a good safeguard in case we somehow call a logger before the shared logger is set
|
|
13
|
+
export function getSharedLogger({ fallback }: { fallback: AstroIntegrationLogger }) {
|
|
14
|
+
return sharedLogger ?? fallback;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Stub here so that `astro sync` generates the correct types for the `docs` content collection
|
|
2
|
+
|
|
3
|
+
import { defineCollection } from 'astro:content';
|
|
4
|
+
import { docsLoader } from '@astrojs/starlight/loaders';
|
|
5
|
+
import { docsSchema } from '@astrojs/starlight/schema';
|
|
6
|
+
|
|
7
|
+
export const collections = {
|
|
8
|
+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
|
9
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DropdownButton } from '@stainless-api/ui-primitives';
|
|
2
|
+
import { CopyIcon } from 'lucide-react';
|
|
3
|
+
import { ChatGPTIcon } from './icons/chat-gpt';
|
|
4
|
+
import { ClaudeIcon } from './icons/claude';
|
|
5
|
+
import { MarkdownIcon } from './icons/markdown';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { getAIDropdownOptions, type DropdownIcon } from '../../plugin/globalJs/ai-dropdown-options';
|
|
9
|
+
|
|
10
|
+
const iconMap: { [key in DropdownIcon]: React.ReactNode } = {
|
|
11
|
+
markdown: <MarkdownIcon />,
|
|
12
|
+
copy: <CopyIcon size={16} />,
|
|
13
|
+
claude: <ClaudeIcon />,
|
|
14
|
+
chatgpt: <ChatGPTIcon />,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const { primaryAction, groups } = getAIDropdownOptions();
|
|
18
|
+
|
|
19
|
+
function ItemLabel({ label }: { label: string[] }) {
|
|
20
|
+
const isExternal = label.length > 1;
|
|
21
|
+
return (
|
|
22
|
+
<DropdownButton.MenuItemText subtle={isExternal}>
|
|
23
|
+
{label[0]}
|
|
24
|
+
{isExternal && <strong>{label[1]}</strong>}
|
|
25
|
+
</DropdownButton.MenuItemText>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function AIDropdown() {
|
|
30
|
+
return (
|
|
31
|
+
<DropdownButton data-dropdown-id="ai-dropdown-button">
|
|
32
|
+
<DropdownButton.PrimaryAction>
|
|
33
|
+
{iconMap[primaryAction.icon]}
|
|
34
|
+
<DropdownButton.PrimaryActionText>{primaryAction.label}</DropdownButton.PrimaryActionText>
|
|
35
|
+
</DropdownButton.PrimaryAction>
|
|
36
|
+
<DropdownButton.Trigger />
|
|
37
|
+
<DropdownButton.Menu>
|
|
38
|
+
{groups.map((group) => (
|
|
39
|
+
<React.Fragment key={group.reactKey}>
|
|
40
|
+
{group.options.map((option) => (
|
|
41
|
+
<DropdownButton.MenuItem value={option.id} isExternalLink key={option.id}>
|
|
42
|
+
<DropdownButton.MenuItemIcon>{iconMap[option.icon]}</DropdownButton.MenuItemIcon>
|
|
43
|
+
<ItemLabel label={option.label} />
|
|
44
|
+
</DropdownButton.MenuItem>
|
|
45
|
+
))}
|
|
46
|
+
{group.isLast ? null : <hr />}
|
|
47
|
+
</React.Fragment>
|
|
48
|
+
))}
|
|
49
|
+
</DropdownButton.Menu>
|
|
50
|
+
</DropdownButton>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import config from 'virtual:starlight/user-config';
|
|
3
3
|
|
|
4
|
-
import { HEADER_LAYOUT } from 'virtual:stl-
|
|
4
|
+
import { HEADER_LAYOUT } from 'virtual:stl-docs-virtual-module';
|
|
5
5
|
import DefaultHeader from './headers/DefaultHeader.astro';
|
|
6
6
|
import StackedHeader from './headers/StackedHeader.astro';
|
|
7
7
|
|
|
@@ -44,9 +44,10 @@ const shouldRenderSearch = !!(
|
|
|
44
44
|
overflow: clip;
|
|
45
45
|
/* Avoid clipping focus ring around link inside title wrapper. */
|
|
46
46
|
padding: 0.25rem;
|
|
47
|
-
padding-left: 0;
|
|
48
47
|
margin: -0.25rem;
|
|
49
48
|
min-width: 0;
|
|
49
|
+
/* Max height should match button height */
|
|
50
|
+
max-height: 32px;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
.default-tabs-container {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { ENABLE_PROSE_MARKDOWN_RENDERING } from 'virtual:stl-docs-virtual-module';
|
|
3
|
+
import type { StarlightRouteData } from '@astrojs/starlight/route-data';
|
|
4
|
+
import Default from '@astrojs/starlight/components/PageTitle.astro';
|
|
5
|
+
import { ContentBreadcrumbs } from './ContentBreadcrumbs';
|
|
6
|
+
import { AIDropdown } from './AIDropdown';
|
|
7
|
+
import { ENABLE_CONTEXT_MENU } from 'virtual:stl-starlight-virtual-module';
|
|
8
|
+
|
|
9
|
+
function sidebarHasEntry(sidebarEntry: StarlightRouteData['sidebar'], currentPath?: string) {
|
|
10
|
+
if (!currentPath) return false;
|
|
11
|
+
const normalizePath = (path: string) => {
|
|
12
|
+
return path.endsWith('/') ? path : path + '/';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const normalizedCurrent = normalizePath(currentPath);
|
|
16
|
+
|
|
17
|
+
for (const entry of sidebarEntry) {
|
|
18
|
+
if (entry.type === 'link') {
|
|
19
|
+
const normalizedHref = normalizePath(entry.href);
|
|
20
|
+
if (normalizedHref === normalizedCurrent) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
} else if (entry.type === 'group') {
|
|
24
|
+
const hasInGroup = sidebarHasEntry(entry.entries, currentPath);
|
|
25
|
+
if (hasInGroup) return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const skipRenderingStarlightTitle = Astro.locals._stlStarlightPage?.skipRenderingStarlightTitle ?? false;
|
|
33
|
+
|
|
34
|
+
const hasMarkdownRoute = Astro.locals._stlStarlightPage?.hasMarkdownRoute ?? true;
|
|
35
|
+
// ⬆️ hopefully this is temporary. But for now, we don't have a markdown representation of the API reference overview page
|
|
36
|
+
|
|
37
|
+
const currentPath = Astro.url.pathname;
|
|
38
|
+
|
|
39
|
+
function shouldShowAIDropdown() {
|
|
40
|
+
// Hide if there is no associated sidebar entry. This applies to pages like the 404 page.
|
|
41
|
+
const hasSidebarEntry = sidebarHasEntry(Astro.locals.starlightRoute.sidebar, currentPath);
|
|
42
|
+
if (!hasSidebarEntry) return false;
|
|
43
|
+
|
|
44
|
+
if (!hasMarkdownRoute) return false;
|
|
45
|
+
|
|
46
|
+
if (!ENABLE_PROSE_MARKDOWN_RENDERING) return false;
|
|
47
|
+
if (!ENABLE_CONTEXT_MENU) return false;
|
|
48
|
+
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const showAIDropdown = shouldShowAIDropdown();
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
skipRenderingStarlightTitle ? null : (
|
|
57
|
+
<>
|
|
58
|
+
<div class="stl-ui-not-prose stl-page-nav-container stl-prose-page-nav-container">
|
|
59
|
+
<ContentBreadcrumbs currentPath={currentPath} sidebarEntry={Astro.locals.starlightRoute.sidebar} />
|
|
60
|
+
{showAIDropdown && <AIDropdown />}
|
|
61
|
+
</div>
|
|
62
|
+
<Default />
|
|
63
|
+
</>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Default from '@astrojs/starlight/components/TableOfContents.astro';
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<Default {...Astro.props} />
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
/**
|
|
9
|
+
* Starlight will mark TOC links as active as they are scrolled to. However, it does not mark
|
|
10
|
+
* a link as active if it cannot be scrolled to on the page. This happens for small sections at
|
|
11
|
+
* the bottom of the page which are not large enough to scroll to the top of the viewport.
|
|
12
|
+
*
|
|
13
|
+
* This script will mark a section as active if its corresponding hash is in the URL, even if
|
|
14
|
+
* it cannot be scrolled to.
|
|
15
|
+
*/
|
|
16
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
17
|
+
const tocLinks = document.querySelectorAll('starlight-toc a') as NodeListOf<HTMLAnchorElement>;
|
|
18
|
+
|
|
19
|
+
function updateAriaCurrent() {
|
|
20
|
+
const current = decodeURIComponent(window.location.hash || '');
|
|
21
|
+
tocLinks.forEach((link) => {
|
|
22
|
+
const linkHash = decodeURIComponent(link.hash || link.getAttribute('href') || '');
|
|
23
|
+
if (linkHash === current) {
|
|
24
|
+
link.setAttribute('aria-current', 'true');
|
|
25
|
+
} else {
|
|
26
|
+
link.removeAttribute('aria-current');
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
window.addEventListener('hashchange', updateAriaCurrent);
|
|
32
|
+
updateAriaCurrent();
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
@@ -59,7 +59,7 @@ const options = [
|
|
|
59
59
|
<Dropdown className="theme-select-container" data-theme-select>
|
|
60
60
|
<DropdownTrigger withChevron>
|
|
61
61
|
<span class="stl-dropdown-icon">
|
|
62
|
-
{options.map(({
|
|
62
|
+
{options.map(({ icon }) => <Fragment set:html={icon} />)}
|
|
63
63
|
</span>
|
|
64
64
|
</DropdownTrigger>
|
|
65
65
|
<DropdownMenu role="listbox">
|
|
@@ -182,7 +182,7 @@ const options = [
|
|
|
182
182
|
applyTheme(event.newDocument, loadTheme());
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
-
document.addEventListener(getPageLoadEvent(), (
|
|
185
|
+
document.addEventListener(getPageLoadEvent(), () => {
|
|
186
186
|
setupThemeMode(document);
|
|
187
187
|
});
|
|
188
188
|
</script>
|
|
@@ -209,6 +209,7 @@ const options = [
|
|
|
209
209
|
display: flex;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
+
.stldocs-root .stl-dropdown-icon,
|
|
212
213
|
.stl-dropdown-icon {
|
|
213
214
|
display: flex;
|
|
214
215
|
align-items: center;
|
|
@@ -217,6 +218,7 @@ const options = [
|
|
|
217
218
|
height: 16px;
|
|
218
219
|
}
|
|
219
220
|
|
|
221
|
+
.stldocs-root span.stl-dropdown-icon,
|
|
220
222
|
span.stl-dropdown-icon,
|
|
221
223
|
span.stl-dropdown-chevron {
|
|
222
224
|
padding-left: 0;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
import { ProseAIDropdown } from './ProseAIDropdown';
|
|
4
|
-
const currentPath = Astro.url.pathname;
|
|
2
|
+
|
|
5
3
|
---
|
|
6
4
|
|
|
7
5
|
<div class="content-panel">
|
|
8
6
|
<div class="sl-container stl-ui-prose">
|
|
9
|
-
<div class="stl-ui-not-prose stl-page-nav-container stl-prose-page-nav-container">
|
|
10
|
-
<ContentBreadcrumbs currentPath={currentPath} sidebarEntry={Astro.locals.starlightRoute.sidebar} />
|
|
11
|
-
<ProseAIDropdown currentPath={currentPath} sidebarEntry={Astro.locals.starlightRoute.sidebar} />
|
|
12
|
-
</div>
|
|
13
7
|
<slot />
|
|
14
8
|
</div>
|
|
15
9
|
</div>
|
|
@@ -26,47 +20,23 @@ const currentPath = Astro.url.pathname;
|
|
|
26
20
|
max-width: var(--sl-content-width);
|
|
27
21
|
}
|
|
28
22
|
|
|
29
|
-
.sl-container > :global(* + *) {
|
|
30
|
-
margin-top: 1.5rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
23
|
@media (min-width: 72rem) {
|
|
34
24
|
.sl-container {
|
|
35
25
|
margin-inline: var(--sl-content-margin-inline, auto);
|
|
36
26
|
}
|
|
37
27
|
}
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
padding: 0 var(--sl-content-pad-x);
|
|
43
|
-
}
|
|
29
|
+
.content-panel {
|
|
30
|
+
padding: 0 var(--sl-content-pad-x) 0 var(--sl-content-pad-x);
|
|
31
|
+
}
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
@media (min-width: 50rem) {
|
|
34
|
+
.content-panel {
|
|
35
|
+
padding: 0 0 0 var(--sl-content-pad-x);
|
|
47
36
|
}
|
|
48
37
|
}
|
|
49
|
-
</style>
|
|
50
38
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
display: none;
|
|
39
|
+
.stl-prose-page-nav-container {
|
|
40
|
+
padding: 1rem 0 0;
|
|
54
41
|
}
|
|
55
42
|
</style>
|
|
56
|
-
|
|
57
|
-
<script>
|
|
58
|
-
import { initDropdownButton } from '@stainless-api/ui-primitives/scripts';
|
|
59
|
-
import { getPageLoadEvent } from '../../../plugin/helpers/getPageLoadEvent';
|
|
60
|
-
import { onSelectAIOption } from '../../../plugin/globalJs/ai-dropdown.ts';
|
|
61
|
-
|
|
62
|
-
document.addEventListener(getPageLoadEvent(), () => {
|
|
63
|
-
console.log('Initializing AI Dropdown');
|
|
64
|
-
initDropdownButton({
|
|
65
|
-
dropdownId: 'prose-ai-dropdown-button',
|
|
66
|
-
onSelect: (option: string) => onSelectAIOption(option, false),
|
|
67
|
-
onPrimaryAction: () => {
|
|
68
|
-
onSelectAIOption('claude', false);
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
</script>
|
|
@@ -4,7 +4,7 @@ import Search from 'virtual:starlight/components/Search';
|
|
|
4
4
|
import SiteTitle from 'virtual:starlight/components/SiteTitle';
|
|
5
5
|
import HeaderLinks from './HeaderLinks.astro';
|
|
6
6
|
import NavLinks from '../nav-tabs/NavTabs.astro';
|
|
7
|
-
import { TABS } from 'virtual:stl-
|
|
7
|
+
import { TABS } from 'virtual:stl-docs-virtual-module';
|
|
8
8
|
import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
|
|
9
9
|
import SplashMobileMenuToggle from './SplashMobileMenuToggle.astro';
|
|
10
10
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import LanguageSelect from
|
|
3
|
-
import Search from
|
|
4
|
-
import SiteTitle from
|
|
2
|
+
import LanguageSelect from 'virtual:starlight/components/LanguageSelect';
|
|
3
|
+
import Search from 'virtual:starlight/components/Search';
|
|
4
|
+
import SiteTitle from 'virtual:starlight/components/SiteTitle';
|
|
5
5
|
import HeaderLinks from './HeaderLinks.astro';
|
|
6
|
-
import { TABS } from
|
|
7
|
-
import ThemeSelect from
|
|
8
|
-
import SecondaryNavTabs from
|
|
9
|
-
import SplashMobileMenuToggle from
|
|
6
|
+
import { TABS } from 'virtual:stl-docs-virtual-module';
|
|
7
|
+
import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
|
|
8
|
+
import SecondaryNavTabs from '../nav-tabs/SecondaryNavTabs.astro';
|
|
9
|
+
import SplashMobileMenuToggle from './SplashMobileMenuToggle.astro';
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
shouldRenderSearch?: boolean;
|
|
@@ -38,17 +38,17 @@ const { hasSidebar } = Astro.locals.starlightRoute;
|
|
|
38
38
|
<SecondaryNavTabs />
|
|
39
39
|
|
|
40
40
|
<style is:inline>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
.stl-top-container {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: end;
|
|
46
|
+
gap: 0.5rem;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
49
|
@media (min-width: 50rem) {
|
|
50
50
|
:root {
|
|
51
|
-
--sl-nav-height:
|
|
51
|
+
--sl-nav-height: 80px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
header.header {
|
|
@@ -64,12 +64,17 @@ const { hasSidebar } = Astro.locals.starlightRoute;
|
|
|
64
64
|
}
|
|
65
65
|
</style>
|
|
66
66
|
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
{
|
|
68
|
+
TABS.length === 0 && (
|
|
69
|
+
<style
|
|
70
|
+
is:inline
|
|
71
|
+
set:text={`
|
|
72
|
+
@media (min-width: 50rem) {
|
|
73
|
+
:root {
|
|
74
|
+
--sl-nav-height: 56px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`}
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function ChatGPTIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
4
|
+
<g clipPath="url(#clip0_2771_126147)">
|
|
5
|
+
<path
|
|
6
|
+
d="M14.853 6.54857C15.216 5.45907 15.091 4.26557 14.5105 3.27457C13.6375 1.75457 11.8825 0.972574 10.1685 1.34057C9.40596 0.481574 8.31046 -0.00692579 7.16196 7.42116e-05C5.40996 -0.00392579 3.85546 1.12407 3.31646 2.79107C2.19096 3.02157 1.21946 3.72607 0.650955 4.72457C-0.228545 6.24057 -0.0280446 8.15157 1.14696 9.45157C0.783955 10.5411 0.908955 11.7346 1.48946 12.7256C2.36246 14.2456 4.11746 15.0276 5.83146 14.6596C6.59346 15.5186 7.68946 16.0071 8.83796 15.9996C10.591 16.0041 12.146 14.8751 12.685 13.2066C13.8105 12.9761 14.782 12.2716 15.3505 11.2731C16.229 9.75707 16.028 7.84757 14.8535 6.54757L14.853 6.54857ZM8.83896 14.9541C8.13746 14.9551 7.45796 14.7096 6.91946 14.2601C6.94396 14.2471 6.98646 14.2236 7.01396 14.2066L10.2 12.3666C10.363 12.2741 10.463 12.1006 10.462 11.9131V7.42157L11.8085 8.19907C11.823 8.20607 11.8325 8.22007 11.8345 8.23607V11.9556C11.8325 13.6096 10.493 14.9506 8.83896 14.9541ZM2.39696 12.2026C2.04546 11.5956 1.91896 10.8841 2.03946 10.1936C2.06296 10.2076 2.10446 10.2331 2.13396 10.2501L5.31996 12.0901C5.48146 12.1846 5.68146 12.1846 5.84346 12.0901L9.73296 9.84407V11.3991C9.73396 11.4151 9.72646 11.4306 9.71396 11.4406L6.49346 13.3001C5.05896 14.1261 3.22696 13.6351 2.39746 12.2026H2.39696ZM1.55846 5.24807C1.90846 4.64007 2.46096 4.17507 3.11896 3.93357C3.11896 3.96107 3.11746 4.00957 3.11746 4.04357V7.72407C3.11646 7.91107 3.21646 8.08457 3.37896 8.17707L7.26846 10.4226L5.92196 11.2001C5.90846 11.2091 5.89146 11.2106 5.87646 11.2041L2.65546 9.34307C1.22396 8.51407 0.732955 6.68257 1.55796 5.24857L1.55846 5.24807ZM12.6215 7.82257L8.73196 5.57657L10.0785 4.79957C10.092 4.79057 10.109 4.78907 10.124 4.79557L13.345 6.65507C14.779 7.48357 15.2705 9.31807 14.442 10.7521C14.0915 11.3591 13.5395 11.8241 12.882 12.0661V8.27557C12.8835 8.08857 12.784 7.91557 12.622 7.82257H12.6215ZM13.9615 5.80557C13.938 5.79107 13.8965 5.76607 13.867 5.74907L10.681 3.90907C10.5195 3.81457 10.3195 3.81457 10.1575 3.90907L6.26796 6.15507V4.60007C6.26696 4.58407 6.27446 4.56857 6.28696 4.55857L9.50746 2.70057C10.942 1.87307 12.776 2.36557 13.603 3.80057C13.9525 4.40657 14.079 5.11607 13.9605 5.80557H13.9615ZM5.53596 8.57707L4.18896 7.79957C4.17446 7.79257 4.16496 7.77857 4.16296 7.76257V4.04307C4.16396 2.38707 5.50746 1.04507 7.16346 1.04607C7.86396 1.04607 8.54196 1.29207 9.08046 1.74007C9.05596 1.75307 9.01396 1.77657 8.98596 1.79357L5.79996 3.63357C5.63696 3.72607 5.53696 3.89907 5.53796 4.08657L5.53596 8.57607V8.57707ZM6.26746 7.00007L7.99996 5.99957L9.73246 6.99957V9.00007L7.99996 10.0001L6.26746 9.00007V7.00007Z"
|
|
7
|
+
fill="var(--stl-ui-foreground)"
|
|
8
|
+
/>
|
|
9
|
+
</g>
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="clip0_2771_126147">
|
|
12
|
+
<rect width="16" height="16" fill="white" />
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function ClaudeIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
4
|
+
<path
|
|
5
|
+
d="M3.13924 10.6036L6.28658 8.84444L6.33924 8.69111L6.28658 8.60638H6.13266L5.60608 8.5741L3.8076 8.52568L2.2481 8.46113L0.737215 8.38043L0.356456 8.29973L0 7.83169L0.0364557 7.59766L0.356456 7.38382L0.814177 7.42416L1.82684 7.49276L3.34582 7.59766L4.4476 7.66222L6.08 7.83169H6.33924L6.3757 7.72678L6.28658 7.66222L6.21772 7.59766L4.64608 6.53649L2.94481 5.4148L2.05367 4.76922L1.57165 4.44239L1.32861 4.13574L1.22329 3.46595L1.66076 2.98581L2.2481 3.02615L2.39797 3.0665L2.99342 3.52244L4.26532 4.50292L5.92608 5.72145L6.16911 5.92319L6.26633 5.8546L6.27848 5.80618L6.16911 5.62461L5.26582 3.99856L4.30177 2.34426L3.87241 1.65833L3.75899 1.24678C3.71848 1.07731 3.69013 0.93609 3.69013 0.762591L4.18835 0.0887672L4.4638 0L5.1281 0.0887672L5.4076 0.330859L5.82076 1.27098L6.48911 2.75178L7.52608 4.76518L7.82987 5.36234L7.9919 5.91512L8.05266 6.08459H8.15797V5.98775L8.24304 4.85395L8.40101 3.46192L8.55494 1.67044L8.60759 1.16608L8.85873 0.560847L9.35696 0.234023L9.74582 0.419627L10.0658 0.875567L10.0213 1.17011L9.83089 2.40075L9.45823 4.32942L9.21519 5.62058H9.35696L9.51899 5.45918L10.1752 4.59168L11.277 3.21983L11.763 2.67512L12.3301 2.07392L12.6947 1.78745H13.3833L13.8896 2.53793L13.6628 3.31263L12.9539 4.20837L12.3666 4.96693L11.5241 6.09669L10.9975 7.0005L11.0461 7.07313L11.1716 7.06103L13.0754 6.65754L14.1043 6.47193L15.3316 6.26212L15.8866 6.52035L15.9473 6.78262L15.7286 7.31926L14.4162 7.64205L12.877 7.9487L10.5843 8.48937L10.5559 8.50954L10.5884 8.54989L11.6213 8.64673L12.0628 8.67094H13.1443L15.1575 8.82023L15.6841 9.16723L16 9.59089L15.9473 9.91368L15.1372 10.3252L14.0435 10.067L11.4916 9.46177L10.6167 9.24389H10.4952V9.31652L11.2243 10.0267L12.561 11.229L14.2339 12.7784L14.319 13.1618L14.1043 13.4644L13.8775 13.4321L12.4071 12.3306L11.84 11.8343L10.5559 10.757H10.4709V10.8699L10.7666 11.3017L12.3301 13.6419L12.4111 14.3601L12.2977 14.5941L11.8927 14.7354L11.4471 14.6547L10.5316 13.3756L9.58785 11.9352L8.82633 10.644L8.73316 10.6964L8.28354 15.5181L8.07291 15.7642L7.58684 15.9498L7.18177 15.6432L6.96709 15.1469L7.18177 14.1664L7.44101 12.8874L7.65165 11.8706L7.84203 10.6077L7.95544 10.1881L7.94734 10.1598L7.85418 10.1719L6.89823 11.4792L5.44405 13.4361L4.29367 14.6627L4.01823 14.7717L3.54025 14.5255L3.58481 14.0857L3.85215 13.6944L5.44405 11.6769L6.40405 10.4261L7.0238 9.70387L7.01975 9.59896H6.98329L2.75443 12.3346L2.00101 12.4314L1.67696 12.1288L1.71747 11.6325L1.87139 11.4711L3.14329 10.5996L3.13924 10.6036Z"
|
|
6
|
+
fill="#D97757"
|
|
7
|
+
/>
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function MarkdownIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
4
|
+
<path
|
|
5
|
+
d="M14.8447 3.33301C15.151 3.33301 15.4455 3.45527 15.6621 3.67188C15.8785 3.88844 16 4.18213 16 4.48828V12.0254C15.9997 12.3315 15.8777 12.6254 15.6611 12.8418C15.4446 13.0581 15.1508 13.1797 14.8447 13.1797H1.15527C0.848967 13.1797 0.55449 13.0584 0.337891 12.8418C0.121288 12.6252 0 12.3307 0 12.0244V4.48828C1.09706e-05 4.18213 0.121501 3.88844 0.337891 3.67188C0.554493 3.45527 0.848951 3.33301 1.15527 3.33301H14.8447ZM1.15527 4.10254C1.10457 4.10245 1.0537 4.11247 1.00684 4.13184C0.960202 4.15116 0.917554 4.17917 0.881836 4.21484C0.845984 4.2507 0.817213 4.29396 0.797852 4.34082C0.778601 4.38756 0.769447 4.43773 0.769531 4.48828V12.0254C0.76962 12.0759 0.779409 12.1262 0.798828 12.1729C0.81827 12.2196 0.846978 12.2621 0.882812 12.2979C0.918602 12.3335 0.961134 12.3616 1.00781 12.3809C1.05454 12.4001 1.10474 12.4102 1.15527 12.4102H14.8447C14.9467 12.4101 15.045 12.3699 15.1172 12.2979C15.1893 12.2258 15.2293 12.1274 15.2295 12.0254V4.48828C15.2296 4.43774 15.2204 4.38755 15.2012 4.34082C15.1819 4.29403 15.1529 4.25166 15.1172 4.21582C15.0814 4.17999 15.0389 4.15126 14.9922 4.13184C14.9455 4.11249 14.8952 4.10258 14.8447 4.10254H1.15527ZM5.38477 7.56348L6.92285 5.64062H8.46094V10.8721H6.92285V7.87109L5.38477 9.79492L3.8457 7.87109V10.8711H2.30762V5.63965H3.8457L5.38477 7.56348ZM12.6924 8.33301H14.2305L11.9229 10.8711L9.61523 8.33301H11.1533V5.64062H12.6924V8.33301Z"
|
|
6
|
+
fill="var(--stl-ui-foreground)"
|
|
7
|
+
/>
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -1,46 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
export interface Props {
|
|
3
3
|
title: string;
|
|
4
|
+
children: astroHTML.JSX.Children;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
const { title } = Astro.props;
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<details class="stl-ui-mintlify-compat-accordion" role="button" data-stl-ui-element>
|
|
10
|
-
<summary class="stl-ui-mintlify-compat-accordion-title">{title}</summary>
|
|
11
|
-
<div class="stl-ui-mintlify-compat-accordion-content" role="contentinfo">
|
|
12
|
-
<slot />
|
|
13
|
-
</div>
|
|
14
|
-
</details>
|
|
15
|
-
|
|
16
|
-
<style>
|
|
17
|
-
@layer stl-ui-mintlify-compat {
|
|
18
|
-
.stl-ui-mintlify-compat-accordion {
|
|
19
|
-
border-inline-start: none;
|
|
20
|
-
padding-inline-start: 0;
|
|
21
|
-
border-radius: 12px;
|
|
22
|
-
border: 1px solid var(--sl-color-hairline);
|
|
23
|
-
overflow: hidden;
|
|
24
8
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
margin-inline-start: 0;
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
background-color: var(--sl-color-hairline);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.stl-ui-mintlify-compat-accordion-title {
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
gap: 8px;
|
|
39
|
-
}
|
|
9
|
+
import { Accordion as StainlessAccordion } from '@stainless-api/ui-primitives';
|
|
10
|
+
---
|
|
40
11
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
12
|
+
<StainlessAccordion>
|
|
13
|
+
<StainlessAccordion.Summary>{title}</StainlessAccordion.Summary>
|
|
14
|
+
<slot />
|
|
15
|
+
</StainlessAccordion>
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
<style>
|
|
6
|
-
@layer stl-ui-mintlify-compat {
|
|
7
|
-
.stl-ui-mintlify-compat-accordion-group {
|
|
8
|
-
border-radius: 12px;
|
|
9
|
-
border: 1px solid var(--sl-color-hairline);
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
padding-inline-start: -5rem;
|
|
1
|
+
---
|
|
2
|
+
import { Accordion as StainlessAccordion } from '@stainless-api/ui-primitives';
|
|
12
3
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
border-radius: 0;
|
|
4
|
+
export interface Props {
|
|
5
|
+
children: astroHTML.JSX.Children;
|
|
6
|
+
}
|
|
7
|
+
---
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
</style>
|
|
9
|
+
<StainlessAccordion.Group>
|
|
10
|
+
<slot />
|
|
11
|
+
</StainlessAccordion.Group>
|