@memori.ai/memori-react 8.45.1 → 8.45.4
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 +27 -0
- package/dist/components/Chat/Chat.js +4 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +4 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +2 -1
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/PositionPopover/PositionPopover.js +38 -25
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
- package/dist/components/UploadButton/UploadButton.js +3 -0
- package/dist/components/UploadButton/UploadButton.js.map +1 -1
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +14 -2
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/dist/components/layouts/chat.css +27 -4
- package/dist/context/widgetSurfaceContext.js +2 -2
- package/dist/context/widgetSurfaceContext.js.map +1 -1
- package/dist/helpers/constants.d.ts +3 -2
- package/dist/helpers/constants.js +19 -20
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/positionPopover.d.ts +2 -1
- package/dist/helpers/positionPopover.js +12 -3
- package/dist/helpers/positionPopover.js.map +1 -1
- package/dist/helpers/tts/muteSpeaker.js +4 -3
- package/dist/helpers/tts/muteSpeaker.js.map +1 -1
- package/dist/helpers/usePressTooltip.js +2 -1
- package/dist/helpers/usePressTooltip.js.map +1 -1
- package/dist/helpers/utils.d.ts +2 -1
- package/dist/helpers/utils.js +7 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/icons/MemoriIcon.js +1 -1
- package/dist/icons/MemoriIcon.js.map +1 -1
- package/dist/styles.css +1 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/Chat/Chat.js +4 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +2 -1
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/UploadButton/UploadButton.js +4 -1
- package/esm/components/UploadButton/UploadButton.js.map +1 -1
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +16 -4
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/esm/components/layouts/chat.css +27 -4
- package/esm/helpers/constants.d.ts +3 -2
- package/esm/helpers/constants.js +18 -19
- package/esm/helpers/constants.js.map +1 -1
- package/esm/helpers/utils.d.ts +2 -1
- package/esm/helpers/utils.js +6 -1
- package/esm/helpers/utils.js.map +1 -1
- package/esm/styles.css +1 -2
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +6 -7
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.d.ts +0 -3
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js +0 -64
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map +0 -1
- package/dist/testUtils.d.ts +0 -5
- package/dist/testUtils.js +0 -18
- package/dist/testUtils.js.map +0 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.d.ts +0 -3
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js +0 -62
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map +0 -1
- package/src/I18nWrapper.tsx +0 -13
- package/src/__snapshots__/index.test.tsx.snap +0 -96
- package/src/components/AgeVerificationModal/AgeVerificationModal.css +0 -95
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +0 -46
- package/src/components/AgeVerificationModal/AgeVerificationModal.test.tsx +0 -33
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +0 -99
- package/src/components/AgeVerificationModal/__snapshots__/AgeVerificationModal.test.tsx.snap +0 -19
- package/src/components/Auth/Auth.css +0 -57
- package/src/components/Auth/Auth.stories.tsx +0 -90
- package/src/components/Auth/Auth.test.tsx +0 -63
- package/src/components/Auth/Auth.tsx +0 -201
- package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +0 -143
- package/src/components/Avatar/Avatar.css +0 -151
- package/src/components/Avatar/Avatar.stories.tsx +0 -160
- package/src/components/Avatar/Avatar.test.tsx +0 -158
- package/src/components/Avatar/Avatar.tsx +0 -245
- package/src/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.tsx +0 -103
- package/src/components/Avatar/AvatarView/AvatarComponent/avatarComponent.tsx +0 -105
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +0 -338
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/types.ts +0 -44
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.ts +0 -1091
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarPositionController.ts +0 -83
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.ts +0 -301
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controls.tsx +0 -100
- package/src/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.tsx +0 -152
- package/src/components/Avatar/AvatarView/AvatarComponent/components/loader.tsx +0 -31
- package/src/components/Avatar/AvatarView/AvatarComponent/constants.ts +0 -141
- package/src/components/Avatar/AvatarView/AvatarComponent/lights/Lights.tsx +0 -145
- package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.css +0 -111
- package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.tsx +0 -201
- package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +0 -254
- package/src/components/Avatar/AvatarView/index.tsx +0 -194
- package/src/components/Avatar/AvatarView/utils/hideHands.ts +0 -11
- package/src/components/Avatar/AvatarView/utils/useEyeBlink.ts +0 -100
- package/src/components/Avatar/AvatarView/utils/useHeadMovement.ts +0 -72
- package/src/components/Avatar/AvatarView/utils/useLoadingMorphAnim.ts +0 -38
- package/src/components/Avatar/AvatarView/utils/useMouthAnimation.ts +0 -93
- package/src/components/Avatar/AvatarView/utils/useSmile.ts +0 -39
- package/src/components/Avatar/AvatarView/utils/utils.ts +0 -55
- package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +0 -246
- package/src/components/Blob/Blob.css +0 -286
- package/src/components/Blob/Blob.stories.tsx +0 -53
- package/src/components/Blob/Blob.test.tsx +0 -18
- package/src/components/Blob/Blob.tsx +0 -26
- package/src/components/Blob/__snapshots__/Blob.test.tsx.snap +0 -80
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +0 -40
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +0 -58
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.test.tsx +0 -53
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx +0 -74
- package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +0 -181
- package/src/components/ChangeMode/ChangeMode.css +0 -22
- package/src/components/ChangeMode/ChangeMode.stories.tsx +0 -50
- package/src/components/ChangeMode/ChangeMode.test.tsx +0 -24
- package/src/components/ChangeMode/ChangeMode.tsx +0 -51
- package/src/components/ChangeMode/__snapshots__/ChangeMode.test.tsx.snap +0 -107
- package/src/components/Chat/Chat.css +0 -285
- package/src/components/Chat/Chat.stories.tsx +0 -1684
- package/src/components/Chat/Chat.test.tsx +0 -372
- package/src/components/Chat/Chat.tsx +0 -778
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +0 -6816
- package/src/components/ChatBubble/ChatBubble.css +0 -430
- package/src/components/ChatBubble/ChatBubble.stories.tsx +0 -1192
- package/src/components/ChatBubble/ChatBubble.test.tsx +0 -481
- package/src/components/ChatBubble/ChatBubble.tsx +0 -776
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +0 -8734
- package/src/components/ChatHistoryDrawer/ChatHistory.css +0 -587
- package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +0 -410
- package/src/components/ChatHistoryDrawer/ChatHistory.test.tsx +0 -107
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +0 -1298
- package/src/components/ChatHistoryDrawer/__snapshots__/ChatHistory.test.tsx.snap +0 -27
- package/src/components/ChatInputs/ChatInputs.css +0 -340
- package/src/components/ChatInputs/ChatInputs.stories.tsx +0 -251
- package/src/components/ChatInputs/ChatInputs.tsx +0 -487
- package/src/components/ChatTextArea/ChatTextArea.css +0 -185
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
- package/src/components/ChatTextArea/ChatTextArea.test.tsx +0 -28
- package/src/components/ChatTextArea/ChatTextArea.tsx +0 -171
- package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +0 -68
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.css +0 -36
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +0 -296
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.test.tsx +0 -31
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +0 -232
- package/src/components/CompletionProviderStatus/__snapshots__/CompletionProviderStatus.test.tsx.snap +0 -96
- package/src/components/ContentPreviewModal/ContentPreviewModal.css +0 -128
- package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +0 -67
- package/src/components/ContentPreviewModal/index.ts +0 -2
- package/src/components/CustomGLBModelViewer/ModelViewer.css +0 -11
- package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
- package/src/components/CustomGLBModelViewer/ModelViewer.test.tsx +0 -13
- package/src/components/CustomGLBModelViewer/ModelViewer.tsx +0 -37
- package/src/components/CustomGLBModelViewer/__snapshots__/ModelViewer.test.tsx.snap +0 -20
- package/src/components/DateSelector/DateSelector.css +0 -158
- package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
- package/src/components/DateSelector/DateSelector.test.tsx +0 -149
- package/src/components/DateSelector/DateSelector.tsx +0 -251
- package/src/components/DateSelector/__snapshots__/DateSelector.test.tsx.snap +0 -1954
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +0 -54
- package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -67
- package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +0 -54
- package/src/components/ExpertsDrawer/ExpertsDrawer.test.tsx +0 -53
- package/src/components/ExpertsDrawer/ExpertsDrawer.tsx +0 -69
- package/src/components/ExpertsDrawer/__snapshots__/ExpertsDrawer.test.tsx.snap +0 -11
- package/src/components/ExportHistoryButton/ExportHistoryButton.css +0 -22
- package/src/components/FeedbackButtons/FeedbackButtons.css +0 -107
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +0 -52
- package/src/components/FeedbackButtons/FeedbackButtons.test.tsx +0 -11
- package/src/components/FeedbackButtons/FeedbackButtons.tsx +0 -152
- package/src/components/FeedbackButtons/__snapshots__/FeedbackButtons.test.tsx.snap +0 -42
- package/src/components/FilePreview/FilePreview.css +0 -358
- package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
- package/src/components/FilePreview/FilePreview.test.tsx +0 -26
- package/src/components/FilePreview/FilePreview.tsx +0 -277
- package/src/components/FilePreview/__snapshots__/FilePreview.test.tsx.snap +0 -185
- package/src/components/Header/ChatConsumptionDropdown.test.tsx +0 -117
- package/src/components/Header/ChatConsumptionDropdown.tsx +0 -275
- package/src/components/Header/Header.css +0 -282
- package/src/components/Header/Header.stories.tsx +0 -338
- package/src/components/Header/Header.test.tsx +0 -371
- package/src/components/Header/Header.tsx +0 -442
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +0 -964
- package/src/components/KnownFacts/KnownFacts.css +0 -19
- package/src/components/KnownFacts/KnownFacts.stories.tsx +0 -80
- package/src/components/KnownFacts/KnownFacts.test.tsx +0 -57
- package/src/components/KnownFacts/KnownFacts.tsx +0 -376
- package/src/components/KnownFacts/__snapshots__/KnownFacts.test.tsx.snap +0 -19
- package/src/components/LoginDrawer/LoginDrawer.css +0 -1616
- package/src/components/LoginDrawer/LoginDrawer.stories.tsx +0 -102
- package/src/components/LoginDrawer/LoginDrawer.test.tsx +0 -199
- package/src/components/LoginDrawer/LoginDrawer.tsx +0 -600
- package/src/components/LoginDrawer/__snapshots__/LoginDrawer.test.tsx.snap +0 -91
- package/src/components/MediaWidget/DocumentCard.test.tsx +0 -45
- package/src/components/MediaWidget/DocumentCard.tsx +0 -19
- package/src/components/MediaWidget/MediaItemWidget.css +0 -1398
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +0 -423
- package/src/components/MediaWidget/MediaItemWidget.test.tsx +0 -248
- package/src/components/MediaWidget/MediaItemWidget.tsx +0 -997
- package/src/components/MediaWidget/MediaItemWidget.types.ts +0 -65
- package/src/components/MediaWidget/MediaItemWidget.utils.test.ts +0 -367
- package/src/components/MediaWidget/MediaItemWidget.utils.ts +0 -227
- package/src/components/MediaWidget/MediaPreviewModal.test.tsx +0 -271
- package/src/components/MediaWidget/MediaPreviewModal.tsx +0 -425
- package/src/components/MediaWidget/MediaWidget.css +0 -131
- package/src/components/MediaWidget/MediaWidget.stories.tsx +0 -319
- package/src/components/MediaWidget/MediaWidget.test.tsx +0 -41
- package/src/components/MediaWidget/MediaWidget.tsx +0 -107
- package/src/components/MediaWidget/__snapshots__/DocumentCard.test.tsx.snap +0 -24
- package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +0 -791
- package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +0 -154
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -2299
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +0 -163
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +0 -250
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +0 -30
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.tsx +0 -467
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.tsx +0 -89
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts +0 -619
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/index.ts +0 -9
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +0 -489
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.tsx +0 -90
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/types.ts +0 -73
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/utils/PDFExporter.ts +0 -454
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +0 -1059
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +0 -431
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +0 -150
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.tsx +0 -79
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +0 -253
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +0 -561
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +0 -355
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +0 -160
- package/src/components/MemoriArtifactSystem/context/ArtifactContext.tsx +0 -167
- package/src/components/MemoriArtifactSystem/types/artifact.types.ts +0 -35
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +0 -308
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.tsx +0 -379
- package/src/components/MemoriArtifactSystem/utils/applyEdits.test.ts +0 -85
- package/src/components/MemoriArtifactSystem/utils/applyEdits.ts +0 -173
- package/src/components/MemoriWidget/MemoriWidget.css +0 -220
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +0 -274
- package/src/components/MemoriWidget/MemoriWidget.tsx +0 -3930
- package/src/components/MicrophoneButton/MicrophoneButton.css +0 -142
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +0 -52
- package/src/components/MicrophoneButton/MicrophoneButton.tsx +0 -128
- package/src/components/PositionDrawer/PositionDrawer.stories.tsx +0 -51
- package/src/components/PositionDrawer/PositionDrawer.test.tsx +0 -39
- package/src/components/PositionDrawer/PositionDrawer.tsx +0 -50
- package/src/components/PositionDrawer/__snapshots__/PositionDrawer.test.tsx.snap +0 -17
- package/src/components/PoweredBy/PoweredBy.css +0 -47
- package/src/components/PoweredBy/PoweredBy.stories.tsx +0 -75
- package/src/components/PoweredBy/PoweredBy.test.tsx +0 -15
- package/src/components/PoweredBy/PoweredBy.tsx +0 -44
- package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +0 -55
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.css +0 -47
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +0 -58
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.test.tsx +0 -17
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.tsx +0 -82
- package/src/components/SendOnEnterMenu/__snapshots__/SendOnEnterMenu.test.tsx.snap +0 -57
- package/src/components/SettingsDrawer/SettingsDrawer.css +0 -24
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +0 -94
- package/src/components/SettingsDrawer/SettingsDrawer.test.tsx +0 -202
- package/src/components/SettingsDrawer/SettingsDrawer.tsx +0 -255
- package/src/components/SettingsDrawer/__snapshots__/SettingsDrawer.test.tsx.snap +0 -59
- package/src/components/ShareButton/ShareButton.css +0 -73
- package/src/components/ShareButton/ShareButton.stories.tsx +0 -98
- package/src/components/ShareButton/ShareButton.test.tsx +0 -53
- package/src/components/ShareButton/ShareButton.tsx +0 -395
- package/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap +0 -316
- package/src/components/Snippet/Snippet.css +0 -142
- package/src/components/Snippet/Snippet.stories.tsx +0 -286
- package/src/components/Snippet/Snippet.test.tsx +0 -176
- package/src/components/Snippet/Snippet.tsx +0 -148
- package/src/components/Snippet/__snapshots__/Snippet.test.tsx.snap +0 -603
- package/src/components/StartPanel/StartPanel.css +0 -273
- package/src/components/StartPanel/StartPanel.stories.tsx +0 -404
- package/src/components/StartPanel/StartPanel.test.tsx +0 -360
- package/src/components/StartPanel/StartPanel.tsx +0 -426
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +0 -1986
- package/src/components/Typing/Typing.stories.tsx +0 -130
- package/src/components/Typing/Typing.test.tsx +0 -62
- package/src/components/Typing/Typing.tsx +0 -154
- package/src/components/Typing/__snapshots__/Typing.test.tsx.snap +0 -133
- package/src/components/UploadButton/UploadButton.css +0 -542
- package/src/components/UploadButton/UploadButton.stories.tsx +0 -376
- package/src/components/UploadButton/UploadButton.test.tsx +0 -11
- package/src/components/UploadButton/UploadButton.tsx +0 -684
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +0 -405
- package/src/components/UploadButton/UploadImages/UploadImages.tsx +0 -538
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +0 -165
- package/src/components/VenueWidget/VenueWidget.css +0 -163
- package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -66
- package/src/components/VenueWidget/VenueWidget.test.tsx +0 -49
- package/src/components/VenueWidget/VenueWidget.tsx +0 -458
- package/src/components/VenueWidget/__snapshots__/VenueWidget.test.tsx.snap +0 -370
- package/src/components/WhyThisAnswer/WhyThisAnswer.css +0 -171
- package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +0 -285
- package/src/components/WhyThisAnswer/WhyThisAnswer.test.tsx +0 -245
- package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +0 -233
- package/src/components/WhyThisAnswer/__snapshots__/WhyThisAnswer.test.tsx.snap +0 -27
- package/src/components/icons/AI.tsx +0 -34
- package/src/components/icons/Alert.tsx +0 -31
- package/src/components/icons/ArrowUp.tsx +0 -28
- package/src/components/icons/Bug.tsx +0 -81
- package/src/components/icons/Chat.tsx +0 -30
- package/src/components/icons/ChevronDown.tsx +0 -26
- package/src/components/icons/ChevronLeft.tsx +0 -28
- package/src/components/icons/ChevronRight.tsx +0 -28
- package/src/components/icons/ChevronUp.tsx +0 -24
- package/src/components/icons/Clear.tsx +0 -23
- package/src/components/icons/Close.tsx +0 -30
- package/src/components/icons/Code.tsx +0 -24
- package/src/components/icons/Copy.tsx +0 -23
- package/src/components/icons/DeepThought.tsx +0 -38
- package/src/components/icons/Delete.tsx +0 -23
- package/src/components/icons/Document.tsx +0 -50
- package/src/components/icons/Download.tsx +0 -23
- package/src/components/icons/Edit.tsx +0 -17
- package/src/components/icons/Expand.tsx +0 -23
- package/src/components/icons/Eye.tsx +0 -17
- package/src/components/icons/EyeInvisible.tsx +0 -24
- package/src/components/icons/Facebook.tsx +0 -23
- package/src/components/icons/Feedback.tsx +0 -24
- package/src/components/icons/File.tsx +0 -17
- package/src/components/icons/FileExcel.tsx +0 -23
- package/src/components/icons/FilePdf.tsx +0 -23
- package/src/components/icons/FileWord.tsx +0 -23
- package/src/components/icons/Fullscreen.tsx +0 -23
- package/src/components/icons/FullscreenExit.tsx +0 -23
- package/src/components/icons/GasStation.tsx +0 -36
- package/src/components/icons/Group.tsx +0 -30
- package/src/components/icons/History.tsx +0 -33
- package/src/components/icons/Image.tsx +0 -37
- package/src/components/icons/Info.tsx +0 -31
- package/src/components/icons/Link.tsx +0 -17
- package/src/components/icons/Linkedin.tsx +0 -23
- package/src/components/icons/Loading.tsx +0 -28
- package/src/components/icons/Logout.tsx +0 -27
- package/src/components/icons/Mail.tsx +0 -17
- package/src/components/icons/MapMarker.tsx +0 -26
- package/src/components/icons/MenuHorizontal.tsx +0 -29
- package/src/components/icons/MenuVertical.tsx +0 -29
- package/src/components/icons/Message.tsx +0 -23
- package/src/components/icons/Microphone.tsx +0 -23
- package/src/components/icons/Minus.tsx +0 -23
- package/src/components/icons/MinusCircle.tsx +0 -24
- package/src/components/icons/PaperClip.tsx +0 -23
- package/src/components/icons/Picture.tsx +0 -23
- package/src/components/icons/Plus.tsx +0 -18
- package/src/components/icons/Preview.tsx +0 -29
- package/src/components/icons/Print.tsx +0 -38
- package/src/components/icons/QuestionHelp.tsx +0 -30
- package/src/components/icons/Refresh.tsx +0 -30
- package/src/components/icons/SelectIcon.tsx +0 -28
- package/src/components/icons/Send.tsx +0 -17
- package/src/components/icons/Setting.tsx +0 -23
- package/src/components/icons/Share.tsx +0 -23
- package/src/components/icons/Sound.tsx +0 -23
- package/src/components/icons/SoundDeactivated.tsx +0 -27
- package/src/components/icons/Telegram.tsx +0 -26
- package/src/components/icons/ThumbDown.tsx +0 -29
- package/src/components/icons/ThumbUp.tsx +0 -29
- package/src/components/icons/Translation.tsx +0 -24
- package/src/components/icons/Twitter.tsx +0 -23
- package/src/components/icons/Upload.tsx +0 -34
- package/src/components/icons/User.tsx +0 -17
- package/src/components/icons/Warning.tsx +0 -24
- package/src/components/icons/WhatsApp.tsx +0 -24
- package/src/components/icons/icons.stories.css +0 -5
- package/src/components/icons/icons.stories.tsx +0 -81
- package/src/components/icons/loading.css +0 -14
- package/src/components/layouts/Chat.test.tsx +0 -40
- package/src/components/layouts/Chat.tsx +0 -69
- package/src/components/layouts/FullBody/FullBody.stories.tsx +0 -110
- package/src/components/layouts/FullPage.test.tsx +0 -65
- package/src/components/layouts/FullPage.tsx +0 -80
- package/src/components/layouts/HiddenChat.test.tsx +0 -40
- package/src/components/layouts/HiddenChat.tsx +0 -233
- package/src/components/layouts/Totem/Totem.stories.tsx +0 -131
- package/src/components/layouts/Totem.test.tsx +0 -40
- package/src/components/layouts/Totem.tsx +0 -49
- package/src/components/layouts/WebsiteAssistant.test.tsx +0 -40
- package/src/components/layouts/WebsiteAssistant.tsx +0 -132
- package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +0 -131
- package/src/components/layouts/ZoomedFullBody.test.tsx +0 -40
- package/src/components/layouts/ZoomedFullBody.tsx +0 -81
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +0 -457
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +0 -1045
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +0 -460
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +0 -566
- package/src/components/layouts/__snapshots__/WebsiteAssistant.test.tsx.snap +0 -59
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +0 -523
- package/src/components/layouts/chat.css +0 -451
- package/src/components/layouts/hidden-chat.css +0 -276
- package/src/components/layouts/layouts.stories.tsx +0 -231
- package/src/components/layouts/totem.css +0 -221
- package/src/components/layouts/website-assistant.css +0 -677
- package/src/components/layouts/zoomed-full-body.css +0 -18
- package/src/components/ui/Alert.css +0 -93
- package/src/components/ui/Alert.stories.tsx +0 -137
- package/src/components/ui/Alert.test.tsx +0 -129
- package/src/components/ui/Alert.tsx +0 -123
- package/src/components/ui/Button.css +0 -167
- package/src/components/ui/Button.stories.tsx +0 -156
- package/src/components/ui/Button.test.tsx +0 -74
- package/src/components/ui/Button.tsx +0 -107
- package/src/components/ui/Card.css +0 -65
- package/src/components/ui/Card.stories.tsx +0 -95
- package/src/components/ui/Card.test.tsx +0 -47
- package/src/components/ui/Card.tsx +0 -48
- package/src/components/ui/Checkbox.css +0 -116
- package/src/components/ui/Checkbox.stories.tsx +0 -74
- package/src/components/ui/Checkbox.test.tsx +0 -28
- package/src/components/ui/Checkbox.tsx +0 -58
- package/src/components/ui/ConfirmDialog.css +0 -42
- package/src/components/ui/ConfirmDialog.stories.tsx +0 -216
- package/src/components/ui/ConfirmDialog.test.tsx +0 -124
- package/src/components/ui/ConfirmDialog.tsx +0 -58
- package/src/components/ui/Details.css +0 -66
- package/src/components/ui/Drawer.css +0 -270
- package/src/components/ui/Drawer.stories.tsx +0 -267
- package/src/components/ui/Drawer.test.tsx +0 -130
- package/src/components/ui/Drawer.tsx +0 -293
- package/src/components/ui/Dropdown.css +0 -173
- package/src/components/ui/Dropdown.tsx +0 -63
- package/src/components/ui/Expandable.css +0 -15
- package/src/components/ui/Expandable.stories.tsx +0 -180
- package/src/components/ui/Expandable.test.tsx +0 -107
- package/src/components/ui/Expandable.tsx +0 -121
- package/src/components/ui/Modal.css +0 -98
- package/src/components/ui/Modal.stories.tsx +0 -171
- package/src/components/ui/Modal.test.tsx +0 -111
- package/src/components/ui/Modal.tsx +0 -117
- package/src/components/ui/Select.css +0 -138
- package/src/components/ui/Select.stories.tsx +0 -79
- package/src/components/ui/Select.test.tsx +0 -84
- package/src/components/ui/Select.tsx +0 -79
- package/src/components/ui/Slider.css +0 -192
- package/src/components/ui/Slider.stories.tsx +0 -63
- package/src/components/ui/Slider.tsx +0 -142
- package/src/components/ui/Spin.css +0 -31
- package/src/components/ui/Spin.stories.tsx +0 -64
- package/src/components/ui/Spin.test.tsx +0 -41
- package/src/components/ui/Spin.tsx +0 -31
- package/src/components/ui/Table.css +0 -132
- package/src/components/ui/Tooltip.css +0 -171
- package/src/components/ui/Tooltip.stories.tsx +0 -109
- package/src/components/ui/Tooltip.test.tsx +0 -102
- package/src/components/ui/Tooltip.tsx +0 -163
- package/src/components/ui/__snapshots__/Alert.test.tsx.snap +0 -59
- package/src/components/ui/__snapshots__/Button.test.tsx.snap +0 -204
- package/src/components/ui/__snapshots__/Card.test.tsx.snap +0 -321
- package/src/components/ui/__snapshots__/Checkbox.test.tsx.snap +0 -131
- package/src/components/ui/__snapshots__/ConfirmDialog.test.tsx.snap +0 -35
- package/src/components/ui/__snapshots__/Drawer.test.tsx.snap +0 -67
- package/src/components/ui/__snapshots__/Expandable.test.tsx.snap +0 -159
- package/src/components/ui/__snapshots__/Modal.test.tsx.snap +0 -59
- package/src/components/ui/__snapshots__/Select.test.tsx.snap +0 -254
- package/src/components/ui/__snapshots__/Spin.test.tsx.snap +0 -193
- package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +0 -113
- package/src/components/ui/definitions.stories.tsx +0 -139
- package/src/context/visemeContext.tsx +0 -384
- package/src/helpers/chatPdfExport.ts +0 -544
- package/src/helpers/configuration.ts +0 -42
- package/src/helpers/constants.ts +0 -267
- package/src/helpers/convertDocument.test.ts +0 -67
- package/src/helpers/convertDocument.ts +0 -35
- package/src/helpers/credits.ts +0 -54
- package/src/helpers/error.test.ts +0 -29
- package/src/helpers/error.ts +0 -278
- package/src/helpers/imageCompression.ts +0 -230
- package/src/helpers/llmUsage.ts +0 -328
- package/src/helpers/markedExtendedTables.js +0 -217
- package/src/helpers/media.test.ts +0 -169
- package/src/helpers/media.ts +0 -81
- package/src/helpers/message.test.ts +0 -126
- package/src/helpers/message.ts +0 -219
- package/src/helpers/nats/getNatsConfig.ts +0 -148
- package/src/helpers/nats/isSessionExpiredError.test.ts +0 -38
- package/src/helpers/nats/isSessionExpiredError.ts +0 -51
- package/src/helpers/nats/useNats.test.tsx +0 -81
- package/src/helpers/nats/useNats.ts +0 -204
- package/src/helpers/nats/useNatsSession.test.ts +0 -16
- package/src/helpers/nats/useNatsSession.ts +0 -460
- package/src/helpers/piiDetection.test.ts +0 -186
- package/src/helpers/piiDetection.ts +0 -91
- package/src/helpers/sanitizer.ts +0 -17
- package/src/helpers/statistics.ts +0 -58
- package/src/helpers/stt/useSTT.ts +0 -515
- package/src/helpers/translations.ts +0 -39
- package/src/helpers/tts/ttsVoiceUtility.ts +0 -275
- package/src/helpers/tts/useTTS.ts +0 -621
- package/src/helpers/utils.test.ts +0 -321
- package/src/helpers/utils.ts +0 -586
- package/src/helpers/venue.ts +0 -36
- package/src/i18n.ts +0 -39
- package/src/index.stories.tsx +0 -220
- package/src/index.test.tsx +0 -156
- package/src/index.tsx +0 -592
- package/src/locales/de.json +0 -680
- package/src/locales/en.json +0 -754
- package/src/locales/es.json +0 -682
- package/src/locales/fr.json +0 -682
- package/src/locales/it.json +0 -750
- package/src/mocks/data.ts +0 -790
- package/src/styles.css +0 -126
- package/src/types/integration.test.ts +0 -32
- package/src/types/integration.ts +0 -31
- package/src/types/layout.ts +0 -50
- package/src/version.ts +0 -2
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { memori, tenant, integration } from '../../mocks/data';
|
|
4
|
-
import Avatar from './Avatar';
|
|
5
|
-
import { VisemeProvider } from '../../context/visemeContext';
|
|
6
|
-
import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContext';
|
|
7
|
-
const integrationConfig = JSON.parse(integration.customData ?? '{}');
|
|
8
|
-
|
|
9
|
-
it('renders defualt Avatar (blob) unchanged', () => {
|
|
10
|
-
const { container } = render(
|
|
11
|
-
<VisemeProvider>
|
|
12
|
-
<ArtifactProvider>
|
|
13
|
-
<Avatar
|
|
14
|
-
memori={memori}
|
|
15
|
-
tenant={tenant}
|
|
16
|
-
isTotem={false}
|
|
17
|
-
setEnablePositionControls={() => {}}
|
|
18
|
-
instruct={false}
|
|
19
|
-
avatar3dVisible={true}
|
|
20
|
-
setAvatar3dVisible={() => {}}
|
|
21
|
-
hasUserActivatedSpeak={false}
|
|
22
|
-
isPlayingAudio={false}
|
|
23
|
-
/>
|
|
24
|
-
</ArtifactProvider>
|
|
25
|
-
</VisemeProvider>
|
|
26
|
-
);
|
|
27
|
-
expect(container).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('renders Avatar with blob and avatar in blob unchanged', () => {
|
|
31
|
-
const { container } = render(
|
|
32
|
-
<VisemeProvider>
|
|
33
|
-
<Avatar
|
|
34
|
-
memori={memori}
|
|
35
|
-
integrationConfig={{
|
|
36
|
-
...integrationConfig,
|
|
37
|
-
avatar: 'userAvatar',
|
|
38
|
-
avatarURL: memori.avatarURL,
|
|
39
|
-
}}
|
|
40
|
-
tenant={tenant}
|
|
41
|
-
instruct={false}
|
|
42
|
-
isTotem={false}
|
|
43
|
-
setEnablePositionControls={() => {}}
|
|
44
|
-
avatar3dVisible={true}
|
|
45
|
-
setAvatar3dVisible={() => {}}
|
|
46
|
-
hasUserActivatedSpeak={false}
|
|
47
|
-
isPlayingAudio={false}
|
|
48
|
-
/>
|
|
49
|
-
</VisemeProvider>
|
|
50
|
-
);
|
|
51
|
-
expect(container).toMatchSnapshot();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('renders Avatar with custom glb model unchanged', () => {
|
|
55
|
-
const { container } = render(
|
|
56
|
-
<VisemeProvider>
|
|
57
|
-
<Avatar
|
|
58
|
-
memori={memori}
|
|
59
|
-
integration={integration}
|
|
60
|
-
isTotem={false}
|
|
61
|
-
setEnablePositionControls={() => {}}
|
|
62
|
-
integrationConfig={{
|
|
63
|
-
...integrationConfig,
|
|
64
|
-
avatar: 'customglb',
|
|
65
|
-
avatarURL:
|
|
66
|
-
'https://assets.memori.ai/api/v2/asset/7383f05a-0788-49b0-b9b9-3bfc402c7ddf.glb#1669136149862',
|
|
67
|
-
}}
|
|
68
|
-
tenant={tenant}
|
|
69
|
-
instruct={false}
|
|
70
|
-
avatar3dVisible={true}
|
|
71
|
-
setAvatar3dVisible={() => {}}
|
|
72
|
-
hasUserActivatedSpeak={false}
|
|
73
|
-
isPlayingAudio={false}
|
|
74
|
-
/>
|
|
75
|
-
</VisemeProvider>
|
|
76
|
-
);
|
|
77
|
-
expect(container).toMatchSnapshot();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('renders Avatar with rpm 3d avatar unchanged', () => {
|
|
81
|
-
const { container } = render(
|
|
82
|
-
<VisemeProvider>
|
|
83
|
-
<Avatar
|
|
84
|
-
memori={memori}
|
|
85
|
-
integration={integration}
|
|
86
|
-
isTotem={false}
|
|
87
|
-
setEnablePositionControls={() => {}}
|
|
88
|
-
integrationConfig={{
|
|
89
|
-
...integrationConfig,
|
|
90
|
-
avatar: 'readyplayerme',
|
|
91
|
-
avatarURL:
|
|
92
|
-
'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
93
|
-
}}
|
|
94
|
-
tenant={tenant}
|
|
95
|
-
instruct={false}
|
|
96
|
-
avatar3dVisible={true}
|
|
97
|
-
setAvatar3dVisible={() => {}}
|
|
98
|
-
hasUserActivatedSpeak={false}
|
|
99
|
-
isPlayingAudio={false}
|
|
100
|
-
/>
|
|
101
|
-
</VisemeProvider>
|
|
102
|
-
);
|
|
103
|
-
expect(container).toMatchSnapshot();
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('renders Avatar with avatar-configurator like readyplayerme-full', () => {
|
|
107
|
-
const { container } = render(
|
|
108
|
-
<VisemeProvider>
|
|
109
|
-
<Avatar
|
|
110
|
-
memori={memori}
|
|
111
|
-
integration={integration}
|
|
112
|
-
isTotem={false}
|
|
113
|
-
setEnablePositionControls={() => {}}
|
|
114
|
-
integrationConfig={{
|
|
115
|
-
...integrationConfig,
|
|
116
|
-
avatar: 'avatar-configurator',
|
|
117
|
-
avatarURL:
|
|
118
|
-
'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
119
|
-
}}
|
|
120
|
-
tenant={tenant}
|
|
121
|
-
instruct={false}
|
|
122
|
-
avatar3dVisible={true}
|
|
123
|
-
setAvatar3dVisible={() => {}}
|
|
124
|
-
hasUserActivatedSpeak={false}
|
|
125
|
-
isPlayingAudio={false}
|
|
126
|
-
avatarType="avatar3d"
|
|
127
|
-
/>
|
|
128
|
-
</VisemeProvider>
|
|
129
|
-
);
|
|
130
|
-
expect(container).toMatchSnapshot();
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('renders Avatar with avatar-configurator on totem layout unchanged', () => {
|
|
134
|
-
const { container } = render(
|
|
135
|
-
<VisemeProvider>
|
|
136
|
-
<Avatar
|
|
137
|
-
memori={memori}
|
|
138
|
-
integration={integration}
|
|
139
|
-
isTotem
|
|
140
|
-
setEnablePositionControls={() => {}}
|
|
141
|
-
integrationConfig={{
|
|
142
|
-
...integrationConfig,
|
|
143
|
-
avatar: 'avatar-configurator',
|
|
144
|
-
avatarURL:
|
|
145
|
-
'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
146
|
-
}}
|
|
147
|
-
tenant={tenant}
|
|
148
|
-
instruct={false}
|
|
149
|
-
avatar3dVisible={true}
|
|
150
|
-
setAvatar3dVisible={() => {}}
|
|
151
|
-
hasUserActivatedSpeak={false}
|
|
152
|
-
isPlayingAudio={false}
|
|
153
|
-
avatarType="avatar3d"
|
|
154
|
-
/>
|
|
155
|
-
</VisemeProvider>
|
|
156
|
-
);
|
|
157
|
-
expect(container).toMatchSnapshot();
|
|
158
|
-
});
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import React, { memo, useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Integration,
|
|
4
|
-
Memori,
|
|
5
|
-
Tenant,
|
|
6
|
-
} from '@memori.ai/memori-api-client/dist/types';
|
|
7
|
-
import ErrorBoundary from '../ErrorBoundary/ErrorBoundary';
|
|
8
|
-
import Tooltip from '../ui/Tooltip';
|
|
9
|
-
import { getResourceUrl } from '../../helpers/media';
|
|
10
|
-
import Blob from '../Blob/Blob';
|
|
11
|
-
import ModelViewer from '../CustomGLBModelViewer/ModelViewer';
|
|
12
|
-
import Button from '../ui/Button';
|
|
13
|
-
import { useTranslation } from 'react-i18next';
|
|
14
|
-
import Eye from '../icons/Eye';
|
|
15
|
-
import EyeInvisible from '../icons/EyeInvisible';
|
|
16
|
-
import Edit from '../icons/Edit';
|
|
17
|
-
import cx from 'classnames';
|
|
18
|
-
import ContainerAvatarView from './AvatarView';
|
|
19
|
-
import { useViseme } from '../../context/visemeContext';
|
|
20
|
-
import { is3dAvatarWithUrl, usesRpmAvatarView } from '../../types/integration';
|
|
21
|
-
|
|
22
|
-
export interface Props {
|
|
23
|
-
memori: Memori;
|
|
24
|
-
integration?: Integration;
|
|
25
|
-
integrationConfig?: { [key: string]: any };
|
|
26
|
-
tenant?: Tenant;
|
|
27
|
-
instruct?: boolean;
|
|
28
|
-
hasUserActivatedSpeak?: boolean;
|
|
29
|
-
avatar3dVisible?: boolean;
|
|
30
|
-
setAvatar3dVisible: (visible: boolean) => void;
|
|
31
|
-
isPlayingAudio?: boolean;
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
baseUrl?: string;
|
|
34
|
-
apiUrl?: string;
|
|
35
|
-
animation?: string;
|
|
36
|
-
isZoomed?: boolean;
|
|
37
|
-
chatProps?: any;
|
|
38
|
-
enablePositionControls?: boolean;
|
|
39
|
-
setEnablePositionControls: (value: boolean) => void;
|
|
40
|
-
avatarType?: 'blob' | 'avatar3d' | null;
|
|
41
|
-
isTotem?: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const Avatar: React.FC<Props> = ({
|
|
45
|
-
memori,
|
|
46
|
-
integration,
|
|
47
|
-
integrationConfig,
|
|
48
|
-
tenant,
|
|
49
|
-
instruct = false,
|
|
50
|
-
avatar3dVisible = false,
|
|
51
|
-
setAvatar3dVisible,
|
|
52
|
-
hasUserActivatedSpeak = false,
|
|
53
|
-
isPlayingAudio = false,
|
|
54
|
-
loading = false,
|
|
55
|
-
baseUrl,
|
|
56
|
-
apiUrl,
|
|
57
|
-
animation,
|
|
58
|
-
isZoomed = false,
|
|
59
|
-
chatProps,
|
|
60
|
-
avatarType = null,
|
|
61
|
-
enablePositionControls,
|
|
62
|
-
setEnablePositionControls,
|
|
63
|
-
isTotem = false,
|
|
64
|
-
}) => {
|
|
65
|
-
const { t } = useTranslation();
|
|
66
|
-
const [isClient, setIsClient] = useState(false);
|
|
67
|
-
|
|
68
|
-
const { stopProcessing, updateCurrentViseme, resetVisemeQueue } = useViseme();
|
|
69
|
-
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
setIsClient(true);
|
|
72
|
-
}, []);
|
|
73
|
-
|
|
74
|
-
// Get the avatar URL, if the avatar is a user avatar, the avatar URL is the user avatar URL, if the avatar is a default avatar, the avatar URL is the default avatar URL
|
|
75
|
-
const getAvatarUrl = () => {
|
|
76
|
-
if (
|
|
77
|
-
integrationConfig?.avatar === 'userAvatar' &&
|
|
78
|
-
memori.avatarURL &&
|
|
79
|
-
memori.avatarURL.length > 0
|
|
80
|
-
) {
|
|
81
|
-
return getResourceUrl({
|
|
82
|
-
type: 'avatar',
|
|
83
|
-
tenantID: tenant?.name,
|
|
84
|
-
resourceURI: memori.avatarURL,
|
|
85
|
-
baseURL: baseUrl,
|
|
86
|
-
apiURL: apiUrl,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return undefined;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const renderAvatar = () => {
|
|
93
|
-
if (
|
|
94
|
-
is3dAvatarWithUrl(
|
|
95
|
-
integrationConfig?.avatar,
|
|
96
|
-
integrationConfig?.avatarURL
|
|
97
|
-
) &&
|
|
98
|
-
avatarType &&
|
|
99
|
-
avatarType !== 'blob'
|
|
100
|
-
) {
|
|
101
|
-
return (
|
|
102
|
-
<>
|
|
103
|
-
<div
|
|
104
|
-
className={cx(
|
|
105
|
-
'memori--avatar-wrapper',
|
|
106
|
-
`memori--avatar-${integrationConfig?.avatar || 'default'}`,
|
|
107
|
-
{
|
|
108
|
-
hidden: !avatar3dVisible,
|
|
109
|
-
}
|
|
110
|
-
)}
|
|
111
|
-
>
|
|
112
|
-
{renderAvatarContent()}
|
|
113
|
-
</div>
|
|
114
|
-
{renderAvatarToggle()}
|
|
115
|
-
</>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
return (
|
|
119
|
-
<div className="memori--blob-container">
|
|
120
|
-
{isClient && <Blob speaking={isPlayingAudio} avatar={getAvatarUrl()} />}
|
|
121
|
-
</div>
|
|
122
|
-
);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const renderAvatarContent = () => {
|
|
126
|
-
if (!isClient || !integrationConfig) return null;
|
|
127
|
-
if (usesRpmAvatarView(integrationConfig.avatar)) {
|
|
128
|
-
return (
|
|
129
|
-
<ErrorBoundary
|
|
130
|
-
fallback={
|
|
131
|
-
<div className="memori--blob-container">
|
|
132
|
-
{isClient && (
|
|
133
|
-
<Blob speaking={isPlayingAudio} avatar={getAvatarUrl()} />
|
|
134
|
-
)}
|
|
135
|
-
</div>
|
|
136
|
-
}
|
|
137
|
-
>
|
|
138
|
-
<ContainerAvatarView
|
|
139
|
-
enablePositionControls={enablePositionControls}
|
|
140
|
-
updateCurrentViseme={updateCurrentViseme}
|
|
141
|
-
url={integrationConfig.avatarURL}
|
|
142
|
-
sex={memori.voiceType === 'FEMALE' ? 'FEMALE' : 'MALE'}
|
|
143
|
-
fallbackImg={getAvatarUrl()}
|
|
144
|
-
headMovement
|
|
145
|
-
eyeBlink
|
|
146
|
-
animation={animation}
|
|
147
|
-
halfBody={integrationConfig.avatar === 'readyplayerme'}
|
|
148
|
-
speaking={isPlayingAudio}
|
|
149
|
-
loading={loading}
|
|
150
|
-
style={getAvatarStyle()}
|
|
151
|
-
stopProcessing={stopProcessing}
|
|
152
|
-
resetVisemeQueue={resetVisemeQueue}
|
|
153
|
-
isZoomed={isZoomed}
|
|
154
|
-
isTotem={isTotem}
|
|
155
|
-
chatEmission={chatProps?.dialogState?.emission}
|
|
156
|
-
setEnablePositionControls={setEnablePositionControls}
|
|
157
|
-
/>
|
|
158
|
-
</ErrorBoundary>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (integrationConfig.avatar === 'customglb') {
|
|
163
|
-
return (
|
|
164
|
-
<ModelViewer
|
|
165
|
-
poster={getAvatarUrl() || ''}
|
|
166
|
-
src={integrationConfig.avatarURL}
|
|
167
|
-
alt=""
|
|
168
|
-
/>
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return null;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
// Render the avatar toggle
|
|
176
|
-
const renderAvatarToggle = () => (
|
|
177
|
-
<div className="memori--avatar-toggle">
|
|
178
|
-
<Button
|
|
179
|
-
ghost
|
|
180
|
-
onClick={() => setAvatar3dVisible(!avatar3dVisible)}
|
|
181
|
-
icon={avatar3dVisible ? <EyeInvisible /> : <Eye />}
|
|
182
|
-
>
|
|
183
|
-
<span className="memori--avatar-toggle-text">
|
|
184
|
-
{avatar3dVisible ? t('hide') : t('show')}
|
|
185
|
-
</span>
|
|
186
|
-
</Button>
|
|
187
|
-
</div>
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
const getAvatarStyle = () => {
|
|
191
|
-
if (integrationConfig?.avatar === 'readyplayerme') {
|
|
192
|
-
return {
|
|
193
|
-
width: '100%',
|
|
194
|
-
height: '100%',
|
|
195
|
-
backgroundColor: 'none',
|
|
196
|
-
// borderRadius: '100%',
|
|
197
|
-
boxShadow: 'none',
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
return {
|
|
201
|
-
width: '100%',
|
|
202
|
-
height: '100%',
|
|
203
|
-
backgroundColor: 'none',
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const renderIntegrationsLink = () => {
|
|
208
|
-
if (!(instruct && !hasUserActivatedSpeak && memori.isGiver && tenant?.name))
|
|
209
|
-
return null;
|
|
210
|
-
|
|
211
|
-
const href = `https://${tenant.name}/${
|
|
212
|
-
memori.culture === 'it-IT' ? 'it' : 'en'
|
|
213
|
-
}/${memori.ownerUserName}/${memori.name}/integrations${
|
|
214
|
-
integration?.integrationID
|
|
215
|
-
? `?integration=${integration.integrationID}&openAvatarModal=true`
|
|
216
|
-
: ''
|
|
217
|
-
}`;
|
|
218
|
-
|
|
219
|
-
return (
|
|
220
|
-
<div className="memori--avatar-link-to-integrations">
|
|
221
|
-
<a
|
|
222
|
-
className="memori-button memori-button--circle memori-button--outlined"
|
|
223
|
-
href={href}
|
|
224
|
-
>
|
|
225
|
-
<Tooltip content={t('widgetgoToIntegrationsToCustomizeAvatar')}>
|
|
226
|
-
<span className="memori-button--icon">
|
|
227
|
-
<Edit />
|
|
228
|
-
</span>
|
|
229
|
-
</Tooltip>
|
|
230
|
-
</a>
|
|
231
|
-
</div>
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
return (
|
|
236
|
-
<>
|
|
237
|
-
{renderAvatar()}
|
|
238
|
-
{renderIntegrationsLink()}
|
|
239
|
-
</>
|
|
240
|
-
);
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export default memo(Avatar, (prevProps, nextProps) => {
|
|
244
|
-
return JSON.stringify(prevProps) === JSON.stringify(nextProps);
|
|
245
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Canvas } from '@react-three/fiber';
|
|
3
|
-
import { ContactShadows, PerspectiveCamera } from '@react-three/drei';
|
|
4
|
-
import { AvatarAnimator } from '../components/controllers/AvatarAnimator';
|
|
5
|
-
|
|
6
|
-
const DynamicShadow = ({
|
|
7
|
-
animator,
|
|
8
|
-
avatarPosition,
|
|
9
|
-
}: {
|
|
10
|
-
animator: AvatarAnimator | null;
|
|
11
|
-
avatarPosition: any;
|
|
12
|
-
}) => {
|
|
13
|
-
// Calculate shadow properties based on animation
|
|
14
|
-
const getShadowProps = () => {
|
|
15
|
-
const baseProps = {
|
|
16
|
-
width: 10,
|
|
17
|
-
height: 10,
|
|
18
|
-
blur: 2.5,
|
|
19
|
-
scale: 10,
|
|
20
|
-
far: 5,
|
|
21
|
-
resolution: 1024,
|
|
22
|
-
color: '#000000',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
if (!animator) {
|
|
26
|
-
return {
|
|
27
|
-
...baseProps,
|
|
28
|
-
opacity: 0,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
// Adjust shadow based on animation type
|
|
32
|
-
if (animator.getCurrentAnimationName()?.startsWith('Loading')) {
|
|
33
|
-
return {
|
|
34
|
-
...baseProps,
|
|
35
|
-
opacity: 0.85,
|
|
36
|
-
blur: 3,
|
|
37
|
-
width: 12,
|
|
38
|
-
height: 12,
|
|
39
|
-
};
|
|
40
|
-
} else if (
|
|
41
|
-
animator.getCurrentAnimationName()?.includes('Gioia') ||
|
|
42
|
-
animator.getCurrentAnimationName()?.includes('Joy')
|
|
43
|
-
) {
|
|
44
|
-
return {
|
|
45
|
-
...baseProps,
|
|
46
|
-
opacity: 0.9,
|
|
47
|
-
blur: 2,
|
|
48
|
-
width: 11,
|
|
49
|
-
height: 11,
|
|
50
|
-
};
|
|
51
|
-
} else if (
|
|
52
|
-
animator.getCurrentAnimationName()?.includes('Rabbia') ||
|
|
53
|
-
animator.getCurrentAnimationName()?.includes('Anger')
|
|
54
|
-
) {
|
|
55
|
-
return {
|
|
56
|
-
...baseProps,
|
|
57
|
-
opacity: 0.95,
|
|
58
|
-
blur: 1.8,
|
|
59
|
-
width: 12,
|
|
60
|
-
height: 12,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Default idle state
|
|
65
|
-
return {
|
|
66
|
-
...baseProps,
|
|
67
|
-
opacity: 0.9,
|
|
68
|
-
blur: 2.2,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const shadowProps = getShadowProps();
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<>
|
|
76
|
-
{/* Main body shadow */}
|
|
77
|
-
<ContactShadows
|
|
78
|
-
opacity={shadowProps.opacity}
|
|
79
|
-
scale={shadowProps.scale}
|
|
80
|
-
blur={shadowProps.blur}
|
|
81
|
-
far={shadowProps.far}
|
|
82
|
-
resolution={shadowProps.resolution}
|
|
83
|
-
color={shadowProps.color}
|
|
84
|
-
frames={Infinity}
|
|
85
|
-
position={[0, avatarPosition.y, 0]}
|
|
86
|
-
/>
|
|
87
|
-
|
|
88
|
-
{/* Foot shadow - smaller and sharper */}
|
|
89
|
-
<ContactShadows
|
|
90
|
-
opacity={1}
|
|
91
|
-
width={5}
|
|
92
|
-
height={5}
|
|
93
|
-
blur={1}
|
|
94
|
-
far={2}
|
|
95
|
-
resolution={1024}
|
|
96
|
-
color="#000000"
|
|
97
|
-
position={[0, -0.98, 0]}
|
|
98
|
-
/>
|
|
99
|
-
</>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default DynamicShadow;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect, useCallback, memo } from 'react';
|
|
2
|
-
import { AvatarAnimator } from './components/controllers/AvatarAnimator';
|
|
3
|
-
import { FullbodyAvatar } from './components/FullbodyAvatar/fullbodyAvatar';
|
|
4
|
-
import HalfBodyAvatar from './components/halfbodyAvatar';
|
|
5
|
-
|
|
6
|
-
interface AvatarViewProps {
|
|
7
|
-
chatEmission: string | null | undefined;
|
|
8
|
-
url: string;
|
|
9
|
-
sex: 'MALE' | 'FEMALE';
|
|
10
|
-
eyeBlink: boolean;
|
|
11
|
-
halfBody: boolean;
|
|
12
|
-
loading: boolean;
|
|
13
|
-
avatarHeight: number;
|
|
14
|
-
avatarDepth: number;
|
|
15
|
-
updateCurrentViseme: (
|
|
16
|
-
currentTime: number
|
|
17
|
-
) => { name: string; weight: number } | null;
|
|
18
|
-
setCameraZ: (cameraZ: number) => void;
|
|
19
|
-
headMovement: boolean;
|
|
20
|
-
speaking: boolean;
|
|
21
|
-
showControls: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Memoized FullbodyAvatar component to prevent unnecessary re-renders
|
|
25
|
-
const MemoizedFullbodyAvatar = memo(FullbodyAvatar);
|
|
26
|
-
|
|
27
|
-
// Memoized HalfBodyAvatar component to prevent unnecessary re-renders
|
|
28
|
-
const MemoizedHalfBodyAvatar = memo(HalfBodyAvatar);
|
|
29
|
-
|
|
30
|
-
export const AvatarView = ({
|
|
31
|
-
chatEmission,
|
|
32
|
-
url,
|
|
33
|
-
sex,
|
|
34
|
-
eyeBlink,
|
|
35
|
-
halfBody,
|
|
36
|
-
loading,
|
|
37
|
-
avatarHeight = 50,
|
|
38
|
-
avatarDepth = -50,
|
|
39
|
-
updateCurrentViseme,
|
|
40
|
-
setCameraZ,
|
|
41
|
-
headMovement,
|
|
42
|
-
// speaking,
|
|
43
|
-
showControls,
|
|
44
|
-
}: AvatarViewProps) => {
|
|
45
|
-
// Reference to the AvatarAnimator instance for animation control
|
|
46
|
-
const animatorRef = useRef<AvatarAnimator | null>(null);
|
|
47
|
-
|
|
48
|
-
// Memoize the setAnimatorRef callback to ensure it doesn't change on re-renders
|
|
49
|
-
const setAnimatorRef = useCallback((animator: AvatarAnimator | null) => {
|
|
50
|
-
if (animator !== animatorRef.current) {
|
|
51
|
-
animatorRef.current = animator;
|
|
52
|
-
}
|
|
53
|
-
}, []); // Empty dependency array ensures this function never changes
|
|
54
|
-
|
|
55
|
-
// React to changes in chat emission or loading state
|
|
56
|
-
// This effect doesn't re-create the animator, it just uses it
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (!animatorRef.current) return;
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
// Prevents any extra work if loading/emission hasn't changed
|
|
62
|
-
animatorRef.current.processChatEmission(chatEmission, loading);
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.error('Error processing chat emission:', error);
|
|
65
|
-
}
|
|
66
|
-
}, [loading, chatEmission]); // Both dependencies are needed
|
|
67
|
-
|
|
68
|
-
// Memoize common props to prevent unnecessary object creation on re-renders
|
|
69
|
-
const commonAvatarProps = useCallback(() => ({
|
|
70
|
-
url,
|
|
71
|
-
onCameraZChange: setCameraZ,
|
|
72
|
-
updateCurrentViseme,
|
|
73
|
-
avatarHeight,
|
|
74
|
-
avatarDepth,
|
|
75
|
-
setAnimatorRef, // This is now stable across renders
|
|
76
|
-
}), [url, setCameraZ, updateCurrentViseme, avatarHeight, avatarDepth, setAnimatorRef]);
|
|
77
|
-
|
|
78
|
-
// Render avatar based on halfBody flag
|
|
79
|
-
return (
|
|
80
|
-
<>
|
|
81
|
-
{halfBody ? (
|
|
82
|
-
<MemoizedHalfBodyAvatar
|
|
83
|
-
{...commonAvatarProps()}
|
|
84
|
-
eyeBlink={eyeBlink}
|
|
85
|
-
headMovement={headMovement}
|
|
86
|
-
/>
|
|
87
|
-
) : (
|
|
88
|
-
<MemoizedFullbodyAvatar
|
|
89
|
-
{...commonAvatarProps()}
|
|
90
|
-
sex={sex}
|
|
91
|
-
eyeBlink={eyeBlink}
|
|
92
|
-
chatEmission={chatEmission}
|
|
93
|
-
loading={loading}
|
|
94
|
-
/>
|
|
95
|
-
)}
|
|
96
|
-
{showControls && animatorRef.current && (
|
|
97
|
-
<div className="animation-controls">
|
|
98
|
-
{/* Optional animation control UI could be added here */}
|
|
99
|
-
</div>
|
|
100
|
-
)}
|
|
101
|
-
</>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export default memo(AvatarView); // Memoize the entire component
|