@memori.ai/memori-react 6.2.0 → 6.3.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/CHANGELOG.md +26 -0
- package/dist/components/Header/Header.css +14 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +43 -19
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/PositionDrawer/PositionDrawer.d.ts +4 -3
- package/dist/components/PositionDrawer/PositionDrawer.js +5 -2
- package/dist/components/PositionDrawer/PositionDrawer.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.js +2 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/VenueWidget/VenueWidget.d.ts +3 -2
- package/dist/components/VenueWidget/VenueWidget.js +31 -14
- package/dist/components/VenueWidget/VenueWidget.js.map +1 -1
- package/dist/components/ui/Drawer.d.ts +1 -0
- package/dist/components/ui/Drawer.js +1 -1
- package/dist/components/ui/Drawer.js.map +1 -1
- package/dist/helpers/configuration.js +1 -0
- package/dist/helpers/configuration.js.map +1 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/it.json +3 -2
- package/esm/components/Header/Header.css +14 -1
- package/esm/components/Header/Header.js +1 -1
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +43 -19
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/PositionDrawer/PositionDrawer.d.ts +4 -3
- package/esm/components/PositionDrawer/PositionDrawer.js +6 -3
- package/esm/components/PositionDrawer/PositionDrawer.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.js +2 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/VenueWidget/VenueWidget.d.ts +3 -2
- package/esm/components/VenueWidget/VenueWidget.js +31 -14
- package/esm/components/VenueWidget/VenueWidget.js.map +1 -1
- package/esm/components/ui/Drawer.d.ts +1 -0
- package/esm/components/ui/Drawer.js +1 -1
- package/esm/components/ui/Drawer.js.map +1 -1
- package/esm/helpers/configuration.js +1 -0
- package/esm/helpers/configuration.js.map +1 -1
- package/esm/locales/en.json +3 -1
- package/esm/locales/it.json +3 -2
- package/package.json +1 -1
- package/src/components/Header/Header.css +14 -1
- package/src/components/Header/Header.tsx +8 -4
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +2 -1
- package/src/components/MemoriWidget/MemoriWidget.tsx +46 -15
- package/src/components/PositionDrawer/PositionDrawer.stories.tsx +7 -2
- package/src/components/PositionDrawer/PositionDrawer.test.tsx +9 -3
- package/src/components/PositionDrawer/PositionDrawer.tsx +16 -4
- package/src/components/PositionDrawer/__snapshots__/PositionDrawer.test.tsx.snap +14 -2
- package/src/components/StartPanel/StartPanel.tsx +5 -1
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +18 -2
- package/src/components/VenueWidget/VenueWidget.tsx +44 -15
- package/src/components/VenueWidget/__snapshots__/VenueWidget.test.tsx.snap +39 -4
- package/src/components/ui/Drawer.tsx +5 -2
- package/src/helpers/configuration.ts +1 -0
- package/src/locales/en.json +3 -1
- package/src/locales/it.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.3.0](https://github.com/memori-ai/memori-react/compare/v6.2.0...v6.3.0) (2024-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* allow null position as negation, dont display that as venue ([17cd359](https://github.com/memori-ai/memori-react/commit/17cd35929d8a89433f12d29ddf712a86a7f1572c))
|
|
9
|
+
* save position to localStorage ([4dd10dc](https://github.com/memori-ai/memori-react/commit/4dd10dc3223e0c1b2a3e9a6ee32a88ca7e7d30b5))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* position drawer rendering ([02766ac](https://github.com/memori-ai/memori-react/commit/02766ac57a139c67d202a79f77a5f55946cce293))
|
|
15
|
+
* sending position event, cleanup ([79be3bf](https://github.com/memori-ai/memori-react/commit/79be3bff3705d570e8d728af21ab7674888dbc31))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Maintenance
|
|
19
|
+
|
|
20
|
+
* transform default context vars uppercase ([7627eb1](https://github.com/memori-ai/memori-react/commit/7627eb1290182b8245e093b9a01d628257729b5b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Changes
|
|
24
|
+
|
|
25
|
+
* add helper description for position request ([f08c2a7](https://github.com/memori-ai/memori-react/commit/f08c2a7691bb9f25ac92f961e636d929432abefa))
|
|
26
|
+
* cleanup ([77f2e2b](https://github.com/memori-ai/memori-react/commit/77f2e2be28577c81469c69cc24a9ed3e872fea31))
|
|
27
|
+
* position drawer + start icons, styles, formatting and overflow in header ([db5993d](https://github.com/memori-ai/memori-react/commit/db5993db77c771d156cc7f78d7dd7af75acfb44d))
|
|
28
|
+
|
|
3
29
|
## [6.2.0](https://github.com/memori-ai/memori-react/compare/v6.1.7...v6.2.0) (2024-04-16)
|
|
4
30
|
|
|
5
31
|
|
|
@@ -48,11 +48,19 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.memori-header--position {
|
|
51
|
-
display: inline-
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
align-items: center;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
.memori-header--position .memori-header--position-placeName {
|
|
56
|
+
display: inline-block;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
max-width: 250px;
|
|
59
|
+
padding-right: 0.25rem;
|
|
60
|
+
margin: 0;
|
|
55
61
|
font-style: italic;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
white-space: nowrap;
|
|
56
64
|
}
|
|
57
65
|
|
|
58
66
|
.memori-header--position .memori-header--button {
|
|
@@ -60,7 +68,12 @@
|
|
|
60
68
|
margin-left: 0.5rem;
|
|
61
69
|
}
|
|
62
70
|
|
|
71
|
+
.memori-header .memori-header--button--position,
|
|
63
72
|
.memori-header .memori-share-button,
|
|
64
73
|
.memori-header .memori-header--button-login {
|
|
65
74
|
margin-left: 0.25rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.memori-header .memori-header--button--position {
|
|
78
|
+
margin-right: 0.25rem;
|
|
66
79
|
}
|
|
@@ -30,7 +30,7 @@ const Header = ({ className, memori, tenant, history, position, setShowPositionD
|
|
|
30
30
|
}, []);
|
|
31
31
|
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('memori-header', className), children: [showReload && ((0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: "memori-header--button memori-header--button--reload", title: t('reload') || 'Reload', icon: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}), onClick: () => {
|
|
32
32
|
window.location.reload();
|
|
33
|
-
} })), showClear && ((0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: "memori-header--button memori-header--button--clear", title: t('clearHistory') || 'Clear chat', icon: (0, jsx_runtime_1.jsx)(Clear_1.default, {}), onClick: clearHistory })), memori.needsPosition && position && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-header--position", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-header--position-placeName", children: position.placeName }), (0, jsx_runtime_1.jsx)(Button_1.default, {
|
|
33
|
+
} })), showClear && ((0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: "memori-header--button memori-header--button--clear", title: t('clearHistory') || 'Clear chat', icon: (0, jsx_runtime_1.jsx)(Clear_1.default, {}), onClick: clearHistory })), memori.needsPosition && position && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-header--position", children: [position.latitude !== 0 && position.longitude !== 0 && ((0, jsx_runtime_1.jsx)("span", { className: "memori-header--position-placeName", children: position.placeName })), (0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: "memori-header--button memori-header--button--position", title: t('widget.position') || 'Position', icon: (0, jsx_runtime_1.jsx)(MapMarker_1.default, {}), onClick: () => setShowPositionDrawer(true) })] })), fullScreenAvailable && ((0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: "memori-header--button memori-header--button--fullscreen", title: fullScreen
|
|
34
34
|
? t('fullscreenExit') || 'Exit fullscreen'
|
|
35
35
|
: t('fullscreenEnter') || 'Enter fullscreen', icon: fullScreen ? (0, jsx_runtime_1.jsx)(FullscreenExit_1.default, {}) : (0, jsx_runtime_1.jsx)(Fullscreen_1.default, {}), onClick: () => {
|
|
36
36
|
if (!document.fullscreenElement) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":";;;;AAAA,iCAAmD;AACnD,oEAA4B;AAQ5B,kEAAkC;AAClC,2EAA2C;AAC3C,yFAAyD;AACzD,mEAAmC;AACnC,iDAA+C;AAC/C,6GAA6E;AAC7E,uEAAuC;AACvC,qFAAqD;AACrD,qFAAqD;AACrD,6EAA6C;AAC7C,uEAAuC;AACvC,mEAAmC;AACnC,+EAA+C;AAC/C,mEAAmC;AACnC,iEAAqC;AA4BrC,MAAM,MAAM,GAAoB,CAAC,EAC/B,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,qBAAqB,GAAG,KAAK,EAC7B,SAAS,GAAG,IAAI,EAChB,YAAY,GAAG,IAAI,EACnB,WAAW,GAAG,IAAI,EAClB,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,IAAI,EAChB,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,SAAS,GACV,EAAE,EAAE;IACH,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BA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252
252
|
uncertaintyKm: (_a = venue.uncertainty) !== null && _a !== void 0 ? _a : 0,
|
|
253
253
|
});
|
|
254
254
|
if (currentState && response.resultCode === 0) {
|
|
255
|
-
|
|
255
|
+
_setCurrentDialogState(cds => {
|
|
256
|
+
var _a;
|
|
257
|
+
return ({
|
|
258
|
+
...cds,
|
|
259
|
+
...currentState,
|
|
260
|
+
hints: ((_a = currentState.hints) === null || _a === void 0 ? void 0 : _a.length) ? currentState.hints : cds === null || cds === void 0 ? void 0 : cds.hints,
|
|
261
|
+
});
|
|
262
|
+
});
|
|
256
263
|
}
|
|
257
264
|
}
|
|
258
265
|
};
|
|
259
266
|
const setPosition = (venue) => {
|
|
260
267
|
_setPosition(venue);
|
|
261
268
|
applyPosition(venue);
|
|
269
|
+
if (venue) {
|
|
270
|
+
(0, configuration_1.setLocalConfig)('position', JSON.stringify(venue));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
(0, configuration_1.removeLocalConfig)('position');
|
|
274
|
+
}
|
|
262
275
|
};
|
|
276
|
+
(0, react_1.useEffect)(() => {
|
|
277
|
+
const position = (0, configuration_1.getLocalConfig)('position', undefined);
|
|
278
|
+
if (position) {
|
|
279
|
+
_setPosition(position);
|
|
280
|
+
}
|
|
281
|
+
}, []);
|
|
263
282
|
const [userMessage, setUserMessage] = (0, react_1.useState)('');
|
|
264
283
|
const onChangeUserMessage = (value) => {
|
|
265
284
|
if (!value || value === '\n' || value.trim() === '') {
|
|
@@ -559,6 +578,8 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
559
578
|
(session === null || session === void 0 ? void 0 : session.currentState) &&
|
|
560
579
|
session.resultCode === 0) {
|
|
561
580
|
setSessionId(session.sessionID);
|
|
581
|
+
if (position)
|
|
582
|
+
applyPosition(position, session.sessionID);
|
|
562
583
|
setLoading(false);
|
|
563
584
|
return {
|
|
564
585
|
dialogState: session.currentState,
|
|
@@ -781,7 +802,6 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
781
802
|
var _a;
|
|
782
803
|
const session = sessionID !== null && sessionID !== void 0 ? sessionID : sessionId;
|
|
783
804
|
const dialogState = state !== null && state !== void 0 ? state : currentDialogState;
|
|
784
|
-
console.log('sendDateChangedEvent', dialogState);
|
|
785
805
|
if (!session || !memori.needsDateTime || ((_a = dialogState === null || dialogState === void 0 ? void 0 : dialogState.hints) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
786
806
|
return;
|
|
787
807
|
}
|
|
@@ -1598,7 +1618,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
1598
1618
|
};
|
|
1599
1619
|
}, [sessionId, userLang]);
|
|
1600
1620
|
const onClickStart = (0, react_1.useCallback)(async (session) => {
|
|
1601
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l;
|
|
1621
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _t, _u, _v;
|
|
1602
1622
|
const sessionID = (session === null || session === void 0 ? void 0 : session.sessionID) || sessionId;
|
|
1603
1623
|
const dialogState = (session === null || session === void 0 ? void 0 : session.dialogState) || currentDialogState;
|
|
1604
1624
|
setClickedStart(true);
|
|
@@ -1636,15 +1656,15 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
1636
1656
|
tag: personification === null || personification === void 0 ? void 0 : personification.tag,
|
|
1637
1657
|
pin: personification === null || personification === void 0 ? void 0 : personification.pin,
|
|
1638
1658
|
initialContextVars: {
|
|
1639
|
-
PATHNAME: window.location.pathname,
|
|
1640
|
-
ROUTE: ((
|
|
1659
|
+
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
1660
|
+
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) || '',
|
|
1641
1661
|
...(initialContextVars || {}),
|
|
1642
1662
|
},
|
|
1643
1663
|
initialQuestion,
|
|
1644
1664
|
birthDate: birth,
|
|
1645
1665
|
additionalInfo: {
|
|
1646
1666
|
...(additionalInfo || {}),
|
|
1647
|
-
loginToken: (
|
|
1667
|
+
loginToken: (_g = (_f = userToken !== null && userToken !== void 0 ? userToken : loginToken) !== null && _f !== void 0 ? _f : additionalInfo === null || additionalInfo === void 0 ? void 0 : additionalInfo.loginToken) !== null && _g !== void 0 ? _g : authToken,
|
|
1648
1668
|
language: getCultureCodeByLanguage(userLang),
|
|
1649
1669
|
},
|
|
1650
1670
|
});
|
|
@@ -1706,8 +1726,9 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
1706
1726
|
catch (e) {
|
|
1707
1727
|
console.error('session #2', e);
|
|
1708
1728
|
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, memori === null || memori === void 0 ? void 0 : memori.giverTag, memori === null || memori === void 0 ? void 0 : memori.giverPIN, {
|
|
1709
|
-
PATHNAME: window.location.pathname,
|
|
1710
|
-
ROUTE: ((
|
|
1729
|
+
PATHNAME: (_h = window.location.pathname) === null || _h === void 0 ? void 0 : _h.toUpperCase(),
|
|
1730
|
+
ROUTE: ((_l = (_k = (_j = window.location.pathname) === null || _j === void 0 ? void 0 : _j.split('/')) === null || _k === void 0 ? void 0 : _k.pop()) === null || _l === void 0 ? void 0 : _l.toUpperCase()) ||
|
|
1731
|
+
'',
|
|
1711
1732
|
...(initialContextVars || {}),
|
|
1712
1733
|
}, initialQuestion, birth).then(() => {
|
|
1713
1734
|
setHasUserActivatedSpeak(true);
|
|
@@ -1740,8 +1761,9 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
1740
1761
|
catch (e) {
|
|
1741
1762
|
console.error('session #5', e);
|
|
1742
1763
|
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, personification.tag, personification.pin, {
|
|
1743
|
-
PATHNAME: window.location.pathname,
|
|
1744
|
-
ROUTE: ((
|
|
1764
|
+
PATHNAME: (_m = window.location.pathname) === null || _m === void 0 ? void 0 : _m.toUpperCase(),
|
|
1765
|
+
ROUTE: ((_q = (_p = (_o = window.location.pathname) === null || _o === void 0 ? void 0 : _o.split('/')) === null || _p === void 0 ? void 0 : _p.pop()) === null || _q === void 0 ? void 0 : _q.toUpperCase()) ||
|
|
1766
|
+
'',
|
|
1745
1767
|
...(initialContextVars || {}),
|
|
1746
1768
|
}, initialQuestion, birth).then(() => {
|
|
1747
1769
|
setHasUserActivatedSpeak(true);
|
|
@@ -1774,8 +1796,9 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
1774
1796
|
catch (e) {
|
|
1775
1797
|
console.error('session #8', e);
|
|
1776
1798
|
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, undefined, undefined, {
|
|
1777
|
-
PATHNAME: window.location.pathname,
|
|
1778
|
-
ROUTE: ((
|
|
1799
|
+
PATHNAME: (_r = window.location.pathname) === null || _r === void 0 ? void 0 : _r.toUpperCase(),
|
|
1800
|
+
ROUTE: ((_v = (_u = (_t = window.location.pathname) === null || _t === void 0 ? void 0 : _t.split('/')) === null || _u === void 0 ? void 0 : _u.pop()) === null || _v === void 0 ? void 0 : _v.toUpperCase()) ||
|
|
1801
|
+
'',
|
|
1779
1802
|
...(initialContextVars || {}),
|
|
1780
1803
|
}, initialQuestion, birth).then(() => {
|
|
1781
1804
|
setHasUserActivatedSpeak(true);
|
|
@@ -2030,7 +2053,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
2030
2053
|
...currentDialogState,
|
|
2031
2054
|
sessionID: sessionId,
|
|
2032
2055
|
}), 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://aisuru.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) => {
|
|
2033
|
-
var _a, _b;
|
|
2056
|
+
var _a, _b, _c, _d;
|
|
2034
2057
|
if (values['password'])
|
|
2035
2058
|
setMemoriPwd(values['password']);
|
|
2036
2059
|
if (values['password'])
|
|
@@ -2038,8 +2061,9 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
2038
2061
|
if (values['tokens'])
|
|
2039
2062
|
setMemoriTokens(values['tokens']);
|
|
2040
2063
|
reopenSession(!sessionId, values['password'], values['tokens'], instruct ? memori.giverTag : personification === null || personification === void 0 ? void 0 : personification.tag, instruct ? memori.giverPIN : personification === null || personification === void 0 ? void 0 : personification.pin, {
|
|
2041
|
-
PATHNAME: window.location.pathname,
|
|
2042
|
-
ROUTE: ((
|
|
2064
|
+
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
2065
|
+
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) ||
|
|
2066
|
+
'',
|
|
2043
2067
|
...(initialContextVars || {}),
|
|
2044
2068
|
}, initialQuestion, birthDate)
|
|
2045
2069
|
.then(state => {
|
|
@@ -2051,13 +2075,13 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
2051
2075
|
setGotErrorInOpening(true);
|
|
2052
2076
|
});
|
|
2053
2077
|
}, minimumNumberOfRecoveryTokens: (_1 = memori === null || memori === void 0 ? void 0 : memori.minimumNumberOfRecoveryTokens) !== null && _1 !== void 0 ? _1 : 1 })), isClient && ((0, jsx_runtime_1.jsx)(AgeVerificationModal_1.default, { visible: showAgeVerification, minAge: minAge, onClose: birthDate => {
|
|
2054
|
-
var _a, _b;
|
|
2078
|
+
var _a, _b, _c, _d;
|
|
2055
2079
|
if (birthDate) {
|
|
2056
2080
|
setBirthDate(birthDate);
|
|
2057
2081
|
(0, configuration_1.setLocalConfig)('birthDate', birthDate);
|
|
2058
2082
|
reopenSession(!sessionId, memoriPassword || memoriPwd || (memori === null || memori === void 0 ? void 0 : memori.secretToken), memoriTokens, instruct ? memori.giverTag : personification === null || personification === void 0 ? void 0 : personification.tag, instruct ? memori.giverPIN : personification === null || personification === void 0 ? void 0 : personification.pin, {
|
|
2059
|
-
PATHNAME: window.location.pathname,
|
|
2060
|
-
ROUTE: ((
|
|
2083
|
+
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
2084
|
+
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) || '',
|
|
2061
2085
|
...(initialContextVars || {}),
|
|
2062
2086
|
}, initialQuestion, birthDate)
|
|
2063
2087
|
.then(state => {
|
|
@@ -2074,7 +2098,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
|
|
|
2074
2098
|
setShowAgeVerification(false);
|
|
2075
2099
|
setClickedStart(false);
|
|
2076
2100
|
}
|
|
2077
|
-
} })), showSettingsDrawer && ((0, jsx_runtime_1.jsx)(SettingsDrawer_1.default, { layout: selectedLayout, open: !!showSettingsDrawer, onClose: () => setShowSettingsDrawer(false), microphoneMode: continuousSpeech ? 'CONTINUOUS' : 'HOLD_TO_TALK', continuousSpeechTimeout: continuousSpeechTimeout, setMicrophoneMode: mode => setContinuousSpeech(mode === 'CONTINUOUS'), setContinuousSpeechTimeout: setContinuousSpeechTimeout, controlsPosition: controlsPosition, setControlsPosition: setControlsPosition, hideEmissions: hideEmissions, setHideEmissions: setHideEmissions, additionalSettings: additionalSettings })), showPositionDrawer && ((0, jsx_runtime_1.jsx)(PositionDrawer_1.default, { open: !!showPositionDrawer, venue: position, setVenue: setPosition, onClose: position => {
|
|
2101
|
+
} })), showSettingsDrawer && ((0, jsx_runtime_1.jsx)(SettingsDrawer_1.default, { layout: selectedLayout, open: !!showSettingsDrawer, onClose: () => setShowSettingsDrawer(false), microphoneMode: continuousSpeech ? 'CONTINUOUS' : 'HOLD_TO_TALK', continuousSpeechTimeout: continuousSpeechTimeout, setMicrophoneMode: mode => setContinuousSpeech(mode === 'CONTINUOUS'), setContinuousSpeechTimeout: setContinuousSpeechTimeout, controlsPosition: controlsPosition, setControlsPosition: setControlsPosition, hideEmissions: hideEmissions, setHideEmissions: setHideEmissions, additionalSettings: additionalSettings })), showPositionDrawer && ((0, jsx_runtime_1.jsx)(PositionDrawer_1.default, { memori: memori, open: !!showPositionDrawer, venue: position, setVenue: setPosition, onClose: position => {
|
|
2078
2102
|
if (position)
|
|
2079
2103
|
applyPosition(position);
|
|
2080
2104
|
setShowPositionDrawer(false);
|