@stainless-api/docs 0.1.0-beta.66 → 0.1.0-beta.67
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,15 @@
|
|
|
1
1
|
# @stainless-api/docs
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.67
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a59d5f7: Pass current page context through as “intent”
|
|
8
|
+
- Updated dependencies [e9567b0]
|
|
9
|
+
- @stainless-api/ui-primitives@0.1.0-beta.40
|
|
10
|
+
- @stainless-api/docs-ui@0.1.0-beta.53
|
|
11
|
+
- @stainless-api/docs-search@0.1.0-beta.5
|
|
12
|
+
|
|
3
13
|
## 0.1.0-beta.66
|
|
4
14
|
|
|
5
15
|
### 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.67",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"vite-plugin-prebundle-workers": "^0.2.0",
|
|
54
54
|
"web-worker": "^1.5.0",
|
|
55
55
|
"yaml": "^2.8.2",
|
|
56
|
-
"@stainless-api/docs-search": "0.1.0-beta.
|
|
57
|
-
"@stainless-api/docs-ui": "0.1.0-beta.
|
|
58
|
-
"@stainless-api/ui-primitives": "0.1.0-beta.
|
|
56
|
+
"@stainless-api/docs-search": "0.1.0-beta.5",
|
|
57
|
+
"@stainless-api/docs-ui": "0.1.0-beta.53",
|
|
58
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.40"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@astrojs/check": "^0.9.6",
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { DocsLanguage } from '@stainless-api/docs-ui/routing';
|
|
2
2
|
import AiChat, { STAINLESS_PROJECT } from 'virtual:stl-docs/components/AiChat.tsx';
|
|
3
3
|
|
|
4
|
-
export default function AiChatIsland({
|
|
4
|
+
export default function AiChatIsland({
|
|
5
|
+
currentLanguage,
|
|
6
|
+
siteTitle,
|
|
7
|
+
}: {
|
|
8
|
+
currentLanguage: DocsLanguage | undefined;
|
|
9
|
+
siteTitle: string | undefined;
|
|
10
|
+
}) {
|
|
5
11
|
if (!AiChat) throw new Error('AiChatIsland was rendered but could not load AiChat component');
|
|
6
12
|
if (!STAINLESS_PROJECT) return null;
|
|
7
|
-
return <AiChat projectId={STAINLESS_PROJECT} language={currentLanguage} />;
|
|
13
|
+
return <AiChat projectId={STAINLESS_PROJECT} language={currentLanguage} siteTitle={siteTitle} />;
|
|
8
14
|
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import Default from '@astrojs/starlight/components/PageFrame.astro';
|
|
3
3
|
import AiChat from 'virtual:stl-docs/components/AiChat.tsx'; // conditionally resolves to null if ai chat module is not injected
|
|
4
4
|
import AiChatIsland from './AiChatIsland.tsx'; // entrypoint for client island can’t be a virtual module
|
|
5
|
+
|
|
6
|
+
import starlightConfig from 'virtual:starlight/user-config';
|
|
7
|
+
const locale = Astro.currentLocale ?? starlightConfig.defaultLocale.lang;
|
|
8
|
+
const siteTitle = locale && starlightConfig.title[locale];
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
<Default>
|
|
@@ -10,5 +14,5 @@ import AiChatIsland from './AiChatIsland.tsx'; // entrypoint for client island c
|
|
|
10
14
|
|
|
11
15
|
<slot />
|
|
12
16
|
|
|
13
|
-
{!!AiChat && <AiChatIsland client:load currentLanguage={Astro.locals.language} />}
|
|
17
|
+
{!!AiChat && <AiChatIsland client:load currentLanguage={Astro.locals.language} siteTitle={siteTitle} />}
|
|
14
18
|
</Default>
|
package/virtual-module.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare module 'virtual:stl-docs/components/AiChat.tsx' {
|
|
|
56
56
|
| import('react').ComponentType<{
|
|
57
57
|
projectId: string;
|
|
58
58
|
language: import('@stainless-api/docs-ui/routing').DocsLanguage | undefined;
|
|
59
|
+
siteTitle: string | undefined;
|
|
59
60
|
}>
|
|
60
61
|
| null;
|
|
61
62
|
export default AiChatComponent;
|