bstp-agent-widget 0.2.45 → 0.2.46
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-widget.js +32 -21
- package/dist/agent-widget.js.map +1 -1
- package/package.json +1 -1
package/dist/agent-widget.js
CHANGED
|
@@ -23747,11 +23747,22 @@ function YO({ ...e }) {
|
|
|
23747
23747
|
}
|
|
23748
23748
|
//#endregion
|
|
23749
23749
|
//#region src/components/AgentChat/AgentChatDrawer.tsx
|
|
23750
|
-
function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening:
|
|
23751
|
-
|
|
23750
|
+
function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0 }) {
|
|
23751
|
+
let D = Math.max(280, S + b.offset);
|
|
23752
|
+
return f(() => {
|
|
23753
|
+
if (typeof document > "u") return;
|
|
23754
|
+
let t = document.documentElement;
|
|
23755
|
+
if (!e) {
|
|
23756
|
+
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23757
|
+
return;
|
|
23758
|
+
}
|
|
23759
|
+
return t.style.setProperty("--agent-widget-drawer-width", `${D}px`), () => {
|
|
23760
|
+
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23761
|
+
};
|
|
23762
|
+
}, [e, D]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
|
|
23752
23763
|
opened: e,
|
|
23753
23764
|
onClose: t,
|
|
23754
|
-
size:
|
|
23765
|
+
size: D,
|
|
23755
23766
|
zIndex: n,
|
|
23756
23767
|
withinPortal: r,
|
|
23757
23768
|
overlayProps: i ? {
|
|
@@ -23772,29 +23783,29 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23772
23783
|
content: db.content
|
|
23773
23784
|
},
|
|
23774
23785
|
styles: { content: {
|
|
23775
|
-
marginTop:
|
|
23776
|
-
height: `calc(100vh - ${
|
|
23786
|
+
marginTop: C,
|
|
23787
|
+
height: `calc(100vh - ${C}px)`
|
|
23777
23788
|
} },
|
|
23778
23789
|
title: /* @__PURE__ */ T(Y, { children: /* @__PURE__ */ E(kl, {
|
|
23779
23790
|
gap: "xs",
|
|
23780
23791
|
align: "center",
|
|
23781
23792
|
wrap: "nowrap",
|
|
23782
23793
|
children: [
|
|
23783
|
-
|
|
23794
|
+
g,
|
|
23784
23795
|
/* @__PURE__ */ T(Xd, {
|
|
23785
23796
|
size: "xs",
|
|
23786
23797
|
c: "dimmed",
|
|
23787
|
-
children:
|
|
23798
|
+
children: _.customerId ? `#${_.customerId}` : "#-"
|
|
23788
23799
|
}),
|
|
23789
23800
|
/* @__PURE__ */ T(Xd, {
|
|
23790
23801
|
size: "xs",
|
|
23791
|
-
c:
|
|
23792
|
-
children:
|
|
23802
|
+
c: _.hasCustomerToken ? "green" : "red",
|
|
23803
|
+
children: _.hasCustomerToken ? "cust✓" : "cust✗"
|
|
23793
23804
|
}),
|
|
23794
23805
|
/* @__PURE__ */ T(Xd, {
|
|
23795
23806
|
size: "xs",
|
|
23796
|
-
c:
|
|
23797
|
-
children:
|
|
23807
|
+
c: _.hasGenaiToken ? "green" : "red",
|
|
23808
|
+
children: _.hasGenaiToken ? "genai✓" : "genai✗"
|
|
23798
23809
|
})
|
|
23799
23810
|
]
|
|
23800
23811
|
}) }),
|
|
@@ -23808,7 +23819,7 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23808
23819
|
h: "100%",
|
|
23809
23820
|
type: "auto",
|
|
23810
23821
|
offsetScrollbars: !0,
|
|
23811
|
-
viewportRef:
|
|
23822
|
+
viewportRef: v,
|
|
23812
23823
|
children: /* @__PURE__ */ E(zv, {
|
|
23813
23824
|
gap: "sm",
|
|
23814
23825
|
children: [a.map((e) => /* @__PURE__ */ T(Y, {
|
|
@@ -23857,8 +23868,8 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23857
23868
|
composerText: o,
|
|
23858
23869
|
onComposerTextChange: s,
|
|
23859
23870
|
isLoading: c,
|
|
23860
|
-
isListening:
|
|
23861
|
-
isVoiceSupported:
|
|
23871
|
+
isListening: p,
|
|
23872
|
+
isVoiceSupported: m,
|
|
23862
23873
|
onSubmit: d
|
|
23863
23874
|
}), /* @__PURE__ */ E(kl, {
|
|
23864
23875
|
gap: 4,
|
|
@@ -23869,10 +23880,10 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23869
23880
|
top: "50%",
|
|
23870
23881
|
transform: "translateY(-50%)"
|
|
23871
23882
|
},
|
|
23872
|
-
children: [
|
|
23873
|
-
isListening:
|
|
23883
|
+
children: [m && /* @__PURE__ */ T(qO, {
|
|
23884
|
+
isListening: p,
|
|
23874
23885
|
isLoading: c,
|
|
23875
|
-
onToggleVoice:
|
|
23886
|
+
onToggleVoice: h
|
|
23876
23887
|
}), /* @__PURE__ */ T(yl, {
|
|
23877
23888
|
onClick: d,
|
|
23878
23889
|
disabled: !u || c,
|
|
@@ -23888,26 +23899,26 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23888
23899
|
})
|
|
23889
23900
|
}) }),
|
|
23890
23901
|
/* @__PURE__ */ T(Y, {
|
|
23891
|
-
onPointerDown:
|
|
23902
|
+
onPointerDown: x.handlePointerDown,
|
|
23892
23903
|
style: {
|
|
23893
23904
|
position: "absolute",
|
|
23894
23905
|
bottom: 0,
|
|
23895
23906
|
left: 0,
|
|
23896
23907
|
right: 0,
|
|
23897
23908
|
height: "8px",
|
|
23898
|
-
...
|
|
23909
|
+
...x.style,
|
|
23899
23910
|
zIndex: 10
|
|
23900
23911
|
}
|
|
23901
23912
|
}),
|
|
23902
23913
|
/* @__PURE__ */ T(Y, {
|
|
23903
|
-
onPointerDown:
|
|
23914
|
+
onPointerDown: b.handlePointerDown,
|
|
23904
23915
|
style: {
|
|
23905
23916
|
position: "absolute",
|
|
23906
23917
|
top: 0,
|
|
23907
23918
|
bottom: 0,
|
|
23908
23919
|
left: 0,
|
|
23909
23920
|
width: "8px",
|
|
23910
|
-
...
|
|
23921
|
+
...b.style,
|
|
23911
23922
|
zIndex: 10
|
|
23912
23923
|
}
|
|
23913
23924
|
})
|