@memori.ai/memori-react 7.12.2 → 7.13.0

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +4 -2
  3. package/dist/components/Chat/Chat.js +2 -1
  4. package/dist/components/Chat/Chat.js.map +1 -1
  5. package/dist/components/MemoriWidget/MemoriWidget.css +10 -4
  6. package/dist/components/MemoriWidget/MemoriWidget.d.ts +3 -1
  7. package/dist/components/MemoriWidget/MemoriWidget.js +14 -18
  8. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  9. package/dist/index.d.ts +4 -1
  10. package/dist/index.js +6 -3
  11. package/dist/index.js.map +1 -1
  12. package/esm/components/Chat/Chat.js +2 -1
  13. package/esm/components/Chat/Chat.js.map +1 -1
  14. package/esm/components/MemoriWidget/MemoriWidget.css +10 -4
  15. package/esm/components/MemoriWidget/MemoriWidget.d.ts +3 -1
  16. package/esm/components/MemoriWidget/MemoriWidget.js +14 -18
  17. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  18. package/esm/index.d.ts +4 -1
  19. package/esm/index.js +6 -3
  20. package/esm/index.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/components/Chat/Chat.tsx +1 -1
  23. package/src/components/MemoriWidget/MemoriWidget.css +10 -4
  24. package/src/components/MemoriWidget/MemoriWidget.stories.tsx +7 -0
  25. package/src/components/MemoriWidget/MemoriWidget.tsx +24 -35
  26. package/src/components/layouts/FullPage.test.tsx +21 -1
  27. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +1 -1
  28. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +463 -1
  29. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +1 -1
  30. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +1 -1
  31. package/src/components/layouts/layouts.stories.tsx +37 -37
  32. package/src/index.stories.tsx +1 -0
  33. package/src/index.tsx +20 -6
@@ -13,7 +13,7 @@ exports[`renders FullPage layout unchanged 1`] = `
13
13
  >
14
14
  <style>
15
15
 
16
- :root, .memori-widget, .memori-drawer, .memori-modal {
16
+ memori-client, .memori-widget, .memori-drawer, .memori-modal {
17
17
  --memori-chat-bubble-bg: #fff;
18
18
  --memori-text-color: #2a2a2a;
19
19
  --memori-button-bg: #823ce1;
@@ -461,3 +461,465 @@ exports[`renders FullPage layout unchanged 1`] = `
461
461
  </div>
462
462
  </div>
463
463
  `;
464
+
465
+ exports[`renders FullPage layout with root css properties unchanged 1`] = `
466
+ <div>
467
+ <div
468
+ class="memori memori-widget memori-layout-fullpage memori-controls-bottom memori--avatar-readyplayerme memori--with-integration"
469
+ data-memori-engine-state="{}"
470
+ data-memori-id="66b4e161-2431-4b21-9b70-d8c27de730ca"
471
+ data-memori-integration="cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1"
472
+ data-memori-name="Memori"
473
+ data-memori-secondary-id="25ced51c-3520-41af-8bbe-222d861b8e32"
474
+ style="height: 100vh;"
475
+ >
476
+ <style>
477
+
478
+ :root, memori-client, .memori-widget, .memori-drawer, .memori-modal {
479
+ --memori-chat-bubble-bg: #fff;
480
+ --memori-text-color: #2a2a2a;
481
+ --memori-button-bg: #823ce1;
482
+ --memori-primary: #823ce1;
483
+ --memori-button-text: #ffffff;
484
+ --memori-blur-background: 5px;
485
+ --memori-inner-bg: rgba(255, 255, 255, 0.8);
486
+ --memori-inner-content-pad: 1.5rem;
487
+ --memori-nav-bg-image: none;
488
+ --memori-nav-bg: rgba(255, 255, 255, 0.8);
489
+ }
490
+
491
+ </style>
492
+ <div
493
+ class="memori--global-background"
494
+ >
495
+ <div
496
+ class="memori--global-background-image"
497
+ style="background-image: url(https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg);"
498
+ />
499
+ </div>
500
+ <div
501
+ class="memori-spin"
502
+ >
503
+ <div
504
+ class="memori-header"
505
+ >
506
+ <div
507
+ class="memori-export-history-button memori-header--button memori-header--button--export"
508
+ data-headlessui-state=""
509
+ title="Vuoi esportare la cronologia chat?"
510
+ >
511
+ <button
512
+ class="memori-button memori-button--circle memori-button--icon-only memori-button--disabled"
513
+ data-headlessui-state=""
514
+ disabled=""
515
+ id="headlessui-popover-button-:r7:"
516
+ type="button"
517
+ >
518
+ <div
519
+ class="memori-button--icon"
520
+ >
521
+ <svg
522
+ aria-hidden="true"
523
+ focusable="false"
524
+ role="img"
525
+ viewBox="0 0 1024 1024"
526
+ xmlns="http://www.w3.org/2000/svg"
527
+ >
528
+ <path
529
+ d="M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"
530
+ />
531
+ </svg>
532
+ </div>
533
+ </button>
534
+ </div>
535
+ <button
536
+ class="memori-button memori-button--primary memori-button--circle memori-button--padded memori-button--icon-only memori-header--button memori-header--button-settings"
537
+ title="Impostazioni"
538
+ >
539
+ <span
540
+ class="memori-button--icon"
541
+ >
542
+ <svg
543
+ aria-hidden="true"
544
+ focusable="false"
545
+ role="img"
546
+ viewBox="0 0 1024 1024"
547
+ xmlns="http://www.w3.org/2000/svg"
548
+ >
549
+ <path
550
+ d="M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"
551
+ />
552
+ </svg>
553
+ </span>
554
+ </button>
555
+ <div
556
+ class="memori-share-button memori-share-button--align-left"
557
+ data-headlessui-state=""
558
+ >
559
+ <button
560
+ aria-expanded="false"
561
+ aria-haspopup="true"
562
+ class="memori-button memori-button--circle memori-button--icon-only memori-share-button--button memori-header--button memori-header--button-share memori-button--primary"
563
+ data-headlessui-state=""
564
+ id="headlessui-menu-button-:rc:"
565
+ title="Condividi"
566
+ type="button"
567
+ >
568
+ <div
569
+ class="memori-button--icon"
570
+ >
571
+ <svg
572
+ aria-hidden="true"
573
+ focusable="false"
574
+ role="img"
575
+ viewBox="0 0 1024 1024"
576
+ xmlns="http://www.w3.org/2000/svg"
577
+ >
578
+ <path
579
+ d="M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 0 0 0-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"
580
+ />
581
+ </svg>
582
+ </div>
583
+ </button>
584
+ </div>
585
+ </div>
586
+ <div
587
+ class="memori--grid"
588
+ >
589
+ <div
590
+ class="memori--grid-column memori--grid-column-left"
591
+ >
592
+ <div
593
+ class="memori--avatar-wrapper memori--avatar-readyplayerme"
594
+ >
595
+ <div
596
+ class="memori--blob-container"
597
+ >
598
+ <div
599
+ class="memori-blob"
600
+ >
601
+ <div
602
+ class="mainDiv"
603
+ />
604
+ <div
605
+ class="mainDiv"
606
+ />
607
+ <div
608
+ class="mainDiv"
609
+ />
610
+ <div
611
+ class="mainDiv"
612
+ />
613
+ <div
614
+ class="mainDiv"
615
+ />
616
+ </div>
617
+ </div>
618
+ </div>
619
+ <div
620
+ class="memori--avatar-toggle"
621
+ >
622
+ <button
623
+ class="memori-button memori-button--ghost memori-button--rounded memori-button--padded memori-button--with-icon"
624
+ >
625
+ <span
626
+ class="memori-button--icon"
627
+ >
628
+ <svg
629
+ aria-hidden="true"
630
+ focusable="false"
631
+ role="img"
632
+ viewBox="0 0 1024 1024"
633
+ xmlns="http://www.w3.org/2000/svg"
634
+ >
635
+ <path
636
+ d="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"
637
+ />
638
+ <path
639
+ d="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"
640
+ />
641
+ </svg>
642
+ </span>
643
+ <span
644
+ class="memori--avatar-toggle-text"
645
+ >
646
+ Nascondi
647
+ </span>
648
+ </button>
649
+ </div>
650
+ <div
651
+ id="extension"
652
+ />
653
+ </div>
654
+ <div
655
+ class="memori--grid-column memori--grid-column-right"
656
+ >
657
+ <div
658
+ class="memori--start-panel"
659
+ >
660
+ <div
661
+ class="memori--cover"
662
+ >
663
+ <div
664
+ class="memori--completions-enabled"
665
+ >
666
+ <div
667
+ class="memori-tooltip memori-tooltip--align-left"
668
+ >
669
+ <div
670
+ class="memori-tooltip--content"
671
+ >
672
+ IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette
673
+ </div>
674
+ <div
675
+ class="memori-tooltip--trigger"
676
+ >
677
+ <span
678
+ aria-label="IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette"
679
+ >
680
+ <svg
681
+ aria-hidden="true"
682
+ fill="none"
683
+ focusable="false"
684
+ role="img"
685
+ viewBox="0 0 24 24"
686
+ xmlns="http://www.w3.org/2000/svg"
687
+ >
688
+ <g
689
+ clip-rule="evenodd"
690
+ fill="currentColor"
691
+ fill-rule="evenodd"
692
+ >
693
+ <path
694
+ clip-rule="evenodd"
695
+ d="M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z"
696
+ fill-rule="evenodd"
697
+ />
698
+ <path
699
+ clip-rule="evenodd"
700
+ d="M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z"
701
+ fill-rule="evenodd"
702
+ />
703
+ <path
704
+ clip-rule="evenodd"
705
+ d="M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z"
706
+ fill-rule="evenodd"
707
+ />
708
+ </g>
709
+ </svg>
710
+ </span>
711
+ </div>
712
+ </div>
713
+ </div>
714
+ </div>
715
+ <picture
716
+ class="memori--avatar"
717
+ >
718
+ <source
719
+ src="https://aisuru.com/images/aisuru/square_logo.png"
720
+ />
721
+ <img
722
+ alt="Memori"
723
+ src="https://aisuru.com/images/aisuru/square_logo.png"
724
+ />
725
+ </picture>
726
+ <h2
727
+ class="memori--title"
728
+ >
729
+ Memori
730
+ </h2>
731
+ <div
732
+ class="memori--description"
733
+ >
734
+ <p>
735
+ <span
736
+ class="memori--description-text"
737
+ >
738
+ Lorem ipsum.
739
+ </span>
740
+ </p>
741
+ <div
742
+ class="memori--language-chooser"
743
+ >
744
+ <label
745
+ for="user-lang-pref"
746
+ id="user-lang-pref-label"
747
+ >
748
+ Voglio parlare con Memori in
749
+ </label>
750
+ <select
751
+ aria-labelledby="user-lang-pref-label"
752
+ class="memori-select--button"
753
+ id="user-lang-pref"
754
+ >
755
+ <option
756
+ aria-label="Italiano"
757
+ value="IT"
758
+ >
759
+ Italiano
760
+ </option>
761
+ <option
762
+ aria-label="English"
763
+ value="EN"
764
+ >
765
+ English
766
+ </option>
767
+ <option
768
+ aria-label="Deutsch"
769
+ value="DE"
770
+ >
771
+ Deutsch
772
+ </option>
773
+ <option
774
+ aria-label="Español"
775
+ value="ES"
776
+ >
777
+ Español
778
+ </option>
779
+ <option
780
+ aria-label="Français"
781
+ value="FR"
782
+ >
783
+ Français
784
+ </option>
785
+ <option
786
+ aria-label="Português"
787
+ value="PT"
788
+ >
789
+ Português
790
+ </option>
791
+ <option
792
+ aria-label="Українська"
793
+ value="UK"
794
+ >
795
+ Українська
796
+ </option>
797
+ <option
798
+ aria-label="Русский"
799
+ value="RU"
800
+ >
801
+ Русский
802
+ </option>
803
+ <option
804
+ aria-label="Polski"
805
+ value="PL"
806
+ >
807
+ Polski
808
+ </option>
809
+ <option
810
+ aria-label="Suomi"
811
+ value="FI"
812
+ >
813
+ Suomi
814
+ </option>
815
+ <option
816
+ aria-label="Ελληνικά"
817
+ value="EL"
818
+ >
819
+ Ελληνικά
820
+ </option>
821
+ <option
822
+ aria-label="العربية"
823
+ value="AR"
824
+ >
825
+ العربية
826
+ </option>
827
+ <option
828
+ aria-label="中文"
829
+ value="ZH"
830
+ >
831
+ 中文
832
+ </option>
833
+ <option
834
+ aria-label="日本語"
835
+ value="JA"
836
+ >
837
+ 日本語
838
+ </option>
839
+ </select>
840
+ </div>
841
+ <button
842
+ class="memori-button memori-button--primary memori-button--rounded memori-button--padded memori--start-button"
843
+ >
844
+ INIZIAMO
845
+ </button>
846
+ <div
847
+ class="memori--completion-provider-status--loading"
848
+ >
849
+ <div
850
+ class="memori-spin memori-spin--spinning"
851
+ >
852
+ <div
853
+ class="memori-spin--spinner"
854
+ >
855
+ <svg
856
+ aria-hidden="true"
857
+ class="memori-loading-icon"
858
+ focusable="false"
859
+ role="img"
860
+ viewBox="0 0 1024 1024"
861
+ xmlns="http://www.w3.org/2000/svg"
862
+ >
863
+ <path
864
+ d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
865
+ />
866
+ </svg>
867
+ </div>
868
+ </div>
869
+ </div>
870
+ <p
871
+ class="memori--start-description"
872
+ >
873
+ Per parlare con me clicca sul pulsante INIZIAMO per cominciare
874
+ </p>
875
+ </div>
876
+ </div>
877
+ </div>
878
+ <div
879
+ class="memori--powered-by"
880
+ >
881
+ <img
882
+ alt=""
883
+ src="https://aisuru.com/images/aisuru/logo.png"
884
+ />
885
+ <p>
886
+ <span
887
+ class="sr-only"
888
+ >
889
+ Powered by
890
+ </span>
891
+ <a
892
+ href="https://memori.ai/it?integrationID=cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1&memori=aisuru.com-username-Memori"
893
+ rel="noopener noreferrer"
894
+ target="_blank"
895
+ >
896
+ Memori.AI
897
+ </a>
898
+ </p>
899
+ </div>
900
+ </div>
901
+ <div
902
+ class="memori-spin--spinner"
903
+ >
904
+ <svg
905
+ aria-hidden="true"
906
+ class="memori-loading-icon"
907
+ focusable="false"
908
+ role="img"
909
+ viewBox="0 0 1024 1024"
910
+ xmlns="http://www.w3.org/2000/svg"
911
+ >
912
+ <path
913
+ d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
914
+ />
915
+ </svg>
916
+ </div>
917
+ </div>
918
+ <audio
919
+ id="memori-audio"
920
+ src="https://aisuru.com/intro.mp3"
921
+ style="display: none;"
922
+ />
923
+ </div>
924
+ </div>
925
+ `;
@@ -13,7 +13,7 @@ exports[`renders Totem layout unchanged 1`] = `
13
13
  >
14
14
  <style>
15
15
 
16
- :root, .memori-widget, .memori-drawer, .memori-modal {
16
+ memori-client, .memori-widget, .memori-drawer, .memori-modal {
17
17
  --memori-chat-bubble-bg: #fff;
18
18
  --memori-text-color: #2a2a2a;
19
19
  --memori-button-bg: #823ce1;
@@ -13,7 +13,7 @@ exports[`renders ZOOMED_FULL_BODY layout unchanged 1`] = `
13
13
  >
14
14
  <style>
15
15
 
16
- :root, .memori-widget, .memori-drawer, .memori-modal {
16
+ memori-client, .memori-widget, .memori-drawer, .memori-modal {
17
17
  --memori-chat-bubble-bg: #fff;
18
18
  --memori-text-color: #2a2a2a;
19
19
  --memori-button-bg: #823ce1;
@@ -24,43 +24,6 @@ const meta: Meta = {
24
24
 
25
25
  export default meta;
26
26
 
27
- export const CustomLayout: React.FC<LayoutProps> = ({
28
- Header,
29
- headerProps,
30
- Avatar,
31
- avatarProps,
32
- Chat,
33
- chatProps,
34
- StartPanel,
35
- startPanelProps,
36
- integrationStyle,
37
- integrationBackground,
38
- ChangeMode,
39
- changeModeProps,
40
- sessionId,
41
- hasUserActivatedSpeak,
42
- showInstruct = false,
43
- loading = false,
44
- poweredBy,
45
- }) => (
46
- <>
47
- {integrationStyle}
48
- {integrationBackground}
49
-
50
- <Spin spinning={loading} className="memori-mycustom-layout">
51
- {poweredBy}
52
-
53
- <div className="memori-mycustom-layout--controls">
54
- {sessionId && hasUserActivatedSpeak && Chat && chatProps ? (
55
- <Chat {...chatProps} />
56
- ) : startPanelProps ? (
57
- <StartPanel {...startPanelProps} />
58
- ) : null}
59
- </div>
60
- </Spin>
61
- </>
62
- );
63
-
64
27
  const Template: Story<Props> = args => (
65
28
  <I18nWrapper>
66
29
  <VisemeProvider>
@@ -294,6 +257,43 @@ ChatOnly.args = {
294
257
  layout: 'CHAT',
295
258
  };
296
259
 
260
+ export const CustomLayout: React.FC<LayoutProps> = ({
261
+ Header,
262
+ headerProps,
263
+ Avatar,
264
+ avatarProps,
265
+ Chat,
266
+ chatProps,
267
+ StartPanel,
268
+ startPanelProps,
269
+ integrationStyle,
270
+ integrationBackground,
271
+ ChangeMode,
272
+ changeModeProps,
273
+ sessionId,
274
+ hasUserActivatedSpeak,
275
+ showInstruct = false,
276
+ loading = false,
277
+ poweredBy,
278
+ }) => (
279
+ <>
280
+ {integrationStyle}
281
+ {integrationBackground}
282
+
283
+ <Spin spinning={loading} className="memori-mycustom-layout">
284
+ {poweredBy}
285
+
286
+ <div className="memori-mycustom-layout--controls">
287
+ {sessionId && hasUserActivatedSpeak && Chat && chatProps ? (
288
+ <Chat {...chatProps} />
289
+ ) : startPanelProps ? (
290
+ <StartPanel {...startPanelProps} />
291
+ ) : null}
292
+ </div>
293
+ </Spin>
294
+ </>
295
+ );
296
+
297
297
  export const Custom = Template.bind({});
298
298
  Custom.args = {
299
299
  uiLang: 'it',
@@ -35,6 +35,7 @@ Anonymous.args = {
35
35
  uiLang: 'IT',
36
36
  spokenLang: 'IT',
37
37
  enableAudio: true,
38
+ autoStart: true,
38
39
  };
39
40
 
40
41
  export const WithPreviousSession = Template.bind({});
package/src/index.tsx CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  DialogState,
6
6
  Memori as IMemori,
7
7
  Tenant,
8
+ Integration,
8
9
  } from '@memori.ai/memori-api-client/dist/types';
9
10
  import memoriApiClient from '@memori.ai/memori-api-client';
10
11
 
@@ -15,7 +16,6 @@ import { VisemeProvider } from './context/visemeContext';
15
16
 
16
17
  import { Toaster } from 'react-hot-toast';
17
18
  import { getTenant } from './helpers/tenant';
18
- import { installMathJax } from './helpers/utils';
19
19
 
20
20
  import i18n from './i18n';
21
21
  import { useTranslation } from 'react-i18next';
@@ -26,6 +26,7 @@ export interface Props {
26
26
  memoriID?: string | null;
27
27
  ownerUserName?: string | null;
28
28
  ownerUserID?: string | null;
29
+ integration?: Integration;
29
30
  integrationID?: string;
30
31
  tenantID: string;
31
32
  secretToken?: string;
@@ -67,6 +68,8 @@ export interface Props {
67
68
  additionalSettings?: WidgetProps['additionalSettings'];
68
69
  userAvatar?: WidgetProps['userAvatar'];
69
70
  useMathFormatting?: boolean;
71
+ autoStart?: boolean;
72
+ applyVarsToRoot?: boolean;
70
73
  }
71
74
 
72
75
  const getPreferredLanguages = () => {
@@ -91,6 +94,7 @@ const Memori: React.FC<Props> = ({
91
94
  ownerUserID,
92
95
  memoriName,
93
96
  memoriID,
97
+ integration,
94
98
  integrationID,
95
99
  tenantID,
96
100
  secretToken,
@@ -132,6 +136,8 @@ const Memori: React.FC<Props> = ({
132
136
  additionalSettings,
133
137
  userAvatar,
134
138
  useMathFormatting = false,
139
+ autoStart = false,
140
+ applyVarsToRoot = false,
135
141
  }) => {
136
142
  const [memori, setMemori] = useState<IMemori>();
137
143
  const [tenant, setTenant] = useState<Tenant>();
@@ -269,17 +275,21 @@ const Memori: React.FC<Props> = ({
269
275
  showContextPerLine={showContextPerLine}
270
276
  showLogin={showLogin ?? memori?.enableDeepThought}
271
277
  showUpload={showUpload}
272
- integration={memori?.integrations?.find(i =>
273
- integrationID
274
- ? i.integrationID === integrationID
275
- : !!i.publish && i.type === 'LANDING_EXPERIENCE'
276
- )}
278
+ integration={
279
+ integration ??
280
+ memori?.integrations?.find(i =>
281
+ integrationID
282
+ ? i.integrationID === integrationID
283
+ : !!i.publish && i.type === 'LANDING_EXPERIENCE'
284
+ )
285
+ }
277
286
  initialContextVars={context}
278
287
  initialQuestion={initialQuestion}
279
288
  authToken={authToken}
280
289
  AZURE_COGNITIVE_SERVICES_TTS_KEY={
281
290
  speechKey || AZURE_COGNITIVE_SERVICES_TTS_KEY
282
291
  }
292
+ autoStart={autoStart}
283
293
  enableAudio={enableAudio}
284
294
  defaultSpeakerActive={defaultSpeakerActive}
285
295
  disableTextEnteredEvents={disableTextEnteredEvents}
@@ -289,6 +299,7 @@ const Memori: React.FC<Props> = ({
289
299
  additionalSettings={additionalSettings}
290
300
  userAvatar={userAvatar}
291
301
  useMathFormatting={useMathFormatting}
302
+ applyVarsToRoot={applyVarsToRoot}
292
303
  {...(tag && pin ? { personification: { tag, pin } } : {})}
293
304
  />
294
305
  ) : (
@@ -321,6 +332,7 @@ Memori.propTypes = {
321
332
  ownerUserName: PropTypes.string,
322
333
  ownerUserID: PropTypes.string,
323
334
  integrationID: PropTypes.string,
335
+ integration: PropTypes.any,
324
336
  tenantID: PropTypes.string.isRequired,
325
337
  secretToken: PropTypes.string,
326
338
  sessionID: PropTypes.string,
@@ -380,6 +392,8 @@ Memori.propTypes = {
380
392
  additionalSettings: PropTypes.any,
381
393
  userAvatar: PropTypes.oneOfType([PropTypes.string, PropTypes.any]),
382
394
  useMathFormatting: PropTypes.bool,
395
+ autoStart: PropTypes.bool,
396
+ applyVarsToRoot: PropTypes.bool,
383
397
  };
384
398
 
385
399
  export default Memori;