@memori.ai/memori-react 9.0.0-alpha.21 → 9.0.0-alpha.22
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 +18 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/dist/components/Auth/Auth.css +12 -5
- package/dist/components/Auth/Auth.d.ts +1 -1
- package/dist/components/Auth/Auth.js +46 -32
- package/dist/components/Auth/Auth.js.map +1 -1
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/dist/components/Chat/Chat.css +1 -0
- package/dist/components/Chat/Chat.js +1 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +32 -5
- package/dist/components/ChatBubble/ChatBubble.js +2 -4
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.js +10 -1
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.css +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/dist/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/dist/components/Header/Header.css +8 -3
- package/dist/components/Header/Header.js +15 -18
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/KnownFacts/KnownFacts.css +1 -1
- package/dist/components/KnownFacts/KnownFacts.js +2 -5
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
- package/dist/components/LoginDrawer/LoginDrawer.css +16 -14
- package/dist/components/LoginDrawer/LoginDrawer.js +19 -11
- package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +35 -31
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/dist/components/PositionPopover/PositionPopover.css +3 -3
- package/dist/components/PositionPopover/PositionPopover.js +38 -25
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
- package/dist/components/Snippet/Snippet.css +1 -1
- package/dist/components/StartPanel/StartPanel.css +19 -3
- package/dist/components/StartPanel/StartPanel.js +12 -18
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/dist/components/layouts/totem.css +43 -9
- package/dist/helpers/positionPopover.d.ts +2 -1
- package/dist/helpers/positionPopover.js +10 -2
- package/dist/helpers/positionPopover.js.map +1 -1
- package/dist/icons/MemoriIcon.js +1 -1
- package/dist/icons/MemoriIcon.js.map +1 -1
- package/dist/locales/de.json +4 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/es.json +3 -1
- package/dist/locales/fr.json +3 -1
- package/dist/locales/it.json +3 -1
- package/dist/styles.css +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/esm/components/Auth/Auth.css +12 -5
- package/esm/components/Auth/Auth.d.ts +1 -1
- package/esm/components/Auth/Auth.js +47 -33
- package/esm/components/Auth/Auth.js.map +1 -1
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/esm/components/Chat/Chat.css +1 -0
- package/esm/components/Chat/Chat.js +1 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +32 -5
- package/esm/components/ChatBubble/ChatBubble.js +2 -4
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +9 -59
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.js +11 -2
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.css +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/esm/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/esm/components/Header/Header.css +8 -3
- package/esm/components/Header/Header.js +15 -18
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/IconButton/IconButton.d.ts +1 -1
- package/esm/components/KnownFacts/KnownFacts.css +1 -1
- package/esm/components/KnownFacts/KnownFacts.js +2 -5
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
- package/esm/components/LoginDrawer/LoginDrawer.css +16 -14
- package/esm/components/LoginDrawer/LoginDrawer.js +20 -12
- package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +36 -32
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/esm/components/PositionPopover/PositionPopover.css +3 -3
- package/esm/components/PositionPopover/PositionPopover.js +39 -26
- package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
- package/esm/components/Snippet/Snippet.css +1 -1
- package/esm/components/StartPanel/StartPanel.css +19 -3
- package/esm/components/StartPanel/StartPanel.js +12 -18
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/esm/components/layouts/totem.css +43 -9
- package/esm/helpers/positionPopover.d.ts +2 -1
- package/esm/helpers/positionPopover.js +9 -2
- package/esm/helpers/positionPopover.js.map +1 -1
- package/esm/icons/MemoriIcon.js +1 -1
- package/esm/icons/MemoriIcon.js.map +1 -1
- package/esm/locales/de.json +4 -1
- package/esm/locales/en.json +3 -1
- package/esm/locales/es.json +3 -1
- package/esm/locales/fr.json +3 -1
- package/esm/locales/it.json +3 -1
- package/esm/styles.css +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +5 -3
- package/src/Live/Agents.stories.tsx +49 -0
- package/src/Live/KnownFacts.stories.tsx +50 -0
- package/src/Showcase.stories.tsx +3 -14
- package/src/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +1 -1
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +1 -0
- package/src/components/Auth/Auth.css +12 -5
- package/src/components/Auth/Auth.stories.tsx +1 -1
- package/src/components/Auth/Auth.test.tsx +68 -1
- package/src/components/Auth/Auth.tsx +69 -54
- package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +5 -6
- package/src/components/Avatar/Avatar.stories.tsx +1 -18
- package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +1 -103
- package/src/components/Blob/Blob.stories.tsx +1 -1
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +1 -1
- package/src/components/ChangeMode/ChangeMode.stories.tsx +1 -1
- package/src/components/Chat/Chat.css +1 -0
- package/src/components/Chat/Chat.stories.tsx +61 -7
- package/src/components/Chat/Chat.tsx +1 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +80 -80
- package/src/components/ChatBubble/ChatBubble.css +32 -5
- package/src/components/ChatBubble/ChatBubble.stories.tsx +13 -2
- package/src/components/ChatBubble/ChatBubble.test.tsx +21 -1
- package/src/components/ChatBubble/ChatBubble.tsx +7 -13
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +158 -185
- package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +1 -1
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +6 -0
- package/src/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx +24 -81
- package/src/components/ChatInputs/ChatInputs.stories.tsx +1 -39
- package/src/components/ChatInputs/ChatInputs.test.tsx +47 -0
- package/src/components/ChatInputs/ChatInputs.tsx +12 -2
- package/src/components/ChatTextArea/ChatTextArea.css +1 -1
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +1 -1
- package/src/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +1 -1
- package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +1 -1
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +29 -10
- package/src/components/Header/Header.css +8 -3
- package/src/components/Header/Header.stories.tsx +1 -1
- package/src/components/Header/Header.tsx +146 -117
- package/src/components/KnownFacts/KnownFacts.css +1 -1
- package/src/components/KnownFacts/KnownFacts.stories.tsx +1 -23
- package/src/components/KnownFacts/KnownFacts.tsx +4 -9
- package/src/components/LoginDrawer/LoginDrawer.css +16 -14
- package/src/components/LoginDrawer/LoginDrawer.stories.tsx +2 -52
- package/src/components/LoginDrawer/LoginDrawer.tsx +51 -39
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +1 -15
- package/src/components/MediaWidget/MediaWidget.stories.tsx +1 -45
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +1 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -6
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +1 -1
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +32 -28
- package/src/components/MemoriWidget/MemoriUIProvider.contract.test.tsx +55 -0
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +55 -77
- package/src/components/MemoriWidget/MemoriWidget.tsx +49 -44
- package/src/components/MemoriWidget/getChatStyles.test.ts +24 -0
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +1 -1
- package/src/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/src/components/PositionPopover/PositionPopover.css +3 -3
- package/src/components/PositionPopover/PositionPopover.stories.tsx +1 -1
- package/src/components/PositionPopover/PositionPopover.tsx +50 -28
- package/src/components/PoweredBy/PoweredBy.stories.tsx +1 -54
- package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +2 -2
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +1 -1
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +1 -1
- package/src/components/ShareButton/ShareButton.stories.tsx +1 -1
- package/src/components/Snippet/Snippet.css +1 -1
- package/src/components/Snippet/Snippet.stories.tsx +1 -1
- package/src/components/StartPanel/StartPanel.css +19 -3
- package/src/components/StartPanel/StartPanel.stories.tsx +2 -2
- package/src/components/StartPanel/StartPanel.tsx +22 -35
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +177 -121
- package/src/components/Typing/Typing.stories.tsx +1 -1
- package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +22 -44
- package/src/components/layouts/FullBody/FullBody.stories.tsx +55 -68
- package/src/components/layouts/Totem/Totem.stories.tsx +69 -87
- package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +69 -87
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +19 -41
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +39 -83
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +15 -11
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +116 -42
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +18 -40
- package/src/components/layouts/layouts.stories.tsx +96 -179
- package/src/components/layouts/totem.css +43 -9
- package/src/helpers/positionPopover.test.ts +36 -1
- package/src/helpers/positionPopover.ts +21 -4
- package/src/i18n.knownFacts.test.ts +40 -0
- package/src/icons/MemoriIcon.tsx +1 -1
- package/src/index.stories.tsx +1 -47
- package/src/locales/de.json +4 -1
- package/src/locales/en.json +3 -1
- package/src/locales/es.json +3 -1
- package/src/locales/fr.json +3 -1
- package/src/locales/it.json +3 -1
- package/src/styles.css +13 -27
- package/src/version.ts +1 -1
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
- package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
- package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
- package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -265
- package/src/components/UploadButton/UploadButton.stories.tsx +0 -510
- package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -69
- package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.stories.tsx +0 -115
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
timestamp keep contrast whatever is painted behind them. */
|
|
290
290
|
.memori-chat--bubble-addon {
|
|
291
291
|
position: absolute;
|
|
292
|
-
z-index:
|
|
292
|
+
z-index: 5;
|
|
293
293
|
top: 100%;
|
|
294
294
|
right: auto;
|
|
295
295
|
bottom: auto;
|
|
@@ -419,9 +419,36 @@
|
|
|
419
419
|
flex-shrink: 0;
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
/* Portal to widget surface so tooltip anchoring is not thrown off by the addon transform.
|
|
422
|
+
/* Portal to widget surface so tooltip anchoring is not thrown off by the addon transform.
|
|
423
|
+
Hide during enter/exit so the popup never flashes at 0,0 (top of the page) when
|
|
424
|
+
Floating UI hasn't applied coordinates yet, or when the trigger loses focus. */
|
|
423
425
|
.memori-chat--bubble-addon-tooltip-positioner {
|
|
424
|
-
z-index:
|
|
426
|
+
z-index: 1300;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.memori-chat--bubble-addon-tooltip-positioner[data-starting-style],
|
|
430
|
+
.memori-chat--bubble-addon-tooltip-positioner[data-ending-style] {
|
|
431
|
+
opacity: 0 !important;
|
|
432
|
+
pointer-events: none;
|
|
433
|
+
visibility: hidden;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.memori-chat--bubble-ai-icon {
|
|
437
|
+
display: inline-flex;
|
|
438
|
+
width: 1.75rem;
|
|
439
|
+
height: 1.75rem;
|
|
440
|
+
flex-shrink: 0;
|
|
441
|
+
align-items: center;
|
|
442
|
+
justify-content: center;
|
|
443
|
+
color: var(--memori-text-color);
|
|
444
|
+
cursor: default;
|
|
445
|
+
pointer-events: auto;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* stylelint-disable-next-line no-descending-specificity -- icon size scoped after action-icon rules */
|
|
449
|
+
.memori-chat--bubble-ai-icon svg {
|
|
450
|
+
width: 1rem;
|
|
451
|
+
height: 1rem;
|
|
425
452
|
}
|
|
426
453
|
|
|
427
454
|
.memori-chat--bubble-addon button {
|
|
@@ -642,13 +669,13 @@
|
|
|
642
669
|
font-weight: var(--memori-text-weight-medium);
|
|
643
670
|
}
|
|
644
671
|
|
|
672
|
+
.memori-chat--function-cache-modal.memori-modal__viewport .memori-modal__popup,
|
|
645
673
|
.memori-chat--function-cache-modal .memori-modal--panel {
|
|
646
674
|
width: 80%;
|
|
647
675
|
height: 100%;
|
|
648
|
-
/* padding: 20px; */
|
|
649
676
|
max-height: 80vh;
|
|
650
677
|
border-radius: var(--memori-radius-box);
|
|
651
|
-
background-color: #fff;
|
|
678
|
+
background-color: var(--memori-main-background, #fff);
|
|
652
679
|
overflow-y: auto;
|
|
653
680
|
}
|
|
654
681
|
|
|
@@ -11,7 +11,7 @@ import { ArtifactProvider } from '../MemoriArtifactSystem/context/ArtifactContex
|
|
|
11
11
|
import { AlertProvider } from '@memori.ai/ui';
|
|
12
12
|
|
|
13
13
|
const meta: Meta = {
|
|
14
|
-
title: '
|
|
14
|
+
title: 'Internals/Chat bubble',
|
|
15
15
|
component: ChatBubble,
|
|
16
16
|
argTypes: {
|
|
17
17
|
fromUser: {
|
|
@@ -53,7 +53,18 @@ const Template: Story<Props> = args => {
|
|
|
53
53
|
<ArtifactProvider>
|
|
54
54
|
<I18nWrapper>
|
|
55
55
|
<AlertProvider defaultDuration={5000}>
|
|
56
|
-
|
|
56
|
+
{/* Addons (copy, feedback, …) are hover-only in product UI.
|
|
57
|
+
Keep them visible here so Storybook can document them. */}
|
|
58
|
+
<div className="memori-storybook-chat-bubble">
|
|
59
|
+
<style>{`
|
|
60
|
+
.memori-storybook-chat-bubble .memori-chat--bubble-addon {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
pointer-events: auto;
|
|
63
|
+
transform: none;
|
|
64
|
+
}
|
|
65
|
+
`}</style>
|
|
66
|
+
<ChatBubble {...args} />
|
|
67
|
+
</div>
|
|
57
68
|
</AlertProvider>
|
|
58
69
|
</I18nWrapper>
|
|
59
70
|
</ArtifactProvider>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import ChatBubble from './ChatBubble';
|
|
4
4
|
import { memori, tenant, sessionID } from '../../mocks/data';
|
|
5
5
|
|
|
@@ -114,6 +114,26 @@ it('renders ChatBubble with msg generated by AI unchanged', () => {
|
|
|
114
114
|
expect(container).toMatchSnapshot();
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
+
it('renders the generatedByAI mark as a static icon, not a button', () => {
|
|
118
|
+
render(
|
|
119
|
+
<ChatBubble
|
|
120
|
+
memori={memori}
|
|
121
|
+
tenant={tenant}
|
|
122
|
+
sessionID={sessionID}
|
|
123
|
+
message={{
|
|
124
|
+
fromUser: false,
|
|
125
|
+
text: 'AI generated reply',
|
|
126
|
+
initial: false,
|
|
127
|
+
generatedByAI: true,
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
const mark = screen.getByLabelText('generatedByAI');
|
|
133
|
+
expect(mark.tagName).not.toBe('BUTTON');
|
|
134
|
+
expect(mark.closest('button')).toBeNull();
|
|
135
|
+
});
|
|
136
|
+
|
|
117
137
|
it('renders ChatBubble with translation and original unchanged', () => {
|
|
118
138
|
const { container } = render(
|
|
119
139
|
<ChatBubble
|
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
} from '../../helpers/message';
|
|
40
40
|
import { Expandable, Modal } from '@memori.ai/ui';
|
|
41
41
|
import memoriApiClient from '@memori.ai/memori-api-client';
|
|
42
|
-
import { usePressTooltip } from '../../helpers/usePressTooltip';
|
|
43
42
|
import { useWidgetSurfaceEl } from '../../context/widgetSurfaceContext';
|
|
44
43
|
const ASSET_URL_PATTERN = /https?:\/\/\S*\/api\/v\d+\/asset\/\S+/gi;
|
|
45
44
|
|
|
@@ -131,7 +130,6 @@ const ChatBubble: React.FC<Props> = ({
|
|
|
131
130
|
const { t, i18n } = useTranslation();
|
|
132
131
|
const surfaceEl = useWidgetSurfaceEl();
|
|
133
132
|
const lang = i18n.language || 'en';
|
|
134
|
-
const generatedByAiTooltip = usePressTooltip();
|
|
135
133
|
const [showingWhyThisAnswer, setShowingWhyThisAnswer] = useState(false);
|
|
136
134
|
const [openFunctionCache, setOpenFunctionCache] = useState(false);
|
|
137
135
|
const [copyStatus, setCopyStatus] = useState<{
|
|
@@ -772,18 +770,13 @@ const ChatBubble: React.FC<Props> = ({
|
|
|
772
770
|
placement="bottom"
|
|
773
771
|
content={t('generatedByAI')}
|
|
774
772
|
className="memori-chat--bubble-action-icon memori-chat--bubble-action-icon--ai"
|
|
775
|
-
{...generatedByAiTooltip.tooltipProps}
|
|
776
773
|
>
|
|
777
|
-
<span
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
aria-label={String(t('generatedByAI'))}
|
|
784
|
-
icon={<Bot aria-hidden />}
|
|
785
|
-
{...generatedByAiTooltip.pressTriggerProps}
|
|
786
|
-
/>
|
|
774
|
+
<span
|
|
775
|
+
className="memori-chat--bubble-addon-tooltip-trigger memori-chat--bubble-ai-icon"
|
|
776
|
+
role="img"
|
|
777
|
+
aria-label={String(t('generatedByAI'))}
|
|
778
|
+
>
|
|
779
|
+
<Bot aria-hidden />
|
|
787
780
|
</span>
|
|
788
781
|
</Tooltip>
|
|
789
782
|
)}
|
|
@@ -885,6 +878,7 @@ const ChatBubble: React.FC<Props> = ({
|
|
|
885
878
|
container={surfaceEl ?? undefined}
|
|
886
879
|
open={openFunctionCache}
|
|
887
880
|
className="memori-chat--function-cache-modal"
|
|
881
|
+
stacking="stacked"
|
|
888
882
|
title={t('functionCache') || 'Function Cache'}
|
|
889
883
|
closable={true}
|
|
890
884
|
onOpenChange={setOpenFunctionCache}
|