@memori.ai/memori-react 9.0.0-alpha.21 → 9.0.0-alpha.22
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 +18 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/dist/components/Auth/Auth.css +12 -5
- package/dist/components/Auth/Auth.d.ts +1 -1
- package/dist/components/Auth/Auth.js +46 -32
- package/dist/components/Auth/Auth.js.map +1 -1
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/dist/components/Chat/Chat.css +1 -0
- package/dist/components/Chat/Chat.js +1 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +32 -5
- package/dist/components/ChatBubble/ChatBubble.js +2 -4
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.js +10 -1
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.css +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/dist/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/dist/components/Header/Header.css +8 -3
- package/dist/components/Header/Header.js +15 -18
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/KnownFacts/KnownFacts.css +1 -1
- package/dist/components/KnownFacts/KnownFacts.js +2 -5
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
- package/dist/components/LoginDrawer/LoginDrawer.css +16 -14
- package/dist/components/LoginDrawer/LoginDrawer.js +19 -11
- package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +35 -31
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/dist/components/PositionPopover/PositionPopover.css +3 -3
- package/dist/components/PositionPopover/PositionPopover.js +38 -25
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
- package/dist/components/Snippet/Snippet.css +1 -1
- package/dist/components/StartPanel/StartPanel.css +19 -3
- package/dist/components/StartPanel/StartPanel.js +12 -18
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/dist/components/layouts/totem.css +43 -9
- package/dist/helpers/positionPopover.d.ts +2 -1
- package/dist/helpers/positionPopover.js +10 -2
- package/dist/helpers/positionPopover.js.map +1 -1
- package/dist/icons/MemoriIcon.js +1 -1
- package/dist/icons/MemoriIcon.js.map +1 -1
- package/dist/locales/de.json +4 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/es.json +3 -1
- package/dist/locales/fr.json +3 -1
- package/dist/locales/it.json +3 -1
- package/dist/styles.css +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/esm/components/Auth/Auth.css +12 -5
- package/esm/components/Auth/Auth.d.ts +1 -1
- package/esm/components/Auth/Auth.js +47 -33
- package/esm/components/Auth/Auth.js.map +1 -1
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/esm/components/Chat/Chat.css +1 -0
- package/esm/components/Chat/Chat.js +1 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +32 -5
- package/esm/components/ChatBubble/ChatBubble.js +2 -4
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +9 -59
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.js +11 -2
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.css +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/esm/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/esm/components/Header/Header.css +8 -3
- package/esm/components/Header/Header.js +15 -18
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/IconButton/IconButton.d.ts +1 -1
- package/esm/components/KnownFacts/KnownFacts.css +1 -1
- package/esm/components/KnownFacts/KnownFacts.js +2 -5
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
- package/esm/components/LoginDrawer/LoginDrawer.css +16 -14
- package/esm/components/LoginDrawer/LoginDrawer.js +20 -12
- package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +36 -32
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/esm/components/PositionPopover/PositionPopover.css +3 -3
- package/esm/components/PositionPopover/PositionPopover.js +39 -26
- package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
- package/esm/components/Snippet/Snippet.css +1 -1
- package/esm/components/StartPanel/StartPanel.css +19 -3
- package/esm/components/StartPanel/StartPanel.js +12 -18
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/esm/components/layouts/totem.css +43 -9
- package/esm/helpers/positionPopover.d.ts +2 -1
- package/esm/helpers/positionPopover.js +9 -2
- package/esm/helpers/positionPopover.js.map +1 -1
- package/esm/icons/MemoriIcon.js +1 -1
- package/esm/icons/MemoriIcon.js.map +1 -1
- package/esm/locales/de.json +4 -1
- package/esm/locales/en.json +3 -1
- package/esm/locales/es.json +3 -1
- package/esm/locales/fr.json +3 -1
- package/esm/locales/it.json +3 -1
- package/esm/styles.css +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +5 -3
- package/src/Live/Agents.stories.tsx +49 -0
- package/src/Live/KnownFacts.stories.tsx +50 -0
- package/src/Showcase.stories.tsx +3 -14
- package/src/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +1 -1
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +1 -0
- package/src/components/Auth/Auth.css +12 -5
- package/src/components/Auth/Auth.stories.tsx +1 -1
- package/src/components/Auth/Auth.test.tsx +68 -1
- package/src/components/Auth/Auth.tsx +69 -54
- package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +5 -6
- package/src/components/Avatar/Avatar.stories.tsx +1 -18
- package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +1 -103
- package/src/components/Blob/Blob.stories.tsx +1 -1
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +1 -1
- package/src/components/ChangeMode/ChangeMode.stories.tsx +1 -1
- package/src/components/Chat/Chat.css +1 -0
- package/src/components/Chat/Chat.stories.tsx +61 -7
- package/src/components/Chat/Chat.tsx +1 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +80 -80
- package/src/components/ChatBubble/ChatBubble.css +32 -5
- package/src/components/ChatBubble/ChatBubble.stories.tsx +13 -2
- package/src/components/ChatBubble/ChatBubble.test.tsx +21 -1
- package/src/components/ChatBubble/ChatBubble.tsx +7 -13
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +158 -185
- package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +1 -1
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +6 -0
- package/src/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx +24 -81
- package/src/components/ChatInputs/ChatInputs.stories.tsx +1 -39
- package/src/components/ChatInputs/ChatInputs.test.tsx +47 -0
- package/src/components/ChatInputs/ChatInputs.tsx +12 -2
- package/src/components/ChatTextArea/ChatTextArea.css +1 -1
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +1 -1
- package/src/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +1 -1
- package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +1 -1
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +29 -10
- package/src/components/Header/Header.css +8 -3
- package/src/components/Header/Header.stories.tsx +1 -1
- package/src/components/Header/Header.tsx +146 -117
- package/src/components/KnownFacts/KnownFacts.css +1 -1
- package/src/components/KnownFacts/KnownFacts.stories.tsx +1 -23
- package/src/components/KnownFacts/KnownFacts.tsx +4 -9
- package/src/components/LoginDrawer/LoginDrawer.css +16 -14
- package/src/components/LoginDrawer/LoginDrawer.stories.tsx +2 -52
- package/src/components/LoginDrawer/LoginDrawer.tsx +51 -39
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +1 -15
- package/src/components/MediaWidget/MediaWidget.stories.tsx +1 -45
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +1 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -6
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +1 -1
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +32 -28
- package/src/components/MemoriWidget/MemoriUIProvider.contract.test.tsx +55 -0
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +55 -77
- package/src/components/MemoriWidget/MemoriWidget.tsx +49 -44
- package/src/components/MemoriWidget/getChatStyles.test.ts +24 -0
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +1 -1
- package/src/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/src/components/PositionPopover/PositionPopover.css +3 -3
- package/src/components/PositionPopover/PositionPopover.stories.tsx +1 -1
- package/src/components/PositionPopover/PositionPopover.tsx +50 -28
- package/src/components/PoweredBy/PoweredBy.stories.tsx +1 -54
- package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +2 -2
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +1 -1
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +1 -1
- package/src/components/ShareButton/ShareButton.stories.tsx +1 -1
- package/src/components/Snippet/Snippet.css +1 -1
- package/src/components/Snippet/Snippet.stories.tsx +1 -1
- package/src/components/StartPanel/StartPanel.css +19 -3
- package/src/components/StartPanel/StartPanel.stories.tsx +2 -2
- package/src/components/StartPanel/StartPanel.tsx +22 -35
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +177 -121
- package/src/components/Typing/Typing.stories.tsx +1 -1
- package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +22 -44
- package/src/components/layouts/FullBody/FullBody.stories.tsx +55 -68
- package/src/components/layouts/Totem/Totem.stories.tsx +69 -87
- package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +69 -87
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +19 -41
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +39 -83
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +15 -11
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +116 -42
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +18 -40
- package/src/components/layouts/layouts.stories.tsx +96 -179
- package/src/components/layouts/totem.css +43 -9
- package/src/helpers/positionPopover.test.ts +36 -1
- package/src/helpers/positionPopover.ts +21 -4
- package/src/i18n.knownFacts.test.ts +40 -0
- package/src/icons/MemoriIcon.tsx +1 -1
- package/src/index.stories.tsx +1 -47
- package/src/locales/de.json +4 -1
- package/src/locales/en.json +3 -1
- package/src/locales/es.json +3 -1
- package/src/locales/fr.json +3 -1
- package/src/locales/it.json +3 -1
- package/src/styles.css +13 -27
- package/src/version.ts +1 -1
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
- package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
- package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
- package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -265
- package/src/components/UploadButton/UploadButton.stories.tsx +0 -510
- package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -69
- package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.stories.tsx +0 -115
|
@@ -187,22 +187,9 @@ function getChatStyles(config) {
|
|
|
187
187
|
const primaryContent = (_a = config === null || config === void 0 ? void 0 : config.buttonTextColor) !== null && _a !== void 0 ? _a : '#ffffff';
|
|
188
188
|
return {
|
|
189
189
|
'--memori-primary-color': primary,
|
|
190
|
-
'--memori-primary': primary,
|
|
191
190
|
'--memori-primary-content': primaryContent,
|
|
192
|
-
'--memori-primary-hover': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast, black) 15%)',
|
|
193
|
-
'--memori-primary-active': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast, black) 25%)',
|
|
194
|
-
'--memori-primary-disabled': 'color-mix(in oklch, var(--memori-primary), transparent 60%)',
|
|
195
|
-
'--memori-primary-subtle': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 60%)',
|
|
196
|
-
'--memori-primary-subtle-hover': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 50%)',
|
|
197
|
-
'--memori-border-primary': 'color-mix(in oklch, var(--memori-primary), transparent 70%)',
|
|
198
|
-
'--memori-border-primary-hover': 'color-mix(in oklch, var(--memori-primary), transparent 50%)',
|
|
199
|
-
'--memori-focus-ring-color': 'color-mix(in oklch, var(--memori-primary), transparent 80%)',
|
|
200
|
-
'--memori-focus-ring': '0 0 0 3px var(--memori-focus-ring-color)',
|
|
201
|
-
'--memori-shadow-primary': '0 8px 16px -4px color-mix(in oklch, var(--memori-primary), transparent 70%)',
|
|
202
|
-
'--memori-skeleton-base': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 85%)',
|
|
203
|
-
'--memori-skeleton-highlight': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 75%)',
|
|
204
191
|
'--memori-icon-active-bg': 'color-mix(in oklch, var(--memori-primary) 12%, transparent)',
|
|
205
|
-
'--memori-icon-recording-bg': 'color-mix(in oklch, var(--memori-error
|
|
192
|
+
'--memori-icon-recording-bg': 'color-mix(in oklch, var(--memori-error) 12%, transparent)',
|
|
206
193
|
};
|
|
207
194
|
}
|
|
208
195
|
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, showMessageConsumption = 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, }) => {
|
|
@@ -826,7 +813,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
826
813
|
}
|
|
827
814
|
}, [initialSessionID]);
|
|
828
815
|
const fetchSession = async (params) => {
|
|
829
|
-
var _a, _b, _c, _d, _f, _g, _h;
|
|
816
|
+
var _a, _b, _c, _d, _f, _g, _h, _j;
|
|
830
817
|
let storageBirthDate = (0, configuration_1.getLocalConfig)('birthDate', undefined);
|
|
831
818
|
let userBirthDate = (_a = birthDate !== null && birthDate !== void 0 ? birthDate : params.birthDate) !== null && _a !== void 0 ? _a : storageBirthDate;
|
|
832
819
|
if (!userBirthDate && !!minAge) {
|
|
@@ -834,8 +821,10 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
834
821
|
return;
|
|
835
822
|
}
|
|
836
823
|
if (memori.privacyType !== 'PUBLIC' &&
|
|
824
|
+
!params.password &&
|
|
837
825
|
!memori.secretToken &&
|
|
838
826
|
!memoriPwd &&
|
|
827
|
+
!((_b = params.recoveryTokens) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
839
828
|
!memoriTokens) {
|
|
840
829
|
setAuthModalState('password');
|
|
841
830
|
return;
|
|
@@ -851,17 +840,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
851
840
|
return window.location.href;
|
|
852
841
|
})();
|
|
853
842
|
}
|
|
854
|
-
catch (
|
|
843
|
+
catch (_k) {
|
|
855
844
|
}
|
|
856
845
|
const session = await initSession({
|
|
857
846
|
...params,
|
|
858
847
|
birthDate: userBirthDate,
|
|
859
|
-
tag: (
|
|
860
|
-
pin: (
|
|
848
|
+
tag: (_c = params.tag) !== null && _c !== void 0 ? _c : personification === null || personification === void 0 ? void 0 : personification.tag,
|
|
849
|
+
pin: (_d = params.pin) !== null && _d !== void 0 ? _d : personification === null || personification === void 0 ? void 0 : personification.pin,
|
|
861
850
|
additionalInfo: {
|
|
862
851
|
...(params.additionalInfo || additionalInfo || {}),
|
|
863
|
-
loginToken: resolveLoginToken((
|
|
864
|
-
language: ((
|
|
852
|
+
loginToken: resolveLoginToken((_f = params.additionalInfo) === null || _f === void 0 ? void 0 : _f.loginToken),
|
|
853
|
+
language: ((_j = userLang !== null && userLang !== void 0 ? userLang : (_h = (_g = memori.culture) === null || _g === void 0 ? void 0 : _g.split('-')) === null || _h === void 0 ? void 0 : _h[0]) !== null && _j !== void 0 ? _j : 'IT').toLowerCase(),
|
|
865
854
|
referral: referral,
|
|
866
855
|
timeZoneOffset: new Date().getTimezoneOffset().toString(),
|
|
867
856
|
},
|
|
@@ -917,15 +906,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
917
906
|
try {
|
|
918
907
|
if (!userBirthDate && !!minAge) {
|
|
919
908
|
setShowAgeVerification(true);
|
|
909
|
+
setLoading(false);
|
|
920
910
|
return;
|
|
921
911
|
}
|
|
922
912
|
if (memori.privacyType !== 'PUBLIC' &&
|
|
923
913
|
!password &&
|
|
924
914
|
!memori.secretToken &&
|
|
925
915
|
!memoriPwd &&
|
|
926
|
-
!recoveryTokens &&
|
|
916
|
+
!(recoveryTokens === null || recoveryTokens === void 0 ? void 0 : recoveryTokens.length) &&
|
|
927
917
|
!memoriTokens) {
|
|
928
918
|
setAuthModalState('password');
|
|
919
|
+
setLoading(false);
|
|
929
920
|
return;
|
|
930
921
|
}
|
|
931
922
|
if (!(await checkCredits({ notify: true }))) {
|
|
@@ -1552,16 +1543,22 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1552
1543
|
}, []);
|
|
1553
1544
|
(0, react_1.useEffect)(() => {
|
|
1554
1545
|
if (!isPlayingAudio &&
|
|
1546
|
+
!memoriTyping &&
|
|
1555
1547
|
continuousSpeech &&
|
|
1556
1548
|
(hasUserActivatedListening || !requestedListening) &&
|
|
1557
1549
|
sessionId &&
|
|
1558
1550
|
!hasUserTypedMessage) {
|
|
1559
1551
|
startRecording();
|
|
1560
1552
|
}
|
|
1561
|
-
else if (isPlayingAudio && isListening) {
|
|
1553
|
+
else if ((isPlayingAudio || memoriTyping) && isListening) {
|
|
1562
1554
|
stopRecording();
|
|
1563
1555
|
}
|
|
1564
|
-
}, [
|
|
1556
|
+
}, [
|
|
1557
|
+
isPlayingAudio,
|
|
1558
|
+
hasUserActivatedListening,
|
|
1559
|
+
hasUserTypedMessage,
|
|
1560
|
+
memoriTyping,
|
|
1561
|
+
]);
|
|
1565
1562
|
(0, react_1.useEffect)(() => {
|
|
1566
1563
|
stopRecording();
|
|
1567
1564
|
}, [language]);
|
|
@@ -1611,7 +1608,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1611
1608
|
transform: none;
|
|
1612
1609
|
}`);
|
|
1613
1610
|
}
|
|
1614
|
-
const integrationStylesheet = `@layer
|
|
1611
|
+
const integrationStylesheet = `@layer memori.overrides {
|
|
1615
1612
|
${integrationStylesheetParts.join('\n ')}
|
|
1616
1613
|
}
|
|
1617
1614
|
`;
|
|
@@ -1713,8 +1710,9 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1713
1710
|
if (!birth && autoStart && (initialSessionID || targetSessionID))
|
|
1714
1711
|
birth = '1970-01-01T10:24:03.845Z';
|
|
1715
1712
|
const localPosition = (0, configuration_1.getLocalConfig)('position', undefined);
|
|
1716
|
-
if (autoStart &&
|
|
1717
|
-
|
|
1713
|
+
if (autoStart &&
|
|
1714
|
+
(0, positionPopover_1.shouldHoldAutoStartForPosition)(!!memori.needsPosition, Boolean(position || localPosition))) {
|
|
1715
|
+
setClickedStart(false);
|
|
1718
1716
|
return;
|
|
1719
1717
|
}
|
|
1720
1718
|
if (!(await checkCredits({ notify: true }))) {
|
|
@@ -1991,8 +1989,9 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1991
1989
|
}, [memoriPwd, memori, memoriTokens, birthDate, sessionId, userLang, position]);
|
|
1992
1990
|
const setPositionPopoverOpen = (0, react_1.useCallback)((open) => {
|
|
1993
1991
|
const sessionAlreadyStarted = !!(sessionId && hasUserActivatedSpeak);
|
|
1992
|
+
const hasPosition = Boolean(position || (0, configuration_1.getLocalConfig)('position', undefined));
|
|
1994
1993
|
setPositionPopoverOpenState(wasOpen => {
|
|
1995
|
-
if ((0, positionPopover_1.shouldRestartSessionOnPositionPopoverClose)(wasOpen, open, autoStart, sessionAlreadyStarted)) {
|
|
1994
|
+
if ((0, positionPopover_1.shouldRestartSessionOnPositionPopoverClose)(wasOpen, open, autoStart, sessionAlreadyStarted, hasPosition)) {
|
|
1996
1995
|
queueMicrotask(() => {
|
|
1997
1996
|
onClickStart();
|
|
1998
1997
|
});
|
|
@@ -2004,14 +2003,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
2004
2003
|
}
|
|
2005
2004
|
return open;
|
|
2006
2005
|
});
|
|
2007
|
-
}, [autoStart, onClickStart, sessionId, hasUserActivatedSpeak]);
|
|
2006
|
+
}, [autoStart, onClickStart, sessionId, hasUserActivatedSpeak, position]);
|
|
2008
2007
|
(0, react_1.useEffect)(() => {
|
|
2008
|
+
const storedPosition = (0, configuration_1.getLocalConfig)('position', undefined);
|
|
2009
|
+
const hasPosition = Boolean(position || storedPosition);
|
|
2009
2010
|
if (!clickedStart &&
|
|
2010
2011
|
!sessionStartingRef.current &&
|
|
2011
2012
|
!sessionId &&
|
|
2012
2013
|
autoStart &&
|
|
2013
2014
|
selectedLayout !== 'HIDDEN_CHAT' &&
|
|
2014
|
-
(!needsCredits || hasEnoughCredits)
|
|
2015
|
+
(!needsCredits || hasEnoughCredits) &&
|
|
2016
|
+
!(0, positionPopover_1.shouldHoldAutoStartForPosition)(!!memori.needsPosition, hasPosition)) {
|
|
2015
2017
|
onClickStart();
|
|
2016
2018
|
}
|
|
2017
2019
|
}, [
|
|
@@ -2021,6 +2023,8 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
2021
2023
|
sessionId,
|
|
2022
2024
|
needsCredits,
|
|
2023
2025
|
hasEnoughCredits,
|
|
2026
|
+
position,
|
|
2027
|
+
memori.needsPosition,
|
|
2024
2028
|
]);
|
|
2025
2029
|
(0, react_1.useEffect)(() => {
|
|
2026
2030
|
var _a;
|
|
@@ -2158,7 +2162,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
2158
2162
|
};
|
|
2159
2163
|
}, [sessionId]);
|
|
2160
2164
|
const showFullHistory = showOnlyLastMessages === undefined
|
|
2161
|
-
? selectedLayout !== '
|
|
2165
|
+
? selectedLayout !== 'WEBSITE_ASSISTANT'
|
|
2162
2166
|
: !showOnlyLastMessages;
|
|
2163
2167
|
const canShowLoginButton = !(tenant === null || tenant === void 0 ? void 0 : tenant.ssoLogin) &&
|
|
2164
2168
|
((_y = showLogin !== null && showLogin !== void 0 ? showLogin : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.showLogin) !== null && _y !== void 0 ? _y : memori.requireLoginToken);
|
|
@@ -2442,7 +2446,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
2442
2446
|
setChatLogID(chatLog.chatLogID);
|
|
2443
2447
|
onClickStart(undefined, false, chatLog);
|
|
2444
2448
|
setShowChatHistoryDrawer(false);
|
|
2445
|
-
}, apiClient: client, sessionId: sessionId || '', memori: memori, baseUrl: baseUrl, history: history, apiUrl: client.constants.BACKEND_URL, loginToken: loginToken, language: language, userLang: userLang, isMultilanguageEnabled: isMultilanguageEnabled })), showKnownFactsDrawer && sessionId && ((0, jsx_runtime_1.jsx)(KnownFacts_1.default, { apiClient: client, memori: memori, sessionID: sessionId, visible: showKnownFactsDrawer, closeDrawer: () => setShowKnownFactsDrawer(false) })), showExpertsDrawer && !!experts && ((0, jsx_runtime_1.jsx)(ExpertsDrawer_1.default, { apiUrl: client.constants.BACKEND_URL, baseUrl: baseUrl, tenant: tenant, experts: experts, open: showExpertsDrawer, onClose: () => setShowExpertsDrawer(false) })), showLoginDrawer && (tenant === null || tenant === void 0 ? void 0 : tenant.name) && ((0, jsx_runtime_1.jsx)(LoginDrawer_1.default, { tenant: tenant, apiClient: client, open: !!showLoginDrawer, user: user, loginToken: loginToken, onClose: () => setShowLoginDrawer(false), drawerClassName: selectedLayout === 'WEBSITE_ASSISTANT'
|
|
2449
|
+
}, apiClient: client, sessionId: sessionId || '', memori: memori, baseUrl: baseUrl, history: history, apiUrl: client.constants.BACKEND_URL, loginToken: loginToken, language: language, userLang: userLang, isMultilanguageEnabled: isMultilanguageEnabled, showFunctionCache: showFunctionCache, showMessageConsumption: enableMessageConsumption })), showKnownFactsDrawer && sessionId && ((0, jsx_runtime_1.jsx)(KnownFacts_1.default, { apiClient: client, memori: memori, sessionID: sessionId, visible: showKnownFactsDrawer, closeDrawer: () => setShowKnownFactsDrawer(false) })), showExpertsDrawer && !!experts && ((0, jsx_runtime_1.jsx)(ExpertsDrawer_1.default, { apiUrl: client.constants.BACKEND_URL, baseUrl: baseUrl, tenant: tenant, experts: experts, open: showExpertsDrawer, onClose: () => setShowExpertsDrawer(false) })), showLoginDrawer && (tenant === null || tenant === void 0 ? void 0 : tenant.name) && ((0, jsx_runtime_1.jsx)(LoginDrawer_1.default, { tenant: tenant, apiClient: client, open: !!showLoginDrawer, user: user, loginToken: loginToken, onClose: () => setShowLoginDrawer(false), drawerClassName: selectedLayout === 'WEBSITE_ASSISTANT'
|
|
2446
2450
|
? 'memori-drawer--above-website-assistant'
|
|
2447
2451
|
: undefined, onLogin: (user, token) => {
|
|
2448
2452
|
var _a, _b, _c, _d;
|