@telia-ace/widget-conversation 1.0.32 → 1.0.33-next.3
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/dist/agent.d.ts +1 -1
- package/dist/components/conversation/conversation.d.ts +1 -1
- package/dist/components/conversation/plugin.d.ts +4 -4
- package/dist/components/conversation/ui/input.d.ts +1 -1
- package/dist/components/conversation/ui/loader.d.ts +1 -1
- package/dist/components/conversation/ui/message-list-items/button-list.d.ts +1 -1
- package/dist/components/conversation/ui/message-list-items/custom.d.ts +1 -1
- package/dist/components/conversation/ui/message-list-items/html.d.ts +1 -1
- package/dist/components/conversation/ui/message-list-items/link-list.d.ts +1 -1
- package/dist/components/conversation/ui/message-list-items/text.d.ts +1 -1
- package/dist/components/conversation/ui/message-list-items/video-request.d.ts +1 -1
- package/dist/components/conversation/ui/message-types/agent.d.ts +1 -1
- package/dist/components/conversation/ui/message-types/message-list.d.ts +1 -1
- package/dist/components/conversation/ui/message-types/system.d.ts +1 -1
- package/dist/components/conversation/ui/message-types/timestamp.d.ts +1 -1
- package/dist/components/conversation/ui/message-types/user.d.ts +1 -1
- package/dist/components/conversation/ui/overlay-outlets.d.ts +2 -2
- package/dist/components/conversation/ui/styles.d.ts +1 -1
- package/dist/components/return-button/plugin.d.ts +1 -1
- package/dist/components/return-button/return-button.d.ts +1 -1
- package/dist/conversation-controller.d.ts +9 -9
- package/dist/conversation-platform.d.ts +4 -4
- package/dist/{conversation.4bd3eedd.js → conversation.bc31361a.js} +330 -305
- package/dist/{conversation.4bd3eedd.js.map → conversation.bc31361a.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/resolve-entity-value.d.ts +2 -2
- package/dist/{return-button.9c3eb2ec.js → return-button.fb63a16e.js} +14 -15
- package/dist/{return-button.9c3eb2ec.js.map → return-button.fb63a16e.js.map} +1 -1
- package/dist/store.d.ts +3 -3
- package/dist/types.d.ts +19 -19
- package/package.json +10 -10
|
@@ -67,49 +67,75 @@ const Re = ({ className: e }) => {
|
|
|
67
67
|
}, O = (d) => {
|
|
68
68
|
ye(d), r(d), d && d.length > 0 && m("user-typing", { textLength: d.length });
|
|
69
69
|
};
|
|
70
|
-
return $ ? null : /* @__PURE__ */ n.createElement(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
70
|
+
return $ ? null : /* @__PURE__ */ n.createElement(
|
|
71
|
+
Oe,
|
|
72
|
+
{
|
|
73
|
+
grow: E,
|
|
74
|
+
className: H("humany-conversation-input", e),
|
|
75
|
+
"data-has-focus": o,
|
|
76
|
+
scrollableCss: fe,
|
|
77
|
+
isTabbing: v
|
|
78
|
+
},
|
|
79
|
+
p && /* @__PURE__ */ n.createElement(
|
|
80
|
+
Ne,
|
|
81
|
+
{
|
|
82
|
+
disabled: k,
|
|
83
|
+
onClick: pe,
|
|
84
|
+
title: p.label,
|
|
85
|
+
"aria-label": p.label
|
|
86
|
+
},
|
|
87
|
+
/* @__PURE__ */ n.createElement(
|
|
88
|
+
w,
|
|
89
|
+
{
|
|
90
|
+
size: 24,
|
|
91
|
+
symbol: { type: "Svg", content: p.icon || "browse" }
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
),
|
|
95
|
+
E ? /* @__PURE__ */ n.createElement(
|
|
96
|
+
Be,
|
|
97
|
+
{
|
|
98
|
+
value: t,
|
|
99
|
+
onChange: O,
|
|
100
|
+
onEnter: N,
|
|
101
|
+
disabled: k,
|
|
102
|
+
"aria-label": i,
|
|
103
|
+
placeholder: i,
|
|
104
|
+
onFocusChange: l,
|
|
105
|
+
type: "textarea",
|
|
106
|
+
rows: 1,
|
|
107
|
+
ref: y
|
|
108
|
+
}
|
|
109
|
+
) : /* @__PURE__ */ n.createElement(
|
|
110
|
+
Ke,
|
|
111
|
+
{
|
|
112
|
+
value: t,
|
|
113
|
+
onChange: O,
|
|
114
|
+
onEnter: N,
|
|
115
|
+
disabled: k,
|
|
116
|
+
"aria-label": i,
|
|
117
|
+
placeholder: i,
|
|
118
|
+
onFocusChange: l
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ n.createElement(
|
|
122
|
+
de,
|
|
123
|
+
{
|
|
124
|
+
disabled: k,
|
|
125
|
+
onClick: N,
|
|
126
|
+
title: S,
|
|
127
|
+
"aria-label": S
|
|
128
|
+
},
|
|
129
|
+
/* @__PURE__ */ n.createElement(
|
|
130
|
+
je,
|
|
131
|
+
{
|
|
132
|
+
size: 22,
|
|
133
|
+
symbol: { type: "Svg", content: "send" },
|
|
134
|
+
hasContent: !!t && !!t.length
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
);
|
|
113
139
|
}, Be = a(ae)`
|
|
114
140
|
resize: none;
|
|
115
141
|
flex: 1;
|
|
@@ -450,15 +476,7 @@ const Re = ({ className: e }) => {
|
|
|
450
476
|
background-color: transparent;
|
|
451
477
|
}
|
|
452
478
|
`, Qe = X(
|
|
453
|
-
({ boxed: e, className: t, agentData: r }, o) => /* @__PURE__ */ n.createElement(P, {
|
|
454
|
-
ref: o
|
|
455
|
-
}, /* @__PURE__ */ n.createElement(U, {
|
|
456
|
-
left: e,
|
|
457
|
-
center: !e
|
|
458
|
-
}, /* @__PURE__ */ n.createElement(_, {
|
|
459
|
-
padded: !!e,
|
|
460
|
-
stacked: e ? "first" : void 0
|
|
461
|
-
}, /* @__PURE__ */ n.createElement(Pe, null, /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null)))))
|
|
479
|
+
({ boxed: e, className: t, agentData: r }, o) => /* @__PURE__ */ n.createElement(P, { ref: o }, /* @__PURE__ */ n.createElement(U, { left: e, center: !e }, /* @__PURE__ */ n.createElement(_, { padded: !!e, stacked: e ? "first" : void 0 }, /* @__PURE__ */ n.createElement(Pe, null, /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null)))))
|
|
462
480
|
), ne = Qe, Xe = a.p`
|
|
463
481
|
&& {
|
|
464
482
|
font-size: ${(e) => {
|
|
@@ -481,19 +499,16 @@ const Re = ({ className: e }) => {
|
|
|
481
499
|
return t ? r ? o = `${t}: ${re(r)}` : o = t : r && (o = re(r)), /* @__PURE__ */ n.createElement(Xe, null, o);
|
|
482
500
|
}, K = Ze, et = ({ className: e, children: t, sender: r, timestamp: o }) => {
|
|
483
501
|
const { avatar: l, name: s } = r, { avatarSize: u } = L();
|
|
484
|
-
return /* @__PURE__ */ n.createElement(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
src: l
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
name: s,
|
|
495
|
-
timestamp: o
|
|
496
|
-
}));
|
|
502
|
+
return /* @__PURE__ */ n.createElement(
|
|
503
|
+
tt,
|
|
504
|
+
{
|
|
505
|
+
hasAvatar: !!l,
|
|
506
|
+
className: H(e, "humany-conversation-agent-message")
|
|
507
|
+
},
|
|
508
|
+
l && /* @__PURE__ */ n.createElement(Fe, { avatarSize: u }, typeof l == "string" ? /* @__PURE__ */ n.createElement("img", { src: l }) : /* @__PURE__ */ n.createElement(w, { symbol: l })),
|
|
509
|
+
t,
|
|
510
|
+
/* @__PURE__ */ n.createElement(K, { name: s, timestamp: o })
|
|
511
|
+
);
|
|
497
512
|
}, tt = a.div`
|
|
498
513
|
display: grid;
|
|
499
514
|
margin-right: 10%;
|
|
@@ -512,17 +527,15 @@ const Re = ({ className: e }) => {
|
|
|
512
527
|
'info';
|
|
513
528
|
`};
|
|
514
529
|
`, ue = et, nt = X(
|
|
515
|
-
({ className: e, children: t, timestamp: r, discrete: o, fullWidth: l }, s) => /* @__PURE__ */ n.createElement(
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
timestamp: r
|
|
523
|
-
|
|
524
|
-
timestamp: r
|
|
525
|
-
})))
|
|
530
|
+
({ className: e, children: t, timestamp: r, discrete: o, fullWidth: l }, s) => /* @__PURE__ */ n.createElement(
|
|
531
|
+
rt,
|
|
532
|
+
{
|
|
533
|
+
ref: s,
|
|
534
|
+
className: H(e, "humany-conversation-system-message"),
|
|
535
|
+
fullWidth: l
|
|
536
|
+
},
|
|
537
|
+
o ? /* @__PURE__ */ n.createElement(ot, { className: "humany-conversation-discrete-message" }, t, /* @__PURE__ */ n.createElement(K, { timestamp: r })) : /* @__PURE__ */ n.createElement(n.Fragment, null, t, /* @__PURE__ */ n.createElement(K, { timestamp: r }))
|
|
538
|
+
)
|
|
526
539
|
), rt = a.div`
|
|
527
540
|
${(e) => e.fullWidth && "width: 100%"};
|
|
528
541
|
padding: 0 ${(e) => {
|
|
@@ -546,12 +559,14 @@ const Re = ({ className: e }) => {
|
|
|
546
559
|
}
|
|
547
560
|
`, at = nt, lt = ({ className: e, children: t, timestamp: r }) => {
|
|
548
561
|
const { userLabel: o = "" } = L();
|
|
549
|
-
return /* @__PURE__ */ n.createElement(
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
562
|
+
return /* @__PURE__ */ n.createElement(
|
|
563
|
+
st,
|
|
564
|
+
{
|
|
565
|
+
className: H(e, "humany-conversation-user-message")
|
|
566
|
+
},
|
|
567
|
+
t,
|
|
568
|
+
/* @__PURE__ */ n.createElement(K, { name: o, timestamp: r })
|
|
569
|
+
);
|
|
555
570
|
}, st = a.div`
|
|
556
571
|
margin-left: 10%;
|
|
557
572
|
width: 90%;
|
|
@@ -561,21 +576,25 @@ const Re = ({ className: e }) => {
|
|
|
561
576
|
`, it = lt, he = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
|
|
562
577
|
label: e[t],
|
|
563
578
|
actionKey: t
|
|
564
|
-
})), ct = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
+
})), ct = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
580
|
+
mt,
|
|
581
|
+
{
|
|
582
|
+
header: e,
|
|
583
|
+
items: he(t),
|
|
584
|
+
renderItem: (o) => /* @__PURE__ */ n.createElement("li", { key: o.actionKey }, /* @__PURE__ */ n.createElement(
|
|
585
|
+
dt,
|
|
586
|
+
{
|
|
587
|
+
onClick: () => {
|
|
588
|
+
r("action", o);
|
|
589
|
+
},
|
|
590
|
+
"aria-label": o.label,
|
|
591
|
+
title: o.label
|
|
592
|
+
},
|
|
593
|
+
/* @__PURE__ */ n.createElement(w, { symbol: o.symbol }),
|
|
594
|
+
o.label
|
|
595
|
+
))
|
|
596
|
+
}
|
|
597
|
+
), mt = a(J)`
|
|
579
598
|
${Q}
|
|
580
599
|
> ul {
|
|
581
600
|
display: flex;
|
|
@@ -619,12 +638,8 @@ const Re = ({ className: e }) => {
|
|
|
619
638
|
}
|
|
620
639
|
`, ut = ({ type: e, content: t = {} }) => {
|
|
621
640
|
const r = Ce(e);
|
|
622
|
-
return !r || !e ? null : /* @__PURE__ */ n.createElement(Me, {
|
|
623
|
-
|
|
624
|
-
}, /* @__PURE__ */ n.createElement(r, g({}, t)));
|
|
625
|
-
}, ht = ({ body: e }) => /* @__PURE__ */ n.createElement(gt, {
|
|
626
|
-
html: e
|
|
627
|
-
}), gt = a(Y)`
|
|
641
|
+
return !r || !e ? null : /* @__PURE__ */ n.createElement(Me, { fallback: null }, /* @__PURE__ */ n.createElement(r, g({}, t)));
|
|
642
|
+
}, ht = ({ body: e }) => /* @__PURE__ */ n.createElement(gt, { html: e }), gt = a(Y)`
|
|
628
643
|
${Se}
|
|
629
644
|
color: inherit;
|
|
630
645
|
white-space: pre-wrap;
|
|
@@ -635,26 +650,35 @@ const Re = ({ className: e }) => {
|
|
|
635
650
|
${b};
|
|
636
651
|
}
|
|
637
652
|
}
|
|
638
|
-
`, ft = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
653
|
+
`, ft = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
654
|
+
pt,
|
|
655
|
+
{
|
|
656
|
+
header: e,
|
|
657
|
+
items: he(t),
|
|
658
|
+
renderItem: (o) => /* @__PURE__ */ n.createElement("li", { key: o.actionKey }, /* @__PURE__ */ n.createElement(
|
|
659
|
+
yt,
|
|
660
|
+
{
|
|
661
|
+
help: o.actionKey === "help",
|
|
662
|
+
onClick: () => {
|
|
663
|
+
r("action", o);
|
|
664
|
+
},
|
|
665
|
+
"aria-label": o.label,
|
|
666
|
+
title: o.label
|
|
667
|
+
},
|
|
668
|
+
o.label,
|
|
669
|
+
o.actionKey === "help" && /* @__PURE__ */ n.createElement(
|
|
670
|
+
w,
|
|
671
|
+
{
|
|
672
|
+
size: 14,
|
|
673
|
+
symbol: {
|
|
674
|
+
type: "Svg",
|
|
675
|
+
content: "caret-down"
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
)
|
|
679
|
+
))
|
|
680
|
+
}
|
|
681
|
+
), pt = a(J)`
|
|
658
682
|
${Q}
|
|
659
683
|
${T}
|
|
660
684
|
|
|
@@ -714,9 +738,7 @@ const Re = ({ className: e }) => {
|
|
|
714
738
|
`, bt = () => /* @__PURE__ */ n.createElement($t, null), $t = a.div`
|
|
715
739
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
716
740
|
width: 100%;
|
|
717
|
-
`, vt = ({ text: e }) => /* @__PURE__ */ n.createElement(Et, {
|
|
718
|
-
variant: "span"
|
|
719
|
-
}, e), Et = a(q)`
|
|
741
|
+
`, vt = ({ text: e }) => /* @__PURE__ */ n.createElement(Et, { variant: "span" }, e), Et = a(q)`
|
|
720
742
|
${T}
|
|
721
743
|
`, xt = ({
|
|
722
744
|
header: e = "Video call",
|
|
@@ -742,26 +764,28 @@ const Re = ({ className: e }) => {
|
|
|
742
764
|
}
|
|
743
765
|
}
|
|
744
766
|
], [t, r]);
|
|
745
|
-
return /* @__PURE__ */ n.createElement(
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
767
|
+
return /* @__PURE__ */ n.createElement(
|
|
768
|
+
wt,
|
|
769
|
+
{
|
|
770
|
+
header: e,
|
|
771
|
+
items: l,
|
|
772
|
+
renderItem: (s) => {
|
|
773
|
+
const u = s.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
|
|
774
|
+
return /* @__PURE__ */ n.createElement("li", { key: s.actionKey }, /* @__PURE__ */ n.createElement(
|
|
775
|
+
kt,
|
|
776
|
+
{
|
|
777
|
+
onClick: () => {
|
|
778
|
+
o("action", s);
|
|
779
|
+
},
|
|
780
|
+
"aria-label": s.label,
|
|
781
|
+
title: s.label,
|
|
782
|
+
bgColor: u
|
|
783
|
+
},
|
|
784
|
+
/* @__PURE__ */ n.createElement(w, { symbol: s.symbol, size: 25 })
|
|
785
|
+
));
|
|
786
|
+
}
|
|
763
787
|
}
|
|
764
|
-
|
|
788
|
+
);
|
|
765
789
|
}, wt = a(J)`
|
|
766
790
|
${(e) => Q(e)}
|
|
767
791
|
> ul {
|
|
@@ -816,39 +840,31 @@ const Re = ({ className: e }) => {
|
|
|
816
840
|
stroke: #fff;
|
|
817
841
|
}
|
|
818
842
|
}
|
|
819
|
-
`, Ct = ([e, t]) => ({ type: e, content: t }), St = ({ items: e, dispatch: t }) => /* @__PURE__ */ n.createElement(
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
return /* @__PURE__ */ n.createElement(xt, x(g({}, r.content), {
|
|
842
|
-
dispatch: t
|
|
843
|
-
}));
|
|
844
|
-
default:
|
|
845
|
-
return /* @__PURE__ */ n.createElement(ut, {
|
|
846
|
-
type: r.type,
|
|
847
|
-
content: r.content
|
|
848
|
-
});
|
|
843
|
+
`, Ct = ([e, t]) => ({ type: e, content: t }), St = ({ items: e, dispatch: t }) => /* @__PURE__ */ n.createElement(
|
|
844
|
+
zt,
|
|
845
|
+
{
|
|
846
|
+
items: e.map(Ct),
|
|
847
|
+
renderLi: !0,
|
|
848
|
+
renderItem: (r) => {
|
|
849
|
+
switch (r.type) {
|
|
850
|
+
case C.Text:
|
|
851
|
+
return /* @__PURE__ */ n.createElement(vt, { text: r.content });
|
|
852
|
+
case C.HTML:
|
|
853
|
+
return /* @__PURE__ */ n.createElement(ht, g({}, r.content));
|
|
854
|
+
case C.Separator:
|
|
855
|
+
return /* @__PURE__ */ n.createElement(bt, g({}, r.content));
|
|
856
|
+
case C.LinkList:
|
|
857
|
+
return /* @__PURE__ */ n.createElement(ft, x(g({}, r.content), { dispatch: t }));
|
|
858
|
+
case C.ButtonList:
|
|
859
|
+
return /* @__PURE__ */ n.createElement(ct, x(g({}, r.content), { dispatch: t }));
|
|
860
|
+
case C.VideoRequest:
|
|
861
|
+
return /* @__PURE__ */ n.createElement(xt, x(g({}, r.content), { dispatch: t }));
|
|
862
|
+
default:
|
|
863
|
+
return /* @__PURE__ */ n.createElement(ut, { type: r.type, content: r.content });
|
|
864
|
+
}
|
|
849
865
|
}
|
|
850
866
|
}
|
|
851
|
-
|
|
867
|
+
), zt = a(le)`
|
|
852
868
|
${ze}
|
|
853
869
|
|
|
854
870
|
> li {
|
|
@@ -864,42 +880,32 @@ const Re = ({ className: e }) => {
|
|
|
864
880
|
[l]
|
|
865
881
|
), c = () => /* @__PURE__ */ n.createElement(n.Fragment, null, l.map((m) => {
|
|
866
882
|
const { key: i, body: $, title: k, form: S, actions: E } = m, p = !!$ && !k && !S && !E;
|
|
867
|
-
return /* @__PURE__ */ n.createElement(
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
isSystem: !0,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
className: e
|
|
894
|
-
}, /* @__PURE__ */ n.createElement(P, null, l.map((m, i) => /* @__PURE__ */ n.createElement(U, {
|
|
895
|
-
right: !0,
|
|
896
|
-
key: m.key,
|
|
897
|
-
ref: s
|
|
898
|
-
}, /* @__PURE__ */ n.createElement(F, {
|
|
899
|
-
isUser: !0,
|
|
900
|
-
content: m,
|
|
901
|
-
stacked: u(i)
|
|
902
|
-
})))));
|
|
883
|
+
return /* @__PURE__ */ n.createElement(
|
|
884
|
+
at,
|
|
885
|
+
{
|
|
886
|
+
className: e,
|
|
887
|
+
key: i,
|
|
888
|
+
discrete: p,
|
|
889
|
+
ref: s,
|
|
890
|
+
timestamp: t,
|
|
891
|
+
fullWidth: !!S || !!E
|
|
892
|
+
},
|
|
893
|
+
p && $ ? /* @__PURE__ */ n.createElement(Y, { html: $ }) : /* @__PURE__ */ n.createElement(F, { isSystem: !0, content: m })
|
|
894
|
+
);
|
|
895
|
+
})), h = () => /* @__PURE__ */ n.createElement(ue, { sender: r, timestamp: t, className: e }, /* @__PURE__ */ n.createElement(P, null, l.map((m, i) => /* @__PURE__ */ n.createElement(U, { left: !0, key: m.key, ref: s }, /* @__PURE__ */ n.createElement(
|
|
896
|
+
F,
|
|
897
|
+
{
|
|
898
|
+
content: m,
|
|
899
|
+
stacked: u(i)
|
|
900
|
+
}
|
|
901
|
+
))))), v = () => /* @__PURE__ */ n.createElement(it, { timestamp: t, className: e }, /* @__PURE__ */ n.createElement(P, null, l.map((m, i) => /* @__PURE__ */ n.createElement(U, { right: !0, key: m.key, ref: s }, /* @__PURE__ */ n.createElement(
|
|
902
|
+
F,
|
|
903
|
+
{
|
|
904
|
+
isUser: !0,
|
|
905
|
+
content: m,
|
|
906
|
+
stacked: u(i)
|
|
907
|
+
}
|
|
908
|
+
)))));
|
|
903
909
|
switch (o) {
|
|
904
910
|
case D.System:
|
|
905
911
|
return c();
|
|
@@ -913,39 +919,44 @@ const Re = ({ className: e }) => {
|
|
|
913
919
|
}
|
|
914
920
|
), F = ({ content: e, isUser: t, isSystem: r, stacked: o }) => {
|
|
915
921
|
const l = V(), { title: s, body: u, actions: c, form: h, items: v } = e;
|
|
916
|
-
return v ? /* @__PURE__ */ n.createElement(_, {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
922
|
+
return v ? /* @__PURE__ */ n.createElement(_, { user: !!t, stacked: o }, /* @__PURE__ */ n.createElement(St, { items: v, dispatch: l })) : /* @__PURE__ */ n.createElement(
|
|
923
|
+
_,
|
|
924
|
+
{
|
|
925
|
+
padded: !r,
|
|
926
|
+
user: !!t,
|
|
927
|
+
stacked: o,
|
|
928
|
+
fullWidth: !!h || !!c
|
|
929
|
+
},
|
|
930
|
+
s && /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(Ue, { variant: "h2" }, s)),
|
|
931
|
+
u && /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(Ye, { html: u })),
|
|
932
|
+
h && /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(
|
|
933
|
+
qe,
|
|
934
|
+
x(g({}, h), {
|
|
935
|
+
onChange: (i, $) => {
|
|
936
|
+
l("form", {
|
|
937
|
+
data: $,
|
|
938
|
+
formKey: h.schema.id,
|
|
939
|
+
actionKey: i
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
})
|
|
943
|
+
)),
|
|
944
|
+
c && /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(
|
|
945
|
+
Ge,
|
|
946
|
+
{
|
|
947
|
+
items: Object.keys(c).map((i) => ({ label: c[i], actionKey: i })),
|
|
948
|
+
renderItem: (i) => /* @__PURE__ */ n.createElement("li", { key: i.actionKey }, /* @__PURE__ */ n.createElement(
|
|
949
|
+
Je,
|
|
950
|
+
{
|
|
951
|
+
onClick: () => {
|
|
952
|
+
l("action", i.actionKey);
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
i.label
|
|
956
|
+
))
|
|
946
957
|
}
|
|
947
|
-
|
|
948
|
-
|
|
958
|
+
))
|
|
959
|
+
);
|
|
949
960
|
}, ge = () => {
|
|
950
961
|
const e = me((c) => {
|
|
951
962
|
c && setTimeout(() => {
|
|
@@ -958,32 +969,19 @@ const Re = ({ className: e }) => {
|
|
|
958
969
|
messages: o,
|
|
959
970
|
loading: l,
|
|
960
971
|
typingActors: s = []
|
|
961
|
-
} = L(), u = () => s && s.length ? s.map((c, h) => /* @__PURE__ */ n.createElement(W, {
|
|
962
|
-
|
|
963
|
-
key: `typing_${c.name}`
|
|
964
|
-
}, /* @__PURE__ */ n.createElement(ue, {
|
|
965
|
-
timestamp: Date.now(),
|
|
966
|
-
sender: c
|
|
967
|
-
}, /* @__PURE__ */ n.createElement(ne, {
|
|
968
|
-
boxed: !0,
|
|
969
|
-
ref: e
|
|
970
|
-
})))) : null;
|
|
971
|
-
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Mt, {
|
|
972
|
-
tabIndex: 0,
|
|
973
|
-
scrollableCss: t,
|
|
974
|
-
ref: r
|
|
975
|
-
}, o && o.length ? o.map((c, h) => {
|
|
972
|
+
} = L(), u = () => s && s.length ? s.map((c, h) => /* @__PURE__ */ n.createElement(W, { id: `typing_${c.name}`, key: `typing_${c.name}` }, /* @__PURE__ */ n.createElement(ue, { timestamp: Date.now(), sender: c }, /* @__PURE__ */ n.createElement(ne, { boxed: !0, ref: e })))) : null;
|
|
973
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Mt, { tabIndex: 0, scrollableCss: t, ref: r }, o && o.length ? o.map((c, h) => {
|
|
976
974
|
const { type: v, timestamp: m, sender: i, content: $ } = c;
|
|
977
|
-
return /* @__PURE__ */ n.createElement(
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
}))), /* @__PURE__ */ n.createElement(De, null));
|
|
975
|
+
return /* @__PURE__ */ n.createElement(
|
|
976
|
+
W,
|
|
977
|
+
{
|
|
978
|
+
className: "humany-conversation-entry",
|
|
979
|
+
tabIndex: -1,
|
|
980
|
+
key: `${v}_${i == null ? void 0 : i.name}_${m}_${$[0].key}`
|
|
981
|
+
},
|
|
982
|
+
/* @__PURE__ */ n.createElement(Lt, x(g({}, c), { ref: e }))
|
|
983
|
+
);
|
|
984
|
+
}) : null, u(), l && /* @__PURE__ */ n.createElement(W, null, /* @__PURE__ */ n.createElement(ne, { ref: e }))), /* @__PURE__ */ n.createElement(De, null));
|
|
987
985
|
}, Mt = a.div`
|
|
988
986
|
display: flex;
|
|
989
987
|
flex-direction: column;
|
|
@@ -1039,35 +1037,52 @@ const Re = ({ className: e }) => {
|
|
|
1039
1037
|
const t = Te(null);
|
|
1040
1038
|
return ce(() => {
|
|
1041
1039
|
t.current && t.current.parentNode && e("overlay-mounted", t.current);
|
|
1042
|
-
}, [t]), /* @__PURE__ */ n.createElement(
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1040
|
+
}, [t]), /* @__PURE__ */ n.createElement(
|
|
1041
|
+
ie,
|
|
1042
|
+
{
|
|
1043
|
+
portalId: "humany-conversation-overlay-portal",
|
|
1044
|
+
className: "humany-conversation-overlay-outlet",
|
|
1045
|
+
ref: t
|
|
1046
|
+
}
|
|
1047
|
+
);
|
|
1047
1048
|
}, Tt = ({
|
|
1048
1049
|
dispatch: e,
|
|
1049
1050
|
header: t,
|
|
1050
1051
|
buttonLabel: r
|
|
1051
|
-
}) => /* @__PURE__ */ n.createElement(
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}, /* @__PURE__ */ n.createElement(Bt, {
|
|
1057
|
-
className: "humany-conversation-outlet-head-button",
|
|
1058
|
-
"aria-label": r,
|
|
1059
|
-
title: r,
|
|
1060
|
-
onClick: () => e("hide-overlay-conversation")
|
|
1061
|
-
}, /* @__PURE__ */ n.createElement(w, {
|
|
1062
|
-
symbol: {
|
|
1063
|
-
type: "Svg",
|
|
1064
|
-
content: "caret-down"
|
|
1052
|
+
}) => /* @__PURE__ */ n.createElement(
|
|
1053
|
+
It,
|
|
1054
|
+
{
|
|
1055
|
+
portalId: "humany-conversation-portal",
|
|
1056
|
+
className: "humany-conversation-outlet"
|
|
1065
1057
|
},
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1058
|
+
/* @__PURE__ */ n.createElement(At, { className: "humany-conversation-outlet-head" }, /* @__PURE__ */ n.createElement(
|
|
1059
|
+
Bt,
|
|
1060
|
+
{
|
|
1061
|
+
className: "humany-conversation-outlet-head-button",
|
|
1062
|
+
"aria-label": r,
|
|
1063
|
+
title: r,
|
|
1064
|
+
onClick: () => e("hide-overlay-conversation")
|
|
1065
|
+
},
|
|
1066
|
+
/* @__PURE__ */ n.createElement(
|
|
1067
|
+
w,
|
|
1068
|
+
{
|
|
1069
|
+
symbol: {
|
|
1070
|
+
type: "Svg",
|
|
1071
|
+
content: "caret-down"
|
|
1072
|
+
},
|
|
1073
|
+
size: 20
|
|
1074
|
+
}
|
|
1075
|
+
)
|
|
1076
|
+
), t && /* @__PURE__ */ n.createElement(
|
|
1077
|
+
Rt,
|
|
1078
|
+
{
|
|
1079
|
+
className: "humany-conversation-outlet-header",
|
|
1080
|
+
variant: "h1"
|
|
1081
|
+
},
|
|
1082
|
+
t
|
|
1083
|
+
)),
|
|
1084
|
+
/* @__PURE__ */ n.createElement(ge, null)
|
|
1085
|
+
), It = a(ie)`
|
|
1071
1086
|
z-index: 11;
|
|
1072
1087
|
top: auto;
|
|
1073
1088
|
height: 65%;
|
|
@@ -1137,17 +1152,27 @@ const Re = ({ className: e }) => {
|
|
|
1137
1152
|
overlayConversationCloseLabel: u,
|
|
1138
1153
|
conversationControllerId: c
|
|
1139
1154
|
} = L(), h = V();
|
|
1140
|
-
return /* @__PURE__ */ n.createElement(
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1155
|
+
return /* @__PURE__ */ n.createElement(
|
|
1156
|
+
Le.Provider,
|
|
1157
|
+
{
|
|
1158
|
+
value: c ? { id: c } : null
|
|
1159
|
+
},
|
|
1160
|
+
/* @__PURE__ */ n.createElement(
|
|
1161
|
+
Kt,
|
|
1162
|
+
x(g({}, t), {
|
|
1163
|
+
className: H(e, "humany-conversation-component")
|
|
1164
|
+
}),
|
|
1165
|
+
/* @__PURE__ */ n.createElement(ge, null)
|
|
1166
|
+
),
|
|
1167
|
+
l && /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Ht, { dispatch: h }), l.conversation && /* @__PURE__ */ n.createElement(
|
|
1168
|
+
Tt,
|
|
1169
|
+
{
|
|
1170
|
+
dispatch: h,
|
|
1171
|
+
header: s,
|
|
1172
|
+
buttonLabel: u
|
|
1173
|
+
}
|
|
1174
|
+
))
|
|
1175
|
+
);
|
|
1151
1176
|
}, Kt = a.div`
|
|
1152
1177
|
position: absolute;
|
|
1153
1178
|
right: 0;
|
|
@@ -1161,4 +1186,4 @@ const Re = ({ className: e }) => {
|
|
|
1161
1186
|
export {
|
|
1162
1187
|
Yt as default
|
|
1163
1188
|
};
|
|
1164
|
-
//# sourceMappingURL=conversation.
|
|
1189
|
+
//# sourceMappingURL=conversation.bc31361a.js.map
|