@memori.ai/memori-react 2.3.1 → 2.4.1
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/CHANGELOG.md +15 -0
- package/README.md +62 -8
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +15 -5
- package/dist/components/MemoriWidget/MemoriWidget.js +100 -16
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/layouts/Chat.js +1 -1
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/FullPage.js +1 -1
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/Totem.js +1 -1
- package/dist/components/layouts/Totem.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +15 -5
- package/esm/components/MemoriWidget/MemoriWidget.js +100 -16
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/layouts/Chat.js +1 -1
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/FullPage.js +1 -1
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/Totem.js +1 -1
- package/esm/components/layouts/Totem.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MemoriWidget/MemoriWidget.tsx +142 -143
- package/src/components/layouts/Chat.tsx +19 -7
- package/src/components/layouts/FullPage.tsx +20 -9
- package/src/components/layouts/Totem.tsx +24 -9
- package/src/components/layouts/layouts.stories.tsx +15 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [2.4.1](https://github.com/memori-ai/memori-react/compare/v2.4.0...v2.4.1) (2023-06-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* default spoken lang order, first is prop ([eadac28](https://github.com/memori-ai/memori-react/commit/eadac284d96f2f5d974967a178638b4314dac3be))
|
|
9
|
+
|
|
10
|
+
## [2.4.0](https://github.com/memori-ai/memori-react/compare/v2.3.1...v2.4.0) (2023-06-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Changes
|
|
14
|
+
|
|
15
|
+
* chat layout with layout props ([eee4cf5](https://github.com/memori-ai/memori-react/commit/eee4cf5e893dd65e7b341516a0f2dcfb65519841))
|
|
16
|
+
* move everything as layout prop ([1c42027](https://github.com/memori-ai/memori-react/commit/1c42027083ba772b533c9d8035e599327fa19e6f))
|
|
17
|
+
|
|
3
18
|
## [2.3.1](https://github.com/memori-ai/memori-react/compare/v2.3.0...v2.3.1) (2023-06-07)
|
|
4
19
|
|
|
5
20
|
|
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ const App = () => (
|
|
|
79
79
|
| `spokenLang` | | `string` | | Language of the spoken text, as defaults to user selection. Example: "en" or "it" |
|
|
80
80
|
| `onStateChange` | | `function` | | Callback function called when the state of the Memori changes |
|
|
81
81
|
| `AZURE_COGNITIVE_SERVICES_TTS_KEY` | | `string` | | Azure Cognitive Services TTS key, used to generate the audio of the Memori and for STT recognition |
|
|
82
|
-
| `layout` | | `string` | | Layout of the Memori, can be "FULLPAGE" (default), "CHAT" or "TOTEM", see [below](#layouts)
|
|
82
|
+
| `layout` | | `string` | | Layout of the Memori, can be "FULLPAGE" (default), "CHAT" or "TOTEM", see [below](#layouts) |
|
|
83
83
|
| `customLayout` | | `React.FC<LayoutProps>` | | Custom layout component, see [below](#custom-layout) |
|
|
84
84
|
|
|
85
85
|
\*: one of these pairs is required: `memoriName` + `ownerUserName`, `memoriID` + `ownerUserID`
|
|
@@ -110,14 +110,19 @@ The custom layout component must be a React functional component that accepts a
|
|
|
110
110
|
```tsx
|
|
111
111
|
import type { LayoutProps } from '@memori.ai/memori-react/components/MemoriWidget';
|
|
112
112
|
|
|
113
|
-
const MyCustomLayout: React.FC<LayoutProps> =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
const MyCustomLayout: React.FC<LayoutProps> = ({
|
|
114
|
+
Header,
|
|
115
|
+
headerProps,
|
|
116
|
+
Avatar,
|
|
117
|
+
avatarProps,
|
|
118
|
+
Chat,
|
|
119
|
+
chatProps,
|
|
120
|
+
StartPanel,
|
|
121
|
+
startPanelProps,
|
|
118
122
|
integrationStyle,
|
|
119
123
|
integrationBackground,
|
|
120
|
-
|
|
124
|
+
ChangeMode,
|
|
125
|
+
changeModeProps,
|
|
121
126
|
sessionId,
|
|
122
127
|
hasUserActivatedSpeak,
|
|
123
128
|
showInstruct = false,
|
|
@@ -132,7 +137,11 @@ const MyCustomLayout: React.FC<LayoutProps> = = ({
|
|
|
132
137
|
{poweredBy}
|
|
133
138
|
|
|
134
139
|
<div className="memori-mycustom-layout--controls">
|
|
135
|
-
{sessionId && hasUserActivatedSpeak
|
|
140
|
+
{sessionId && hasUserActivatedSpeak && Chat && chatProps ? (
|
|
141
|
+
<Chat {...chatProps} />
|
|
142
|
+
) : startPanelProps ? (
|
|
143
|
+
<StartPanel {...startPanelProps} />
|
|
144
|
+
) : null}
|
|
136
145
|
</div>
|
|
137
146
|
</Spin>
|
|
138
147
|
</>
|
|
@@ -148,6 +157,51 @@ And then pass it to the `customLayout` prop:
|
|
|
148
157
|
/>
|
|
149
158
|
```
|
|
150
159
|
|
|
160
|
+
## Component overrides
|
|
161
|
+
|
|
162
|
+
When using the `customLayout` prop, you can also override the default components used by the client.
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
const MyCustomChat: LayoutProps['Chat'] = ({ history, sendMessage }) => {
|
|
166
|
+
const [message, setMessage] = React.useState('');
|
|
167
|
+
|
|
168
|
+
...
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const MyCustomAvatar: LayoutProps['Avatar'] = (props) => {
|
|
172
|
+
...
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const CustomLayout: React.FC<LayoutProps> = ({
|
|
176
|
+
avatarProps,
|
|
177
|
+
chatProps,
|
|
178
|
+
StartPanel,
|
|
179
|
+
startPanelProps,
|
|
180
|
+
sessionId,
|
|
181
|
+
hasUserActivatedSpeak,
|
|
182
|
+
loading = false,
|
|
183
|
+
poweredBy,
|
|
184
|
+
}) => (
|
|
185
|
+
<>
|
|
186
|
+
<Spin spinning={loading} className="memori-mycustom-layout">
|
|
187
|
+
{poweredBy}
|
|
188
|
+
|
|
189
|
+
<div className="memori-mycustom-layout--avatar">
|
|
190
|
+
<MyCustomAvatar {...avatarProps} />
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<div className="memori-mycustom-layout--controls">
|
|
194
|
+
{sessionId && hasUserActivatedSpeak && Chat && chatProps ? (
|
|
195
|
+
<MyCustomChat {...chatProps} />
|
|
196
|
+
) : startPanelProps ? (
|
|
197
|
+
<StartPanel {...startPanelProps} />
|
|
198
|
+
) : null}
|
|
199
|
+
</div>
|
|
200
|
+
</Spin>
|
|
201
|
+
</>
|
|
202
|
+
);
|
|
203
|
+
```
|
|
204
|
+
|
|
151
205
|
## See also
|
|
152
206
|
|
|
153
207
|
- [memori-api-client](https://github.com/memori-ai/memori-api-client) - API client for Memori
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { DialogState, Memori, Integration, MemoriConfig, Tenant } from '@memori.ai/memori-api-client/src/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import Chat, { Props as ChatProps } from '../Chat/Chat';
|
|
4
|
+
import StartPanel, { Props as StartPanelProps } from '../StartPanel/StartPanel';
|
|
5
|
+
import Avatar, { Props as AvatarProps } from '../Avatar/Avatar';
|
|
6
|
+
import ChangeMode, { Props as ChangeModeProps } from '../ChangeMode/ChangeMode';
|
|
7
|
+
import Header, { Props as HeaderProps } from '../Header/Header';
|
|
3
8
|
declare const getMemoriState: (integrationId?: string | undefined) => object | null;
|
|
4
9
|
declare const typeMessage: (message: string) => void;
|
|
5
10
|
declare global {
|
|
@@ -9,13 +14,18 @@ declare global {
|
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
16
|
export interface LayoutProps {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
Header?: typeof Header;
|
|
18
|
+
headerProps?: HeaderProps;
|
|
19
|
+
Avatar: typeof Avatar;
|
|
20
|
+
avatarProps?: AvatarProps;
|
|
21
|
+
Chat?: typeof Chat;
|
|
22
|
+
chatProps?: ChatProps;
|
|
23
|
+
StartPanel: typeof StartPanel;
|
|
24
|
+
startPanelProps?: StartPanelProps;
|
|
16
25
|
integrationStyle?: JSX.Element | null;
|
|
17
26
|
integrationBackground?: JSX.Element | null;
|
|
18
|
-
|
|
27
|
+
ChangeMode?: typeof ChangeMode;
|
|
28
|
+
changeModeProps?: ChangeModeProps;
|
|
19
29
|
poweredBy?: JSX.Element | null;
|
|
20
30
|
sessionId?: string;
|
|
21
31
|
hasUserActivatedSpeak?: boolean;
|
|
@@ -87,7 +87,7 @@ let speechSynthesizer;
|
|
|
87
87
|
let audioDestination;
|
|
88
88
|
let audioContext;
|
|
89
89
|
const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout = 'DEFAULT', customLayout, showInstruct = false, showShare = true, preview = false, embed = false, showInputs = true, showDates = false, showContextPerLine = false, showSettings = true, height = '100vh', secret, baseUrl = 'https://app.twincreator.com', apiUrl = 'https://backend.memori.ai', initialContextVars, initialQuestion, ogImage, sessionID: initialSessionID, tenant, personification, authToken, AZURE_COGNITIVE_SERVICES_TTS_KEY, onStateChange, }) => {
|
|
90
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _t, _u, _v, _w, _x
|
|
90
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _t, _u, _v, _w, _x;
|
|
91
91
|
const { t, i18n } = (0, react_i18next_1.useTranslation)();
|
|
92
92
|
const [isClient, setIsClient] = (0, react_1.useState)(false);
|
|
93
93
|
(0, react_1.useEffect)(() => {
|
|
@@ -103,7 +103,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
103
103
|
? JSON.parse(integration.customData)
|
|
104
104
|
: null;
|
|
105
105
|
const isMultilanguageEnabled = !!(integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.multilanguage);
|
|
106
|
-
const [userLang, setUserLang] = (0, react_1.useState)((
|
|
106
|
+
const [userLang, setUserLang] = (0, react_1.useState)((_m = (_l = (_k = (_j = (_f = memoriLang !== null && memoriLang !== void 0 ? memoriLang : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.lang) !== null && _f !== void 0 ? _f : (_h = (_g = memori === null || memori === void 0 ? void 0 : memori.culture) === null || _g === void 0 ? void 0 : _g.split('-')) === null || _h === void 0 ? void 0 : _h[0]) !== null && _j !== void 0 ? _j : language) !== null && _k !== void 0 ? _k : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.uiLang) !== null && _l !== void 0 ? _l : i18n.language) !== null && _m !== void 0 ? _m : 'IT');
|
|
107
107
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
108
108
|
const [memoriTyping, setMemoriTyping] = (0, react_1.useState)(false);
|
|
109
109
|
const selectedLayout = layout || (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.layout) || 'DEFAULT';
|
|
@@ -1115,7 +1115,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1115
1115
|
? {
|
|
1116
1116
|
'--memori-chat-bubble-bg': '#fff',
|
|
1117
1117
|
...(integrationConfig && !showInstruct
|
|
1118
|
-
? { '--memori-text-color': (
|
|
1118
|
+
? { '--memori-text-color': (_o = integrationConfig.textColor) !== null && _o !== void 0 ? _o : '#000' }
|
|
1119
1119
|
: {}),
|
|
1120
1120
|
...((integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.buttonBgColor)
|
|
1121
1121
|
? {
|
|
@@ -1139,12 +1139,12 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1139
1139
|
? {
|
|
1140
1140
|
'--memori-inner-bg': `rgba(${integrationConfig.innerBgColor === 'dark'
|
|
1141
1141
|
? '0, 0, 0'
|
|
1142
|
-
: '255, 255, 255'}, ${(
|
|
1142
|
+
: '255, 255, 255'}, ${(_p = integrationConfig.innerBgAlpha) !== null && _p !== void 0 ? _p : 0.4})`,
|
|
1143
1143
|
'--memori-inner-content-pad': '1.5rem',
|
|
1144
1144
|
'--memori-nav-bg-image': 'none',
|
|
1145
1145
|
'--memori-nav-bg': `rgba(${integrationConfig.innerBgColor === 'dark'
|
|
1146
1146
|
? '0, 0, 0'
|
|
1147
|
-
: '255, 255, 255'}, ${(
|
|
1147
|
+
: '255, 255, 255'}, ${(_q = integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.innerBgAlpha) !== null && _q !== void 0 ? _q : 0.4})`,
|
|
1148
1148
|
}
|
|
1149
1149
|
: {
|
|
1150
1150
|
'--memori-inner-content-pad': '0px',
|
|
@@ -1493,7 +1493,16 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1493
1493
|
observer.disconnect();
|
|
1494
1494
|
};
|
|
1495
1495
|
}, []);
|
|
1496
|
-
const
|
|
1496
|
+
const headerProps = {
|
|
1497
|
+
memori,
|
|
1498
|
+
history,
|
|
1499
|
+
showShare,
|
|
1500
|
+
position,
|
|
1501
|
+
setShowPositionDrawer,
|
|
1502
|
+
setShowSettingsDrawer,
|
|
1503
|
+
showSpeaker: !!AZURE_COGNITIVE_SERVICES_TTS_KEY,
|
|
1504
|
+
speakerMuted: muteSpeaker,
|
|
1505
|
+
setSpeakerMuted: mute => {
|
|
1497
1506
|
setMuteSpeaker(mute);
|
|
1498
1507
|
if (mute) {
|
|
1499
1508
|
stopAudio();
|
|
@@ -1505,20 +1514,91 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1505
1514
|
source.buffer = buffer;
|
|
1506
1515
|
source.connect(audioContext.destination);
|
|
1507
1516
|
}
|
|
1508
|
-
},
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1517
|
+
},
|
|
1518
|
+
showSettings,
|
|
1519
|
+
hasUserActivatedSpeak,
|
|
1520
|
+
showReload: selectedLayout === 'TOTEM',
|
|
1521
|
+
};
|
|
1522
|
+
const avatarProps = {
|
|
1523
|
+
memori,
|
|
1524
|
+
integration,
|
|
1525
|
+
integrationConfig,
|
|
1526
|
+
tenant,
|
|
1527
|
+
instruct,
|
|
1528
|
+
avatar3dVisible,
|
|
1529
|
+
setAvatar3dVisible,
|
|
1530
|
+
hasUserActivatedSpeak,
|
|
1531
|
+
isPlayingAudio,
|
|
1532
|
+
loading: memoriTyping,
|
|
1533
|
+
baseUrl,
|
|
1534
|
+
apiUrl,
|
|
1535
|
+
};
|
|
1536
|
+
const startPanelProps = {
|
|
1537
|
+
memori: memori,
|
|
1538
|
+
tenant: tenant,
|
|
1539
|
+
gamificationLevel: gamificationLevel,
|
|
1540
|
+
language: language,
|
|
1541
|
+
userLang: userLang,
|
|
1542
|
+
setUserLang: setUserLang,
|
|
1543
|
+
baseUrl: baseUrl,
|
|
1544
|
+
apiUrl: apiUrl,
|
|
1545
|
+
position: position,
|
|
1546
|
+
openPositionDrawer: () => setShowPositionDrawer(true),
|
|
1547
|
+
integrationConfig: integrationConfig,
|
|
1548
|
+
instruct: instruct,
|
|
1549
|
+
sessionId: sessionId,
|
|
1550
|
+
clickedStart: clickedStart,
|
|
1551
|
+
onClickStart: onClickStart,
|
|
1552
|
+
initializeTTS: initializeTTS,
|
|
1553
|
+
};
|
|
1554
|
+
const chatProps = {
|
|
1555
|
+
memori,
|
|
1556
|
+
sessionID: sessionId || '',
|
|
1557
|
+
tenant,
|
|
1558
|
+
translateTo: isMultilanguageEnabled &&
|
|
1512
1559
|
userLang.toUpperCase() !==
|
|
1513
|
-
((
|
|
1560
|
+
((_w = ((_v = (_u = (_t = (_r = memori.culture) === null || _r === void 0 ? void 0 : _r.split('-')) === null || _t === void 0 ? void 0 : _t[0]) !== null && _u !== void 0 ? _u : i18n.language) !== null && _v !== void 0 ? _v : 'IT')) === null || _w === void 0 ? void 0 : _w.toUpperCase())
|
|
1514
1561
|
? userLang
|
|
1515
|
-
: undefined,
|
|
1562
|
+
: undefined,
|
|
1563
|
+
baseUrl,
|
|
1564
|
+
apiUrl,
|
|
1565
|
+
memoriTyping,
|
|
1566
|
+
history: layout === 'TOTEM' ? history.slice(-2) : history,
|
|
1567
|
+
authToken: loginToken,
|
|
1568
|
+
dialogState: currentDialogState,
|
|
1569
|
+
setDialogState: setCurrentDialogState,
|
|
1570
|
+
pushMessage,
|
|
1571
|
+
simulateUserPrompt,
|
|
1572
|
+
showDates,
|
|
1573
|
+
showContextPerLine,
|
|
1574
|
+
showAIicon,
|
|
1575
|
+
client,
|
|
1576
|
+
selectReceiverTag,
|
|
1577
|
+
preview,
|
|
1578
|
+
sendOnEnter,
|
|
1579
|
+
setSendOnEnter,
|
|
1580
|
+
microphoneMode: continuousSpeech ? 'CONTINUOUS' : 'HOLD_TO_TALK',
|
|
1581
|
+
attachmentsMenuOpen,
|
|
1582
|
+
setAttachmentsMenuOpen,
|
|
1583
|
+
instruct,
|
|
1584
|
+
showInputs,
|
|
1585
|
+
showMicrophone: !!AZURE_COGNITIVE_SERVICES_TTS_KEY,
|
|
1586
|
+
userMessage,
|
|
1587
|
+
onChangeUserMessage,
|
|
1588
|
+
sendMessage: (msg) => {
|
|
1516
1589
|
stopAudio();
|
|
1517
1590
|
stopListening();
|
|
1518
1591
|
sendMessage(msg);
|
|
1519
1592
|
setUserMessage('');
|
|
1520
1593
|
resetTranscript();
|
|
1521
|
-
},
|
|
1594
|
+
},
|
|
1595
|
+
stopListening: clearListening,
|
|
1596
|
+
startListening,
|
|
1597
|
+
stopAudio,
|
|
1598
|
+
resetTranscript,
|
|
1599
|
+
listening,
|
|
1600
|
+
isPlayingAudio,
|
|
1601
|
+
};
|
|
1522
1602
|
const integrationBackground = integration && globalBackgroundUrl ? ((0, jsx_runtime_1.jsx)("div", { className: "memori--global-background", children: (0, jsx_runtime_1.jsx)("div", { className: "memori--global-background-image", style: { backgroundImage: globalBackgroundUrl } }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "memori--global-background no-background-image" }));
|
|
1523
1603
|
const integrationStyle = integration ? ((0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: { __html: integrationStylesheet } })) : null;
|
|
1524
1604
|
const onChangeMode = (mode) => {
|
|
@@ -1526,7 +1606,11 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1526
1606
|
setHasUserActivatedSpeak(false);
|
|
1527
1607
|
setClickedStart(false);
|
|
1528
1608
|
};
|
|
1529
|
-
const
|
|
1609
|
+
const changeModeProps = {
|
|
1610
|
+
canInstruct: !!memori.giverTag,
|
|
1611
|
+
instruct: !!instruct,
|
|
1612
|
+
onChangeMode,
|
|
1613
|
+
};
|
|
1530
1614
|
const poweredBy = (0, jsx_runtime_1.jsx)(PoweredBy_1.default, { tenant: tenant, userLang: userLang });
|
|
1531
1615
|
const Layout = customLayout
|
|
1532
1616
|
? customLayout
|
|
@@ -1547,7 +1631,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1547
1631
|
}), "data-memori-name": memori === null || memori === void 0 ? void 0 : memori.name, "data-memori-id": memori === null || memori === void 0 ? void 0 : memori.engineMemoriID, "data-memori-secondary-id": memori === null || memori === void 0 ? void 0 : memori.memoriID, "data-memori-session-id": sessionId, "data-memori-integration": integration === null || integration === void 0 ? void 0 : integration.integrationID, "data-memori-engine-state": JSON.stringify({
|
|
1548
1632
|
...currentDialogState,
|
|
1549
1633
|
sessionID: sessionId,
|
|
1550
|
-
}), style: { height }, children: [(0, jsx_runtime_1.jsx)(Layout, {
|
|
1634
|
+
}), style: { height }, children: [(0, jsx_runtime_1.jsx)(Layout, { Header: Header_1.default, headerProps: headerProps, Avatar: Avatar_1.default, avatarProps: avatarProps, Chat: Chat_1.default, chatProps: chatProps, StartPanel: StartPanel_1.default, startPanelProps: startPanelProps, integrationStyle: integrationStyle, integrationBackground: integrationBackground, ChangeMode: ChangeMode_1.default, changeModeProps: changeModeProps, poweredBy: poweredBy, sessionId: sessionId, hasUserActivatedSpeak: hasUserActivatedSpeak, showInstruct: showInstruct, loading: loading }), (0, jsx_runtime_1.jsx)("audio", { id: "memori-audio", style: { display: 'none' }, src: "https://app.twincreator.com/intro.mp3" }), isClient && ((0, jsx_runtime_1.jsx)(Auth_1.default, { withModal: true, pwdOrTokens: authModalState, openModal: !!authModalState, setPwdOrTokens: setAuthModalState, showTokens: memori.privacyType === 'SECRET', onFinish: async (values) => {
|
|
1551
1635
|
if (values['password'])
|
|
1552
1636
|
setMemoriPwd(values['password']);
|
|
1553
1637
|
if (values['tokens'])
|
|
@@ -1561,7 +1645,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, integration, layout =
|
|
|
1561
1645
|
setAuthModalState(null);
|
|
1562
1646
|
setGotErrorInOpening(true);
|
|
1563
1647
|
});
|
|
1564
|
-
}, minimumNumberOfRecoveryTokens: (
|
|
1648
|
+
}, minimumNumberOfRecoveryTokens: (_x = memori === null || memori === void 0 ? void 0 : memori.minimumNumberOfRecoveryTokens) !== null && _x !== void 0 ? _x : 1 })), isClient && ((0, jsx_runtime_1.jsx)(AgeVerificationModal_1.default, { visible: showAgeVerification, minAge: minAge, onClose: birthDate => {
|
|
1565
1649
|
if (birthDate) {
|
|
1566
1650
|
setBirthDate(birthDate);
|
|
1567
1651
|
(0, configuration_1.setLocalConfig)('birthDate', birthDate);
|