@memori.ai/memori-react 8.45.2 → 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 +20 -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 +39 -0
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +66 -0
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -0
- package/dist/components/DrawerFooter/DrawerFooter.d.ts +12 -0
- package/dist/components/DrawerFooter/DrawerFooter.js +10 -0
- package/dist/components/DrawerFooter/DrawerFooter.js.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts +9 -0
- package/dist/components/IconButton/IconButton.js +36 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- 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/MobileSessionPanel/MobileSessionPanel.d.ts +65 -0
- package/dist/components/MobileSessionPanel/MobileSessionPanel.js +294 -0
- package/dist/components/MobileSessionPanel/MobileSessionPanel.js.map +1 -0
- package/dist/components/PositionPopover/PositionPopover.d.ts +22 -0
- package/dist/components/PositionPopover/PositionPopover.js +208 -0
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -0
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.d.ts +4 -0
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +64 -0
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -0
- package/dist/components/layouts/chat.css +27 -4
- package/dist/context/widgetSurfaceContext.d.ts +3 -0
- package/dist/context/widgetSurfaceContext.js +11 -0
- package/dist/context/widgetSurfaceContext.js.map +1 -0
- package/dist/helpers/positionPopover.d.ts +2 -0
- package/dist/helpers/positionPopover.js +16 -0
- package/dist/helpers/positionPopover.js.map +1 -0
- package/dist/helpers/tts/muteSpeaker.d.ts +13 -0
- package/dist/helpers/tts/muteSpeaker.js +27 -0
- package/dist/helpers/tts/muteSpeaker.js.map +1 -0
- package/dist/helpers/usePressTooltip.d.ts +13 -0
- package/dist/helpers/usePressTooltip.js +24 -0
- package/dist/helpers/usePressTooltip.js.map +1 -0
- package/dist/icons/FacebookIcon.d.ts +3 -0
- package/dist/icons/FacebookIcon.js +6 -0
- package/dist/icons/FacebookIcon.js.map +1 -0
- package/dist/icons/LinkedinIcon.d.ts +3 -0
- package/dist/icons/LinkedinIcon.js +6 -0
- package/dist/icons/LinkedinIcon.js.map +1 -0
- package/dist/icons/MemoriIcon.d.ts +3 -0
- package/dist/icons/MemoriIcon.js +8 -0
- package/dist/icons/MemoriIcon.js.map +1 -0
- package/dist/icons/TelegramIcon.d.ts +3 -0
- package/dist/icons/TelegramIcon.js +6 -0
- package/dist/icons/TelegramIcon.js.map +1 -0
- package/dist/icons/TwitterIcon.d.ts +3 -0
- package/dist/icons/TwitterIcon.js +6 -0
- package/dist/icons/TwitterIcon.js.map +1 -0
- package/dist/icons/WhatsappIcon.d.ts +3 -0
- package/dist/icons/WhatsappIcon.js +6 -0
- package/dist/icons/WhatsappIcon.js.map +1 -0
- package/dist/icons/artifacts/DocumentIcon.d.ts +3 -0
- package/dist/icons/artifacts/DocumentIcon.js +6 -0
- package/dist/icons/artifacts/DocumentIcon.js.map +1 -0
- package/dist/icons/artifacts/HtmlIcon.d.ts +3 -0
- package/dist/icons/artifacts/HtmlIcon.js +6 -0
- package/dist/icons/artifacts/HtmlIcon.js.map +1 -0
- package/dist/icons/artifacts/JavascriptIcon.d.ts +3 -0
- package/dist/icons/artifacts/JavascriptIcon.js +6 -0
- package/dist/icons/artifacts/JavascriptIcon.js.map +1 -0
- package/dist/icons/artifacts/MarkdownIcon.d.ts +3 -0
- package/dist/icons/artifacts/MarkdownIcon.js +6 -0
- package/dist/icons/artifacts/MarkdownIcon.js.map +1 -0
- package/dist/icons/artifacts/PythonIcon.d.ts +3 -0
- package/dist/icons/artifacts/PythonIcon.js +6 -0
- package/dist/icons/artifacts/PythonIcon.js.map +1 -0
- package/dist/icons/artifacts/SvgIcon.d.ts +3 -0
- package/dist/icons/artifacts/SvgIcon.js +6 -0
- package/dist/icons/artifacts/SvgIcon.js.map +1 -0
- package/dist/icons/artifacts/XmlIcon.d.ts +3 -0
- package/dist/icons/artifacts/XmlIcon.js +6 -0
- package/dist/icons/artifacts/XmlIcon.js.map +1 -0
- package/dist/icons/artifacts/cssIcon.d.ts +3 -0
- package/dist/icons/artifacts/cssIcon.js +6 -0
- package/dist/icons/artifacts/cssIcon.js.map +1 -0
- 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/layouts/chat.css +27 -4
- 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/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 -688
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +0 -421
- 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 -268
- 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 -331
- package/src/helpers/utils.ts +0 -591
- 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,423 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
|
-
import MediaItemWidget, { Props } from './MediaItemWidget';
|
|
5
|
-
|
|
6
|
-
import './MediaItemWidget.css';
|
|
7
|
-
|
|
8
|
-
const meta: Meta = {
|
|
9
|
-
title: 'Media Widget/Media',
|
|
10
|
-
component: MediaItemWidget,
|
|
11
|
-
argTypes: {
|
|
12
|
-
translateTo: {
|
|
13
|
-
control: {
|
|
14
|
-
type: 'select',
|
|
15
|
-
items: ['IT', 'EN', 'DE', 'FR', 'ES', 'PT', 'RU', 'ZH'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
parameters: {
|
|
20
|
-
controls: { expanded: true },
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
|
|
26
|
-
const Template: Story<Props> = args => (
|
|
27
|
-
<I18nWrapper>
|
|
28
|
-
<MediaItemWidget {...args} />
|
|
29
|
-
</I18nWrapper>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
33
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
34
|
-
export const Default = Template.bind({});
|
|
35
|
-
Default.args = {
|
|
36
|
-
items: [
|
|
37
|
-
{
|
|
38
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5971',
|
|
39
|
-
mimeType: 'text/javascript',
|
|
40
|
-
title: 'Snippet',
|
|
41
|
-
content: "console.log('Hello World!');",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5972',
|
|
45
|
-
mimeType: 'image/png',
|
|
46
|
-
title: 'Image',
|
|
47
|
-
url: 'https://picsum.photos/200/300',
|
|
48
|
-
content: 'https://picsum.photos/200/300',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5973',
|
|
52
|
-
mimeType: 'application/pdf',
|
|
53
|
-
title: 'PDF',
|
|
54
|
-
url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
55
|
-
content:
|
|
56
|
-
'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5974',
|
|
60
|
-
mimeType: 'video/mp4',
|
|
61
|
-
title: 'Video',
|
|
62
|
-
url: 'https://www.w3schools.com/html/mov_bbb.mp4',
|
|
63
|
-
content: 'https://www.w3schools.com/html/mov_bbb.mp4',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5975',
|
|
67
|
-
mimeType: 'audio/mpeg',
|
|
68
|
-
title: 'Audio',
|
|
69
|
-
url: 'https://www.w3schools.com/html/horse.mp3',
|
|
70
|
-
content: 'https://www.w3schools.com/html/horse.mp3',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5976',
|
|
74
|
-
mimeType: 'application/msword',
|
|
75
|
-
title: 'Word',
|
|
76
|
-
url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
77
|
-
content:
|
|
78
|
-
'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5977',
|
|
82
|
-
mimeType: 'application/vnd.ms-excel',
|
|
83
|
-
title: 'Excel',
|
|
84
|
-
url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
85
|
-
content:
|
|
86
|
-
'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247928',
|
|
90
|
-
mimeType: 'image/png',
|
|
91
|
-
title: 'Verde',
|
|
92
|
-
url: 'rgb(0, 255, 0)',
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const ImagesGrid = Template.bind({});
|
|
98
|
-
ImagesGrid.args = {
|
|
99
|
-
items: Array.from({ length: 9 }, (_, i) => ({
|
|
100
|
-
mediumID: `95226d7e-7bae-465e-8b80-995587bb597${i}`,
|
|
101
|
-
mimeType: 'image/png',
|
|
102
|
-
title: `Image ${i}`,
|
|
103
|
-
url: `https://picsum.photos/${i % 2 ? '200' : '300'}/${
|
|
104
|
-
i % 3 ? '300' : '200'
|
|
105
|
-
}?random=${i}`,
|
|
106
|
-
})),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const JavaScript = Template.bind({});
|
|
110
|
-
JavaScript.args = {
|
|
111
|
-
items: [
|
|
112
|
-
{
|
|
113
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247928',
|
|
114
|
-
mimeType: 'text/javascript',
|
|
115
|
-
title: 'JavaScript',
|
|
116
|
-
content: `{
|
|
117
|
-
"name": "John Doe",
|
|
118
|
-
"age": 43,
|
|
119
|
-
"city": "New York",
|
|
120
|
-
"items": [
|
|
121
|
-
{
|
|
122
|
-
"name": "Item 1",
|
|
123
|
-
"price": 10
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"name": "Item 2",
|
|
127
|
-
"price": 20
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
`,
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const ShortCodeSnippets = Template.bind({});
|
|
137
|
-
ShortCodeSnippets.args = {
|
|
138
|
-
items: [
|
|
139
|
-
{
|
|
140
|
-
mediumID: 'short-js-1',
|
|
141
|
-
mimeType: 'text/javascript',
|
|
142
|
-
title: 'Short JS Function',
|
|
143
|
-
content: 'function greet() {\n return "Hello World!";\n}',
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
mediumID: 'short-python-1',
|
|
147
|
-
mimeType: 'text/python',
|
|
148
|
-
title: 'Python Print',
|
|
149
|
-
content: 'print("Hello, World!")',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
mediumID: 'short-css-1',
|
|
153
|
-
mimeType: 'text/css',
|
|
154
|
-
title: 'CSS Rule',
|
|
155
|
-
content: 'body {\n background: #f0f0f0;\n color: #333;\n}',
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const LongCodeSnippets = Template.bind({});
|
|
161
|
-
LongCodeSnippets.args = {
|
|
162
|
-
items: [
|
|
163
|
-
{
|
|
164
|
-
mediumID: 'long-js-1',
|
|
165
|
-
mimeType: 'text/javascript',
|
|
166
|
-
title: 'Long JavaScript Function',
|
|
167
|
-
content: `function processData(data) {
|
|
168
|
-
// Validate input
|
|
169
|
-
if (!data || typeof data !== 'object') {
|
|
170
|
-
throw new Error('Invalid data provided');
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Process each item
|
|
174
|
-
return data.map(item => {
|
|
175
|
-
const processed = {
|
|
176
|
-
id: item.id,
|
|
177
|
-
name: item.name.toUpperCase(),
|
|
178
|
-
value: item.value * 2,
|
|
179
|
-
timestamp: new Date().toISOString()
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
return processed;
|
|
183
|
-
});
|
|
184
|
-
}`,
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
mediumID: 'long-python-1',
|
|
188
|
-
mimeType: 'text/python',
|
|
189
|
-
title: 'Python Class',
|
|
190
|
-
content: `class DataProcessor:
|
|
191
|
-
def __init__(self, config):
|
|
192
|
-
self.config = config
|
|
193
|
-
self.cache = {}
|
|
194
|
-
|
|
195
|
-
def process(self, data):
|
|
196
|
-
if data in self.cache:
|
|
197
|
-
return self.cache[data]
|
|
198
|
-
|
|
199
|
-
result = self._transform(data)
|
|
200
|
-
self.cache[data] = result
|
|
201
|
-
return result
|
|
202
|
-
|
|
203
|
-
def _transform(self, data):
|
|
204
|
-
# Complex transformation logic
|
|
205
|
-
return data.upper()`,
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export const MixedSnippets = Template.bind({});
|
|
211
|
-
MixedSnippets.args = {
|
|
212
|
-
items: [
|
|
213
|
-
{
|
|
214
|
-
mediumID: 'short-1',
|
|
215
|
-
mimeType: 'text/javascript',
|
|
216
|
-
title: 'Quick Function',
|
|
217
|
-
content: 'const add = (a, b) => a + b;',
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
mediumID: 'long-2',
|
|
221
|
-
mimeType: 'text/javascript',
|
|
222
|
-
title: 'Long JSON',
|
|
223
|
-
content: `{
|
|
224
|
-
"id": 1,
|
|
225
|
-
"title": "Ciao",
|
|
226
|
-
"description": "I'm a test!",
|
|
227
|
-
"refs": [
|
|
228
|
-
{
|
|
229
|
-
"id": 1,
|
|
230
|
-
"tag": "TEST"
|
|
231
|
-
}
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
`,
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
mediumID: 'long-3',
|
|
238
|
-
mimeType: 'text/plain',
|
|
239
|
-
title: 'Long Text',
|
|
240
|
-
content: `{
|
|
241
|
-
"id": 1,
|
|
242
|
-
"title": "Ciao",
|
|
243
|
-
"description": "I'm a test!",
|
|
244
|
-
"refs": [
|
|
245
|
-
{
|
|
246
|
-
"id": 1,
|
|
247
|
-
"tag": "TEST"
|
|
248
|
-
}
|
|
249
|
-
]
|
|
250
|
-
}`,
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
mediumID: 'long-1',
|
|
254
|
-
mimeType: 'text/javascript',
|
|
255
|
-
title: 'Complex Component',
|
|
256
|
-
content: `import React, { useState, useEffect } from 'react';
|
|
257
|
-
|
|
258
|
-
const MyComponent = ({ data, onUpdate }) => {
|
|
259
|
-
const [loading, setLoading] = useState(false);
|
|
260
|
-
const [error, setError] = useState(null);
|
|
261
|
-
|
|
262
|
-
useEffect(() => {
|
|
263
|
-
if (data) {
|
|
264
|
-
setLoading(true);
|
|
265
|
-
processData(data)
|
|
266
|
-
.then(result => {
|
|
267
|
-
onUpdate(result);
|
|
268
|
-
setLoading(false);
|
|
269
|
-
})
|
|
270
|
-
.catch(err => {
|
|
271
|
-
setError(err.message);
|
|
272
|
-
setLoading(false);
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}, [data, onUpdate]);
|
|
276
|
-
|
|
277
|
-
if (loading) return <div>Loading...</div>;
|
|
278
|
-
if (error) return <div>Error: {error}</div>;
|
|
279
|
-
|
|
280
|
-
return <div>Data processed successfully</div>;
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
export default MyComponent;`,
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
mediumID: 'short-2',
|
|
287
|
-
mimeType: 'text/css',
|
|
288
|
-
title: 'Simple Style',
|
|
289
|
-
content: '.button {\n padding: 10px;\n background: blue;\n}',
|
|
290
|
-
},
|
|
291
|
-
],
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
export const LongTXT = Template.bind({});
|
|
295
|
-
LongTXT.args = {
|
|
296
|
-
items: [
|
|
297
|
-
{
|
|
298
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247928',
|
|
299
|
-
mimeType: 'text/plain',
|
|
300
|
-
title: 'Long Text',
|
|
301
|
-
content:
|
|
302
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi.',
|
|
303
|
-
},
|
|
304
|
-
],
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
export const WithCustomMediaRenderer = Template.bind({});
|
|
308
|
-
WithCustomMediaRenderer.args = {
|
|
309
|
-
items: [
|
|
310
|
-
{
|
|
311
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5971',
|
|
312
|
-
mimeType: 'image/png',
|
|
313
|
-
title: 'Image',
|
|
314
|
-
url: 'https://picsum.photos/200/300',
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
mediumID: '95226d7e-7bae-465e-8b80-995587bb5973',
|
|
318
|
-
mimeType: 'application/pdf',
|
|
319
|
-
title: 'PDF',
|
|
320
|
-
url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
321
|
-
content:
|
|
322
|
-
'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
|
|
323
|
-
},
|
|
324
|
-
],
|
|
325
|
-
customMediaRenderer: (mimeType: string) => {
|
|
326
|
-
if (mimeType === 'image/png') {
|
|
327
|
-
return <div>Custom Image Renderer</div>;
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
export const WithRGBColors = Template.bind({});
|
|
333
|
-
WithRGBColors.args = {
|
|
334
|
-
items: [
|
|
335
|
-
{
|
|
336
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247927',
|
|
337
|
-
mimeType: 'image/png',
|
|
338
|
-
title: 'Rosso',
|
|
339
|
-
url: 'rgb(255, 0, 0)',
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247928',
|
|
343
|
-
mimeType: 'image/png',
|
|
344
|
-
title: 'Verde',
|
|
345
|
-
url: 'rgb(0, 255, 0)',
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247929',
|
|
349
|
-
mimeType: 'image/png',
|
|
350
|
-
title: 'Blu',
|
|
351
|
-
url: 'rgb(0, 0, 255)',
|
|
352
|
-
},
|
|
353
|
-
],
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
export const AllImageTypes = Template.bind({});
|
|
357
|
-
AllImageTypes.args = {
|
|
358
|
-
items: [
|
|
359
|
-
{
|
|
360
|
-
mediumID: 'img-png-1',
|
|
361
|
-
mimeType: 'image/png',
|
|
362
|
-
title: 'PNG Image',
|
|
363
|
-
url: 'https://picsum.photos/300/200?random=1',
|
|
364
|
-
content: 'https://picsum.photos/300/200?random=1',
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
mediumID: 'img-jpeg-1',
|
|
368
|
-
mimeType: 'image/jpeg',
|
|
369
|
-
title: 'JPEG Image',
|
|
370
|
-
url: 'https://picsum.photos/300/200?random=2',
|
|
371
|
-
content: 'https://picsum.photos/300/200?random=2',
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
mediumID: 'img-jpg-1',
|
|
375
|
-
mimeType: 'image/jpg',
|
|
376
|
-
title: 'JPG Image',
|
|
377
|
-
url: 'https://picsum.photos/300/200?random=3',
|
|
378
|
-
content: 'https://picsum.photos/300/200?random=3',
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
mediumID: 'img-gif-1',
|
|
382
|
-
mimeType: 'image/gif',
|
|
383
|
-
title: 'GIF Image',
|
|
384
|
-
url: 'https://picsum.photos/300/200?random=4',
|
|
385
|
-
content: 'https://picsum.photos/300/200?random=4',
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
mediumID: 'img-webp-1',
|
|
389
|
-
mimeType: 'image/webp',
|
|
390
|
-
title: 'WebP Image',
|
|
391
|
-
url: 'https://picsum.photos/300/200?random=5',
|
|
392
|
-
content: 'https://picsum.photos/300/200?random=5',
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
mediumID: 'img-svg-1',
|
|
396
|
-
mimeType: 'image/svg+xml',
|
|
397
|
-
title: 'SVG Image',
|
|
398
|
-
url: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="300" height="200"%3E%3Crect width="300" height="200" fill="%234CAF50"/%3E%3Ctext x="150" y="100" font-family="Arial" font-size="24" fill="white" text-anchor="middle"%3ESVG Image%3C/text%3E%3C/svg%3E',
|
|
399
|
-
content: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="300" height="200"%3E%3Crect width="300" height="200" fill="%234CAF50"/%3E%3Ctext x="150" y="100" font-family="Arial" font-size="24" fill="white" text-anchor="middle"%3ESVG Image%3C/text%3E%3C/svg%3E',
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
mediumID: 'img-bmp-1',
|
|
403
|
-
mimeType: 'image/bmp',
|
|
404
|
-
title: 'BMP Image',
|
|
405
|
-
url: 'https://picsum.photos/300/200?random=6',
|
|
406
|
-
content: 'https://picsum.photos/300/200?random=6',
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
mediumID: 'img-tiff-1',
|
|
410
|
-
mimeType: 'image/tiff',
|
|
411
|
-
title: 'TIFF Image',
|
|
412
|
-
url: 'https://picsum.photos/300/200?random=7',
|
|
413
|
-
content: 'https://picsum.photos/300/200?random=7',
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
mediumID: 'img-ico-1',
|
|
417
|
-
mimeType: 'image/x-icon',
|
|
418
|
-
title: 'ICO Image',
|
|
419
|
-
url: 'https://picsum.photos/300/200?random=8',
|
|
420
|
-
content: 'https://picsum.photos/300/200?random=8',
|
|
421
|
-
},
|
|
422
|
-
],
|
|
423
|
-
};
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
|
-
import { medium, sessionID } from '../../mocks/data';
|
|
5
|
-
import MediaItemWidget from './MediaItemWidget';
|
|
6
|
-
import type { Medium } from '@memori.ai/memori-api-client/dist/types';
|
|
7
|
-
|
|
8
|
-
beforeAll(() => {
|
|
9
|
-
if (typeof window !== 'undefined' && !window.IntersectionObserver) {
|
|
10
|
-
(window as unknown as { IntersectionObserver: unknown }).IntersectionObserver = jest.fn().mockImplementation(() => ({
|
|
11
|
-
observe: jest.fn(),
|
|
12
|
-
unobserve: jest.fn(),
|
|
13
|
-
disconnect: jest.fn(),
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
16
|
-
if (typeof global !== 'undefined' && !globalThis.IntersectionObserver) {
|
|
17
|
-
(globalThis as unknown as { IntersectionObserver: unknown }).IntersectionObserver = jest.fn().mockImplementation(() => ({
|
|
18
|
-
observe: jest.fn(),
|
|
19
|
-
unobserve: jest.fn(),
|
|
20
|
-
disconnect: jest.fn(),
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('renders MediaItemWidget unchanged with no media', () => {
|
|
26
|
-
const { container } = render(
|
|
27
|
-
<MediaItemWidget items={[]} sessionID={sessionID} />
|
|
28
|
-
);
|
|
29
|
-
expect(container).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('renders MediaItemWidget unchanged with img', () => {
|
|
33
|
-
const { container } = render(<MediaItemWidget items={[medium]} />);
|
|
34
|
-
expect(container).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('renders MediaItemWidget unchanged with img and sessionID', () => {
|
|
38
|
-
const { container } = render(
|
|
39
|
-
<MediaItemWidget items={[medium]} sessionID={sessionID} />
|
|
40
|
-
);
|
|
41
|
-
expect(container).toMatchSnapshot();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('renders MediaItemWidget with imgs in correct order (creation date)', () => {
|
|
45
|
-
let now = new Date().toISOString();
|
|
46
|
-
let past = new Date('01/01/1970').toISOString();
|
|
47
|
-
|
|
48
|
-
const { container } = render(
|
|
49
|
-
<MediaItemWidget
|
|
50
|
-
items={[
|
|
51
|
-
{
|
|
52
|
-
...medium,
|
|
53
|
-
url: 'https://memori.ai/now',
|
|
54
|
-
mediumID: 'now',
|
|
55
|
-
creationTimestamp: now,
|
|
56
|
-
},
|
|
57
|
-
{ ...medium, url: 'https://memori.ai/medium' },
|
|
58
|
-
{
|
|
59
|
-
...medium,
|
|
60
|
-
url: 'https://memori.ai/past',
|
|
61
|
-
mediumID: 'past',
|
|
62
|
-
creationTimestamp: past,
|
|
63
|
-
},
|
|
64
|
-
]}
|
|
65
|
-
/>
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
expect(container).toMatchSnapshot();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('renders MediaItemWidget unchanged with js snippet to show', () => {
|
|
72
|
-
const { container } = render(
|
|
73
|
-
<MediaItemWidget
|
|
74
|
-
items={[
|
|
75
|
-
{
|
|
76
|
-
mediumID: 'a669fadb-12c0-469b-9b6c-34db22d371ca',
|
|
77
|
-
mimeType: 'text/javascript',
|
|
78
|
-
title: 'Snippet',
|
|
79
|
-
content: 'console.log("Hello World!");',
|
|
80
|
-
},
|
|
81
|
-
]}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
expect(container).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('renders MediaItemWidget unchanged with js snippet to exec', () => {
|
|
88
|
-
const { container } = render(
|
|
89
|
-
<MediaItemWidget
|
|
90
|
-
items={[
|
|
91
|
-
{
|
|
92
|
-
mediumID: 'a669fadb-12c0-469b-9b6c-34db22d371ca',
|
|
93
|
-
mimeType: 'text/javascript',
|
|
94
|
-
title: 'Snippet',
|
|
95
|
-
content: 'console.log("Hello World!");',
|
|
96
|
-
properties: {
|
|
97
|
-
executable: true,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
]}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
expect(container).toMatchSnapshot();
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('renders MediaItemWidget unchanged with css snippet to show', () => {
|
|
107
|
-
const { container } = render(
|
|
108
|
-
<MediaItemWidget
|
|
109
|
-
items={[
|
|
110
|
-
{
|
|
111
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247927',
|
|
112
|
-
mimeType: 'text/css',
|
|
113
|
-
title: 'Snippet',
|
|
114
|
-
content: 'body{\n background-color: #f00;\n}',
|
|
115
|
-
},
|
|
116
|
-
]}
|
|
117
|
-
/>
|
|
118
|
-
);
|
|
119
|
-
expect(container).toMatchSnapshot();
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it('renders MediaItemWidget unchanged with css snippet to exec', () => {
|
|
123
|
-
const { container } = render(
|
|
124
|
-
<MediaItemWidget
|
|
125
|
-
items={[
|
|
126
|
-
{
|
|
127
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247927',
|
|
128
|
-
mimeType: 'text/css',
|
|
129
|
-
title: 'Snippet',
|
|
130
|
-
content: 'body{\n background-color: #f00;\n}',
|
|
131
|
-
properties: {
|
|
132
|
-
executable: true,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
]}
|
|
136
|
-
/>
|
|
137
|
-
);
|
|
138
|
-
expect(container).toMatchSnapshot();
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('renders MediaItemWidget unchanged with custom media renderer', () => {
|
|
142
|
-
const { container } = render(
|
|
143
|
-
<MediaItemWidget
|
|
144
|
-
items={[]}
|
|
145
|
-
sessionID={sessionID}
|
|
146
|
-
customMediaRenderer={mimeType => <pre>{mimeType}</pre>}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
expect(container).toMatchSnapshot();
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it('renders MediaItemWidget unchanged with rgb color', () => {
|
|
153
|
-
const { container } = render(
|
|
154
|
-
<MediaItemWidget
|
|
155
|
-
items={[
|
|
156
|
-
{
|
|
157
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247927',
|
|
158
|
-
mimeType: 'image/png',
|
|
159
|
-
title: 'Rosso',
|
|
160
|
-
url: 'rgb(255, 0, 0)',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247928',
|
|
164
|
-
mimeType: 'image/png',
|
|
165
|
-
title: 'Verde',
|
|
166
|
-
url: 'rgb(0, 255, 0)',
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
mediumID: '65ca4a6d-f20b-402e-9d79-5e470f247929',
|
|
170
|
-
mimeType: 'image/png',
|
|
171
|
-
title: 'Blu',
|
|
172
|
-
url: 'rgb(0, 0, 255)',
|
|
173
|
-
},
|
|
174
|
-
]}
|
|
175
|
-
sessionID={sessionID}
|
|
176
|
-
/>
|
|
177
|
-
);
|
|
178
|
-
expect(container).toMatchSnapshot();
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// --- Document cards & unified media list ---
|
|
182
|
-
|
|
183
|
-
it('renders PDF as document card with title and PDF badge', () => {
|
|
184
|
-
const pdfItem: Medium & { type?: string } = {
|
|
185
|
-
mediumID: 'pdf-1',
|
|
186
|
-
mimeType: 'application/pdf',
|
|
187
|
-
title: 'Report',
|
|
188
|
-
url: 'https://example.com/report.pdf',
|
|
189
|
-
type: 'document',
|
|
190
|
-
};
|
|
191
|
-
const { container } = render(
|
|
192
|
-
<MediaItemWidget items={[pdfItem]} sessionID={sessionID} />
|
|
193
|
-
);
|
|
194
|
-
expect(screen.getByText('Report')).toBeInTheDocument();
|
|
195
|
-
expect(screen.getByText('PDF')).toBeInTheDocument();
|
|
196
|
-
expect(container.querySelector('.memori-media-item--document-link')).toBeInTheDocument();
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
it('renders HTML link as document card with Link badge when url present', () => {
|
|
200
|
-
const linkItem: Medium & { type?: string } = {
|
|
201
|
-
mediumID: 'link-1',
|
|
202
|
-
mimeType: 'text/html',
|
|
203
|
-
title: 'Memori',
|
|
204
|
-
url: 'https://memori.ai',
|
|
205
|
-
type: 'document',
|
|
206
|
-
};
|
|
207
|
-
render(
|
|
208
|
-
<MediaItemWidget items={[linkItem]} sessionID={sessionID} />
|
|
209
|
-
);
|
|
210
|
-
expect(screen.getByText('Memori')).toBeInTheDocument();
|
|
211
|
-
expect(screen.getByText('Link')).toBeInTheDocument();
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('opens MediaPreviewModal when clicking document attachment card', () => {
|
|
215
|
-
const docItem: Medium & { type?: string } = {
|
|
216
|
-
mediumID: 'doc-att-1',
|
|
217
|
-
mimeType: 'application/pdf',
|
|
218
|
-
title: 'Extracted Doc',
|
|
219
|
-
content: 'Extracted text content',
|
|
220
|
-
properties: { isDocumentAttachment: true },
|
|
221
|
-
type: 'document',
|
|
222
|
-
};
|
|
223
|
-
render(
|
|
224
|
-
<MediaItemWidget items={[docItem]} sessionID={sessionID} />
|
|
225
|
-
);
|
|
226
|
-
const card = screen.getByText('Extracted Doc').closest('[role="button"]');
|
|
227
|
-
expect(card).toBeInTheDocument();
|
|
228
|
-
fireEvent.click(card!);
|
|
229
|
-
expect(screen.getByText('Extracted text content')).toBeInTheDocument();
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
it('opens MediaPreviewModal when clicking image with mediumID', () => {
|
|
233
|
-
const imgItem: Medium & { type?: string } = {
|
|
234
|
-
...medium,
|
|
235
|
-
mediumID: 'img-modal-1',
|
|
236
|
-
mimeType: 'image/jpeg',
|
|
237
|
-
title: 'Game Cover',
|
|
238
|
-
url: 'https://api.lorem.space/image/game?w=150&h=220&hash=8B7BCDC2',
|
|
239
|
-
};
|
|
240
|
-
const { container } = render(
|
|
241
|
-
<MediaItemWidget items={[imgItem]} sessionID={sessionID} />
|
|
242
|
-
);
|
|
243
|
-
const imageLink = container.querySelector('.memori-media-item--image-link');
|
|
244
|
-
expect(imageLink).toBeInTheDocument();
|
|
245
|
-
fireEvent.click(imageLink!);
|
|
246
|
-
const modalImage = document.querySelector('.memori-content-preview-modal--image');
|
|
247
|
-
expect(modalImage).toBeInTheDocument();
|
|
248
|
-
});
|