move message box style inside component
This commit is contained in:
parent
681d8ecb0b
commit
e6d85c7257
5 changed files with 130 additions and 90 deletions
|
@ -246,7 +246,7 @@
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
button {
|
button {
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,88 +416,6 @@
|
||||||
background: variables.$bg-color-chat;
|
background: variables.$bg-color-chat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-theme-light & {
|
|
||||||
|
|
||||||
background: #F5F5F5;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-theme-dark & {
|
|
||||||
|
|
||||||
background: #2c2c2c;
|
|
||||||
color: #d5d5d5;
|
|
||||||
|
|
||||||
.message {
|
|
||||||
|
|
||||||
&.user {
|
|
||||||
background: #232432;
|
|
||||||
color: #8b8ecf;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.llm {
|
|
||||||
background: #232432;
|
|
||||||
|
|
||||||
.message-content {
|
|
||||||
color: #8b8ecf;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions {
|
|
||||||
|
|
||||||
.button {
|
|
||||||
background: #0d0e15;
|
|
||||||
color: grey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-theme-funky & {
|
|
||||||
color: #1B1D27;
|
|
||||||
background: #ffe8e8;
|
|
||||||
|
|
||||||
.message {
|
|
||||||
.message-content {
|
|
||||||
color: #fff3f3;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.user {
|
|
||||||
background: #d6a3a3;
|
|
||||||
color: #1B1D27;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.llm {
|
|
||||||
|
|
||||||
background: #9f36bc;
|
|
||||||
color: #bba7d6;
|
|
||||||
|
|
||||||
.actions {
|
|
||||||
|
|
||||||
.button {
|
|
||||||
background: #b08eba;
|
|
||||||
color: #d4b4ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
|
|
||||||
&.user {
|
|
||||||
background: variables.$neutral-white;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.llm {
|
|
||||||
background: rgba(#3B87CC1A, 10%);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import type {Preview} from '@storybook/angular';
|
import type {Preview} from '@storybook/angular';
|
||||||
|
import {moduleMetadata} from '@storybook/angular';
|
||||||
|
import {Store, StoreModule} from '@ngrx/store';
|
||||||
|
import {reducers} from '../src/app/reducers';
|
||||||
// import 'remixicon/fonts/remixicon.css';
|
// import 'remixicon/fonts/remixicon.css';
|
||||||
|
|
||||||
const preview: Preview = {
|
const preview: Preview = {
|
||||||
|
@ -11,6 +14,16 @@ const preview: Preview = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
decorators: [
|
||||||
|
moduleMetadata({
|
||||||
|
imports: [
|
||||||
|
StoreModule.forRoot(reducers),
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
Store
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
export default preview;
|
export default preview;
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="{'expanded': expanded}" class="expanded-message-fullscreen">
|
<div [ngClass]="{'is-expanded': expanded}" class="expanded-message-fullscreen">
|
||||||
@if (content) {
|
@if (content) {
|
||||||
<div [innerHTML]="sanitizedContent"></div>
|
<div [innerHTML]="sanitizedContent"></div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@use 'sae-lib/src/styles/variables' as variables;
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -28,21 +30,128 @@
|
||||||
margin-left: 39px;
|
margin-left: 39px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
|
||||||
|
|
||||||
|
|
||||||
.actions {
|
.message {
|
||||||
.fullscreen {
|
&.user {
|
||||||
float: right;
|
background: #232432;
|
||||||
|
color: #8b8ecf;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.llm {
|
||||||
|
//background: #232432;
|
||||||
|
|
||||||
|
.message-content {
|
||||||
|
color: #8b8ecf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
.button {
|
||||||
|
background: #0d0e15;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
.fullscreen {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-theme-light & {
|
||||||
|
|
||||||
|
background: #F5F5F5;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-theme-dark & {
|
||||||
|
|
||||||
|
background: #2c2c2c;
|
||||||
|
color: #d5d5d5;
|
||||||
|
|
||||||
|
.message {
|
||||||
|
|
||||||
|
&.user {
|
||||||
|
background: #232432;
|
||||||
|
color: #8b8ecf;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.llm {
|
||||||
|
background: #232432;
|
||||||
|
|
||||||
|
.message-content {
|
||||||
|
color: #8b8ecf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background: #0d0e15;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-theme-funky & {
|
||||||
|
color: #1B1D27;
|
||||||
|
background: #ffe8e8;
|
||||||
|
|
||||||
|
.message {
|
||||||
|
.message-content {
|
||||||
|
color: #fff3f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.user {
|
||||||
|
background: #d6a3a3;
|
||||||
|
color: #1B1D27;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.llm {
|
||||||
|
|
||||||
|
background: #9f36bc;
|
||||||
|
color: #bba7d6;
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background: #b08eba;
|
||||||
|
color: #d4b4ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
|
||||||
|
&.user {
|
||||||
|
background: variables.$neutral-white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.llm {
|
||||||
|
background: rgba(#3B87CC1A, 10%);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.expanded-message-fullscreen {
|
.expanded-message-fullscreen {
|
||||||
display: none;
|
display: none;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
||||||
&.is-visible {
|
&.is-visible {
|
||||||
display: block;
|
display: block;
|
||||||
|
padding: 20px;
|
||||||
|
background: #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ export class MessageBox implements OnChanges {
|
||||||
@Input() message: ChatbotMessage = {} as ChatbotMessage;
|
@Input() message: ChatbotMessage = {} as ChatbotMessage;
|
||||||
id: string = "00122121221312";
|
id: string = "00122121221312";
|
||||||
sanitizedContent: SafeHtml = "";
|
sanitizedContent: SafeHtml = "";
|
||||||
expanded: boolean = false;
|
expanded: boolean = true;
|
||||||
|
|
||||||
constructor(private sanitizer: DomSanitizer, private store: Store<StateInterface>) {
|
constructor(private sanitizer: DomSanitizer, private store: Store<StateInterface>) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue