@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,83 +0,0 @@
|
|
|
1
|
-
import { Vector3, MathUtils } from 'three';
|
|
2
|
-
import { AVATAR_POSITION, AVATAR_POSITION_ZOOMED } from '../../constants';
|
|
3
|
-
|
|
4
|
-
export class AvatarPositionController {
|
|
5
|
-
private currentScale: Vector3;
|
|
6
|
-
private targetScale: Vector3;
|
|
7
|
-
private currentPosition: Vector3;
|
|
8
|
-
private basePosition: Vector3;
|
|
9
|
-
private defaultPosition: Vector3;
|
|
10
|
-
private zoomedPosition: Vector3;
|
|
11
|
-
private initialCameraPosition: Vector3;
|
|
12
|
-
|
|
13
|
-
constructor(
|
|
14
|
-
defaultPosition: Vector3 = AVATAR_POSITION.clone(),
|
|
15
|
-
zoomedPosition: Vector3 = AVATAR_POSITION_ZOOMED.clone(),
|
|
16
|
-
initialCameraZ: number = 0.6
|
|
17
|
-
) {
|
|
18
|
-
this.defaultPosition = defaultPosition;
|
|
19
|
-
this.zoomedPosition = zoomedPosition;
|
|
20
|
-
this.currentScale = new Vector3(1, 1, 1);
|
|
21
|
-
this.targetScale = new Vector3(1, 1, 1);
|
|
22
|
-
this.currentPosition = defaultPosition.clone();
|
|
23
|
-
this.basePosition = defaultPosition.clone();
|
|
24
|
-
this.initialCameraPosition = new Vector3(0, 0, initialCameraZ);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Map height slider value (0 to 100) to scale (0.8 to 1.2)
|
|
28
|
-
private mapHeightToScale(sliderValue: number, isHalfBody: boolean): number {
|
|
29
|
-
// Convert slider value to scale factor
|
|
30
|
-
if (isHalfBody) {
|
|
31
|
-
return MathUtils.lerp(1.4, 2.1, sliderValue / 100);
|
|
32
|
-
} else {
|
|
33
|
-
return MathUtils.lerp(0.5, 1.5, sliderValue / 100);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Map depth slider value (0 to 100) to camera Z position
|
|
38
|
-
private mapDepthToCamera(depthValue: number, isHalfBody: boolean): number {
|
|
39
|
-
const baseZ = this.initialCameraPosition.z;
|
|
40
|
-
if (isHalfBody) {
|
|
41
|
-
return MathUtils.lerp(baseZ, baseZ + 3, depthValue / 100);
|
|
42
|
-
} else {
|
|
43
|
-
return MathUtils.lerp(baseZ, baseZ + 3, depthValue / 100);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Update height from GUI control (0-100)
|
|
48
|
-
updateHeight(heightValue: number, isHalfBody: boolean): void {
|
|
49
|
-
const heightScale = this.mapHeightToScale(heightValue, isHalfBody);
|
|
50
|
-
this.targetScale.set(heightScale, heightScale, heightScale);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Update depth and return new camera Z position
|
|
54
|
-
updateDepth(depthValue: number, isHalfBody: boolean): number {
|
|
55
|
-
return this.mapDepthToCamera(depthValue, isHalfBody);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Update base position for zooming
|
|
59
|
-
updateBasePosition(isZoomed: boolean): void {
|
|
60
|
-
const newPosition = isZoomed ? this.zoomedPosition : this.defaultPosition;
|
|
61
|
-
this.basePosition.copy(newPosition);
|
|
62
|
-
this.currentPosition.copy(newPosition);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Smoothly interpolate current scale to target scale
|
|
66
|
-
updateScale(lerpFactor: number): Vector3 {
|
|
67
|
-
this.currentScale.lerp(this.targetScale, lerpFactor);
|
|
68
|
-
return this.currentScale;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Get current position
|
|
72
|
-
getPosition(): Vector3 {
|
|
73
|
-
return this.currentPosition;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Reset to default values
|
|
77
|
-
reset(): void {
|
|
78
|
-
this.currentScale.set(1, 1, 1);
|
|
79
|
-
this.targetScale.set(1, 1, 1);
|
|
80
|
-
this.currentPosition.copy(this.defaultPosition);
|
|
81
|
-
this.basePosition.copy(this.defaultPosition);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import { SkinnedMesh } from 'three';
|
|
2
|
-
import { MathUtils } from 'three';
|
|
3
|
-
import {
|
|
4
|
-
EMOTION_SMOOTHING,
|
|
5
|
-
EMOTION_INTENSITY,
|
|
6
|
-
VISEME_SMOOTHING,
|
|
7
|
-
BLINK_CONFIG,
|
|
8
|
-
MAPPING_EMOTIONS_ITALIAN_TO_ENGLISH,
|
|
9
|
-
MAPPING_BLEND_SHAPE_TO_EMOTION_RPM,
|
|
10
|
-
EmotionMapping,
|
|
11
|
-
BlendShapeMap,
|
|
12
|
-
} from '../../constants';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Controller class for handling morph target animations including emotions, visemes and blinking
|
|
16
|
-
*/
|
|
17
|
-
export class MorphTargetController {
|
|
18
|
-
private headMesh: SkinnedMesh;
|
|
19
|
-
private currentEmotionValues: Record<string, number> = {};
|
|
20
|
-
private previousEmotionKeys: Set<string> = new Set();
|
|
21
|
-
private isRPM: boolean = false;
|
|
22
|
-
|
|
23
|
-
// Default RPM blend shape mappings
|
|
24
|
-
private rpmBlendShapes: BlendShapeMap =
|
|
25
|
-
MAPPING_BLEND_SHAPE_TO_EMOTION_RPM as BlendShapeMap;
|
|
26
|
-
|
|
27
|
-
// Default custom GLB emotion mappings
|
|
28
|
-
private customGlbMapping: EmotionMapping =
|
|
29
|
-
MAPPING_EMOTIONS_ITALIAN_TO_ENGLISH as EmotionMapping;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Constructor for MorphTargetController
|
|
33
|
-
* @param headMesh SkinnedMesh representing the head
|
|
34
|
-
* @param rpmBlendShapes Optional custom RPM blend shapes
|
|
35
|
-
* @param customGlbMapping Optional custom GLB emotion mapping
|
|
36
|
-
*/
|
|
37
|
-
constructor(
|
|
38
|
-
headMesh: SkinnedMesh,
|
|
39
|
-
rpmBlendShapes?: BlendShapeMap,
|
|
40
|
-
customGlbMapping?: EmotionMapping
|
|
41
|
-
) {
|
|
42
|
-
this.headMesh = headMesh;
|
|
43
|
-
|
|
44
|
-
// Detect if this is an RPM avatar based on mesh name
|
|
45
|
-
this.isRPM = headMesh.name !== 'GBNL__Head';
|
|
46
|
-
|
|
47
|
-
// Override default maps if provided
|
|
48
|
-
if (rpmBlendShapes) {
|
|
49
|
-
this.rpmBlendShapes = rpmBlendShapes;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (customGlbMapping) {
|
|
53
|
-
this.customGlbMapping = customGlbMapping;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Process chat emission to extract emotion data
|
|
59
|
-
* @param chatEmission Chat emission text
|
|
60
|
-
* @param isLoading Loading state
|
|
61
|
-
* @returns Object with emotion morph targets
|
|
62
|
-
*/
|
|
63
|
-
processChatEmission(
|
|
64
|
-
chatEmission: any,
|
|
65
|
-
isLoading: boolean
|
|
66
|
-
): Record<string, number> {
|
|
67
|
-
// Default empty emotion targets
|
|
68
|
-
const defaultEmotions = this.getDefaultEmotionMorphTargets();
|
|
69
|
-
|
|
70
|
-
// If loading or no chat emission, return default emotions
|
|
71
|
-
if (isLoading || !chatEmission) {
|
|
72
|
-
return defaultEmotions;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Check if chat emission contains emotion tag
|
|
76
|
-
const hasOutputTagEmotion = chatEmission?.includes(
|
|
77
|
-
'<output class="memori-emotion">'
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
if (!hasOutputTagEmotion) {
|
|
81
|
-
return defaultEmotions;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Extract emotion name
|
|
85
|
-
const outputContentEmotion = chatEmission
|
|
86
|
-
?.split('<output class="memori-emotion">')[1]
|
|
87
|
-
?.split('</output>')[0]
|
|
88
|
-
?.trim();
|
|
89
|
-
|
|
90
|
-
if (!outputContentEmotion) {
|
|
91
|
-
return defaultEmotions;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Process emotion based on avatar type
|
|
95
|
-
return this.processEmotion(outputContentEmotion);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Process an emotion name into morph target values
|
|
100
|
-
* @param emotionName Emotion name (in Italian or English)
|
|
101
|
-
* @returns Object with morph target values
|
|
102
|
-
*/
|
|
103
|
-
private processEmotion(emotionName: string): Record<string, number> {
|
|
104
|
-
// Get default empty emotion targets
|
|
105
|
-
const defaultEmotions = this.getDefaultEmotionMorphTargets();
|
|
106
|
-
|
|
107
|
-
// First, try to find the emotion regardless of language
|
|
108
|
-
if (this.isRPM) {
|
|
109
|
-
// For RPM avatars, find the matching emotion in the rpmBlendShapes array
|
|
110
|
-
const foundEmotion = this.rpmBlendShapes.find(
|
|
111
|
-
item =>
|
|
112
|
-
item.emotion.italian.toLowerCase() === emotionName.toLowerCase() ||
|
|
113
|
-
item.emotion.english.toLowerCase() === emotionName.toLowerCase()
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
if (foundEmotion) {
|
|
117
|
-
return { ...defaultEmotions, ...foundEmotion.blendShapes };
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
// For custom GLB, find the matching emotion in the customGlbMapping array
|
|
121
|
-
const foundEmotion = this.customGlbMapping.find(
|
|
122
|
-
item =>
|
|
123
|
-
item.italian.toLowerCase() === emotionName.toLowerCase() ||
|
|
124
|
-
item.english.toLowerCase() === emotionName.toLowerCase()
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
if (foundEmotion) {
|
|
128
|
-
return { ...defaultEmotions, [foundEmotion.english]: 1 };
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return defaultEmotions;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Get default emotion morph targets (all set to 0)
|
|
137
|
-
*/
|
|
138
|
-
private getDefaultEmotionMorphTargets(): Record<string, number> {
|
|
139
|
-
// For RPM, collect all blend shape keys
|
|
140
|
-
if (this.isRPM) {
|
|
141
|
-
const allBlendShapeKeys = new Set<string>();
|
|
142
|
-
|
|
143
|
-
this.rpmBlendShapes.forEach(item => {
|
|
144
|
-
Object.keys(item.blendShapes).forEach(key =>
|
|
145
|
-
allBlendShapeKeys.add(key)
|
|
146
|
-
);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
return Array.from(allBlendShapeKeys).reduce(
|
|
150
|
-
(acc, key) => ({ ...acc, [key]: 0 }),
|
|
151
|
-
{}
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
// For custom GLB, use English emotion names
|
|
155
|
-
else {
|
|
156
|
-
return this.customGlbMapping.reduce(
|
|
157
|
-
(acc, emotion) => ({ ...acc, [emotion.english]: 0 }),
|
|
158
|
-
{}
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Updates the morph target influences for emotions, visemes and blinking
|
|
164
|
-
*/
|
|
165
|
-
updateMorphTargets(
|
|
166
|
-
currentTime: number,
|
|
167
|
-
chatEmission: any,
|
|
168
|
-
isLoading: boolean,
|
|
169
|
-
currentViseme: { name: string; weight: number } | null,
|
|
170
|
-
eyeBlink: boolean,
|
|
171
|
-
blinkState: {
|
|
172
|
-
isBlinking: boolean;
|
|
173
|
-
lastBlinkTime: number;
|
|
174
|
-
nextBlinkTime: number;
|
|
175
|
-
blinkStartTime: number;
|
|
176
|
-
}
|
|
177
|
-
) {
|
|
178
|
-
// Validate required mesh properties exist
|
|
179
|
-
if (
|
|
180
|
-
!this.headMesh.morphTargetDictionary ||
|
|
181
|
-
!this.headMesh.morphTargetInfluences
|
|
182
|
-
) {
|
|
183
|
-
console.error(
|
|
184
|
-
'[MorphTargetController] Missing morphTargetDictionary or morphTargetInfluences'
|
|
185
|
-
);
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Process chat emission to get emotion morph targets
|
|
190
|
-
const emotionMorphTargets = this.processChatEmission(
|
|
191
|
-
chatEmission,
|
|
192
|
-
isLoading
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
// Calculate blink value for this frame
|
|
196
|
-
const blinkValue = this.calculateBlinkValue(
|
|
197
|
-
currentTime,
|
|
198
|
-
blinkState,
|
|
199
|
-
eyeBlink
|
|
200
|
-
);
|
|
201
|
-
|
|
202
|
-
const currentEmotionKeys = new Set(Object.keys(emotionMorphTargets));
|
|
203
|
-
|
|
204
|
-
// Process each morph target
|
|
205
|
-
Object.entries(this.headMesh.morphTargetDictionary).forEach(
|
|
206
|
-
([key, index]) => {
|
|
207
|
-
if (typeof index !== 'number') return;
|
|
208
|
-
|
|
209
|
-
let targetValue = 0;
|
|
210
|
-
|
|
211
|
-
// Handle emotion morphs with smoothing
|
|
212
|
-
if (currentEmotionKeys.has(key)) {
|
|
213
|
-
// console.log('[MorphTargetController] Processing morph target:', key);
|
|
214
|
-
const targetEmotionValue = emotionMorphTargets[key];
|
|
215
|
-
const currentEmotionValue = this.currentEmotionValues[key] || 0;
|
|
216
|
-
const newEmotionValue = MathUtils.lerp(
|
|
217
|
-
currentEmotionValue,
|
|
218
|
-
targetEmotionValue * EMOTION_INTENSITY,
|
|
219
|
-
EMOTION_SMOOTHING
|
|
220
|
-
);
|
|
221
|
-
this.currentEmotionValues[key] = newEmotionValue;
|
|
222
|
-
targetValue += newEmotionValue;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Add viseme influence if active
|
|
226
|
-
if (currentViseme && key === currentViseme.name) {
|
|
227
|
-
targetValue += currentViseme.weight;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Add blink influence if active
|
|
231
|
-
if (key === 'eyesClosed' && eyeBlink) {
|
|
232
|
-
targetValue += blinkValue;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Clamp and smooth final value
|
|
236
|
-
targetValue = MathUtils.clamp(targetValue, 0, 1);
|
|
237
|
-
if (this.headMesh.morphTargetInfluences) {
|
|
238
|
-
const finalValue = MathUtils.lerp(
|
|
239
|
-
this.headMesh.morphTargetInfluences[index] || 0,
|
|
240
|
-
targetValue,
|
|
241
|
-
VISEME_SMOOTHING
|
|
242
|
-
);
|
|
243
|
-
this.headMesh.morphTargetInfluences[index] = finalValue;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
this.previousEmotionKeys = currentEmotionKeys;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Calculates the blink value based on timing and state
|
|
253
|
-
*/
|
|
254
|
-
private calculateBlinkValue(
|
|
255
|
-
currentTime: number,
|
|
256
|
-
blinkState: {
|
|
257
|
-
isBlinking: boolean;
|
|
258
|
-
lastBlinkTime: number;
|
|
259
|
-
nextBlinkTime: number;
|
|
260
|
-
blinkStartTime: number;
|
|
261
|
-
},
|
|
262
|
-
eyeBlink: boolean
|
|
263
|
-
): number {
|
|
264
|
-
if (!eyeBlink) return 0;
|
|
265
|
-
|
|
266
|
-
let blinkValue = 0;
|
|
267
|
-
|
|
268
|
-
// Start new blink if it's time
|
|
269
|
-
if (currentTime >= blinkState.nextBlinkTime && !blinkState.isBlinking) {
|
|
270
|
-
blinkState.isBlinking = true;
|
|
271
|
-
blinkState.blinkStartTime = currentTime;
|
|
272
|
-
blinkState.lastBlinkTime = currentTime;
|
|
273
|
-
blinkState.nextBlinkTime =
|
|
274
|
-
currentTime +
|
|
275
|
-
Math.random() * (BLINK_CONFIG.maxInterval - BLINK_CONFIG.minInterval) +
|
|
276
|
-
BLINK_CONFIG.minInterval;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// Calculate blink animation progress
|
|
280
|
-
if (blinkState.isBlinking) {
|
|
281
|
-
const blinkProgress =
|
|
282
|
-
(currentTime - blinkState.blinkStartTime) / BLINK_CONFIG.blinkDuration;
|
|
283
|
-
|
|
284
|
-
// First half of blink - closing eyes
|
|
285
|
-
if (blinkProgress <= 0.5) {
|
|
286
|
-
blinkValue = blinkProgress * 2;
|
|
287
|
-
}
|
|
288
|
-
// Second half of blink - opening eyes
|
|
289
|
-
else if (blinkProgress <= 1) {
|
|
290
|
-
blinkValue = 2 - blinkProgress * 2;
|
|
291
|
-
}
|
|
292
|
-
// Blink complete
|
|
293
|
-
else {
|
|
294
|
-
blinkState.isBlinking = false;
|
|
295
|
-
blinkValue = 0;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
return blinkValue;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import GUI from 'lil-gui';
|
|
3
|
-
|
|
4
|
-
interface BaseAction {
|
|
5
|
-
weight: number;
|
|
6
|
-
action?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface AdditiveAction {
|
|
10
|
-
weight: number;
|
|
11
|
-
action?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface AnimationControlPanelProps {
|
|
15
|
-
baseActions: Record<string, BaseAction>;
|
|
16
|
-
onBaseActionChange: (action: string, outputContent: string) => void;
|
|
17
|
-
currentBaseAction: {
|
|
18
|
-
action: string;
|
|
19
|
-
weight: number;
|
|
20
|
-
};
|
|
21
|
-
onMorphTargetInfluencesChange: (influences: { [key: string]: number }) => void;
|
|
22
|
-
onMorphTargetDictionaryChange: (dictionary: { [key: string]: number }) => void;
|
|
23
|
-
morphTargetDictionary: { [key: string]: number };
|
|
24
|
-
modifyTimeScale: (value: number) => void;
|
|
25
|
-
timeScale: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const AnimationControlPanel: React.FC<AnimationControlPanelProps> = ({
|
|
29
|
-
onBaseActionChange,
|
|
30
|
-
baseActions,
|
|
31
|
-
modifyTimeScale,
|
|
32
|
-
onMorphTargetInfluencesChange,
|
|
33
|
-
onMorphTargetDictionaryChange,
|
|
34
|
-
morphTargetDictionary,
|
|
35
|
-
timeScale,
|
|
36
|
-
}) => {
|
|
37
|
-
const guiRef = useRef<GUI | null>(null);
|
|
38
|
-
const panelSettingsRef = useRef<Record<string, any>>({
|
|
39
|
-
'modify time scale': timeScale,
|
|
40
|
-
});
|
|
41
|
-
const crossFadeControlsRef = useRef<any[]>([]);
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
|
|
45
|
-
const gui = new GUI({ width: 310 });
|
|
46
|
-
guiRef.current = gui;
|
|
47
|
-
|
|
48
|
-
const folder1 = gui.addFolder('Base Actions');
|
|
49
|
-
const folder2 = gui.addFolder('Additive Action Weights');
|
|
50
|
-
const folder3 = gui.addFolder('General Speed');
|
|
51
|
-
|
|
52
|
-
const baseNames = ['None', ...Object.keys(baseActions)];
|
|
53
|
-
|
|
54
|
-
baseNames.forEach(name => {
|
|
55
|
-
const settings = baseActions[name];
|
|
56
|
-
panelSettingsRef.current[name] = () => {
|
|
57
|
-
onBaseActionChange(name, '');
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const control = folder1.add(panelSettingsRef.current, name);
|
|
61
|
-
crossFadeControlsRef.current.push(control);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
Object.entries(morphTargetDictionary).forEach(([name, settings]) => {
|
|
65
|
-
panelSettingsRef.current[name] = settings/100;
|
|
66
|
-
folder2
|
|
67
|
-
.add(panelSettingsRef.current, name, -1.0, 1.0, 0.01)
|
|
68
|
-
.listen()
|
|
69
|
-
.onChange((weight: number) => {
|
|
70
|
-
onMorphTargetInfluencesChange({ [name]: weight });
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
folder3
|
|
75
|
-
.add(panelSettingsRef.current, 'modify time scale', 0.0, 1.5, 0.01)
|
|
76
|
-
.onChange((value: number) => {
|
|
77
|
-
modifyTimeScale(value);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
folder1.open();
|
|
81
|
-
folder2.open();
|
|
82
|
-
folder3.open();
|
|
83
|
-
|
|
84
|
-
return () => {
|
|
85
|
-
gui.destroy();
|
|
86
|
-
};
|
|
87
|
-
}, [
|
|
88
|
-
onBaseActionChange,
|
|
89
|
-
onMorphTargetInfluencesChange,
|
|
90
|
-
onMorphTargetDictionaryChange,
|
|
91
|
-
modifyTimeScale,
|
|
92
|
-
baseActions,
|
|
93
|
-
morphTargetDictionary,
|
|
94
|
-
timeScale
|
|
95
|
-
]);
|
|
96
|
-
|
|
97
|
-
return null; // This component doesn't render anything itself
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export default AnimationControlPanel;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
2
|
-
import { Object3D, SkinnedMesh } from 'three';
|
|
3
|
-
import { useGLTF } from '@react-three/drei';
|
|
4
|
-
import { useGraph, useFrame, useThree } from '@react-three/fiber';
|
|
5
|
-
import { correctMaterials, isSkinnedMesh } from '../../../../../helpers/utils';
|
|
6
|
-
import { MorphTargetController } from './controllers/MorphTargetController';
|
|
7
|
-
import { AvatarPositionController } from './controllers/AvatarPositionController';
|
|
8
|
-
import {
|
|
9
|
-
AVATAR_POSITION,
|
|
10
|
-
SCALE_LERP_FACTOR,
|
|
11
|
-
AVATAR_POSITION_ZOOMED,
|
|
12
|
-
} from '../constants';
|
|
13
|
-
import { hideHands } from '../../utils/utils';
|
|
14
|
-
import useHeadMovement from '../../utils/useHeadMovement';
|
|
15
|
-
|
|
16
|
-
interface HalfBodyAvatarProps {
|
|
17
|
-
url: string;
|
|
18
|
-
updateCurrentViseme: (currentTime: number) => any;
|
|
19
|
-
eyeBlink?: boolean;
|
|
20
|
-
avatarHeight: number;
|
|
21
|
-
avatarDepth: number;
|
|
22
|
-
onLoaded?: () => void;
|
|
23
|
-
onCameraZChange: (value: number) => void;
|
|
24
|
-
headMovement?: boolean;
|
|
25
|
-
chatEmission?: any;
|
|
26
|
-
loading?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default function HalfBodyAvatar({
|
|
30
|
-
url,
|
|
31
|
-
updateCurrentViseme,
|
|
32
|
-
eyeBlink = false,
|
|
33
|
-
avatarHeight = 50,
|
|
34
|
-
avatarDepth = 0,
|
|
35
|
-
headMovement = false,
|
|
36
|
-
onLoaded,
|
|
37
|
-
onCameraZChange,
|
|
38
|
-
chatEmission,
|
|
39
|
-
loading = false,
|
|
40
|
-
}: HalfBodyAvatarProps) {
|
|
41
|
-
const { scene } = useGLTF(url);
|
|
42
|
-
const { nodes, materials } = useGraph(scene);
|
|
43
|
-
const { camera } = useThree();
|
|
44
|
-
|
|
45
|
-
const morphTargetControllerRef = useRef<MorphTargetController | null>(null);
|
|
46
|
-
const positionControllerRef = useRef<AvatarPositionController | null>(null);
|
|
47
|
-
const targetCameraZRef = useRef(camera.position.z);
|
|
48
|
-
|
|
49
|
-
// Apply head movement if enabled
|
|
50
|
-
useHeadMovement(headMovement, nodes);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// Eye blinking state
|
|
54
|
-
const blinkStateRef = useRef({
|
|
55
|
-
isBlinking: false,
|
|
56
|
-
lastBlinkTime: 0,
|
|
57
|
-
nextBlinkTime: 0,
|
|
58
|
-
blinkStartTime: 0,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// Find head mesh
|
|
62
|
-
const headMesh = useMemo(() => {
|
|
63
|
-
let foundMesh: SkinnedMesh | undefined;
|
|
64
|
-
scene?.traverse((object: Object3D) => {
|
|
65
|
-
if (
|
|
66
|
-
object instanceof SkinnedMesh &&
|
|
67
|
-
(object.name === 'GBNL__Head' || object.name === 'Wolf3D_Avatar' || object.name === 'Wolf3D_Avatar006_1')
|
|
68
|
-
) {
|
|
69
|
-
foundMesh = object;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
return foundMesh;
|
|
73
|
-
}, [scene]);
|
|
74
|
-
|
|
75
|
-
// Initialize controllers
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
if (!positionControllerRef.current) {
|
|
78
|
-
positionControllerRef.current = new AvatarPositionController(
|
|
79
|
-
AVATAR_POSITION,
|
|
80
|
-
AVATAR_POSITION_ZOOMED,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Initialize MorphTargetController if head mesh exists
|
|
85
|
-
if (headMesh) {
|
|
86
|
-
morphTargetControllerRef.current = new MorphTargetController(headMesh);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Correct materials and perform other initialization tasks
|
|
90
|
-
correctMaterials(materials);
|
|
91
|
-
onLoaded?.();
|
|
92
|
-
hideHands(nodes);
|
|
93
|
-
|
|
94
|
-
// Cleanup on unmount
|
|
95
|
-
return () => {
|
|
96
|
-
Object.values(materials).forEach(material => material.dispose());
|
|
97
|
-
Object.values(nodes)
|
|
98
|
-
.filter(isSkinnedMesh)
|
|
99
|
-
.forEach(mesh => mesh.geometry.dispose());
|
|
100
|
-
};
|
|
101
|
-
}, [materials, nodes, url, onLoaded, scene, headMesh]);
|
|
102
|
-
|
|
103
|
-
// Handle avatar height changes
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
if (positionControllerRef.current) {
|
|
106
|
-
positionControllerRef.current.updateHeight(avatarHeight, true);
|
|
107
|
-
}
|
|
108
|
-
}, [avatarHeight]);
|
|
109
|
-
|
|
110
|
-
// Handle avatar depth changes
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (positionControllerRef.current && onCameraZChange) {
|
|
113
|
-
const newCameraZ = positionControllerRef.current.updateDepth(avatarDepth, true);
|
|
114
|
-
onCameraZChange(newCameraZ);
|
|
115
|
-
}
|
|
116
|
-
}, [avatarDepth, onCameraZChange]);
|
|
117
|
-
|
|
118
|
-
// Animation and morphing update loop
|
|
119
|
-
useFrame((state) => {
|
|
120
|
-
const currentTime = state.clock.elapsedTime * 1000;
|
|
121
|
-
|
|
122
|
-
// Update morph targets
|
|
123
|
-
if (morphTargetControllerRef.current) {
|
|
124
|
-
const currentViseme = updateCurrentViseme(currentTime / 1000);
|
|
125
|
-
|
|
126
|
-
// Use the updated MorphTargetController that handles chat emission directly
|
|
127
|
-
morphTargetControllerRef.current.updateMorphTargets(
|
|
128
|
-
currentTime,
|
|
129
|
-
chatEmission,
|
|
130
|
-
loading,
|
|
131
|
-
currentViseme,
|
|
132
|
-
eyeBlink,
|
|
133
|
-
blinkStateRef.current,
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Update scale with smooth transition
|
|
138
|
-
if (scene && positionControllerRef.current) {
|
|
139
|
-
const newScale = positionControllerRef.current.updateScale(SCALE_LERP_FACTOR);
|
|
140
|
-
scene.scale.copy(newScale);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
// Get current position from controller
|
|
145
|
-
const position = positionControllerRef.current?.getPosition() || AVATAR_POSITION;
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<group position={position}>
|
|
149
|
-
<primitive object={scene} />
|
|
150
|
-
</group>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Html, useProgress } from '@react-three/drei';
|
|
3
|
-
import Spin from '../../../../ui/Spin';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
fallbackImg?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const Loader = ({ fallbackImg }: Props) => {
|
|
10
|
-
const { progress } = useProgress();
|
|
11
|
-
return (
|
|
12
|
-
<Html center className="avatar-loader">
|
|
13
|
-
<Spin spinning>
|
|
14
|
-
{fallbackImg ? (
|
|
15
|
-
<figure>
|
|
16
|
-
<img
|
|
17
|
-
src={fallbackImg}
|
|
18
|
-
alt={`${Math.round(progress)}% loaded`}
|
|
19
|
-
title={`${Math.round(progress)}% loaded`}
|
|
20
|
-
/>
|
|
21
|
-
<figcaption>{`${Math.round(progress)}%`}</figcaption>
|
|
22
|
-
</figure>
|
|
23
|
-
) : (
|
|
24
|
-
<>{Math.round(progress)} % loaded</>
|
|
25
|
-
)}
|
|
26
|
-
</Spin>
|
|
27
|
-
</Html>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default Loader;
|