forked from botfront/rasa-webchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
44 lines (41 loc) · 1.2 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
import React from 'react';
import ReactDOM from 'react-dom';
import { Widget, toggleChat, openChat, closeChat, showChat, hideChat, isOpen, isVisible } from './index_for_react_app';
const plugin = {
init: (args) => {
ReactDOM.render(
<Widget
socketUrl={args.socketUrl}
socketPath={args.socketPath}
interval={args.interval}
initPayload={args.initPayload}
title={args.title}
subtitle={args.subtitle}
customData={args.customData}
inputTextFieldHint={args.inputTextFieldHint}
connectingText={args.connectingText}
profileAvatar={args.profileAvatar}
showCloseButton={args.showCloseButton}
hideWhenNotConnected={args.hideWhenNotConnected}
fullScreenMode={args.fullScreenMode}
badge={args.badge}
params={args.params}
embedded={args.embedded}
openLauncherImage={args.openLauncherImage}
closeImage={args.closeImage}
docViewer={args.docViewer}
/>, 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
};