@stainless-api/docs-ai-chat 0.1.0-beta.46 → 0.1.0-beta.47
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 +12 -0
- package/package.json +2 -2
- package/src/DocsChat.tsx +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @stainless-api/docs-ai-chat
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.47
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a8ed299: Adds the ability for AI chat to move into a sidebar “panel” position.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [5b3b798]
|
|
12
|
+
- Updated dependencies [a8ed299]
|
|
13
|
+
- @stainless-api/ai-chat@0.1.0-beta.9
|
|
14
|
+
|
|
3
15
|
## 0.1.0-beta.46
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-ai-chat",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.47",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@streamparser/json-whatwg": "^0.0.22",
|
|
15
15
|
"zod": "^4.3.6",
|
|
16
|
-
"@stainless-api/ai-chat": "0.1.0-beta.
|
|
16
|
+
"@stainless-api/ai-chat": "0.1.0-beta.9"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/react": "19.2.14",
|
package/src/DocsChat.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AiChat from '@stainless-api/ai-chat/src/AiChat.tsx';
|
|
2
2
|
import type { DocsLanguage } from '@stainless-api/docs-ui/routing';
|
|
3
3
|
import { setResponseMetadata, submitResponseFeedback } from './api';
|
|
4
|
+
import { useSyncExternalStore } from 'react';
|
|
4
5
|
import { useChat } from './hook';
|
|
5
6
|
|
|
6
7
|
function onCopyMessage(spanId: string) {
|
|
@@ -31,12 +32,23 @@ export default function DocsChat({
|
|
|
31
32
|
siteTitle,
|
|
32
33
|
});
|
|
33
34
|
|
|
35
|
+
// panel mode is supported only on larger viewports
|
|
36
|
+
const supportsPanel = useSyncExternalStore(
|
|
37
|
+
(cb) => {
|
|
38
|
+
window.addEventListener('resize', cb);
|
|
39
|
+
return () => window.removeEventListener('resize', cb);
|
|
40
|
+
},
|
|
41
|
+
() => window.innerWidth >= 968,
|
|
42
|
+
() => false,
|
|
43
|
+
);
|
|
44
|
+
|
|
34
45
|
return (
|
|
35
46
|
<AiChat
|
|
36
47
|
chatMessages={chatMessages}
|
|
37
48
|
sendMessage={sendMessage}
|
|
38
49
|
rateMessage={rateMessage}
|
|
39
50
|
onCopyMessage={onCopyMessage}
|
|
51
|
+
supportsPanel={supportsPanel}
|
|
40
52
|
/>
|
|
41
53
|
);
|
|
42
54
|
}
|