mirror of https://github.com/buster-so/buster.git
mark down in the side bar
This commit is contained in:
parent
283b1bd012
commit
9e18072bbd
|
@ -1,5 +1,4 @@
|
||||||
.container {
|
.container {
|
||||||
line-height: 1.3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.container table {
|
.container table {
|
||||||
|
|
|
@ -76,7 +76,7 @@ const AppMarkdownBase: React.FC<{
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(styles.container, 'flex flex-col gap-1.5', className)}>
|
<div className={cn(styles.container, 'flex flex-col gap-1.5 leading-1.5', className)}>
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
remarkPlugins={[remarkGfm]}
|
remarkPlugins={[remarkGfm]}
|
||||||
skipHtml={true}
|
skipHtml={true}
|
||||||
|
|
|
@ -20,7 +20,7 @@ export const CustomCode: React.FC<
|
||||||
const language = matchRegex ? matchRegex[1] : undefined;
|
const language = matchRegex ? matchRegex[1] : undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppCodeBlock wrapperClassName="my-2.5" className="leading-1.3" language={language}>
|
<AppCodeBlock wrapperClassName="my-2.5" className="" language={language}>
|
||||||
{children}
|
{children}
|
||||||
</AppCodeBlock>
|
</AppCodeBlock>
|
||||||
);
|
);
|
||||||
|
@ -35,11 +35,7 @@ export const CustomParagraph: React.FC<
|
||||||
> = ({ children, markdown, showLoader, ...rest }) => {
|
> = ({ children, markdown, showLoader, ...rest }) => {
|
||||||
if (Array.isArray(children)) {
|
if (Array.isArray(children)) {
|
||||||
return (
|
return (
|
||||||
<p
|
<p className={cn('text-size-inherit!', showLoader && 'animate-in fade-in duration-700')}>
|
||||||
className={cn(
|
|
||||||
'leading-1.3 text-size-inherit!',
|
|
||||||
showLoader && 'animate-in fade-in duration-700'
|
|
||||||
)}>
|
|
||||||
{children}
|
{children}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
|
@ -52,17 +48,13 @@ export const CustomParagraph: React.FC<
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<p
|
<p className={cn('text-size-inherit!', showLoader && 'animate-in fade-in duration-700')}>
|
||||||
className={cn(
|
|
||||||
'leading-1.3 text-size-inherit!',
|
|
||||||
showLoader && 'animate-in fade-in duration-700'
|
|
||||||
)}>
|
|
||||||
{children}
|
{children}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const headingVariants = cva('leading-1.3', {
|
const headingVariants = cva('', {
|
||||||
variants: {
|
variants: {
|
||||||
level: {
|
level: {
|
||||||
1: 'text-3xl ',
|
1: 'text-3xl ',
|
||||||
|
@ -108,7 +100,7 @@ export const CustomList: React.FC<
|
||||||
> = ({ ordered, children, markdown, showLoader, ...rest }) => {
|
> = ({ ordered, children, markdown, showLoader, ...rest }) => {
|
||||||
const ListTag = ordered ? 'ol' : 'ul';
|
const ListTag = ordered ? 'ol' : 'ul';
|
||||||
return (
|
return (
|
||||||
<ListTag className={cn('leading-1.3', showLoader && 'animate-in fade-in duration-700')}>
|
<ListTag className={cn('', showLoader && 'animate-in fade-in duration-700')}>
|
||||||
{children}
|
{children}
|
||||||
</ListTag>
|
</ListTag>
|
||||||
);
|
);
|
||||||
|
@ -122,11 +114,7 @@ export const CustomOrderedList: React.FC<
|
||||||
} & ExtraPropsExtra
|
} & ExtraPropsExtra
|
||||||
> = ({ children, markdown, showLoader, ...rest }) => {
|
> = ({ children, markdown, showLoader, ...rest }) => {
|
||||||
return (
|
return (
|
||||||
<ol
|
<ol className={cn('list-decimal space-y-1', showLoader && 'animate-in fade-in duration-700')}>
|
||||||
className={cn(
|
|
||||||
'leading-1.3 list-decimal space-y-1',
|
|
||||||
showLoader && 'animate-in fade-in duration-700'
|
|
||||||
)}>
|
|
||||||
{children}
|
{children}
|
||||||
</ol>
|
</ol>
|
||||||
);
|
);
|
||||||
|
@ -142,7 +130,7 @@ export const CustomUnorderedList: React.FC<
|
||||||
return (
|
return (
|
||||||
<ul
|
<ul
|
||||||
className={cn(
|
className={cn(
|
||||||
'leading-1.3 mt-1 list-inside list-disc space-y-1',
|
'mt-1 list-inside list-disc space-y-1',
|
||||||
showLoader && 'animate-in fade-in duration-700'
|
showLoader && 'animate-in fade-in duration-700'
|
||||||
)}>
|
)}>
|
||||||
{children}
|
{children}
|
||||||
|
@ -158,9 +146,7 @@ export const CustomListItem: React.FC<
|
||||||
} & ExtraPropsExtra
|
} & ExtraPropsExtra
|
||||||
> = ({ children, markdown, showLoader, ...rest }) => {
|
> = ({ children, markdown, showLoader, ...rest }) => {
|
||||||
return (
|
return (
|
||||||
<li className={cn('leading-1.3 space-y-1', showLoader && 'animate-in fade-in duration-700')}>
|
<li className={cn('space-y-1', showLoader && 'animate-in fade-in duration-700')}>{children}</li>
|
||||||
{children}
|
|
||||||
</li>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -172,7 +158,7 @@ export const CustomBlockquote: React.FC<
|
||||||
} & ExtraPropsExtra
|
} & ExtraPropsExtra
|
||||||
> = ({ children, markdown, showLoader, ...rest }) => {
|
> = ({ children, markdown, showLoader, ...rest }) => {
|
||||||
return (
|
return (
|
||||||
<blockquote className={cn('leading-1.3', showLoader && 'animate-in fade-in duration-700')}>
|
<blockquote className={cn('', showLoader && 'animate-in fade-in duration-700')}>
|
||||||
{children}
|
{children}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
);
|
);
|
||||||
|
@ -186,9 +172,7 @@ export const CustomTable: React.FC<
|
||||||
} & ExtraPropsExtra
|
} & ExtraPropsExtra
|
||||||
> = ({ children, markdown, showLoader, ...rest }) => {
|
> = ({ children, markdown, showLoader, ...rest }) => {
|
||||||
return (
|
return (
|
||||||
<table className={cn('leading-1.3', showLoader && 'animate-in fade-in duration-700')}>
|
<table className={cn('', showLoader && 'animate-in fade-in duration-700')}>{children}</table>
|
||||||
{children}
|
|
||||||
</table>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -200,8 +184,6 @@ export const CustomSpan: React.FC<
|
||||||
} & ExtraPropsExtra
|
} & ExtraPropsExtra
|
||||||
> = ({ children, markdown, showLoader, ...rest }) => {
|
> = ({ children, markdown, showLoader, ...rest }) => {
|
||||||
return (
|
return (
|
||||||
<span className={cn('leading-1.3', showLoader && 'animate-in fade-in duration-700')}>
|
<span className={cn('', showLoader && 'animate-in fade-in duration-700')}>{children}</span>
|
||||||
{children}
|
|
||||||
</span>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ChatResponseMessageProps } from './ChatResponseMessageSelector';
|
import { ChatResponseMessageProps } from './ChatResponseMessageSelector';
|
||||||
import { StreamingMessage_Text } from '@/components/ui/streaming/StreamingMessage_Text';
|
|
||||||
import { BusterChatResponseMessage_text } from '@/api/asset_interfaces';
|
import { BusterChatResponseMessage_text } from '@/api/asset_interfaces';
|
||||||
import { useGetChatMessage } from '@/api/buster_rest/chats';
|
import { useGetChatMessage } from '@/api/buster_rest/chats';
|
||||||
|
import { AppMarkdown } from '@/components/ui/typography/AppMarkdown';
|
||||||
|
|
||||||
export const ChatResponseMessage_Text: React.FC<ChatResponseMessageProps> = React.memo(
|
export const ChatResponseMessage_Text: React.FC<ChatResponseMessageProps> = React.memo(
|
||||||
({ responseMessageId, messageId, isCompletedStream }) => {
|
({ responseMessageId, messageId, isCompletedStream }) => {
|
||||||
|
@ -12,7 +12,16 @@ export const ChatResponseMessage_Text: React.FC<ChatResponseMessageProps> = Reac
|
||||||
) as BusterChatResponseMessage_text;
|
) as BusterChatResponseMessage_text;
|
||||||
const { message } = responseMessage;
|
const { message } = responseMessage;
|
||||||
|
|
||||||
return <StreamingMessage_Text message={message} isCompletedStream={isCompletedStream} />;
|
return (
|
||||||
|
<AppMarkdown
|
||||||
|
markdown={message}
|
||||||
|
showLoader={!isCompletedStream}
|
||||||
|
className="text-base leading-1.5!"
|
||||||
|
stripFormatting
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
// return <StreamingMessage_Text message={message} isCompletedStream={isCompletedStream} />;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -44,5 +44,5 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@apply leading-1.3;
|
@apply leading-1.5;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue