@botpress/webchat 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Composer.d.ts +9 -11
- package/dist/components/Composer.js +3 -3
- package/dist/components/Container.d.ts +8 -7
- package/dist/components/Container.js +4 -4
- package/dist/components/ConversationList.d.ts +6 -3
- package/dist/components/ConversationList.js +6 -4
- package/dist/components/Header.js +3 -3
- package/dist/components/OverridableComponent.js +1 -1
- package/dist/components/VoiceRecorder.js +9 -9
- package/dist/components/common/BotInfo.d.ts +6 -3
- package/dist/components/common/BotInfo.js +4 -4
- package/dist/components/messages/InlineFeedback.js +2 -2
- package/dist/components/messages/Message.d.ts +6 -3
- package/dist/components/messages/Message.js +23 -98
- package/dist/components/messages/MessageGroup.js +7 -11
- package/dist/components/messages/MessageList.d.ts +6 -3
- package/dist/components/messages/MessageList.js +8 -8
- package/dist/core/api.js +3 -3
- package/dist/core/socket.js +1 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +15 -11
- package/dist/main.d.ts +8 -7
- package/dist/main.js +16 -17
- package/dist/store/composer.js +2 -2
- package/dist/store/index.d.ts +3 -3
- package/dist/store/index.js +18 -19
- package/dist/store/view.js +2 -2
- package/dist/translations/index.d.ts +1 -2
- package/dist/translations/index.js +11 -25
- package/dist/utils.js +1 -1
- package/package.json +32 -13
- package/dist/components/messages/renderer/Button.d.ts +0 -16
- package/dist/components/messages/renderer/Button.js +0 -66
- package/dist/components/messages/renderer/Carousel.d.ts +0 -21
- package/dist/components/messages/renderer/Carousel.js +0 -72
- package/dist/components/messages/renderer/Dropdown.d.ts +0 -3
- package/dist/components/messages/renderer/Dropdown.js +0 -76
- package/dist/components/messages/renderer/FileInput.d.ts +0 -9
- package/dist/components/messages/renderer/FileInput.js +0 -32
- package/dist/components/messages/renderer/FileMessage.d.ts +0 -3
- package/dist/components/messages/renderer/FileMessage.js +0 -53
- package/dist/components/messages/renderer/LoginPrompt.d.ts +0 -6
- package/dist/components/messages/renderer/LoginPrompt.js +0 -98
- package/dist/components/messages/renderer/QuickReplies.d.ts +0 -18
- package/dist/components/messages/renderer/QuickReplies.js +0 -73
- package/dist/components/messages/renderer/Text.d.ts +0 -11
- package/dist/components/messages/renderer/Text.js +0 -71
- package/dist/components/messages/renderer/VoiceMessage.d.ts +0 -5
- package/dist/components/messages/renderer/VoiceMessage.js +0 -50
- package/dist/components/messages/renderer/index.d.ts +0 -8
- package/dist/components/messages/renderer/index.js +0 -19
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { StoreDef } from '../store';
|
|
4
|
-
declare const _default: React.
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<ComposerProps, "intl"> & {
|
|
5
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
+
} & React.RefAttributes<any>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<ComposerProps>;
|
|
8
|
+
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
9
|
+
export default _default;
|
|
10
|
+
declare type ComposerProps = {
|
|
5
11
|
focused: boolean;
|
|
6
12
|
composerPlaceholder: string;
|
|
7
13
|
composerLocked: boolean;
|
|
8
14
|
composerHidden: boolean;
|
|
9
|
-
} & Pick<StoreDef,
|
|
10
|
-
WrappedComponent: React.ComponentType<{
|
|
11
|
-
focused: boolean;
|
|
12
|
-
composerPlaceholder: string;
|
|
13
|
-
composerLocked: boolean;
|
|
14
|
-
composerHidden: boolean;
|
|
15
|
-
} & Pick<StoreDef, "intl" | "message" | "composerPlaceholder" | "updateMessage" | "recallHistory" | "focusedArea" | "setFocus" | "focusPrevious" | "focusNext" | "currentConversation" | "preferredLanguage" | "botName" | "isEmulator" | "sendMessage" | "resetSession" | "sendVoiceMessage" | "enableArrowNavigation" | "enableResetSessionShortcut" | "enableVoiceComposer"> & InjectedIntlProps>;
|
|
16
|
-
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
17
|
-
export default _default;
|
|
15
|
+
} & WrappedComponentProps & Pick<StoreDef, 'botName' | 'composerPlaceholder' | 'intl' | 'focusedArea' | 'sendMessage' | 'sendVoiceMessage' | 'focusPrevious' | 'focusNext' | 'recallHistory' | 'setFocus' | 'updateMessage' | 'message' | 'enableArrowNavigation' | 'resetSession' | 'isEmulator' | 'enableResetSessionShortcut' | 'enableVoiceComposer' | 'currentConversation' | 'preferredLanguage'>;
|
|
@@ -70,7 +70,7 @@ class Composer extends react_1.default.Component {
|
|
|
70
70
|
setTimeout(() => {
|
|
71
71
|
this.textInput.current.focus();
|
|
72
72
|
}, 50);
|
|
73
|
-
mobx_1.observe(this.props.focusedArea, (focus) => {
|
|
73
|
+
(0, mobx_1.observe)(this.props.focusedArea, (focus) => {
|
|
74
74
|
focus.newValue === 'input' && this.textInput.current.focus();
|
|
75
75
|
});
|
|
76
76
|
}
|
|
@@ -92,7 +92,7 @@ class Composer extends react_1.default.Component {
|
|
|
92
92
|
react_1.default.createElement("div", { className: 'bpw-send-buttons' }, this.props.enableVoiceComposer && (react_1.default.createElement(VoiceRecorder_1.default, { onStart: this.onVoiceStart, onDone: this.onVoiceEnd, onNotAvailable: this.onVoiceNotAvailable }))))));
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
95
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
96
96
|
enableVoiceComposer: store.config.enableVoiceComposer,
|
|
97
97
|
message: store.composer.message,
|
|
98
98
|
composerLocked: store.composer.locked,
|
|
@@ -114,4 +114,4 @@ exports.default = mobx_react_1.inject(({ store }) => ({
|
|
|
114
114
|
currentConversation: store.currentConversation,
|
|
115
115
|
isEmulator: store.isEmulator,
|
|
116
116
|
preferredLanguage: store.preferredLanguage
|
|
117
|
-
}))(react_intl_1.injectIntl(mobx_react_1.observer(Composer)));
|
|
117
|
+
}))((0, react_intl_1.injectIntl)((0, mobx_react_1.observer)(Composer)));
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { RootStore, StoreDef } from '../store';
|
|
4
|
-
declare const _default: React.
|
|
5
|
-
|
|
6
|
-
} &
|
|
7
|
-
WrappedComponent: React.ComponentType<
|
|
8
|
-
store?: RootStore | undefined;
|
|
9
|
-
} & Pick<StoreDef, "rtl" | "isFullscreen" | "dimensions" | "isConversationsDisplayed" | "isPoweredByDisplayed" | "isBotInfoDisplayed" | "sideTransition" | "config" | "isInitialized" | "botName" | "isEmulator"> & InjectedIntlProps>;
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<ContainerProps, "intl"> & {
|
|
5
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
+
} & React.RefAttributes<any>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<ContainerProps>;
|
|
10
8
|
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
11
9
|
export default _default;
|
|
10
|
+
declare type ContainerProps = {
|
|
11
|
+
store?: RootStore;
|
|
12
|
+
} & WrappedComponentProps & Pick<StoreDef, 'config' | 'botName' | 'isFullscreen' | 'isConversationsDisplayed' | 'isBotInfoDisplayed' | 'sideTransition' | 'isInitialized' | 'dimensions' | 'isEmulator' | 'isPoweredByDisplayed' | 'rtl'>;
|
|
@@ -47,7 +47,7 @@ class Container extends react_1.default.Component {
|
|
|
47
47
|
return react_1.default.createElement(BotInfo_1.default, null);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
return (react_1.default.createElement("div", { className: classnames_1.default('bpw-msg-list-container', {
|
|
50
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('bpw-msg-list-container', {
|
|
51
51
|
'bpw-emulator': this.props.isEmulator,
|
|
52
52
|
'bpw-rtl': this.props.rtl
|
|
53
53
|
}) },
|
|
@@ -57,7 +57,7 @@ class Container extends react_1.default.Component {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
|
-
const classNames = classnames_1.default('bpw-layout', 'bpw-chat-container', {
|
|
60
|
+
const classNames = (0, classnames_1.default)('bpw-layout', 'bpw-chat-container', {
|
|
61
61
|
'bpw-layout-fullscreen': this.props.isFullscreen && 'fullscreen',
|
|
62
62
|
[`bpw-anim-${this.props.sideTransition}`]: true
|
|
63
63
|
});
|
|
@@ -70,7 +70,7 @@ class Container extends react_1.default.Component {
|
|
|
70
70
|
this.props.isPoweredByDisplayed && react_1.default.createElement(Footer_1.default, null))));
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
73
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
74
74
|
store,
|
|
75
75
|
isConversationsDisplayed: store.view.isConversationsDisplayed,
|
|
76
76
|
isBotInfoDisplayed: store.view.isBotInfoDisplayed,
|
|
@@ -83,4 +83,4 @@ exports.default = mobx_react_1.inject(({ store }) => ({
|
|
|
83
83
|
config: store.config,
|
|
84
84
|
botName: store.botName,
|
|
85
85
|
rtl: store.rtl
|
|
86
|
-
}))(react_intl_1.injectIntl(mobx_react_1.observer(Container)));
|
|
86
|
+
}))((0, react_intl_1.injectIntl)((0, mobx_react_1.observer)(Container)));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { StoreDef } from '../store';
|
|
4
|
-
declare const _default: React.
|
|
5
|
-
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<ConversationListProps, "intl"> & {
|
|
5
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
+
} & React.RefAttributes<any>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<ConversationListProps>;
|
|
6
8
|
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
7
9
|
export default _default;
|
|
10
|
+
declare type ConversationListProps = WrappedComponentProps & Pick<StoreDef, 'conversations' | 'fetchConversation' | 'createConversation' | 'enableArrowNavigation'>;
|
|
@@ -3,14 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const intl_utils_1 = require("@formatjs/intl-utils");
|
|
6
7
|
const mobx_react_1 = require("mobx-react");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const react_intl_1 = require("react-intl");
|
|
9
10
|
const Add_1 = __importDefault(require("../icons/Add"));
|
|
10
|
-
const ConversationListItem = react_intl_1.injectIntl(({ conversation, onClick, hasFocus, intl }) => {
|
|
11
|
+
const ConversationListItem = (0, react_intl_1.injectIntl)(({ conversation, onClick, hasFocus, intl }) => {
|
|
11
12
|
var _a, _b, _c;
|
|
12
13
|
const title = intl.formatMessage({ id: 'conversationList.title' }, { id: conversation.id });
|
|
13
|
-
const
|
|
14
|
+
const { value, unit } = (0, intl_utils_1.selectUnit)(((_a = conversation.lastMessage) === null || _a === void 0 ? void 0 : _a.sentOn) || conversation.createdOn);
|
|
15
|
+
const date = intl.formatRelativeTime(value, unit);
|
|
14
16
|
const message = ((_c = (_b = conversation.lastMessage) === null || _b === void 0 ? void 0 : _b.payload) === null || _c === void 0 ? void 0 : _c.text) || '...';
|
|
15
17
|
return (react_1.default.createElement("div", { className: 'bpw-convo-item', onClick: onClick },
|
|
16
18
|
react_1.default.createElement("div", { className: 'bpw-align-right' },
|
|
@@ -72,9 +74,9 @@ class ConversationList extends react_1.default.Component {
|
|
|
72
74
|
react_1.default.createElement(Add_1.default, { width: 15, height: 15 }))));
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
77
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
76
78
|
conversations: store.conversations,
|
|
77
79
|
createConversation: store.createConversation,
|
|
78
80
|
fetchConversation: store.fetchConversation,
|
|
79
81
|
enableArrowNavigation: store.config.enableArrowNavigation
|
|
80
|
-
}))(react_intl_1.injectIntl(mobx_react_1.observer(ConversationList)));
|
|
82
|
+
}))((0, react_intl_1.injectIntl)((0, mobx_react_1.observer)(ConversationList)));
|
|
@@ -115,7 +115,7 @@ class Header extends react_1.default.Component {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
componentDidMount() {
|
|
118
|
-
mobx_1.observe(this.props.focusedArea, (focus) => {
|
|
118
|
+
(0, mobx_1.observe)(this.props.focusedArea, (focus) => {
|
|
119
119
|
focus.newValue === 'header' && this.changeButtonFocus(1);
|
|
120
120
|
});
|
|
121
121
|
}
|
|
@@ -198,7 +198,7 @@ class Header extends react_1.default.Component {
|
|
|
198
198
|
this.props.showCloseButton && this.renderCloseButton()));
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
201
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
202
202
|
intl: store.intl,
|
|
203
203
|
isConversationsDisplayed: store.view.isConversationsDisplayed,
|
|
204
204
|
showDeleteConversationButton: store.view.showDeleteConversationButton,
|
|
@@ -225,4 +225,4 @@ exports.default = mobx_react_1.inject(({ store }) => ({
|
|
|
225
225
|
isEmulator: store.isEmulator,
|
|
226
226
|
botConvoDescription: store.config.botConvoDescription,
|
|
227
227
|
enableArrowNavigation: store.config.enableArrowNavigation
|
|
228
|
-
}))(mobx_react_1.observer(Header));
|
|
228
|
+
}))((0, mobx_react_1.observer)(Header));
|
|
@@ -44,7 +44,7 @@ class OverridableComponent extends react_1.default.Component {
|
|
|
44
44
|
: null;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
47
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
48
48
|
store,
|
|
49
49
|
overrides: store.config.overrides
|
|
50
50
|
}))(OverridableComponent);
|
|
@@ -36,12 +36,12 @@ const lite_1 = __importDefault(require("mime/lite"));
|
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const VoiceRecorder = (props) => {
|
|
38
38
|
var _a;
|
|
39
|
-
const [isRecording, setIsRecording] = react_1.useState(false);
|
|
40
|
-
const mediaRecorder = react_1.useRef(null);
|
|
41
|
-
const mediaChunks = react_1.useRef([]);
|
|
42
|
-
const mediaStream = react_1.useRef(null);
|
|
43
|
-
const isCancelled = react_1.useRef(false);
|
|
44
|
-
const getMediaStream = react_1.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
const [isRecording, setIsRecording] = (0, react_1.useState)(false);
|
|
40
|
+
const mediaRecorder = (0, react_1.useRef)(null);
|
|
41
|
+
const mediaChunks = (0, react_1.useRef)([]);
|
|
42
|
+
const mediaStream = (0, react_1.useRef)(null);
|
|
43
|
+
const isCancelled = (0, react_1.useRef)(false);
|
|
44
|
+
const getMediaStream = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
45
|
var _b;
|
|
46
46
|
try {
|
|
47
47
|
const stream = yield window.navigator.mediaDevices.getUserMedia({ audio: true, video: false });
|
|
@@ -52,7 +52,7 @@ const VoiceRecorder = (props) => {
|
|
|
52
52
|
(_b = props.onNotAvailable) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
53
53
|
}
|
|
54
54
|
}), []);
|
|
55
|
-
react_1.useEffect(() => {
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
56
|
return () => {
|
|
57
57
|
var _a, _b, _c, _d;
|
|
58
58
|
(_a = mediaRecorder.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('dataavailable', onResult);
|
|
@@ -127,7 +127,7 @@ const VoiceRecorder = (props) => {
|
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
129
129
|
return (react_1.default.createElement(react_1.Fragment, null,
|
|
130
|
-
isRecording && (react_1.default.createElement("button", { className: classnames_1.default('bpw-send-button', props.className), onClick: cancelRecording })),
|
|
131
|
-
react_1.default.createElement("button", { className: classnames_1.default('bpw-send-button', props.className), onClick: isRecording ? stopRecording : startRecording })));
|
|
130
|
+
isRecording && (react_1.default.createElement("button", { className: (0, classnames_1.default)('bpw-send-button', props.className), onClick: cancelRecording })),
|
|
131
|
+
react_1.default.createElement("button", { className: (0, classnames_1.default)('bpw-send-button', props.className), onClick: isRecording ? stopRecording : startRecording })));
|
|
132
132
|
};
|
|
133
133
|
exports.default = VoiceRecorder;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { StoreDef } from '../../store';
|
|
4
|
-
declare const _default: React.
|
|
5
|
-
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<BotInfoProps, "intl"> & {
|
|
5
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
+
} & React.RefAttributes<any>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<BotInfoProps>;
|
|
6
8
|
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
7
9
|
export default _default;
|
|
10
|
+
declare type BotInfoProps = WrappedComponentProps & Pick<StoreDef, 'botInfo' | 'botName' | 'avatarUrl' | 'toggleBotInfo' | 'startConversation' | 'isConversationStarted' | 'enableArrowNavigation' | 'updatePreferredLanguage' | 'preferredLanguage' | 'escapeHTML' | 'rtl'>;
|
|
@@ -56,13 +56,13 @@ class BotInfoPage extends React.Component {
|
|
|
56
56
|
(_a = this.btnEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
57
57
|
}
|
|
58
58
|
renderDescription(text) {
|
|
59
|
-
const html = utils_1.renderUnsafeHTML(text, this.props.escapeHTML);
|
|
59
|
+
const html = (0, utils_1.renderUnsafeHTML)(text, this.props.escapeHTML);
|
|
60
60
|
return React.createElement("div", { className: 'bpw-botinfo-description', dangerouslySetInnerHTML: { __html: html } });
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
63
|
const { botInfo, botName, avatarUrl } = this.props;
|
|
64
64
|
const onDismiss = this.props.isConversationStarted ? this.props.toggleBotInfo : this.props.startConversation;
|
|
65
|
-
return (React.createElement("div", { className: classnames_1.default('bpw-botinfo-container', {
|
|
65
|
+
return (React.createElement("div", { className: (0, classnames_1.default)('bpw-botinfo-container', {
|
|
66
66
|
'bpw-rtl': this.props.rtl
|
|
67
67
|
}) },
|
|
68
68
|
React.createElement(CoverPicture, { botInfo: botInfo }),
|
|
@@ -96,7 +96,7 @@ class BotInfoPage extends React.Component {
|
|
|
96
96
|
React.createElement("button", { tabIndex: 1, ref: (el) => (this.btnEl = el), className: 'bpw-botinfo-start-button', onClick: onDismiss.bind(this, undefined) }, this.props.isConversationStarted ? (React.createElement(react_intl_1.FormattedMessage, { id: 'botInfo.backToConversation' })) : (React.createElement(react_intl_1.FormattedMessage, { id: 'botInfo.startConversation' })))));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
99
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
100
100
|
botName: store.botName,
|
|
101
101
|
botInfo: store.botInfo,
|
|
102
102
|
avatarUrl: store.botAvatarUrl,
|
|
@@ -107,4 +107,4 @@ exports.default = mobx_react_1.inject(({ store }) => ({
|
|
|
107
107
|
preferredLanguage: store.preferredLanguage,
|
|
108
108
|
escapeHTML: store.escapeHTML,
|
|
109
109
|
rtl: store.rtl
|
|
110
|
-
}))(react_intl_1.injectIntl(mobx_react_1.observer(BotInfoPage)));
|
|
110
|
+
}))((0, react_intl_1.injectIntl)((0, mobx_react_1.observer)(BotInfoPage)));
|
|
@@ -27,8 +27,8 @@ const react_1 = __importStar(require("react"));
|
|
|
27
27
|
const ThumbsDown_1 = __importDefault(require("../../icons/ThumbsDown"));
|
|
28
28
|
const ThumbsUp_1 = __importDefault(require("../../icons/ThumbsUp"));
|
|
29
29
|
const InlineFeedback = ({ messageFeedbacks, messageId, onFeedback, intl }) => {
|
|
30
|
-
const [feedbackSent, setFeedbackSent] = react_1.useState(false);
|
|
31
|
-
react_1.useEffect(() => {
|
|
30
|
+
const [feedbackSent, setFeedbackSent] = (0, react_1.useState)(false);
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
32
|
if (messageFeedbacks && messageFeedbacks.find((x) => x.messageId === messageId && x.feedback != null)) {
|
|
33
33
|
setFeedbackSent(true);
|
|
34
34
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { StoreDef } from '../../store';
|
|
4
4
|
import { Renderer } from '../../typings';
|
|
5
|
-
declare const _default: React.
|
|
6
|
-
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<MessageProps, "intl"> & {
|
|
6
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
7
|
+
} & React.RefAttributes<any>> & {
|
|
8
|
+
WrappedComponent: React.ComponentType<MessageProps>;
|
|
7
9
|
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
8
10
|
export default _default;
|
|
11
|
+
declare type MessageProps = Renderer.Message & WrappedComponentProps & Pick<StoreDef, 'intl'>;
|
|
@@ -31,13 +31,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
const messaging_components_1 = __importDefault(require("@botpress/messaging-components"));
|
|
34
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
36
|
const mobx_react_1 = require("mobx-react");
|
|
36
37
|
const react_1 = __importStar(require("react"));
|
|
37
38
|
const react_intl_1 = require("react-intl");
|
|
38
39
|
const ContextMenu_1 = require("../ContextMenu");
|
|
39
|
-
const renderer_1 = require("./renderer");
|
|
40
|
-
const Dropdown_1 = require("./renderer/Dropdown");
|
|
41
40
|
class Message extends react_1.Component {
|
|
42
41
|
constructor() {
|
|
43
42
|
super(...arguments);
|
|
@@ -46,101 +45,12 @@ class Message extends react_1.Component {
|
|
|
46
45
|
showMore: false
|
|
47
46
|
};
|
|
48
47
|
this.handleContextMenu = (e) => {
|
|
49
|
-
ContextMenu_1.showContextMenu(e, this.props);
|
|
48
|
+
(0, ContextMenu_1.showContextMenu)(e, this.props);
|
|
50
49
|
};
|
|
51
50
|
}
|
|
52
51
|
static getDerivedStateFromError(_error) {
|
|
53
52
|
return { hasError: true };
|
|
54
53
|
}
|
|
55
|
-
render_text(textMessage) {
|
|
56
|
-
const { text, markdown } = this.props.payload;
|
|
57
|
-
const message = textMessage || text;
|
|
58
|
-
return (react_1.default.createElement(renderer_1.Text, { markdown: markdown, text: message, intl: this.props.intl, maxLength: this.props.payload.trimLength, escapeHTML: this.props.store.escapeHTML }));
|
|
59
|
-
}
|
|
60
|
-
render_quick_reply() {
|
|
61
|
-
return this.render_text();
|
|
62
|
-
}
|
|
63
|
-
render_login_prompt() {
|
|
64
|
-
return (react_1.default.createElement(renderer_1.LoginPrompt, { isLastMessage: this.props.isLastGroup && this.props.isLastOfGroup, isBotMessage: this.props.isBotMessage, onSendData: this.props.onSendData }));
|
|
65
|
-
}
|
|
66
|
-
render_carousel() {
|
|
67
|
-
return react_1.default.createElement(renderer_1.Carousel, { onSendData: this.props.onSendData, carousel: this.props.payload });
|
|
68
|
-
}
|
|
69
|
-
render_typing() {
|
|
70
|
-
return (react_1.default.createElement("div", { className: 'bpw-typing-group' },
|
|
71
|
-
react_1.default.createElement("div", { className: 'bpw-typing-bubble' }),
|
|
72
|
-
react_1.default.createElement("div", { className: 'bpw-typing-bubble' }),
|
|
73
|
-
react_1.default.createElement("div", { className: 'bpw-typing-bubble' })));
|
|
74
|
-
}
|
|
75
|
-
render_audio() {
|
|
76
|
-
return react_1.default.createElement(renderer_1.FileMessage, { file: this.props.payload, escapeTextHTML: this.props.store.escapeHTML });
|
|
77
|
-
}
|
|
78
|
-
render_video() {
|
|
79
|
-
return react_1.default.createElement(renderer_1.FileMessage, { file: this.props.payload, escapeTextHTML: this.props.store.escapeHTML });
|
|
80
|
-
}
|
|
81
|
-
render_image() {
|
|
82
|
-
return react_1.default.createElement(renderer_1.FileMessage, { file: this.props.payload, escapeTextHTML: this.props.store.escapeHTML });
|
|
83
|
-
}
|
|
84
|
-
render_file() {
|
|
85
|
-
return react_1.default.createElement(renderer_1.FileMessage, { file: this.props.payload, escapeTextHTML: this.props.store.escapeHTML });
|
|
86
|
-
}
|
|
87
|
-
render_voice() {
|
|
88
|
-
return (react_1.default.createElement(renderer_1.VoiceMessage, { file: this.props.payload, shouldPlay: this.props.shouldPlay, onAudioEnded: this.props.onAudioEnded }));
|
|
89
|
-
}
|
|
90
|
-
render_custom() {
|
|
91
|
-
// This doesn't work at the moment. We can't get the InjectedModuleView
|
|
92
|
-
/*
|
|
93
|
-
const { module = undefined, component = undefined, wrapped = undefined } = this.props.payload || {}
|
|
94
|
-
if (!module || !component) {
|
|
95
|
-
return this.render_unsupported()
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// TODO: Remove eventually, it's for backward compatibility
|
|
99
|
-
if (module === 'extensions' && component === 'Dropdown') {
|
|
100
|
-
return this.render_dropdown()
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const InjectedModuleView = this.props.store!.bp.getModuleInjector()
|
|
104
|
-
|
|
105
|
-
const messageDataProps = { ...this.props.payload }
|
|
106
|
-
delete messageDataProps.module
|
|
107
|
-
delete messageDataProps.component
|
|
108
|
-
|
|
109
|
-
const sanitizedProps = pick(this.props, [
|
|
110
|
-
'messageId',
|
|
111
|
-
'isLastGroup',
|
|
112
|
-
'isLastOfGroup',
|
|
113
|
-
'isBotMessage',
|
|
114
|
-
'onSendData',
|
|
115
|
-
'onFileUpload',
|
|
116
|
-
'sentOn',
|
|
117
|
-
'store',
|
|
118
|
-
'className',
|
|
119
|
-
'intl'
|
|
120
|
-
])
|
|
121
|
-
|
|
122
|
-
const props = {
|
|
123
|
-
...sanitizedProps,
|
|
124
|
-
...messageDataProps,
|
|
125
|
-
keyboard: Keyboard,
|
|
126
|
-
children: wrapped && <Message {...sanitizedProps} keyboard={Keyboard} noBubble payload={wrapped} />
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return <InjectedModuleView moduleName={module} componentName={component} lite extraProps={props} />
|
|
130
|
-
*/
|
|
131
|
-
}
|
|
132
|
-
render_session_reset() {
|
|
133
|
-
return this.render_text(this.props.store.intl.formatMessage({ id: 'store.resetSessionMessage' }));
|
|
134
|
-
}
|
|
135
|
-
render_visit() {
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
render_unsupported() {
|
|
139
|
-
return '*Unsupported message type*';
|
|
140
|
-
}
|
|
141
|
-
render_dropdown() {
|
|
142
|
-
return react_1.default.createElement(Dropdown_1.Dropdown, Object.assign({}, this.props, this.props.payload, { escapeHTML: this.props.store.escapeHTML }));
|
|
143
|
-
}
|
|
144
54
|
renderTimestamp() {
|
|
145
55
|
return (react_1.default.createElement("span", { className: "bpw-message-timestamp" }, this.props.store.intl.formatTime(new Date(this.props.sentOn), { hour: 'numeric', minute: 'numeric' })));
|
|
146
56
|
}
|
|
@@ -156,18 +66,33 @@ class Message extends react_1.Component {
|
|
|
156
66
|
}
|
|
157
67
|
const type = this.props.type || (this.props.payload && this.props.payload.type);
|
|
158
68
|
const wrappedType = this.props.payload && this.props.payload.wrapped && this.props.payload.wrapped.type;
|
|
159
|
-
const renderer = (this[`render_${type}`] || this.render_unsupported).bind(this);
|
|
160
69
|
const wrappedClass = `bpw-bubble-${wrappedType}`;
|
|
161
70
|
const isEmulator = this.props.store.config.isEmulator;
|
|
162
|
-
const rendered =
|
|
71
|
+
const rendered = (react_1.default.createElement(messaging_components_1.default, { key: this.props.messageId, content: this.props.payload, config: {
|
|
72
|
+
messageId: this.props.messageId,
|
|
73
|
+
noMessageBubble: this.props.noBubble,
|
|
74
|
+
isLastOfGroup: this.props.isLastOfGroup,
|
|
75
|
+
isLastGroup: this.props.isLastGroup,
|
|
76
|
+
isBotMessage: this.props.isBotMessage,
|
|
77
|
+
sentOn: this.props.sentOn,
|
|
78
|
+
onSendData: this.props.onSendData,
|
|
79
|
+
onFileUpload: this.props.onFileUpload,
|
|
80
|
+
store: this.props.store,
|
|
81
|
+
onAudioEnded: this.props.onAudioEnded,
|
|
82
|
+
shouldPlay: this.props.shouldPlay,
|
|
83
|
+
intl: this.props.store.intl,
|
|
84
|
+
escapeHTML: true,
|
|
85
|
+
isInEmulator: this.props.store.config.isEmulator,
|
|
86
|
+
showTimestamp: this.props.store.config.showTimestamp
|
|
87
|
+
} }));
|
|
163
88
|
if (rendered === null) {
|
|
164
89
|
return null;
|
|
165
90
|
}
|
|
166
91
|
const additionalStyle = (this.props.payload && this.props.payload['web-style']) || {};
|
|
167
92
|
if (this.props.noBubble || ((_b = (_a = this.props.payload) === null || _a === void 0 ? void 0 : _a.wrapped) === null || _b === void 0 ? void 0 : _b.noBubble)) {
|
|
168
|
-
return (react_1.default.createElement("div", { className: classnames_1.default(this.props.className, wrappedClass), style: additionalStyle }, rendered));
|
|
93
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(this.props.className, wrappedClass), style: additionalStyle }, rendered));
|
|
169
94
|
}
|
|
170
|
-
return (react_1.default.createElement("div", { className: classnames_1.default(this.props.className, wrappedClass, 'bpw-chat-bubble', `bpw-bubble-${type}`, {
|
|
95
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(this.props.className, wrappedClass, 'bpw-chat-bubble', `bpw-bubble-${type}`, {
|
|
171
96
|
'bpw-bubble-highlight': this.props.isHighlighted,
|
|
172
97
|
'bpw-msg-hovering': isEmulator
|
|
173
98
|
}), "data-from": this.props.fromLabel, onClick: () => this.onMessageClicked(), tabIndex: -1, style: additionalStyle },
|
|
@@ -181,6 +106,6 @@ class Message extends react_1.Component {
|
|
|
181
106
|
this.props.inlineFeedback));
|
|
182
107
|
}
|
|
183
108
|
}
|
|
184
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
109
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
185
110
|
intl: store.intl
|
|
186
|
-
}))(react_intl_1.injectIntl(mobx_react_1.observer(Message)));
|
|
111
|
+
}))((0, react_intl_1.injectIntl)((0, mobx_react_1.observer)(Message)));
|
|
@@ -66,7 +66,7 @@ class MessageGroup extends react_1.default.Component {
|
|
|
66
66
|
if (this.state.hasError) {
|
|
67
67
|
return '* Cannot display message *';
|
|
68
68
|
}
|
|
69
|
-
return (react_1.default.createElement("div", { role: "main", className: classnames_1.default('bpw-message-big-container', {
|
|
69
|
+
return (react_1.default.createElement("div", { role: "main", className: (0, classnames_1.default)('bpw-message-big-container', {
|
|
70
70
|
'bpw-from-user': !isBot,
|
|
71
71
|
'bpw-from-bot': isBot
|
|
72
72
|
}) },
|
|
@@ -75,23 +75,19 @@ class MessageGroup extends react_1.default.Component {
|
|
|
75
75
|
showUserName && react_1.default.createElement("div", { className: 'bpw-message-username' }, userName),
|
|
76
76
|
react_1.default.createElement("div", { "aria-live": "assertive", role: "log", className: 'bpw-message-group' },
|
|
77
77
|
react_1.default.createElement("span", { "data-from": fromLabel, className: "from hidden", "aria-hidden": "true" }, fromLabel),
|
|
78
|
-
sortBy_1.default(messages, ['sent_on', 'eventId']).map((message, i, messages) => {
|
|
78
|
+
(0, sortBy_1.default)(messages, ['sent_on', 'eventId']).map((message, i, messages) => {
|
|
79
79
|
const isLastMsg = i === messages.length - 1;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
payload = { ...payload, wrapped: renderPayload(payload.wrapped) }
|
|
85
|
-
} else {
|
|
86
|
-
payload = renderPayload(payload)
|
|
80
|
+
let payload = this.convertPayloadFromOldFormat(message);
|
|
81
|
+
// TODO: remove this. quick_reply should be single-choice
|
|
82
|
+
if (payload.type === 'single-choice') {
|
|
83
|
+
payload = Object.assign(Object.assign({}, payload), { type: 'quick_reply' });
|
|
87
84
|
}
|
|
88
|
-
*/
|
|
89
85
|
const showInlineFeedback = isBot && isLastMsg && (payload.wrapped ? payload.wrapped.collectFeedback : payload.collectFeedback);
|
|
90
86
|
return (react_1.default.createElement(Message_1.default, { key: message.id, isHighlighted: this.props.highlightedMessages && this.props.highlightedMessages.includes(message.id), inlineFeedback: showInlineFeedback && (react_1.default.createElement(InlineFeedback_1.InlineFeedback, { intl: this.props.store.intl, messageId: message.id, onFeedback: this.props.onFeedback, messageFeedbacks: this.props.store.messageFeedbacks })), messageId: message.id, noBubble: !!payload.noBubble, fromLabel: fromLabel, isLastOfGroup: i >= this.props.messages.length - 1, isLastGroup: this.props.isLastGroup, isBotMessage: !message.authorId, payload: payload, sentOn: message.sentOn, onSendData: this.props.onSendData, onFileUpload: this.props.onFileUpload, store: this.props.store, onAudioEnded: this.onAudioEnded, shouldPlay: this.state.audioPlayingIndex === i }));
|
|
91
87
|
})))));
|
|
92
88
|
}
|
|
93
89
|
}
|
|
94
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
90
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
95
91
|
store,
|
|
96
92
|
onFeedback: store.sendFeedback,
|
|
97
93
|
onSendData: store.sendData,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
3
|
import { StoreDef } from '../../store';
|
|
4
|
-
declare const _default: React.
|
|
5
|
-
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<MessageListProps, "intl"> & {
|
|
5
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
+
} & React.RefAttributes<any>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<MessageListProps>;
|
|
6
8
|
} & import("mobx-react").IWrappedComponent<unknown>;
|
|
7
9
|
export default _default;
|
|
10
|
+
declare type MessageListProps = WrappedComponentProps & Pick<StoreDef, 'intl' | 'isBotTyping' | 'focusedArea' | 'focusPrevious' | 'focusNext' | 'botAvatarUrl' | 'isEmulator' | 'botName' | 'enableArrowNavigation' | 'showUserAvatar' | 'currentMessages' | 'preferredLanguage'>;
|
|
@@ -36,7 +36,7 @@ class MessageList extends react_1.default.Component {
|
|
|
36
36
|
this.shouldDisplayMessage = (m) => {
|
|
37
37
|
return m.payload.type !== 'postback';
|
|
38
38
|
};
|
|
39
|
-
this.handleScroll = debounce_1.default((e) => {
|
|
39
|
+
this.handleScroll = (0, debounce_1.default)((e) => {
|
|
40
40
|
const scroll = this.messagesDiv.scrollHeight - this.messagesDiv.scrollTop - this.messagesDiv.clientHeight;
|
|
41
41
|
const manualScroll = scroll >= 150;
|
|
42
42
|
const showNewMessageIndicator = this.state.showNewMessageIndicator && manualScroll;
|
|
@@ -45,11 +45,11 @@ class MessageList extends react_1.default.Component {
|
|
|
45
45
|
}
|
|
46
46
|
componentDidMount() {
|
|
47
47
|
this.tryScrollToBottom(true);
|
|
48
|
-
mobx_1.observe(this.props.focusedArea, (focus) => {
|
|
48
|
+
(0, mobx_1.observe)(this.props.focusedArea, (focus) => {
|
|
49
49
|
focus.newValue === 'convo' && this.messagesDiv.focus();
|
|
50
50
|
});
|
|
51
51
|
if (this.props.currentMessages) {
|
|
52
|
-
mobx_1.observe(this.props.currentMessages, (messages) => {
|
|
52
|
+
(0, mobx_1.observe)(this.props.currentMessages, (messages) => {
|
|
53
53
|
if (this.state.manualScroll) {
|
|
54
54
|
if (!this.state.showNewMessageIndicator) {
|
|
55
55
|
this.setState({ showNewMessageIndicator: true });
|
|
@@ -60,7 +60,7 @@ class MessageList extends react_1.default.Component {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
// this should account for keyboard rendering as it triggers a resize of the messagesDiv
|
|
63
|
-
this.divSizeObserver = new resize_observer_1.ResizeObserver(debounce_1.default(([divResizeEntry]) => {
|
|
63
|
+
this.divSizeObserver = new resize_observer_1.ResizeObserver((0, debounce_1.default)(([divResizeEntry]) => {
|
|
64
64
|
// we don't need to do anything with the resize entry
|
|
65
65
|
this.tryScrollToBottom();
|
|
66
66
|
}, 200, { trailing: true }));
|
|
@@ -112,7 +112,7 @@ class MessageList extends react_1.default.Component {
|
|
|
112
112
|
// Create a new group if messages are separated by more than X minutes or if different speaker
|
|
113
113
|
if (speaker !== lastSpeaker ||
|
|
114
114
|
!currentGroup ||
|
|
115
|
-
difference_in_minutes_1.default(new Date(date), new Date(lastDate)) >= constants_1.default.TIME_BETWEEN_DATES) {
|
|
115
|
+
(0, difference_in_minutes_1.default)(new Date(date), new Date(lastDate)) >= constants_1.default.TIME_BETWEEN_DATES) {
|
|
116
116
|
currentGroup = [];
|
|
117
117
|
groups.push(currentGroup);
|
|
118
118
|
}
|
|
@@ -139,7 +139,7 @@ class MessageList extends react_1.default.Component {
|
|
|
139
139
|
const lastDate = (_a = lastGroup === null || lastGroup === void 0 ? void 0 : lastGroup[lastGroup.length - 1]) === null || _a === void 0 ? void 0 : _a.sentOn;
|
|
140
140
|
const groupDate = group === null || group === void 0 ? void 0 : group[0].sentOn;
|
|
141
141
|
const isDateNeeded = !groups[i - 1] ||
|
|
142
|
-
difference_in_minutes_1.default(new Date(groupDate), new Date(lastDate)) > constants_1.default.TIME_BETWEEN_DATES;
|
|
142
|
+
(0, difference_in_minutes_1.default)(new Date(groupDate), new Date(lastDate)) > constants_1.default.TIME_BETWEEN_DATES;
|
|
143
143
|
const [{ authorId, payload }] = group;
|
|
144
144
|
const avatar = authorId
|
|
145
145
|
? this.props.showUserAvatar &&
|
|
@@ -161,7 +161,7 @@ class MessageList extends react_1.default.Component {
|
|
|
161
161
|
this.renderMessageGroups()));
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
exports.default = mobx_react_1.inject(({ store }) => ({
|
|
164
|
+
exports.default = (0, mobx_react_1.inject)(({ store }) => ({
|
|
165
165
|
intl: store.intl,
|
|
166
166
|
isEmulator: store.isEmulator,
|
|
167
167
|
botName: store.botName,
|
|
@@ -174,4 +174,4 @@ exports.default = mobx_react_1.inject(({ store }) => ({
|
|
|
174
174
|
showUserAvatar: store.config.showUserAvatar,
|
|
175
175
|
enableArrowNavigation: store.config.enableArrowNavigation,
|
|
176
176
|
preferredLanguage: store.preferredLanguage
|
|
177
|
-
}))(react_intl_1.injectIntl(mobx_react_1.observer(MessageList)));
|
|
177
|
+
}))((0, react_intl_1.injectIntl)((0, mobx_react_1.observer)(MessageList)));
|
package/dist/core/api.js
CHANGED
|
@@ -13,13 +13,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const get_1 = __importDefault(require("lodash/get"));
|
|
16
|
-
const uuid_1 =
|
|
16
|
+
const uuid_1 = require("uuid");
|
|
17
17
|
class WebchatApi {
|
|
18
18
|
constructor(socket) {
|
|
19
19
|
this.socket = socket;
|
|
20
20
|
this.handleApiError = (error) => __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
// @deprecated 11.9 (replace with proper error management)
|
|
22
|
-
const data = get_1.default(error, 'response.data', {});
|
|
22
|
+
const data = (0, get_1.default)(error, 'response.data', {});
|
|
23
23
|
if (data && typeof data === 'string' && data.includes('BP_CONV_NOT_FOUND')) {
|
|
24
24
|
console.error('Conversation not found, starting a new one...');
|
|
25
25
|
yield this.createConversation();
|
|
@@ -190,7 +190,7 @@ class WebchatApi {
|
|
|
190
190
|
try {
|
|
191
191
|
const audio = {
|
|
192
192
|
buffer: voice.toString('base64'),
|
|
193
|
-
title: `${uuid_1.
|
|
193
|
+
title: `${(0, uuid_1.v4)()}.${ext}`
|
|
194
194
|
};
|
|
195
195
|
return this.axios.post('/messages/voice', Object.assign(Object.assign({}, this.baseUserPayload), { conversationId, audio }), this.axiosConfig);
|
|
196
196
|
}
|