@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,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
3
|
-
import Button from '../ui/Button';
|
|
4
|
-
import { withTranslation, WithTranslation } from 'react-i18next';
|
|
5
|
-
|
|
6
|
-
interface Props extends WithTranslation {
|
|
7
|
-
fallback?: ReactNode;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface State {
|
|
12
|
-
hasError: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
class ErrorBoundary extends Component<Props, State> {
|
|
16
|
-
public state: State = {
|
|
17
|
-
hasError: false,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
public static getDerivedStateFromError(_: Error): State {
|
|
21
|
-
// Update state so the next render will show the fallback UI.
|
|
22
|
-
return { hasError: true };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
|
26
|
-
console.error('Uncaught error:', error, errorInfo);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
public render() {
|
|
30
|
-
if (this.state.hasError) {
|
|
31
|
-
return this.props.fallback ? (
|
|
32
|
-
this.props.fallback
|
|
33
|
-
) : (
|
|
34
|
-
<div
|
|
35
|
-
style={{
|
|
36
|
-
background: 'rgba(255, 255, 255, 0.4)',
|
|
37
|
-
color: '#000',
|
|
38
|
-
padding: '2rem',
|
|
39
|
-
borderRadius: '10px',
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
<h2>{this.props.t('error.generic')}</h2>
|
|
43
|
-
<Button primary onClick={() => this.setState({ hasError: false })}>
|
|
44
|
-
{this.props.t('error.tryAgain') || 'Try again'}
|
|
45
|
-
</Button>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return this.props.children;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default withTranslation(['common'])(ErrorBoundary);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
.memori--experts-drawer {
|
|
2
|
-
z-index: 1000;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.memori--experts-drawer .memori-drawer--panel {
|
|
6
|
-
--memori-drawer--width: 100%;
|
|
7
|
-
--memori-drawer--width--md: 60%;
|
|
8
|
-
--memori-drawer--width--lg: 40%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
h2.memori--experts-drawer--title {
|
|
12
|
-
margin: 0;
|
|
13
|
-
font-size: inherit;
|
|
14
|
-
font-weight: 400;
|
|
15
|
-
line-height: inherit;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
ul.memori--experts-drawer--list {
|
|
19
|
-
padding: 0;
|
|
20
|
-
margin: 0;
|
|
21
|
-
list-style: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
li.memori--experts-drawer--item {
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-wrap: nowrap;
|
|
27
|
-
align-items: center;
|
|
28
|
-
margin-top: 1rem;
|
|
29
|
-
margin-bottom: 1rem;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
figure.memori--experts-drawer--avatar {
|
|
33
|
-
display: flex;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
width: 1.5rem;
|
|
36
|
-
height: 1.5rem;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
border-radius: 50%;
|
|
40
|
-
margin: 0 0.5rem 0 0;
|
|
41
|
-
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
figure.memori--experts-drawer--avatar img {
|
|
45
|
-
min-width: 100%;
|
|
46
|
-
min-height: 100%;
|
|
47
|
-
object-fit: cover;
|
|
48
|
-
object-position: center;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.memori--experts-drawer--content {
|
|
52
|
-
flex: 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
h3.memori--experts-drawer--name {
|
|
56
|
-
margin: 0;
|
|
57
|
-
font-size: 0.875rem;
|
|
58
|
-
font-weight: 400;
|
|
59
|
-
line-height: 1.25rem;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
p.memori--experts-drawer--description {
|
|
63
|
-
margin: 0;
|
|
64
|
-
font-size: 0.75rem;
|
|
65
|
-
font-weight: 400;
|
|
66
|
-
line-height: 1rem;
|
|
67
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
|
-
import ExpertsDrawer, { Props } from './ExpertsDrawer';
|
|
5
|
-
import { tenant, expertReference } from '../../mocks/data';
|
|
6
|
-
import './ExpertsDrawer.css';
|
|
7
|
-
|
|
8
|
-
const meta: Meta = {
|
|
9
|
-
title: 'Widget/ExpertsDrawer',
|
|
10
|
-
component: ExpertsDrawer,
|
|
11
|
-
argTypes: {
|
|
12
|
-
open: {
|
|
13
|
-
control: {
|
|
14
|
-
type: 'boolean',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
controls: { expanded: true },
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
|
|
25
|
-
const Template: Story<Props> = args => {
|
|
26
|
-
return (
|
|
27
|
-
<I18nWrapper>
|
|
28
|
-
<ExpertsDrawer
|
|
29
|
-
{...args}
|
|
30
|
-
baseUrl="https://aisuru.com"
|
|
31
|
-
apiUrl="https://backend.memori.ai"
|
|
32
|
-
tenant={tenant}
|
|
33
|
-
experts={[
|
|
34
|
-
expertReference,
|
|
35
|
-
{
|
|
36
|
-
...expertReference,
|
|
37
|
-
expertID: '2',
|
|
38
|
-
name: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
|
|
39
|
-
description:
|
|
40
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
41
|
-
},
|
|
42
|
-
]}
|
|
43
|
-
/>
|
|
44
|
-
</I18nWrapper>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
49
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
50
|
-
export const Default = Template.bind({});
|
|
51
|
-
Default.args = {
|
|
52
|
-
open: true,
|
|
53
|
-
onClose: () => {},
|
|
54
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { render } from '@testing-library/react';
|
|
2
|
-
import ExpertsDrawer from './ExpertsDrawer';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { tenant, expertReference } from '../../mocks/data';
|
|
5
|
-
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
window.IntersectionObserver = jest.fn(() => ({
|
|
9
|
-
observe: jest.fn(),
|
|
10
|
-
unobserve: jest.fn(),
|
|
11
|
-
disconnect: jest.fn(),
|
|
12
|
-
takeRecords: jest.fn(),
|
|
13
|
-
}));
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('renders ExpertsDrawer unchanged', () => {
|
|
17
|
-
const { container } = render(
|
|
18
|
-
<ExpertsDrawer
|
|
19
|
-
onClose={jest.fn()}
|
|
20
|
-
baseUrl="https://aisuru.com"
|
|
21
|
-
apiUrl="https://backend.memori.ai"
|
|
22
|
-
tenant={tenant}
|
|
23
|
-
experts={[
|
|
24
|
-
expertReference,
|
|
25
|
-
{
|
|
26
|
-
...expertReference,
|
|
27
|
-
expertID: '2',
|
|
28
|
-
},
|
|
29
|
-
]}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
expect(container).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('renders ExpertsDrawer open unchanged', () => {
|
|
36
|
-
const { container } = render(
|
|
37
|
-
<ExpertsDrawer
|
|
38
|
-
open
|
|
39
|
-
onClose={jest.fn()}
|
|
40
|
-
baseUrl="https://aisuru.com"
|
|
41
|
-
apiUrl="https://backend.memori.ai"
|
|
42
|
-
tenant={tenant}
|
|
43
|
-
experts={[
|
|
44
|
-
expertReference,
|
|
45
|
-
{
|
|
46
|
-
...expertReference,
|
|
47
|
-
expertID: '2',
|
|
48
|
-
},
|
|
49
|
-
]}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
expect(container).toMatchSnapshot();
|
|
53
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExpertReference,
|
|
3
|
-
Tenant,
|
|
4
|
-
} from '@memori.ai/memori-api-client/dist/types';
|
|
5
|
-
import Drawer from '../ui/Drawer';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { getResourceUrl } from '../../helpers/media';
|
|
8
|
-
|
|
9
|
-
export interface Props {
|
|
10
|
-
experts: ExpertReference[];
|
|
11
|
-
baseUrl: string;
|
|
12
|
-
apiUrl: string;
|
|
13
|
-
tenant?: Tenant;
|
|
14
|
-
open?: boolean;
|
|
15
|
-
onClose: () => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const ExpertsDrawer = ({
|
|
19
|
-
open = false,
|
|
20
|
-
baseUrl,
|
|
21
|
-
apiUrl,
|
|
22
|
-
tenant,
|
|
23
|
-
experts,
|
|
24
|
-
onClose,
|
|
25
|
-
}: Props) => {
|
|
26
|
-
const { t } = useTranslation();
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Drawer
|
|
30
|
-
open={open}
|
|
31
|
-
onClose={onClose}
|
|
32
|
-
className="memori--experts-drawer"
|
|
33
|
-
title={
|
|
34
|
-
<h2 className="memori--experts-drawer--title">
|
|
35
|
-
{t('widget.expertsInTheBoard')}
|
|
36
|
-
</h2>
|
|
37
|
-
}
|
|
38
|
-
>
|
|
39
|
-
<ul className="memori--experts-drawer--list">
|
|
40
|
-
{experts.map(expert => (
|
|
41
|
-
<li key={expert.expertID} className="memori--experts-drawer--item">
|
|
42
|
-
<figure className="memori--experts-drawer--avatar">
|
|
43
|
-
<img
|
|
44
|
-
src={`${new URL(apiUrl).origin}/api/v1/memoriai/memori/avatar/${
|
|
45
|
-
expert.expertMemoriID
|
|
46
|
-
}`}
|
|
47
|
-
alt={expert.name}
|
|
48
|
-
onError={e => {
|
|
49
|
-
e.currentTarget.src = getResourceUrl({
|
|
50
|
-
tenantID: tenant?.name,
|
|
51
|
-
type: 'avatar',
|
|
52
|
-
baseURL: baseUrl,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
e.currentTarget.onerror = null;
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
58
|
-
</figure>
|
|
59
|
-
<div className="memori--experts-drawer--content">
|
|
60
|
-
<h3 className="memori--experts-drawer--name">{expert.name}</h3>
|
|
61
|
-
</div>
|
|
62
|
-
</li>
|
|
63
|
-
))}
|
|
64
|
-
</ul>
|
|
65
|
-
</Drawer>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default ExpertsDrawer;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders ExpertsDrawer open unchanged 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
style="position: fixed; top: 1px; left: 1px; width: 1px; height: 0px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border-width: 0px; display: none;"
|
|
7
|
-
/>
|
|
8
|
-
</div>
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
exports[`renders ExpertsDrawer unchanged 1`] = `<div />`;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.memori-export-history-button--panel {
|
|
2
|
-
position: absolute;
|
|
3
|
-
z-index: 10;
|
|
4
|
-
right: 0.5rem;
|
|
5
|
-
padding: var(--memori-button-padding);
|
|
6
|
-
border: 1px solid var(--memori-button-border-color);
|
|
7
|
-
border-radius: var(--memori-button-radius);
|
|
8
|
-
margin-top: 0.5rem;
|
|
9
|
-
background: #fff;
|
|
10
|
-
box-shadow: var(--memori-button-box-shadow);
|
|
11
|
-
color: #000;
|
|
12
|
-
text-align: left;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.memori-export-history-button--panel button + button {
|
|
16
|
-
margin-left: 0.5rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.memori-export-history-button--align-left .memori-export-history-button--panel {
|
|
20
|
-
right: auto;
|
|
21
|
-
left: 0.5rem;
|
|
22
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
.memori-chat--feedback button {
|
|
2
|
-
padding: 0.5em;
|
|
3
|
-
color: #333;
|
|
4
|
-
transition: all 0.3s ease-in-out;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.memori-chat--feedback button:hover,
|
|
8
|
-
.memori-chat--feedback button:focus {
|
|
9
|
-
opacity: 1;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.memori-chat--feedback button .memori-button--icon svg.memori-chat--feedback-clicked {
|
|
13
|
-
color: var(--memori-primary);
|
|
14
|
-
fill: var(--memori-primary);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.memori-chat--feedback-menu {
|
|
18
|
-
position: relative;
|
|
19
|
-
display: inline-flex;
|
|
20
|
-
text-align: left;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.transition {
|
|
24
|
-
transition-duration: 0.15s;
|
|
25
|
-
transition-property: all;
|
|
26
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ease-out {
|
|
30
|
-
transition-timing-function: ease-out;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ease-in {
|
|
34
|
-
transition-timing-function: ease-in;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.duration-100 {
|
|
38
|
-
transition-duration: 100ms;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.duration-200 {
|
|
42
|
-
transition-duration: 200ms;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.opacity-0 {
|
|
46
|
-
opacity: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.opacity-100 {
|
|
50
|
-
opacity: 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.scale-95 {
|
|
54
|
-
transform: scale(0.95);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.scale-100 {
|
|
58
|
-
transform: scale(1);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.memori-chat--feedback-menu-items {
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: calc(100% - 0.25rem);
|
|
64
|
-
right: -2rem;
|
|
65
|
-
width: 14rem;
|
|
66
|
-
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
67
|
-
border-radius: 0.375rem;
|
|
68
|
-
margin-top: 0.5rem;
|
|
69
|
-
background-color: #fff;
|
|
70
|
-
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
71
|
-
outline: none;
|
|
72
|
-
transform-origin: top right;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.memori-chat--feedback-menu-items:focus {
|
|
76
|
-
outline: none;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.memori-chat--feedback-menu-items-container {
|
|
80
|
-
padding: 0.25rem;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.memori-chat--feedback-menu-items button.memori-chat--feedback-menu-item {
|
|
84
|
-
display: flex;
|
|
85
|
-
width: 100%;
|
|
86
|
-
align-items: center;
|
|
87
|
-
padding: 0.5rem;
|
|
88
|
-
border: none;
|
|
89
|
-
border-radius: 0.375rem;
|
|
90
|
-
margin: 0;
|
|
91
|
-
background: none;
|
|
92
|
-
box-shadow: none;
|
|
93
|
-
color: #333;
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
font-family: inherit;
|
|
96
|
-
font-size: 0.75em;
|
|
97
|
-
font-weight: inherit;
|
|
98
|
-
line-height: inherit;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.memori-chat--feedback-menu-items button.memori-chat--feedback-menu-item:hover,
|
|
102
|
-
.memori-chat--feedback-menu-items button.memori-chat--feedback-menu-item:focus,
|
|
103
|
-
.memori-chat--feedback-menu-items button.memori-chat--feedback-menu-item:active,
|
|
104
|
-
.memori-chat--feedback-menu-items button.memori-chat--feedback-menu-item.memori-chat--feedback-menu-item-active {
|
|
105
|
-
background-color: var(--memori-primary, rgb(102, 103, 171));
|
|
106
|
-
color: var(--memori-primary-text, #fff);
|
|
107
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
|
-
import FeedbackButtons, { Props } from './FeedbackButtons';
|
|
5
|
-
import { memori } from '../../mocks/data';
|
|
6
|
-
|
|
7
|
-
import './FeedbackButtons.css';
|
|
8
|
-
|
|
9
|
-
const meta: Meta = {
|
|
10
|
-
title: 'Feedback Buttons',
|
|
11
|
-
component: FeedbackButtons,
|
|
12
|
-
argTypes: {},
|
|
13
|
-
parameters: {
|
|
14
|
-
controls: { expanded: true },
|
|
15
|
-
},
|
|
16
|
-
decorators: [
|
|
17
|
-
Story => (
|
|
18
|
-
<div style={{ textAlign: 'right', padding: '0 3rem' }}>
|
|
19
|
-
<Story />
|
|
20
|
-
</div>
|
|
21
|
-
),
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
const Template: Story<Props> = args => (
|
|
28
|
-
<I18nWrapper>
|
|
29
|
-
<FeedbackButtons {...args} />
|
|
30
|
-
</I18nWrapper>
|
|
31
|
-
);
|
|
32
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
33
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
34
|
-
export const Default = Template.bind({});
|
|
35
|
-
Default.args = {
|
|
36
|
-
memori,
|
|
37
|
-
onNegativeClick: () => {},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Toggle = Template.bind({});
|
|
41
|
-
Toggle.args = {
|
|
42
|
-
memori,
|
|
43
|
-
toggle: true,
|
|
44
|
-
onNegativeClick: () => {},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Dropdown = Template.bind({});
|
|
48
|
-
Dropdown.args = {
|
|
49
|
-
memori,
|
|
50
|
-
dropdown: true,
|
|
51
|
-
onNegativeClick: () => {},
|
|
52
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { memori } from '../../mocks/data';
|
|
4
|
-
import FeedbackButtons from './FeedbackButtons';
|
|
5
|
-
|
|
6
|
-
it('renders FeedbackButtons unchanged', () => {
|
|
7
|
-
const { container } = render(
|
|
8
|
-
<FeedbackButtons memori={memori} onNegativeClick={jest.fn()} />
|
|
9
|
-
);
|
|
10
|
-
expect(container).toMatchSnapshot();
|
|
11
|
-
});
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { Memori } from '@memori.ai/memori-api-client/dist/types';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import { Menu, Transition } from '@headlessui/react';
|
|
4
|
-
import Tooltip from '../ui/Tooltip';
|
|
5
|
-
import Button from '../ui/Button';
|
|
6
|
-
import Feedback from '../icons/Feedback';
|
|
7
|
-
|
|
8
|
-
const feedbackMsgs = {
|
|
9
|
-
'it-IT': 'Non è quello che ti ho chiesto',
|
|
10
|
-
'fr-FR': "Ce n'est pas ce que je t'ai demandé",
|
|
11
|
-
'en-GB': "It's not what I asked",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const feedbackMsgsHelpers = {
|
|
15
|
-
'it-IT': 'La risposta non era corretta',
|
|
16
|
-
'fr-FR': "La réponse n'était pas correcte",
|
|
17
|
-
'en-GB': 'The answer was not correct',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const dislikeMsgs = {
|
|
21
|
-
'it-IT': 'Non mi è piaciuta la risposta',
|
|
22
|
-
'fr-FR': "Je n'ai pas aimé la réponse",
|
|
23
|
-
'en-GB': "I didn't like the answer",
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export interface Props {
|
|
27
|
-
memori: Memori;
|
|
28
|
-
onNegativeClick: (msg?: string) => void;
|
|
29
|
-
className?: string;
|
|
30
|
-
toggle?: boolean;
|
|
31
|
-
dropdown?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const FeedbackButtons = ({
|
|
35
|
-
memori,
|
|
36
|
-
className,
|
|
37
|
-
onNegativeClick,
|
|
38
|
-
toggle = false,
|
|
39
|
-
dropdown = false,
|
|
40
|
-
}: Props) => {
|
|
41
|
-
const [clicked, setClicked] = useState<'up' | 'down'>();
|
|
42
|
-
const culture =
|
|
43
|
-
memori.culture === 'it-IT'
|
|
44
|
-
? 'it-IT'
|
|
45
|
-
: memori.culture === 'fr-FR'
|
|
46
|
-
? 'fr-FR'
|
|
47
|
-
: 'en-GB';
|
|
48
|
-
const feedbackMsg = feedbackMsgs[culture];
|
|
49
|
-
const feedbackMsgHelper = feedbackMsgsHelpers[culture];
|
|
50
|
-
const dislikeMsg = dislikeMsgs[culture];
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<div className={`memori-chat--feedback${className ? ` ${className}` : ''}`}>
|
|
54
|
-
{dropdown ? (
|
|
55
|
-
<Menu as="div" className="memori-chat--feedback-menu">
|
|
56
|
-
<Menu.Button as={React.Fragment}>
|
|
57
|
-
<Button
|
|
58
|
-
ghost
|
|
59
|
-
shape="circle"
|
|
60
|
-
title="Feedback"
|
|
61
|
-
className="memori-chat--feedback-menu-button"
|
|
62
|
-
disabled={!!clicked}
|
|
63
|
-
icon={
|
|
64
|
-
<Feedback
|
|
65
|
-
className={
|
|
66
|
-
clicked ? 'memori-chat--feedback-clicked' : undefined
|
|
67
|
-
}
|
|
68
|
-
/>
|
|
69
|
-
}
|
|
70
|
-
/>
|
|
71
|
-
</Menu.Button>
|
|
72
|
-
<Transition
|
|
73
|
-
as={React.Fragment}
|
|
74
|
-
enter="transition ease-out duration-200"
|
|
75
|
-
enterFrom="transform opacity-0 scale-95"
|
|
76
|
-
enterTo="transform opacity-100 scale-100"
|
|
77
|
-
leave="transition ease-in duration-75"
|
|
78
|
-
leaveFrom="transform opacity-100 scale-100"
|
|
79
|
-
leaveTo="transform opacity-0 scale-95"
|
|
80
|
-
>
|
|
81
|
-
<Menu.Items className="memori-chat--feedback-menu-items">
|
|
82
|
-
<div className="memori-chat--feedback-menu-items-container">
|
|
83
|
-
<Menu.Item key="ok">
|
|
84
|
-
{({ active }) => (
|
|
85
|
-
<button
|
|
86
|
-
className={`memori-chat--feedback-menu-item${
|
|
87
|
-
active ? ' memori-chat--feedback-menu-item-active' : ''
|
|
88
|
-
}`}
|
|
89
|
-
onClick={() => {
|
|
90
|
-
if (clicked === 'up' && !!toggle) {
|
|
91
|
-
setClicked(undefined);
|
|
92
|
-
} else {
|
|
93
|
-
setClicked('up');
|
|
94
|
-
}
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
{dislikeMsg}
|
|
98
|
-
</button>
|
|
99
|
-
)}
|
|
100
|
-
</Menu.Item>
|
|
101
|
-
<Menu.Item key="no">
|
|
102
|
-
{({ active }) => (
|
|
103
|
-
<button
|
|
104
|
-
className={`memori-chat--feedback-menu-item${
|
|
105
|
-
active ? ' memori-chat--feedback-menu-item-active' : ''
|
|
106
|
-
}`}
|
|
107
|
-
onClick={() => {
|
|
108
|
-
if (clicked === 'down' && !!toggle) {
|
|
109
|
-
setClicked(undefined);
|
|
110
|
-
} else {
|
|
111
|
-
setClicked('down');
|
|
112
|
-
}
|
|
113
|
-
onNegativeClick(feedbackMsg);
|
|
114
|
-
}}
|
|
115
|
-
>
|
|
116
|
-
{feedbackMsgHelper}
|
|
117
|
-
</button>
|
|
118
|
-
)}
|
|
119
|
-
</Menu.Item>
|
|
120
|
-
</div>
|
|
121
|
-
</Menu.Items>
|
|
122
|
-
</Transition>
|
|
123
|
-
</Menu>
|
|
124
|
-
) : (
|
|
125
|
-
<Tooltip align="left" content="Feedback">
|
|
126
|
-
<Button
|
|
127
|
-
title="Feedback"
|
|
128
|
-
onClick={() => {
|
|
129
|
-
if (clicked === 'down' && !!toggle) {
|
|
130
|
-
setClicked(undefined);
|
|
131
|
-
} else {
|
|
132
|
-
setClicked('down');
|
|
133
|
-
}
|
|
134
|
-
onNegativeClick(feedbackMsg);
|
|
135
|
-
}}
|
|
136
|
-
ghost
|
|
137
|
-
shape="circle"
|
|
138
|
-
icon={
|
|
139
|
-
<Feedback
|
|
140
|
-
className={
|
|
141
|
-
clicked ? 'memori-chat--feedback-clicked' : undefined
|
|
142
|
-
}
|
|
143
|
-
/>
|
|
144
|
-
}
|
|
145
|
-
/>
|
|
146
|
-
</Tooltip>
|
|
147
|
-
)}
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export default FeedbackButtons;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders FeedbackButtons unchanged 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="memori-chat--feedback"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
class="memori-tooltip memori-tooltip--align-left"
|
|
10
|
-
>
|
|
11
|
-
<div
|
|
12
|
-
class="memori-tooltip--trigger"
|
|
13
|
-
>
|
|
14
|
-
<button
|
|
15
|
-
class="memori-button memori-button--ghost memori-button--circle memori-button--padded memori-button--icon-only"
|
|
16
|
-
title="Feedback"
|
|
17
|
-
>
|
|
18
|
-
<span
|
|
19
|
-
class="memori-button--icon"
|
|
20
|
-
>
|
|
21
|
-
<svg
|
|
22
|
-
aria-hidden="true"
|
|
23
|
-
focusable="false"
|
|
24
|
-
role="img"
|
|
25
|
-
viewBox="0 0 24 24"
|
|
26
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
-
>
|
|
28
|
-
<path
|
|
29
|
-
d="M0 0h24v24H0V0z"
|
|
30
|
-
fill="none"
|
|
31
|
-
/>
|
|
32
|
-
<path
|
|
33
|
-
d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"
|
|
34
|
-
/>
|
|
35
|
-
</svg>
|
|
36
|
-
</span>
|
|
37
|
-
</button>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
`;
|