@stainless-api/docs 0.1.0-beta.10 → 0.1.0-beta.100

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.
Files changed (145) hide show
  1. package/CHANGELOG.md +846 -0
  2. package/eslint-suppressions.json +27 -0
  3. package/locals.d.ts +17 -0
  4. package/package.json +49 -40
  5. package/playground-virtual-modules.d.ts +96 -0
  6. package/plugin/assets/languages/cli.svg +14 -0
  7. package/plugin/assets/languages/csharp.svg +1 -0
  8. package/plugin/assets/languages/php.svg +4 -0
  9. package/plugin/buildAlgoliaIndex.ts +40 -39
  10. package/plugin/components/MethodDescription.tsx +54 -0
  11. package/plugin/components/RequestBuilder/ParamEditor.tsx +55 -0
  12. package/plugin/components/RequestBuilder/SnippetStainlessIsland.tsx +107 -0
  13. package/plugin/components/RequestBuilder/index.tsx +37 -0
  14. package/plugin/components/RequestBuilder/props.ts +9 -0
  15. package/plugin/components/RequestBuilder/spec-helpers.ts +47 -0
  16. package/plugin/components/RequestBuilder/styles.css +67 -0
  17. package/plugin/components/SDKSelect.astro +18 -105
  18. package/plugin/components/SnippetCode.tsx +111 -66
  19. package/plugin/components/StainlessIslands.tsx +126 -0
  20. package/plugin/components/search/SearchAlgolia.astro +45 -28
  21. package/plugin/components/search/SearchIsland.tsx +47 -29
  22. package/plugin/generateAPIReferenceLink.ts +2 -2
  23. package/plugin/globalJs/ai-dropdown-options.ts +243 -0
  24. package/plugin/globalJs/code-snippets.ts +40 -11
  25. package/plugin/globalJs/copy.ts +95 -17
  26. package/plugin/globalJs/create-playground.shim.ts +3 -0
  27. package/plugin/globalJs/method-descriptions.ts +33 -0
  28. package/plugin/globalJs/navigation.ts +12 -32
  29. package/plugin/globalJs/playground-data.shim.ts +1 -0
  30. package/plugin/globalJs/playground-data.ts +14 -0
  31. package/plugin/helpers/generateDocsRoutes.ts +59 -0
  32. package/plugin/helpers/multiSpec.ts +8 -0
  33. package/plugin/index.ts +299 -118
  34. package/plugin/languages.ts +8 -2
  35. package/plugin/loadPluginConfig.ts +251 -107
  36. package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +1 -1
  37. package/plugin/react/Routing.tsx +210 -141
  38. package/plugin/referencePlaceholderUtils.ts +18 -15
  39. package/plugin/replaceSidebarPlaceholderMiddleware.ts +38 -34
  40. package/plugin/routes/Docs.astro +70 -119
  41. package/plugin/routes/DocsStatic.astro +6 -5
  42. package/plugin/routes/Overview.astro +37 -27
  43. package/plugin/routes/markdown.ts +13 -12
  44. package/plugin/{cms → sidebar-utils}/sidebar-builder.ts +49 -60
  45. package/plugin/specs/FileCache.ts +99 -0
  46. package/plugin/specs/fetchSpecSSR.ts +27 -0
  47. package/plugin/specs/generateSpec.ts +112 -0
  48. package/plugin/specs/index.ts +132 -0
  49. package/plugin/specs/inputResolver.ts +146 -0
  50. package/plugin/{cms → specs}/worker.ts +82 -5
  51. package/plugin/vendor/preview.worker.docs.js +22406 -17955
  52. package/plugin/vendor/templates/cli.md +1 -0
  53. package/plugin/vendor/templates/go.md +4 -2
  54. package/plugin/vendor/templates/java.md +3 -1
  55. package/plugin/vendor/templates/kotlin.md +3 -1
  56. package/plugin/vendor/templates/node.md +4 -2
  57. package/plugin/vendor/templates/python.md +4 -2
  58. package/plugin/vendor/templates/ruby.md +4 -2
  59. package/plugin/vendor/templates/terraform.md +1 -1
  60. package/plugin/vendor/templates/typescript.md +3 -1
  61. package/resolveSrcFile.ts +10 -0
  62. package/scripts/vendor_deps.ts +5 -5
  63. package/shared/getProsePages.ts +42 -0
  64. package/shared/getSharedLogger.ts +15 -0
  65. package/shared/terminalUtils.ts +3 -0
  66. package/shared/virtualModule.ts +54 -1
  67. package/src/content.config.ts +9 -0
  68. package/stl-docs/components/AIDropdown.tsx +63 -0
  69. package/stl-docs/components/AiChatIsland.tsx +14 -0
  70. package/stl-docs/components/{content-panel/ContentBreadcrumbs.tsx → ContentBreadcrumbs.tsx} +2 -2
  71. package/stl-docs/components/Head.astro +20 -0
  72. package/stl-docs/components/Header.astro +6 -8
  73. package/stl-docs/components/PageFrame.astro +18 -0
  74. package/stl-docs/components/PageTitle.astro +82 -0
  75. package/stl-docs/components/TableOfContents.astro +34 -0
  76. package/stl-docs/components/ThemeProvider.astro +36 -0
  77. package/stl-docs/components/ThemeSelect.astro +84 -139
  78. package/stl-docs/components/content-panel/ContentPanel.astro +16 -46
  79. package/stl-docs/components/headers/SplashMobileMenuToggle.astro +17 -1
  80. package/stl-docs/components/headers/StackedHeader.astro +29 -24
  81. package/stl-docs/components/icons/chat-gpt.tsx +2 -2
  82. package/stl-docs/components/icons/cursor.tsx +10 -0
  83. package/stl-docs/components/icons/gemini.tsx +19 -0
  84. package/stl-docs/components/icons/markdown.tsx +1 -1
  85. package/stl-docs/components/index.ts +1 -0
  86. package/stl-docs/components/mintlify-compat/Accordion.astro +5 -3
  87. package/stl-docs/components/mintlify-compat/AccordionGroup.astro +3 -3
  88. package/stl-docs/components/mintlify-compat/Columns.astro +40 -42
  89. package/stl-docs/components/mintlify-compat/Frame.astro +16 -18
  90. package/stl-docs/components/mintlify-compat/card.css +33 -35
  91. package/stl-docs/components/mintlify-compat/index.ts +2 -4
  92. package/stl-docs/components/nav-tabs/NavDropdown.astro +31 -70
  93. package/stl-docs/components/nav-tabs/NavTabs.astro +78 -80
  94. package/stl-docs/components/nav-tabs/SecondaryNavTabs.astro +15 -8
  95. package/stl-docs/components/nav-tabs/buildNavLinks.ts +3 -2
  96. package/stl-docs/components/pagination/HomeLink.astro +10 -0
  97. package/stl-docs/components/pagination/Pagination.astro +175 -0
  98. package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +22 -0
  99. package/stl-docs/components/pagination/PaginationLinkQuiet.astro +13 -0
  100. package/stl-docs/components/pagination/util.ts +71 -0
  101. package/stl-docs/components/scripts.ts +1 -0
  102. package/stl-docs/components/sidebars/BaseSidebar.astro +79 -2
  103. package/stl-docs/components/sidebars/SidebarWithComponents.tsx +10 -0
  104. package/stl-docs/components/sidebars/convertAstroSidebarToStl.tsx +62 -0
  105. package/stl-docs/disableCalloutSyntax.ts +36 -0
  106. package/stl-docs/fonts.ts +186 -0
  107. package/stl-docs/index.ts +154 -51
  108. package/stl-docs/loadStlDocsConfig.ts +58 -8
  109. package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +61 -0
  110. package/stl-docs/proseMarkdown/proseMarkdownMiddleware.ts +41 -0
  111. package/stl-docs/proseMarkdown/toMarkdown.ts +158 -0
  112. package/stl-docs/proseSearchIndexing.ts +606 -0
  113. package/stl-docs/tabsMiddleware.ts +13 -4
  114. package/styles/code.css +133 -136
  115. package/styles/links.css +11 -48
  116. package/styles/method-descriptions.css +36 -0
  117. package/styles/overrides.css +49 -57
  118. package/styles/page.css +100 -59
  119. package/styles/sdk_select.css +9 -7
  120. package/styles/search.css +57 -69
  121. package/styles/sidebar.css +26 -156
  122. package/styles/{variables.css → sl-variables.css} +3 -2
  123. package/styles/stldocs-variables.css +6 -0
  124. package/styles/toc.css +41 -34
  125. package/theme.css +11 -11
  126. package/tsconfig.json +2 -5
  127. package/virtual-module.d.ts +64 -8
  128. package/components/variables.css +0 -135
  129. package/plugin/cms/client.ts +0 -62
  130. package/plugin/cms/server.ts +0 -268
  131. package/plugin/globalJs/ai-dropdown.ts +0 -57
  132. package/stl-docs/components/APIReferenceAIDropdown.tsx +0 -58
  133. package/stl-docs/components/content-panel/ProseAIDropdown.tsx +0 -55
  134. package/stl-docs/components/mintlify-compat/Step.astro +0 -58
  135. package/stl-docs/components/mintlify-compat/Steps.astro +0 -17
  136. package/styles/fonts.css +0 -68
  137. /package/{plugin/assets → assets}/fonts/geist/OFL.txt +0 -0
  138. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin-ext.woff2 +0 -0
  139. /package/{plugin/assets → assets}/fonts/geist/geist-italic-latin.woff2 +0 -0
  140. /package/{plugin/assets → assets}/fonts/geist/geist-latin-ext.woff2 +0 -0
  141. /package/{plugin/assets → assets}/fonts/geist/geist-latin.woff2 +0 -0
  142. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin-ext.woff2 +0 -0
  143. /package/{plugin/assets → assets}/fonts/geist/geist-mono-italic-latin.woff2 +0 -0
  144. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin-ext.woff2 +0 -0
  145. /package/{plugin/assets → assets}/fonts/geist/geist-mono-latin.woff2 +0 -0
@@ -1,58 +0,0 @@
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
-
7
- export function AIDropdownOptions() {
8
- return (
9
- <>
10
- <DropdownButton.MenuItem value="claude" isExternalLink>
11
- <DropdownButton.MenuItemIcon>
12
- <ClaudeIcon />
13
- </DropdownButton.MenuItemIcon>
14
- <DropdownButton.MenuItemText subtle>
15
- Open in
16
- <strong> Claude</strong>
17
- </DropdownButton.MenuItemText>
18
- </DropdownButton.MenuItem>
19
- <DropdownButton.MenuItem value="chat-gpt" isExternalLink>
20
- <DropdownButton.MenuItemIcon>
21
- <ChatGPTIcon />
22
- </DropdownButton.MenuItemIcon>
23
- <DropdownButton.MenuItemText subtle>
24
- Open in
25
- <strong> ChatGPT</strong>
26
- </DropdownButton.MenuItemText>
27
- </DropdownButton.MenuItem>
28
- </>
29
- );
30
- }
31
-
32
- export function APIReferenceAIDropdown() {
33
- return (
34
- <DropdownButton id="ai-dropdown-button">
35
- <DropdownButton.PrimaryAction>
36
- <CopyIcon size={16} />
37
- <DropdownButton.PrimaryActionText>Copy Markdown</DropdownButton.PrimaryActionText>
38
- </DropdownButton.PrimaryAction>
39
- <DropdownButton.Trigger />
40
- <DropdownButton.Menu>
41
- <AIDropdownOptions />
42
- <hr />
43
- <DropdownButton.MenuItem value="copy-as-markdown" isExternalLink>
44
- <DropdownButton.MenuItemIcon>
45
- <CopyIcon size={16} />
46
- </DropdownButton.MenuItemIcon>
47
- <DropdownButton.MenuItemText>Copy Markdown</DropdownButton.MenuItemText>
48
- </DropdownButton.MenuItem>
49
- <DropdownButton.MenuItem value="view-as-markdown" isExternalLink>
50
- <DropdownButton.MenuItemIcon>
51
- <MarkdownIcon />
52
- </DropdownButton.MenuItemIcon>
53
- <DropdownButton.MenuItemText>View as Markdown</DropdownButton.MenuItemText>
54
- </DropdownButton.MenuItem>
55
- </DropdownButton.Menu>
56
- </DropdownButton>
57
- );
58
- }
@@ -1,55 +0,0 @@
1
- import { DropdownButton } from '@stainless-api/ui-primitives';
2
- import { AIDropdownOptions } from '../APIReferenceAIDropdown';
3
- import type { StarlightRouteData } from '@astrojs/starlight/route-data';
4
- import { ClaudeIcon } from '../icons/claude';
5
-
6
- const sidebarHasEntry = (sidebarEntry: StarlightRouteData['sidebar'], currentPath?: string) => {
7
- if (!currentPath) return false;
8
- const normalizePath = (path: string) => {
9
- return path.endsWith('/') ? path : path + '/';
10
- };
11
-
12
- const normalizedCurrent = normalizePath(currentPath);
13
-
14
- for (const entry of sidebarEntry) {
15
- if (entry.type === 'link') {
16
- const normalizedHref = normalizePath(entry.href);
17
- if (normalizedHref === normalizedCurrent) {
18
- return true;
19
- }
20
- } else if (entry.type === 'group') {
21
- const hasInGroup = sidebarHasEntry(entry.entries, currentPath);
22
- if (hasInGroup) return true;
23
- }
24
- }
25
-
26
- return false;
27
- };
28
-
29
- export function ProseAIDropdown({
30
- currentPath,
31
- sidebarEntry,
32
- }: {
33
- currentPath: string;
34
- sidebarEntry: StarlightRouteData['sidebar'];
35
- }) {
36
- // Hide if there is no associated sidebar entry. This applies to pages like the 404 page.
37
- const hasEntry = sidebarHasEntry(sidebarEntry, currentPath);
38
-
39
- if (!hasEntry) {
40
- return null;
41
- }
42
-
43
- return (
44
- <DropdownButton id="prose-ai-dropdown-button">
45
- <DropdownButton.PrimaryAction>
46
- <ClaudeIcon />
47
- Open in Claude
48
- </DropdownButton.PrimaryAction>
49
- <DropdownButton.Trigger />
50
- <DropdownButton.Menu>
51
- <AIDropdownOptions />
52
- </DropdownButton.Menu>
53
- </DropdownButton>
54
- );
55
- }
@@ -1,58 +0,0 @@
1
- ---
2
- export interface Props {
3
- title?: string;
4
- }
5
-
6
- const { title } = Astro.props;
7
- ---
8
-
9
- <li class="stl-ui-mintlify-compat-step" data-stl-ui-element>
10
- <div class="stl-ui-mintlify-compat-step-step-number"></div>
11
- <div>
12
- <p class="stl-ui-mintlify-compat-step-title">{title}</p>
13
- <div class="stl-ui-mintlify-compat-step-content"><slot /></div>
14
- </div>
15
- </li>
16
-
17
- <style>
18
- @layer stl-ui-mintlify-compat {
19
- .stl-ui-mintlify-compat-step {
20
- display: flex;
21
-
22
- &:not(:first-child) {
23
- margin-top: 1rem;
24
- }
25
- }
26
-
27
- .stl-ui-mintlify-compat-step-step-number {
28
- margin-right: 1rem;
29
- display: flex;
30
- align-items: top;
31
- justify-content: center;
32
- margin-top: 4px;
33
-
34
- &::before {
35
- counter-increment: ui-steps;
36
- content: counter(ui-steps);
37
- border-radius: 50%;
38
- height: 1.5rem;
39
- width: 1.5rem;
40
- font-size: 0.8rem;
41
- color: var(--sl-color-text);
42
- font-weight: 600;
43
- background-color: var(--sl-color-gray-5);
44
- display: flex;
45
- align-items: center;
46
- justify-content: center;
47
- }
48
- }
49
-
50
- .stl-ui-mintlify-compat-step-title {
51
- font-weight: 600;
52
- color: var(--sl-color-text);
53
- }
54
- .stl-ui-mintlify-compat-step-content {
55
- margin-top: 0.5rem;
56
- }
57
- }
58
- </style>
@@ -1,17 +0,0 @@
1
- <ol class="stl-ui-mintlify-compat-steps"><slot /></ol>
2
-
3
- <style>
4
- @layer stl-ui-mintlify-compat {
5
- .stl-ui-mintlify-compat-steps {
6
- counter-reset: ui-steps;
7
- list-style: none;
8
- margin: 0;
9
- padding: 0;
10
- margin-top: 1rem;
11
-
12
- * {
13
- margin: 0;
14
- }
15
- }
16
- }
17
- </style>
package/styles/fonts.css DELETED
@@ -1,68 +0,0 @@
1
- /* Geist */
2
- @font-face {
3
- font-family: 'Geist';
4
- font-style: normal;
5
- font-display: swap;
6
- font-weight: 100 900;
7
- src: url(../plugin/assets/fonts/geist/geist-latin.woff2) format('woff2-variations');
8
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
9
- }
10
- @font-face {
11
- font-family: 'Geist';
12
- font-style: italic;
13
- font-display: swap;
14
- font-weight: 100 900;
15
- src: url(../plugin/assets/fonts/geist/geist-italic-latin.woff2) format('woff2-variations');
16
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
17
- }
18
- @font-face {
19
- font-family: 'Geist';
20
- font-style: normal;
21
- font-display: swap;
22
- font-weight: 100 900;
23
- src: url(../plugin/assets/fonts/geist/geist-latin-ext.woff2) format('woff2-variations');
24
- unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
25
- }
26
- @font-face {
27
- font-family: 'Geist';
28
- font-style: italic;
29
- font-display: swap;
30
- font-weight: 100 900;
31
- src: url(../plugin/assets/fonts/geist/geist-italic-latin-ext.woff2) format('woff2-variations');
32
- unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
33
- }
34
-
35
-
36
- /* Geist Mono */
37
- @font-face {
38
- font-family: 'Geist Mono';
39
- font-style: normal;
40
- font-display: swap;
41
- font-weight: 100 900;
42
- src: url(../plugin/assets/fonts/geist/geist-mono-latin.woff2) format('woff2-variations');
43
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
44
- }
45
- @font-face {
46
- font-family: 'Geist Mono';
47
- font-style: italic;
48
- font-display: swap;
49
- font-weight: 100 900;
50
- src: url(../plugin/assets/fonts/geist/geist-mono-italic-latin.woff2) format('woff2-variations');
51
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
52
- }
53
- @font-face {
54
- font-family: 'Geist Mono';
55
- font-style: normal;
56
- font-display: swap;
57
- font-weight: 100 900;
58
- src: url(../plugin/assets/fonts/geist/geist-mono-latin-ext.woff2) format('woff2-variations');
59
- unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
60
- }
61
- @font-face {
62
- font-family: 'Geist Mono';
63
- font-style: italic;
64
- font-display: swap;
65
- font-weight: 100 900;
66
- src: url(../plugin/assets/fonts/geist/geist-mono-italic-latin-ext.woff2) format('woff2-variations');
67
- unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
68
- }
File without changes