@memori.ai/memori-react 8.45.1 → 8.45.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/components/Chat/Chat.js +4 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +4 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +2 -1
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/PositionPopover/PositionPopover.js +38 -25
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
- package/dist/components/UploadButton/UploadButton.js +3 -0
- package/dist/components/UploadButton/UploadButton.js.map +1 -1
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +14 -2
- package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/dist/components/layouts/chat.css +27 -4
- package/dist/context/widgetSurfaceContext.js +2 -2
- package/dist/context/widgetSurfaceContext.js.map +1 -1
- package/dist/helpers/constants.d.ts +3 -2
- package/dist/helpers/constants.js +19 -20
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/positionPopover.d.ts +2 -1
- package/dist/helpers/positionPopover.js +12 -3
- package/dist/helpers/positionPopover.js.map +1 -1
- package/dist/helpers/tts/muteSpeaker.js +4 -3
- package/dist/helpers/tts/muteSpeaker.js.map +1 -1
- package/dist/helpers/usePressTooltip.js +2 -1
- package/dist/helpers/usePressTooltip.js.map +1 -1
- package/dist/helpers/utils.d.ts +2 -1
- package/dist/helpers/utils.js +7 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/icons/MemoriIcon.js +1 -1
- package/dist/icons/MemoriIcon.js.map +1 -1
- package/dist/styles.css +1 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/Chat/Chat.js +4 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +2 -1
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/UploadButton/UploadButton.js +4 -1
- package/esm/components/UploadButton/UploadButton.js.map +1 -1
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +16 -4
- package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
- package/esm/components/layouts/chat.css +27 -4
- package/esm/helpers/constants.d.ts +3 -2
- package/esm/helpers/constants.js +18 -19
- package/esm/helpers/constants.js.map +1 -1
- package/esm/helpers/utils.d.ts +2 -1
- package/esm/helpers/utils.js +6 -1
- package/esm/helpers/utils.js.map +1 -1
- package/esm/styles.css +1 -2
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +6 -7
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.d.ts +0 -3
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js +0 -64
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map +0 -1
- package/dist/testUtils.d.ts +0 -5
- package/dist/testUtils.js +0 -18
- package/dist/testUtils.js.map +0 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.d.ts +0 -3
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js +0 -62
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map +0 -1
- package/src/I18nWrapper.tsx +0 -13
- package/src/__snapshots__/index.test.tsx.snap +0 -96
- package/src/components/AgeVerificationModal/AgeVerificationModal.css +0 -95
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +0 -46
- package/src/components/AgeVerificationModal/AgeVerificationModal.test.tsx +0 -33
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +0 -99
- package/src/components/AgeVerificationModal/__snapshots__/AgeVerificationModal.test.tsx.snap +0 -19
- package/src/components/Auth/Auth.css +0 -57
- package/src/components/Auth/Auth.stories.tsx +0 -90
- package/src/components/Auth/Auth.test.tsx +0 -63
- package/src/components/Auth/Auth.tsx +0 -201
- package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +0 -143
- package/src/components/Avatar/Avatar.css +0 -151
- package/src/components/Avatar/Avatar.stories.tsx +0 -160
- package/src/components/Avatar/Avatar.test.tsx +0 -158
- package/src/components/Avatar/Avatar.tsx +0 -245
- package/src/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.tsx +0 -103
- package/src/components/Avatar/AvatarView/AvatarComponent/avatarComponent.tsx +0 -105
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +0 -338
- package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/types.ts +0 -44
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.ts +0 -1091
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarPositionController.ts +0 -83
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.ts +0 -301
- package/src/components/Avatar/AvatarView/AvatarComponent/components/controls.tsx +0 -100
- package/src/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.tsx +0 -152
- package/src/components/Avatar/AvatarView/AvatarComponent/components/loader.tsx +0 -31
- package/src/components/Avatar/AvatarView/AvatarComponent/constants.ts +0 -141
- package/src/components/Avatar/AvatarView/AvatarComponent/lights/Lights.tsx +0 -145
- package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.css +0 -111
- package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.tsx +0 -201
- package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +0 -254
- package/src/components/Avatar/AvatarView/index.tsx +0 -194
- package/src/components/Avatar/AvatarView/utils/hideHands.ts +0 -11
- package/src/components/Avatar/AvatarView/utils/useEyeBlink.ts +0 -100
- package/src/components/Avatar/AvatarView/utils/useHeadMovement.ts +0 -72
- package/src/components/Avatar/AvatarView/utils/useLoadingMorphAnim.ts +0 -38
- package/src/components/Avatar/AvatarView/utils/useMouthAnimation.ts +0 -93
- package/src/components/Avatar/AvatarView/utils/useSmile.ts +0 -39
- package/src/components/Avatar/AvatarView/utils/utils.ts +0 -55
- package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +0 -246
- package/src/components/Blob/Blob.css +0 -286
- package/src/components/Blob/Blob.stories.tsx +0 -53
- package/src/components/Blob/Blob.test.tsx +0 -18
- package/src/components/Blob/Blob.tsx +0 -26
- package/src/components/Blob/__snapshots__/Blob.test.tsx.snap +0 -80
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +0 -40
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +0 -58
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.test.tsx +0 -53
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx +0 -74
- package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +0 -181
- package/src/components/ChangeMode/ChangeMode.css +0 -22
- package/src/components/ChangeMode/ChangeMode.stories.tsx +0 -50
- package/src/components/ChangeMode/ChangeMode.test.tsx +0 -24
- package/src/components/ChangeMode/ChangeMode.tsx +0 -51
- package/src/components/ChangeMode/__snapshots__/ChangeMode.test.tsx.snap +0 -107
- package/src/components/Chat/Chat.css +0 -285
- package/src/components/Chat/Chat.stories.tsx +0 -1684
- package/src/components/Chat/Chat.test.tsx +0 -372
- package/src/components/Chat/Chat.tsx +0 -778
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +0 -6816
- package/src/components/ChatBubble/ChatBubble.css +0 -430
- package/src/components/ChatBubble/ChatBubble.stories.tsx +0 -1192
- package/src/components/ChatBubble/ChatBubble.test.tsx +0 -481
- package/src/components/ChatBubble/ChatBubble.tsx +0 -776
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +0 -8734
- package/src/components/ChatHistoryDrawer/ChatHistory.css +0 -587
- package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +0 -410
- package/src/components/ChatHistoryDrawer/ChatHistory.test.tsx +0 -107
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +0 -1298
- package/src/components/ChatHistoryDrawer/__snapshots__/ChatHistory.test.tsx.snap +0 -27
- package/src/components/ChatInputs/ChatInputs.css +0 -340
- package/src/components/ChatInputs/ChatInputs.stories.tsx +0 -251
- package/src/components/ChatInputs/ChatInputs.tsx +0 -487
- package/src/components/ChatTextArea/ChatTextArea.css +0 -185
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
- package/src/components/ChatTextArea/ChatTextArea.test.tsx +0 -28
- package/src/components/ChatTextArea/ChatTextArea.tsx +0 -171
- package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +0 -68
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.css +0 -36
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +0 -296
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.test.tsx +0 -31
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +0 -232
- package/src/components/CompletionProviderStatus/__snapshots__/CompletionProviderStatus.test.tsx.snap +0 -96
- package/src/components/ContentPreviewModal/ContentPreviewModal.css +0 -128
- package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +0 -67
- package/src/components/ContentPreviewModal/index.ts +0 -2
- package/src/components/CustomGLBModelViewer/ModelViewer.css +0 -11
- package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
- package/src/components/CustomGLBModelViewer/ModelViewer.test.tsx +0 -13
- package/src/components/CustomGLBModelViewer/ModelViewer.tsx +0 -37
- package/src/components/CustomGLBModelViewer/__snapshots__/ModelViewer.test.tsx.snap +0 -20
- package/src/components/DateSelector/DateSelector.css +0 -158
- package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
- package/src/components/DateSelector/DateSelector.test.tsx +0 -149
- package/src/components/DateSelector/DateSelector.tsx +0 -251
- package/src/components/DateSelector/__snapshots__/DateSelector.test.tsx.snap +0 -1954
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +0 -54
- package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -67
- package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +0 -54
- package/src/components/ExpertsDrawer/ExpertsDrawer.test.tsx +0 -53
- package/src/components/ExpertsDrawer/ExpertsDrawer.tsx +0 -69
- package/src/components/ExpertsDrawer/__snapshots__/ExpertsDrawer.test.tsx.snap +0 -11
- package/src/components/ExportHistoryButton/ExportHistoryButton.css +0 -22
- package/src/components/FeedbackButtons/FeedbackButtons.css +0 -107
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +0 -52
- package/src/components/FeedbackButtons/FeedbackButtons.test.tsx +0 -11
- package/src/components/FeedbackButtons/FeedbackButtons.tsx +0 -152
- package/src/components/FeedbackButtons/__snapshots__/FeedbackButtons.test.tsx.snap +0 -42
- package/src/components/FilePreview/FilePreview.css +0 -358
- package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
- package/src/components/FilePreview/FilePreview.test.tsx +0 -26
- package/src/components/FilePreview/FilePreview.tsx +0 -277
- package/src/components/FilePreview/__snapshots__/FilePreview.test.tsx.snap +0 -185
- package/src/components/Header/ChatConsumptionDropdown.test.tsx +0 -117
- package/src/components/Header/ChatConsumptionDropdown.tsx +0 -275
- package/src/components/Header/Header.css +0 -282
- package/src/components/Header/Header.stories.tsx +0 -338
- package/src/components/Header/Header.test.tsx +0 -371
- package/src/components/Header/Header.tsx +0 -442
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +0 -964
- package/src/components/KnownFacts/KnownFacts.css +0 -19
- package/src/components/KnownFacts/KnownFacts.stories.tsx +0 -80
- package/src/components/KnownFacts/KnownFacts.test.tsx +0 -57
- package/src/components/KnownFacts/KnownFacts.tsx +0 -376
- package/src/components/KnownFacts/__snapshots__/KnownFacts.test.tsx.snap +0 -19
- package/src/components/LoginDrawer/LoginDrawer.css +0 -1616
- package/src/components/LoginDrawer/LoginDrawer.stories.tsx +0 -102
- package/src/components/LoginDrawer/LoginDrawer.test.tsx +0 -199
- package/src/components/LoginDrawer/LoginDrawer.tsx +0 -600
- package/src/components/LoginDrawer/__snapshots__/LoginDrawer.test.tsx.snap +0 -91
- package/src/components/MediaWidget/DocumentCard.test.tsx +0 -45
- package/src/components/MediaWidget/DocumentCard.tsx +0 -19
- package/src/components/MediaWidget/MediaItemWidget.css +0 -1398
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +0 -423
- package/src/components/MediaWidget/MediaItemWidget.test.tsx +0 -248
- package/src/components/MediaWidget/MediaItemWidget.tsx +0 -997
- package/src/components/MediaWidget/MediaItemWidget.types.ts +0 -65
- package/src/components/MediaWidget/MediaItemWidget.utils.test.ts +0 -367
- package/src/components/MediaWidget/MediaItemWidget.utils.ts +0 -227
- package/src/components/MediaWidget/MediaPreviewModal.test.tsx +0 -271
- package/src/components/MediaWidget/MediaPreviewModal.tsx +0 -425
- package/src/components/MediaWidget/MediaWidget.css +0 -131
- package/src/components/MediaWidget/MediaWidget.stories.tsx +0 -319
- package/src/components/MediaWidget/MediaWidget.test.tsx +0 -41
- package/src/components/MediaWidget/MediaWidget.tsx +0 -107
- package/src/components/MediaWidget/__snapshots__/DocumentCard.test.tsx.snap +0 -24
- package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +0 -791
- package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +0 -154
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -2299
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +0 -163
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +0 -250
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +0 -30
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.tsx +0 -467
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.tsx +0 -89
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts +0 -619
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/index.ts +0 -9
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +0 -489
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.tsx +0 -90
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/types.ts +0 -73
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/utils/PDFExporter.ts +0 -454
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +0 -1059
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +0 -431
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +0 -150
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.tsx +0 -79
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +0 -253
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +0 -561
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +0 -355
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +0 -160
- package/src/components/MemoriArtifactSystem/context/ArtifactContext.tsx +0 -167
- package/src/components/MemoriArtifactSystem/types/artifact.types.ts +0 -35
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +0 -308
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.tsx +0 -379
- package/src/components/MemoriArtifactSystem/utils/applyEdits.test.ts +0 -85
- package/src/components/MemoriArtifactSystem/utils/applyEdits.ts +0 -173
- package/src/components/MemoriWidget/MemoriWidget.css +0 -220
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +0 -274
- package/src/components/MemoriWidget/MemoriWidget.tsx +0 -3930
- package/src/components/MicrophoneButton/MicrophoneButton.css +0 -142
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +0 -52
- package/src/components/MicrophoneButton/MicrophoneButton.tsx +0 -128
- package/src/components/PositionDrawer/PositionDrawer.stories.tsx +0 -51
- package/src/components/PositionDrawer/PositionDrawer.test.tsx +0 -39
- package/src/components/PositionDrawer/PositionDrawer.tsx +0 -50
- package/src/components/PositionDrawer/__snapshots__/PositionDrawer.test.tsx.snap +0 -17
- package/src/components/PoweredBy/PoweredBy.css +0 -47
- package/src/components/PoweredBy/PoweredBy.stories.tsx +0 -75
- package/src/components/PoweredBy/PoweredBy.test.tsx +0 -15
- package/src/components/PoweredBy/PoweredBy.tsx +0 -44
- package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +0 -55
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.css +0 -47
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +0 -58
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.test.tsx +0 -17
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.tsx +0 -82
- package/src/components/SendOnEnterMenu/__snapshots__/SendOnEnterMenu.test.tsx.snap +0 -57
- package/src/components/SettingsDrawer/SettingsDrawer.css +0 -24
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +0 -94
- package/src/components/SettingsDrawer/SettingsDrawer.test.tsx +0 -202
- package/src/components/SettingsDrawer/SettingsDrawer.tsx +0 -255
- package/src/components/SettingsDrawer/__snapshots__/SettingsDrawer.test.tsx.snap +0 -59
- package/src/components/ShareButton/ShareButton.css +0 -73
- package/src/components/ShareButton/ShareButton.stories.tsx +0 -98
- package/src/components/ShareButton/ShareButton.test.tsx +0 -53
- package/src/components/ShareButton/ShareButton.tsx +0 -395
- package/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap +0 -316
- package/src/components/Snippet/Snippet.css +0 -142
- package/src/components/Snippet/Snippet.stories.tsx +0 -286
- package/src/components/Snippet/Snippet.test.tsx +0 -176
- package/src/components/Snippet/Snippet.tsx +0 -148
- package/src/components/Snippet/__snapshots__/Snippet.test.tsx.snap +0 -603
- package/src/components/StartPanel/StartPanel.css +0 -273
- package/src/components/StartPanel/StartPanel.stories.tsx +0 -404
- package/src/components/StartPanel/StartPanel.test.tsx +0 -360
- package/src/components/StartPanel/StartPanel.tsx +0 -426
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +0 -1986
- package/src/components/Typing/Typing.stories.tsx +0 -130
- package/src/components/Typing/Typing.test.tsx +0 -62
- package/src/components/Typing/Typing.tsx +0 -154
- package/src/components/Typing/__snapshots__/Typing.test.tsx.snap +0 -133
- package/src/components/UploadButton/UploadButton.css +0 -542
- package/src/components/UploadButton/UploadButton.stories.tsx +0 -376
- package/src/components/UploadButton/UploadButton.test.tsx +0 -11
- package/src/components/UploadButton/UploadButton.tsx +0 -684
- package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +0 -405
- package/src/components/UploadButton/UploadImages/UploadImages.tsx +0 -538
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +0 -165
- package/src/components/VenueWidget/VenueWidget.css +0 -163
- package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -66
- package/src/components/VenueWidget/VenueWidget.test.tsx +0 -49
- package/src/components/VenueWidget/VenueWidget.tsx +0 -458
- package/src/components/VenueWidget/__snapshots__/VenueWidget.test.tsx.snap +0 -370
- package/src/components/WhyThisAnswer/WhyThisAnswer.css +0 -171
- package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +0 -285
- package/src/components/WhyThisAnswer/WhyThisAnswer.test.tsx +0 -245
- package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +0 -233
- package/src/components/WhyThisAnswer/__snapshots__/WhyThisAnswer.test.tsx.snap +0 -27
- package/src/components/icons/AI.tsx +0 -34
- package/src/components/icons/Alert.tsx +0 -31
- package/src/components/icons/ArrowUp.tsx +0 -28
- package/src/components/icons/Bug.tsx +0 -81
- package/src/components/icons/Chat.tsx +0 -30
- package/src/components/icons/ChevronDown.tsx +0 -26
- package/src/components/icons/ChevronLeft.tsx +0 -28
- package/src/components/icons/ChevronRight.tsx +0 -28
- package/src/components/icons/ChevronUp.tsx +0 -24
- package/src/components/icons/Clear.tsx +0 -23
- package/src/components/icons/Close.tsx +0 -30
- package/src/components/icons/Code.tsx +0 -24
- package/src/components/icons/Copy.tsx +0 -23
- package/src/components/icons/DeepThought.tsx +0 -38
- package/src/components/icons/Delete.tsx +0 -23
- package/src/components/icons/Document.tsx +0 -50
- package/src/components/icons/Download.tsx +0 -23
- package/src/components/icons/Edit.tsx +0 -17
- package/src/components/icons/Expand.tsx +0 -23
- package/src/components/icons/Eye.tsx +0 -17
- package/src/components/icons/EyeInvisible.tsx +0 -24
- package/src/components/icons/Facebook.tsx +0 -23
- package/src/components/icons/Feedback.tsx +0 -24
- package/src/components/icons/File.tsx +0 -17
- package/src/components/icons/FileExcel.tsx +0 -23
- package/src/components/icons/FilePdf.tsx +0 -23
- package/src/components/icons/FileWord.tsx +0 -23
- package/src/components/icons/Fullscreen.tsx +0 -23
- package/src/components/icons/FullscreenExit.tsx +0 -23
- package/src/components/icons/GasStation.tsx +0 -36
- package/src/components/icons/Group.tsx +0 -30
- package/src/components/icons/History.tsx +0 -33
- package/src/components/icons/Image.tsx +0 -37
- package/src/components/icons/Info.tsx +0 -31
- package/src/components/icons/Link.tsx +0 -17
- package/src/components/icons/Linkedin.tsx +0 -23
- package/src/components/icons/Loading.tsx +0 -28
- package/src/components/icons/Logout.tsx +0 -27
- package/src/components/icons/Mail.tsx +0 -17
- package/src/components/icons/MapMarker.tsx +0 -26
- package/src/components/icons/MenuHorizontal.tsx +0 -29
- package/src/components/icons/MenuVertical.tsx +0 -29
- package/src/components/icons/Message.tsx +0 -23
- package/src/components/icons/Microphone.tsx +0 -23
- package/src/components/icons/Minus.tsx +0 -23
- package/src/components/icons/MinusCircle.tsx +0 -24
- package/src/components/icons/PaperClip.tsx +0 -23
- package/src/components/icons/Picture.tsx +0 -23
- package/src/components/icons/Plus.tsx +0 -18
- package/src/components/icons/Preview.tsx +0 -29
- package/src/components/icons/Print.tsx +0 -38
- package/src/components/icons/QuestionHelp.tsx +0 -30
- package/src/components/icons/Refresh.tsx +0 -30
- package/src/components/icons/SelectIcon.tsx +0 -28
- package/src/components/icons/Send.tsx +0 -17
- package/src/components/icons/Setting.tsx +0 -23
- package/src/components/icons/Share.tsx +0 -23
- package/src/components/icons/Sound.tsx +0 -23
- package/src/components/icons/SoundDeactivated.tsx +0 -27
- package/src/components/icons/Telegram.tsx +0 -26
- package/src/components/icons/ThumbDown.tsx +0 -29
- package/src/components/icons/ThumbUp.tsx +0 -29
- package/src/components/icons/Translation.tsx +0 -24
- package/src/components/icons/Twitter.tsx +0 -23
- package/src/components/icons/Upload.tsx +0 -34
- package/src/components/icons/User.tsx +0 -17
- package/src/components/icons/Warning.tsx +0 -24
- package/src/components/icons/WhatsApp.tsx +0 -24
- package/src/components/icons/icons.stories.css +0 -5
- package/src/components/icons/icons.stories.tsx +0 -81
- package/src/components/icons/loading.css +0 -14
- package/src/components/layouts/Chat.test.tsx +0 -40
- package/src/components/layouts/Chat.tsx +0 -69
- package/src/components/layouts/FullBody/FullBody.stories.tsx +0 -110
- package/src/components/layouts/FullPage.test.tsx +0 -65
- package/src/components/layouts/FullPage.tsx +0 -80
- package/src/components/layouts/HiddenChat.test.tsx +0 -40
- package/src/components/layouts/HiddenChat.tsx +0 -233
- package/src/components/layouts/Totem/Totem.stories.tsx +0 -131
- package/src/components/layouts/Totem.test.tsx +0 -40
- package/src/components/layouts/Totem.tsx +0 -49
- package/src/components/layouts/WebsiteAssistant.test.tsx +0 -40
- package/src/components/layouts/WebsiteAssistant.tsx +0 -132
- package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +0 -131
- package/src/components/layouts/ZoomedFullBody.test.tsx +0 -40
- package/src/components/layouts/ZoomedFullBody.tsx +0 -81
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +0 -457
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +0 -1045
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +0 -460
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +0 -566
- package/src/components/layouts/__snapshots__/WebsiteAssistant.test.tsx.snap +0 -59
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +0 -523
- package/src/components/layouts/chat.css +0 -451
- package/src/components/layouts/hidden-chat.css +0 -276
- package/src/components/layouts/layouts.stories.tsx +0 -231
- package/src/components/layouts/totem.css +0 -221
- package/src/components/layouts/website-assistant.css +0 -677
- package/src/components/layouts/zoomed-full-body.css +0 -18
- package/src/components/ui/Alert.css +0 -93
- package/src/components/ui/Alert.stories.tsx +0 -137
- package/src/components/ui/Alert.test.tsx +0 -129
- package/src/components/ui/Alert.tsx +0 -123
- package/src/components/ui/Button.css +0 -167
- package/src/components/ui/Button.stories.tsx +0 -156
- package/src/components/ui/Button.test.tsx +0 -74
- package/src/components/ui/Button.tsx +0 -107
- package/src/components/ui/Card.css +0 -65
- package/src/components/ui/Card.stories.tsx +0 -95
- package/src/components/ui/Card.test.tsx +0 -47
- package/src/components/ui/Card.tsx +0 -48
- package/src/components/ui/Checkbox.css +0 -116
- package/src/components/ui/Checkbox.stories.tsx +0 -74
- package/src/components/ui/Checkbox.test.tsx +0 -28
- package/src/components/ui/Checkbox.tsx +0 -58
- package/src/components/ui/ConfirmDialog.css +0 -42
- package/src/components/ui/ConfirmDialog.stories.tsx +0 -216
- package/src/components/ui/ConfirmDialog.test.tsx +0 -124
- package/src/components/ui/ConfirmDialog.tsx +0 -58
- package/src/components/ui/Details.css +0 -66
- package/src/components/ui/Drawer.css +0 -270
- package/src/components/ui/Drawer.stories.tsx +0 -267
- package/src/components/ui/Drawer.test.tsx +0 -130
- package/src/components/ui/Drawer.tsx +0 -293
- package/src/components/ui/Dropdown.css +0 -173
- package/src/components/ui/Dropdown.tsx +0 -63
- package/src/components/ui/Expandable.css +0 -15
- package/src/components/ui/Expandable.stories.tsx +0 -180
- package/src/components/ui/Expandable.test.tsx +0 -107
- package/src/components/ui/Expandable.tsx +0 -121
- package/src/components/ui/Modal.css +0 -98
- package/src/components/ui/Modal.stories.tsx +0 -171
- package/src/components/ui/Modal.test.tsx +0 -111
- package/src/components/ui/Modal.tsx +0 -117
- package/src/components/ui/Select.css +0 -138
- package/src/components/ui/Select.stories.tsx +0 -79
- package/src/components/ui/Select.test.tsx +0 -84
- package/src/components/ui/Select.tsx +0 -79
- package/src/components/ui/Slider.css +0 -192
- package/src/components/ui/Slider.stories.tsx +0 -63
- package/src/components/ui/Slider.tsx +0 -142
- package/src/components/ui/Spin.css +0 -31
- package/src/components/ui/Spin.stories.tsx +0 -64
- package/src/components/ui/Spin.test.tsx +0 -41
- package/src/components/ui/Spin.tsx +0 -31
- package/src/components/ui/Table.css +0 -132
- package/src/components/ui/Tooltip.css +0 -171
- package/src/components/ui/Tooltip.stories.tsx +0 -109
- package/src/components/ui/Tooltip.test.tsx +0 -102
- package/src/components/ui/Tooltip.tsx +0 -163
- package/src/components/ui/__snapshots__/Alert.test.tsx.snap +0 -59
- package/src/components/ui/__snapshots__/Button.test.tsx.snap +0 -204
- package/src/components/ui/__snapshots__/Card.test.tsx.snap +0 -321
- package/src/components/ui/__snapshots__/Checkbox.test.tsx.snap +0 -131
- package/src/components/ui/__snapshots__/ConfirmDialog.test.tsx.snap +0 -35
- package/src/components/ui/__snapshots__/Drawer.test.tsx.snap +0 -67
- package/src/components/ui/__snapshots__/Expandable.test.tsx.snap +0 -159
- package/src/components/ui/__snapshots__/Modal.test.tsx.snap +0 -59
- package/src/components/ui/__snapshots__/Select.test.tsx.snap +0 -254
- package/src/components/ui/__snapshots__/Spin.test.tsx.snap +0 -193
- package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +0 -113
- package/src/components/ui/definitions.stories.tsx +0 -139
- package/src/context/visemeContext.tsx +0 -384
- package/src/helpers/chatPdfExport.ts +0 -544
- package/src/helpers/configuration.ts +0 -42
- package/src/helpers/constants.ts +0 -267
- package/src/helpers/convertDocument.test.ts +0 -67
- package/src/helpers/convertDocument.ts +0 -35
- package/src/helpers/credits.ts +0 -54
- package/src/helpers/error.test.ts +0 -29
- package/src/helpers/error.ts +0 -278
- package/src/helpers/imageCompression.ts +0 -230
- package/src/helpers/llmUsage.ts +0 -328
- package/src/helpers/markedExtendedTables.js +0 -217
- package/src/helpers/media.test.ts +0 -169
- package/src/helpers/media.ts +0 -81
- package/src/helpers/message.test.ts +0 -126
- package/src/helpers/message.ts +0 -219
- package/src/helpers/nats/getNatsConfig.ts +0 -148
- package/src/helpers/nats/isSessionExpiredError.test.ts +0 -38
- package/src/helpers/nats/isSessionExpiredError.ts +0 -51
- package/src/helpers/nats/useNats.test.tsx +0 -81
- package/src/helpers/nats/useNats.ts +0 -204
- package/src/helpers/nats/useNatsSession.test.ts +0 -16
- package/src/helpers/nats/useNatsSession.ts +0 -460
- package/src/helpers/piiDetection.test.ts +0 -186
- package/src/helpers/piiDetection.ts +0 -91
- package/src/helpers/sanitizer.ts +0 -17
- package/src/helpers/statistics.ts +0 -58
- package/src/helpers/stt/useSTT.ts +0 -515
- package/src/helpers/translations.ts +0 -39
- package/src/helpers/tts/ttsVoiceUtility.ts +0 -275
- package/src/helpers/tts/useTTS.ts +0 -621
- package/src/helpers/utils.test.ts +0 -321
- package/src/helpers/utils.ts +0 -586
- package/src/helpers/venue.ts +0 -36
- package/src/i18n.ts +0 -39
- package/src/index.stories.tsx +0 -220
- package/src/index.test.tsx +0 -156
- package/src/index.tsx +0 -592
- package/src/locales/de.json +0 -680
- package/src/locales/en.json +0 -754
- package/src/locales/es.json +0 -682
- package/src/locales/fr.json +0 -682
- package/src/locales/it.json +0 -750
- package/src/mocks/data.ts +0 -790
- package/src/styles.css +0 -126
- package/src/types/integration.test.ts +0 -32
- package/src/types/integration.ts +0 -31
- package/src/types/layout.ts +0 -50
- package/src/version.ts +0 -2
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import Expandable, { Props } from './Expandable';
|
|
4
|
-
|
|
5
|
-
import './Expandable.css';
|
|
6
|
-
|
|
7
|
-
const meta: Meta = {
|
|
8
|
-
title: 'UI/Expandable',
|
|
9
|
-
component: Expandable,
|
|
10
|
-
argTypes: {
|
|
11
|
-
className: {
|
|
12
|
-
control: {
|
|
13
|
-
type: 'text',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
parameters: {
|
|
18
|
-
controls: { expanded: true },
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
const Template: Story<Props> = args => (
|
|
25
|
-
<Expandable {...args}>
|
|
26
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
27
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a
|
|
28
|
-
sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
29
|
-
nisi. Lorem Ipsum is simply dummy text of the printing and typesetting
|
|
30
|
-
industry. Lorem Ipsum has been the industry's standard dummy text ever
|
|
31
|
-
since the 1500s, when an unknown printer took a galley of type and scrambled
|
|
32
|
-
it to make a type specimen book. It has survived not only five centuries,
|
|
33
|
-
but also the leap into electronic typesetting, remaining essentially
|
|
34
|
-
unchanged. It was popularised in the 1960s with the release of Letraset
|
|
35
|
-
sheets containing Lorem Ipsum passages, and more recently with desktop
|
|
36
|
-
publishing software like Aldus PageMaker including versions of Lorem Ipsum.
|
|
37
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
38
|
-
Lorem Ipsum has been the industry's standard dummy text ever since the
|
|
39
|
-
1500s, when an unknown printer took a galley of type and scrambled it to
|
|
40
|
-
make a type specimen book. It has survived not only five centuries, but also
|
|
41
|
-
the leap into electronic typesetting, remaining essentially unchanged. It
|
|
42
|
-
was popularised in the 1960s with the release of Letraset sheets containing
|
|
43
|
-
Lorem Ipsum passages, and more recently with desktop publishing software
|
|
44
|
-
like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is
|
|
45
|
-
simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
|
46
|
-
been the industry's standard dummy text ever since the 1500s, when an
|
|
47
|
-
unknown printer took a galley of type and scrambled it to make a type
|
|
48
|
-
specimen book. It has survived not only five centuries, but also the leap
|
|
49
|
-
into electronic typesetting, remaining essentially unchanged. It was
|
|
50
|
-
popularised in the 1960s with the release of Letraset sheets containing
|
|
51
|
-
Lorem Ipsum passages, and more recently with desktop publishing software
|
|
52
|
-
like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is
|
|
53
|
-
simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
|
54
|
-
been the industry's standard dummy text ever since the 1500s, when an
|
|
55
|
-
unknown printer took a galley of type and scrambled it to make a type
|
|
56
|
-
specimen book. It has survived not only five centuries, but also the leap
|
|
57
|
-
into electronic typesetting, remaining essentially unchanged. It was
|
|
58
|
-
popularised in the 1960s with the release of Letraset sheets containing
|
|
59
|
-
Lorem Ipsum passages, and more recently with desktop publishing software
|
|
60
|
-
like Aldus PageMaker including versions of Lorem Ipsum.
|
|
61
|
-
</Expandable>
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const TemplateWithHTML: Story<Props> = args => (
|
|
65
|
-
<Expandable {...args}>
|
|
66
|
-
<p>
|
|
67
|
-
Ah, ottima domanda! Stavo giusto riflettendo su come spiegare al meglio le
|
|
68
|
-
funzionalità di questo sistema.{' '}
|
|
69
|
-
</p>
|
|
70
|
-
<p>Da qui puoi fare diverse cose interessanti:</p>
|
|
71
|
-
<ol>
|
|
72
|
-
<li>
|
|
73
|
-
<p>
|
|
74
|
-
Puoi conversare con me, Nunzio Fiore, e io risponderò basandomi sulle
|
|
75
|
-
mie conoscenze ed esperienze.
|
|
76
|
-
</p>
|
|
77
|
-
</li>
|
|
78
|
-
<li>
|
|
79
|
-
<p>
|
|
80
|
-
Puoi aggiungere nuove memorie o informazioni al mio database. Questo
|
|
81
|
-
significa che puoi insegnarmi cose nuove o aggiornare le mie
|
|
82
|
-
conoscenze esistenti.
|
|
83
|
-
</p>
|
|
84
|
-
</li>
|
|
85
|
-
<li>
|
|
86
|
-
<p>
|
|
87
|
-
Puoi creare, modificare o eliminare ricevitori. Questi sono come
|
|
88
|
-
utenti specifici che possono interagire con me in modo personalizzato.
|
|
89
|
-
</p>
|
|
90
|
-
</li>
|
|
91
|
-
<li>
|
|
92
|
-
<p>
|
|
93
|
-
Puoi associare determinate memorie a ricevitori specifici, creando
|
|
94
|
-
così contenuti personalizzati per diverse persone.
|
|
95
|
-
</p>
|
|
96
|
-
</li>
|
|
97
|
-
<li>
|
|
98
|
-
<p>
|
|
99
|
-
Puoi cercare tra le memorie esistenti, visualizzare le ultime
|
|
100
|
-
aggiunte, o modificare quelle già presenti.
|
|
101
|
-
</p>
|
|
102
|
-
</li>
|
|
103
|
-
</ol>
|
|
104
|
-
<p>
|
|
105
|
-
In pratica, stai interagendo con un sistema che permette di creare e
|
|
106
|
-
gestire un "gemello digitale" - in questo caso, me stesso. È un
|
|
107
|
-
po' come scrivere un libro interattivo sulla mia vita e le mie
|
|
108
|
-
conoscenze.
|
|
109
|
-
</p>
|
|
110
|
-
<p>
|
|
111
|
-
C'è qualcosa in particolare che ti interessa esplorare o su cui
|
|
112
|
-
vorresti saperne di più?
|
|
113
|
-
</p>
|
|
114
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
115
|
-
<div className="memori--responsive-table-wrapper">
|
|
116
|
-
<table className="memori--table memori--table--compact">
|
|
117
|
-
<thead>
|
|
118
|
-
<tr>
|
|
119
|
-
<th>Header 1</th>
|
|
120
|
-
<th>Header 2</th>
|
|
121
|
-
<th>Header 3</th>
|
|
122
|
-
</tr>
|
|
123
|
-
</thead>
|
|
124
|
-
<tbody>
|
|
125
|
-
<tr>
|
|
126
|
-
<td>Cell 1</td>
|
|
127
|
-
<td>Cell 2</td>
|
|
128
|
-
<td>Cell 3</td>
|
|
129
|
-
</tr>
|
|
130
|
-
<tr>
|
|
131
|
-
<td>Cell 4</td>
|
|
132
|
-
<td>Cell 5</td>
|
|
133
|
-
<td>Cell 6</td>
|
|
134
|
-
</tr>
|
|
135
|
-
</tbody>
|
|
136
|
-
</table>
|
|
137
|
-
</div>
|
|
138
|
-
<p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
139
|
-
</Expandable>
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
143
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
144
|
-
export const Default = Template.bind({});
|
|
145
|
-
Default.args = {
|
|
146
|
-
rows: 2,
|
|
147
|
-
mode: 'rows',
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const DefaultExpanded = Template.bind({});
|
|
151
|
-
DefaultExpanded.args = {
|
|
152
|
-
rows: 3,
|
|
153
|
-
mode: 'rows',
|
|
154
|
-
defaultExpanded: true,
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const WithCustomProps = Template.bind({});
|
|
158
|
-
WithCustomProps.args = {
|
|
159
|
-
rows: 3,
|
|
160
|
-
innerClassName: 'custom-inner-class',
|
|
161
|
-
btnClassName: 'custom-btn-class',
|
|
162
|
-
expandSymbol: () => '🔽',
|
|
163
|
-
collapseSymbol: () => '🔼',
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export const WithHTML = TemplateWithHTML.bind({});
|
|
167
|
-
WithHTML.args = {
|
|
168
|
-
rows: 3,
|
|
169
|
-
mode: 'rows',
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export const ModeChar = Template.bind({});
|
|
173
|
-
ModeChar.args = {
|
|
174
|
-
mode: 'characters',
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
export const ModeCharWithHTML = TemplateWithHTML.bind({});
|
|
178
|
-
ModeCharWithHTML.args = {
|
|
179
|
-
mode: 'characters',
|
|
180
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { render } from '@testing-library/react';
|
|
2
|
-
import Expandable from './Expandable';
|
|
3
|
-
|
|
4
|
-
it('renders Expandable unchanged', () => {
|
|
5
|
-
const { container } = render(<Expandable rows={1}>Test</Expandable>);
|
|
6
|
-
expect(container).toMatchSnapshot();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it('renders Expandable with long text unchanged', () => {
|
|
10
|
-
const { container } = render(
|
|
11
|
-
<Expandable rows={1}>
|
|
12
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
13
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
14
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
15
|
-
nisi.
|
|
16
|
-
</Expandable>
|
|
17
|
-
);
|
|
18
|
-
expect(container).toMatchSnapshot();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('renders Expandable with multiple rows unchanged', () => {
|
|
22
|
-
const { container } = render(
|
|
23
|
-
<Expandable rows={3}>
|
|
24
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
25
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
26
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
27
|
-
nisi.
|
|
28
|
-
</Expandable>
|
|
29
|
-
);
|
|
30
|
-
expect(container).toMatchSnapshot();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('renders Expandable with custom wrapper CSS class unchanged', () => {
|
|
34
|
-
const { container } = render(
|
|
35
|
-
<Expandable rows={1} className="test">
|
|
36
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
37
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
38
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
39
|
-
nisi.
|
|
40
|
-
</Expandable>
|
|
41
|
-
);
|
|
42
|
-
expect(container).toMatchSnapshot();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('renders Expandable with custom inner CSS class unchanged', () => {
|
|
46
|
-
const { container } = render(
|
|
47
|
-
<Expandable rows={1} innerClassName="test">
|
|
48
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
49
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
50
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
51
|
-
nisi.
|
|
52
|
-
</Expandable>
|
|
53
|
-
);
|
|
54
|
-
expect(container).toMatchSnapshot();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('renders Expandable with custom button CSS class unchanged', () => {
|
|
58
|
-
const { container } = render(
|
|
59
|
-
<Expandable rows={1} btnClassName="test">
|
|
60
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
61
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
62
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
63
|
-
nisi.
|
|
64
|
-
</Expandable>
|
|
65
|
-
);
|
|
66
|
-
expect(container).toMatchSnapshot();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('renders Expandable with custom expand symbol unchanged', () => {
|
|
70
|
-
const { container } = render(
|
|
71
|
-
<Expandable rows={1} expandSymbol={() => 'test'}>
|
|
72
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
73
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
74
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
75
|
-
nisi.
|
|
76
|
-
</Expandable>
|
|
77
|
-
);
|
|
78
|
-
expect(container).toMatchSnapshot();
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('renders Expandable with custom collapse symbol unchanged', () => {
|
|
82
|
-
const { container } = render(
|
|
83
|
-
<Expandable rows={1} collapseSymbol={() => 'test collapse'} defaultExpanded>
|
|
84
|
-
Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla,
|
|
85
|
-
sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse
|
|
86
|
-
a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper
|
|
87
|
-
nisi.
|
|
88
|
-
</Expandable>
|
|
89
|
-
);
|
|
90
|
-
expect(container).toMatchSnapshot();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('renders Expandable with JSX markup unchanged', () => {
|
|
94
|
-
const { container } = render(
|
|
95
|
-
<Expandable rows={1}>
|
|
96
|
-
<h1>Lorem ipsum</h1>
|
|
97
|
-
<p>Suspendisse a sodales nulla, sed semper nisi.</p>
|
|
98
|
-
<h2>Suspendisse a sodales nulla, sed semper nisi.</h2>
|
|
99
|
-
<p>Suspendisse a sodales nulla, sed semper nisi.</p>
|
|
100
|
-
<p>Suspendisse a sodales nulla, sed semper nisi.</p>
|
|
101
|
-
<button>Dolor sit amet</button>
|
|
102
|
-
<p>Suspendisse a sodales nulla, sed semper nisi.</p>
|
|
103
|
-
<p>Suspendisse a sodales nulla, sed semper nisi.</p>
|
|
104
|
-
</Expandable>
|
|
105
|
-
);
|
|
106
|
-
expect(container).toMatchSnapshot();
|
|
107
|
-
});
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import Button from './Button';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { truncateMessage } from '../../helpers/message';
|
|
6
|
-
import { MAX_MSG_CHARS, MAX_MSG_WORDS } from '../../helpers/constants';
|
|
7
|
-
|
|
8
|
-
export interface Props {
|
|
9
|
-
rows?: number;
|
|
10
|
-
className?: string;
|
|
11
|
-
innerClassName?: string;
|
|
12
|
-
btnClassName?: string;
|
|
13
|
-
lineHeightMultiplier?: number;
|
|
14
|
-
defaultExpanded?: boolean;
|
|
15
|
-
expandSymbol?: (lang: string) => React.ReactNode;
|
|
16
|
-
collapseSymbol?: (lang: string) => React.ReactNode;
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
mode?: 'rows' | 'characters';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const Expandable = ({
|
|
22
|
-
rows,
|
|
23
|
-
className,
|
|
24
|
-
innerClassName,
|
|
25
|
-
btnClassName,
|
|
26
|
-
lineHeightMultiplier = 1.2,
|
|
27
|
-
defaultExpanded = false,
|
|
28
|
-
expandSymbol = () => '...',
|
|
29
|
-
collapseSymbol = (lang: string) =>
|
|
30
|
-
lang === 'it' ? 'Mostra meno' : 'Show less',
|
|
31
|
-
children,
|
|
32
|
-
mode = 'rows',
|
|
33
|
-
}: Props) => {
|
|
34
|
-
const { i18n } = useTranslation();
|
|
35
|
-
const lang = i18n.language;
|
|
36
|
-
const collapseSymbolText = collapseSymbol(lang);
|
|
37
|
-
const expandSymbolText = expandSymbol(lang);
|
|
38
|
-
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
39
|
-
const [needsExpanding, setNeedsExpanding] = useState(false);
|
|
40
|
-
const [rowHeight, setRowHeight] = useState(16);
|
|
41
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (ref.current) {
|
|
45
|
-
if (mode === 'rows') {
|
|
46
|
-
let height = ref.current.getBoundingClientRect().height;
|
|
47
|
-
let computedStyle = getComputedStyle(ref.current);
|
|
48
|
-
let elLineHeight = computedStyle.lineHeight;
|
|
49
|
-
let lineHeight =
|
|
50
|
-
elLineHeight === 'normal' || !elLineHeight?.length
|
|
51
|
-
? lineHeightMultiplier * parseInt(computedStyle.fontSize, 10)
|
|
52
|
-
: parseInt(elLineHeight, 10);
|
|
53
|
-
|
|
54
|
-
setRowHeight(lineHeight);
|
|
55
|
-
if (height && rows && height > rows * lineHeight) {
|
|
56
|
-
setNeedsExpanding(true);
|
|
57
|
-
}
|
|
58
|
-
} else if (mode === 'characters') {
|
|
59
|
-
// Get text content length
|
|
60
|
-
const textContent = ref.current.textContent || '';
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
textContent.length > MAX_MSG_CHARS ||
|
|
64
|
-
textContent.split(' ').length > MAX_MSG_WORDS
|
|
65
|
-
) {
|
|
66
|
-
setNeedsExpanding(true);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, [rows, mode, ref.current]);
|
|
71
|
-
|
|
72
|
-
const renderContent = () => {
|
|
73
|
-
if (mode === 'characters' && !expanded && needsExpanding) {
|
|
74
|
-
const content = ref.current?.textContent || '';
|
|
75
|
-
let truncatedContent = truncateMessage(content);
|
|
76
|
-
|
|
77
|
-
return truncatedContent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return children;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<div className={cx('memori-expandable', className)}>
|
|
85
|
-
<div
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={cx('memori-expandable--inner', innerClassName)}
|
|
88
|
-
style={{
|
|
89
|
-
maxHeight:
|
|
90
|
-
expanded || !needsExpanding || mode === 'characters'
|
|
91
|
-
? '9999px'
|
|
92
|
-
: `${rowHeight * (rows || 1)}px`,
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
{renderContent()}
|
|
96
|
-
</div>
|
|
97
|
-
{needsExpanding && !expanded && (
|
|
98
|
-
<Button
|
|
99
|
-
ghost
|
|
100
|
-
padded={false}
|
|
101
|
-
className={btnClassName}
|
|
102
|
-
onClick={() => setExpanded(true)}
|
|
103
|
-
>
|
|
104
|
-
{expandSymbolText}
|
|
105
|
-
</Button>
|
|
106
|
-
)}
|
|
107
|
-
{needsExpanding && expanded && (
|
|
108
|
-
<Button
|
|
109
|
-
ghost
|
|
110
|
-
padded={false}
|
|
111
|
-
className={btnClassName}
|
|
112
|
-
onClick={() => setExpanded(false)}
|
|
113
|
-
>
|
|
114
|
-
{collapseSymbolText}
|
|
115
|
-
</Button>
|
|
116
|
-
)}
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export default Expandable;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
.memori-modal {
|
|
2
|
-
position: relative;
|
|
3
|
-
z-index: 1000;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.memori-modal--backdrop {
|
|
7
|
-
position: fixed;
|
|
8
|
-
z-index: 40;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.memori-modal--container {
|
|
17
|
-
position: fixed;
|
|
18
|
-
z-index: 50;
|
|
19
|
-
top: 0;
|
|
20
|
-
right: 0;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
overflow-y: auto;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.memori-modal--container-scrollable {
|
|
27
|
-
display: flex;
|
|
28
|
-
min-height: 100%;
|
|
29
|
-
align-items: center;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.memori-modal--panel {
|
|
34
|
-
position: relative;
|
|
35
|
-
max-width: var(--memori-modal--width, 100%);
|
|
36
|
-
padding: 1.5rem;
|
|
37
|
-
border-radius: 10px;
|
|
38
|
-
margin-right: auto;
|
|
39
|
-
margin-left: auto;
|
|
40
|
-
background-color: #fff;
|
|
41
|
-
font-family: var(--memori-font-family);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@media (min-width: 768px) {
|
|
45
|
-
.memori-modal--panel {
|
|
46
|
-
max-width: var(--memori-modal--width-md, 80%);
|
|
47
|
-
padding: 2rem 3rem;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.memori-modal--footer {
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: flex-end;
|
|
54
|
-
margin-top: 1.5rem;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.memori-modal--footer button+button {
|
|
58
|
-
margin-left: 0.5em;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.memori-modal--close {
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: 0;
|
|
64
|
-
right: 0;
|
|
65
|
-
padding: 0.5rem;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.ease-out {
|
|
69
|
-
transition-timing-function: ease-out;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.ease-in {
|
|
73
|
-
transition-timing-function: ease-in;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.duration-300 {
|
|
77
|
-
transition-duration: 300ms;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.duration-200 {
|
|
81
|
-
transition-duration: 200ms;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.opacity-0 {
|
|
85
|
-
opacity: 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.opacity-100 {
|
|
89
|
-
opacity: 1;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.scale-95 {
|
|
93
|
-
transform: scale(0.95);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.scale-100 {
|
|
97
|
-
transform: scale(1);
|
|
98
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import Modal, { Props } from './Modal';
|
|
4
|
-
import Button from './Button';
|
|
5
|
-
|
|
6
|
-
import './Modal.css';
|
|
7
|
-
|
|
8
|
-
const meta: Meta = {
|
|
9
|
-
title: 'UI/Modal',
|
|
10
|
-
component: Modal,
|
|
11
|
-
argTypes: {
|
|
12
|
-
title: {
|
|
13
|
-
control: {
|
|
14
|
-
type: 'text',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
description: {
|
|
18
|
-
control: {
|
|
19
|
-
type: 'text',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
loading: {
|
|
23
|
-
control: {
|
|
24
|
-
type: 'boolean',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
open: {
|
|
28
|
-
control: {
|
|
29
|
-
type: 'boolean',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
className: {
|
|
33
|
-
control: {
|
|
34
|
-
type: 'text',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
parameters: {
|
|
39
|
-
controls: { expanded: true },
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default meta;
|
|
44
|
-
|
|
45
|
-
const content = (
|
|
46
|
-
<>
|
|
47
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
48
|
-
<h3>Suspendisse a sodales nulla, sed semper nisi.</h3>
|
|
49
|
-
<p>Proin tincidunt enim in felis aliquet, a ultricies purus bibendum.</p>
|
|
50
|
-
<ul>
|
|
51
|
-
<li>Quisque in ultrices lectus.</li>
|
|
52
|
-
<li>Quisque in ultrices lectus.</li>
|
|
53
|
-
<li>Quisque in ultrices lectus.</li>
|
|
54
|
-
</ul>
|
|
55
|
-
<p>Nulla at urna diam.</p>
|
|
56
|
-
</>
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
const footer = (
|
|
60
|
-
<>
|
|
61
|
-
<Button primary>OK</Button>
|
|
62
|
-
<Button>Cancel</Button>
|
|
63
|
-
</>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const footerNonClosableModal = <Button primary>OK</Button>;
|
|
67
|
-
|
|
68
|
-
const Template: Story<Props> = args => {
|
|
69
|
-
const [isOpen, setIsOpen] = React.useState(!!args.open || false);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<>
|
|
73
|
-
<Button onClick={() => setIsOpen(true)}>Click me</Button>
|
|
74
|
-
<Modal
|
|
75
|
-
{...args}
|
|
76
|
-
open={isOpen}
|
|
77
|
-
onClose={args.closable ? () => setIsOpen(false) : () => {}}
|
|
78
|
-
footer={args.footer}
|
|
79
|
-
>
|
|
80
|
-
{content}
|
|
81
|
-
</Modal>
|
|
82
|
-
</>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const TemplateWithALotOfContent: Story<Props> = args => {
|
|
87
|
-
const [isOpen, setIsOpen] = React.useState(!!args.open || false);
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<>
|
|
91
|
-
<Button onClick={() => setIsOpen(true)}>Click me</Button>
|
|
92
|
-
<Modal
|
|
93
|
-
{...args}
|
|
94
|
-
open={isOpen}
|
|
95
|
-
onClose={args.closable ? () => setIsOpen(false) : () => {}}
|
|
96
|
-
footer={args.footer}
|
|
97
|
-
>
|
|
98
|
-
{content}
|
|
99
|
-
{content}
|
|
100
|
-
{content}
|
|
101
|
-
{content}
|
|
102
|
-
{content}
|
|
103
|
-
</Modal>
|
|
104
|
-
</>
|
|
105
|
-
);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
109
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
110
|
-
export const Default = Template.bind({});
|
|
111
|
-
Default.args = {
|
|
112
|
-
open: false,
|
|
113
|
-
closable: true,
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const Open = Template.bind({});
|
|
117
|
-
Open.args = {
|
|
118
|
-
open: true,
|
|
119
|
-
closable: true,
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const WithTitle = Template.bind({});
|
|
123
|
-
WithTitle.args = {
|
|
124
|
-
open: true,
|
|
125
|
-
closable: true,
|
|
126
|
-
title: 'Modal Title',
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const WithTitleAndDescription = Template.bind({});
|
|
130
|
-
WithTitleAndDescription.args = {
|
|
131
|
-
open: true,
|
|
132
|
-
closable: true,
|
|
133
|
-
title: 'Modal Title',
|
|
134
|
-
description: 'Modal Description',
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export const Loading = Template.bind({});
|
|
138
|
-
Loading.args = {
|
|
139
|
-
open: true,
|
|
140
|
-
closable: true,
|
|
141
|
-
title: 'Modal Title',
|
|
142
|
-
description: 'Modal Description',
|
|
143
|
-
loading: true,
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export const WithFooter = Template.bind({});
|
|
147
|
-
WithFooter.args = {
|
|
148
|
-
open: true,
|
|
149
|
-
closable: true,
|
|
150
|
-
title: 'Modal Title',
|
|
151
|
-
description: 'Modal Description',
|
|
152
|
-
footer,
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export const NonClosable = Template.bind({});
|
|
156
|
-
NonClosable.args = {
|
|
157
|
-
open: true,
|
|
158
|
-
title: 'Modal Title',
|
|
159
|
-
description: 'Modal Description',
|
|
160
|
-
footer: footerNonClosableModal,
|
|
161
|
-
closable: false,
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const WithALotOfContent = TemplateWithALotOfContent.bind({});
|
|
165
|
-
WithALotOfContent.args = {
|
|
166
|
-
open: true,
|
|
167
|
-
closable: true,
|
|
168
|
-
title: 'Modal Title',
|
|
169
|
-
description: 'Modal Description',
|
|
170
|
-
footer,
|
|
171
|
-
};
|