@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,544 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chat PDF Export Utilities
|
|
3
|
-
* Modular functions for exporting chat history to PDF with visual UI preservation
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { Message, Memori } from '@memori.ai/memori-api-client/dist/types';
|
|
7
|
-
import { renderMsg, stripAllInternalTags } from './message';
|
|
8
|
-
import { stripOutputTags } from './utils';
|
|
9
|
-
|
|
10
|
-
export interface ChatPDFOptions {
|
|
11
|
-
fontSize?: string;
|
|
12
|
-
fontFamily?: string;
|
|
13
|
-
lineHeight?: string;
|
|
14
|
-
color?: string;
|
|
15
|
-
backgroundColor?: string;
|
|
16
|
-
primaryColorRgb?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ChatPDFExportParams {
|
|
20
|
-
messages: Message[];
|
|
21
|
-
memori: Memori;
|
|
22
|
-
conversationStartedLabel: string;
|
|
23
|
-
language?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Generate PDF-optimized CSS for chat export
|
|
28
|
-
*/
|
|
29
|
-
export const generateChatPDFCSS = (options: ChatPDFOptions = {}): string => {
|
|
30
|
-
const {
|
|
31
|
-
fontSize = '12pt',
|
|
32
|
-
fontFamily = 'system-ui, -apple-system, sans-serif',
|
|
33
|
-
lineHeight = '1.6',
|
|
34
|
-
color = '#333',
|
|
35
|
-
backgroundColor = '#fff',
|
|
36
|
-
} = options;
|
|
37
|
-
|
|
38
|
-
const baseStyles = `
|
|
39
|
-
@page {
|
|
40
|
-
margin: 1in;
|
|
41
|
-
size: A4;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@media print {
|
|
45
|
-
* {
|
|
46
|
-
-webkit-print-color-adjust: exact !important;
|
|
47
|
-
color-adjust: exact !important;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
body {
|
|
51
|
-
font-family: ${fontFamily};
|
|
52
|
-
font-size: ${fontSize};
|
|
53
|
-
line-height: ${lineHeight};
|
|
54
|
-
color: ${color};
|
|
55
|
-
background-color: ${backgroundColor};
|
|
56
|
-
margin: 0;
|
|
57
|
-
padding: 0;
|
|
58
|
-
max-width: none;
|
|
59
|
-
word-wrap: break-word;
|
|
60
|
-
overflow-wrap: break-word;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
h1, h2, h3, h4, h5, h6 {
|
|
64
|
-
page-break-after: avoid;
|
|
65
|
-
margin-top: 1.5em;
|
|
66
|
-
margin-bottom: 0.5em;
|
|
67
|
-
font-weight: 600;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
h1 { font-size: 1.8em; }
|
|
71
|
-
h2 { font-size: 1.5em; }
|
|
72
|
-
h3 { font-size: 1.3em; }
|
|
73
|
-
|
|
74
|
-
p {
|
|
75
|
-
margin: 0 0 1em 0;
|
|
76
|
-
orphans: 3;
|
|
77
|
-
widows: 3;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
pre, code {
|
|
81
|
-
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
82
|
-
font-size: 0.9em;
|
|
83
|
-
background-color: #f5f5f5;
|
|
84
|
-
border: 1px solid #ddd;
|
|
85
|
-
border-radius: 3px;
|
|
86
|
-
padding: 0.2em 0.4em;
|
|
87
|
-
page-break-inside: avoid;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
pre {
|
|
91
|
-
padding: 1em;
|
|
92
|
-
overflow-x: auto;
|
|
93
|
-
white-space: pre;
|
|
94
|
-
margin: 1em 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
pre code {
|
|
98
|
-
background: none;
|
|
99
|
-
border: none;
|
|
100
|
-
padding: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
blockquote {
|
|
104
|
-
margin: 1em 0;
|
|
105
|
-
padding-left: 1em;
|
|
106
|
-
border-left: 3px solid #ddd;
|
|
107
|
-
font-style: italic;
|
|
108
|
-
page-break-inside: avoid;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
ul, ol {
|
|
112
|
-
margin: 1em 0;
|
|
113
|
-
padding-left: 2em;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
li {
|
|
117
|
-
margin: 0.25em 0;
|
|
118
|
-
page-break-inside: avoid;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
table {
|
|
122
|
-
border-collapse: collapse;
|
|
123
|
-
width: 100%;
|
|
124
|
-
margin: 1em 0;
|
|
125
|
-
page-break-inside: avoid;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
th, td {
|
|
129
|
-
border: 1px solid #ddd;
|
|
130
|
-
padding: 0.5em;
|
|
131
|
-
text-align: left;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
th {
|
|
135
|
-
background-color: #f5f5f5;
|
|
136
|
-
font-weight: 600;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
a {
|
|
140
|
-
color: #0066cc;
|
|
141
|
-
text-decoration: none;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
a:hover {
|
|
145
|
-
text-decoration: underline;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
img {
|
|
149
|
-
max-width: 100%;
|
|
150
|
-
height: auto;
|
|
151
|
-
page-break-inside: avoid;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
hr {
|
|
155
|
-
margin: 2em 0;
|
|
156
|
-
border: none;
|
|
157
|
-
border-top: 1px solid #ddd;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.page-break {
|
|
161
|
-
page-break-before: always;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.no-print {
|
|
165
|
-
display: none !important;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@media screen {
|
|
170
|
-
body {
|
|
171
|
-
font-family: ${fontFamily};
|
|
172
|
-
font-size: ${fontSize};
|
|
173
|
-
line-height: ${lineHeight};
|
|
174
|
-
color: ${color};
|
|
175
|
-
background-color: ${backgroundColor};
|
|
176
|
-
margin: 20px;
|
|
177
|
-
padding: 20px;
|
|
178
|
-
max-width: 800px;
|
|
179
|
-
margin: 0 auto;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
`;
|
|
183
|
-
|
|
184
|
-
const chatBubbleStyles = generateChatBubbleStyles(options.primaryColorRgb);
|
|
185
|
-
|
|
186
|
-
return `<style>${baseStyles}${chatBubbleStyles}</style>`;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Generate CSS styles for chat bubbles
|
|
191
|
-
*/
|
|
192
|
-
const generateChatBubbleStyles = (primaryColorRgb?: string): string => {
|
|
193
|
-
// Default fallback if not provided
|
|
194
|
-
const rgbValue = primaryColorRgb || '130, 70, 175';
|
|
195
|
-
|
|
196
|
-
return `
|
|
197
|
-
:root {
|
|
198
|
-
--memori-primary-rgb: ${rgbValue};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.chat-export-header {
|
|
202
|
-
margin-bottom: 2em;
|
|
203
|
-
padding-bottom: 1em;
|
|
204
|
-
border-bottom: 2px solid #e5e7eb;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.chat-export-date {
|
|
208
|
-
margin-top: 0.5em;
|
|
209
|
-
color: #6b7280;
|
|
210
|
-
font-size: 0.9em;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.chat-bubble-container {
|
|
214
|
-
display: flex;
|
|
215
|
-
align-items: flex-end;
|
|
216
|
-
margin-bottom: 1em;
|
|
217
|
-
page-break-inside: avoid;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.chat-bubble {
|
|
221
|
-
display: inline-flex;
|
|
222
|
-
max-width: 75%;
|
|
223
|
-
flex-direction: column;
|
|
224
|
-
padding: 10px 16px;
|
|
225
|
-
border-radius: 12px;
|
|
226
|
-
margin-bottom: 5px;
|
|
227
|
-
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.08);
|
|
228
|
-
font-size: 0.9em;
|
|
229
|
-
line-height: 1.5;
|
|
230
|
-
word-wrap: break-word;
|
|
231
|
-
overflow-wrap: break-word;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.chat-bubble-assistant {
|
|
235
|
-
border-radius: 12px 12px 12px 0;
|
|
236
|
-
margin-left: 0;
|
|
237
|
-
margin-right: auto;
|
|
238
|
-
background: #ffffff;
|
|
239
|
-
color: #141515;
|
|
240
|
-
border: 1px solid #e5e7eb;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.chat-bubble-user {
|
|
244
|
-
border-radius: 12px 12px 0 12px;
|
|
245
|
-
margin-left: auto;
|
|
246
|
-
margin-right: 0;
|
|
247
|
-
background: rgb(var(--memori-primary-rgb));
|
|
248
|
-
color: #ffffff;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.chat-bubble-content {
|
|
252
|
-
margin: 0;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.chat-bubble-content p {
|
|
256
|
-
margin: 0 0 0.5em 0;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.chat-bubble-content p:last-child {
|
|
260
|
-
margin-bottom: 0;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.chat-bubble-content ul,
|
|
264
|
-
.chat-bubble-content ol {
|
|
265
|
-
padding-left: 1.5em;
|
|
266
|
-
margin: 0.5em 0;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.chat-bubble-content a {
|
|
270
|
-
color: inherit;
|
|
271
|
-
text-decoration: underline;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.chat-bubble-user .chat-bubble-content a {
|
|
275
|
-
color: #ffffff;
|
|
276
|
-
text-decoration: underline;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.chat-bubble-assistant .chat-bubble-content a {
|
|
280
|
-
color:rgb(var(--memori-primary-rgb));
|
|
281
|
-
text-decoration: underline;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.chat-bubble-timestamp {
|
|
285
|
-
margin-top: 0.25em;
|
|
286
|
-
font-size: 0.75em;
|
|
287
|
-
opacity: 0.7;
|
|
288
|
-
text-align: right;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.chat-bubble-assistant .chat-bubble-timestamp {
|
|
292
|
-
text-align: left;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.chat-bubble-media {
|
|
296
|
-
margin: 0.5em 0 0 0;
|
|
297
|
-
padding-left: 1.5em;
|
|
298
|
-
list-style-type: disc;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.chat-bubble-media li {
|
|
302
|
-
margin: 0.25em 0;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.chat-bubble-content code {
|
|
306
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
307
|
-
padding: 0.2em 0.4em;
|
|
308
|
-
border-radius: 3px;
|
|
309
|
-
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
310
|
-
font-size: 0.9em;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.chat-bubble-user .chat-bubble-content code {
|
|
314
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.chat-bubble-content pre {
|
|
318
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
319
|
-
padding: 1em;
|
|
320
|
-
border-radius: 5px;
|
|
321
|
-
overflow-x: auto;
|
|
322
|
-
margin: 0.5em 0;
|
|
323
|
-
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.chat-bubble-user .chat-bubble-content pre {
|
|
327
|
-
background-color: rgba(255, 255, 255, 0.15);
|
|
328
|
-
border-color: rgba(255, 255, 255, 0.2);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.chat-bubble-content pre code {
|
|
332
|
-
background: none;
|
|
333
|
-
padding: 0;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.chat-bubble-content table {
|
|
337
|
-
width: 100%;
|
|
338
|
-
border-collapse: collapse;
|
|
339
|
-
margin: 0.5em 0;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.chat-bubble-content table th,
|
|
343
|
-
.chat-bubble-content table td {
|
|
344
|
-
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
345
|
-
padding: 0.5em;
|
|
346
|
-
text-align: left;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.chat-bubble-user .chat-bubble-content table th,
|
|
350
|
-
.chat-bubble-user .chat-bubble-content table td {
|
|
351
|
-
border-color: rgba(255, 255, 255, 0.2);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.chat-bubble-content table th {
|
|
355
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
356
|
-
font-weight: 600;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.chat-bubble-user .chat-bubble-content table th {
|
|
360
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.chat-bubble-content blockquote {
|
|
364
|
-
margin: 0.5em 0;
|
|
365
|
-
padding-left: 1em;
|
|
366
|
-
border-left: 3px solid rgba(0, 0, 0, 0.2);
|
|
367
|
-
font-style: italic;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.chat-bubble-user .chat-bubble-content blockquote {
|
|
371
|
-
border-left-color: rgba(255, 255, 255, 0.3);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.chat-bubble-content img {
|
|
375
|
-
max-width: 100%;
|
|
376
|
-
height: auto;
|
|
377
|
-
border-radius: 5px;
|
|
378
|
-
margin: 0.5em 0;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.chat-bubble-content h1,
|
|
382
|
-
.chat-bubble-content h2,
|
|
383
|
-
.chat-bubble-content h3,
|
|
384
|
-
.chat-bubble-content h4,
|
|
385
|
-
.chat-bubble-content h5,
|
|
386
|
-
.chat-bubble-content h6 {
|
|
387
|
-
margin: 0.5em 0 0.25em 0;
|
|
388
|
-
font-weight: 600;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.chat-bubble-content h1 { font-size: 1.5em; }
|
|
392
|
-
.chat-bubble-content h2 { font-size: 1.3em; }
|
|
393
|
-
.chat-bubble-content h3 { font-size: 1.1em; }
|
|
394
|
-
`;
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* Format a single message as a chat bubble HTML
|
|
399
|
-
*/
|
|
400
|
-
const formatMessageBubble = (
|
|
401
|
-
message: Message,
|
|
402
|
-
language: string = 'en'
|
|
403
|
-
): string => {
|
|
404
|
-
const timestamp = message.timestamp
|
|
405
|
-
? new Intl.DateTimeFormat(language, {
|
|
406
|
-
dateStyle: 'short',
|
|
407
|
-
timeStyle: 'short',
|
|
408
|
-
}).format(
|
|
409
|
-
new Date(
|
|
410
|
-
message.timestamp.endsWith('Z')
|
|
411
|
-
? message.timestamp
|
|
412
|
-
: `${message.timestamp}Z`
|
|
413
|
-
)
|
|
414
|
-
)
|
|
415
|
-
: '';
|
|
416
|
-
|
|
417
|
-
// Clean and render message text
|
|
418
|
-
const cleanText = stripAllInternalTags(message.text || '');
|
|
419
|
-
|
|
420
|
-
// Use renderMsg to convert markdown to HTML (same as ChatBubble does)
|
|
421
|
-
const { text: renderedText } = renderMsg(
|
|
422
|
-
cleanText,
|
|
423
|
-
false, // useMathFormatting
|
|
424
|
-
'Reasoning...', // reasoningText
|
|
425
|
-
false // showReasoning - hide reasoning in PDF
|
|
426
|
-
);
|
|
427
|
-
|
|
428
|
-
// For non-user messages, remove output tags but keep the rendered HTML
|
|
429
|
-
const messageText = message.fromUser
|
|
430
|
-
? renderedText
|
|
431
|
-
: stripOutputTags(renderedText);
|
|
432
|
-
|
|
433
|
-
// Format message as chat bubble
|
|
434
|
-
const bubbleClass = message.fromUser
|
|
435
|
-
? 'chat-bubble chat-bubble-user'
|
|
436
|
-
: 'chat-bubble chat-bubble-assistant';
|
|
437
|
-
|
|
438
|
-
let html = `<div class="chat-bubble-container">`;
|
|
439
|
-
html += `<div class="${bubbleClass}">`;
|
|
440
|
-
|
|
441
|
-
// Add message text
|
|
442
|
-
if (messageText.trim()) {
|
|
443
|
-
html += `<div class="chat-bubble-content">${messageText}</div>`;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
// Add media attachments if present
|
|
447
|
-
if (message.media && message.media.length > 0) {
|
|
448
|
-
html += `<ul class="chat-bubble-media">`;
|
|
449
|
-
message.media.forEach(media => {
|
|
450
|
-
if (media.title) {
|
|
451
|
-
html += `<li><a href="${media.url || '#'}">${media.title}</a></li>`;
|
|
452
|
-
} else if (media.url) {
|
|
453
|
-
html += `<li><a href="${media.url}">${media.url}</a></li>`;
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
html += `</ul>`;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// Add timestamp
|
|
460
|
-
if (timestamp) {
|
|
461
|
-
html += `<div class="chat-bubble-timestamp">${timestamp}</div>`;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
html += `</div>`;
|
|
465
|
-
html += `</div>`;
|
|
466
|
-
|
|
467
|
-
return html;
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Format chat history header
|
|
472
|
-
*/
|
|
473
|
-
const formatChatHeader = (
|
|
474
|
-
memoriName: string,
|
|
475
|
-
exportDate: string,
|
|
476
|
-
conversationStartedLabel: string
|
|
477
|
-
): string => {
|
|
478
|
-
return `
|
|
479
|
-
<div class="chat-export-header">
|
|
480
|
-
<h1>${memoriName} - Chat Export</h1>
|
|
481
|
-
<p class="chat-export-date">
|
|
482
|
-
<strong>${conversationStartedLabel}</strong>: ${exportDate}
|
|
483
|
-
</p>
|
|
484
|
-
</div>
|
|
485
|
-
`;
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* Format chat history into HTML for PDF export
|
|
490
|
-
*/
|
|
491
|
-
export const formatChatHistoryForPDF = (
|
|
492
|
-
params: ChatPDFExportParams
|
|
493
|
-
): string => {
|
|
494
|
-
const { messages, memori, conversationStartedLabel, language = 'en' } =
|
|
495
|
-
params;
|
|
496
|
-
|
|
497
|
-
if (!messages || messages.length === 0) {
|
|
498
|
-
return '';
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
const memoriName = memori?.name || 'Assistant';
|
|
502
|
-
const exportDate = new Intl.DateTimeFormat(language, {
|
|
503
|
-
dateStyle: 'long',
|
|
504
|
-
timeStyle: 'short',
|
|
505
|
-
}).format(new Date());
|
|
506
|
-
|
|
507
|
-
// Build HTML
|
|
508
|
-
let html = formatChatHeader(memoriName, exportDate, conversationStartedLabel);
|
|
509
|
-
|
|
510
|
-
// Add each message as a bubble
|
|
511
|
-
messages.forEach(message => {
|
|
512
|
-
html += formatMessageBubble(message, language);
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
return html;
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Create the complete HTML document for PDF export
|
|
520
|
-
*/
|
|
521
|
-
export const createChatPDFDocument = (
|
|
522
|
-
htmlContent: string,
|
|
523
|
-
title: string,
|
|
524
|
-
options: ChatPDFOptions = {}
|
|
525
|
-
): string => {
|
|
526
|
-
const css = generateChatPDFCSS(options);
|
|
527
|
-
|
|
528
|
-
return `
|
|
529
|
-
<!DOCTYPE html>
|
|
530
|
-
<html lang="en">
|
|
531
|
-
<head>
|
|
532
|
-
<meta charset="UTF-8">
|
|
533
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
534
|
-
<title>${title}</title>
|
|
535
|
-
${css}
|
|
536
|
-
</head>
|
|
537
|
-
<body>
|
|
538
|
-
<div class="content">
|
|
539
|
-
${htmlContent}
|
|
540
|
-
</div>
|
|
541
|
-
</body>
|
|
542
|
-
</html>
|
|
543
|
-
`;
|
|
544
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const keys: { [key: string]: string } = {
|
|
2
|
-
muteSpeaker: '@memori:muteSpeaker',
|
|
3
|
-
microphoneMode: '@memori:microphoneMode',
|
|
4
|
-
continuousSpeechTimeout: '@memori:continuousSpeechTimeout',
|
|
5
|
-
birthDate: '@memori:birthDate',
|
|
6
|
-
controlsPosition: '@memori:controlsPosition',
|
|
7
|
-
hideEmissions: '@memori:hideEmissions',
|
|
8
|
-
loginToken: '@memori:loginToken',
|
|
9
|
-
location: '@memori:location',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const getLocalConfig = <Type>(key: string, defaultValue: Type): Type => {
|
|
13
|
-
try {
|
|
14
|
-
const value = window.localStorage.getItem(keys[key] ?? key);
|
|
15
|
-
if (!value) return defaultValue;
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
return JSON.parse(value) as unknown as Type;
|
|
19
|
-
} catch {
|
|
20
|
-
return value as unknown as Type;
|
|
21
|
-
}
|
|
22
|
-
} catch (error) {
|
|
23
|
-
console.error('error', error);
|
|
24
|
-
return defaultValue;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const setLocalConfig = (key: string, value: any): void => {
|
|
29
|
-
try {
|
|
30
|
-
window.localStorage.setItem(keys[key] ?? key, value.toString());
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error('error', error);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const removeLocalConfig = (key: string): void => {
|
|
37
|
-
try {
|
|
38
|
-
window.localStorage.removeItem(keys[key] ?? key);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error('error', error);
|
|
41
|
-
}
|
|
42
|
-
};
|