Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 11 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@
"@microsoft/fetch-event-source": "^2.0.1",
"clsx": "^1.2.1",
"eventemitter3": "^5.0.0",
"highlight.js": "^11.10.0",
"highlightjs-copy": "^1.0.6",
"remark-external-links": "^9.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-shadow-root": "^6.2.0",
"remark": "^14.0.2",
"remark-external-links": "^9.0.1",
"remark-gfm": "^3.0.1",
"remark-html": "^15.0.2",
"streamdown": "^0.6.0",
"uuid": "^9.0.0"
}
}
76 changes: 1 addition & 75 deletions src/assets/scss/_components/_bot-message.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,81 +16,7 @@
width: 100%;
}

a {
color: inherit;
font-weight: 500;
word-break: break-all;
display: inline-block;
max-width: 100%;

&:hover {
text-decoration: none;
}
}

p {
margin-top: 0;
max-width: 100%;

&:last-child {
margin-bottom: 0;
}
}

pre {
direction: ltr;
text-align: left;
overflow: hidden;
position: relative;
margin: $spacing-xs 0;
border: 1px solid $color-secondary-200;
border-radius: $spacing-xs;
box-shadow: none;

code {
padding: $spacing-sm;
box-shadow: none;
font-size: 12px;
line-height: 16px;
direction: ltr;
text-align: left;
unicode-bidi: normal;
}

button {
cursor: pointer;
border: 1px solid $color-secondary-200;
background: $color-secondary-200;
color: $color-neutral-100;
transition:
border-color $transition-duration-short linear,
background $transition-duration-short ease,
color $transition-duration-short ease;

&:hover {
border-color: $color-neutral-100;
background: $color-neutral-100;
color: $color-neutral-300;
}

&:focus {
outline: none;
border-color: $color-neutral-300;
}

&[data-copied="true"] {
padding-left: $spacing-sm;
padding-right: $spacing-sm;
}
}
}

ol,
ul {
padding-left: $spacing-lg;
}

&-container {
&-container {
display: flex;
justify-content: flex-start;
padding-right: $spacing-sm;
Expand Down
176 changes: 176 additions & 0 deletions src/assets/scss/_components/_streamdown.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
@use '../_utils/tokens' as *;

.docsbot-streamdown {
display: block;
width: 100%;
color: inherit;
font-family: inherit;
font-size: 14px;
line-height: 20px;
word-wrap: break-word;
overflow-wrap: anywhere;
word-break: break-word;

> * {
margin: $spacing-xs 0;
}

> :first-child {
margin-top: 0;
}

> :last-child {
margin-bottom: 0;
}

a {
color: inherit;
font-weight: 500;
text-decoration: underline;
word-break: break-word;
display: inline-block;
max-width: 100%;

&:hover {
text-decoration: none;
}
}

p {
margin: $spacing-xs 0;
max-width: 100%;
}

strong {
font-weight: 600;
}

em {
font-style: italic;
}

ul,
ol {
margin: $spacing-xs 0;
padding-left: $spacing-lg;
}

li {
margin: $spacing-xs 0;
}

blockquote {
margin: $spacing-sm 0;
padding-left: $spacing-sm;
border-left: 2px solid $color-secondary-200;
color: $color-secondary-100;
}

hr {
border: none;
border-top: 1px solid $color-secondary-200;
margin: $spacing-sm 0;
}

img,
video,
iframe {
display: block;
max-width: 100%;
height: auto;
margin: $spacing-xs 0;
border-radius: $spacing-xs;
}

table {
width: 100%;
margin: $spacing-sm 0;
border-collapse: collapse;
font-size: 13px;
line-height: 18px;
display: block;
overflow-x: auto;
}

th,
td {
padding: $spacing-xs $spacing-sm;
border: 1px solid $color-secondary-200;
vertical-align: top;
text-align: left;
white-space: normal;
word-break: break-word;
}

thead th {
background: $color-secondary-400;
color: $color-neutral-100;
font-weight: 600;
}

code {
font-family:
SFMono-Regular,
Menlo,
Monaco,
Consolas,
'Liberation Mono',
'Courier New',
monospace;
}

:not(pre) > code {
display: inline;
padding: 0 $spacing-xs;
border-radius: $spacing-xs;
background: $color-secondary-300;
}

pre {
position: relative;
margin: $spacing-xs 0;
border: 1px solid $color-secondary-200;
border-radius: $spacing-xs;
background: $color-secondary-400;
overflow: auto;
direction: ltr;
text-align: left;

code {
display: block;
padding: $spacing-sm;
font-size: 12px;
line-height: 16px;
background: transparent;
color: inherit;
unicode-bidi: normal;
}

button {
cursor: pointer;
border: 1px solid $color-secondary-200;
background: $color-secondary-200;
color: $color-neutral-100;
transition:
border-color $transition-duration-short linear,
background $transition-duration-short ease,
color $transition-duration-short ease;

&:hover {
border-color: $color-neutral-100;
background: $color-neutral-100;
color: $color-neutral-300;
}

&:focus {
outline: none;
border-color: $color-neutral-300;
}

&[data-copied='true'] {
padding-left: $spacing-sm;
padding-right: $spacing-sm;
}
}
}
}
1 change: 1 addition & 0 deletions src/assets/scss/chatbot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@forward './_components/bot-sources';
@forward './_components/bot-rating';
@forward './_components/bot-support';
@forward './_components/streamdown';
@forward './_components/user-message';
@forward './_components/footer';
@forward './_components/input';
Expand Down
4 changes: 0 additions & 4 deletions src/components/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import appStyles from "!raw-loader!../../assets/css/App.min.css";
import floatingButtonStyles from "!raw-loader!../../assets/css/FloatingButton.min.css";
import optionsStyles from "!raw-loader!../../assets/css/Options.min.css";
import linkListStyles from "!raw-loader!../../assets/css/LinkList.min.css";
import highlightJSStyles from "!raw-loader!highlight.js/styles/github.min.css";
import hljsCopyStyles from "!raw-loader!highlightjs-copy/dist/highlightjs-copy.min.css";
import { Chatbot } from "../chatbot/Chatbot";
import { ChatbotProvider } from "../chatbotContext/ChatbotContext";
import { Emitter } from "../../utils/event-emitter";
Expand Down Expand Up @@ -61,8 +59,6 @@ function App() {
return (
<ReactShadowRoot>
<style type="text/css">{fontAwesomeStyles}</style>
<style type="text/css">{highlightJSStyles}</style>
<style type="text/css">{hljsCopyStyles}</style>
<style type="text/css">{reactChatbotStyles}</style>
<style type="text/css">{appStyles}</style>
<style type="text/css">{floatingButtonStyles}</style>
Expand Down
Loading