@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,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import ChatTextArea, { Props } from './ChatTextArea';
|
|
4
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
5
|
-
import './ChatTextArea.css';
|
|
6
|
-
|
|
7
|
-
const meta: Meta = {
|
|
8
|
-
title: 'Widget/Chat textarea',
|
|
9
|
-
component: ChatTextArea,
|
|
10
|
-
argTypes: {
|
|
11
|
-
disabled: {
|
|
12
|
-
control: {
|
|
13
|
-
type: 'boolean',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
parameters: {
|
|
18
|
-
controls: { expanded: true },
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
const Template: Story<Props> = args => {
|
|
25
|
-
const [userMessage, setUserMessage] = React.useState(args.value);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<I18nWrapper>
|
|
29
|
-
<div style={{ paddingTop: '10rem' }}>
|
|
30
|
-
<ChatTextArea {...args} value={userMessage} onChange={setUserMessage} />
|
|
31
|
-
</div>
|
|
32
|
-
</I18nWrapper>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
37
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
38
|
-
export const Default = Template.bind({});
|
|
39
|
-
Default.args = {
|
|
40
|
-
value: '',
|
|
41
|
-
onChange: () => {},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const WithValue = Template.bind({});
|
|
45
|
-
WithValue.args = {
|
|
46
|
-
value: 'Suspendisse sit amet volutpat velit.',
|
|
47
|
-
onChange: () => {},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const WithLongText = Template.bind({});
|
|
51
|
-
WithLongText.args = {
|
|
52
|
-
value:
|
|
53
|
-
'Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur. Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur.',
|
|
54
|
-
onChange: () => {},
|
|
55
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, fireEvent, screen } from '@testing-library/react';
|
|
3
|
-
import ChatTextArea from './ChatTextArea';
|
|
4
|
-
|
|
5
|
-
it('renders ChatTextArea unchanged', () => {
|
|
6
|
-
const { container } = render(<ChatTextArea value="" onChange={jest.fn()} />);
|
|
7
|
-
expect(container).toMatchSnapshot();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('renders ChatTextArea with value unchanged', () => {
|
|
11
|
-
const { container } = render(
|
|
12
|
-
<ChatTextArea
|
|
13
|
-
value="Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."
|
|
14
|
-
onChange={jest.fn()}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
expect(container).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('renders ChatTextArea with long text unchanged', () => {
|
|
21
|
-
const { container } = render(
|
|
22
|
-
<ChatTextArea
|
|
23
|
-
value="Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur. Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur."
|
|
24
|
-
onChange={jest.fn()}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
expect(container).toMatchSnapshot();
|
|
28
|
-
});
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import cx from 'classnames';
|
|
3
|
-
import Button from '../ui/Button';
|
|
4
|
-
import Expand from '../icons/Expand';
|
|
5
|
-
import FullscreenExit from '../icons/FullscreenExit';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { isMobileOrTablet } from '../../helpers/utils';
|
|
8
|
-
|
|
9
|
-
export interface Props {
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
value: string;
|
|
12
|
-
onChange: (value: string) => void;
|
|
13
|
-
onPressEnter?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
14
|
-
onPaste?: (e: React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
15
|
-
onFocus?: (e: React.FocusEvent) => void;
|
|
16
|
-
onBlur?: (e: React.FocusEvent) => void;
|
|
17
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
18
|
-
/** When set, shows a character counter (e.g. "0 / 500") above the textarea and enforces the max length. */
|
|
19
|
-
maxTextareaCharacters?: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const ChatTextArea: React.FC<Props> = ({
|
|
23
|
-
disabled = false,
|
|
24
|
-
value,
|
|
25
|
-
onChange,
|
|
26
|
-
onPressEnter,
|
|
27
|
-
onPaste,
|
|
28
|
-
onFocus,
|
|
29
|
-
onBlur,
|
|
30
|
-
onExpandedChange,
|
|
31
|
-
maxTextareaCharacters,
|
|
32
|
-
}) => {
|
|
33
|
-
const { t } = useTranslation();
|
|
34
|
-
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
35
|
-
const innerRef = useRef<HTMLDivElement>(null);
|
|
36
|
-
const MIN_HEIGHT = 36;
|
|
37
|
-
const MAX_HEIGHT = 208;
|
|
38
|
-
|
|
39
|
-
// Auto-expand textarea based on content (only when not manually expanded)
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
const textarea = textareaRef.current;
|
|
42
|
-
const inner = innerRef.current;
|
|
43
|
-
|
|
44
|
-
if (textarea && inner) {
|
|
45
|
-
if (value.length === 0) {
|
|
46
|
-
textarea.style.height = `${MIN_HEIGHT}px`;
|
|
47
|
-
inner.style.height = `${MIN_HEIGHT}px`;
|
|
48
|
-
if (onExpandedChange) {
|
|
49
|
-
onExpandedChange(false);
|
|
50
|
-
}
|
|
51
|
-
//reset the padding bottom of the chat
|
|
52
|
-
const chat = document.getElementsByClassName('memori-chat--content');
|
|
53
|
-
if (chat) {
|
|
54
|
-
const lastChild = chat[chat.length - 1];
|
|
55
|
-
if (lastChild) {
|
|
56
|
-
(lastChild as HTMLElement).style.paddingBottom = '0px';
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
} else {
|
|
60
|
-
textarea.style.height = 'auto';
|
|
61
|
-
const scrollHeight = textarea.scrollHeight;
|
|
62
|
-
const newHeight = Math.min(Math.max(scrollHeight, MIN_HEIGHT), MAX_HEIGHT);
|
|
63
|
-
textarea.style.height = `${newHeight}px`;
|
|
64
|
-
inner.style.height = `${newHeight}px`;
|
|
65
|
-
|
|
66
|
-
//set the padding bottom to the chat in order to keep the whole chat visible
|
|
67
|
-
// take last child of chat wrapper and set the padding bottom to the height of the textarea
|
|
68
|
-
const chat = document.getElementsByClassName('memori-chat--content');
|
|
69
|
-
if (chat) {
|
|
70
|
-
const lastChild = chat[chat.length - 1];
|
|
71
|
-
if (lastChild) {
|
|
72
|
-
// (lastChild as HTMLElement).style.paddingBottom = `${newHeight}px`;
|
|
73
|
-
//then scroll to the bottom of the chat
|
|
74
|
-
(chat[0] as HTMLElement).scrollTo({
|
|
75
|
-
top: (chat[0] as HTMLElement).scrollHeight,
|
|
76
|
-
behavior: 'smooth'
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}, [value]);
|
|
83
|
-
|
|
84
|
-
const displayValue =
|
|
85
|
-
maxTextareaCharacters != null
|
|
86
|
-
? value.slice(0, maxTextareaCharacters)
|
|
87
|
-
: value;
|
|
88
|
-
|
|
89
|
-
// Keep parent state in sync when value exceeds limit (e.g. paste or prop change)
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
if (
|
|
92
|
-
maxTextareaCharacters != null &&
|
|
93
|
-
value.length > maxTextareaCharacters
|
|
94
|
-
) {
|
|
95
|
-
onChange(value.slice(0, maxTextareaCharacters));
|
|
96
|
-
}
|
|
97
|
-
}, [maxTextareaCharacters, value, onChange]);
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<div
|
|
101
|
-
data-testid="chat-textarea"
|
|
102
|
-
className={cx('memori-chat-textarea', {
|
|
103
|
-
'memori-chat-textarea--disabled': disabled,
|
|
104
|
-
'memori-chat-textarea--with-counter': maxTextareaCharacters != null,
|
|
105
|
-
})}
|
|
106
|
-
>
|
|
107
|
-
{maxTextareaCharacters != null && (
|
|
108
|
-
<div className="memori-chat-textarea--counter" aria-live="polite">
|
|
109
|
-
{displayValue.length} / {maxTextareaCharacters}
|
|
110
|
-
</div>
|
|
111
|
-
)}
|
|
112
|
-
<div ref={innerRef} className="memori-chat-textarea--inner">
|
|
113
|
-
<textarea
|
|
114
|
-
ref={textareaRef}
|
|
115
|
-
className="memori-chat-textarea--input"
|
|
116
|
-
disabled={disabled}
|
|
117
|
-
value={displayValue}
|
|
118
|
-
placeholder={t('placeholder', 'Ask a question') || 'Ask a question'}
|
|
119
|
-
onChange={e => {
|
|
120
|
-
const next = e.target.value;
|
|
121
|
-
if (maxTextareaCharacters != null) {
|
|
122
|
-
onChange(next.slice(0, maxTextareaCharacters));
|
|
123
|
-
} else {
|
|
124
|
-
onChange(next);
|
|
125
|
-
}
|
|
126
|
-
}}
|
|
127
|
-
onKeyDownCapture={e => {
|
|
128
|
-
// On mobile/tablet only: Enter creates a new line instead of sending.
|
|
129
|
-
// Touch laptops (e.g. Surface) keep desktop behavior: Enter = send, Alt/Shift+Enter = new line.
|
|
130
|
-
const isMobile = isMobileOrTablet();
|
|
131
|
-
// Alt/Option+Enter should always create a newline (do not send).
|
|
132
|
-
// We insert it manually because this is a controlled textarea and
|
|
133
|
-
// some browser/keyboard combos won't trigger an input event as expected.
|
|
134
|
-
if (e.key === 'Enter' && e.altKey && !e.shiftKey && !isMobile) {
|
|
135
|
-
e.preventDefault();
|
|
136
|
-
|
|
137
|
-
const el = textareaRef.current;
|
|
138
|
-
const start = el?.selectionStart ?? displayValue.length;
|
|
139
|
-
const end = el?.selectionEnd ?? displayValue.length;
|
|
140
|
-
let nextValue = `${displayValue.slice(0, start)}\n${displayValue.slice(end)}`;
|
|
141
|
-
if (maxTextareaCharacters != null) {
|
|
142
|
-
nextValue = nextValue.slice(0, maxTextareaCharacters);
|
|
143
|
-
}
|
|
144
|
-
onChange(nextValue);
|
|
145
|
-
|
|
146
|
-
// Restore caret right after the inserted newline
|
|
147
|
-
requestAnimationFrame(() => {
|
|
148
|
-
if (!el) return;
|
|
149
|
-
const caret = start + 1;
|
|
150
|
-
el.selectionStart = caret;
|
|
151
|
-
el.selectionEnd = caret;
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (e.key === 'Enter' && !e.shiftKey && onPressEnter && !isMobile) {
|
|
158
|
-
onPressEnter(e);
|
|
159
|
-
}
|
|
160
|
-
}}
|
|
161
|
-
onPaste={onPaste}
|
|
162
|
-
onFocus={onFocus}
|
|
163
|
-
onBlur={onBlur}
|
|
164
|
-
maxLength={maxTextareaCharacters ?? 100000}
|
|
165
|
-
/>
|
|
166
|
-
</div>
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export default ChatTextArea;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders ChatTextArea unchanged 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="memori-chat-textarea"
|
|
7
|
-
data-testid="chat-textarea"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
class="memori-chat-textarea--inner"
|
|
11
|
-
style="height: 36px;"
|
|
12
|
-
>
|
|
13
|
-
<textarea
|
|
14
|
-
class="memori-chat-textarea--input"
|
|
15
|
-
maxlength="100000"
|
|
16
|
-
placeholder="placeholder"
|
|
17
|
-
style="height: 36px;"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
exports[`renders ChatTextArea with long text unchanged 1`] = `
|
|
25
|
-
<div>
|
|
26
|
-
<div
|
|
27
|
-
class="memori-chat-textarea"
|
|
28
|
-
data-testid="chat-textarea"
|
|
29
|
-
>
|
|
30
|
-
<div
|
|
31
|
-
class="memori-chat-textarea--inner"
|
|
32
|
-
style="height: 36px;"
|
|
33
|
-
>
|
|
34
|
-
<textarea
|
|
35
|
-
class="memori-chat-textarea--input"
|
|
36
|
-
maxlength="100000"
|
|
37
|
-
placeholder="placeholder"
|
|
38
|
-
style="height: 36px;"
|
|
39
|
-
>
|
|
40
|
-
Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur. Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur.
|
|
41
|
-
</textarea>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
exports[`renders ChatTextArea with value unchanged 1`] = `
|
|
48
|
-
<div>
|
|
49
|
-
<div
|
|
50
|
-
class="memori-chat-textarea"
|
|
51
|
-
data-testid="chat-textarea"
|
|
52
|
-
>
|
|
53
|
-
<div
|
|
54
|
-
class="memori-chat-textarea--inner"
|
|
55
|
-
style="height: 36px;"
|
|
56
|
-
>
|
|
57
|
-
<textarea
|
|
58
|
-
class="memori-chat-textarea--input"
|
|
59
|
-
maxlength="100000"
|
|
60
|
-
placeholder="placeholder"
|
|
61
|
-
style="height: 36px;"
|
|
62
|
-
>
|
|
63
|
-
Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.
|
|
64
|
-
</textarea>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
`;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.memori--completion-provider-status--icon {
|
|
2
|
-
width: 24px;
|
|
3
|
-
height: 24px;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
font-size: 16px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.memori--completion-provider-status--loading {
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.memori--completion-provider-status--icon-error {
|
|
15
|
-
color: #f5222d;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.memori--completion-provider-status--icon-warning {
|
|
19
|
-
color: #faad14;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.memori--completion-provider-status--icon-info {
|
|
23
|
-
color: #1890ff;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.memori--completion-provider-status--tooltip {
|
|
27
|
-
max-width: 300px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.memori--completion-provider-status--tooltip p {
|
|
31
|
-
margin-bottom: 8px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.memori--completion-provider-status--tooltip p:last-child {
|
|
35
|
-
margin-bottom: 0;
|
|
36
|
-
}
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import CompletionProviderStatus, { Props } from './CompletionProviderStatus';
|
|
4
|
-
import './CompletionProviderStatus.css';
|
|
5
|
-
|
|
6
|
-
// Import the actual component for the live examples
|
|
7
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
8
|
-
|
|
9
|
-
// Create a mock I18n provider instead of trying to replace useTranslation
|
|
10
|
-
const MockI18nProvider = ({ children }: { children: React.ReactNode }) => {
|
|
11
|
-
// We'll create a wrapper component that provides the translation context
|
|
12
|
-
return <div className="mock-i18n-wrapper">{children}</div>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// Mock wrapper that also provides example tooltips
|
|
16
|
-
const MockI18nWrapper = ({ children, status }: { children: React.ReactNode, status?: string }) => {
|
|
17
|
-
return (
|
|
18
|
-
<MockI18nProvider>
|
|
19
|
-
<div className="mock-tooltip">
|
|
20
|
-
{children}
|
|
21
|
-
{status && (
|
|
22
|
-
<div className="mock-tooltip-content" style={{
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
left: '50px',
|
|
25
|
-
top: '0',
|
|
26
|
-
backgroundColor: '#fff',
|
|
27
|
-
border: '1px solid #eee',
|
|
28
|
-
borderRadius: '5px',
|
|
29
|
-
padding: '10px',
|
|
30
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
31
|
-
zIndex: 10,
|
|
32
|
-
width: '300px'
|
|
33
|
-
}}>
|
|
34
|
-
<p>{getStatusMessage(status)}</p>
|
|
35
|
-
<p><a href="#" onClick={(e) => e.preventDefault()}>Check the status page for updates</a></p>
|
|
36
|
-
</div>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
</MockI18nProvider>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// Helper function to get status messages
|
|
44
|
-
const getStatusMessage = (status: string): string => {
|
|
45
|
-
switch (status) {
|
|
46
|
-
case 'major_outage':
|
|
47
|
-
return 'Mistral service is completely down. Please try again later.';
|
|
48
|
-
case 'partial_outage':
|
|
49
|
-
return 'Anthropic service is experiencing significant disruptions.';
|
|
50
|
-
case 'degraded_performance':
|
|
51
|
-
return 'OpenAI service is responding slower than usual.';
|
|
52
|
-
default:
|
|
53
|
-
return 'The service is currently experiencing issues.';
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const meta: Meta = {
|
|
58
|
-
title: 'Completion Provider Status',
|
|
59
|
-
component: CompletionProviderStatus as React.ComponentType<any>,
|
|
60
|
-
parameters: {
|
|
61
|
-
layout: 'centered',
|
|
62
|
-
controls: { expanded: true },
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Add real examples of the component for reference
|
|
67
|
-
export const LiveExample_OpenAI_DegradedPerformance = () => (
|
|
68
|
-
<I18nWrapper>
|
|
69
|
-
<div style={{ padding: '20px' }}>
|
|
70
|
-
<h3>Live Component - OpenAI with Degraded Performance</h3>
|
|
71
|
-
<p>This is how the actual component will appear:</p>
|
|
72
|
-
<CompletionProviderStatus
|
|
73
|
-
forceStatus="degraded_performance"
|
|
74
|
-
provider="OpenAI"
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
</I18nWrapper>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
export const LiveExample_Anthropic_PartialOutage = () => (
|
|
81
|
-
<I18nWrapper>
|
|
82
|
-
<div style={{ padding: '20px' }}>
|
|
83
|
-
<h3>Live Component - Anthropic with Partial Outage</h3>
|
|
84
|
-
<p>This is how the actual component will appear:</p>
|
|
85
|
-
<CompletionProviderStatus
|
|
86
|
-
forceStatus="partial_outage"
|
|
87
|
-
provider="Anthropic"
|
|
88
|
-
/>
|
|
89
|
-
</div>
|
|
90
|
-
</I18nWrapper>
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
export const LiveExample_Mistral_MajorOutage = () => (
|
|
94
|
-
<I18nWrapper>
|
|
95
|
-
<div style={{ padding: '20px' }}>
|
|
96
|
-
<h3>Live Component - Mistral with Major Outage</h3>
|
|
97
|
-
<p>This is how the actual component will appear:</p>
|
|
98
|
-
<CompletionProviderStatus
|
|
99
|
-
forceStatus="major_outage"
|
|
100
|
-
provider="Mistral"
|
|
101
|
-
/>
|
|
102
|
-
</div>
|
|
103
|
-
</I18nWrapper>
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
export default meta;
|
|
107
|
-
|
|
108
|
-
// Status container to add some context around the icon
|
|
109
|
-
const StatusContainer = ({ status, children }: { status: string, children: React.ReactNode }) => (
|
|
110
|
-
<div style={{
|
|
111
|
-
padding: '20px',
|
|
112
|
-
border: '1px solid #eee',
|
|
113
|
-
borderRadius: '5px',
|
|
114
|
-
margin: '10px 0',
|
|
115
|
-
width: '500px'
|
|
116
|
-
}}>
|
|
117
|
-
<h3>{status}</h3>
|
|
118
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
|
119
|
-
<div>{children}</div>
|
|
120
|
-
<div style={{ fontSize: '14px', color: '#888' }}>← Hover to see message</div>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
// Stories for each status type - we'll create visual examples instead of using the component
|
|
126
|
-
export const AllStatusTypes = () => (
|
|
127
|
-
<div>
|
|
128
|
-
<h2>Status Alert Types</h2>
|
|
129
|
-
<p>Each alert has a different icon and color based on severity.</p>
|
|
130
|
-
|
|
131
|
-
<StatusContainer status="Degraded Performance (Blue Info Icon)">
|
|
132
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
133
|
-
<div style={{
|
|
134
|
-
color: '#1890ff',
|
|
135
|
-
width: '24px',
|
|
136
|
-
height: '24px',
|
|
137
|
-
display: 'flex',
|
|
138
|
-
alignItems: 'center',
|
|
139
|
-
justifyContent: 'center',
|
|
140
|
-
border: '1px solid #e8e8e8',
|
|
141
|
-
borderRadius: '50%',
|
|
142
|
-
backgroundColor: '#f0f5ff'
|
|
143
|
-
}}>
|
|
144
|
-
i
|
|
145
|
-
</div>
|
|
146
|
-
<div style={{ marginLeft: '10px' }}>
|
|
147
|
-
"OpenAI service is responding slower than usual."
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</StatusContainer>
|
|
151
|
-
|
|
152
|
-
<StatusContainer status="Partial Outage (Yellow Warning Icon)">
|
|
153
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
154
|
-
<div style={{
|
|
155
|
-
color: '#faad14',
|
|
156
|
-
width: '24px',
|
|
157
|
-
height: '24px',
|
|
158
|
-
display: 'flex',
|
|
159
|
-
alignItems: 'center',
|
|
160
|
-
justifyContent: 'center',
|
|
161
|
-
border: '1px solid #e8e8e8',
|
|
162
|
-
borderRadius: '50%',
|
|
163
|
-
backgroundColor: '#fffbe6'
|
|
164
|
-
}}>
|
|
165
|
-
⚠️
|
|
166
|
-
</div>
|
|
167
|
-
<div style={{ marginLeft: '10px' }}>
|
|
168
|
-
"Anthropic service is experiencing significant disruptions."
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
</StatusContainer>
|
|
172
|
-
|
|
173
|
-
<StatusContainer status="Major Outage (Red Alert Icon)">
|
|
174
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
175
|
-
<div style={{
|
|
176
|
-
color: '#f5222d',
|
|
177
|
-
width: '24px',
|
|
178
|
-
height: '24px',
|
|
179
|
-
display: 'flex',
|
|
180
|
-
alignItems: 'center',
|
|
181
|
-
justifyContent: 'center',
|
|
182
|
-
border: '1px solid #e8e8e8',
|
|
183
|
-
borderRadius: '50%',
|
|
184
|
-
backgroundColor: '#fff1f0'
|
|
185
|
-
}}>
|
|
186
|
-
⚠️
|
|
187
|
-
</div>
|
|
188
|
-
<div style={{ marginLeft: '10px' }}>
|
|
189
|
-
"Mistral service is completely down. Please try again later."
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</StatusContainer>
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
// Individual stories for each status using visual examples
|
|
197
|
-
export const DegradedPerformance = () => (
|
|
198
|
-
<StatusContainer status="Degraded Performance (Blue Info Icon)">
|
|
199
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
200
|
-
<div style={{
|
|
201
|
-
color: '#1890ff',
|
|
202
|
-
width: '24px',
|
|
203
|
-
height: '24px',
|
|
204
|
-
display: 'flex',
|
|
205
|
-
alignItems: 'center',
|
|
206
|
-
justifyContent: 'center',
|
|
207
|
-
border: '1px solid #e8e8e8',
|
|
208
|
-
borderRadius: '50%',
|
|
209
|
-
backgroundColor: '#f0f5ff'
|
|
210
|
-
}}>
|
|
211
|
-
i
|
|
212
|
-
</div>
|
|
213
|
-
<div style={{ marginLeft: '10px' }}>
|
|
214
|
-
"OpenAI service is responding slower than usual."
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
</StatusContainer>
|
|
218
|
-
);
|
|
219
|
-
|
|
220
|
-
export const PartialOutage = () => (
|
|
221
|
-
<StatusContainer status="Partial Outage (Yellow Warning Icon)">
|
|
222
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
223
|
-
<div style={{
|
|
224
|
-
color: '#faad14',
|
|
225
|
-
width: '24px',
|
|
226
|
-
height: '24px',
|
|
227
|
-
display: 'flex',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
justifyContent: 'center',
|
|
230
|
-
border: '1px solid #e8e8e8',
|
|
231
|
-
borderRadius: '50%',
|
|
232
|
-
backgroundColor: '#fffbe6'
|
|
233
|
-
}}>
|
|
234
|
-
⚠️
|
|
235
|
-
</div>
|
|
236
|
-
<div style={{ marginLeft: '10px' }}>
|
|
237
|
-
"Anthropic service is experiencing significant disruptions."
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
</StatusContainer>
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
export const MajorOutage = () => (
|
|
244
|
-
<StatusContainer status="Major Outage (Red Alert Icon)">
|
|
245
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
246
|
-
<div style={{
|
|
247
|
-
color: '#f5222d',
|
|
248
|
-
width: '24px',
|
|
249
|
-
height: '24px',
|
|
250
|
-
display: 'flex',
|
|
251
|
-
alignItems: 'center',
|
|
252
|
-
justifyContent: 'center',
|
|
253
|
-
border: '1px solid #e8e8e8',
|
|
254
|
-
borderRadius: '50%',
|
|
255
|
-
backgroundColor: '#fff1f0'
|
|
256
|
-
}}>
|
|
257
|
-
⚠️
|
|
258
|
-
</div>
|
|
259
|
-
<div style={{ marginLeft: '10px' }}>
|
|
260
|
-
"Mistral service is completely down. Please try again later."
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
</StatusContainer>
|
|
264
|
-
);
|
|
265
|
-
|
|
266
|
-
// All statuses for each provider
|
|
267
|
-
export const AllProvidersWithDifferentStatuses = () => (
|
|
268
|
-
<I18nWrapper>
|
|
269
|
-
<div>
|
|
270
|
-
<h2>Different Providers with Different Statuses</h2>
|
|
271
|
-
|
|
272
|
-
<div style={{
|
|
273
|
-
display: 'flex',
|
|
274
|
-
flexDirection: 'column',
|
|
275
|
-
gap: '20px',
|
|
276
|
-
padding: '20px',
|
|
277
|
-
border: '1px solid #eee',
|
|
278
|
-
borderRadius: '5px',
|
|
279
|
-
marginBottom: '20px'
|
|
280
|
-
}}>
|
|
281
|
-
<div>
|
|
282
|
-
<h3>OpenAI - Real-time status</h3>
|
|
283
|
-
<CompletionProviderStatus provider="OpenAI" />
|
|
284
|
-
</div>
|
|
285
|
-
<div>
|
|
286
|
-
<h3>Anthropic - Real-time status</h3>
|
|
287
|
-
<CompletionProviderStatus provider="Anthropic" />
|
|
288
|
-
</div>
|
|
289
|
-
<div>
|
|
290
|
-
<h3>Mistral - Real-time status</h3>
|
|
291
|
-
<CompletionProviderStatus provider="Mistral" />
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
</div>
|
|
295
|
-
</I18nWrapper>
|
|
296
|
-
);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import CompletionProviderStatus from './CompletionProviderStatus';
|
|
4
|
-
|
|
5
|
-
it('renders CompletionProviderStatus unchanged', () => {
|
|
6
|
-
const { container } = render(
|
|
7
|
-
<CompletionProviderStatus forceStatus="major_outage" />
|
|
8
|
-
);
|
|
9
|
-
expect(container).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it('renders CompletionProviderStatus errored unchanged', () => {
|
|
13
|
-
const { container } = render(
|
|
14
|
-
<CompletionProviderStatus forceStatus="major_outage" />
|
|
15
|
-
);
|
|
16
|
-
expect(container).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('renders CompletionProviderStatus with provider specified unchanged', () => {
|
|
20
|
-
const { container } = render(
|
|
21
|
-
<CompletionProviderStatus provider="OpenAI" forceStatus="operational" />
|
|
22
|
-
);
|
|
23
|
-
expect(container).toMatchSnapshot();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('renders CompletionProviderStatus errored with provider specified unchanged', () => {
|
|
27
|
-
const { container } = render(
|
|
28
|
-
<CompletionProviderStatus provider="OpenAI" forceStatus="major_outage" />
|
|
29
|
-
);
|
|
30
|
-
expect(container).toMatchSnapshot();
|
|
31
|
-
});
|