5 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ There are several classes that you need to take in consideration if you want to
34
34
- _ webchat-input-button-add-attachments_
35
35
- _ webchat-input-drag-and-drop-file-text_
36
36
- _ webchat-input-button-send_
37
+ - _ webchat-input-get-started-button_
37
38
- _ webchat-toggle-button_
38
39
- _ webchat-unread-message-preview_
39
40
- _ webchat-unread-message-badge_
@@ -387,6 +388,17 @@ The avatars can be repositioned to appear at the top edge of a message rather th
387
388
}
388
389
```
389
390
391
+ - _ webchat-input-get-started-button_
392
+ The button to initiate the first interaction in the Webchat. You can customize its appearance, size, and background.
393
+
394
+ ``` CSS
395
+ [data-cognigy-webchat-root ] [data-cognigy-webchat ].webchat .webchat-input-get-started-button {
396
+
397
+ border-radius : 10px ;
398
+ background-color : rgb (0 , 123 , 255 );
399
+ }
400
+ ```
401
+
390
402
- _ webchat-input-button-add-attachments_
391
403
The button to open the file attachment section, you can not change the icon but you can customize the position, size and background.
392
404
Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ import styled from "@emotion/styled";
7
7
const GetStartedButton = styled ( Button ) ( ( { theme } ) => ( {
8
8
marginBottom : theme . unitSize * 2 ,
9
9
flexGrow : 1 ,
10
- "&:focus" : {
11
- outline : "none" ,
12
- boxShadow : `0 0 3px 1px ${ theme . primaryWeakColor } ` ,
13
- backgroundColor : theme . primaryStrongColor ,
14
- } ,
15
10
} ) ) ;
16
11
17
12
const GetStartedInput = ( { onSendMessage, config } : InputComponentProps ) => (
@@ -26,6 +21,7 @@ const GetStartedInput = ({ onSendMessage, config }: InputComponentProps) => (
26
21
}
27
22
color = "primary"
28
23
id = "webchatGetStartedButton"
24
+ className = "webchat-input-get-started-button"
29
25
>
30
26
{ config . settings . startBehavior . getStartedButtonText }
31
27
</ GetStartedButton >
Original file line number Diff line number Diff line change 1
1
import GetStartedInput from "./GetStartedInput" ;
2
2
import { InputRule , InputPlugin } from "../../common/interfaces/input-plugin" ;
3
3
import { registerInputPlugin } from "../helper" ;
4
+ import getMessagesListWithoutControlCommands from "../../webchat-ui/utils/filter-out-control-commands" ;
4
5
5
6
const rule : InputRule = ( {
6
7
config : {
@@ -16,7 +17,9 @@ const rule: InputRule = ({
16
17
} ,
17
18
messages,
18
19
} ) =>
19
- ( messages . length === 0 || ( messages . length === 1 && messages [ 0 ] . source === "engagement" ) ) &&
20
+ ( messages . length === 0 ||
21
+ ( messages . length === 1 && messages [ 0 ] . source === "engagement" ) ||
22
+ getMessagesListWithoutControlCommands ( messages ) ?. length === 0 ) &&
20
23
startBehavior === "button" &&
21
24
! ! getStartedPayload &&
22
25
( ! ! getStartedButtonText ||
Original file line number Diff line number Diff line change @@ -58,8 +58,13 @@ export const createAutoInjectMiddleware =
58
58
}
59
59
60
60
// Don't trigger the auto inject message when the history is not empty
61
- // except if explicitly set via enableAutoInjectWithHistory
61
+ // except if explicitly set via enableInjectionWithoutEmptyHistory
62
62
if ( ! config . settings . widgetSettings . enableInjectionWithoutEmptyHistory ) {
63
+ // If there are stored messages waiting to be sent, don't send the auto-inject message
64
+ if ( state . ui . storedMessage ) {
65
+ break ;
66
+ }
67
+
63
68
// Exclude engagement messages from state.messages
64
69
const messagesExcludingEngagementMessages =
65
70
state . messages . messageHistory ?. filter (
Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ export const createConnectionMiddleware =
56
56
// set options
57
57
store . dispatch ( setConnecting ( false ) ) ;
58
58
store . dispatch ( setReconnectionLimit ( false ) ) ;
59
- store . dispatch ( setOptions ( client . socketOptions ) ) ;
60
59
61
60
if ( storedMessage ) {
62
61
store . dispatch (
@@ -67,6 +66,7 @@ export const createConnectionMiddleware =
67
66
) ;
68
67
store . dispatch ( setStoredMessage ( null ) ) ;
69
68
}
69
+ store . dispatch ( setOptions ( client . socketOptions ) ) ;
70
70
} )
71
71
. catch ( ( ) => {
72
72
store . dispatch ( setConnecting ( false ) ) ;
0 commit comments