@memori.ai/memori-react 9.0.0 → 9.0.2
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 +24 -0
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +7 -3
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +1 -0
- package/dist/components/Header/ChatConsumptionDropdown.js +1 -1
- package/dist/components/Header/ChatConsumptionDropdown.js.map +1 -1
- package/dist/components/Header/Header.css +1 -0
- package/dist/components/IconButton/IconButton.css +8 -0
- package/dist/components/MemoriWidget/MemoriWidget.js +52 -7
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MobileSessionPanel/MobileSessionPanel.css +27 -0
- package/dist/components/MobileSessionPanel/MobileSessionPanel.d.ts +17 -3
- package/dist/components/MobileSessionPanel/MobileSessionPanel.js +106 -31
- package/dist/components/MobileSessionPanel/MobileSessionPanel.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.css +5 -7
- package/dist/components/StartPanel/StartPanel.js +4 -4
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/Chat.js +18 -9
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/FullPage.js +18 -9
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +24 -10
- package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +7 -5
- package/dist/components/layouts/ZoomedFullBody.js +18 -9
- package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
- package/dist/components/layouts/fullpage.css +5 -0
- package/dist/components/layouts/zoomed-full-body.css +3 -0
- package/dist/helpers/artifactPanel.d.ts +1 -1
- package/dist/helpers/artifactPanel.js +1 -1
- package/dist/helpers/autoStart.d.ts +1 -0
- package/dist/helpers/autoStart.js +7 -0
- package/dist/helpers/autoStart.js.map +1 -1
- package/dist/helpers/constants.d.ts +3 -1
- package/dist/helpers/constants.js +44 -31
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/conversationTitle.d.ts +2 -1
- package/dist/helpers/conversationTitle.js +215 -17
- package/dist/helpers/conversationTitle.js.map +1 -1
- package/dist/locales/it.json +2 -2
- package/dist/styles/host-isolation.css +57 -0
- package/dist/styles.css +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +8 -4
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +1 -0
- package/esm/components/Header/ChatConsumptionDropdown.js +2 -2
- package/esm/components/Header/ChatConsumptionDropdown.js.map +1 -1
- package/esm/components/Header/Header.css +1 -0
- package/esm/components/IconButton/IconButton.css +8 -0
- package/esm/components/MemoriWidget/MemoriWidget.js +53 -8
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MobileSessionPanel/MobileSessionPanel.css +27 -0
- package/esm/components/MobileSessionPanel/MobileSessionPanel.d.ts +17 -3
- package/esm/components/MobileSessionPanel/MobileSessionPanel.js +105 -33
- package/esm/components/MobileSessionPanel/MobileSessionPanel.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.css +5 -7
- package/esm/components/StartPanel/StartPanel.js +4 -4
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/Chat.js +19 -10
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/FullPage.js +20 -11
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js +25 -11
- package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +7 -5
- package/esm/components/layouts/ZoomedFullBody.js +20 -11
- package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
- package/esm/components/layouts/fullpage.css +5 -0
- package/esm/components/layouts/zoomed-full-body.css +3 -0
- package/esm/helpers/artifactPanel.d.ts +1 -1
- package/esm/helpers/artifactPanel.js +1 -1
- package/esm/helpers/autoStart.d.ts +1 -0
- package/esm/helpers/autoStart.js +6 -0
- package/esm/helpers/autoStart.js.map +1 -1
- package/esm/helpers/constants.d.ts +3 -1
- package/esm/helpers/constants.js +42 -30
- package/esm/helpers/constants.js.map +1 -1
- package/esm/helpers/conversationTitle.d.ts +2 -1
- package/esm/helpers/conversationTitle.js +215 -17
- package/esm/helpers/conversationTitle.js.map +1 -1
- package/esm/locales/it.json +2 -2
- package/esm/styles/host-isolation.css +57 -0
- package/esm/styles.css +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +1 -1
package/esm/helpers/constants.js
CHANGED
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
export const chatLanguages = [
|
|
2
|
-
{ value: 'AR', label: 'Arabic' },
|
|
3
|
-
{ value: 'BG', label: 'Bulgarian' },
|
|
4
|
-
{ value: 'CS', label: 'Czech' },
|
|
5
|
-
{ value: 'DA', label: 'Danish' },
|
|
6
|
-
{ value: 'DE', label: 'German' },
|
|
7
|
-
{ value: 'EL', label: 'Greek' },
|
|
8
|
-
{ value: 'EN', label: 'English' },
|
|
9
|
-
{ value: 'ES', label: 'Spanish' },
|
|
10
|
-
{ value: 'ET', label: 'Estonian' },
|
|
11
|
-
{ value: 'FI', label: 'Finnish' },
|
|
12
|
-
{ value: 'FR', label: 'French' },
|
|
13
|
-
{ value: 'HR', label: 'Croatian' },
|
|
14
|
-
{ value: 'HU', label: 'Hungarian' },
|
|
15
|
-
{ value: 'IT', label: 'Italian' },
|
|
16
|
-
{ value: 'JA', label: 'Japanese' },
|
|
17
|
-
{ value: 'LT', label: 'Lithuanian' },
|
|
18
|
-
{ value: 'LV', label: 'Latvian' },
|
|
19
|
-
{ value: 'NL', label: 'Dutch' },
|
|
20
|
-
{ value: 'PL', label: 'Polish' },
|
|
21
|
-
{ value: 'PT', label: 'Portuguese' },
|
|
22
|
-
{ value: 'RO', label: 'Romanian' },
|
|
23
|
-
{ value: 'RU', label: 'Russian' },
|
|
24
|
-
{ value: 'SK', label: 'Slovak' },
|
|
25
|
-
{ value: 'SL', label: 'Slovenian' },
|
|
26
|
-
{ value: 'SV', label: 'Swedish' },
|
|
27
|
-
{ value: 'UK', label: 'Ukrainian' },
|
|
28
|
-
{ value: 'ZH', label: 'Chinese' },
|
|
2
|
+
{ value: 'AR', label: 'Arabic', labelIt: 'Arabo' },
|
|
3
|
+
{ value: 'BG', label: 'Bulgarian', labelIt: 'Bulgaro' },
|
|
4
|
+
{ value: 'CS', label: 'Czech', labelIt: 'Ceco' },
|
|
5
|
+
{ value: 'DA', label: 'Danish', labelIt: 'Danese' },
|
|
6
|
+
{ value: 'DE', label: 'German', labelIt: 'Tedesco' },
|
|
7
|
+
{ value: 'EL', label: 'Greek', labelIt: 'Greco' },
|
|
8
|
+
{ value: 'EN', label: 'English', labelIt: 'Inglese' },
|
|
9
|
+
{ value: 'ES', label: 'Spanish', labelIt: 'Spagnolo' },
|
|
10
|
+
{ value: 'ET', label: 'Estonian', labelIt: 'Estone' },
|
|
11
|
+
{ value: 'FI', label: 'Finnish', labelIt: 'Finlandese' },
|
|
12
|
+
{ value: 'FR', label: 'French', labelIt: 'Francese' },
|
|
13
|
+
{ value: 'HR', label: 'Croatian', labelIt: 'Croato' },
|
|
14
|
+
{ value: 'HU', label: 'Hungarian', labelIt: 'Ungherese' },
|
|
15
|
+
{ value: 'IT', label: 'Italian', labelIt: 'Italiano' },
|
|
16
|
+
{ value: 'JA', label: 'Japanese', labelIt: 'Giapponese' },
|
|
17
|
+
{ value: 'LT', label: 'Lithuanian', labelIt: 'Lituano' },
|
|
18
|
+
{ value: 'LV', label: 'Latvian', labelIt: 'Lettone' },
|
|
19
|
+
{ value: 'NL', label: 'Dutch', labelIt: 'Olandese' },
|
|
20
|
+
{ value: 'PL', label: 'Polish', labelIt: 'Polacco' },
|
|
21
|
+
{ value: 'PT', label: 'Portuguese', labelIt: 'Portoghese' },
|
|
22
|
+
{ value: 'RO', label: 'Romanian', labelIt: 'Rumeno' },
|
|
23
|
+
{ value: 'RU', label: 'Russian', labelIt: 'Russo' },
|
|
24
|
+
{ value: 'SK', label: 'Slovak', labelIt: 'Slovacco' },
|
|
25
|
+
{ value: 'SL', label: 'Slovenian', labelIt: 'Sloveno' },
|
|
26
|
+
{ value: 'SV', label: 'Swedish', labelIt: 'Svedese' },
|
|
27
|
+
{ value: 'UK', label: 'Ukrainian', labelIt: 'Ucraino' },
|
|
28
|
+
{ value: 'ZH', label: 'Chinese', labelIt: 'Cinese' },
|
|
29
29
|
];
|
|
30
30
|
export const popularLanguageCodes = ['IT', 'EN'];
|
|
31
|
-
export const
|
|
32
|
-
const
|
|
33
|
-
|
|
31
|
+
export const getChatLanguageLabel = (lang, uiLanguage) => {
|
|
32
|
+
const code = (uiLanguage !== null && uiLanguage !== void 0 ? uiLanguage : 'en').toLowerCase().split('-')[0];
|
|
33
|
+
return code === 'it' ? lang.labelIt : lang.label;
|
|
34
|
+
};
|
|
35
|
+
export const getGroupedChatLanguages = (uiLanguage) => {
|
|
36
|
+
const withLabel = (lang) => ({
|
|
37
|
+
value: lang.value,
|
|
38
|
+
label: getChatLanguageLabel(lang, uiLanguage),
|
|
39
|
+
});
|
|
40
|
+
const popular = chatLanguages
|
|
41
|
+
.filter(lang => popularLanguageCodes.includes(lang.value))
|
|
42
|
+
.map(withLabel);
|
|
43
|
+
const all = chatLanguages
|
|
44
|
+
.filter(lang => !popularLanguageCodes.includes(lang.value))
|
|
45
|
+
.map(withLabel);
|
|
34
46
|
return {
|
|
35
47
|
popular,
|
|
36
48
|
all,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
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,EAAE,EAAE;QACF;YACE,IAAI,EAAE,EAAE;YACR,UAAU,EAAE,EAAE;SACf;QACD;YACE,IAAI,EAAE,4BAA4B;YAClC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,oBAAoB;YAC1B,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,+BAA+B;YACrC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,uCAAuC;YAC7C,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,4BAA4B;YAClC,UAAU,EAAE,CAAC;SACd;KACF;IACD,EAAE,EAAE;QACF;YACE,IAAI,EAAE,EAAE;YACR,UAAU,EAAE,EAAE;SACf;QACD;YACE,IAAI,EAAE,0CAA0C;YAChD,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,2BAA2B;YACjC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,2CAA2C;YACjD,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC;SACd;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC"}
|
|
@@ -2,7 +2,8 @@ export type ConversationTitleLine = {
|
|
|
2
2
|
inbound?: boolean;
|
|
3
3
|
text?: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const getConversationTitle: ({
|
|
5
|
+
export declare const getConversationTitle: ({ lines, truncate, }: {
|
|
6
6
|
title?: string | null;
|
|
7
7
|
lines: ConversationTitleLine[];
|
|
8
|
+
truncate?: boolean;
|
|
8
9
|
}) => string;
|
|
@@ -1,23 +1,221 @@
|
|
|
1
1
|
import { stripHTML } from './utils';
|
|
2
2
|
import { stripAllInternalTags } from './message';
|
|
3
|
-
const TITLE_MAX_LENGTH =
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const TITLE_MAX_LENGTH = 100;
|
|
4
|
+
const insignificantPhrases = [
|
|
5
|
+
'hello',
|
|
6
|
+
'hi',
|
|
7
|
+
'hey',
|
|
8
|
+
'good morning',
|
|
9
|
+
'good afternoon',
|
|
10
|
+
'good evening',
|
|
11
|
+
'thanks',
|
|
12
|
+
'thank you',
|
|
13
|
+
'thx',
|
|
14
|
+
'tnx',
|
|
15
|
+
'ty',
|
|
16
|
+
'thanks!',
|
|
17
|
+
'thank you!',
|
|
18
|
+
'ok',
|
|
19
|
+
'okay',
|
|
20
|
+
'k',
|
|
21
|
+
'yes',
|
|
22
|
+
'no',
|
|
23
|
+
'yep',
|
|
24
|
+
'nope',
|
|
25
|
+
'yeah',
|
|
26
|
+
'nah',
|
|
27
|
+
'good',
|
|
28
|
+
'great',
|
|
29
|
+
'nice',
|
|
30
|
+
'cool',
|
|
31
|
+
'awesome',
|
|
32
|
+
'perfect',
|
|
33
|
+
'excellent',
|
|
34
|
+
'bye',
|
|
35
|
+
'goodbye',
|
|
36
|
+
'see you',
|
|
37
|
+
'see ya',
|
|
38
|
+
'later',
|
|
39
|
+
'good night',
|
|
40
|
+
'how are you',
|
|
41
|
+
'how are you doing',
|
|
42
|
+
"what's up",
|
|
43
|
+
'sup',
|
|
44
|
+
'please',
|
|
45
|
+
'pls',
|
|
46
|
+
'sorry',
|
|
47
|
+
'excuse me',
|
|
48
|
+
'pardon',
|
|
49
|
+
'i see',
|
|
50
|
+
'i understand',
|
|
51
|
+
'got it',
|
|
52
|
+
'gotcha',
|
|
53
|
+
'understood',
|
|
54
|
+
'continue',
|
|
55
|
+
'go on',
|
|
56
|
+
'tell me more',
|
|
57
|
+
'more',
|
|
58
|
+
'next',
|
|
59
|
+
'start',
|
|
60
|
+
'begin',
|
|
61
|
+
"let's start",
|
|
62
|
+
"let's begin",
|
|
63
|
+
'help',
|
|
64
|
+
'can you help',
|
|
65
|
+
'i need help',
|
|
66
|
+
'test',
|
|
67
|
+
'testing',
|
|
68
|
+
'test message',
|
|
69
|
+
'?',
|
|
70
|
+
'??',
|
|
71
|
+
'???',
|
|
72
|
+
'!',
|
|
73
|
+
'!!',
|
|
74
|
+
'!!!',
|
|
75
|
+
'...',
|
|
76
|
+
'..',
|
|
77
|
+
'.',
|
|
78
|
+
'a',
|
|
79
|
+
'an',
|
|
80
|
+
'the',
|
|
81
|
+
'and',
|
|
82
|
+
'or',
|
|
83
|
+
'but',
|
|
84
|
+
'in',
|
|
85
|
+
'on',
|
|
86
|
+
'at',
|
|
87
|
+
'to',
|
|
88
|
+
'for',
|
|
89
|
+
'of',
|
|
90
|
+
'with',
|
|
91
|
+
'by',
|
|
92
|
+
'ciao',
|
|
93
|
+
'salve',
|
|
94
|
+
'buongiorno',
|
|
95
|
+
'buonasera',
|
|
96
|
+
'buonanotte',
|
|
97
|
+
'grazie',
|
|
98
|
+
'grazie mille',
|
|
99
|
+
'grazie!',
|
|
100
|
+
'grazie mille!',
|
|
101
|
+
'va bene',
|
|
102
|
+
'va bene così',
|
|
103
|
+
'perfetto',
|
|
104
|
+
'ottimo',
|
|
105
|
+
'bene',
|
|
106
|
+
'sì',
|
|
107
|
+
'si',
|
|
108
|
+
'certo',
|
|
109
|
+
'certamente',
|
|
110
|
+
'assolutamente',
|
|
111
|
+
'arrivederci',
|
|
112
|
+
'a presto',
|
|
113
|
+
'a dopo',
|
|
114
|
+
'ci vediamo',
|
|
115
|
+
'addio',
|
|
116
|
+
'come stai',
|
|
117
|
+
'come va',
|
|
118
|
+
'tutto bene',
|
|
119
|
+
'che succede',
|
|
120
|
+
'per favore',
|
|
121
|
+
'per piacere',
|
|
122
|
+
'scusa',
|
|
123
|
+
'scusami',
|
|
124
|
+
'mi dispiace',
|
|
125
|
+
'capisco',
|
|
126
|
+
'ho capito',
|
|
127
|
+
'capito',
|
|
128
|
+
'continua',
|
|
129
|
+
'vai avanti',
|
|
130
|
+
'dimmi di più',
|
|
131
|
+
'altro',
|
|
132
|
+
'altro ancora',
|
|
133
|
+
'inizia',
|
|
134
|
+
'iniziamo',
|
|
135
|
+
'comincia',
|
|
136
|
+
'cominciamo',
|
|
137
|
+
'aiuto',
|
|
138
|
+
'puoi aiutarmi',
|
|
139
|
+
'ho bisogno di aiuto',
|
|
140
|
+
'prova',
|
|
141
|
+
'messaggio di prova',
|
|
142
|
+
'un',
|
|
143
|
+
'una',
|
|
144
|
+
'il',
|
|
145
|
+
'la',
|
|
146
|
+
'gli',
|
|
147
|
+
'le',
|
|
148
|
+
'e',
|
|
149
|
+
'o',
|
|
150
|
+
'ma',
|
|
151
|
+
'su',
|
|
152
|
+
'per',
|
|
153
|
+
'di',
|
|
154
|
+
'con',
|
|
155
|
+
'da',
|
|
156
|
+
];
|
|
157
|
+
const calculateSignificanceScore = (message) => {
|
|
158
|
+
const cleanMessage = message.toLowerCase().trim();
|
|
159
|
+
if (insignificantPhrases.includes(cleanMessage)) {
|
|
160
|
+
return 0;
|
|
161
|
+
}
|
|
162
|
+
const wordCount = cleanMessage
|
|
163
|
+
.split(/\s+/)
|
|
164
|
+
.filter(word => word.length > 0).length;
|
|
165
|
+
if (wordCount < 3) {
|
|
166
|
+
return 0.1;
|
|
167
|
+
}
|
|
168
|
+
if (cleanMessage.length < 5) {
|
|
169
|
+
return 0.1;
|
|
170
|
+
}
|
|
171
|
+
const isQuestion = /\?$/.test(cleanMessage) ||
|
|
172
|
+
/^(what|how|why|when|where|who|which|can|could|would|will|do|does|did|is|are|was|were)/.test(cleanMessage) ||
|
|
173
|
+
/^(cosa|come|perché|perche|quando|dove|chi|quale|quali|può|puo|potrebbe|vorrebbe|sarà|sara|fa|fai|fanno|è|e|sono|era|erano)/.test(cleanMessage);
|
|
174
|
+
let score = 0.5;
|
|
175
|
+
if (isQuestion)
|
|
176
|
+
score += 0.3;
|
|
177
|
+
if (wordCount > 5)
|
|
178
|
+
score += 0.2;
|
|
179
|
+
if (wordCount > 10)
|
|
180
|
+
score += 0.2;
|
|
181
|
+
if (wordCount > 20)
|
|
182
|
+
score -= 0.1;
|
|
183
|
+
if (/\d/.test(cleanMessage))
|
|
184
|
+
score += 0.1;
|
|
185
|
+
if (/[A-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸ][a-zàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]+/.test(message)) {
|
|
186
|
+
score += 0.1;
|
|
187
|
+
}
|
|
188
|
+
return Math.min(score, 1.0);
|
|
12
189
|
};
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
190
|
+
const truncateTitle = (title, maxLength = TITLE_MAX_LENGTH) => {
|
|
191
|
+
if (title.length <= maxLength)
|
|
192
|
+
return title;
|
|
193
|
+
const truncated = title.substring(0, maxLength);
|
|
194
|
+
const lastSpace = truncated.lastIndexOf(' ');
|
|
195
|
+
if (lastSpace > maxLength * 0.7) {
|
|
196
|
+
return `${truncated.substring(0, lastSpace)}...`;
|
|
197
|
+
}
|
|
198
|
+
return `${truncated}...`;
|
|
199
|
+
};
|
|
200
|
+
export const getConversationTitle = ({ lines, truncate = true, }) => {
|
|
201
|
+
const userMessages = lines.filter(line => line.inbound);
|
|
202
|
+
if (userMessages.length === 0)
|
|
20
203
|
return '';
|
|
21
|
-
|
|
204
|
+
const scoredMessages = userMessages.map((msg, index) => {
|
|
205
|
+
const text = stripHTML(stripAllInternalTags(msg.text || ''));
|
|
206
|
+
return {
|
|
207
|
+
text,
|
|
208
|
+
score: calculateSignificanceScore(text),
|
|
209
|
+
index,
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
scoredMessages.sort((a, b) => {
|
|
213
|
+
if (Math.abs(a.score - b.score) < 0.1) {
|
|
214
|
+
return a.index - b.index;
|
|
215
|
+
}
|
|
216
|
+
return b.score - a.score;
|
|
217
|
+
});
|
|
218
|
+
const bestMessage = scoredMessages[0];
|
|
219
|
+
return truncate ? truncateTitle(bestMessage.text) : bestMessage.text;
|
|
22
220
|
};
|
|
23
221
|
//# sourceMappingURL=conversationTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversationTitle.js","sourceRoot":"","sources":["../../src/helpers/conversationTitle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAO7B,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"conversationTitle.js","sourceRoot":"","sources":["../../src/helpers/conversationTitle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAO7B,MAAM,oBAAoB,GAAG;IAC3B,OAAO;IACP,IAAI;IACJ,KAAK;IACL,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,QAAQ;IACR,WAAW;IACX,KAAK;IACL,KAAK;IACL,IAAI;IACJ,SAAS;IACT,YAAY;IACZ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,KAAK;IACL,IAAI;IACJ,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;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,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC;YACtC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAEtC,OAAO,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC;AACvE,CAAC,CAAC"}
|
package/esm/locales/it.json
CHANGED
|
@@ -512,8 +512,8 @@
|
|
|
512
512
|
"editEmail": "Modifica",
|
|
513
513
|
"otpSentToPrefix": "Abbiamo mandato un codice di 4 cifre a",
|
|
514
514
|
"otpCodeShort": "Codice",
|
|
515
|
-
"loginBenefitLine1": "{{memoriName}}
|
|
516
|
-
"loginBenefit": "{{memoriName}}
|
|
515
|
+
"loginBenefitLine1": "{{memoriName}} ti mostra la cronologia delle chat, che puoi riprendere in qualsiasi momento.",
|
|
516
|
+
"loginBenefit": "{{memoriName}} ti mostra la cronologia delle chat, che puoi riprendere in qualsiasi momento.",
|
|
517
517
|
"passwordlessHint": "Ti mandiamo un codice di 4 cifre. Nessuna password da ricordare.",
|
|
518
518
|
"defaultAgentName": "l'agente",
|
|
519
519
|
"otpSent": "Codice di verifica inviato!",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Host-page isolation.
|
|
3
|
+
* @memori.ai/ui ships its rules inside `@layer memori.*`, and any unlayered
|
|
4
|
+
* host rule beats a layered one regardless of specificity: bare resets such as
|
|
5
|
+
* `button { font: inherit }` or `h2 { text-transform: uppercase }` would win
|
|
6
|
+
* over `.memori-button` / `.memori--title`.
|
|
7
|
+
* This unlayered rule (specificity of one class) beats host element selectors
|
|
8
|
+
* and rolls their declarations back to the memori layers. It must stay right
|
|
9
|
+
* after the @memori.ai/ui import so equal-specificity widget rules still win.
|
|
10
|
+
* Replaced elements keep their width/height attributes; MathJax styles its
|
|
11
|
+
* own elements with element selectors, and katex.css is unlayered and loaded
|
|
12
|
+
* before this rule, so both math renderers are left out.
|
|
13
|
+
* Not covered: rem-based tokens still follow the host `html { font-size }`.
|
|
14
|
+
*/
|
|
15
|
+
.memori-widget,
|
|
16
|
+
.memori-widget
|
|
17
|
+
:where(
|
|
18
|
+
:not(
|
|
19
|
+
svg,
|
|
20
|
+
svg *,
|
|
21
|
+
img,
|
|
22
|
+
picture,
|
|
23
|
+
video,
|
|
24
|
+
audio,
|
|
25
|
+
canvas,
|
|
26
|
+
iframe,
|
|
27
|
+
object,
|
|
28
|
+
mjx-container,
|
|
29
|
+
mjx-container *,
|
|
30
|
+
.katex-display,
|
|
31
|
+
.katex,
|
|
32
|
+
.katex *
|
|
33
|
+
)
|
|
34
|
+
) {
|
|
35
|
+
all: revert-layer;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* What the rule above rolls back to when no memori rule sets a value. */
|
|
39
|
+
@layer memori.theme {
|
|
40
|
+
/* Inherited text properties the host body would otherwise pass down */
|
|
41
|
+
.memori-widget {
|
|
42
|
+
font-style: normal;
|
|
43
|
+
font-weight: 400;
|
|
44
|
+
letter-spacing: normal;
|
|
45
|
+
line-height: normal;
|
|
46
|
+
text-align: start;
|
|
47
|
+
text-indent: 0;
|
|
48
|
+
text-transform: none;
|
|
49
|
+
word-spacing: normal;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Inherit the widget typography instead of the UA system font */
|
|
53
|
+
.memori-widget :where(button, input, select, textarea) {
|
|
54
|
+
font: inherit;
|
|
55
|
+
letter-spacing: inherit;
|
|
56
|
+
}
|
|
57
|
+
}
|