@stainless-api/docs 0.1.0-beta.20 → 0.1.0-beta.22
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 +13 -0
- package/package.json +3 -3
- package/plugin/index.ts +1 -2
- package/plugin/loadPluginConfig.ts +8 -0
- package/stl-docs/components/PageTitle.astro +1 -2
- package/stl-docs/index.ts +3 -2
- package/virtual-module.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @stainless-api/docs
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [f7ba067]
|
|
8
|
+
- @stainless-api/docs-ui@0.1.0-beta.17
|
|
9
|
+
|
|
10
|
+
## 0.1.0-beta.21
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 41e87cb: fix virtual module imports
|
|
15
|
+
|
|
3
16
|
## 0.1.0-beta.20
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.22",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"remark-gfm": "^4.0.1",
|
|
51
51
|
"remark-stringify": "^11.0.0",
|
|
52
52
|
"unified": "^11.0.5",
|
|
53
|
-
"@stainless-api/ui
|
|
54
|
-
"@stainless-api/
|
|
53
|
+
"@stainless-api/docs-ui": "0.1.0-beta.17",
|
|
54
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.16"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@astrojs/check": "^0.9.5",
|
package/plugin/index.ts
CHANGED
|
@@ -225,8 +225,7 @@ async function stlStarlightAstroIntegration(
|
|
|
225
225
|
EXPERIMENTAL_COLLAPSIBLE_SNIPPETS: pluginConfig.experimentalCollapsibleSnippets,
|
|
226
226
|
PROPERTY_SETTINGS: pluginConfig.propertySettings,
|
|
227
227
|
SEARCH: pluginConfig.search,
|
|
228
|
-
|
|
229
|
-
ENABLE_CONTEXT_MENU: pluginConfig._contextMenu,
|
|
228
|
+
ENABLE_CONTEXT_MENU: pluginConfig.contextMenu,
|
|
230
229
|
}),
|
|
231
230
|
vmMiddlewareExport,
|
|
232
231
|
].join('\n');
|
|
@@ -128,6 +128,13 @@ export type StainlessStarlightUserConfig = {
|
|
|
128
128
|
* Default: `false`
|
|
129
129
|
*/
|
|
130
130
|
experimentalCollapsibleSnippets?: boolean;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Whether to show the context menu with options like "Copy as Markdown" and "Open in ChatGPT".
|
|
134
|
+
*
|
|
135
|
+
* Default: `true`
|
|
136
|
+
*/
|
|
137
|
+
contextMenu?: boolean;
|
|
131
138
|
};
|
|
132
139
|
|
|
133
140
|
export type ExternalSpecServerUserConfig = Omit<StainlessStarlightUserConfig, 'stainlessProject'> & {
|
|
@@ -262,6 +269,7 @@ function normalizeConfig(partial: SomeStainlessStarlightUserConfig, command: Ast
|
|
|
262
269
|
search: {
|
|
263
270
|
enableAISearch: partial.search?.enableAISearch ?? false,
|
|
264
271
|
},
|
|
272
|
+
contextMenu: partial.contextMenu ?? true,
|
|
265
273
|
};
|
|
266
274
|
|
|
267
275
|
function getSpecRetrieverConfig(): SpecRetrieverConfig {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { ENABLE_PROSE_MARKDOWN_RENDERING } from 'virtual:stl-docs-virtual-module';
|
|
2
|
+
import { ENABLE_PROSE_MARKDOWN_RENDERING, ENABLE_CONTEXT_MENU } from 'virtual:stl-docs-virtual-module';
|
|
3
3
|
import type { StarlightRouteData } from '@astrojs/starlight/route-data';
|
|
4
4
|
import Default from '@astrojs/starlight/components/PageTitle.astro';
|
|
5
5
|
import { ContentBreadcrumbs } from './ContentBreadcrumbs';
|
|
6
6
|
import { AIDropdown } from './AIDropdown';
|
|
7
|
-
import { ENABLE_CONTEXT_MENU } from 'virtual:stl-starlight-virtual-module';
|
|
8
7
|
|
|
9
8
|
function sidebarHasEntry(sidebarEntry: StarlightRouteData['sidebar'], currentPath?: string) {
|
|
10
9
|
if (!currentPath) return false;
|
package/stl-docs/index.ts
CHANGED
|
@@ -66,8 +66,7 @@ function stainlessDocsStarlightIntegration(config: NormalizedStainlessDocsConfig
|
|
|
66
66
|
plugins.push(
|
|
67
67
|
stainlessStarlight({
|
|
68
68
|
...config.apiReference,
|
|
69
|
-
|
|
70
|
-
_contextMenu: config.contextMenu,
|
|
69
|
+
contextMenu: config.contextMenu,
|
|
71
70
|
}),
|
|
72
71
|
);
|
|
73
72
|
componentOverrides.Sidebar = resolveSrcFile(COMPONENTS_FOLDER, './sidebars/SDKSelectSidebar.astro');
|
|
@@ -172,6 +171,8 @@ function stainlessDocsIntegration(
|
|
|
172
171
|
ENABLE_CLIENT_ROUTER: config.enableClientRouter,
|
|
173
172
|
API_REFERENCE_BASE_PATH: apiReferenceBasePath,
|
|
174
173
|
ENABLE_PROSE_MARKDOWN_RENDERING: config.enableProseMarkdownRendering,
|
|
174
|
+
// TODO: do not duplicate this between both virtual modules
|
|
175
|
+
ENABLE_CONTEXT_MENU: config.contextMenu,
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
},
|
package/virtual-module.d.ts
CHANGED