@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,254 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../../I18nWrapper';
|
|
4
|
-
import AvatarView, { Props } from './index';
|
|
5
|
-
import { VisemeProvider } from '../../../context/visemeContext';
|
|
6
|
-
|
|
7
|
-
const meta: Meta = {
|
|
8
|
-
title: 'RPM 3D Avatar',
|
|
9
|
-
component: AvatarView,
|
|
10
|
-
argTypes: {
|
|
11
|
-
url: {
|
|
12
|
-
control: {
|
|
13
|
-
type: 'text',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
rotateAvatar: {
|
|
17
|
-
control: {
|
|
18
|
-
type: 'boolean',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
eyeBlink: {
|
|
22
|
-
control: {
|
|
23
|
-
type: 'boolean',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
headMovement: {
|
|
27
|
-
control: {
|
|
28
|
-
type: 'boolean',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
speaking: {
|
|
32
|
-
control: {
|
|
33
|
-
type: 'boolean',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
halfBody: {
|
|
37
|
-
control: {
|
|
38
|
-
type: 'boolean',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
showControls: {
|
|
42
|
-
control: {
|
|
43
|
-
type: 'boolean',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
animation: {
|
|
47
|
-
control: {
|
|
48
|
-
type: 'select',
|
|
49
|
-
options: [
|
|
50
|
-
'Idle',
|
|
51
|
-
'Idle 1',
|
|
52
|
-
'Idle 2',
|
|
53
|
-
'Idle 3',
|
|
54
|
-
'Loading',
|
|
55
|
-
'Sad',
|
|
56
|
-
'Talk 1',
|
|
57
|
-
'Talk 2',
|
|
58
|
-
'Talk 3',
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
parameters: {
|
|
64
|
-
controls: { expanded: false },
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export default meta;
|
|
69
|
-
|
|
70
|
-
const Template: Story<Props> = args => {
|
|
71
|
-
const [hydrated, setHydrated] = React.useState(false);
|
|
72
|
-
React.useEffect(() => {
|
|
73
|
-
setHydrated(true);
|
|
74
|
-
}, []);
|
|
75
|
-
|
|
76
|
-
return hydrated ? (
|
|
77
|
-
<I18nWrapper>
|
|
78
|
-
<VisemeProvider>
|
|
79
|
-
<AvatarView
|
|
80
|
-
{...args}
|
|
81
|
-
url={args.url + `#${new Date(Date.now()).toISOString()}`}
|
|
82
|
-
key={Date.now()}
|
|
83
|
-
/>
|
|
84
|
-
</VisemeProvider>
|
|
85
|
-
</I18nWrapper>
|
|
86
|
-
) : (
|
|
87
|
-
<></>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
92
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
93
|
-
export const Default = Template.bind({});
|
|
94
|
-
Default.args = {
|
|
95
|
-
eyeBlink: false,
|
|
96
|
-
headMovement: false,
|
|
97
|
-
rotateAvatar: false,
|
|
98
|
-
speaking: false,
|
|
99
|
-
updateCurrentViseme: () => {},
|
|
100
|
-
url: 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
101
|
-
fallbackImg:
|
|
102
|
-
'https://assets.memori.ai/api/v2/asset/d8035229-08cf-42a7-a532-ab051df2603d.png',
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const EyeBlink = Template.bind({});
|
|
106
|
-
EyeBlink.args = {
|
|
107
|
-
updateCurrentViseme: () => {},
|
|
108
|
-
eyeBlink: true,
|
|
109
|
-
headMovement: false,
|
|
110
|
-
rotateAvatar: false,
|
|
111
|
-
speaking: false,
|
|
112
|
-
url: 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
113
|
-
fallbackImg:
|
|
114
|
-
'https://assets.memori.ai/api/v2/asset/d8035229-08cf-42a7-a532-ab051df2603d.png',
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const HeadMovement = Template.bind({});
|
|
118
|
-
HeadMovement.args = {
|
|
119
|
-
updateCurrentViseme: () => {},
|
|
120
|
-
eyeBlink: false,
|
|
121
|
-
headMovement: true,
|
|
122
|
-
rotateAvatar: false,
|
|
123
|
-
speaking: false,
|
|
124
|
-
url: 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
125
|
-
fallbackImg:
|
|
126
|
-
'https://assets.memori.ai/api/v2/asset/d8035229-08cf-42a7-a532-ab051df2603d.png',
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const RotateAvatar = Template.bind({});
|
|
130
|
-
RotateAvatar.args = {
|
|
131
|
-
updateCurrentViseme: () => {},
|
|
132
|
-
eyeBlink: false,
|
|
133
|
-
headMovement: false,
|
|
134
|
-
rotateAvatar: true,
|
|
135
|
-
speaking: false,
|
|
136
|
-
url: 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
137
|
-
fallbackImg:
|
|
138
|
-
'https://assets.memori.ai/api/v2/asset/d8035229-08cf-42a7-a532-ab051df2603d.png',
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const Speaking = Template.bind({});
|
|
142
|
-
Speaking.args = {
|
|
143
|
-
updateCurrentViseme: () => {},
|
|
144
|
-
eyeBlink: false,
|
|
145
|
-
headMovement: false,
|
|
146
|
-
rotateAvatar: false,
|
|
147
|
-
speaking: true,
|
|
148
|
-
url: 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
|
|
149
|
-
fallbackImg:
|
|
150
|
-
'https://assets.memori.ai/api/v2/asset/d8035229-08cf-42a7-a532-ab051df2603d.png',
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export const Fullbody = Template.bind({});
|
|
154
|
-
Fullbody.args = {
|
|
155
|
-
sex: 'MALE',
|
|
156
|
-
eyeBlink: true,
|
|
157
|
-
headMovement: true,
|
|
158
|
-
rotateAvatar: true,
|
|
159
|
-
speaking: false,
|
|
160
|
-
updateCurrentViseme: () => {},
|
|
161
|
-
url: 'https://models.readyplayer.me/63b55751f17e295642bf07a2.glb',
|
|
162
|
-
fallbackImg:
|
|
163
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
164
|
-
halfBody: false,
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const FullbodyZoomed = Template.bind({});
|
|
168
|
-
FullbodyZoomed.args = {
|
|
169
|
-
sex: 'FEMALE',
|
|
170
|
-
eyeBlink: true,
|
|
171
|
-
headMovement: true,
|
|
172
|
-
rotateAvatar: true,
|
|
173
|
-
speaking: false,
|
|
174
|
-
isZoomed: true,
|
|
175
|
-
updateCurrentViseme: () => {},
|
|
176
|
-
url: 'https://assets.memori.ai/api/v2/asset/3f5ef41c-6c4c-449c-888d-cf9c89782528.glb',
|
|
177
|
-
fallbackImg:
|
|
178
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
179
|
-
halfBody: false,
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export const FullbodyAnimatedIdle = Template.bind({});
|
|
183
|
-
FullbodyAnimatedIdle.args = {
|
|
184
|
-
sex: 'MALE',
|
|
185
|
-
eyeBlink: true,
|
|
186
|
-
headMovement: true,
|
|
187
|
-
rotateAvatar: true,
|
|
188
|
-
speaking: false,
|
|
189
|
-
updateCurrentViseme: () => {},
|
|
190
|
-
url: 'https://models.readyplayer.me/63b55751f17e295642bf07a2.glb',
|
|
191
|
-
fallbackImg:
|
|
192
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
193
|
-
animation: 'Idle',
|
|
194
|
-
halfBody: false,
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export const FullbodyAnimatedLoading = Template.bind({});
|
|
198
|
-
FullbodyAnimatedLoading.args = {
|
|
199
|
-
sex: 'MALE',
|
|
200
|
-
eyeBlink: true,
|
|
201
|
-
headMovement: true,
|
|
202
|
-
rotateAvatar: true,
|
|
203
|
-
speaking: false,
|
|
204
|
-
updateCurrentViseme: () => {},
|
|
205
|
-
url: 'https://models.readyplayer.me/63b55751f17e295642bf07a2.glb',
|
|
206
|
-
fallbackImg:
|
|
207
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
208
|
-
animation: 'Loading',
|
|
209
|
-
halfBody: false,
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export const FullbodyAnimatedSpeaking = Template.bind({});
|
|
213
|
-
FullbodyAnimatedSpeaking.args = {
|
|
214
|
-
sex: 'MALE',
|
|
215
|
-
eyeBlink: true,
|
|
216
|
-
headMovement: true,
|
|
217
|
-
rotateAvatar: true,
|
|
218
|
-
speaking: true,
|
|
219
|
-
updateCurrentViseme: () => {},
|
|
220
|
-
url: 'https://models.readyplayer.me/63b55751f17e295642bf07a2.glb',
|
|
221
|
-
fallbackImg:
|
|
222
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
223
|
-
animation: 'Talk 1',
|
|
224
|
-
halfBody: false,
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export const FullbodyFemale = Template.bind({});
|
|
228
|
-
FullbodyFemale.args = {
|
|
229
|
-
sex: 'FEMALE',
|
|
230
|
-
eyeBlink: true,
|
|
231
|
-
headMovement: true,
|
|
232
|
-
rotateAvatar: true,
|
|
233
|
-
speaking: false,
|
|
234
|
-
updateCurrentViseme: () => {},
|
|
235
|
-
url: 'https://models.readyplayer.me/650d50c2663b19e0d2831b2b.glb',
|
|
236
|
-
fallbackImg:
|
|
237
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
238
|
-
halfBody: false,
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export const FullbodyAnimatedFemale = Template.bind({});
|
|
242
|
-
FullbodyAnimatedFemale.args = {
|
|
243
|
-
sex: 'FEMALE',
|
|
244
|
-
eyeBlink: true,
|
|
245
|
-
headMovement: true,
|
|
246
|
-
rotateAvatar: true,
|
|
247
|
-
speaking: true,
|
|
248
|
-
updateCurrentViseme: () => {},
|
|
249
|
-
url: 'https://models.readyplayer.me/650d50c2663b19e0d2831b2b.glb',
|
|
250
|
-
fallbackImg:
|
|
251
|
-
'https://assets.memori.ai/api/v2/asset/3049582f-db5f-452c-913d-e4340d4afd0a.png',
|
|
252
|
-
animation: 'Idle',
|
|
253
|
-
halfBody: false,
|
|
254
|
-
};
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, useState } from 'react';
|
|
2
|
-
import React, { Suspense } from 'react';
|
|
3
|
-
import { Canvas } from '@react-three/fiber';
|
|
4
|
-
import {
|
|
5
|
-
OrbitControls,
|
|
6
|
-
SpotLight,
|
|
7
|
-
Environment,
|
|
8
|
-
PerspectiveCamera,
|
|
9
|
-
} from '@react-three/drei';
|
|
10
|
-
import { isAndroid, isiOS } from '../../../helpers/utils';
|
|
11
|
-
import { AvatarView } from './AvatarComponent/avatarComponent';
|
|
12
|
-
import PositionControls from './AvatarComponent/positionControls/positionControls';
|
|
13
|
-
import { getLocalConfig } from '../../../helpers/configuration';
|
|
14
|
-
import Loader from './AvatarComponent/components/loader';
|
|
15
|
-
import Lights from './AvatarComponent/lights/Lights';
|
|
16
|
-
|
|
17
|
-
export interface Props {
|
|
18
|
-
url: string;
|
|
19
|
-
sex: 'MALE' | 'FEMALE';
|
|
20
|
-
fallbackImg?: string;
|
|
21
|
-
eyeBlink?: boolean;
|
|
22
|
-
headMovement?: boolean;
|
|
23
|
-
rotateAvatar?: boolean;
|
|
24
|
-
speaking?: boolean;
|
|
25
|
-
style?: CSSProperties;
|
|
26
|
-
fallback?: React.ReactNode;
|
|
27
|
-
halfBody?: boolean;
|
|
28
|
-
loading?: boolean;
|
|
29
|
-
animation?: string;
|
|
30
|
-
showControls?: boolean;
|
|
31
|
-
isZoomed?: boolean;
|
|
32
|
-
chatEmission?: any;
|
|
33
|
-
enablePositionControls?: boolean;
|
|
34
|
-
setEnablePositionControls: (value: boolean) => void;
|
|
35
|
-
isTotem?: boolean;
|
|
36
|
-
setMeshRef?: any;
|
|
37
|
-
stopProcessing: () => void;
|
|
38
|
-
resetVisemeQueue: () => void;
|
|
39
|
-
updateCurrentViseme: (
|
|
40
|
-
currentTime: number
|
|
41
|
-
) => { name: string; weight: number } | null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const defaultStyles = {
|
|
45
|
-
halfBody: {
|
|
46
|
-
width: '100%',
|
|
47
|
-
height: '100%',
|
|
48
|
-
minHeight: '500px', // Ensure minimum height
|
|
49
|
-
backgroundColor: 'white',
|
|
50
|
-
borderRadius: '100%',
|
|
51
|
-
},
|
|
52
|
-
fullBody: {
|
|
53
|
-
width: '500px',
|
|
54
|
-
height: '500px',
|
|
55
|
-
backgroundColor: 'white',
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const getCameraSettings = (halfBody: boolean, isZoomed: boolean) => {
|
|
61
|
-
const baseZ = halfBody ? 0.6 : 3;
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
fov: isZoomed ? 44 : 40,
|
|
65
|
-
position: [0, 0, baseZ],
|
|
66
|
-
target: [0, 0, 0],
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default function ContainerAvatarView({
|
|
71
|
-
url,
|
|
72
|
-
sex,
|
|
73
|
-
style,
|
|
74
|
-
rotateAvatar,
|
|
75
|
-
eyeBlink,
|
|
76
|
-
headMovement,
|
|
77
|
-
speaking,
|
|
78
|
-
fallback,
|
|
79
|
-
fallbackImg,
|
|
80
|
-
halfBody = true,
|
|
81
|
-
loading,
|
|
82
|
-
// animation,
|
|
83
|
-
showControls = false,
|
|
84
|
-
isZoomed,
|
|
85
|
-
chatEmission,
|
|
86
|
-
updateCurrentViseme,
|
|
87
|
-
enablePositionControls,
|
|
88
|
-
setEnablePositionControls,
|
|
89
|
-
isTotem = false,
|
|
90
|
-
|
|
91
|
-
}: Props) {
|
|
92
|
-
const [cameraZ, setCameraZ] = useState(
|
|
93
|
-
() => getCameraSettings(halfBody, isZoomed || false).position[2]
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const getAvatarHeight = () => {
|
|
97
|
-
// For totem avatars, use stored config value or default to 50
|
|
98
|
-
if (isTotem) {
|
|
99
|
-
const height = getLocalConfig('avatarHeight', 50);
|
|
100
|
-
return height;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// For half body avatars, use fixed height of 100
|
|
104
|
-
if (halfBody) {
|
|
105
|
-
return 80;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// For full body avatars, adjust height based on zoom
|
|
109
|
-
return isZoomed ? 16 : 65;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const getAvatarDepth = () => {
|
|
113
|
-
// For totem avatars, use stored config value or default to 50
|
|
114
|
-
if (isTotem) {
|
|
115
|
-
const depth = getLocalConfig('avatarDepth', 50);
|
|
116
|
-
return depth;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// For half body avatars, use fixed depth of 50
|
|
120
|
-
if (halfBody) {
|
|
121
|
-
return 50;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// For full body avatars, adjust depth based on zoom
|
|
125
|
-
return isZoomed ? 5 : 100;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const [avatarHeight, setAvatarHeight] = useState(getAvatarHeight());
|
|
129
|
-
const [avatarDepth, setAvatarDepth] = useState(getAvatarDepth());
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
<>
|
|
133
|
-
{enablePositionControls && (
|
|
134
|
-
<PositionControls
|
|
135
|
-
avatarHeight={avatarHeight}
|
|
136
|
-
avatarDepth={avatarDepth}
|
|
137
|
-
halfBody={halfBody}
|
|
138
|
-
setAvatarHeight={setAvatarHeight}
|
|
139
|
-
setAvatarDepth={setAvatarDepth}
|
|
140
|
-
setEnablePositionControls={setEnablePositionControls}
|
|
141
|
-
/>
|
|
142
|
-
)}
|
|
143
|
-
<Canvas
|
|
144
|
-
style={style || defaultStyles.fullBody}
|
|
145
|
-
shadows={true}
|
|
146
|
-
dpr={[1, 2]} // Optimize pixel ratio
|
|
147
|
-
gl={{
|
|
148
|
-
antialias: true,
|
|
149
|
-
alpha: true,
|
|
150
|
-
powerPreference: "high-performance",
|
|
151
|
-
stencil: false
|
|
152
|
-
}}
|
|
153
|
-
>
|
|
154
|
-
<PerspectiveCamera
|
|
155
|
-
makeDefault
|
|
156
|
-
position={[0, 0, cameraZ]}
|
|
157
|
-
fov={getCameraSettings(halfBody, isZoomed || false).fov}
|
|
158
|
-
near={0.1}
|
|
159
|
-
far={1000}
|
|
160
|
-
/>
|
|
161
|
-
|
|
162
|
-
{rotateAvatar && (
|
|
163
|
-
<OrbitControls
|
|
164
|
-
enablePan={false}
|
|
165
|
-
enableZoom={false}
|
|
166
|
-
target={[0, 0, 0]}
|
|
167
|
-
enableDamping
|
|
168
|
-
dampingFactor={0.05}
|
|
169
|
-
/>
|
|
170
|
-
)}
|
|
171
|
-
|
|
172
|
-
<Suspense fallback={fallback || <Loader fallbackImg={fallbackImg} />}>
|
|
173
|
-
<Lights />
|
|
174
|
-
|
|
175
|
-
<AvatarView
|
|
176
|
-
url={url}
|
|
177
|
-
sex={sex}
|
|
178
|
-
showControls={showControls}
|
|
179
|
-
loading={loading || false}
|
|
180
|
-
eyeBlink={eyeBlink || false}
|
|
181
|
-
headMovement={headMovement || false}
|
|
182
|
-
speaking={speaking || false}
|
|
183
|
-
halfBody={halfBody}
|
|
184
|
-
chatEmission={chatEmission}
|
|
185
|
-
updateCurrentViseme={updateCurrentViseme}
|
|
186
|
-
setCameraZ={setCameraZ}
|
|
187
|
-
avatarHeight={avatarHeight}
|
|
188
|
-
avatarDepth={avatarDepth}
|
|
189
|
-
/>
|
|
190
|
-
</Suspense>
|
|
191
|
-
</Canvas>
|
|
192
|
-
</>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Nodes } from "./utils";
|
|
2
|
-
|
|
3
|
-
export const hideHands = (nodes: Nodes) => {
|
|
4
|
-
if (nodes.Wolf3D_Hands) {
|
|
5
|
-
nodes.Wolf3D_Hands.visible = false;
|
|
6
|
-
}
|
|
7
|
-
if (nodes.RightHand && nodes.LeftHand) {
|
|
8
|
-
nodes.RightHand.position.set(0, -2, 0);
|
|
9
|
-
nodes.LeftHand.position.set(0, -2, 0);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
interface BlinkConfig {
|
|
4
|
-
minInterval: number;
|
|
5
|
-
maxInterval: number;
|
|
6
|
-
blinkDuration: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const DEFAULT_BLINK_CONFIG: BlinkConfig = {
|
|
10
|
-
minInterval: 1000, // Minimum time between blinks in milliseconds
|
|
11
|
-
maxInterval: 5000, // Maximum time between blinks in milliseconds
|
|
12
|
-
blinkDuration: 150, // Duration of a single blink in milliseconds
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
interface UseAvatarBlinkProps {
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
setMorphTargetInfluences: (morphTargetInfluences: any) => void;
|
|
18
|
-
config?: Partial<BlinkConfig>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function useAvatarBlink({
|
|
22
|
-
enabled,
|
|
23
|
-
setMorphTargetInfluences,
|
|
24
|
-
config = {}
|
|
25
|
-
}: UseAvatarBlinkProps) {
|
|
26
|
-
const blinkTimeoutRef = useRef<NodeJS.Timeout>();
|
|
27
|
-
const isBlinkingRef = useRef(false);
|
|
28
|
-
const lastBlinkTime = useRef(0);
|
|
29
|
-
|
|
30
|
-
const blinkConfig = {
|
|
31
|
-
...DEFAULT_BLINK_CONFIG,
|
|
32
|
-
...config
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const blink = useCallback(() => {
|
|
36
|
-
if (!enabled || isBlinkingRef.current) return;
|
|
37
|
-
|
|
38
|
-
isBlinkingRef.current = true;
|
|
39
|
-
// Close eyes
|
|
40
|
-
setMorphTargetInfluences((prev: any) => ({
|
|
41
|
-
...prev,
|
|
42
|
-
eyesClosed: 1
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
|
-
// Open eyes after blinkDuration
|
|
46
|
-
setTimeout(() => {
|
|
47
|
-
setMorphTargetInfluences((prev: any) => ({
|
|
48
|
-
...prev,
|
|
49
|
-
eyesClosed: 0
|
|
50
|
-
}));
|
|
51
|
-
isBlinkingRef.current = false;
|
|
52
|
-
lastBlinkTime.current = Date.now();
|
|
53
|
-
|
|
54
|
-
// Schedule next blink
|
|
55
|
-
scheduleNextBlink();
|
|
56
|
-
}, blinkConfig.blinkDuration);
|
|
57
|
-
}, [enabled, blinkConfig.blinkDuration, setMorphTargetInfluences]);
|
|
58
|
-
|
|
59
|
-
const scheduleNextBlink = useCallback(() => {
|
|
60
|
-
if (blinkTimeoutRef.current) {
|
|
61
|
-
clearTimeout(blinkTimeoutRef.current);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Randomize the next blink delay between min and max interval
|
|
65
|
-
const nextBlinkDelay = Math.random() *
|
|
66
|
-
(blinkConfig.maxInterval - blinkConfig.minInterval) +
|
|
67
|
-
blinkConfig.minInterval;
|
|
68
|
-
|
|
69
|
-
blinkTimeoutRef.current = setTimeout(blink, nextBlinkDelay);
|
|
70
|
-
}, [blink, blinkConfig.maxInterval, blinkConfig.minInterval]);
|
|
71
|
-
|
|
72
|
-
// Handle enabled state changes
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (enabled) {
|
|
75
|
-
scheduleNextBlink();
|
|
76
|
-
} else {
|
|
77
|
-
if (blinkTimeoutRef.current) {
|
|
78
|
-
clearTimeout(blinkTimeoutRef.current);
|
|
79
|
-
}
|
|
80
|
-
// Reset eyes to open
|
|
81
|
-
setMorphTargetInfluences((prevInfluences: any) => ({
|
|
82
|
-
...prevInfluences,
|
|
83
|
-
eyesClosed: 0
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Cleanup
|
|
88
|
-
return () => {
|
|
89
|
-
if (blinkTimeoutRef.current) {
|
|
90
|
-
clearTimeout(blinkTimeoutRef.current);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}, [enabled, scheduleNextBlink, setMorphTargetInfluences]);
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
isBlinking: isBlinkingRef.current,
|
|
97
|
-
lastBlinkTime: lastBlinkTime.current,
|
|
98
|
-
triggerBlink: blink
|
|
99
|
-
};
|
|
100
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Nodes } from './utils';
|
|
2
|
-
import { Vector2 } from 'three';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { lerp, mapRange } from './utils';
|
|
5
|
-
import { useFrame, useThree } from '@react-three/fiber';
|
|
6
|
-
|
|
7
|
-
const rad = Math.PI / 180;
|
|
8
|
-
// const eyeRotationOffsetX = 90 * rad;
|
|
9
|
-
|
|
10
|
-
let reset: boolean = false;
|
|
11
|
-
let timeout: NodeJS.Timeout;
|
|
12
|
-
|
|
13
|
-
const targetPos = new Vector2(0, 0);
|
|
14
|
-
const currentPos = new Vector2(0, 0);
|
|
15
|
-
|
|
16
|
-
const setResetTrue = () => {
|
|
17
|
-
timeout = setTimeout(() => {
|
|
18
|
-
reset = true;
|
|
19
|
-
}, 1000);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const setResetFalse = () => {
|
|
23
|
-
clearTimeout(timeout);
|
|
24
|
-
reset = false;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default function useHeadMovement(
|
|
28
|
-
enabled: boolean | undefined,
|
|
29
|
-
nodes: Nodes
|
|
30
|
-
) {
|
|
31
|
-
const { gl } = useThree();
|
|
32
|
-
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!enabled) return;
|
|
35
|
-
|
|
36
|
-
gl.domElement.addEventListener('mouseleave', setResetTrue);
|
|
37
|
-
gl.domElement.addEventListener('mouseenter', setResetFalse);
|
|
38
|
-
|
|
39
|
-
return () => {
|
|
40
|
-
gl.domElement.removeEventListener('mouseleave', setResetTrue);
|
|
41
|
-
gl.domElement.removeEventListener('mouseenter', setResetFalse);
|
|
42
|
-
};
|
|
43
|
-
}, [gl.domElement, enabled]);
|
|
44
|
-
|
|
45
|
-
useFrame(state => {
|
|
46
|
-
if (!enabled || !nodes?.Neck || !nodes?.Head) return;
|
|
47
|
-
|
|
48
|
-
const cameraRotation = Math.abs(state.camera.rotation.z);
|
|
49
|
-
|
|
50
|
-
if (!reset && cameraRotation < 0.2) {
|
|
51
|
-
targetPos.x = mapRange(state.mouse.y, -1, 1, 5 * rad, -5 * rad);
|
|
52
|
-
targetPos.y = mapRange(state.mouse.x, -1, 1, -10 * rad, 10 * rad);
|
|
53
|
-
} else {
|
|
54
|
-
targetPos.set(0, 0);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
currentPos.x = lerp(currentPos.x, targetPos.x);
|
|
58
|
-
currentPos.y = lerp(currentPos.y, targetPos.y);
|
|
59
|
-
|
|
60
|
-
nodes.Neck.rotation.x = currentPos.x + 0.1;
|
|
61
|
-
nodes.Neck.rotation.y = currentPos.y;
|
|
62
|
-
|
|
63
|
-
nodes.Head.rotation.x = currentPos.x * 2;
|
|
64
|
-
nodes.Head.rotation.y = currentPos.y * 2;
|
|
65
|
-
|
|
66
|
-
// nodes.RightEye.rotation.x = currentPos.x - eyeRotationOffsetX;
|
|
67
|
-
// nodes.LeftEye.rotation.x = currentPos.x - eyeRotationOffsetX;
|
|
68
|
-
|
|
69
|
-
// nodes.RightEye.rotation.z = currentPos.y * 3 + Math.PI;
|
|
70
|
-
// nodes.LeftEye.rotation.z = currentPos.y * 3 + Math.PI;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Nodes } from './utils';
|
|
2
|
-
import { SkinnedMesh } from 'three';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
|
|
6
|
-
let headMesh: SkinnedMesh;
|
|
7
|
-
let eyesClosedMorphIndex: number = 0;
|
|
8
|
-
let viseme_UMorphIndex: number = 0;
|
|
9
|
-
|
|
10
|
-
export default function useLoadingMorphAnim(
|
|
11
|
-
loading: boolean | undefined,
|
|
12
|
-
nodes: Nodes
|
|
13
|
-
) {
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!loading) return;
|
|
16
|
-
|
|
17
|
-
headMesh = (nodes.Wolf3D_Head ||
|
|
18
|
-
nodes.Wolf3D_Avatar ||
|
|
19
|
-
nodes.Wolf3D_Avatar001) as SkinnedMesh;
|
|
20
|
-
|
|
21
|
-
if (headMesh?.morphTargetDictionary && headMesh?.morphTargetInfluences) {
|
|
22
|
-
eyesClosedMorphIndex = headMesh.morphTargetDictionary.mouthOpen;
|
|
23
|
-
viseme_UMorphIndex = headMesh.morphTargetDictionary.viseme_U;
|
|
24
|
-
}
|
|
25
|
-
}, [nodes, loading]);
|
|
26
|
-
|
|
27
|
-
useFrame(() => {
|
|
28
|
-
if (!loading) {
|
|
29
|
-
if (headMesh?.morphTargetInfluences) {
|
|
30
|
-
headMesh.morphTargetInfluences[eyesClosedMorphIndex] = 0;
|
|
31
|
-
headMesh.morphTargetInfluences[viseme_UMorphIndex] = 0;
|
|
32
|
-
}
|
|
33
|
-
} else if (headMesh?.morphTargetInfluences) {
|
|
34
|
-
headMesh.morphTargetInfluences[eyesClosedMorphIndex] = 0.56;
|
|
35
|
-
headMesh.morphTargetInfluences[viseme_UMorphIndex] = 0.67;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|