@pindai-ai/chat-widget 2.0.4 → 3.0.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/README.md +364 -426
- package/dist/pindai-chat-widget.css +1 -1
- package/dist/pindai-chat-widget.js +830 -22
- package/dist/pindai-chat-widget.js.map +1 -1
- package/dist/pindai-chat-widget.umd.js +46 -0
- package/dist/pindai-chat-widget.umd.js.map +1 -0
- package/package.json +10 -2
- package/src/i18n.js +20 -0
- package/src/main.js +770 -326
- package/src/style.css +306 -5
package/src/style.css
CHANGED
|
@@ -75,10 +75,25 @@
|
|
|
75
75
|
Chat Launcher Button
|
|
76
76
|
================================ */
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
/* Launcher wrapper — handles alignment (bottom-right default, bottom-left variant) */
|
|
79
|
+
.n8n-chat-launcher-wrapper {
|
|
79
80
|
position: fixed;
|
|
80
81
|
bottom: 16px;
|
|
81
82
|
right: 16px;
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
align-items: flex-end;
|
|
86
|
+
gap: 8px;
|
|
87
|
+
z-index: 9998;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.n8n-chat-launcher-wrapper--left {
|
|
91
|
+
right: auto;
|
|
92
|
+
left: 16px;
|
|
93
|
+
align-items: flex-start;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.n8n-chat-launcher {
|
|
82
97
|
width: 56px;
|
|
83
98
|
height: 56px;
|
|
84
99
|
background-color: var(--pindai-primary);
|
|
@@ -91,9 +106,9 @@
|
|
|
91
106
|
transition: transform var(--transition-base),
|
|
92
107
|
opacity var(--transition-base),
|
|
93
108
|
box-shadow var(--transition-base);
|
|
94
|
-
z-index: 9998;
|
|
95
109
|
border: none;
|
|
96
110
|
outline: none;
|
|
111
|
+
position: relative;
|
|
97
112
|
}
|
|
98
113
|
|
|
99
114
|
.n8n-chat-launcher:hover {
|
|
@@ -697,9 +712,17 @@ a:focus-visible {
|
|
|
697
712
|
border-radius: var(--radius-lg);
|
|
698
713
|
}
|
|
699
714
|
|
|
700
|
-
.n8n-chat-launcher {
|
|
715
|
+
.n8n-chat-launcher-wrapper {
|
|
701
716
|
bottom: 20px;
|
|
702
717
|
right: 20px;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.n8n-chat-launcher-wrapper--left {
|
|
721
|
+
right: auto;
|
|
722
|
+
left: 20px;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.n8n-chat-launcher {
|
|
703
726
|
width: 60px;
|
|
704
727
|
height: 60px;
|
|
705
728
|
}
|
|
@@ -735,13 +758,291 @@ a:focus-visible {
|
|
|
735
758
|
padding-bottom: env(safe-area-inset-bottom);
|
|
736
759
|
}
|
|
737
760
|
|
|
738
|
-
.n8n-chat-launcher {
|
|
761
|
+
.n8n-chat-launcher-wrapper {
|
|
739
762
|
bottom: calc(16px + env(safe-area-inset-bottom));
|
|
740
763
|
}
|
|
741
764
|
|
|
742
765
|
@media (min-width: 640px) {
|
|
743
|
-
.n8n-chat-launcher {
|
|
766
|
+
.n8n-chat-launcher-wrapper {
|
|
744
767
|
bottom: calc(20px + env(safe-area-inset-bottom));
|
|
745
768
|
}
|
|
746
769
|
}
|
|
747
770
|
}
|
|
771
|
+
|
|
772
|
+
/* ================================
|
|
773
|
+
v3.0 — Header Avatar
|
|
774
|
+
================================ */
|
|
775
|
+
|
|
776
|
+
.n8n-chat-header-avatar {
|
|
777
|
+
width: 36px;
|
|
778
|
+
height: 36px;
|
|
779
|
+
border-radius: 50%;
|
|
780
|
+
object-fit: cover;
|
|
781
|
+
flex-shrink: 0;
|
|
782
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/* ================================
|
|
786
|
+
v3.0 — Bubble Popup (speech bubble above launcher)
|
|
787
|
+
================================ */
|
|
788
|
+
|
|
789
|
+
.n8n-chat-bubble-popup {
|
|
790
|
+
background: #ffffff;
|
|
791
|
+
color: var(--pindai-gray-900);
|
|
792
|
+
border-radius: var(--radius-md);
|
|
793
|
+
box-shadow: var(--shadow-md);
|
|
794
|
+
padding: 10px 14px;
|
|
795
|
+
font-size: var(--font-size-sm);
|
|
796
|
+
max-width: 220px;
|
|
797
|
+
position: relative;
|
|
798
|
+
display: flex;
|
|
799
|
+
align-items: center;
|
|
800
|
+
gap: 8px;
|
|
801
|
+
animation: pindai-bubble-in 0.3s ease-out;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
@keyframes pindai-bubble-in {
|
|
805
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
806
|
+
to { opacity: 1; transform: translateY(0); }
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
.n8n-chat-bubble-popup-text {
|
|
810
|
+
flex: 1;
|
|
811
|
+
line-height: 1.4;
|
|
812
|
+
transition: opacity 0.25s ease, transform 0.25s ease;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/* Text rotation animations */
|
|
816
|
+
.n8n-chat-bubble-popup-text--exit {
|
|
817
|
+
opacity: 0;
|
|
818
|
+
transform: translateY(-4px);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.n8n-chat-bubble-popup-text--enter {
|
|
822
|
+
animation: pindai-bubble-text-in 0.3s ease-out forwards;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
@keyframes pindai-bubble-text-in {
|
|
826
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
827
|
+
to { opacity: 1; transform: translateY(0); }
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.n8n-chat-bubble-popup-dismiss {
|
|
831
|
+
background: none;
|
|
832
|
+
border: none;
|
|
833
|
+
cursor: pointer;
|
|
834
|
+
color: var(--pindai-gray-500);
|
|
835
|
+
font-size: 16px;
|
|
836
|
+
padding: 0;
|
|
837
|
+
line-height: 1;
|
|
838
|
+
flex-shrink: 0;
|
|
839
|
+
transition: color var(--transition-fast);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.n8n-chat-bubble-popup-dismiss:hover {
|
|
843
|
+
color: var(--pindai-gray-900);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/* Arrow pointing down toward the launcher */
|
|
847
|
+
.n8n-chat-bubble-popup-arrow {
|
|
848
|
+
position: absolute;
|
|
849
|
+
bottom: -7px;
|
|
850
|
+
right: 20px;
|
|
851
|
+
width: 14px;
|
|
852
|
+
height: 8px;
|
|
853
|
+
overflow: hidden;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.n8n-chat-bubble-popup-arrow::before {
|
|
857
|
+
content: '';
|
|
858
|
+
position: absolute;
|
|
859
|
+
top: 0;
|
|
860
|
+
left: 50%;
|
|
861
|
+
transform: translateX(-50%) rotate(45deg);
|
|
862
|
+
width: 10px;
|
|
863
|
+
height: 10px;
|
|
864
|
+
background: #ffffff;
|
|
865
|
+
box-shadow: var(--shadow-sm);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/* For left-aligned launcher, flip arrow */
|
|
869
|
+
.n8n-chat-launcher-wrapper--left .n8n-chat-bubble-popup-arrow {
|
|
870
|
+
right: auto;
|
|
871
|
+
left: 20px;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/* ================================
|
|
875
|
+
v3.0 — Footer separator
|
|
876
|
+
================================ */
|
|
877
|
+
|
|
878
|
+
.n8n-chat-footer-sep {
|
|
879
|
+
color: var(--pindai-gray-300);
|
|
880
|
+
margin: 0 2px;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/* ================================
|
|
884
|
+
v3.0 — Streaming bubble + cursor
|
|
885
|
+
================================ */
|
|
886
|
+
|
|
887
|
+
.n8n-chat-bubble--streaming .n8n-chat-message-text {
|
|
888
|
+
white-space: pre-wrap;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.n8n-chat-stream-cursor {
|
|
892
|
+
display: inline-block;
|
|
893
|
+
width: 2px;
|
|
894
|
+
height: 1em;
|
|
895
|
+
background-color: var(--pindai-gray-700);
|
|
896
|
+
margin-left: 2px;
|
|
897
|
+
vertical-align: text-bottom;
|
|
898
|
+
animation: pindai-cursor-blink 0.8s step-end infinite;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
@keyframes pindai-cursor-blink {
|
|
902
|
+
0%, 100% { opacity: 1; }
|
|
903
|
+
50% { opacity: 0; }
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/* ================================
|
|
907
|
+
v3.0 — Typing indicator label
|
|
908
|
+
================================ */
|
|
909
|
+
|
|
910
|
+
.n8n-chat-typing-indicator {
|
|
911
|
+
flex-direction: column;
|
|
912
|
+
gap: 4px;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.n8n-chat-typing-dots {
|
|
916
|
+
display: flex;
|
|
917
|
+
gap: 4px;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.n8n-chat-typing-label {
|
|
921
|
+
font-size: var(--font-size-xs);
|
|
922
|
+
color: var(--pindai-gray-500);
|
|
923
|
+
font-style: italic;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/* ================================
|
|
927
|
+
v3.0 — Dark Theme
|
|
928
|
+
================================ */
|
|
929
|
+
|
|
930
|
+
[data-pindai-theme="dark"] .n8n-chat-widget {
|
|
931
|
+
background-color: #1e1e1e;
|
|
932
|
+
color: #f0f0f0;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
[data-pindai-theme="dark"] .n8n-chat-messages {
|
|
936
|
+
background-color: #1e1e1e;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
[data-pindai-theme="dark"] .n8n-chat-ai-message {
|
|
940
|
+
background-color: #2d2d2d;
|
|
941
|
+
color: #f0f0f0;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
[data-pindai-theme="dark"] .n8n-chat-message-timestamp {
|
|
945
|
+
color: #888;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
[data-pindai-theme="dark"] .n8n-chat-input-area {
|
|
949
|
+
background-color: #262626;
|
|
950
|
+
border-top-color: #3a3a3a;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
[data-pindai-theme="dark"] .n8n-chat-input-area input {
|
|
954
|
+
background-color: #2d2d2d;
|
|
955
|
+
border-color: #444;
|
|
956
|
+
color: #f0f0f0;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-pindai-theme="dark"] .n8n-chat-input-area input::placeholder {
|
|
960
|
+
color: #777;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
[data-pindai-theme="dark"] .n8n-chat-input-area input:focus {
|
|
964
|
+
border-color: #4a9eff;
|
|
965
|
+
box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
[data-pindai-theme="dark"] .n8n-chat-watermark {
|
|
969
|
+
background-color: #262626;
|
|
970
|
+
border-top-color: #3a3a3a;
|
|
971
|
+
color: #888;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
[data-pindai-theme="dark"] .n8n-chat-watermark a {
|
|
975
|
+
color: #4a9eff;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
[data-pindai-theme="dark"] .n8n-chat-quick-reply-btn {
|
|
979
|
+
background-color: #2d2d2d;
|
|
980
|
+
border-color: #444;
|
|
981
|
+
color: #f0f0f0;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
[data-pindai-theme="dark"] .n8n-chat-quick-reply-btn:hover {
|
|
985
|
+
background-color: #3a3a3a;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
[data-pindai-theme="dark"] .n8n-chat-file-preview {
|
|
989
|
+
background-color: #262626;
|
|
990
|
+
border-top-color: #3a3a3a;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
[data-pindai-theme="dark"] .n8n-chat-file-item {
|
|
994
|
+
background-color: #2d2d2d;
|
|
995
|
+
border-color: #444;
|
|
996
|
+
color: #f0f0f0;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
[data-pindai-theme="dark"] .n8n-chat-bubble-popup {
|
|
1000
|
+
background: #2d2d2d;
|
|
1001
|
+
color: #f0f0f0;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
[data-pindai-theme="dark"] .n8n-chat-bubble-popup-arrow::before {
|
|
1005
|
+
background: #2d2d2d;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
[data-pindai-theme="dark"] .n8n-chat-stream-cursor {
|
|
1009
|
+
background-color: #f0f0f0;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
[data-pindai-theme="dark"] .n8n-chat-typing-label {
|
|
1013
|
+
color: #888;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/* ── Handoff banner ────────────────────────────────────────────────────────── */
|
|
1017
|
+
|
|
1018
|
+
.pindai-chat-handoff-banner {
|
|
1019
|
+
display: flex;
|
|
1020
|
+
align-items: center;
|
|
1021
|
+
gap: 8px;
|
|
1022
|
+
padding: 8px 14px;
|
|
1023
|
+
background: rgba(245, 158, 11, 0.08);
|
|
1024
|
+
border-bottom: 1px solid rgba(245, 158, 11, 0.25);
|
|
1025
|
+
font-size: 12px;
|
|
1026
|
+
color: #92400e;
|
|
1027
|
+
flex-shrink: 0;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
[data-pindai-theme="dark"] .pindai-chat-handoff-banner {
|
|
1031
|
+
background: rgba(245, 158, 11, 0.12);
|
|
1032
|
+
border-bottom-color: rgba(245, 158, 11, 0.3);
|
|
1033
|
+
color: #fbbf24;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.pindai-chat-handoff-pulse {
|
|
1037
|
+
width: 8px;
|
|
1038
|
+
height: 8px;
|
|
1039
|
+
border-radius: 50%;
|
|
1040
|
+
background: #f59e0b;
|
|
1041
|
+
flex-shrink: 0;
|
|
1042
|
+
animation: pindai-handoff-pulse 1.5s ease-in-out infinite;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
@keyframes pindai-handoff-pulse {
|
|
1046
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
1047
|
+
50% { opacity: 0.45; transform: scale(0.78); }
|
|
1048
|
+
}
|