@memori.ai/memori-react 8.22.0 → 8.24.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 +19 -0
- package/dist/components/DrawerFooter/DrawerFooter.css +63 -0
- package/dist/components/DrawerFooter/DrawerFooter.d.ts +12 -0
- package/dist/components/DrawerFooter/DrawerFooter.js +10 -0
- package/dist/components/DrawerFooter/DrawerFooter.js.map +1 -0
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +3 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +27 -59
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant.js +3 -3
- package/dist/components/layouts/WebsiteAssistant.js.map +1 -1
- package/dist/icons/FacebookIcon.d.ts +3 -0
- package/dist/icons/FacebookIcon.js +6 -0
- package/dist/icons/FacebookIcon.js.map +1 -0
- package/dist/icons/LinkedinIcon.d.ts +3 -0
- package/dist/icons/LinkedinIcon.js +6 -0
- package/dist/icons/LinkedinIcon.js.map +1 -0
- package/dist/icons/TelegramIcon.d.ts +3 -0
- package/dist/icons/TelegramIcon.js +6 -0
- package/dist/icons/TelegramIcon.js.map +1 -0
- package/dist/icons/TwitterIcon.d.ts +3 -0
- package/dist/icons/TwitterIcon.js +6 -0
- package/dist/icons/TwitterIcon.js.map +1 -0
- package/dist/icons/WhatsappIcon.d.ts +3 -0
- package/dist/icons/WhatsappIcon.js +6 -0
- package/dist/icons/WhatsappIcon.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/DrawerFooter/DrawerFooter.css +63 -0
- package/esm/components/DrawerFooter/DrawerFooter.d.ts +12 -0
- package/esm/components/DrawerFooter/DrawerFooter.js +8 -0
- package/esm/components/DrawerFooter/DrawerFooter.js.map +1 -0
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +3 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +27 -59
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant.js +3 -3
- package/esm/components/layouts/WebsiteAssistant.js.map +1 -1
- package/esm/icons/FacebookIcon.d.ts +3 -0
- package/esm/icons/FacebookIcon.js +4 -0
- package/esm/icons/FacebookIcon.js.map +1 -0
- package/esm/icons/LinkedinIcon.d.ts +3 -0
- package/esm/icons/LinkedinIcon.js +4 -0
- package/esm/icons/LinkedinIcon.js.map +1 -0
- package/esm/icons/TelegramIcon.d.ts +3 -0
- package/esm/icons/TelegramIcon.js +4 -0
- package/esm/icons/TelegramIcon.js.map +1 -0
- package/esm/icons/TwitterIcon.d.ts +3 -0
- package/esm/icons/TwitterIcon.js +4 -0
- package/esm/icons/TwitterIcon.js.map +1 -0
- package/esm/icons/WhatsappIcon.d.ts +3 -0
- package/esm/icons/WhatsappIcon.js +4 -0
- package/esm/icons/WhatsappIcon.js.map +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +1 -1
- package/src/components/MemoriWidget/MemoriWidget.tsx +69 -95
- package/src/components/layouts/WebsiteAssistant.tsx +25 -22
- package/src/components/layouts/layouts.stories.tsx +6 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [8.24.0](https://github.com/memori-ai/memori-react/compare/v8.23.0...v8.24.0) (2026-03-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* implement logic for avatar3dHidden prop in MemoriWidget ([609ed74](https://github.com/memori-ai/memori-react/commit/609ed74978c1197159754fcf9357431a96e38b57))
|
|
9
|
+
|
|
10
|
+
## [8.23.0](https://github.com/memori-ai/memori-react/compare/v8.22.0...v8.23.0) (2026-03-16)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add avatar3dHidden prop to WebsiteAssistant layout ([8803b75](https://github.com/memori-ai/memori-react/commit/8803b751df3f34aff37af500a650b29ccb012218))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Changes
|
|
19
|
+
|
|
20
|
+
* dont send date event every minute, but when opening session and sending TextEntered ([25f083e](https://github.com/memori-ai/memori-react/commit/25f083efadb8d07b311e371739711eabcdffdc1b))
|
|
21
|
+
|
|
3
22
|
## [8.22.0](https://github.com/memori-ai/memori-react/compare/v8.21.0...v8.22.0) (2026-03-02)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.memori-drawer-footer {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
padding: var(--memori-spacing-md);
|
|
4
|
+
border-top: 1px solid var(--memori-border-color, #e5e7eb);
|
|
5
|
+
background: var(--memori-main-background);
|
|
6
|
+
box-shadow: 0 -8px 24px -8px rgba(0, 0, 0, 0.06), 0 -2px 8px -2px rgba(0, 0, 0, 0.03);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.memori-drawer-footer__inner {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
gap: var(--memori-spacing-lg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.memori-drawer-footer__start {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--memori-spacing-md);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.memori-drawer-footer__end {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
margin-left: auto;
|
|
29
|
+
gap: var(--memori-spacing-md);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.memori-drawer-footer__end .memori-button {
|
|
33
|
+
min-height: 44px;
|
|
34
|
+
padding: 10px var(--memori-spacing-lg);
|
|
35
|
+
border-radius: 10px;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.memori-drawer-footer__end .memori-button:hover:not([disabled]) {
|
|
41
|
+
transform: translateY(-1px);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.memori-drawer-footer__inner--centered {
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (max-width: 768px) {
|
|
49
|
+
.memori-drawer-footer {
|
|
50
|
+
padding: var(--memori-spacing-md) var(--memori-spacing-lg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.memori-drawer-footer__inner {
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
align-items: stretch;
|
|
56
|
+
gap: var(--memori-spacing-md);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.memori-drawer-footer__end {
|
|
60
|
+
justify-content: flex-end;
|
|
61
|
+
margin-left: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DrawerFooterProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
start?: React.ReactNode;
|
|
5
|
+
end?: React.ReactNode;
|
|
6
|
+
center?: React.ReactNode;
|
|
7
|
+
closeLabel?: string;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const DrawerFooter: React.FC<DrawerFooterProps>;
|
|
12
|
+
export default DrawerFooter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ui_1 = require("@memori.ai/ui");
|
|
5
|
+
const DrawerFooter = ({ children, start, end, center, closeLabel, onClose, className = '', }) => {
|
|
6
|
+
const hasSlots = start != null || end != null || center != null || closeLabel != null;
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("footer", { className: `memori-drawer-footer ${className}`.trim(), role: "contentinfo", children: center != null ? ((0, jsx_runtime_1.jsx)("div", { className: "memori-drawer-footer__inner memori-drawer-footer__inner--centered", children: center })) : children != null && !hasSlots ? ((0, jsx_runtime_1.jsx)("div", { className: "memori-drawer-footer__inner memori-drawer-footer__inner--centered", children: children })) : ((0, jsx_runtime_1.jsxs)("div", { className: "memori-drawer-footer__inner", children: [start != null && ((0, jsx_runtime_1.jsx)("div", { className: "memori-drawer-footer__start", children: start })), (0, jsx_runtime_1.jsxs)("div", { className: "memori-drawer-footer__end", children: [end, closeLabel != null && onClose != null && ((0, jsx_runtime_1.jsx)(ui_1.Button, { variant: "primary", onClick: onClose, children: closeLabel }))] })] })) }));
|
|
8
|
+
};
|
|
9
|
+
exports.default = DrawerFooter;
|
|
10
|
+
//# sourceMappingURL=DrawerFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerFooter.js","sourceRoot":"","sources":["../../../src/components/DrawerFooter/DrawerFooter.tsx"],"names":[],"mappings":";;;AACA,sCAAuC;AAgBvC,MAAM,YAAY,GAAgC,CAAC,EACjD,QAAQ,EACR,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,GAAG,EAAE,GACf,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,KAAK,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC;IAEtF,OAAO,CACL,mCACE,SAAS,EAAE,wBAAwB,SAAS,EAAE,CAAC,IAAI,EAAE,EACrD,IAAI,EAAC,aAAa,YAEjB,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAChB,gCAAK,SAAS,EAAC,mEAAmE,YAC/E,MAAM,GACH,CACP,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAClC,gCAAK,SAAS,EAAC,mEAAmE,YAC/E,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,CACF,iCAAK,SAAS,EAAC,6BAA6B,aACzC,KAAK,IAAI,IAAI,IAAI,CAChB,gCAAK,SAAS,EAAC,6BAA6B,YAAE,KAAK,GAAO,CAC3D,EACD,iCAAK,SAAS,EAAC,2BAA2B,aACvC,GAAG,EACH,UAAU,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,CACxC,uBAAC,WAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,YACvC,UAAU,GACJ,CACV,IACG,IACF,CACP,GACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|
|
@@ -79,6 +79,7 @@ export interface LayoutProps {
|
|
|
79
79
|
loading?: boolean;
|
|
80
80
|
autoStart?: boolean;
|
|
81
81
|
onSidebarToggle?: (isOpen: boolean) => void;
|
|
82
|
+
avatar3dHidden?: boolean;
|
|
82
83
|
}
|
|
83
84
|
export interface Props {
|
|
84
85
|
memori: Memori;
|
|
@@ -107,6 +108,7 @@ export interface Props {
|
|
|
107
108
|
showUpload?: boolean;
|
|
108
109
|
showChatHistory?: boolean;
|
|
109
110
|
showReasoning?: boolean;
|
|
111
|
+
avatar3dHidden?: boolean;
|
|
110
112
|
preview?: boolean;
|
|
111
113
|
embed?: boolean;
|
|
112
114
|
height?: number | string;
|
|
@@ -146,5 +148,5 @@ export interface Props {
|
|
|
146
148
|
maxTotalMessagePayload?: number;
|
|
147
149
|
maxTextareaCharacters?: number;
|
|
148
150
|
}
|
|
149
|
-
declare const MemoriWidget: ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenantID, memoriLang, uiLang, spokenLang, multilingual, integration, layout, customLayout, showShare, preview, embed, showCopyButton, showTranslationOriginal, showInputs, showDates, showContextPerLine, showSettings, showTypingText, showClear, showLogin, showUpload, showOnlyLastMessages, showChatHistory, showReasoning, height, secret, baseUrl, apiURL, engineURL, initialContextVars, initialQuestion, ttsProvider, ogImage, sessionID: initialSessionID, tenant, personification, authToken, enableAudio, defaultSpeakerActive, disableTextEnteredEvents, onStateChange, additionalInfo, additionalSettings, customMediaRenderer, userAvatar, __WEBCOMPONENT__, useMathFormatting, autoStart, applyVarsToRoot, showFunctionCache, maxTotalMessagePayload, maxTextareaCharacters, }: Props) => JSX.Element;
|
|
151
|
+
declare const MemoriWidget: ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenantID, memoriLang, uiLang, spokenLang, multilingual, integration, layout, customLayout, showShare, preview, embed, showCopyButton, showTranslationOriginal, showInputs, showDates, showContextPerLine, showSettings, showTypingText, showClear, showLogin, showUpload, showOnlyLastMessages, showChatHistory, showReasoning, avatar3dHidden, height, secret, baseUrl, apiURL, engineURL, initialContextVars, initialQuestion, ttsProvider, ogImage, sessionID: initialSessionID, tenant, personification, authToken, enableAudio, defaultSpeakerActive, disableTextEnteredEvents, onStateChange, additionalInfo, additionalSettings, customMediaRenderer, userAvatar, __WEBCOMPONENT__, useMathFormatting, autoStart, applyVarsToRoot, showFunctionCache, maxTotalMessagePayload, maxTextareaCharacters, }: Props) => JSX.Element;
|
|
150
152
|
export default MemoriWidget;
|
|
@@ -158,15 +158,15 @@ window.typeBatchMessages = typeBatchMessages;
|
|
|
158
158
|
let audioContext;
|
|
159
159
|
let memoriPassword;
|
|
160
160
|
let userToken;
|
|
161
|
-
const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenantID, memoriLang, uiLang, spokenLang, multilingual, integration, layout, customLayout, showShare, preview = false, embed = false, showCopyButton = true, showTranslationOriginal = false, showInputs = true, showDates = false, showContextPerLine = false, showSettings, showTypingText = false, showClear = false, showLogin = false, showUpload, showOnlyLastMessages, showChatHistory, showReasoning, height = '100vh', secret, baseUrl = 'https://aisuru-staging.aclambda.online', apiURL = 'https://backend-staging.memori.ai', engineURL = 'https://engine-staging.memori.ai', initialContextVars, initialQuestion, ttsProvider, ogImage, sessionID: initialSessionID, tenant, personification, authToken, enableAudio, defaultSpeakerActive = true, disableTextEnteredEvents = false, onStateChange, additionalInfo, additionalSettings, customMediaRenderer, userAvatar, __WEBCOMPONENT__ = false, useMathFormatting = false, autoStart = false, applyVarsToRoot = false, showFunctionCache = false, maxTotalMessagePayload, maxTextareaCharacters, }) => {
|
|
162
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
|
|
161
|
+
const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenantID, memoriLang, uiLang, spokenLang, multilingual, integration, layout, customLayout, showShare, preview = false, embed = false, showCopyButton = true, showTranslationOriginal = false, showInputs = true, showDates = false, showContextPerLine = false, showSettings, showTypingText = false, showClear = false, showLogin = false, showUpload, showOnlyLastMessages, showChatHistory, showReasoning, avatar3dHidden, height = '100vh', secret, baseUrl = 'https://aisuru-staging.aclambda.online', apiURL = 'https://backend-staging.memori.ai', engineURL = 'https://engine-staging.memori.ai', initialContextVars, initialQuestion, ttsProvider, ogImage, sessionID: initialSessionID, tenant, personification, authToken, enableAudio, defaultSpeakerActive = true, disableTextEnteredEvents = false, onStateChange, additionalInfo, additionalSettings, customMediaRenderer, userAvatar, __WEBCOMPONENT__ = false, useMathFormatting = false, autoStart = false, applyVarsToRoot = false, showFunctionCache = false, maxTotalMessagePayload, maxTextareaCharacters, }) => {
|
|
162
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
|
|
163
163
|
const { t, i18n } = (0, react_i18next_1.useTranslation)();
|
|
164
164
|
const [isClient, setIsClient] = (0, react_1.useState)(false);
|
|
165
165
|
(0, react_1.useEffect)(() => {
|
|
166
166
|
setIsClient(true);
|
|
167
167
|
}, []);
|
|
168
168
|
const client = (0, memori_api_client_1.default)(apiURL, engineURL);
|
|
169
|
-
const { initSession, deleteSession, postTextEnteredEvent, postPlaceChangedEvent, postDateChangedEvent,
|
|
169
|
+
const { initSession, deleteSession, postTextEnteredEvent, postPlaceChangedEvent, postDateChangedEvent, postTagChangedEvent, getSession, getExpertReferences, getSessionChatLogs, } = client;
|
|
170
170
|
const [instruct, setInstruct] = (0, react_1.useState)(false);
|
|
171
171
|
const [enableFocusChatInput, setEnableFocusChatInput] = (0, react_1.useState)(true);
|
|
172
172
|
const [loginToken, setLoginToken] = (0, react_1.useState)((_a = additionalInfo === null || additionalInfo === void 0 ? void 0 : additionalInfo.loginToken) !== null && _a !== void 0 ? _a : authToken);
|
|
@@ -374,6 +374,9 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
374
374
|
((_a = window.getMemoriState()) === null || _a === void 0 ? void 0 : _a.sessionID);
|
|
375
375
|
if (!sessionID || !(text === null || text === void 0 ? void 0 : text.length))
|
|
376
376
|
return;
|
|
377
|
+
if (memori.needsDateTime) {
|
|
378
|
+
await sendDateChangedEvent({ sessionID: sessionID });
|
|
379
|
+
}
|
|
377
380
|
let msg = text;
|
|
378
381
|
if (!hidden &&
|
|
379
382
|
translate &&
|
|
@@ -384,9 +387,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
384
387
|
}
|
|
385
388
|
const mediaDocuments = media === null || media === void 0 ? void 0 : media.filter(m => { var _a; return m.type === 'document' && ((_a = m.properties) === null || _a === void 0 ? void 0 : _a.isAttachedFile); });
|
|
386
389
|
if (mediaDocuments && mediaDocuments.length > 0) {
|
|
387
|
-
const documentContents = mediaDocuments
|
|
388
|
-
.map(doc => doc.content)
|
|
389
|
-
.join(' ');
|
|
390
|
+
const documentContents = mediaDocuments.map(doc => doc.content).join(' ');
|
|
390
391
|
msg = msg + ' ' + documentContents;
|
|
391
392
|
}
|
|
392
393
|
if (piiDetection === null || piiDetection === void 0 ? void 0 : piiDetection.enabled) {
|
|
@@ -493,14 +494,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
493
494
|
});
|
|
494
495
|
}
|
|
495
496
|
else if (response.resultCode === 500 && response.resultMessage) {
|
|
496
|
-
setHistory(h => [
|
|
497
|
+
setHistory(h => [
|
|
498
|
+
...h,
|
|
499
|
+
{
|
|
497
500
|
text: 'Error: ' + response.resultMessage,
|
|
498
501
|
emitter: 'system',
|
|
499
502
|
fromUser: false,
|
|
500
503
|
initial: false,
|
|
501
504
|
contextVars: {},
|
|
502
505
|
date: new Date().toISOString(),
|
|
503
|
-
}
|
|
506
|
+
},
|
|
507
|
+
]);
|
|
504
508
|
}
|
|
505
509
|
else {
|
|
506
510
|
console.warn('[SEND_MESSAGE]', response);
|
|
@@ -772,6 +776,12 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
772
776
|
}
|
|
773
777
|
if (position && memori.needsPosition)
|
|
774
778
|
applyPosition(position, session.sessionID);
|
|
779
|
+
if (memori.needsDateTime) {
|
|
780
|
+
await sendDateChangedEvent({
|
|
781
|
+
sessionID: session.sessionID,
|
|
782
|
+
state: session === null || session === void 0 ? void 0 : session.currentState,
|
|
783
|
+
});
|
|
784
|
+
}
|
|
775
785
|
setLoading(false);
|
|
776
786
|
return {
|
|
777
787
|
dialogState: session.currentState,
|
|
@@ -1042,53 +1052,6 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1042
1052
|
});
|
|
1043
1053
|
}
|
|
1044
1054
|
}, [currentDialogState, memori.needsDateTime, sessionId]);
|
|
1045
|
-
(0, react_1.useEffect)(() => {
|
|
1046
|
-
if (sessionId && memori.needsDateTime) {
|
|
1047
|
-
sendDateChangedEvent({ sessionID: sessionId, state: currentDialogState });
|
|
1048
|
-
let datePolling = null;
|
|
1049
|
-
let isTabVisible = !document.hidden;
|
|
1050
|
-
const startDatePolling = () => {
|
|
1051
|
-
if (datePolling) {
|
|
1052
|
-
clearInterval(datePolling);
|
|
1053
|
-
}
|
|
1054
|
-
datePolling = setInterval(() => {
|
|
1055
|
-
if (!document.hidden) {
|
|
1056
|
-
sendDateChangedEvent({
|
|
1057
|
-
sessionID: sessionId,
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
}, 60 * 1000);
|
|
1061
|
-
};
|
|
1062
|
-
const stopDatePolling = () => {
|
|
1063
|
-
if (datePolling) {
|
|
1064
|
-
clearInterval(datePolling);
|
|
1065
|
-
datePolling = null;
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1068
|
-
const handleVisibilityChange = () => {
|
|
1069
|
-
const isVisible = !document.hidden;
|
|
1070
|
-
if (isVisible && !isTabVisible) {
|
|
1071
|
-
sendDateChangedEvent({
|
|
1072
|
-
sessionID: sessionId,
|
|
1073
|
-
state: currentDialogState,
|
|
1074
|
-
});
|
|
1075
|
-
startDatePolling();
|
|
1076
|
-
}
|
|
1077
|
-
else if (!isVisible && isTabVisible) {
|
|
1078
|
-
stopDatePolling();
|
|
1079
|
-
}
|
|
1080
|
-
isTabVisible = isVisible;
|
|
1081
|
-
};
|
|
1082
|
-
if (isTabVisible) {
|
|
1083
|
-
startDatePolling();
|
|
1084
|
-
}
|
|
1085
|
-
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
1086
|
-
return () => {
|
|
1087
|
-
stopDatePolling();
|
|
1088
|
-
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
1089
|
-
};
|
|
1090
|
-
}
|
|
1091
|
-
}, [memori.needsDateTime, sessionId]);
|
|
1092
1055
|
const [userInteractionTimeout, setUserInteractionTimeout] = (0, react_1.useState)();
|
|
1093
1056
|
const timeoutRef = (0, react_1.useRef)();
|
|
1094
1057
|
const clearInteractionTimeout = () => {
|
|
@@ -1627,14 +1590,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1627
1590
|
text: initialQuestion,
|
|
1628
1591
|
});
|
|
1629
1592
|
if (response.resultCode === 500 && response.resultMessage) {
|
|
1630
|
-
setHistory(h => [
|
|
1593
|
+
setHistory(h => [
|
|
1594
|
+
...h,
|
|
1595
|
+
{
|
|
1631
1596
|
text: 'Error: ' + response.resultMessage,
|
|
1632
1597
|
emitter: 'system',
|
|
1633
1598
|
fromUser: false,
|
|
1634
1599
|
initial: false,
|
|
1635
1600
|
contextVars: {},
|
|
1636
1601
|
date: new Date().toISOString(),
|
|
1637
|
-
}
|
|
1602
|
+
},
|
|
1603
|
+
]);
|
|
1638
1604
|
setMemoriTyping(false);
|
|
1639
1605
|
return;
|
|
1640
1606
|
}
|
|
@@ -1946,7 +1912,9 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1946
1912
|
}), "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({
|
|
1947
1913
|
...currentDialogState,
|
|
1948
1914
|
sessionID: sessionId,
|
|
1949
|
-
}), 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, poweredBy: poweredBy, autoStart: autoStart, sessionId: sessionId, hasUserActivatedSpeak: hasUserActivatedSpeak, loading: loading
|
|
1915
|
+
}), 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, poweredBy: poweredBy, autoStart: autoStart, sessionId: sessionId, hasUserActivatedSpeak: hasUserActivatedSpeak, loading: loading, avatar3dHidden: selectedLayout === 'WEBSITE_ASSISTANT'
|
|
1916
|
+
? ((_18 = avatar3dHidden !== null && avatar3dHidden !== void 0 ? avatar3dHidden : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.avatar_3d_hidden) !== null && _18 !== void 0 ? _18 : false)
|
|
1917
|
+
: false }), (0, jsx_runtime_1.jsx)(ArtifactAPI_1.ArtifactAPIBridge, { pushMessage: (message) => {
|
|
1950
1918
|
setHistory(history => {
|
|
1951
1919
|
if (!history.length)
|
|
1952
1920
|
return history;
|
|
@@ -1993,7 +1961,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1993
1961
|
}
|
|
1994
1962
|
throw error;
|
|
1995
1963
|
});
|
|
1996
|
-
}, minimumNumberOfRecoveryTokens: (
|
|
1964
|
+
}, minimumNumberOfRecoveryTokens: (_19 = memori === null || memori === void 0 ? void 0 : memori.minimumNumberOfRecoveryTokens) !== null && _19 !== void 0 ? _19 : 1 })), isClient && ((0, jsx_runtime_1.jsx)(AgeVerificationModal_1.default, { visible: showAgeVerification, minAge: minAge, onClose: birthDate => {
|
|
1997
1965
|
var _a, _b, _c, _d;
|
|
1998
1966
|
if (birthDate) {
|
|
1999
1967
|
setBirthDate(birthDate);
|