@memori.ai/memori-react 2.1.0 → 2.2.1
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 +37 -0
- package/dist/components/Avatar/Avatar.css +0 -1
- package/dist/components/Blob/Blob.css +6 -1
- package/dist/components/ChangeMode/ChangeMode.css +1 -1
- package/dist/components/Chat/Chat.css +3 -2
- package/dist/components/Chat/Chat.d.ts +1 -0
- package/dist/components/Chat/Chat.js +2 -2
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +1 -1
- package/dist/components/ChatBubble/ChatBubble.js +1 -1
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +1 -41
- package/dist/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/dist/components/ChatInputs/ChatInputs.js +9 -3
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.css +7 -3
- package/dist/components/DateSelector/DateSelector.css +17 -15
- package/dist/components/ExportHistoryButton/ExportHistoryButton.css +1 -1
- package/dist/components/FeedbackButtons/FeedbackButtons.css +4 -4
- package/dist/components/FeedbackButtons/FeedbackButtons.js +1 -1
- package/dist/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
- package/dist/components/Header/Header.css +2 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/ImageUpload/ImageUpload.css +2 -3
- package/dist/components/MediaWidget/MediaItemWidget.css +2 -0
- package/dist/components/MediaWidget/MediaWidget.css +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.css +1 -2
- package/dist/components/MemoriWidget/MemoriWidget.js +23 -13
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.css +107 -0
- package/dist/components/MicrophoneButton/MicrophoneButton.d.ts +9 -0
- package/dist/components/MicrophoneButton/MicrophoneButton.js +46 -0
- package/dist/components/MicrophoneButton/MicrophoneButton.js.map +1 -0
- package/dist/components/SettingsDrawer/SettingsDrawer.d.ts +3 -3
- package/dist/components/SettingsDrawer/SettingsDrawer.js +8 -6
- package/dist/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/dist/components/SettingsDrawer/SettingsDrawer.test.js +7 -7
- package/dist/components/SettingsDrawer/SettingsDrawer.test.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.css +1 -1
- package/dist/components/StartPanel/StartPanel.js +1 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/totem.css +49 -8
- package/dist/components/ui/Button.css +1 -1
- package/dist/components/ui/Button.d.ts +5 -1
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.css +0 -2
- package/dist/components/ui/Drawer.css +1 -1
- package/dist/components/ui/Modal.css +1 -1
- package/dist/components/ui/Select.css +17 -16
- package/dist/components/ui/Tooltip.css +38 -3
- package/dist/components/ui/Tooltip.d.ts +2 -1
- package/dist/components/ui/Tooltip.js +1 -2
- package/dist/components/ui/Tooltip.js.map +1 -1
- package/dist/components/ui/Tooltip.test.js +16 -0
- package/dist/components/ui/Tooltip.test.js.map +1 -1
- package/dist/helpers/configuration.js +1 -1
- package/dist/helpers/configuration.js.map +1 -1
- package/dist/helpers/translations.js +1 -2
- package/dist/helpers/translations.js.map +1 -1
- package/dist/locales/en.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/styles.css +2 -1
- package/esm/components/Avatar/Avatar.css +0 -1
- package/esm/components/Blob/Blob.css +6 -1
- package/esm/components/ChangeMode/ChangeMode.css +1 -1
- package/esm/components/Chat/Chat.css +3 -2
- package/esm/components/Chat/Chat.d.ts +1 -0
- package/esm/components/Chat/Chat.js +2 -2
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +1 -1
- package/esm/components/ChatBubble/ChatBubble.js +1 -1
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +1 -41
- package/esm/components/ChatInputs/ChatInputs.d.ts +1 -0
- package/esm/components/ChatInputs/ChatInputs.js +9 -3
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.css +7 -3
- package/esm/components/DateSelector/DateSelector.css +17 -15
- package/esm/components/ExportHistoryButton/ExportHistoryButton.css +1 -1
- package/esm/components/FeedbackButtons/FeedbackButtons.css +4 -4
- package/esm/components/FeedbackButtons/FeedbackButtons.js +1 -1
- package/esm/components/FeedbackButtons/FeedbackButtons.js.map +1 -1
- package/esm/components/Header/Header.css +2 -1
- package/esm/components/Header/Header.js +1 -1
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/ImageUpload/ImageUpload.css +2 -3
- package/esm/components/MediaWidget/MediaItemWidget.css +2 -0
- package/esm/components/MediaWidget/MediaWidget.css +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.css +1 -2
- package/esm/components/MemoriWidget/MemoriWidget.js +23 -13
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.css +107 -0
- package/esm/components/MicrophoneButton/MicrophoneButton.d.ts +9 -0
- package/esm/components/MicrophoneButton/MicrophoneButton.js +43 -0
- package/esm/components/MicrophoneButton/MicrophoneButton.js.map +1 -0
- package/esm/components/SettingsDrawer/SettingsDrawer.d.ts +3 -3
- package/esm/components/SettingsDrawer/SettingsDrawer.js +9 -7
- package/esm/components/SettingsDrawer/SettingsDrawer.js.map +1 -1
- package/esm/components/SettingsDrawer/SettingsDrawer.test.js +7 -7
- package/esm/components/SettingsDrawer/SettingsDrawer.test.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.css +1 -1
- package/esm/components/StartPanel/StartPanel.js +1 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/totem.css +49 -8
- package/esm/components/ui/Button.css +1 -1
- package/esm/components/ui/Button.d.ts +5 -1
- package/esm/components/ui/Button.js +1 -1
- package/esm/components/ui/Button.js.map +1 -1
- package/esm/components/ui/Checkbox.css +0 -2
- package/esm/components/ui/Drawer.css +1 -1
- package/esm/components/ui/Modal.css +1 -1
- package/esm/components/ui/Select.css +17 -16
- package/esm/components/ui/Tooltip.css +38 -3
- package/esm/components/ui/Tooltip.d.ts +2 -1
- package/esm/components/ui/Tooltip.js +1 -2
- package/esm/components/ui/Tooltip.js.map +1 -1
- package/esm/components/ui/Tooltip.test.js +16 -0
- package/esm/components/ui/Tooltip.test.js.map +1 -1
- package/esm/helpers/configuration.js +1 -1
- package/esm/helpers/configuration.js.map +1 -1
- package/esm/helpers/translations.js +1 -2
- package/esm/helpers/translations.js.map +1 -1
- package/esm/locales/en.json +4 -0
- package/esm/locales/it.json +4 -0
- package/esm/styles.css +2 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.css +0 -1
- package/src/components/Blob/Blob.css +6 -1
- package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +4 -4
- package/src/components/ChangeMode/ChangeMode.css +1 -1
- package/src/components/Chat/Chat.css +3 -2
- package/src/components/Chat/Chat.tsx +3 -0
- package/src/components/ChatBubble/ChatBubble.css +1 -1
- package/src/components/ChatBubble/ChatBubble.tsx +1 -1
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +1 -1
- package/src/components/ChatInputs/ChatInputs.css +1 -41
- package/src/components/ChatInputs/ChatInputs.stories.tsx +50 -3
- package/src/components/ChatInputs/ChatInputs.tsx +20 -3
- package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +160 -85
- package/src/components/ChatTextArea/ChatTextArea.css +7 -3
- package/src/components/DateSelector/DateSelector.css +17 -15
- package/src/components/ExportHistoryButton/ExportHistoryButton.css +1 -1
- package/src/components/FeedbackButtons/FeedbackButtons.css +4 -4
- package/src/components/FeedbackButtons/FeedbackButtons.tsx +1 -1
- package/src/components/Header/Header.css +2 -1
- package/src/components/Header/Header.stories.tsx +3 -0
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +1 -1
- package/src/components/ImageUpload/ImageUpload.css +2 -3
- package/src/components/MediaWidget/MediaItemWidget.css +2 -0
- package/src/components/MediaWidget/MediaWidget.css +1 -1
- package/src/components/MemoriWidget/MemoriWidget.css +1 -2
- package/src/components/MemoriWidget/MemoriWidget.tsx +29 -12
- package/src/components/MicrophoneButton/MicrophoneButton.css +107 -0
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +49 -0
- package/src/components/MicrophoneButton/MicrophoneButton.tsx +95 -0
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +6 -4
- package/src/components/SettingsDrawer/SettingsDrawer.test.tsx +14 -14
- package/src/components/SettingsDrawer/SettingsDrawer.tsx +57 -25
- package/src/components/StartPanel/StartPanel.css +1 -1
- package/src/components/StartPanel/StartPanel.tsx +3 -3
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +1 -1
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +1 -1
- package/src/components/layouts/totem.css +49 -8
- package/src/components/ui/Button.css +1 -1
- package/src/components/ui/Button.tsx +21 -1
- package/src/components/ui/Checkbox.css +0 -2
- package/src/components/ui/Drawer.css +1 -1
- package/src/components/ui/Modal.css +1 -1
- package/src/components/ui/Select.css +17 -16
- package/src/components/ui/Tooltip.css +38 -3
- package/src/components/ui/Tooltip.stories.tsx +40 -3
- package/src/components/ui/Tooltip.test.tsx +52 -0
- package/src/components/ui/Tooltip.tsx +12 -7
- package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +80 -4
- package/src/helpers/configuration.ts +1 -1
- package/src/helpers/translations.ts +3 -2
- package/src/locales/en.json +4 -0
- package/src/locales/it.json +4 -0
- package/src/styles.css +2 -1
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
flex-direction: column;
|
|
13
|
-
|
|
14
|
-
/* --memori-text-color: #fff; */
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
.memori-totem-layout--header {
|
|
@@ -31,6 +29,22 @@
|
|
|
31
29
|
width: 100%;
|
|
32
30
|
}
|
|
33
31
|
|
|
32
|
+
.memori-totem-layout--avatar .memori--blob-container {
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (max-width: 480px) {
|
|
37
|
+
.memori-totem-layout--avatar .memori--blob-container {
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (max-width: 870px) {
|
|
43
|
+
.memori-totem-layout--avatar .memori--blob-container {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
34
48
|
.memori-totem-layout .memori-header {
|
|
35
49
|
position: relative;
|
|
36
50
|
z-index: 100;
|
|
@@ -97,6 +111,27 @@
|
|
|
97
111
|
margin: 0 auto;
|
|
98
112
|
}
|
|
99
113
|
|
|
114
|
+
@media (max-width: 870px) {
|
|
115
|
+
.memori-totem-layout--controls .memori--start-panel,
|
|
116
|
+
.memori-totem-layout--controls .memori-chat--wrapper {
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.memori-totem-layout--controls .memori-chat--wrapper {
|
|
121
|
+
padding: 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media (max-width: 480px) {
|
|
126
|
+
.memori-send-on-enter-menu {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.memori-header--button-settings {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
100
135
|
.memori-totem-layout .memori--avatar-toggle {
|
|
101
136
|
display: none;
|
|
102
137
|
width: 100%;
|
|
@@ -113,14 +148,20 @@
|
|
|
113
148
|
background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(200, 200, 200, 0.8));
|
|
114
149
|
}
|
|
115
150
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
151
|
+
@media (min-width: 481px) {
|
|
152
|
+
.memori-widget.memori-controls-center .memori-totem-layout--controls {
|
|
153
|
+
position: absolute;
|
|
154
|
+
top: 40%;
|
|
155
|
+
width: 100%;
|
|
156
|
+
}
|
|
120
157
|
}
|
|
121
158
|
|
|
122
|
-
.memori-widget.memori-layout-totem.memori--hide-emissions
|
|
123
|
-
.memori-
|
|
159
|
+
.memori-widget.memori-layout-totem.memori--hide-emissions
|
|
160
|
+
.memori-totem-layout--controls
|
|
161
|
+
.memori-chat--bubble-container:not(.memori-chat--bubble-from-user),
|
|
162
|
+
.memori-widget.memori-layout-totem.memori--hide-emissions.memori--with-speechkey
|
|
163
|
+
.memori-totem-layout--controls
|
|
164
|
+
.memori-chat--bubble-container:not(.memori-chat--bubble-from-user) {
|
|
124
165
|
display: none;
|
|
125
166
|
}
|
|
126
167
|
|
|
@@ -23,7 +23,19 @@ export interface Props {
|
|
|
23
23
|
id?: string;
|
|
24
24
|
htmlType?: 'button' | 'submit' | 'reset';
|
|
25
25
|
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
26
|
-
|
|
26
|
+
onMouseDown?: (
|
|
27
|
+
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
|
28
|
+
) => void;
|
|
29
|
+
onMouseUp?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
30
|
+
onMouseLeave?: (
|
|
31
|
+
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
|
32
|
+
) => void;
|
|
33
|
+
onTouchStart?: (
|
|
34
|
+
event: React.TouchEvent<HTMLButtonElement> | React.MouseEvent
|
|
35
|
+
) => void;
|
|
36
|
+
onTouchEnd?: (
|
|
37
|
+
event: React.TouchEvent<HTMLButtonElement> | React.MouseEvent
|
|
38
|
+
) => void;
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
const Button: FC<Props> = ({
|
|
@@ -42,6 +54,10 @@ const Button: FC<Props> = ({
|
|
|
42
54
|
id,
|
|
43
55
|
htmlType,
|
|
44
56
|
onClick,
|
|
57
|
+
onMouseDown,
|
|
58
|
+
onMouseUp,
|
|
59
|
+
onMouseLeave,
|
|
60
|
+
onTouchStart,
|
|
45
61
|
onTouchEnd,
|
|
46
62
|
children,
|
|
47
63
|
}) => (
|
|
@@ -49,6 +65,10 @@ const Button: FC<Props> = ({
|
|
|
49
65
|
id={id}
|
|
50
66
|
type={htmlType}
|
|
51
67
|
onClick={onClick}
|
|
68
|
+
onMouseDown={onMouseDown}
|
|
69
|
+
onMouseUp={onMouseUp}
|
|
70
|
+
onMouseLeave={onMouseLeave}
|
|
71
|
+
onTouchStart={onTouchStart}
|
|
52
72
|
onTouchEnd={onTouchEnd}
|
|
53
73
|
title={title}
|
|
54
74
|
disabled={loading || disabled}
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
position: relative;
|
|
8
8
|
width: 100%;
|
|
9
9
|
min-height: 38px;
|
|
10
|
-
padding-top: .5rem;
|
|
10
|
+
padding-top: 0.5rem;
|
|
11
11
|
padding-right: 2.5rem;
|
|
12
|
-
padding-bottom: .5rem;
|
|
13
|
-
padding-left: .75rem;
|
|
12
|
+
padding-bottom: 0.5rem;
|
|
13
|
+
padding-left: 0.75rem;
|
|
14
14
|
border: 1px solid #e5e7eb;
|
|
15
|
-
border-radius: .5rem;
|
|
15
|
+
border-radius: 0.5rem;
|
|
16
16
|
background: #fff;
|
|
17
|
-
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,
|
|
17
|
+
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,
|
|
18
|
+
rgba(0, 0, 0, 0.1) 0px 2px 4px -2px;
|
|
18
19
|
cursor: pointer;
|
|
19
20
|
text-align: left;
|
|
20
21
|
}
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
|
|
47
48
|
@media (min-width: 640px) {
|
|
48
49
|
.memori-select--button {
|
|
49
|
-
font-size: .875rem;
|
|
50
|
+
font-size: 0.875rem;
|
|
50
51
|
line-height: 1.25rem;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
bottom: 0;
|
|
75
76
|
display: flex;
|
|
76
77
|
align-items: center;
|
|
77
|
-
padding-right: .5rem;
|
|
78
|
+
padding-right: 0.5rem;
|
|
78
79
|
pointer-events: none;
|
|
79
80
|
}
|
|
80
81
|
|
|
@@ -91,32 +92,33 @@ ul.memori-select--options {
|
|
|
91
92
|
width: 100%;
|
|
92
93
|
max-width: min(18rem, 30%);
|
|
93
94
|
max-height: 15rem;
|
|
94
|
-
padding-top: .25rem;
|
|
95
|
+
padding-top: 0.25rem;
|
|
95
96
|
padding-right: 0;
|
|
96
|
-
padding-bottom: .25rem;
|
|
97
|
+
padding-bottom: 0.25rem;
|
|
97
98
|
padding-left: 0;
|
|
98
|
-
border-radius: .375rem;
|
|
99
|
-
margin-top: .25rem;
|
|
99
|
+
border-radius: 0.375rem;
|
|
100
|
+
margin-top: 0.25rem;
|
|
100
101
|
margin-right: 0;
|
|
101
102
|
margin-bottom: 0;
|
|
102
103
|
margin-left: 0;
|
|
103
104
|
background: #fff;
|
|
104
|
-
box-shadow: rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px,
|
|
105
|
+
box-shadow: rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px,
|
|
106
|
+
rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.1) 0px 4px 6px -4px;
|
|
105
107
|
list-style: none;
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
@media (min-width: 640px) {
|
|
109
111
|
.memori-select--options {
|
|
110
|
-
font-size: .875rem;
|
|
112
|
+
font-size: 0.875rem;
|
|
111
113
|
line-height: 1.25rem;
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
li.memori-select--option {
|
|
116
118
|
position: relative;
|
|
117
|
-
padding-top: .5rem;
|
|
119
|
+
padding-top: 0.5rem;
|
|
118
120
|
padding-right: 1rem;
|
|
119
|
-
padding-bottom: .5rem;
|
|
121
|
+
padding-bottom: 0.5rem;
|
|
120
122
|
padding-left: 1rem;
|
|
121
123
|
color: rgb(17 24 39/1);
|
|
122
124
|
cursor: pointer;
|
|
@@ -132,4 +134,3 @@ li.memori-select--option:focus {
|
|
|
132
134
|
outline: 2px solid #63b3ed;
|
|
133
135
|
outline-offset: 2px;
|
|
134
136
|
}
|
|
135
|
-
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* stylelint-disable no-descending-specificity */
|
|
2
|
+
|
|
1
3
|
.memori-tooltip {
|
|
2
4
|
position: relative;
|
|
3
5
|
display: inline-block;
|
|
@@ -23,7 +25,8 @@
|
|
|
23
25
|
transition: 0.3s 0.1s all ease;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
.memori-tooltip.memori-tooltip--align-left .memori-tooltip--content
|
|
28
|
+
.memori-tooltip.memori-tooltip--align-left .memori-tooltip--content,
|
|
29
|
+
.memori-tooltip.memori-tooltip--align-topLeft .memori-tooltip--content {
|
|
27
30
|
right: 100%;
|
|
28
31
|
left: initial;
|
|
29
32
|
margin: initial;
|
|
@@ -38,10 +41,10 @@
|
|
|
38
41
|
border: 10px solid rgba(0, 0, 0, 0.8);
|
|
39
42
|
border-color: transparent rgba(0, 0, 0, 0.8) transparent transparent;
|
|
40
43
|
margin-left: -5px;
|
|
41
|
-
content:
|
|
44
|
+
content: '';
|
|
42
45
|
opacity: 0;
|
|
43
46
|
transform: translateY(-50%);
|
|
44
|
-
transition: .3s;
|
|
47
|
+
transition: 0.3s;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
.memori-tooltip.memori-tooltip--align-left .memori-tooltip--content::before {
|
|
@@ -52,6 +55,15 @@
|
|
|
52
55
|
margin-left: 0;
|
|
53
56
|
}
|
|
54
57
|
|
|
58
|
+
.memori-tooltip.memori-tooltip--align-topRight .memori-tooltip--content::before {
|
|
59
|
+
top: 100%;
|
|
60
|
+
right: auto;
|
|
61
|
+
left: 10px;
|
|
62
|
+
border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
|
|
63
|
+
margin-top: 10px;
|
|
64
|
+
margin-left: 5px;
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
.memori-tooltip:not(.memori-tooltip--disabled).memori-tooltip--visible .memori-tooltip--content,
|
|
56
68
|
.memori-tooltip:not(.memori-tooltip--disabled).memori-tooltip--visible .memori-tooltip--content::before {
|
|
57
69
|
display: block;
|
|
@@ -69,6 +81,29 @@
|
|
|
69
81
|
opacity: 1;
|
|
70
82
|
}
|
|
71
83
|
|
|
84
|
+
.memori-tooltip.memori-tooltip--align-topRight:not(.memori-tooltip--disabled).memori-tooltip--visible
|
|
85
|
+
.memori-tooltip--content,
|
|
86
|
+
.memori-tooltip.memori-tooltip--align-topRight:not(.memori-tooltip--disabled):not(.memori-tooltip--visible):hover
|
|
87
|
+
.memori-tooltip--content {
|
|
88
|
+
transform: translateY(-150%) translateX(-33%);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.memori-tooltip.memori-tooltip--align-topLeft .memori-tooltip--content::before {
|
|
92
|
+
top: 100%;
|
|
93
|
+
right: 10px;
|
|
94
|
+
left: auto;
|
|
95
|
+
border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
|
|
96
|
+
margin-top: 10px;
|
|
97
|
+
margin-left: 5px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.memori-tooltip.memori-tooltip--align-topLeft:not(.memori-tooltip--disabled).memori-tooltip--visible
|
|
101
|
+
.memori-tooltip--content,
|
|
102
|
+
.memori-tooltip.memori-tooltip--align-topLeft:not(.memori-tooltip--disabled):not(.memori-tooltip--visible):hover
|
|
103
|
+
.memori-tooltip--content {
|
|
104
|
+
transform: translateY(-150%) translateX(33%);
|
|
105
|
+
}
|
|
106
|
+
|
|
72
107
|
.memori-tooltip:not(.memori-tooltip--disabled).memori-tooltip--visible .memori-tooltip--content a,
|
|
73
108
|
.memori-tooltip:not(.memori-tooltip--disabled):not(.memori-tooltip--visible):hover .memori-tooltip--content a {
|
|
74
109
|
color: #fff;
|
|
@@ -20,9 +20,21 @@ const meta: Meta = {
|
|
|
20
20
|
|
|
21
21
|
export default meta;
|
|
22
22
|
|
|
23
|
-
const Template: Story<Props> = args =>
|
|
23
|
+
const Template: Story<Props> = args => (
|
|
24
|
+
<div
|
|
25
|
+
style={{
|
|
26
|
+
display: 'flex',
|
|
27
|
+
justifyContent: 'flex-start',
|
|
28
|
+
paddingTop: '10rem',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<Tooltip {...args} />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
24
34
|
const TemplateRight: Story<Props> = args => (
|
|
25
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
style={{ display: 'flex', justifyContent: 'flex-end', paddingTop: '10rem' }}
|
|
37
|
+
>
|
|
26
38
|
<Tooltip {...args} />
|
|
27
39
|
</div>
|
|
28
40
|
);
|
|
@@ -68,5 +80,30 @@ export const AlignLeft = TemplateRight.bind({});
|
|
|
68
80
|
AlignLeft.args = {
|
|
69
81
|
content: 'Here is some tooltip content',
|
|
70
82
|
children: <span>Hover me</span>,
|
|
71
|
-
|
|
83
|
+
align: 'left',
|
|
84
|
+
visible: true,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const AlignRight = Template.bind({});
|
|
88
|
+
AlignRight.args = {
|
|
89
|
+
content: 'Here is some tooltip content',
|
|
90
|
+
children: <span>Hover me</span>,
|
|
91
|
+
align: 'right',
|
|
92
|
+
visible: true,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const AlignTopLeft = TemplateRight.bind({});
|
|
96
|
+
AlignTopLeft.args = {
|
|
97
|
+
content: 'Here is some tooltip content',
|
|
98
|
+
children: <span>Hover me</span>,
|
|
99
|
+
align: 'topLeft',
|
|
100
|
+
visible: true,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const AlignTopRight = Template.bind({});
|
|
104
|
+
AlignTopRight.args = {
|
|
105
|
+
content: 'Here is some tooltip content',
|
|
106
|
+
children: <span>Hover me</span>,
|
|
107
|
+
align: 'topRight',
|
|
108
|
+
visible: true,
|
|
72
109
|
};
|
|
@@ -48,3 +48,55 @@ it('renders Tooltip visible unchanged', () => {
|
|
|
48
48
|
);
|
|
49
49
|
expect(container).toMatchSnapshot();
|
|
50
50
|
});
|
|
51
|
+
|
|
52
|
+
it('renders Tooltip aligned left unchanged', () => {
|
|
53
|
+
const { container } = render(
|
|
54
|
+
<Tooltip
|
|
55
|
+
content="Here is some tooltip content by default as I am controlled"
|
|
56
|
+
visible
|
|
57
|
+
align="left"
|
|
58
|
+
>
|
|
59
|
+
Hover me
|
|
60
|
+
</Tooltip>
|
|
61
|
+
);
|
|
62
|
+
expect(container).toMatchSnapshot();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('renders Tooltip aligned top left unchanged', () => {
|
|
66
|
+
const { container } = render(
|
|
67
|
+
<Tooltip
|
|
68
|
+
content="Here is some tooltip content by default as I am controlled"
|
|
69
|
+
visible
|
|
70
|
+
align="topLeft"
|
|
71
|
+
>
|
|
72
|
+
Hover me
|
|
73
|
+
</Tooltip>
|
|
74
|
+
);
|
|
75
|
+
expect(container).toMatchSnapshot();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('renders Tooltip aligned right unchanged', () => {
|
|
79
|
+
const { container } = render(
|
|
80
|
+
<Tooltip
|
|
81
|
+
content="Here is some tooltip content by default as I am controlled"
|
|
82
|
+
visible
|
|
83
|
+
align="right"
|
|
84
|
+
>
|
|
85
|
+
Hover me
|
|
86
|
+
</Tooltip>
|
|
87
|
+
);
|
|
88
|
+
expect(container).toMatchSnapshot();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('renders Tooltip aligned top right unchanged', () => {
|
|
92
|
+
const { container } = render(
|
|
93
|
+
<Tooltip
|
|
94
|
+
content="Here is some tooltip content by default as I am controlled"
|
|
95
|
+
visible
|
|
96
|
+
align="topRight"
|
|
97
|
+
>
|
|
98
|
+
Hover me
|
|
99
|
+
</Tooltip>
|
|
100
|
+
);
|
|
101
|
+
expect(container).toMatchSnapshot();
|
|
102
|
+
});
|
|
@@ -4,7 +4,8 @@ import cx from 'classnames';
|
|
|
4
4
|
export interface Props {
|
|
5
5
|
content: string | JSX.Element | React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
-
|
|
7
|
+
align?: 'left' | 'right' | 'topLeft' | 'topRight';
|
|
8
|
+
alignTop?: boolean;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
children: React.ReactNode;
|
|
10
11
|
visible?: boolean;
|
|
@@ -13,17 +14,21 @@ export interface Props {
|
|
|
13
14
|
const Tooltip: FC<Props> = ({
|
|
14
15
|
content,
|
|
15
16
|
className,
|
|
16
|
-
|
|
17
|
+
align = 'right',
|
|
17
18
|
disabled = false,
|
|
18
19
|
visible = false,
|
|
19
20
|
children,
|
|
20
21
|
}) => (
|
|
21
22
|
<div
|
|
22
|
-
className={cx(
|
|
23
|
-
'memori-tooltip
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
className={cx(
|
|
24
|
+
'memori-tooltip',
|
|
25
|
+
`memori-tooltip--align-${align}`,
|
|
26
|
+
className,
|
|
27
|
+
{
|
|
28
|
+
'memori-tooltip--disabled': disabled,
|
|
29
|
+
'memori-tooltip--visible': visible,
|
|
30
|
+
}
|
|
31
|
+
)}
|
|
27
32
|
>
|
|
28
33
|
<div className="memori-tooltip--content">{content}</div>
|
|
29
34
|
<div className="memori-tooltip--trigger">{children}</div>
|
|
@@ -1,9 +1,85 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders Tooltip aligned left unchanged 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="memori-tooltip memori-tooltip--align-left memori-tooltip--visible"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="memori-tooltip--content"
|
|
10
|
+
>
|
|
11
|
+
Here is some tooltip content by default as I am controlled
|
|
12
|
+
</div>
|
|
13
|
+
<div
|
|
14
|
+
class="memori-tooltip--trigger"
|
|
15
|
+
>
|
|
16
|
+
Hover me
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`renders Tooltip aligned right unchanged 1`] = `
|
|
23
|
+
<div>
|
|
24
|
+
<div
|
|
25
|
+
class="memori-tooltip memori-tooltip--align-right memori-tooltip--visible"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="memori-tooltip--content"
|
|
29
|
+
>
|
|
30
|
+
Here is some tooltip content by default as I am controlled
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
class="memori-tooltip--trigger"
|
|
34
|
+
>
|
|
35
|
+
Hover me
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`renders Tooltip aligned top left unchanged 1`] = `
|
|
42
|
+
<div>
|
|
43
|
+
<div
|
|
44
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-tooltip--visible"
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
class="memori-tooltip--content"
|
|
48
|
+
>
|
|
49
|
+
Here is some tooltip content by default as I am controlled
|
|
50
|
+
</div>
|
|
51
|
+
<div
|
|
52
|
+
class="memori-tooltip--trigger"
|
|
53
|
+
>
|
|
54
|
+
Hover me
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`renders Tooltip aligned top right unchanged 1`] = `
|
|
61
|
+
<div>
|
|
62
|
+
<div
|
|
63
|
+
class="memori-tooltip memori-tooltip--align-topRight memori-tooltip--visible"
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
class="memori-tooltip--content"
|
|
67
|
+
>
|
|
68
|
+
Here is some tooltip content by default as I am controlled
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
class="memori-tooltip--trigger"
|
|
72
|
+
>
|
|
73
|
+
Hover me
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
|
|
3
79
|
exports[`renders Tooltip disabled unchanged 1`] = `
|
|
4
80
|
<div>
|
|
5
81
|
<div
|
|
6
|
-
class="memori-tooltip memori-tooltip--disabled"
|
|
82
|
+
class="memori-tooltip memori-tooltip--align-right memori-tooltip--disabled"
|
|
7
83
|
>
|
|
8
84
|
<div
|
|
9
85
|
class="memori-tooltip--content"
|
|
@@ -22,7 +98,7 @@ exports[`renders Tooltip disabled unchanged 1`] = `
|
|
|
22
98
|
exports[`renders Tooltip unchanged 1`] = `
|
|
23
99
|
<div>
|
|
24
100
|
<div
|
|
25
|
-
class="memori-tooltip"
|
|
101
|
+
class="memori-tooltip memori-tooltip--align-right"
|
|
26
102
|
>
|
|
27
103
|
<div
|
|
28
104
|
class="memori-tooltip--content"
|
|
@@ -41,7 +117,7 @@ exports[`renders Tooltip unchanged 1`] = `
|
|
|
41
117
|
exports[`renders Tooltip visible unchanged 1`] = `
|
|
42
118
|
<div>
|
|
43
119
|
<div
|
|
44
|
-
class="memori-tooltip memori-tooltip--visible"
|
|
120
|
+
class="memori-tooltip memori-tooltip--align-right memori-tooltip--visible"
|
|
45
121
|
>
|
|
46
122
|
<div
|
|
47
123
|
class="memori-tooltip--content"
|
|
@@ -60,7 +136,7 @@ exports[`renders Tooltip visible unchanged 1`] = `
|
|
|
60
136
|
exports[`renders Tooltip with jsx content unchanged 1`] = `
|
|
61
137
|
<div>
|
|
62
138
|
<div
|
|
63
|
-
class="memori-tooltip"
|
|
139
|
+
class="memori-tooltip memori-tooltip--align-right"
|
|
64
140
|
>
|
|
65
141
|
<div
|
|
66
142
|
class="memori-tooltip--content"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const keys: { [key: string]: string } = {
|
|
2
2
|
muteSpeaker: '@memori:muteSpeaker',
|
|
3
|
-
|
|
3
|
+
microphoneMode: '@memori:microphoneMode',
|
|
4
4
|
continuousSpeechTimeout: '@memori:continuousSpeechTimeout',
|
|
5
5
|
sendOnEnter: '@memori:sendOnEnter',
|
|
6
6
|
birthDate: '@memori:birthDate',
|
|
@@ -23,8 +23,9 @@ export const getTranslation = async (
|
|
|
23
23
|
const isReservedKeyword = dialogKeywords.indexOf(text.toLowerCase()) > -1;
|
|
24
24
|
const fromLanguage = isReservedKeyword ? 'IT' : from?.toUpperCase();
|
|
25
25
|
const deeplResult = await fetch(
|
|
26
|
-
`${
|
|
27
|
-
'https://app.twincreator.com'
|
|
26
|
+
`${
|
|
27
|
+
baseUrl || 'https://app.twincreator.com'
|
|
28
|
+
}/api/translate?text=${encodeURIComponent(
|
|
28
29
|
text
|
|
29
30
|
)}&target_lang=${to.toUpperCase()}${
|
|
30
31
|
fromLanguage ? `&source_lang=${fromLanguage}` : ''
|
package/src/locales/en.json
CHANGED
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
"conversationStartedLabel": "Conversation started on",
|
|
71
71
|
"settingsHeaderLabel": "Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.",
|
|
72
72
|
"continuousSpeechLabel": "Continuous speech",
|
|
73
|
+
"holdToSpeak": "Hold to speak",
|
|
74
|
+
"releaseToEndListening": "Release to end listening",
|
|
75
|
+
"pressAndHoldToSpeak": "Press and hold to speak",
|
|
76
|
+
"microphoneMode": "Microphone mode",
|
|
73
77
|
"hideEmissionsLabel": "Hide text emitted by the Twin",
|
|
74
78
|
"secondsLabel": "Set seconds",
|
|
75
79
|
"controlsPosition": "Controls position",
|
package/src/locales/it.json
CHANGED
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
"conversationStartedLabel": "Conversazione avvenuta il",
|
|
71
71
|
"settingsHeaderLabel": "Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell'invio.",
|
|
72
72
|
"continuousSpeechLabel": "Conversazione continua",
|
|
73
|
+
"holdToSpeak": "Tieni premuto per parlare",
|
|
74
|
+
"releaseToEndListening": "Rilascia per smettere di parlare",
|
|
75
|
+
"pressAndHoldToSpeak": "Premi e tieni premuto per parlare",
|
|
76
|
+
"microphoneMode": "Modalità microfono",
|
|
73
77
|
"hideEmissionsLabel": "Nascondi testo emesso dal Twin",
|
|
74
78
|
"secondsLabel": "Secondi",
|
|
75
79
|
"controlsPosition": "Posizione dei controlli",
|
package/src/styles.css
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
@import url('./components/Chat/Chat.css');
|
|
18
18
|
@import url('./components/ChatBubble/ChatBubble.css');
|
|
19
19
|
@import url('./components/ChatInputs/ChatInputs.css');
|
|
20
|
+
@import url('./components/MicrophoneButton/MicrophoneButton.css');
|
|
20
21
|
@import url('./components/ChatTextArea/ChatTextArea.css');
|
|
21
22
|
@import url('./components/CustomGLBModelViewer/ModelViewer.css');
|
|
22
23
|
@import url('./components/SettingsDrawer/SettingsDrawer.css');
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
|
|
56
57
|
memori-client,
|
|
57
58
|
memori-client #root,
|
|
58
|
-
memori-client
|
|
59
|
+
memori-client ~ #headlessui-portal-root,
|
|
59
60
|
body.sb-show-main #root,
|
|
60
61
|
body.sb-show-main #headlessui-portal-root,
|
|
61
62
|
#storybook-root,
|