bibot 1.0.32 → 1.0.33
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/component/bibot.d.ts +3 -1
- package/dist/hooks/useBiBotChatBot.d.ts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +14 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
@@ -1,6 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
interface bubbleProps {
|
3
3
|
clientId: string;
|
4
|
+
client_session_id?: string;
|
5
|
+
redirect_notice?: boolean;
|
4
6
|
}
|
5
|
-
declare const ChatBubbleBiBot: ({ clientId }: bubbleProps) => React.JSX.Element;
|
7
|
+
declare const ChatBubbleBiBot: ({ clientId, client_session_id, redirect_notice }: bubbleProps) => React.JSX.Element;
|
6
8
|
export default ChatBubbleBiBot;
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
2
2
|
import { predefinedQuestionsType } from '../services/plugin-api';
|
3
3
|
interface UseBiBotChatBotProps {
|
4
4
|
clientId: string;
|
5
|
+
client_session_id?: string;
|
6
|
+
redirect_notice?: boolean;
|
5
7
|
}
|
6
8
|
interface ChatBubbleConfigProps {
|
7
9
|
bgColor?: string;
|
@@ -9,7 +11,7 @@ interface ChatBubbleConfigProps {
|
|
9
11
|
title?: string;
|
10
12
|
logo_url?: string;
|
11
13
|
}
|
12
|
-
declare const useBiBotChatBot: ({ clientId }: UseBiBotChatBotProps) => {
|
14
|
+
declare const useBiBotChatBot: ({ clientId, client_session_id }: UseBiBotChatBotProps) => {
|
13
15
|
chatIsOpen: boolean;
|
14
16
|
messages: {
|
15
17
|
sender: 'user' | 'bot';
|
package/dist/index.d.ts
CHANGED
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
2
2
|
import './styles.css';
|
3
3
|
interface Props {
|
4
4
|
clientId: string;
|
5
|
+
client_session_id?: string;
|
6
|
+
redirect_notice?: boolean;
|
5
7
|
}
|
6
|
-
export declare const BiBot: ({ clientId }: Props) => React.JSX.Element;
|
8
|
+
export declare const BiBot: ({ clientId, client_session_id }: Props) => React.JSX.Element;
|
7
9
|
export {};
|
package/dist/index.js
CHANGED
@@ -3630,7 +3630,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
|
|
3630
3630
|
return Promise.resolve(askBiBot({
|
3631
3631
|
client_id: clientId,
|
3632
3632
|
q: input,
|
3633
|
-
session_id: state.sessionId,
|
3633
|
+
session_id: client_session_id ? client_session_id : state.sessionId,
|
3634
3634
|
chat_id: v4()
|
3635
3635
|
})).then(function (response) {
|
3636
3636
|
setMessages(function (messages) {
|
@@ -3683,7 +3683,8 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
|
|
3683
3683
|
return Promise.reject(e);
|
3684
3684
|
}
|
3685
3685
|
};
|
3686
|
-
var clientId = _ref.clientId
|
3686
|
+
var clientId = _ref.clientId,
|
3687
|
+
client_session_id = _ref.client_session_id;
|
3687
3688
|
var _useState = React.useState([]),
|
3688
3689
|
predefinedQuestions = _useState[0],
|
3689
3690
|
setPredefinedQuestions = _useState[1];
|
@@ -4131,9 +4132,13 @@ var PredefinedQuestions = function PredefinedQuestions(_ref) {
|
|
4131
4132
|
};
|
4132
4133
|
var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
|
4133
4134
|
var _chatBubbleConfig$col2, _chatBubbleConfig$col3;
|
4134
|
-
var clientId = _ref2.clientId
|
4135
|
+
var clientId = _ref2.clientId,
|
4136
|
+
client_session_id = _ref2.client_session_id,
|
4137
|
+
redirect_notice = _ref2.redirect_notice;
|
4135
4138
|
var _useBiBotChatBot2 = useBiBotChatBot({
|
4136
|
-
clientId: clientId
|
4139
|
+
clientId: clientId,
|
4140
|
+
client_session_id: client_session_id,
|
4141
|
+
redirect_notice: redirect_notice
|
4137
4142
|
}),
|
4138
4143
|
chatIsOpen = _useBiBotChatBot2.chatIsOpen,
|
4139
4144
|
messages = _useBiBotChatBot2.messages,
|
@@ -4341,9 +4346,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
|
|
4341
4346
|
};
|
4342
4347
|
|
4343
4348
|
var BiBot = function BiBot(_ref) {
|
4344
|
-
var clientId = _ref.clientId
|
4349
|
+
var clientId = _ref.clientId,
|
4350
|
+
client_session_id = _ref.client_session_id;
|
4345
4351
|
return React.createElement(AppProvider, null, React.createElement(ChatBubbleBiBot, {
|
4346
|
-
clientId: clientId
|
4352
|
+
clientId: clientId,
|
4353
|
+
client_session_id: client_session_id,
|
4354
|
+
redirect_notice: false
|
4347
4355
|
}));
|
4348
4356
|
};
|
4349
4357
|
|