Compare commits

..

4 Commits

Author SHA1 Message Date
Samy Pessé 433d66482d Version Packages (#3446)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-08 11:01:57 +02:00
Greg Bergé bd553bcf9e Expose isJson and isYaml in @gitbook/openapi-parser (#3447) 2025-07-08 10:41:46 +02:00
Nolann B. f5894bcf74 Fix incorrect revision ID in Markdown fetch logic (#3448) 2025-07-08 09:41:12 +02:00
Zeno Kapitein 1b59e7ce36 Styling improvements to AI Chat Followup questions (#3444) 2025-07-07 19:02:01 +02:00
11 changed files with 51 additions and 19 deletions
+10
View File
@@ -1,5 +1,15 @@
# gitbook
## 0.13.1
### Patch Changes
- f5894bc: Fix incorrect revision ID in Markdown fetch logic
- 1b59e7c: Styling improvements to AI Chat Followup questions
- Updated dependencies [bd553bc]
- @gitbook/openapi-parser@2.2.0
- @gitbook/react-openapi@1.3.2
## 0.13.0
### Minor Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "0.13.0",
"version": "0.13.1",
"private": true,
"dependencies": {
"@gitbook/api": "catalog:",
@@ -16,7 +16,6 @@ import AIChatIcon from './AIChatIcon';
import { AIChatInput } from './AIChatInput';
import { AIChatMessages } from './AIChatMessages';
import AIChatSuggestedQuestions from './AIChatSuggestedQuestions';
import { AIChatFollowupSuggestions } from './AiChatFollowupSuggestions';
export function AIChat() {
const chat = useAIChatState();
@@ -169,7 +168,11 @@ export function AIChatWindow(props: { chat: AIChatState }) {
) : null}
</div>
) : (
<AIChatMessages chat={chat} lastUserMessageRef={lastUserMessageRef} />
<AIChatMessages
chat={chat}
chatController={chatController}
lastUserMessageRef={lastUserMessageRef}
/>
)}
</div>
<div
@@ -177,11 +180,7 @@ export function AIChatWindow(props: { chat: AIChatState }) {
className="absolute inset-x-0 bottom-0 mr-2 flex flex-col gap-4 bg-gradient-to-b from-transparent to-50% to-tint-base/9 p-4 pr-2"
>
{/* Display an error banner when something went wrong. */}
{chat.error ? (
<AIChatError chatController={chatController} />
) : (
<AIChatFollowupSuggestions chat={chat} chatController={chatController} />
)}
{chat.error ? <AIChatError chatController={chatController} /> : null}
<AIChatInput
value={input}
@@ -1,17 +1,20 @@
import { tcls } from '@/lib/tailwind';
import { AIMessageRole } from '@gitbook/api';
import type React from 'react';
import type { AIChatState } from '../AI/useAIChat';
import type { AIChatController, AIChatState } from '../AI/useAIChat';
import { AIChatFollowupSuggestions } from './AiChatFollowupSuggestions';
export function AIChatMessages(props: {
chat: AIChatState;
chatController: AIChatController;
lastUserMessageRef?: React.RefObject<HTMLDivElement>;
}) {
const { chat, lastUserMessageRef } = props;
const { chat, chatController, lastUserMessageRef } = props;
return (
<>
{chat.messages.map((message, index) => {
const isLastMessage = index === chat.messages.length - 1;
const isLastUserMessage =
message.role === AIMessageRole.User &&
index === chat.messages.map((m) => m.role).lastIndexOf(AIMessageRole.User);
@@ -23,8 +26,9 @@ export function AIChatMessages(props: {
message.content ? 'animate-[fadeIn_500ms_both]' : '',
'shrink-0',
'last:min-h-[calc(100%-5rem)]',
'flex flex-col gap-6',
message.role === AIMessageRole.User
? 'max-w-[80%] self-end rounded-md bg-tint px-4 py-2'
? 'max-w-[80%] self-end circular-corners:rounded-2xl rounded-corners:rounded-md bg-tint px-4 py-2'
: ''
)}
style={{
@@ -48,6 +52,12 @@ export function AIChatMessages(props: {
))}
</div>
) : null}
{isLastMessage ? (
<AIChatFollowupSuggestions
chat={chat}
chatController={chatController}
/>
) : null}
</div>
);
})}
@@ -15,7 +15,7 @@ export function AIChatFollowupSuggestions(props: {
}
return (
<div className="flex flex-row flex-wrap justify-end gap-2 pt-8">
<div className="mt-auto flex flex-row flex-wrap justify-end gap-2">
{chat.followUpSuggestions.map((suggestion, index) => (
<Button
key={index}
@@ -23,9 +23,9 @@ export function AIChatFollowupSuggestions(props: {
chatController.postMessage({ message: suggestion });
}}
label={suggestion}
className="max-w-full animate-[present_500ms_both] whitespace-normal text-right"
size="small"
variant="secondary"
className="max-w-[80%] animate-[present_500ms_both] whitespace-normal text-left ring-1 ring-tint-subtle"
size="medium"
variant="blank"
style={{
animationDelay: `${250 + Math.min(index * 50, 150)}ms`,
}}
+1 -1
View File
@@ -35,7 +35,7 @@ export async function servePageMarkdown(context: GitBookSiteContext, pagePath: s
const markdown = await throwIfDataError(
context.dataFetcher.getRevisionPageMarkdown({
spaceId: context.space.id,
revisionId: context.revision.id,
revisionId: context.revisionId,
pageId: page.id,
})
);
+6
View File
@@ -1,5 +1,11 @@
# @gitbook/openapi-parser
## 2.2.0
### Minor Changes
- bd553bc: Expose `isJson` and `isYaml` in OpenAPI parser
## 2.1.5
### Patch Changes
+1 -1
View File
@@ -9,7 +9,7 @@
"default": "./dist/index.js"
}
},
"version": "2.1.5",
"version": "2.2.0",
"sideEffects": false,
"dependencies": {
"@scalar/openapi-parser": "^0.18.0",
+1 -1
View File
@@ -1,6 +1,6 @@
export { parseOpenAPI } from './parse';
export { dereference } from '@scalar/openapi-parser';
export { dereference, isJson, isYaml } from '@scalar/openapi-parser';
export type { AnyObject } from '@scalar/openapi-parser';
export type * from '@scalar/openapi-types';
export * from './error';
+7
View File
@@ -1,5 +1,12 @@
# @gitbook/react-openapi
## 1.3.2
### Patch Changes
- Updated dependencies [bd553bc]
- @gitbook/openapi-parser@2.2.0
## 1.3.1
### Patch Changes
+1 -1
View File
@@ -8,7 +8,7 @@
"default": "./dist/index.js"
}
},
"version": "1.3.1",
"version": "1.3.2",
"sideEffects": false,
"dependencies": {
"@gitbook/openapi-parser": "workspace:*",