forked from botfront/rasa-webchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (54 loc) · 1.76 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react';
import ReactDOM from 'react-dom';
import { Widget, toggleChat, openChat, closeChat, showChat, hideChat, isOpen, isVisible, send } from './index_for_react_app';
const plugin = {
init: (args) => {
ReactDOM.render(
<Widget
protocol={args.protocol}
socketUrl={args.socketUrl}
socketPath={args.socketPath}
protocolOptions={args.protocolOptions}
initPayload={args.initPayload}
title={args.title}
subtitle={args.subtitle}
customData={args.customData}
inputTextFieldHint={args.inputTextFieldHint}
connectingText={args.connectingText}
profileAvatar={args.profileAvatar}
showCloseButton={args.showCloseButton}
showFullScreenButton={args.showFullScreenButton}
hideWhenNotConnected={args.hideWhenNotConnected}
autoClearCache={args.autoClearCache}
connectOn={args.connectOn}
onSocketEvent={args.onSocketEvent}
fullScreenMode={args.fullScreenMode}
badge={args.badge}
params={args.params}
embedded={args.embedded}
openLauncherImage={args.openLauncherImage}
closeImage={args.closeImage}
docViewer={args.docViewer}
displayUnreadCount={args.displayUnreadCount}
showMessageDate={args.showMessageDate}
customMessageDelay={args.customMessageDelay}
tooltipPayload={args.tooltipPayload}
tooltipDelay={args.tooltipDelay}
onWidgetEvent={args.onWidgetEvent}
disableTooltips={args.disableTooltips}
/>, document.querySelector(args.selector)
);
}
};
export {
plugin as default,
Widget,
toggleChat as toggle,
openChat as open,
closeChat as close,
showChat as show,
hideChat as hide,
isOpen,
isVisible,
send
};