Function
Static Public Summary | ||
public |
Renders the chat bot's avatar along with a status indicator. |
|
public |
AvatarContainer(objectPattern: {"AvatarComponent": *, "connection": *, "typing": *}): * |
|
public |
A simple button component |
|
public |
ButtonContainer(objectPattern: {"children": *}): * |
|
public |
ChatContainer(objectPattern: {"theme": *, "connection": *}): * |
|
public |
|
|
public |
ImageComponent(param: Object): Object An image |
|
public |
A simple text Input component. |
|
public |
InputArea(objectPattern: {"InputComponent": *, "submitHandler": *, "inputExpected": *, "MenuComponent": *, "CheckboxMenuComponent": *, "buttons": *}): * |
|
public |
A menu listing several items. |
|
public |
Message(objectPattern: {"page": *, "isLocal": *, "ImageComponent": *, "InputComponent": *, "MessageComponent": *, "TextComponent": *, "ButtonComponent": *, "submitHandler": *}): undefined[] |
|
public |
MessageContainer(objectPattern: {"userId": *, "type": *, "children": *, "layout": *, "origin": *, "pages": *, ...rest: Object}): * |
|
public |
ReactWebChatComponent(params: Object): Object The main react component for React Web Chat |
|
public |
A typing indicator component |
|
public |
attempted(_: *): {type: CONNECTION_ATTEMPTED} Sets connection to attempted |
|
public |
delayedMessageAdd(message: object): function() Async action creator: Adds a new message after a delay of 1200 milliseconds. |
|
public |
dropped(_: *): {type: CONNECTION_DROPPED} Sets connection to offline |
|
public |
established(_: *): {type: CONNECTION_ESTABLISHED} Sets connection to established |
|
public |
eventEmitterMiddleware(store: Object) Automatically dispatches custom events whenever a redux action is dispatched. |
|
public |
getLatestRemote(messages: Array) Returns the latest remote message |
|
public |
listening(_: *): {type: CONNECTION_LISTENING} Sets connection to listening |
|
public |
messageAdd(message: object): {type: MESSAGE_ADD} Action creator: Adds a message to the store. |
|
public |
messageReceive(message: object): function() Async action creator: Dispatched when a message is received from the server. |
|
public |
messageSend(message: object): function() Async action creator: Dispatched when a message is received from the server. |
|
public |
remoteMessage(message: Object) Checks if a message belongs to remote |
Static Public
public Avatar(props: Object): Object source
import Avatar from 'react-web-chat/src/themes/default/components/Avatar/index.js'
Renders the chat bot's avatar along with a status indicator.
Params:
Name | Type | Attribute | Description |
props | Object | ||
props.avatar | string | A url to an image to use as the avatar. |
|
props.connecting | boolean | A state variable indicating that the chat app is busy attempting a connection to the server. |
|
props.established | boolean | A state variable indicating that the chat server is online and the handshake was successful. |
|
props.offline | boolean | A state variable indicating that the chat server is offline. |
|
props.typing | boolean | A state variable indicating that the chat app is currently simulating "typing..." |
public AvatarContainer(objectPattern: {"AvatarComponent": *, "connection": *, "typing": *}): * source
import {AvatarContainer} from 'react-web-chat/src/components/AvatarContainer/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"AvatarComponent": *, "connection": *, "typing": *} |
|
Return:
* |
public Button(param: Object): Object source
import {Button} from 'react-web-chat/src/themes/default/components/Button/index.js'
A simple button component
public ButtonContainer(objectPattern: {"children": *}): * source
import {ButtonContainer} from 'react-web-chat/src/components/ButtonContainer/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"children": *} |
|
Return:
* |
public ChatContainer(objectPattern: {"theme": *, "connection": *}): * source
import {ChatContainer} from 'react-web-chat/src/components/ChatContainer/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"theme": *, "connection": *} |
|
Return:
* |
public Fade(objectPattern: {"children": *, ...props: Object}) source
import {Fade} from 'react-web-chat/src/themes/default/components/Animation/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"children": *, ...props: Object} |
|
public ImageComponent(param: Object): Object source
import {ImageComponent} from 'react-web-chat/src/themes/default/components/Image/index.js'
An image
public Input(param: Object): Object source
import {Input} from 'react-web-chat/src/themes/default/components/Input/index.js'
A simple text Input component.
public InputArea(objectPattern: {"InputComponent": *, "submitHandler": *, "inputExpected": *, "MenuComponent": *, "CheckboxMenuComponent": *, "buttons": *}): * source
import {InputArea} from 'react-web-chat/src/components/InputArea/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"InputComponent": *, "submitHandler": *, "inputExpected": *, "MenuComponent": *, "CheckboxMenuComponent": *, "buttons": *} |
|
Return:
* |
public Menu(param: Object): Object source
import {Menu} from 'react-web-chat/src/themes/default/components/Menu/index.js'
A menu listing several items. (single choice)
public Message(objectPattern: {"page": *, "isLocal": *, "ImageComponent": *, "InputComponent": *, "MessageComponent": *, "TextComponent": *, "ButtonComponent": *, "submitHandler": *}): undefined[] source
import {Message} from 'react-web-chat/src/components/Message/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"page": *, "isLocal": *, "ImageComponent": *, "InputComponent": *, "MessageComponent": *, "TextComponent": *, "ButtonComponent": *, "submitHandler": *} |
|
public MessageContainer(objectPattern: {"userId": *, "type": *, "children": *, "layout": *, "origin": *, "pages": *, ...rest: Object}): * source
import MessageContainer from 'react-web-chat/src/components/MessageContainer/index.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"userId": *, "type": *, "children": *, "layout": *, "origin": *, "pages": *, ...rest: Object} |
|
Return:
* |
public ReactWebChatComponent(params: Object): Object source
import {ReactWebChatComponent} from 'react-web-chat/src/index.js'
The main react component for React Web Chat
public TypingIndicator(): Object source
import TypingIndicator from 'react-web-chat/src/themes/default/components/TypingIndicator/index.js'
A typing indicator component
public attempted(_: *): {type: CONNECTION_ATTEMPTED} source
import {attempted} from 'react-web-chat/src/actions/connection.js'
Sets connection to attempted
Params:
Name | Type | Attribute | Description |
_ | * |
Return:
{type: CONNECTION_ATTEMPTED} | redux action type returned |
public delayedMessageAdd(message: object): function() source
import {delayedMessageAdd} from 'react-web-chat/src/actions/messages.js'
Async action creator: Adds a new message after a delay of 1200 milliseconds. This is designed to simulate the "typing..." state of a chat user.
Params:
Name | Type | Attribute | Description |
message | object |
TODO:
- Make timeout duration a configurable setting.
public dropped(_: *): {type: CONNECTION_DROPPED} source
import {dropped} from 'react-web-chat/src/actions/connection.js'
Sets connection to offline
Params:
Name | Type | Attribute | Description |
_ | * |
Return:
{type: CONNECTION_DROPPED} | redux action type returned |
public established(_: *): {type: CONNECTION_ESTABLISHED} source
import {established} from 'react-web-chat/src/actions/connection.js'
Sets connection to established
Params:
Name | Type | Attribute | Description |
_ | * |
Return:
{type: CONNECTION_ESTABLISHED} | redux action type returned |
public eventEmitterMiddleware(store: Object) source
import eventEmitterMiddleware from 'react-web-chat/src/middleware/eventEmitter.js'
Automatically dispatches custom events whenever a redux action is dispatched.
Params:
Name | Type | Attribute | Description |
store | Object | a redux store instance |
public getLatestRemote(messages: Array) source
import {getLatestRemote} from 'react-web-chat/src/utils/helpers.js'
Returns the latest remote message
Params:
Name | Type | Attribute | Description |
messages | Array |
public listening(_: *): {type: CONNECTION_LISTENING} source
import {listening} from 'react-web-chat/src/actions/connection.js'
Sets connection to listening
Params:
Name | Type | Attribute | Description |
_ | * |
Return:
{type: CONNECTION_LISTENING} | redux action type returned |
public messageAdd(message: object): {type: MESSAGE_ADD} source
import {messageAdd} from 'react-web-chat/src/actions/messages.js'
Action creator: Adds a message to the store.
Params:
Name | Type | Attribute | Description |
message | object |
Return:
{type: MESSAGE_ADD} | redux action type returned |
public messageReceive(message: object): function() source
import {messageReceive} from 'react-web-chat/src/actions/messages.js'
Async action creator: Dispatched when a message is received from the server. The message will get added to a dispatch queue.
Params:
Name | Type | Attribute | Description |
message | object |
public messageSend(message: object): function() source
import {messageSend} from 'react-web-chat/src/actions/messages.js'
Async action creator: Dispatched when a message is received from the server. The message will get added to a dispatch queue.
Params:
Name | Type | Attribute | Description |
message | object |
public remoteMessage(message: Object) source
import {remoteMessage} from 'react-web-chat/src/utils/filters.js'
Checks if a message belongs to remote
Params:
Name | Type | Attribute | Description |
message | Object |