@stainless-api/docs 0.1.0-beta.6 → 0.1.0-beta.61
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 +486 -0
- package/README.md +1 -1
- package/eslint-suppressions.json +52 -0
- package/locals.d.ts +16 -0
- package/package.json +45 -40
- package/plugin/assets/languages/csharp.svg +1 -0
- package/plugin/buildAlgoliaIndex.ts +32 -7
- package/plugin/cms/server.ts +130 -58
- package/plugin/cms/sidebar-builder.ts +7 -26
- package/plugin/cms/worker.ts +83 -5
- package/plugin/components/MethodDescription.tsx +54 -0
- package/plugin/components/SDKSelect.astro +7 -87
- package/plugin/components/SnippetCode.tsx +53 -8
- package/plugin/components/search/SearchAlgolia.astro +14 -26
- package/plugin/components/search/SearchIsland.tsx +38 -24
- package/plugin/create-playground.shim.tsx +3 -0
- package/plugin/generateAPIReferenceLink.ts +2 -2
- package/plugin/globalJs/ai-dropdown-options.ts +235 -0
- package/plugin/globalJs/code-snippets.ts +15 -8
- package/plugin/globalJs/copy.ts +81 -16
- package/plugin/globalJs/method-descriptions.ts +33 -0
- package/plugin/globalJs/navigation.ts +7 -4
- package/plugin/index.ts +179 -35
- package/plugin/languages.ts +5 -2
- package/plugin/loadPluginConfig.ts +121 -32
- package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +1 -1
- package/plugin/react/Routing.tsx +208 -104
- package/plugin/referencePlaceholderUtils.ts +1 -1
- package/plugin/replaceSidebarPlaceholderMiddleware.ts +5 -1
- package/plugin/routes/Docs.astro +61 -83
- package/plugin/routes/Overview.astro +10 -16
- package/plugin/routes/markdown.ts +7 -7
- package/plugin/vendor/preview.worker.docs.js +19768 -17702
- package/plugin/vendor/templates/go.md +1 -1
- package/plugin/vendor/templates/python.md +1 -1
- package/resolveSrcFile.ts +10 -0
- package/scripts/vendor_deps.ts +5 -5
- 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 +63 -0
- package/stl-docs/components/AiChatIsland.tsx +10 -0
- package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +10 -18
- package/stl-docs/components/Head.astro +16 -0
- package/stl-docs/components/Header.astro +6 -8
- package/stl-docs/components/PageFrame.astro +14 -0
- package/stl-docs/components/PageTitle.astro +82 -0
- package/stl-docs/components/TableOfContents.astro +34 -0
- package/stl-docs/components/ThemeSelect.astro +118 -136
- package/stl-docs/components/content-panel/ContentPanel.astro +16 -25
- package/stl-docs/components/headers/SplashMobileMenuToggle.astro +17 -1
- package/stl-docs/components/headers/StackedHeader.astro +29 -24
- package/stl-docs/components/icons/chat-gpt.tsx +17 -0
- package/stl-docs/components/icons/claude.tsx +10 -0
- package/stl-docs/components/icons/cursor.tsx +10 -0
- package/stl-docs/components/icons/gemini.tsx +19 -0
- package/stl-docs/components/icons/markdown.tsx +10 -0
- package/stl-docs/components/index.ts +1 -0
- package/stl-docs/components/mintlify-compat/Accordion.astro +7 -5
- package/stl-docs/components/mintlify-compat/AccordionGroup.astro +7 -3
- 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 +1 -1
- package/stl-docs/components/mintlify-compat/callouts/Check.astro +1 -1
- package/stl-docs/components/mintlify-compat/callouts/Danger.astro +1 -1
- package/stl-docs/components/mintlify-compat/callouts/Info.astro +1 -1
- package/stl-docs/components/mintlify-compat/callouts/Note.astro +1 -1
- package/stl-docs/components/mintlify-compat/callouts/Tip.astro +1 -1
- package/stl-docs/components/mintlify-compat/callouts/Warning.astro +1 -1
- package/stl-docs/components/mintlify-compat/card.css +33 -35
- package/stl-docs/components/nav-tabs/NavDropdown.astro +31 -70
- package/stl-docs/components/nav-tabs/NavTabs.astro +78 -80
- package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -8
- package/stl-docs/components/nav-tabs/buildNavLinks.ts +3 -2
- package/stl-docs/components/pagination/HomeLink.astro +10 -0
- package/stl-docs/components/pagination/Pagination.astro +175 -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/scripts.ts +1 -0
- package/stl-docs/disableCalloutSyntax.ts +36 -0
- package/stl-docs/index.ts +130 -48
- package/stl-docs/loadStlDocsConfig.ts +44 -4
- 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/proseSearchIndexing.ts +113 -0
- package/stl-docs/tabsMiddleware.ts +11 -3
- package/styles/code.css +108 -140
- package/styles/fonts.css +32 -17
- package/styles/links.css +11 -48
- package/styles/method-descriptions.css +36 -0
- package/styles/overrides.css +48 -60
- package/styles/page.css +92 -52
- package/styles/sdk_select.css +9 -7
- package/styles/search.css +58 -69
- package/styles/sidebar.css +211 -131
- package/styles/{variables.css → sl-variables.css} +3 -2
- package/styles/stldocs-variables.css +6 -0
- package/styles/toc.css +41 -34
- package/theme.css +10 -10
- package/tsconfig.json +2 -5
- package/virtual-module.d.ts +23 -3
- package/components/variables.css +0 -135
- /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
- /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { AstroIntegration } from 'astro';
|
|
2
|
+
import { readFile } from 'fs/promises';
|
|
3
|
+
import { getSharedLogger } from '../shared/getSharedLogger';
|
|
4
|
+
import { bold } from '../shared/terminalUtils';
|
|
5
|
+
import { buildProseIndex } from '@stainless-api/docs-search/providers/algolia';
|
|
6
|
+
import * as cheerio from 'cheerio';
|
|
7
|
+
|
|
8
|
+
function chunkByWords(content: string, chunkSize: number = 30000, chunkOverlap: number = 10) {
|
|
9
|
+
if (Buffer.byteLength(content) < chunkSize) return [content];
|
|
10
|
+
|
|
11
|
+
const words = content.split(/\s+/);
|
|
12
|
+
const chunks: string[] = [];
|
|
13
|
+
|
|
14
|
+
let currentChunk: string[] = [];
|
|
15
|
+
let currentSize = 0;
|
|
16
|
+
|
|
17
|
+
for (const word of words) {
|
|
18
|
+
const wordSize = Buffer.byteLength(word + ' ', 'utf-8');
|
|
19
|
+
|
|
20
|
+
if (currentSize + wordSize > chunkSize && currentChunk.length > 0) {
|
|
21
|
+
chunks.push(currentChunk.join(' '));
|
|
22
|
+
|
|
23
|
+
const overlapStart = Math.max(0, currentChunk.length - chunkOverlap);
|
|
24
|
+
currentChunk = currentChunk.slice(overlapStart);
|
|
25
|
+
currentSize = Buffer.byteLength(currentChunk.join(' '), 'utf-8');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
currentChunk.push(word);
|
|
29
|
+
currentSize += wordSize;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (currentChunk.length > 0) {
|
|
33
|
+
chunks.push(currentChunk.join(' '));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return chunks;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function* indexHTML(content: string, root: string, pattern: string) {
|
|
40
|
+
const $ = cheerio.load(content);
|
|
41
|
+
const matches = $(root).find(pattern);
|
|
42
|
+
|
|
43
|
+
for (const match of matches) {
|
|
44
|
+
const rawText = $(match).text().trim();
|
|
45
|
+
const chunks = chunkByWords(rawText);
|
|
46
|
+
const chunkId = crypto.randomUUID();
|
|
47
|
+
|
|
48
|
+
for (const [chunkN, content] of chunks.entries()) {
|
|
49
|
+
yield {
|
|
50
|
+
id: $(match).attr('id'),
|
|
51
|
+
tag: match.tagName.toLowerCase(),
|
|
52
|
+
content,
|
|
53
|
+
chunk: {
|
|
54
|
+
id: chunkId,
|
|
55
|
+
index: chunkN,
|
|
56
|
+
total: chunks.length,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const root = 'main';
|
|
64
|
+
const pattern = 'h1, h2, h3, h4, h5, h6, p, li';
|
|
65
|
+
|
|
66
|
+
export function stainlessDocsProseIndexing(): AstroIntegration {
|
|
67
|
+
return {
|
|
68
|
+
name: 'stl-docs-prose-indexing',
|
|
69
|
+
hooks: {
|
|
70
|
+
'astro:build:done': async ({ assets, logger: localLogger, dir }) => {
|
|
71
|
+
const logger = getSharedLogger({ fallback: localLogger });
|
|
72
|
+
const outputBasePath = dir.pathname;
|
|
73
|
+
|
|
74
|
+
const {
|
|
75
|
+
PUBLIC_ALGOLIA_APP_ID: appId,
|
|
76
|
+
PUBLIC_ALGOLIA_INDEX: indexName,
|
|
77
|
+
PRIVATE_ALGOLIA_WRITE_KEY: algoliaWriteKey,
|
|
78
|
+
} = process.env;
|
|
79
|
+
|
|
80
|
+
if (!appId || !indexName || !algoliaWriteKey) {
|
|
81
|
+
logger.info('Skipping algolia indexing due to missing environment variables');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const starlightPagePatterns = ['/[...slug]'];
|
|
86
|
+
const pagesToRender = Array.from(assets.entries())
|
|
87
|
+
.filter(([k]) => starlightPagePatterns.includes(k))
|
|
88
|
+
.map(([, v]) => v)
|
|
89
|
+
.flat()
|
|
90
|
+
.map((v) => v.pathname);
|
|
91
|
+
|
|
92
|
+
logger.info(bold(`Indexing ${pagesToRender.length} prose pages for search`));
|
|
93
|
+
|
|
94
|
+
const objects = [];
|
|
95
|
+
for (const absHtmlPath of pagesToRender) {
|
|
96
|
+
const content = await readFile(absHtmlPath, 'utf-8');
|
|
97
|
+
const idx = indexHTML(content, root, pattern);
|
|
98
|
+
for (const entry of idx)
|
|
99
|
+
objects.push({
|
|
100
|
+
...entry,
|
|
101
|
+
source: absHtmlPath.slice(outputBasePath.length),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
await buildProseIndex(appId, `${indexName}-prose`, algoliaWriteKey, objects);
|
|
107
|
+
} catch (err) {
|
|
108
|
+
logger.error(`Failed to index prose content: ${err}`);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -58,7 +58,7 @@ function getTabIndexForSlug(
|
|
|
58
58
|
match: 'exact' | 'prefix';
|
|
59
59
|
} | null {
|
|
60
60
|
// ↓ exact match eg. slug = "/blog" and there is a link containing "/blog"
|
|
61
|
-
|
|
61
|
+
const tab = linksByTab.get(slug)!;
|
|
62
62
|
if (typeof tab === 'string') {
|
|
63
63
|
return {
|
|
64
64
|
match: 'exact',
|
|
@@ -88,13 +88,19 @@ function getNonSplitLinksByTab() {
|
|
|
88
88
|
const linksByTab = new Map<string, string>();
|
|
89
89
|
|
|
90
90
|
for (let i = 0; i < TABS.length; i++) {
|
|
91
|
-
const tab = TABS[i]
|
|
91
|
+
const tab = TABS[i]!;
|
|
92
92
|
linksByTab.set(tab.link, String(i));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
return linksByTab;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
export interface StarlightRouteWithStlDocs extends StarlightRouteData {
|
|
99
|
+
_stlDocs?: {
|
|
100
|
+
activeTabIndex: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
98
104
|
export const onRequest = defineRouteMiddleware(async (context) => {
|
|
99
105
|
// if using content collection schema, use: context.locals.starlightRoute.entry.data.stainlessStarlight
|
|
100
106
|
// this worked without collections but relied on hijacking starlightRoute: context.props.frontmatter.stainlessStarlight
|
|
@@ -143,7 +149,8 @@ export const onRequest = defineRouteMiddleware(async (context) => {
|
|
|
143
149
|
}
|
|
144
150
|
|
|
145
151
|
// We store the active tab index so we can use it in our nav tabs component
|
|
146
|
-
context.locals.starlightRoute
|
|
152
|
+
const routeData: StarlightRouteWithStlDocs = context.locals.starlightRoute;
|
|
153
|
+
routeData._stlDocs = {
|
|
147
154
|
activeTabIndex: activeTabIndex.index,
|
|
148
155
|
};
|
|
149
156
|
|
|
@@ -179,5 +186,6 @@ export const onRequest = defineRouteMiddleware(async (context) => {
|
|
|
179
186
|
|
|
180
187
|
matchingGroup?.entries.unshift(...mobileLinks);
|
|
181
188
|
|
|
189
|
+
(context.locals._stlStarlightPage ??= {}).fullSidebar = context.locals.starlightRoute.sidebar;
|
|
182
190
|
context.locals.starlightRoute.sidebar = matchingGroup.entries;
|
|
183
191
|
});
|
package/styles/code.css
CHANGED
|
@@ -1,72 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
.expressive-code {
|
|
2
|
+
.frame {
|
|
3
|
+
--code-background: var(--stl-color-faint-background);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
figure.frame {
|
|
7
|
+
box-shadow: none;
|
|
8
|
+
}
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
figure,
|
|
11
|
+
pre {
|
|
12
|
+
border-radius: var(--sl-button-border-radius);
|
|
13
|
+
border-color: var(--stl-color-border);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.frame.has-title:not(.is-terminal),
|
|
17
|
+
.frame.is-terminal {
|
|
18
|
+
figcaption {
|
|
19
|
+
border-radius: var(--sl-button-border-radius) var(--sl-button-border-radius) 0 0;
|
|
20
|
+
border-color: var(--stl-color-border);
|
|
9
21
|
}
|
|
10
22
|
|
|
11
|
-
figure,
|
|
12
23
|
pre {
|
|
13
|
-
border-radius: var(--sl-button-border-radius);
|
|
14
|
-
border-color: var(--
|
|
24
|
+
border-radius: 0 0 var(--sl-button-border-radius) var(--sl-button-border-radius);
|
|
25
|
+
border-color: var(--stl-color-border);
|
|
15
26
|
}
|
|
27
|
+
}
|
|
16
28
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
border-radius: var(--sl-button-border-radius) var(--sl-button-border-radius) 0 0;
|
|
21
|
-
border-color: var(--sl-color-hairline);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pre {
|
|
25
|
-
border-radius: 0 0 var(--sl-button-border-radius) var(--sl-button-border-radius);
|
|
26
|
-
border-color: var(--sl-color-hairline);
|
|
27
|
-
}
|
|
29
|
+
.frame.has-title:not(.is-terminal) {
|
|
30
|
+
figcaption span:first-child {
|
|
31
|
+
border-top-left-radius: var(--sl-button-border-radius);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.header::before {
|
|
36
|
-
border-color: var(--sl-color-hairline);
|
|
37
|
-
}
|
|
34
|
+
.header::before {
|
|
35
|
+
border-color: var(--stl-color-border);
|
|
36
|
+
}
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
38
|
+
.title::after {
|
|
39
|
+
bottom: -1px;
|
|
40
|
+
top: unset;
|
|
43
41
|
}
|
|
44
42
|
}
|
|
43
|
+
}
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
.astro-code {
|
|
46
|
+
border-radius: var(--sl-button-border-radius);
|
|
47
|
+
border-color: var(--stl-color-border);
|
|
48
|
+
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
.stl-snippet-request-container {
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.stl-snippet-expand-button {
|
|
55
|
+
display: none;
|
|
56
|
+
|
|
57
|
+
position: relative;
|
|
58
|
+
left: 50%;
|
|
59
|
+
transform: translateX(-50%);
|
|
60
|
+
bottom: 12px;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
height: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.stl-snippet-code-is-expanded {
|
|
66
|
+
.ellipsis {
|
|
67
|
+
display: none;
|
|
53
68
|
}
|
|
69
|
+
}
|
|
54
70
|
|
|
71
|
+
.stl-snippet-collapsible {
|
|
55
72
|
.stl-snippet-expand-button {
|
|
56
|
-
display:
|
|
73
|
+
display: block;
|
|
74
|
+
margin-bottom: -23px;
|
|
75
|
+
/* Prevent clipping of the button with the container below */
|
|
76
|
+
z-index: 100;
|
|
77
|
+
}
|
|
57
78
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
font-family: var(--stldocs-font);
|
|
68
|
-
padding: 4px 7px 4px 7px;
|
|
69
|
-
height: auto;
|
|
79
|
+
.stl-snippet-code-is-collapsed {
|
|
80
|
+
.hidden {
|
|
81
|
+
display: none;
|
|
82
|
+
opacity: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.leading-ws {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
70
88
|
}
|
|
71
89
|
|
|
72
90
|
.stl-snippet-code-is-expanded {
|
|
@@ -74,116 +92,66 @@
|
|
|
74
92
|
display: none;
|
|
75
93
|
}
|
|
76
94
|
}
|
|
95
|
+
}
|
|
77
96
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/* Prevent clipping of the button with the container below */
|
|
83
|
-
z-index: 100;
|
|
97
|
+
.stldocs-root {
|
|
98
|
+
.stl-snippets-non-collapsible {
|
|
99
|
+
.shiki {
|
|
100
|
+
counter-reset: codeblock-line 0 !important;
|
|
84
101
|
}
|
|
85
102
|
|
|
86
|
-
.
|
|
103
|
+
.stldocs-snippet {
|
|
87
104
|
.hidden {
|
|
88
|
-
display:
|
|
89
|
-
opacity:
|
|
105
|
+
display: inline;
|
|
106
|
+
opacity: 1;
|
|
90
107
|
}
|
|
91
108
|
|
|
92
109
|
.leading-ws {
|
|
93
|
-
display:
|
|
110
|
+
display: inline;
|
|
94
111
|
}
|
|
95
|
-
}
|
|
96
112
|
|
|
97
|
-
.stl-snippet-code-is-expanded {
|
|
98
113
|
.ellipsis {
|
|
99
114
|
display: none;
|
|
100
115
|
}
|
|
101
116
|
}
|
|
102
117
|
}
|
|
118
|
+
}
|
|
103
119
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
opacity: 1;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.leading-ws {
|
|
117
|
-
display: inline;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.ellipsis {
|
|
121
|
-
display: none;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.stl-snippet-dropdown-button-text {
|
|
128
|
-
font-weight: 500;
|
|
129
|
-
font-style: normal;
|
|
130
|
-
font-family: var(--stldocs-font);
|
|
131
|
-
line-height: 100%;
|
|
132
|
-
font-size: var(--sl-text-body-sm);
|
|
133
|
-
color: var(--sl-color-text);
|
|
134
|
-
text-transform: capitalize;
|
|
135
|
-
|
|
136
|
-
&.http {
|
|
137
|
-
text-transform: uppercase;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
:root[data-theme='light'] {
|
|
142
|
-
.astro-code,
|
|
143
|
-
.astro-code span {
|
|
144
|
-
background-color: var(--sl-color-bg-inline-code) !important;
|
|
145
|
-
}
|
|
120
|
+
.stldocs-root .stl-snippet-dropdown-button-text,
|
|
121
|
+
.stl-snippet-dropdown-button-text {
|
|
122
|
+
font-weight: 500;
|
|
123
|
+
font-style: normal;
|
|
124
|
+
font-family: var(--stl-typography-font);
|
|
125
|
+
line-height: 100%;
|
|
126
|
+
font-size: var(--stl-typography-scale-sm);
|
|
127
|
+
color: var(--stl-color-foreground);
|
|
128
|
+
}
|
|
146
129
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
130
|
+
.shiki,
|
|
131
|
+
.astro-code,
|
|
132
|
+
.stldocs-snippet-response-pane {
|
|
133
|
+
background-color: var(--shiki-background, var(--stl-color-faint-background)) !important;
|
|
134
|
+
.shiki,
|
|
135
|
+
.astro-code,
|
|
136
|
+
.stldocs-snippet-response-pane {
|
|
137
|
+
background-color: transparent !important;
|
|
155
138
|
}
|
|
139
|
+
}
|
|
156
140
|
|
|
157
|
-
|
|
158
|
-
|
|
141
|
+
:root[data-theme='dark'] {
|
|
142
|
+
/*
|
|
159
143
|
Need to use important to override inline variables. This is the
|
|
160
144
|
recommended pattern in the shiki docs.
|
|
161
145
|
|
|
162
146
|
https://shiki.style/guide/dual-themes#query-based-dark-mode
|
|
163
147
|
*/
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.astro-code,
|
|
176
|
-
.astro-code span {
|
|
177
|
-
background-color: var(--sl-color-bg-inline-code) !important;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.stldocs-snippet-response-pane {
|
|
181
|
-
.shiki,
|
|
182
|
-
.shiki span,
|
|
183
|
-
.astro-code,
|
|
184
|
-
.astro-code span {
|
|
185
|
-
background-color: var(--sl-color-bg-inline-code) !important;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
148
|
+
.shiki,
|
|
149
|
+
.shiki span,
|
|
150
|
+
.astro-code,
|
|
151
|
+
.astro-code span {
|
|
152
|
+
color: var(--shiki-dark) !important;
|
|
153
|
+
font-style: var(--shiki-dark-font-style) !important;
|
|
154
|
+
font-weight: var(--shiki-dark-font-weight) !important;
|
|
155
|
+
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
188
156
|
}
|
|
189
157
|
}
|
package/styles/fonts.css
CHANGED
|
@@ -4,65 +4,80 @@
|
|
|
4
4
|
font-style: normal;
|
|
5
5
|
font-display: swap;
|
|
6
6
|
font-weight: 100 900;
|
|
7
|
-
src: url(../
|
|
8
|
-
unicode-range:
|
|
7
|
+
src: url(../assets/fonts/geist/geist-latin.woff2) format('woff2-variations');
|
|
8
|
+
unicode-range:
|
|
9
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
10
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
9
11
|
}
|
|
10
12
|
@font-face {
|
|
11
13
|
font-family: 'Geist';
|
|
12
14
|
font-style: italic;
|
|
13
15
|
font-display: swap;
|
|
14
16
|
font-weight: 100 900;
|
|
15
|
-
src: url(../
|
|
16
|
-
unicode-range:
|
|
17
|
+
src: url(../assets/fonts/geist/geist-italic-latin.woff2) format('woff2-variations');
|
|
18
|
+
unicode-range:
|
|
19
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
20
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
17
21
|
}
|
|
18
22
|
@font-face {
|
|
19
23
|
font-family: 'Geist';
|
|
20
24
|
font-style: normal;
|
|
21
25
|
font-display: swap;
|
|
22
26
|
font-weight: 100 900;
|
|
23
|
-
src: url(../
|
|
24
|
-
unicode-range:
|
|
27
|
+
src: url(../assets/fonts/geist/geist-latin-ext.woff2) format('woff2-variations');
|
|
28
|
+
unicode-range:
|
|
29
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
|
|
30
|
+
U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
25
31
|
}
|
|
26
32
|
@font-face {
|
|
27
33
|
font-family: 'Geist';
|
|
28
34
|
font-style: italic;
|
|
29
35
|
font-display: swap;
|
|
30
36
|
font-weight: 100 900;
|
|
31
|
-
src: url(../
|
|
32
|
-
unicode-range:
|
|
37
|
+
src: url(../assets/fonts/geist/geist-italic-latin-ext.woff2) format('woff2-variations');
|
|
38
|
+
unicode-range:
|
|
39
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
|
|
40
|
+
U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
33
41
|
}
|
|
34
42
|
|
|
35
|
-
|
|
36
43
|
/* Geist Mono */
|
|
37
44
|
@font-face {
|
|
38
45
|
font-family: 'Geist Mono';
|
|
39
46
|
font-style: normal;
|
|
40
47
|
font-display: swap;
|
|
41
48
|
font-weight: 100 900;
|
|
42
|
-
src: url(../
|
|
43
|
-
unicode-range:
|
|
49
|
+
src: url(../assets/fonts/geist/geist-mono-latin.woff2) format('woff2-variations');
|
|
50
|
+
unicode-range:
|
|
51
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
52
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
44
53
|
}
|
|
45
54
|
@font-face {
|
|
46
55
|
font-family: 'Geist Mono';
|
|
47
56
|
font-style: italic;
|
|
48
57
|
font-display: swap;
|
|
49
58
|
font-weight: 100 900;
|
|
50
|
-
src: url(../
|
|
51
|
-
unicode-range:
|
|
59
|
+
src: url(../assets/fonts/geist/geist-mono-italic-latin.woff2) format('woff2-variations');
|
|
60
|
+
unicode-range:
|
|
61
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
62
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
52
63
|
}
|
|
53
64
|
@font-face {
|
|
54
65
|
font-family: 'Geist Mono';
|
|
55
66
|
font-style: normal;
|
|
56
67
|
font-display: swap;
|
|
57
68
|
font-weight: 100 900;
|
|
58
|
-
src: url(../
|
|
59
|
-
unicode-range:
|
|
69
|
+
src: url(../assets/fonts/geist/geist-mono-latin-ext.woff2) format('woff2-variations');
|
|
70
|
+
unicode-range:
|
|
71
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
|
|
72
|
+
U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
60
73
|
}
|
|
61
74
|
@font-face {
|
|
62
75
|
font-family: 'Geist Mono';
|
|
63
76
|
font-style: italic;
|
|
64
77
|
font-display: swap;
|
|
65
78
|
font-weight: 100 900;
|
|
66
|
-
src: url(../
|
|
67
|
-
unicode-range:
|
|
79
|
+
src: url(../assets/fonts/geist/geist-mono-italic-latin-ext.woff2) format('woff2-variations');
|
|
80
|
+
unicode-range:
|
|
81
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
|
|
82
|
+
U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
68
83
|
}
|
package/styles/links.css
CHANGED
|
@@ -1,51 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
.sl-link-card {
|
|
3
|
-
box-shadow: none;
|
|
4
|
-
border-radius: var(--sl-button-border-radius);
|
|
5
|
-
padding: 1.5rem;
|
|
6
|
-
margin-top: 16px;
|
|
7
|
-
}
|
|
1
|
+
/* TODO: remove for real card component */
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.pagination-links {
|
|
16
|
-
margin-bottom: 2rem;
|
|
17
|
-
|
|
18
|
-
> a {
|
|
19
|
-
border-radius: var(--sl-button-border-radius);
|
|
20
|
-
border: 1px solid transparent;
|
|
21
|
-
box-shadow: none;
|
|
22
|
-
max-width: 90%;
|
|
23
|
-
text-decoration: none;
|
|
24
|
-
|
|
25
|
-
svg {
|
|
26
|
-
margin-top: 0;
|
|
27
|
-
transform: translateY(6px);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
> a:hover {
|
|
32
|
-
transition: 0.3s;
|
|
33
|
-
border: 1px solid var(--sl-color-accent-high);
|
|
34
|
-
background-color: var(--sl-color-accent-low);
|
|
35
|
-
box-shadow: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* if only one pagination direction */
|
|
39
|
-
> a:first-child:nth-last-child(1) {
|
|
40
|
-
max-width: 45%;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
> a[rel='next'] {
|
|
44
|
-
margin-left: auto;
|
|
45
|
-
}
|
|
3
|
+
.sl-link-card {
|
|
4
|
+
box-shadow: none;
|
|
5
|
+
border-radius: var(--sl-button-border-radius);
|
|
6
|
+
padding: 1.5rem;
|
|
7
|
+
margin-top: 16px;
|
|
8
|
+
}
|
|
46
9
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
10
|
+
.sl-link-card:hover {
|
|
11
|
+
transition: 0.3s;
|
|
12
|
+
border: 1px solid var(--sl-color-accent-high);
|
|
13
|
+
background-color: var(--sl-color-accent-low);
|
|
51
14
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.stldocs-root {
|
|
2
|
+
.stl-method-description-overflow-wrapper {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
/* Minimum height to minimize layout shift */
|
|
7
|
+
min-height: 24px;
|
|
8
|
+
}
|
|
9
|
+
.stl-method-description {
|
|
10
|
+
.stldocs-method-description {
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
max-height: 170px;
|
|
13
|
+
transition: max-height 0.3s ease;
|
|
14
|
+
position: relative;
|
|
15
|
+
|
|
16
|
+
&::after {
|
|
17
|
+
content: '';
|
|
18
|
+
position: absolute;
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
height: 3rem;
|
|
23
|
+
background: linear-gradient(to bottom, transparent, var(--stl-color-background));
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[data-collapsed='false'] {
|
|
28
|
+
max-height: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&[data-collapsed='false']::after {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|