@memori.ai/memori-react 2.18.2 → 2.18.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.
@@ -679,7 +679,11 @@ const MemoriWidget = ({
679
679
  memoriTokens,
680
680
  instruct && memori.giverTag ? memori.giverTag : undefined,
681
681
  instruct && memori.giverPIN ? memori.giverPIN : undefined,
682
- initialContextVars,
682
+ {
683
+ PATHNAME: window.location.pathname,
684
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
685
+ ...(initialContextVars || {}),
686
+ },
683
687
  initialQuestion
684
688
  ).then(state => {
685
689
  console.info('session timeout');
@@ -806,22 +810,13 @@ const MemoriWidget = ({
806
810
  new Function(s.content ?? '')();
807
811
 
808
812
  setTimeout(() => {
809
- if (
810
- document.body.classList.contains('chat-focused') ||
811
- layout === 'WEBSITE_ASSISTANT'
812
- ) {
813
- document
814
- .querySelector('.memori-chat--content')
815
- ?.scrollTo(
816
- 0,
817
- document.querySelector('.memori-chat--content')
818
- ?.scrollHeight ?? 0
819
- );
820
- } else {
821
- document.querySelector('#end-messages-ref')?.scrollIntoView({
822
- behavior: 'smooth',
823
- });
824
- }
813
+ document
814
+ .querySelector('.memori-chat--content')
815
+ ?.scrollTo(
816
+ 0,
817
+ document.querySelector('.memori-chat--content')?.scrollHeight ??
818
+ 0
819
+ );
825
820
  }, 400);
826
821
  }, 1000);
827
822
  } catch (e) {
@@ -965,7 +960,11 @@ const MemoriWidget = ({
965
960
  recoveryTokens: recoveryTokens || memoriTokens,
966
961
  tag,
967
962
  pin,
968
- initialContextVars,
963
+ initialContextVars: {
964
+ PATHNAME: window.location.pathname,
965
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
966
+ ...(initialContextVars || {}),
967
+ },
969
968
  initialQuestion,
970
969
  birthDate: birthDate || storageBirthDate || undefined,
971
970
  additionalInfo: {
@@ -1091,7 +1090,11 @@ const MemoriWidget = ({
1091
1090
  password: secret || memoriPwd || memori.secretToken,
1092
1091
  tag: memori.giverTag,
1093
1092
  pin: memori.giverPIN,
1094
- initialContextVars,
1093
+ initialContextVars: {
1094
+ PATHNAME: window.location.pathname,
1095
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
1096
+ ...(initialContextVars || {}),
1097
+ },
1095
1098
  initialQuestion,
1096
1099
  birthDate: birthDate || storageBirthDate || undefined,
1097
1100
  additionalInfo: {
@@ -1365,6 +1368,13 @@ const MemoriWidget = ({
1365
1368
  : 'pl-PL-AgnieszkaNeural'
1366
1369
  }`;
1367
1370
  break;
1371
+ case 'FI':
1372
+ voice = `${
1373
+ memori.voiceType === 'MALE'
1374
+ ? 'fi-FI-HarriNeural'
1375
+ : 'fi-FI-SelmaNeural'
1376
+ }`;
1377
+ break;
1368
1378
  default:
1369
1379
  voice = `${
1370
1380
  memori.voiceType === 'MALE'
@@ -1414,6 +1424,9 @@ const MemoriWidget = ({
1414
1424
  case 'PL':
1415
1425
  voice = 'pl-PL';
1416
1426
  break;
1427
+ case 'FI':
1428
+ voice = 'fi-FI';
1429
+ break;
1417
1430
  default:
1418
1431
  voice = 'it-IT';
1419
1432
  break;
@@ -2251,7 +2264,11 @@ const MemoriWidget = ({
2251
2264
  password: secret || memoriPwd || memori.secretToken,
2252
2265
  tag: personification?.tag,
2253
2266
  pin: personification?.pin,
2254
- initialContextVars,
2267
+ initialContextVars: {
2268
+ PATHNAME: window.location.pathname,
2269
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
2270
+ ...(initialContextVars || {}),
2271
+ },
2255
2272
  initialQuestion,
2256
2273
  birthDate: birth,
2257
2274
  });
@@ -2333,7 +2350,11 @@ const MemoriWidget = ({
2333
2350
  undefined,
2334
2351
  memori?.giverTag,
2335
2352
  memori?.giverPIN,
2336
- initialContextVars,
2353
+ {
2354
+ PATHNAME: window.location.pathname,
2355
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
2356
+ ...(initialContextVars || {}),
2357
+ },
2337
2358
  initialQuestion,
2338
2359
  birth
2339
2360
  ).then(() => {
@@ -2380,7 +2401,11 @@ const MemoriWidget = ({
2380
2401
  undefined,
2381
2402
  personification.tag,
2382
2403
  personification.pin,
2383
- initialContextVars,
2404
+ {
2405
+ PATHNAME: window.location.pathname,
2406
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
2407
+ ...(initialContextVars || {}),
2408
+ },
2384
2409
  initialQuestion,
2385
2410
  birth
2386
2411
  ).then(() => {
@@ -2427,7 +2452,11 @@ const MemoriWidget = ({
2427
2452
  undefined,
2428
2453
  undefined,
2429
2454
  undefined,
2430
- initialContextVars,
2455
+ {
2456
+ PATHNAME: window.location.pathname,
2457
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
2458
+ ...(initialContextVars || {}),
2459
+ },
2431
2460
  initialQuestion,
2432
2461
  birth
2433
2462
  ).then(() => {
@@ -2746,7 +2775,11 @@ const MemoriWidget = ({
2746
2775
  values['tokens'],
2747
2776
  instruct ? memori.giverTag : undefined,
2748
2777
  instruct ? memori.giverPIN : undefined,
2749
- initialContextVars,
2778
+ {
2779
+ PATHNAME: window.location.pathname,
2780
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
2781
+ ...(initialContextVars || {}),
2782
+ },
2750
2783
  initialQuestion,
2751
2784
  birthDate
2752
2785
  )
@@ -2781,7 +2814,11 @@ const MemoriWidget = ({
2781
2814
  memoriTokens,
2782
2815
  instruct ? memori.giverTag : undefined,
2783
2816
  instruct ? memori.giverPIN : undefined,
2784
- initialContextVars,
2817
+ {
2818
+ PATHNAME: window.location.pathname,
2819
+ ROUTE: window.location.pathname?.split('/')?.pop() || '',
2820
+ ...(initialContextVars || {}),
2821
+ },
2785
2822
  initialQuestion,
2786
2823
  birthDate
2787
2824
  )
@@ -602,6 +602,12 @@ exports[`renders StartPanel with integrationConfig unchanged 1`] = `
602
602
  >
603
603
  Polski
604
604
  </option>
605
+ <option
606
+ aria-label="Suomi"
607
+ value="FI"
608
+ >
609
+ Suomi
610
+ </option>
605
611
  </select>
606
612
  </div>
607
613
  <button
@@ -302,6 +302,12 @@ exports[`renders Chat layout unchanged 1`] = `
302
302
  >
303
303
  Polski
304
304
  </option>
305
+ <option
306
+ aria-label="Suomi"
307
+ value="FI"
308
+ >
309
+ Suomi
310
+ </option>
305
311
  </select>
306
312
  </div>
307
313
  <button
@@ -344,6 +344,12 @@ exports[`renders FullPage layout unchanged 1`] = `
344
344
  >
345
345
  Polski
346
346
  </option>
347
+ <option
348
+ aria-label="Suomi"
349
+ value="FI"
350
+ >
351
+ Suomi
352
+ </option>
347
353
  </select>
348
354
  </div>
349
355
  <button
@@ -395,6 +395,12 @@ exports[`renders Totem layout unchanged 1`] = `
395
395
  >
396
396
  Polski
397
397
  </option>
398
+ <option
399
+ aria-label="Suomi"
400
+ value="FI"
401
+ >
402
+ Suomi
403
+ </option>
398
404
  </select>
399
405
  </div>
400
406
  <button
@@ -8,6 +8,7 @@ export const chatLanguages = [
8
8
  { value: 'UK', label: 'Українська' },
9
9
  { value: 'RU', label: 'Русский' },
10
10
  { value: 'PL', label: 'Polski' },
11
+ { value: 'FI', label: 'Suomi' },
11
12
  ];
12
13
 
13
14
  export const allowedMediaTypes = [