@@ -21,6 +21,21 @@ import { getTimestamp, processText } from './utils/index.js';
2121
2222@customElement ( 'chat-component' )
2323export class ChatComponent extends LitElement {
24+ //--
25+ // Public attributes
26+ // --
27+
28+ @property ( { type : Boolean , attribute : 'inputPosition' } )
29+ inputPosition = 'sticky' ;
30+
31+ // interaction type: should come from dynamic settings
32+ // INTERACTION_MODEL defines the UI presentation and behavior
33+ // but for now we can switch between 'chat' and 'ask', using this
34+ @property ( { type : String , attribute : 'interactionModel' } )
35+ interactionModel = INTERACTION_MODEL [ 0 ] ;
36+
37+ //--
38+
2439 @property ( { type : String } )
2540 currentQuestion = '' ;
2641 @query ( '#question-input' )
@@ -48,11 +63,6 @@ export class ChatComponent extends LitElement {
4863 isShowingThoughtProcess = false ;
4964 @property ( { type : Boolean } )
5065 canShowThoughtProcess = false ;
51- // interaction type: should come from dynamic settings
52- // INTERACTION_MODEL defines the UI presentation and behavior
53- // but for now we can switch between 'chat' and 'ask', using this
54- @property ( { type : String } )
55- interactionModel = INTERACTION_MODEL [ 0 ] ;
5666 // api response
5767 apiResponse = { } as BotResponse | Response ;
5868 // These are the chat bubbles that will be displayed in the chat
@@ -61,7 +71,6 @@ export class ChatComponent extends LitElement {
6171 defaultPrompts : string [ ] = globalConfig . DEFAULT_PROMPTS ;
6272 defaultPromptsHeading : string = globalConfig . DEFAULT_PROMPTS_HEADING ;
6373 chatButtonLabelText : string = globalConfig . CHAT_BUTTON_LABEL_TEXT ;
64- chatInputLabelText : string = globalConfig . CHAT_INPUT_LABEL_TEXT ;
6574 chatThoughtProcess : BotResponse [ ] = [ ] ;
6675 chatThoughts : string | null = '' ;
6776 chatDataPoints : string [ ] = [ ] ;
@@ -446,11 +455,11 @@ export class ChatComponent extends LitElement {
446455 ${ this . hasDefaultPromptsEnabled
447456 ? html `
448457 < div class ="defaults__container ">
449- < h2 class ="subheadline ">
458+ < h1 class ="headline ">
450459 ${ this . interactionModel === 'chat'
451- ? globalConfig . DEFAULT_PROMPTS_HEADING_CHAT
452- : globalConfig . DEFAULT_PROMPTS_HEADING_ASK }
453- </ h2 >
460+ ? this . title || globalConfig . DEFAULT_PROMPTS_HEADING_CHAT
461+ : this . title || globalConfig . DEFAULT_PROMPTS_HEADING_ASK }
462+ </ h1 >
454463 < ul class ="defaults__list ">
455464 ${ this . defaultPrompts . map (
456465 ( prompt ) => html `
@@ -472,11 +481,10 @@ export class ChatComponent extends LitElement {
472481 `
473482 : '' }
474483 </ div >
475- < form id ="chat-form " class ="form__container ">
476- < label id ="chatbox-label " for ="question-input " class ="form__label "
477- > ${ globalConfig . CHAT_INPUT_LABEL_TEXT } </ label
478- >
479-
484+ < form
485+ id ="chat-form "
486+ class ="form__container ${ this . inputPosition === 'sticky' ? 'form__container-sticky' : '' } "
487+ >
480488 < div class ="chatbox__container container-col container-row ">
481489 < input
482490 class ="chatbox__input "
@@ -516,16 +524,15 @@ export class ChatComponent extends LitElement {
516524 ${ globalConfig . RESET_BUTTON_LABEL_TEXT }
517525 </ button >
518526 </ div >
519- </ form >
520- < div class ="chat__containerFooter ">
527+
521528 ${ this . hasDefaultPromptsEnabled
522529 ? ''
523- : html `
530+ : html `< div class =" chat__containerFooter " >
524531 < button type ="button " @click ="${ this . showDefaultPrompts } " class ="defaults__span button ">
525532 ${ globalConfig . DISPLAY_DEFAULT_PROMPTS_BUTTON }
526533 </ button >
527- ` }
528- </ div >
534+ </ div > ` }
535+ </ form >
529536 </ section >
530537 ${ this . isShowingThoughtProcess
531538 ? html `
0 commit comments