@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
package/src/components/AgeVerificationModal/__snapshots__/AgeVerificationModal.test.tsx.snap
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders AgeVerificationModal unchanged 1`] = `<div />`;
|
|
4
|
-
|
|
5
|
-
exports[`renders AgeVerificationModal visible unchanged 1`] = `
|
|
6
|
-
<div>
|
|
7
|
-
<div
|
|
8
|
-
style="position: fixed; top: 1px; left: 1px; width: 1px; height: 0px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border-width: 0px; display: none;"
|
|
9
|
-
/>
|
|
10
|
-
</div>
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
exports[`renders AgeVerificationModal with minAge unchanged 1`] = `
|
|
14
|
-
<div>
|
|
15
|
-
<div
|
|
16
|
-
style="position: fixed; top: 1px; left: 1px; width: 1px; height: 0px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border-width: 0px; display: none;"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
`;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
.memori-auth-widget--form fieldset {
|
|
2
|
-
padding: 0;
|
|
3
|
-
border: 0;
|
|
4
|
-
margin: 0 0 1em;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.memori-auth-widget--form hr {
|
|
8
|
-
border-top: 0;
|
|
9
|
-
border-bottom: 1px solid #e0e0e0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.memori-auth-widget--form label {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
input.memori-auth-widget--input {
|
|
18
|
-
min-height: 2.5rem;
|
|
19
|
-
border: 1px solid #e0e0e0;
|
|
20
|
-
border-radius: 0.375rem;
|
|
21
|
-
appearance: none;
|
|
22
|
-
background: inherit;
|
|
23
|
-
font-size: 1rem;
|
|
24
|
-
outline: transparent solid 2px;
|
|
25
|
-
outline-offset: 2px;
|
|
26
|
-
padding-inline-end: 1rem;
|
|
27
|
-
padding-inline-start: 1rem;
|
|
28
|
-
transition-duration: 0.2s;
|
|
29
|
-
transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
input.memori-auth-widget--input::placeholder {
|
|
33
|
-
color: #bdbdbd;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
input.memori-auth-widget--input:hover {
|
|
37
|
-
border-color: #c0c0c0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
input.memori-auth-widget--input:focus {
|
|
41
|
-
border-color: var(--memori-primary);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.memori-auth-widget--token {
|
|
45
|
-
display: block;
|
|
46
|
-
margin-bottom: 0.5rem;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.memori-auth-widget--error {
|
|
50
|
-
padding: 1rem 1.5rem;
|
|
51
|
-
border: 1px solid currentColor;
|
|
52
|
-
border-radius: 10px;
|
|
53
|
-
margin-top: 0.5rem;
|
|
54
|
-
margin-bottom: 1rem;
|
|
55
|
-
background-color: rgba(255, 235, 238, 0.5);
|
|
56
|
-
color: #f44336;
|
|
57
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
|
-
import AuthWidget, { Props } from './Auth';
|
|
5
|
-
|
|
6
|
-
import './Auth.css';
|
|
7
|
-
|
|
8
|
-
const meta: Meta = {
|
|
9
|
-
title: 'Auth Widget',
|
|
10
|
-
component: AuthWidget,
|
|
11
|
-
argTypes: {
|
|
12
|
-
pwdOrTokens: {
|
|
13
|
-
control: {
|
|
14
|
-
type: 'select',
|
|
15
|
-
options: ['password', 'tokens'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
showTokens: {
|
|
19
|
-
control: {
|
|
20
|
-
type: 'boolean',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
parameters: {
|
|
25
|
-
controls: { expanded: true },
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default meta;
|
|
30
|
-
|
|
31
|
-
const Template: Story<Props> = args => {
|
|
32
|
-
const [pwdOrTokens, setPwdOrTokens] = useState<null | 'password' | 'tokens'>(
|
|
33
|
-
args.pwdOrTokens as 'password' | 'tokens' | null
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<I18nWrapper>
|
|
38
|
-
<AuthWidget
|
|
39
|
-
{...args}
|
|
40
|
-
pwdOrTokens={pwdOrTokens}
|
|
41
|
-
setPwdOrTokens={setPwdOrTokens}
|
|
42
|
-
/>
|
|
43
|
-
</I18nWrapper>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const TemplateWithModal: Story<Props> = args => {
|
|
48
|
-
const [pwdOrTokens, setPwdOrTokens] = useState<null | 'password' | 'tokens'>(
|
|
49
|
-
args.pwdOrTokens as 'password' | 'tokens' | null
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<I18nWrapper>
|
|
54
|
-
<AuthWidget
|
|
55
|
-
{...args}
|
|
56
|
-
withModal
|
|
57
|
-
pwdOrTokens={pwdOrTokens}
|
|
58
|
-
setPwdOrTokens={setPwdOrTokens}
|
|
59
|
-
/>
|
|
60
|
-
</I18nWrapper>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const Password = Template.bind({});
|
|
65
|
-
Password.args = {
|
|
66
|
-
pwdOrTokens: 'password',
|
|
67
|
-
minimumNumberOfRecoveryTokens: 2,
|
|
68
|
-
showTokens: false,
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const WithTokens = Template.bind({});
|
|
72
|
-
WithTokens.args = {
|
|
73
|
-
pwdOrTokens: 'password',
|
|
74
|
-
minimumNumberOfRecoveryTokens: 2,
|
|
75
|
-
showTokens: true,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const Tokens = Template.bind({});
|
|
79
|
-
Tokens.args = {
|
|
80
|
-
pwdOrTokens: 'tokens',
|
|
81
|
-
minimumNumberOfRecoveryTokens: 2,
|
|
82
|
-
showTokens: true,
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const WithModal = TemplateWithModal.bind({});
|
|
86
|
-
WithModal.args = {
|
|
87
|
-
pwdOrTokens: 'password',
|
|
88
|
-
minimumNumberOfRecoveryTokens: 2,
|
|
89
|
-
showTokens: true,
|
|
90
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import Auth from './Auth';
|
|
4
|
-
|
|
5
|
-
it('renders Auth unchanged', () => {
|
|
6
|
-
const { container } = render(
|
|
7
|
-
<Auth
|
|
8
|
-
pwdOrTokens="password"
|
|
9
|
-
setPwdOrTokens={() => {}}
|
|
10
|
-
minimumNumberOfRecoveryTokens={2}
|
|
11
|
-
showTokens={false}
|
|
12
|
-
onFinish={() => Promise.resolve()}
|
|
13
|
-
withModal={false}
|
|
14
|
-
openModal
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
expect(container).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('renders Auth with tokens unchanged', () => {
|
|
21
|
-
const { container } = render(
|
|
22
|
-
<Auth
|
|
23
|
-
pwdOrTokens="password"
|
|
24
|
-
setPwdOrTokens={() => {}}
|
|
25
|
-
minimumNumberOfRecoveryTokens={2}
|
|
26
|
-
showTokens={true}
|
|
27
|
-
onFinish={() => Promise.resolve()}
|
|
28
|
-
withModal={false}
|
|
29
|
-
openModal
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
expect(container).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('renders Auth on tokens unchanged', () => {
|
|
36
|
-
const { container } = render(
|
|
37
|
-
<Auth
|
|
38
|
-
pwdOrTokens="tokens"
|
|
39
|
-
setPwdOrTokens={() => {}}
|
|
40
|
-
minimumNumberOfRecoveryTokens={2}
|
|
41
|
-
showTokens={true}
|
|
42
|
-
onFinish={() => Promise.resolve()}
|
|
43
|
-
withModal={false}
|
|
44
|
-
openModal
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
expect(container).toMatchSnapshot();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('renders Auth with modal unchanged', () => {
|
|
51
|
-
const { container } = render(
|
|
52
|
-
<Auth
|
|
53
|
-
pwdOrTokens="password"
|
|
54
|
-
setPwdOrTokens={() => {}}
|
|
55
|
-
minimumNumberOfRecoveryTokens={2}
|
|
56
|
-
showTokens={true}
|
|
57
|
-
onFinish={() => Promise.resolve()}
|
|
58
|
-
withModal={true}
|
|
59
|
-
openModal
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
62
|
-
expect(container).toMatchSnapshot();
|
|
63
|
-
});
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import Button from '../ui/Button';
|
|
4
|
-
import Modal from '../ui/Modal';
|
|
5
|
-
import { useForm, SubmitHandler } from 'react-hook-form';
|
|
6
|
-
import Plus from '../icons/Plus';
|
|
7
|
-
|
|
8
|
-
export interface Props {
|
|
9
|
-
pwdOrTokens: null | 'password' | 'tokens';
|
|
10
|
-
setPwdOrTokens: (state: null | 'password' | 'tokens') => void;
|
|
11
|
-
onFinish?: (values: AuthInputs) => Promise<void>;
|
|
12
|
-
minimumNumberOfRecoveryTokens?: number;
|
|
13
|
-
showTokens?: boolean;
|
|
14
|
-
withModal?: boolean;
|
|
15
|
-
openModal?: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type AuthInputs = {
|
|
19
|
-
password?: string;
|
|
20
|
-
tokens?: string[];
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
function createArrayWithNumbers(length: number) {
|
|
24
|
-
return Array.from({ length }, (_, i) => i);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const AuthWidget = ({
|
|
28
|
-
pwdOrTokens,
|
|
29
|
-
setPwdOrTokens,
|
|
30
|
-
onFinish,
|
|
31
|
-
minimumNumberOfRecoveryTokens = 1,
|
|
32
|
-
showTokens = true,
|
|
33
|
-
openModal = false,
|
|
34
|
-
withModal = false,
|
|
35
|
-
}: Props) => {
|
|
36
|
-
const { t } = useTranslation();
|
|
37
|
-
const {
|
|
38
|
-
register,
|
|
39
|
-
handleSubmit,
|
|
40
|
-
formState: { errors },
|
|
41
|
-
setError,
|
|
42
|
-
} = useForm<AuthInputs>();
|
|
43
|
-
const [numTokens, setNumTokens] = useState(1);
|
|
44
|
-
|
|
45
|
-
const [showModal, setShowModal] = useState(!!pwdOrTokens);
|
|
46
|
-
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
47
|
-
|
|
48
|
-
const onSubmit: SubmitHandler<AuthInputs> = data => {
|
|
49
|
-
const missingPassword = pwdOrTokens === 'password' && !data.password?.length;
|
|
50
|
-
const invalidTokens =
|
|
51
|
-
pwdOrTokens === 'tokens' &&
|
|
52
|
-
((data?.tokens?.length || 0) < minimumNumberOfRecoveryTokens ||
|
|
53
|
-
!data?.tokens?.every(t => t.length));
|
|
54
|
-
|
|
55
|
-
if (missingPassword) {
|
|
56
|
-
setError('password', {
|
|
57
|
-
type: 'required',
|
|
58
|
-
message: t('auth.passwordRequired') || 'Password required',
|
|
59
|
-
});
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (invalidTokens) {
|
|
64
|
-
setError('tokens', {
|
|
65
|
-
type: 'minLength',
|
|
66
|
-
message: t('auth.tokens') || 'Tokens',
|
|
67
|
-
});
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (onFinish) {
|
|
72
|
-
setIsSubmitting(true);
|
|
73
|
-
onFinish(data)
|
|
74
|
-
.then(() => {
|
|
75
|
-
setShowModal(false);
|
|
76
|
-
})
|
|
77
|
-
.catch(() => {
|
|
78
|
-
if (pwdOrTokens === 'password') {
|
|
79
|
-
setError('password', {
|
|
80
|
-
type: 'auth',
|
|
81
|
-
message: t('auth.invalidCredentials') || 'Invalid credentials',
|
|
82
|
-
});
|
|
83
|
-
} else if (pwdOrTokens === 'tokens') {
|
|
84
|
-
setError('tokens', {
|
|
85
|
-
type: 'auth',
|
|
86
|
-
message: t('auth.invalidCredentials') || 'Invalid credentials',
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
.finally(() => {
|
|
91
|
-
setIsSubmitting(false);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const form = (
|
|
97
|
-
<form
|
|
98
|
-
name="memoriAuth"
|
|
99
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
100
|
-
className="memori-auth-widget--form"
|
|
101
|
-
>
|
|
102
|
-
{(pwdOrTokens === 'password' || !showTokens) && (
|
|
103
|
-
<fieldset className="memori-auth-widget--password-fieldset">
|
|
104
|
-
<label>
|
|
105
|
-
Password:{' '}
|
|
106
|
-
<input
|
|
107
|
-
className="memori-auth-widget--input"
|
|
108
|
-
required
|
|
109
|
-
type="password"
|
|
110
|
-
placeholder="Password"
|
|
111
|
-
{...register('password', { required: true })}
|
|
112
|
-
/>
|
|
113
|
-
</label>
|
|
114
|
-
{showTokens && (
|
|
115
|
-
<>
|
|
116
|
-
<hr />
|
|
117
|
-
<Button outlined onClick={() => setPwdOrTokens('tokens')}>
|
|
118
|
-
{t('auth.useRecoveryTokens') || 'Recovery tokens'}
|
|
119
|
-
</Button>
|
|
120
|
-
</>
|
|
121
|
-
)}
|
|
122
|
-
</fieldset>
|
|
123
|
-
)}
|
|
124
|
-
{pwdOrTokens === 'tokens' && showTokens && (
|
|
125
|
-
<fieldset className="memori-auth-widget--tokens-fieldset" name="tokens">
|
|
126
|
-
<legend>{t('auth.tokens')}: </legend>
|
|
127
|
-
{createArrayWithNumbers(numTokens).map(idx => {
|
|
128
|
-
return (
|
|
129
|
-
<label className="memori-auth-widget--token" key={idx}>
|
|
130
|
-
<input
|
|
131
|
-
type="password"
|
|
132
|
-
className="memori-auth-widget--input"
|
|
133
|
-
placeholder="Recovery token"
|
|
134
|
-
required
|
|
135
|
-
autoComplete="off"
|
|
136
|
-
{...register(`tokens.${idx}`, {
|
|
137
|
-
required: true,
|
|
138
|
-
})}
|
|
139
|
-
/>
|
|
140
|
-
</label>
|
|
141
|
-
);
|
|
142
|
-
})}
|
|
143
|
-
|
|
144
|
-
<Button
|
|
145
|
-
onClick={() => setNumTokens(t => t + 1)}
|
|
146
|
-
className="memori-auth-widget--token-add"
|
|
147
|
-
icon={<Plus />}
|
|
148
|
-
>
|
|
149
|
-
{t('auth.addToken') || 'Add token'}
|
|
150
|
-
</Button>
|
|
151
|
-
|
|
152
|
-
<hr />
|
|
153
|
-
<Button outlined onClick={() => setPwdOrTokens('password')}>
|
|
154
|
-
{t('auth.usePassword') || 'Password'}
|
|
155
|
-
</Button>
|
|
156
|
-
</fieldset>
|
|
157
|
-
)}
|
|
158
|
-
|
|
159
|
-
{errors.tokens?.type === 'minLength' && (
|
|
160
|
-
<div className="memori-auth-widget--error">
|
|
161
|
-
{t('auth.atLeast') || 'At least'} {minimumNumberOfRecoveryTokens}
|
|
162
|
-
</div>
|
|
163
|
-
)}
|
|
164
|
-
|
|
165
|
-
{errors.password?.type === 'auth' && (
|
|
166
|
-
<div className="memori-auth-widget--error">
|
|
167
|
-
{errors.password.message}
|
|
168
|
-
</div>
|
|
169
|
-
)}
|
|
170
|
-
{errors.tokens?.type === 'auth' && (
|
|
171
|
-
<div className="memori-auth-widget--error">
|
|
172
|
-
{errors.tokens.message}
|
|
173
|
-
</div>
|
|
174
|
-
)}
|
|
175
|
-
|
|
176
|
-
<Button
|
|
177
|
-
htmlType="submit"
|
|
178
|
-
primary
|
|
179
|
-
className="memori-auth-widget--submit"
|
|
180
|
-
loading={isSubmitting}
|
|
181
|
-
>
|
|
182
|
-
{t('confirm') || 'Submit'}
|
|
183
|
-
</Button>
|
|
184
|
-
</form>
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
return withModal ? (
|
|
188
|
-
<Modal
|
|
189
|
-
open={openModal || showModal}
|
|
190
|
-
title={t('auth.title') || 'Authentication'}
|
|
191
|
-
onClose={() => setPwdOrTokens(null)}
|
|
192
|
-
closable={false}
|
|
193
|
-
>
|
|
194
|
-
{form}
|
|
195
|
-
</Modal>
|
|
196
|
-
) : (
|
|
197
|
-
form
|
|
198
|
-
);
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
export default AuthWidget;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders Auth on tokens unchanged 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<form
|
|
6
|
-
class="memori-auth-widget--form"
|
|
7
|
-
name="memoriAuth"
|
|
8
|
-
>
|
|
9
|
-
<fieldset
|
|
10
|
-
class="memori-auth-widget--tokens-fieldset"
|
|
11
|
-
name="tokens"
|
|
12
|
-
>
|
|
13
|
-
<legend>
|
|
14
|
-
auth.tokens
|
|
15
|
-
:
|
|
16
|
-
</legend>
|
|
17
|
-
<label
|
|
18
|
-
class="memori-auth-widget--token"
|
|
19
|
-
>
|
|
20
|
-
<input
|
|
21
|
-
autocomplete="off"
|
|
22
|
-
class="memori-auth-widget--input"
|
|
23
|
-
name="tokens.0"
|
|
24
|
-
placeholder="Recovery token"
|
|
25
|
-
required=""
|
|
26
|
-
type="password"
|
|
27
|
-
/>
|
|
28
|
-
</label>
|
|
29
|
-
<button
|
|
30
|
-
class="memori-button memori-button--rounded memori-button--padded memori-button--with-icon memori-auth-widget--token-add"
|
|
31
|
-
>
|
|
32
|
-
<span
|
|
33
|
-
class="memori-button--icon"
|
|
34
|
-
>
|
|
35
|
-
<svg
|
|
36
|
-
aria-hidden="true"
|
|
37
|
-
focusable="false"
|
|
38
|
-
role="img"
|
|
39
|
-
viewBox="0 0 1024 1024"
|
|
40
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
-
>
|
|
42
|
-
<path
|
|
43
|
-
d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"
|
|
44
|
-
/>
|
|
45
|
-
<path
|
|
46
|
-
d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"
|
|
47
|
-
/>
|
|
48
|
-
</svg>
|
|
49
|
-
</span>
|
|
50
|
-
auth.addToken
|
|
51
|
-
</button>
|
|
52
|
-
<hr />
|
|
53
|
-
<button
|
|
54
|
-
class="memori-button memori-button--outlined memori-button--rounded memori-button--padded"
|
|
55
|
-
>
|
|
56
|
-
auth.usePassword
|
|
57
|
-
</button>
|
|
58
|
-
</fieldset>
|
|
59
|
-
<button
|
|
60
|
-
class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori-auth-widget--submit"
|
|
61
|
-
type="submit"
|
|
62
|
-
>
|
|
63
|
-
confirm
|
|
64
|
-
</button>
|
|
65
|
-
</form>
|
|
66
|
-
</div>
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
exports[`renders Auth unchanged 1`] = `
|
|
70
|
-
<div>
|
|
71
|
-
<form
|
|
72
|
-
class="memori-auth-widget--form"
|
|
73
|
-
name="memoriAuth"
|
|
74
|
-
>
|
|
75
|
-
<fieldset
|
|
76
|
-
class="memori-auth-widget--password-fieldset"
|
|
77
|
-
>
|
|
78
|
-
<label>
|
|
79
|
-
Password:
|
|
80
|
-
|
|
81
|
-
<input
|
|
82
|
-
class="memori-auth-widget--input"
|
|
83
|
-
name="password"
|
|
84
|
-
placeholder="Password"
|
|
85
|
-
required=""
|
|
86
|
-
type="password"
|
|
87
|
-
/>
|
|
88
|
-
</label>
|
|
89
|
-
</fieldset>
|
|
90
|
-
<button
|
|
91
|
-
class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori-auth-widget--submit"
|
|
92
|
-
type="submit"
|
|
93
|
-
>
|
|
94
|
-
confirm
|
|
95
|
-
</button>
|
|
96
|
-
</form>
|
|
97
|
-
</div>
|
|
98
|
-
`;
|
|
99
|
-
|
|
100
|
-
exports[`renders Auth with modal unchanged 1`] = `
|
|
101
|
-
<div>
|
|
102
|
-
<div
|
|
103
|
-
style="position: fixed; top: 1px; left: 1px; width: 1px; height: 0px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border-width: 0px; display: none;"
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
`;
|
|
107
|
-
|
|
108
|
-
exports[`renders Auth with tokens unchanged 1`] = `
|
|
109
|
-
<div>
|
|
110
|
-
<form
|
|
111
|
-
class="memori-auth-widget--form"
|
|
112
|
-
name="memoriAuth"
|
|
113
|
-
>
|
|
114
|
-
<fieldset
|
|
115
|
-
class="memori-auth-widget--password-fieldset"
|
|
116
|
-
>
|
|
117
|
-
<label>
|
|
118
|
-
Password:
|
|
119
|
-
|
|
120
|
-
<input
|
|
121
|
-
class="memori-auth-widget--input"
|
|
122
|
-
name="password"
|
|
123
|
-
placeholder="Password"
|
|
124
|
-
required=""
|
|
125
|
-
type="password"
|
|
126
|
-
/>
|
|
127
|
-
</label>
|
|
128
|
-
<hr />
|
|
129
|
-
<button
|
|
130
|
-
class="memori-button memori-button--outlined memori-button--rounded memori-button--padded"
|
|
131
|
-
>
|
|
132
|
-
auth.useRecoveryTokens
|
|
133
|
-
</button>
|
|
134
|
-
</fieldset>
|
|
135
|
-
<button
|
|
136
|
-
class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori-auth-widget--submit"
|
|
137
|
-
type="submit"
|
|
138
|
-
>
|
|
139
|
-
confirm
|
|
140
|
-
</button>
|
|
141
|
-
</form>
|
|
142
|
-
</div>
|
|
143
|
-
`;
|