@memori.ai/memori-react 8.14.0 → 8.14.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.
@@ -239,7 +239,6 @@
239
239
  align-items: center;
240
240
  justify-content: center;
241
241
  padding: 0;
242
- padding: 1.2rem !important;
243
242
  border: none;
244
243
  border-radius: var(--memori-border-radius);
245
244
  background: #000;
@@ -415,7 +415,11 @@ export const RenderMediaItem = ({
415
415
  // Helper function to count lines in content
416
416
  const countLines = (content: string | undefined): number => {
417
417
  if (!content) return 0;
418
- return content.split('\n').length;
418
+ // Support all common newline conventions:
419
+ // - Unix: \n
420
+ // - Windows: \r\n
421
+ // - Classic Mac: \r
422
+ return content.split(/\r\n|\r|\n/).length;
419
423
  };
420
424
 
421
425
  export const RenderSnippetItem = ({
@@ -434,7 +438,10 @@ export const RenderSnippetItem = ({
434
438
  onClick?: (mediumID: string) => void;
435
439
  }) => {
436
440
  const lineCount = countLines(item.content);
437
- const isShortSnippet = lineCount <= 5;
441
+ const contentLength = item.content?.length ?? 0;
442
+ // Treat very long single-line snippets as "long" so we show a preview,
443
+ // otherwise plain-text uploads with only '\r' (or no '\n') would render full.
444
+ const isShortSnippet = lineCount <= 5 && contentLength <= 200;
438
445
 
439
446
  // For short snippets, show them directly without the clickable link
440
447
  if (isShortSnippet) {
@@ -142,12 +142,14 @@
142
142
  bottom: 0;
143
143
  left: 0;
144
144
  display: inline-flex;
145
- flex-wrap: wrap;
146
- padding: 0.25rem 0.5rem;
145
+ flex-wrap: nowrap;
146
+ align-items: center;
147
+ padding: 0.25rem 1rem;
147
148
  border-radius: 10px;
148
149
  background-color: var(--memori-inner-bg, transparent);
149
150
  color: var(--memori-text-color, rgba(0, 0, 0, 0.85)) !important;
150
151
  font-size: 0.7em;
152
+ white-space: nowrap;
151
153
  }
152
154
 
153
155
  @media (max-width: 870px) {
@@ -4,14 +4,15 @@
4
4
  bottom: 1rem;
5
5
  left: 0;
6
6
  display: inline-flex;
7
- flex-wrap: wrap;
7
+ flex-wrap: nowrap;
8
8
  align-items: center;
9
- padding: 0.25rem 0.5rem;
9
+ padding: 0.25rem 1rem;
10
10
  border-radius: 10px;
11
11
  background-color: var(--memori-inner-bg, transparent);
12
12
  box-shadow: var(--memori-button-box-shadow);
13
13
  color: var(--memori-text-color, rgba(0, 0, 0, 0.85)) !important;
14
14
  font-size: 0.7em;
15
+ white-space: nowrap;
15
16
  }
16
17
 
17
18
  @media (max-width: 768px) {
@@ -134,13 +134,39 @@ Custom.args = {
134
134
 
135
135
  export const WebsiteAssistant = Template.bind({});
136
136
  WebsiteAssistant.args = {
137
- ...DefaultLayout.args,
138
- uiLang: 'it',
139
- showShare: true,
137
+ uiLang: 'EN',
138
+ showShare: false,
140
139
  showSettings: true,
141
140
  memori: memori,
142
141
  tenant,
143
142
  layout: 'WEBSITE_ASSISTANT',
143
+ memoriName: 'Memori',
144
+ memoriID: '25ced51c-3520-41af-8bbe-222d861b8e32',
145
+ ownerUserName: 'memoridev',
146
+ tenantID: 'www.aisuru.com',
147
+ apiURL: 'https://backend.memori.ai',
148
+ baseURL: 'https://www.aisuru.com',
149
+ spokenLang: 'EN',
150
+ context: {
151
+ SOURCE: 'WEBSITE',
152
+ PATH: '/en/',
153
+ },
154
+ multilingual: true,
155
+ integrationID: 'cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1',
156
+ integration: {
157
+ ...integration,
158
+ customData: JSON.stringify({
159
+ textColor: '#2a2a2a',
160
+ buttonBgColor: '#653165',
161
+ buttonTextColor: '#ffffff',
162
+ blurBackground: true,
163
+ innerBgColor: 'light',
164
+ innerBgAlpha: 0.8,
165
+ multilanguage: true,
166
+ avatar: 'readyplayerme',
167
+ avatarURL: 'https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb',
168
+ }),
169
+ },
144
170
  };
145
171
 
146
172
  export const HiddenChat = Template.bind({});
@@ -114,6 +114,7 @@
114
114
  top: calc(100% + 10px);
115
115
  right: auto;
116
116
  left: 0;
117
+ background-color: transparent !important;
117
118
  }
118
119
 
119
120
  .memori-widget.memori-layout-website_assistant {