@stainless-api/docs 0.1.0-beta.136 → 0.1.0-beta.138

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.138
4
+
5
+ ### Patch Changes
6
+
7
+ - bb5f952: Stop loading AI chat examples from obsolete Stainless endpoint
8
+ - 25d7a11: Stop creating Algolia prose indexes during docs site builds. Vector-based prose indexing is unaffected and remains controlled by the `experimental.disableStainlessProseIndexing` flag.
9
+ - Updated dependencies [25d7a11]
10
+ - @stainless-api/docs-search@0.1.0-beta.49
11
+
12
+ ## 0.1.0-beta.137
13
+
14
+ ### Minor Changes
15
+
16
+ - ce2dd81: Add interface for customizing ai-chat behaviour
17
+
18
+ ### Patch Changes
19
+
20
+ - 5f0fdda: Vendor dependencies for Stainless Config change
21
+ - 680889d: feat: support disabling third-party context menu options
22
+
3
23
  ## 0.1.0-beta.136
4
24
 
5
25
  ### Minor Changes
@@ -64,10 +64,5 @@
64
64
  "@typescript-eslint/restrict-template-expressions": {
65
65
  "count": 4
66
66
  }
67
- },
68
- "stl-docs/proseSearchIndexing.ts": {
69
- "@typescript-eslint/restrict-template-expressions": {
70
- "count": 1
71
- }
72
67
  }
73
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/docs",
3
- "version": "0.1.0-beta.136",
3
+ "version": "0.1.0-beta.138",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -28,7 +28,8 @@
28
28
  "./components/Pagination": "./stl-docs/components/pagination/Pagination.astro",
29
29
  "./og-image/components/OpenGraphImage": "./stl-docs/og-image/components/OpenGraphImage.tsx",
30
30
  "./og-image/components/OpenGraphFunctionSignature": "./stl-docs/og-image/components/OpenGraphFunctionSignature.tsx",
31
- "./schema-extension": "./stl-docs/schema-extension.ts"
31
+ "./schema-extension": "./stl-docs/schema-extension.ts",
32
+ "./chat": "./stl-docs/chat/docs-chat-handler.ts"
32
33
  },
33
34
  "keywords": [],
34
35
  "author": "",
@@ -50,15 +51,14 @@
50
51
  }
51
52
  },
52
53
  "dependencies": {
53
- "@astrojs/markdown-remark": "^7.1.0",
54
- "@astrojs/react": "^5.0.3",
54
+ "@astrojs/markdown-remark": "^7.1.1",
55
+ "@astrojs/react": "^5.0.4",
55
56
  "@markdoc/markdoc": "^0.5.7",
56
57
  "@stainless-api/sdk": "0.5.0",
57
- "@streamparser/json-whatwg": "^0.0.22",
58
58
  "cheerio": "^1.2.0",
59
59
  "clsx": "^2.1.1",
60
60
  "dotenv": "17.4.2",
61
- "lucide-react": "^1.8.0",
61
+ "lucide-react": "^1.14.0",
62
62
  "motion": "^12.38.0",
63
63
  "node-html-parser": "^7.1.0",
64
64
  "rehype-parse": "^9.0.1",
@@ -72,24 +72,24 @@
72
72
  "shiki": "^4.0.2",
73
73
  "unified": "^11.0.5",
74
74
  "web-worker": "^1.5.0",
75
- "@stainless-api/docs-search": "0.1.0-beta.48",
75
+ "@stainless-api/docs-search": "0.1.0-beta.49",
76
76
  "@stainless-api/docs-ui": "0.1.0-beta.95",
77
77
  "@stainless-api/ui-primitives": "0.1.0-beta.53"
78
78
  },
79
79
  "devDependencies": {
80
- "@astrojs/check": "^0.9.8",
81
- "takumi-js": "^1.0.11",
80
+ "@astrojs/check": "^0.9.9",
81
+ "takumi-js": "^1.1.2",
82
82
  "@types/node": "24.12.2",
83
83
  "@types/react": "19.2.14",
84
84
  "@types/react-dom": "^19.2.3",
85
85
  "@types/react-syntax-highlighter": "^15.5.13",
86
- "astro": "^6.1.7",
86
+ "astro": "^6.2.2",
87
87
  "react": "^19.2.5",
88
88
  "react-dom": "^19.2.5",
89
- "typescript": "6.0.2",
89
+ "typescript": "6.0.3",
90
90
  "vite": "^7.3.2",
91
- "vitest": "^4.1.4",
92
- "zod": "^4.3.6",
91
+ "vitest": "^4.1.5",
92
+ "zod": "^4.4.3",
93
93
  "@stainless/eslint-config": "0.1.0-beta.2",
94
94
  "@stainless/sdk-json": "^0.1.0-beta.10"
95
95
  },
@@ -16,8 +16,6 @@ export function RequestBuilder({
16
16
  }) {
17
17
  let params: Param[];
18
18
  const spec = useSpec();
19
- // https://github.com/Rel1cx/eslint-react/issues/1617
20
- /* eslint-disable @eslint-react/error-boundaries */
21
19
  try {
22
20
  if (!spec) throw new Error('Spec is required for RequestBuilder');
23
21
  params = spec && extractParams(spec, method);
@@ -25,7 +23,6 @@ export function RequestBuilder({
25
23
  console.warn(e);
26
24
  return <div className={className}>{children}</div>;
27
25
  }
28
- /* eslint-enable */
29
26
  const [httpMethod, path] = method.endpoint.split(' ') as [string, string];
30
27
 
31
28
  return (
@@ -1,5 +1,6 @@
1
1
  import { initDropdownButton } from '@stainless-api/ui-primitives/scripts';
2
2
  import { getPageLoadEvent } from '../helpers/getPageLoadEvent';
3
+ import { CONTEXT_MENU_ENABLE_THIRD_PARTY } from 'virtual:stl-docs-virtual-module';
3
4
 
4
5
  export type DropdownIcon = 'markdown' | 'copy' | 'claude' | 'chatgpt' | 'gemini' | 'cursor';
5
6
 
@@ -9,6 +10,7 @@ interface DropdownOptionInputProps {
9
10
  primaryAction?: boolean;
10
11
  clientHidden?: () => boolean;
11
12
  external: boolean;
13
+ thirdParty?: boolean;
12
14
  }
13
15
 
14
16
  function option(label: string[] | string, props: DropdownOptionInputProps) {
@@ -101,6 +103,7 @@ const aiDropdownOptions: DropdownOption[][] = [
101
103
  icon: 'claude',
102
104
  primaryAction: false,
103
105
  external: true,
106
+ thirdParty: true,
104
107
  }),
105
108
  option(['Open in ', 'ChatGPT'], {
106
109
  onClick: () => {
@@ -109,6 +112,7 @@ const aiDropdownOptions: DropdownOption[][] = [
109
112
  icon: 'chatgpt',
110
113
  primaryAction: false,
111
114
  external: true,
115
+ thirdParty: true,
112
116
  }),
113
117
  option(['Open in ', 'Cursor'], {
114
118
  onClick: () => {
@@ -122,6 +126,7 @@ const aiDropdownOptions: DropdownOption[][] = [
122
126
  icon: 'cursor',
123
127
  primaryAction: false,
124
128
  external: true,
129
+ thirdParty: true,
125
130
  }),
126
131
  ],
127
132
  [
@@ -184,13 +189,16 @@ const aiDropdownOptions: DropdownOption[][] = [
184
189
  // },
185
190
 
186
191
  export function getAIDropdownOptions() {
187
- const renderedOptions = aiDropdownOptions.map((group, index) => {
188
- return {
189
- options: group,
190
- isLast: index === aiDropdownOptions.length - 1,
191
- reactKey: index,
192
- };
193
- });
192
+ const renderedOptions = aiDropdownOptions
193
+ .map((e) => e.filter((e) => CONTEXT_MENU_ENABLE_THIRD_PARTY || !e.thirdParty))
194
+ .filter((e) => e.length)
195
+ .map((group, index, array) => {
196
+ return {
197
+ options: group,
198
+ isLast: index === array.length - 1,
199
+ reactKey: index,
200
+ };
201
+ });
194
202
 
195
203
  const allOptions = renderedOptions.flatMap((group) => group.options);
196
204
  const primaryAction = allOptions.find((o) => o.primaryAction) ?? allOptions[0]!;
package/plugin/index.ts CHANGED
@@ -240,7 +240,11 @@ function stlStarlightAstroIntegration(pluginConfig: NormalizedStainlessStarlight
240
240
  EXPERIMENTAL_COLLAPSIBLE_METHOD_DESCRIPTIONS:
241
241
  pluginConfig.experimentalCollapsibleMethodDescriptions,
242
242
  PROPERTY_SETTINGS: pluginConfig.propertySettings,
243
- ENABLE_CONTEXT_MENU: pluginConfig.contextMenu,
243
+ ENABLE_CONTEXT_MENU: !!pluginConfig.contextMenu,
244
+ CONTEXT_MENU_ENABLE_THIRD_PARTY:
245
+ (typeof pluginConfig.contextMenu === 'object'
246
+ ? pluginConfig.contextMenu.thirdParty
247
+ : null) ?? true,
244
248
  EXPERIMENTAL_REQUEST_BUILDER: pluginConfig.experimentalRequestBuilder,
245
249
  STAINLESS_PROJECT: pluginConfig.stainlessProject,
246
250
  LLMS_TXT_DESCRIPTION: pluginConfig.llmsTxt.description,
@@ -149,7 +149,7 @@ export type StainlessStarlightUserConfig = {
149
149
  * @default true
150
150
  */
151
151
 
152
- contextMenu?: boolean;
152
+ contextMenu?: boolean | { thirdParty?: boolean };
153
153
 
154
154
  /** When set to true, enables the experimental request builder interface for testing API endpoints. */
155
155
  experimentalRequestBuilder?: boolean;
@@ -106,6 +106,4 @@ export const specCache = new FileCache({
106
106
 
107
107
  export type SpecCacheResult = Awaited<ReturnType<typeof specCache.get>>;
108
108
 
109
- export type GenerateSpecFn = typeof generateSpecFromStrings;
110
-
111
- export type SpecWithAuth = Awaited<ReturnType<GenerateSpecFn>>;
109
+ export type SpecWithAuth = Awaited<ReturnType<typeof generateSpecFromStrings>>;