@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,5 +1,25 @@
|
|
|
1
1
|
.memori-widget.memori-layout-chat {
|
|
2
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
min-height: 0;
|
|
5
|
+
max-height: 100%;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Fill the known mount nodes. Do not size memori-client / :host: the page owns those. */
|
|
10
|
+
#memori-root:has(.memori-layout-chat),
|
|
11
|
+
.memori-root:has(.memori-layout-chat) {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
min-height: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Same mount nodes when this stylesheet is injected into the web component shadow root. */
|
|
18
|
+
:host:has(.memori-layout-chat) #memori-root,
|
|
19
|
+
:host:has(.memori-layout-chat) .memori-root {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
min-height: 0;
|
|
3
23
|
}
|
|
4
24
|
|
|
5
25
|
.memori-widget.memori-layout-chat .memori--global-background.no-background-image {
|
|
@@ -9,10 +29,13 @@
|
|
|
9
29
|
.memori-widget > .memori-spin.memori-chat-layout {
|
|
10
30
|
display: flex;
|
|
11
31
|
height: 100%;
|
|
32
|
+
min-height: 0;
|
|
33
|
+
flex: 1 1 auto;
|
|
12
34
|
flex-direction: column;
|
|
13
35
|
}
|
|
14
36
|
|
|
15
37
|
.memori-chat-layout--header {
|
|
38
|
+
flex: 0 0 auto;
|
|
16
39
|
margin-bottom: 12px;
|
|
17
40
|
text-align: right;
|
|
18
41
|
transition: all 0.05s ease-in-out;
|
|
@@ -53,9 +76,10 @@
|
|
|
53
76
|
overflow: hidden;
|
|
54
77
|
width: 100%;
|
|
55
78
|
height: 100%;
|
|
79
|
+
min-height: 0;
|
|
56
80
|
flex: 1;
|
|
57
81
|
flex-direction: row;
|
|
58
|
-
align-items: center;
|
|
82
|
+
/* align-items: center; */
|
|
59
83
|
justify-content: center;
|
|
60
84
|
/* max-width: 1200px; */
|
|
61
85
|
transition: all 0.05s ease-in-out;
|
|
@@ -75,8 +99,7 @@
|
|
|
75
99
|
z-index: 5;
|
|
76
100
|
overflow: hidden;
|
|
77
101
|
min-width: 0;
|
|
78
|
-
height:
|
|
79
|
-
max-height: 100%;
|
|
102
|
+
min-height: 0;
|
|
80
103
|
flex: 1;
|
|
81
104
|
/* padding-bottom: 1.5rem; */
|
|
82
105
|
transition: all 0.05s ease-in-out;
|
package/esm/styles.css
CHANGED
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
@import url('./components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css');
|
|
59
59
|
@import url('./components/ContentPreviewModal/ContentPreviewModal.css');
|
|
60
60
|
|
|
61
|
-
|
|
62
61
|
@import url('./components/layouts/hidden-chat.css');
|
|
63
62
|
@import url('./components/layouts/totem.css');
|
|
64
63
|
@import url('./components/layouts/website-assistant.css');
|
|
@@ -123,4 +122,4 @@ body.sb-show-main #root,
|
|
|
123
122
|
.mobile-hidden {
|
|
124
123
|
display: none;
|
|
125
124
|
}
|
|
126
|
-
}
|
|
125
|
+
}
|
package/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.45.
|
|
1
|
+
export declare const version = "8.45.4";
|
package/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '8.45.
|
|
1
|
+
export const version = '8.45.4';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "8.45.
|
|
2
|
+
"version": "8.45.4",
|
|
3
3
|
"name": "@memori.ai/memori-react",
|
|
4
4
|
"author": "Memori Srl",
|
|
5
5
|
"main": "dist/index.js",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"esm",
|
|
11
|
-
"src",
|
|
12
11
|
"CHANGELOG.md",
|
|
13
12
|
"LICENSE",
|
|
14
13
|
"README.md"
|
|
@@ -43,11 +42,11 @@
|
|
|
43
42
|
"clean": "rimraf dist esm",
|
|
44
43
|
"copy-files:cjs": "copyfiles -u 1 src/**/*.css dist/",
|
|
45
44
|
"copy-files:esm": "copyfiles -u 1 src/**/*.css esm/",
|
|
46
|
-
"cleanup-test:cjs": "find dist -name \\*.test.\\* -type f | xargs -n1 rm",
|
|
45
|
+
"cleanup-test:cjs": "find dist \\( -name \\*.test.\\* -o -name testUtils.\\* -o -name CopyButtonTest.\\* \\) -type f | xargs -n1 rm",
|
|
47
46
|
"cleanup-stories:cjs": "find dist -name \\*.stories.\\* -type f | xargs -n1 rm",
|
|
48
|
-
"cleanup-test:esm": "find esm -name \\*.test.\\* -type f | xargs -n1 rm",
|
|
47
|
+
"cleanup-test:esm": "find esm \\( -name \\*.test.\\* -o -name testUtils.\\* -o -name CopyButtonTest.\\* \\) -type f | xargs -n1 rm",
|
|
49
48
|
"cleanup-stories:esm": "find esm -name \\*.stories.\\* -type f | xargs -n1 rm",
|
|
50
|
-
"cleanup-mocks": "rimraf dist/mocks esm/mocks",
|
|
49
|
+
"cleanup-mocks": "rimraf dist/mocks esm/mocks dist/components/MemoriArtifactSystem/components/ArtifactActions/test esm/components/MemoriArtifactSystem/components/ArtifactActions/test",
|
|
51
50
|
"cleanup": "yarn cleanup-test:cjs && yarn cleanup-stories:cjs && yarn cleanup-test:esm && yarn cleanup-stories:esm && yarn cleanup-mocks",
|
|
52
51
|
"copy-files": "yarn copy-files:cjs && yarn copy-files:esm",
|
|
53
52
|
"build:cjs": "tsc --module commonjs --outDir dist",
|
|
@@ -225,7 +224,7 @@
|
|
|
225
224
|
}
|
|
226
225
|
],
|
|
227
226
|
"devDependencies": {
|
|
228
|
-
"@babel/core": "7.
|
|
227
|
+
"@babel/core": "7.29.7",
|
|
229
228
|
"@babel/preset-env": "^7.21.4",
|
|
230
229
|
"@babel/preset-react": "^7.18.6",
|
|
231
230
|
"@babel/preset-typescript": "^7.21.4",
|
|
@@ -269,7 +268,7 @@
|
|
|
269
268
|
"is-ci": "3.0.1",
|
|
270
269
|
"jest": "29.3.1",
|
|
271
270
|
"jest-environment-jsdom": "29.3.1",
|
|
272
|
-
"postcss": "8.
|
|
271
|
+
"postcss": "8.5.28",
|
|
273
272
|
"prettier": "2.8.0",
|
|
274
273
|
"prop-types": "15.8.1",
|
|
275
274
|
"react": "18.2.0",
|
package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const __1 = require("../");
|
|
5
|
-
const CopyButtonTest = () => {
|
|
6
|
-
const testArtifacts = [
|
|
7
|
-
{
|
|
8
|
-
content: `# Hello World
|
|
9
|
-
|
|
10
|
-
This is a **markdown** document with some content.
|
|
11
|
-
|
|
12
|
-
\`\`\`javascript
|
|
13
|
-
function hello() {
|
|
14
|
-
console.log("Hello, World!");
|
|
15
|
-
}
|
|
16
|
-
\`\`\`
|
|
17
|
-
|
|
18
|
-
- Item 1
|
|
19
|
-
- Item 2
|
|
20
|
-
- Item 3`,
|
|
21
|
-
mimeType: 'text/markdown',
|
|
22
|
-
title: 'Markdown Test',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
content: `<!DOCTYPE html>
|
|
26
|
-
<html>
|
|
27
|
-
<head>
|
|
28
|
-
<title>Test HTML</title>
|
|
29
|
-
</head>
|
|
30
|
-
<body>
|
|
31
|
-
<h1>Hello World</h1>
|
|
32
|
-
<p>This is a test HTML document.</p>
|
|
33
|
-
</body>
|
|
34
|
-
</html>`,
|
|
35
|
-
mimeType: 'text/html',
|
|
36
|
-
title: 'HTML Test',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
content: `function fibonacci(n) {
|
|
40
|
-
if (n <= 1) return n;
|
|
41
|
-
return fibonacci(n - 1) + fibonacci(n - 2);
|
|
42
|
-
}`,
|
|
43
|
-
mimeType: 'application/vnd.ant.code.javascript',
|
|
44
|
-
title: 'JavaScript Code',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
content: `<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
|
|
48
|
-
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
|
|
49
|
-
</svg>`,
|
|
50
|
-
mimeType: 'image/svg+xml',
|
|
51
|
-
title: 'SVG Test',
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { padding: '20px', display: 'flex', flexDirection: 'column', gap: '20px' }, children: [(0, jsx_runtime_1.jsx)("h2", { children: "Copy Button Dropdown Test" }), testArtifacts.map((artifact, index) => ((0, jsx_runtime_1.jsxs)("div", { style: { border: '1px solid #ccc', padding: '10px', borderRadius: '8px' }, children: [(0, jsx_runtime_1.jsxs)("h3", { children: [artifact.title, " (", artifact.mimeType, ")"] }), (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '10px' }, children: (0, jsx_runtime_1.jsx)(__1.CopyButtonWithDropdown, { artifact: artifact, onCopy: () => console.log('Copy clicked'), onDownload: () => console.log('Download clicked'), onPrint: () => console.log('Print clicked') }) }), (0, jsx_runtime_1.jsxs)("pre", { style: {
|
|
55
|
-
background: '#f5f5f5',
|
|
56
|
-
padding: '10px',
|
|
57
|
-
borderRadius: '4px',
|
|
58
|
-
fontSize: '12px',
|
|
59
|
-
maxHeight: '200px',
|
|
60
|
-
overflow: 'auto'
|
|
61
|
-
}, children: [artifact.content.substring(0, 200), "..."] })] }, index)))] }));
|
|
62
|
-
};
|
|
63
|
-
exports.default = CopyButtonTest;
|
|
64
|
-
//# sourceMappingURL=CopyButtonTest.js.map
|
package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButtonTest.js","sourceRoot":"","sources":["../../../../../../src/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.tsx"],"names":[],"mappings":";;;AAMA,2BAA6C;AAE7C,MAAM,cAAc,GAAa,GAAG,EAAE;IACpC,MAAM,aAAa,GAAG;QACpB;YACE,OAAO,EAAE;;;;;;;;;;;;SAYN;YACH,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,eAAe;SACvB;QACD;YACE,OAAO,EAAE;;;;;;;;;QASP;YACF,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE;;;EAGb;YACI,QAAQ,EAAE,qCAAqC;YAC/C,KAAK,EAAE,iBAAiB;SACzB;QACD;YACE,OAAO,EAAE;;OAER;YACD,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,UAAU;SAClB;KACF,CAAC;IAEF,OAAO,CACL,iCAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,aACpF,uEAAkC,EAEjC,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CACtC,iCAAiB,KAAK,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,aACxF,2CAAK,QAAQ,CAAC,KAAK,QAAI,QAAQ,CAAC,QAAQ,SAAO,EAC/C,gCAAK,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAClC,uBAAC,0BAAsB,IACrB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EACzC,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAC3C,GACE,EACN,iCAAK,KAAK,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,OAAO,EAAE,MAAM;4BACf,YAAY,EAAE,KAAK;4BACnB,QAAQ,EAAE,MAAM;4BAChB,SAAS,EAAE,OAAO;4BAClB,QAAQ,EAAE,MAAM;yBACjB,aACE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,WAC/B,KAnBE,KAAK,CAoBT,CACP,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CopyButtonWithDropdown } from '../';
|
|
3
|
-
const CopyButtonTest = () => {
|
|
4
|
-
const testArtifacts = [
|
|
5
|
-
{
|
|
6
|
-
content: `# Hello World
|
|
7
|
-
|
|
8
|
-
This is a **markdown** document with some content.
|
|
9
|
-
|
|
10
|
-
\`\`\`javascript
|
|
11
|
-
function hello() {
|
|
12
|
-
console.log("Hello, World!");
|
|
13
|
-
}
|
|
14
|
-
\`\`\`
|
|
15
|
-
|
|
16
|
-
- Item 1
|
|
17
|
-
- Item 2
|
|
18
|
-
- Item 3`,
|
|
19
|
-
mimeType: 'text/markdown',
|
|
20
|
-
title: 'Markdown Test',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
content: `<!DOCTYPE html>
|
|
24
|
-
<html>
|
|
25
|
-
<head>
|
|
26
|
-
<title>Test HTML</title>
|
|
27
|
-
</head>
|
|
28
|
-
<body>
|
|
29
|
-
<h1>Hello World</h1>
|
|
30
|
-
<p>This is a test HTML document.</p>
|
|
31
|
-
</body>
|
|
32
|
-
</html>`,
|
|
33
|
-
mimeType: 'text/html',
|
|
34
|
-
title: 'HTML Test',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
content: `function fibonacci(n) {
|
|
38
|
-
if (n <= 1) return n;
|
|
39
|
-
return fibonacci(n - 1) + fibonacci(n - 2);
|
|
40
|
-
}`,
|
|
41
|
-
mimeType: 'application/vnd.ant.code.javascript',
|
|
42
|
-
title: 'JavaScript Code',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
content: `<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
-
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
|
|
47
|
-
</svg>`,
|
|
48
|
-
mimeType: 'image/svg+xml',
|
|
49
|
-
title: 'SVG Test',
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
|
-
return (_jsxs("div", { style: { padding: '20px', display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsx("h2", { children: "Copy Button Dropdown Test" }), testArtifacts.map((artifact, index) => (_jsxs("div", { style: { border: '1px solid #ccc', padding: '10px', borderRadius: '8px' }, children: [_jsxs("h3", { children: [artifact.title, " (", artifact.mimeType, ")"] }), _jsx("div", { style: { marginBottom: '10px' }, children: _jsx(CopyButtonWithDropdown, { artifact: artifact, onCopy: () => console.log('Copy clicked'), onDownload: () => console.log('Download clicked'), onPrint: () => console.log('Print clicked') }) }), _jsxs("pre", { style: {
|
|
53
|
-
background: '#f5f5f5',
|
|
54
|
-
padding: '10px',
|
|
55
|
-
borderRadius: '4px',
|
|
56
|
-
fontSize: '12px',
|
|
57
|
-
maxHeight: '200px',
|
|
58
|
-
overflow: 'auto'
|
|
59
|
-
}, children: [artifact.content.substring(0, 200), "..."] })] }, index)))] }));
|
|
60
|
-
};
|
|
61
|
-
export default CopyButtonTest;
|
|
62
|
-
//# sourceMappingURL=CopyButtonTest.js.map
|
package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButtonTest.js","sourceRoot":"","sources":["../../../../../../src/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAE7C,MAAM,cAAc,GAAa,GAAG,EAAE;IACpC,MAAM,aAAa,GAAG;QACpB;YACE,OAAO,EAAE;;;;;;;;;;;;SAYN;YACH,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,eAAe;SACvB;QACD;YACE,OAAO,EAAE;;;;;;;;;QASP;YACF,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE;;;EAGb;YACI,QAAQ,EAAE,qCAAqC;YAC/C,KAAK,EAAE,iBAAiB;SACzB;QACD;YACE,OAAO,EAAE;;OAER;YACD,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,UAAU;SAClB;KACF,CAAC;IAEF,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,aACpF,qDAAkC,EAEjC,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CACtC,eAAiB,KAAK,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,aACxF,yBAAK,QAAQ,CAAC,KAAK,QAAI,QAAQ,CAAC,QAAQ,SAAO,EAC/C,cAAK,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAClC,KAAC,sBAAsB,IACrB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EACzC,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAC3C,GACE,EACN,eAAK,KAAK,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,OAAO,EAAE,MAAM;4BACf,YAAY,EAAE,KAAK;4BACnB,QAAQ,EAAE,MAAM;4BAChB,SAAS,EAAE,OAAO;4BAClB,QAAQ,EAAE,MAAM;yBACjB,aACE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,WAC/B,KAnBE,KAAK,CAoBT,CACP,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/src/I18nWrapper.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { I18nextProvider } from 'react-i18next';
|
|
3
|
-
import i18n from './i18n';
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const I18nWrapper = ({ children }: Props) => {
|
|
10
|
-
return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default I18nWrapper;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders client 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
id="_rht_toaster"
|
|
7
|
-
style="position: fixed; z-index: 9999; top: 16px; left: 16px; right: 16px; bottom: 16px; pointer-events: none;"
|
|
8
|
-
/>
|
|
9
|
-
<div
|
|
10
|
-
style="display: flex; align-items: center; justify-content: center;"
|
|
11
|
-
>
|
|
12
|
-
<p
|
|
13
|
-
style="text-align: center; margin: 2rem auto; text-transform: capitalize;"
|
|
14
|
-
>
|
|
15
|
-
loading
|
|
16
|
-
...
|
|
17
|
-
</p>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
exports[`renders client with all the props 1`] = `
|
|
23
|
-
<div>
|
|
24
|
-
<div
|
|
25
|
-
id="_rht_toaster"
|
|
26
|
-
style="position: fixed; z-index: 9999; top: 16px; left: 16px; right: 16px; bottom: 16px; pointer-events: none;"
|
|
27
|
-
/>
|
|
28
|
-
<div
|
|
29
|
-
style="display: flex; align-items: center; justify-content: center;"
|
|
30
|
-
>
|
|
31
|
-
<p
|
|
32
|
-
style="text-align: center; margin: 2rem auto; text-transform: capitalize;"
|
|
33
|
-
>
|
|
34
|
-
loading
|
|
35
|
-
...
|
|
36
|
-
</p>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
exports[`renders client with audio disabled 1`] = `
|
|
42
|
-
<div>
|
|
43
|
-
<div
|
|
44
|
-
id="_rht_toaster"
|
|
45
|
-
style="position: fixed; z-index: 9999; top: 16px; left: 16px; right: 16px; bottom: 16px; pointer-events: none;"
|
|
46
|
-
/>
|
|
47
|
-
<div
|
|
48
|
-
style="display: flex; align-items: center; justify-content: center;"
|
|
49
|
-
>
|
|
50
|
-
<p
|
|
51
|
-
style="text-align: center; margin: 2rem auto; text-transform: capitalize;"
|
|
52
|
-
>
|
|
53
|
-
loading
|
|
54
|
-
...
|
|
55
|
-
</p>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
exports[`renders client with whiteListedDomains on allowed domains 1`] = `
|
|
61
|
-
<div>
|
|
62
|
-
<div
|
|
63
|
-
id="_rht_toaster"
|
|
64
|
-
style="position: fixed; z-index: 9999; top: 16px; left: 16px; right: 16px; bottom: 16px; pointer-events: none;"
|
|
65
|
-
/>
|
|
66
|
-
<div
|
|
67
|
-
style="display: flex; align-items: center; justify-content: center;"
|
|
68
|
-
>
|
|
69
|
-
<p
|
|
70
|
-
style="text-align: center; margin: 2rem auto; text-transform: capitalize;"
|
|
71
|
-
>
|
|
72
|
-
loading
|
|
73
|
-
...
|
|
74
|
-
</p>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
exports[`renders client with whiteListedDomains on not allowed domains 1`] = `
|
|
80
|
-
<div>
|
|
81
|
-
<div
|
|
82
|
-
id="_rht_toaster"
|
|
83
|
-
style="position: fixed; z-index: 9999; top: 16px; left: 16px; right: 16px; bottom: 16px; pointer-events: none;"
|
|
84
|
-
/>
|
|
85
|
-
<div
|
|
86
|
-
style="display: flex; align-items: center; justify-content: center;"
|
|
87
|
-
>
|
|
88
|
-
<p
|
|
89
|
-
style="text-align: center; margin: 2rem auto; text-transform: capitalize;"
|
|
90
|
-
>
|
|
91
|
-
loading
|
|
92
|
-
...
|
|
93
|
-
</p>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
`;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* Above website assistant and other fixed UI (same max z-index so modal stacks on top by DOM order) */
|
|
2
|
-
.age-verification-modal {
|
|
3
|
-
z-index: 2147483647;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.age-verification-modal,
|
|
7
|
-
.age-verification-modal * {
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.age-verification-form {
|
|
12
|
-
display: flex;
|
|
13
|
-
width: 100%;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
}
|
|
17
|
-
/*
|
|
18
|
-
@media (min-width: 640px) {
|
|
19
|
-
.age-verification-form {
|
|
20
|
-
min-width: 600px;
|
|
21
|
-
}
|
|
22
|
-
} */
|
|
23
|
-
|
|
24
|
-
.age-verification-form fieldset {
|
|
25
|
-
padding-right: 0;
|
|
26
|
-
padding-left: 0;
|
|
27
|
-
border: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.age-verification-form .form-item {
|
|
31
|
-
width: 100%;
|
|
32
|
-
text-align: center;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.age-verification-form .form-item.submit {
|
|
36
|
-
margin-top: 1.5rem;
|
|
37
|
-
text-align: center;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.age-verification-form .form-item input {
|
|
41
|
-
color: #000;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.age-verification-form .form-item-help {
|
|
45
|
-
padding-bottom: 0.25rem;
|
|
46
|
-
margin: 1.5rem 0 1rem;
|
|
47
|
-
opacity: 0.5;
|
|
48
|
-
text-align: left;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.age-verification-form .form-item-error {
|
|
52
|
-
padding-bottom: 0.25rem;
|
|
53
|
-
margin: 1.5rem 0 1rem;
|
|
54
|
-
color: var(--memori-error-color);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
button.age-verification-submit {
|
|
58
|
-
position: relative;
|
|
59
|
-
overflow: hidden;
|
|
60
|
-
width: 100%;
|
|
61
|
-
min-width: 220px;
|
|
62
|
-
max-width: 220px;
|
|
63
|
-
min-height: 42px;
|
|
64
|
-
padding: 1rem 2rem;
|
|
65
|
-
border: none;
|
|
66
|
-
border-radius: 12px;
|
|
67
|
-
border-radius: 8px;
|
|
68
|
-
margin-top: 1rem;
|
|
69
|
-
background: var(--memori-primary);
|
|
70
|
-
color: white;
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
font-size: 1rem;
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
button.age-verification-submit::before {
|
|
78
|
-
position: absolute;
|
|
79
|
-
top: 0;
|
|
80
|
-
left: -100%;
|
|
81
|
-
width: 100%;
|
|
82
|
-
height: 100%;
|
|
83
|
-
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
|
84
|
-
content: '';
|
|
85
|
-
transition: left 0.5s ease;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
button.age-verification-submit:hover::before {
|
|
89
|
-
left: 100%;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
button.age-verification-submit:active {
|
|
94
|
-
transform: translateY(0);
|
|
95
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
|
-
import AgeVerificationModal, { Props } from './AgeVerificationModal';
|
|
5
|
-
|
|
6
|
-
import './AgeVerificationModal.css';
|
|
7
|
-
|
|
8
|
-
const meta: Meta = {
|
|
9
|
-
title: 'AgeVerificationModal',
|
|
10
|
-
component: AgeVerificationModal,
|
|
11
|
-
parameters: {
|
|
12
|
-
controls: { expanded: true },
|
|
13
|
-
layout: 'fullscreen',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
|
|
19
|
-
const Template: Story<Props> = args => (
|
|
20
|
-
<I18nWrapper>
|
|
21
|
-
<AgeVerificationModal {...args} />
|
|
22
|
-
</I18nWrapper>
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
26
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
27
|
-
export const Default = Template.bind({});
|
|
28
|
-
Default.args = {
|
|
29
|
-
visible: true,
|
|
30
|
-
onClose: console.log,
|
|
31
|
-
minAge: 0,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Min14yo = Template.bind({});
|
|
35
|
-
Min14yo.args = {
|
|
36
|
-
visible: true,
|
|
37
|
-
onClose: console.log,
|
|
38
|
-
minAge: 14,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Min18yo = Template.bind({});
|
|
42
|
-
Min18yo.args = {
|
|
43
|
-
visible: true,
|
|
44
|
-
onClose: console.log,
|
|
45
|
-
minAge: 18,
|
|
46
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { render } from '@testing-library/react';
|
|
2
|
-
import AgeVerificationModal from './AgeVerificationModal';
|
|
3
|
-
|
|
4
|
-
beforeEach(() => {
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
window.IntersectionObserver = jest.fn(() => ({
|
|
7
|
-
observe: jest.fn(),
|
|
8
|
-
unobserve: jest.fn(),
|
|
9
|
-
disconnect: jest.fn(),
|
|
10
|
-
takeRecords: jest.fn(),
|
|
11
|
-
}));
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('renders AgeVerificationModal unchanged', () => {
|
|
15
|
-
const { container } = render(
|
|
16
|
-
<AgeVerificationModal onClose={jest.fn()} minAge={0} />
|
|
17
|
-
);
|
|
18
|
-
expect(container).toMatchSnapshot();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('renders AgeVerificationModal visible unchanged', () => {
|
|
22
|
-
const { container } = render(
|
|
23
|
-
<AgeVerificationModal visible onClose={jest.fn()} minAge={14} />
|
|
24
|
-
);
|
|
25
|
-
expect(container).toMatchSnapshot();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('renders AgeVerificationModal with minAge unchanged', () => {
|
|
29
|
-
const { container } = render(
|
|
30
|
-
<AgeVerificationModal visible onClose={jest.fn()} minAge={18} />
|
|
31
|
-
);
|
|
32
|
-
expect(container).toMatchSnapshot();
|
|
33
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import toast from 'react-hot-toast';
|
|
3
|
-
import Button from '../ui/Button';
|
|
4
|
-
import Modal from '../ui/Modal';
|
|
5
|
-
import { DateTime } from 'luxon';
|
|
6
|
-
import DateSelector from '../DateSelector/DateSelector';
|
|
7
|
-
import { useCallback, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
export interface Props {
|
|
10
|
-
visible?: boolean;
|
|
11
|
-
onClose: (birthDate?: string) => void;
|
|
12
|
-
minAge: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const AgeVerificationModal = ({ visible = false, onClose, minAge }: Props) => {
|
|
16
|
-
const { t } = useTranslation();
|
|
17
|
-
|
|
18
|
-
const [birthDate, setBirthDate] = useState<DateTime>();
|
|
19
|
-
const [error, setError] = useState<string>();
|
|
20
|
-
const [submitting, setSubmitting] = useState<boolean>(false);
|
|
21
|
-
|
|
22
|
-
const onSubmit = useCallback(() => {
|
|
23
|
-
setSubmitting(true);
|
|
24
|
-
|
|
25
|
-
if (!birthDate) {
|
|
26
|
-
toast.error(t('requiredField'));
|
|
27
|
-
setError(t('requiredField') || 'Required field');
|
|
28
|
-
setSubmitting(false);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let age = DateTime.now().diff(birthDate, 'years').years;
|
|
33
|
-
if (age < minAge) {
|
|
34
|
-
toast.error(t('underageTwinSession', { age: minAge }));
|
|
35
|
-
setError(
|
|
36
|
-
t('underageTwinSession', { age: minAge }) ||
|
|
37
|
-
`You must be at least ${minAge} years old to interact with this Agent`
|
|
38
|
-
);
|
|
39
|
-
setSubmitting(false);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
onClose(birthDate.toJSDate().toISOString());
|
|
44
|
-
}, [birthDate, minAge, onClose, t]);
|
|
45
|
-
|
|
46
|
-
const handleDateChange = useCallback((date: DateTime | undefined) => {
|
|
47
|
-
setBirthDate(date);
|
|
48
|
-
}, []);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<Modal
|
|
52
|
-
open={visible}
|
|
53
|
-
width="600px"
|
|
54
|
-
widthMd="600px"
|
|
55
|
-
title={t('ageVerification')}
|
|
56
|
-
className="age-verification-modal"
|
|
57
|
-
closable
|
|
58
|
-
onClose={() => onClose()}
|
|
59
|
-
>
|
|
60
|
-
<p>{t('ageVerificationText', { minAge })}</p>
|
|
61
|
-
|
|
62
|
-
<form
|
|
63
|
-
className="age-verification-form"
|
|
64
|
-
onSubmit={e => {
|
|
65
|
-
e.preventDefault();
|
|
66
|
-
onSubmit();
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
<div className="form-item">
|
|
70
|
-
<fieldset name="birthDate">
|
|
71
|
-
<legend className="sr-only">{t('birthDate')}</legend>
|
|
72
|
-
|
|
73
|
-
<DateSelector
|
|
74
|
-
minAge={minAge}
|
|
75
|
-
onChange={handleDateChange}
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
<p className="form-item-help">{t('birthDateHelper')}</p>
|
|
79
|
-
|
|
80
|
-
{error && <p className="form-item-error">{error}</p>}
|
|
81
|
-
</fieldset>
|
|
82
|
-
</div>
|
|
83
|
-
<div className="form-item form-submit">
|
|
84
|
-
<Button
|
|
85
|
-
primary
|
|
86
|
-
htmlType="submit"
|
|
87
|
-
className="age-verification-submit"
|
|
88
|
-
loading={submitting}
|
|
89
|
-
disabled={!birthDate}
|
|
90
|
-
>
|
|
91
|
-
{t('confirm')}
|
|
92
|
-
</Button>
|
|
93
|
-
</div>
|
|
94
|
-
</form>
|
|
95
|
-
</Modal>
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export default AgeVerificationModal;
|