bstp-agent-widget 0.2.90 → 0.2.91
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 +61 -49
- package/dist/agent-widget.js.map +1 -1
- package/dist/bstp-agent-widget.css +1 -1
- package/package.json +1 -1
package/dist/agent-widget.js
CHANGED
|
@@ -28403,42 +28403,52 @@ function AP(e = {}) {
|
|
|
28403
28403
|
};
|
|
28404
28404
|
}
|
|
28405
28405
|
var jP = {
|
|
28406
|
-
root: "
|
|
28407
|
-
button: "
|
|
28408
|
-
icon: "
|
|
28409
|
-
label: "
|
|
28406
|
+
root: "_root_1eel0_1",
|
|
28407
|
+
button: "_button_1eel0_5",
|
|
28408
|
+
icon: "_icon_1eel0_21",
|
|
28409
|
+
label: "_label_1eel0_27"
|
|
28410
28410
|
};
|
|
28411
28411
|
//#endregion
|
|
28412
28412
|
//#region src/components/AgentChat/AgentChatFab/AgentChatFab.tsx
|
|
28413
|
-
function MP({ onClick: e, zIndex: t, position: n, label: r }) {
|
|
28414
|
-
let
|
|
28415
|
-
transform:
|
|
28416
|
-
touchAction:
|
|
28413
|
+
function MP({ onClick: e, zIndex: t, position: n, label: r, accentColor: i }) {
|
|
28414
|
+
let a = CT(), o = An(), { handlePointerDown: s, style: c } = AP({ skipSelector: "" }), { transform: l, cursor: u, touchAction: d } = c, f = _(() => ({
|
|
28415
|
+
transform: l,
|
|
28416
|
+
touchAction: d,
|
|
28417
28417
|
zIndex: t,
|
|
28418
28418
|
...n
|
|
28419
28419
|
}), [
|
|
28420
28420
|
n,
|
|
28421
|
+
d,
|
|
28421
28422
|
l,
|
|
28422
|
-
s,
|
|
28423
28423
|
t
|
|
28424
|
+
]), p = _(() => {
|
|
28425
|
+
let e = i || o.colors.primary[4];
|
|
28426
|
+
return {
|
|
28427
|
+
cursor: u ?? "pointer",
|
|
28428
|
+
background: `linear-gradient(135deg, ${o.colors.primary[5]}, ${e})`
|
|
28429
|
+
};
|
|
28430
|
+
}, [
|
|
28431
|
+
u,
|
|
28432
|
+
i,
|
|
28433
|
+
o.colors.primary
|
|
28424
28434
|
]);
|
|
28425
28435
|
return /* @__PURE__ */ T("div", {
|
|
28426
28436
|
className: jP.root,
|
|
28427
|
-
style:
|
|
28437
|
+
style: f,
|
|
28428
28438
|
children: /* @__PURE__ */ T(xv, {
|
|
28429
28439
|
label: "Open agent widget",
|
|
28430
28440
|
position: "left",
|
|
28431
28441
|
children: /* @__PURE__ */ E(hc, {
|
|
28432
28442
|
onClick: e,
|
|
28433
|
-
onPointerDown:
|
|
28434
|
-
style:
|
|
28443
|
+
onPointerDown: s,
|
|
28444
|
+
style: p,
|
|
28435
28445
|
className: jP.button,
|
|
28436
28446
|
"aria-label": "Open agent widget",
|
|
28437
28447
|
children: [/* @__PURE__ */ T("span", {
|
|
28438
28448
|
className: jP.icon,
|
|
28439
28449
|
children: /* @__PURE__ */ T(DP, {
|
|
28440
|
-
width:
|
|
28441
|
-
height:
|
|
28450
|
+
width: a.other.iconSize["icon-md"],
|
|
28451
|
+
height: a.other.iconSize["icon-md"]
|
|
28442
28452
|
})
|
|
28443
28453
|
}), /* @__PURE__ */ T("span", {
|
|
28444
28454
|
className: jP.label,
|
|
@@ -33971,7 +33981,8 @@ function YV(e) {
|
|
|
33971
33981
|
zIndex: a,
|
|
33972
33982
|
fabPosition: o,
|
|
33973
33983
|
fabButtonLabel: e?.fabButtonLabel,
|
|
33974
|
-
panelTitle: s
|
|
33984
|
+
panelTitle: s,
|
|
33985
|
+
accentColor: e?.accentColor
|
|
33975
33986
|
};
|
|
33976
33987
|
}
|
|
33977
33988
|
//#endregion
|
|
@@ -34108,54 +34119,55 @@ function eH({ isListening: e, stopListening: t, reset: n, sendMessage: r, compos
|
|
|
34108
34119
|
//#region src/features/agent-chat/components/AgentChatLauncher/AgentChatLauncher.tsx
|
|
34109
34120
|
function tH(e) {
|
|
34110
34121
|
GV();
|
|
34111
|
-
let { panelWidth: t, panelHeight: n, panelHeaderHeight: r, panelTopOffset: i, zIndex: a, fabPosition: o, fabButtonLabel: s, panelTitle: c } = YV(e),
|
|
34122
|
+
let { panelWidth: t, panelHeight: n, panelHeaderHeight: r, panelTopOffset: i, zIndex: a, fabPosition: o, fabButtonLabel: s, panelTitle: c, accentColor: l } = YV(e), u = v(!1), { messages: d, composerText: f, setComposerText: p, isLoading: m, error: h, sendMessage: g, sendInitialMessage: _, canSend: y } = kV(), { actions: b, handleActionClick: x } = XV(d, g), { runtimeInfo: S, refreshRuntimeInfo: C } = AV(), { isOpen: D, open: O, close: k } = KV({
|
|
34112
34123
|
defaultOpen: !1,
|
|
34113
34124
|
persist: !0,
|
|
34114
34125
|
onOpen: async () => {
|
|
34115
|
-
|
|
34126
|
+
u.current || (u.current = !0, await C(), await _());
|
|
34116
34127
|
}
|
|
34117
|
-
}),
|
|
34128
|
+
}), A = MV([d.length, m]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = NV({
|
|
34118
34129
|
lang: PV(),
|
|
34119
34130
|
continuous: !0,
|
|
34120
34131
|
pauseOnSubmit: !0,
|
|
34121
|
-
onTextChange:
|
|
34122
|
-
}), { panelResizableWidth:
|
|
34123
|
-
isListening:
|
|
34124
|
-
stopListening:
|
|
34125
|
-
reset:
|
|
34126
|
-
sendMessage:
|
|
34127
|
-
composerText:
|
|
34128
|
-
setComposerText:
|
|
34129
|
-
startListening:
|
|
34130
|
-
close:
|
|
34131
|
-
});
|
|
34132
|
-
return /* @__PURE__ */ E(w, { children: [!
|
|
34133
|
-
onClick: () => void
|
|
34132
|
+
onTextChange: p
|
|
34133
|
+
}), { panelResizableWidth: ee } = $V(e, t, D), { handleSubmit: te, handleToggleVoice: I, handleClose: L } = eH({
|
|
34134
|
+
isListening: j,
|
|
34135
|
+
stopListening: P,
|
|
34136
|
+
reset: F,
|
|
34137
|
+
sendMessage: g,
|
|
34138
|
+
composerText: f,
|
|
34139
|
+
setComposerText: p,
|
|
34140
|
+
startListening: N,
|
|
34141
|
+
close: k
|
|
34142
|
+
});
|
|
34143
|
+
return /* @__PURE__ */ E(w, { children: [!D && /* @__PURE__ */ T(MP, {
|
|
34144
|
+
onClick: () => void O(),
|
|
34134
34145
|
zIndex: a,
|
|
34135
34146
|
position: o,
|
|
34136
|
-
label: s
|
|
34137
|
-
|
|
34147
|
+
label: s,
|
|
34148
|
+
accentColor: l
|
|
34149
|
+
}), D && /* @__PURE__ */ T(EP, {
|
|
34138
34150
|
visible: !0,
|
|
34139
|
-
onClose:
|
|
34140
|
-
messages:
|
|
34141
|
-
composerText:
|
|
34142
|
-
onComposerTextChange:
|
|
34143
|
-
isLoading:
|
|
34144
|
-
error:
|
|
34145
|
-
canSend:
|
|
34146
|
-
onSubmit:
|
|
34147
|
-
actions:
|
|
34148
|
-
onActionClick:
|
|
34149
|
-
isListening:
|
|
34150
|
-
isVoiceSupported:
|
|
34151
|
-
onToggleVoice:
|
|
34151
|
+
onClose: L,
|
|
34152
|
+
messages: d,
|
|
34153
|
+
composerText: f,
|
|
34154
|
+
onComposerTextChange: p,
|
|
34155
|
+
isLoading: m,
|
|
34156
|
+
error: h,
|
|
34157
|
+
canSend: y,
|
|
34158
|
+
onSubmit: te,
|
|
34159
|
+
actions: b,
|
|
34160
|
+
onActionClick: x,
|
|
34161
|
+
isListening: j,
|
|
34162
|
+
isVoiceSupported: M,
|
|
34163
|
+
onToggleVoice: I,
|
|
34152
34164
|
panelTitle: c,
|
|
34153
|
-
runtimeInfo:
|
|
34154
|
-
scrollViewportRef:
|
|
34165
|
+
runtimeInfo: S,
|
|
34166
|
+
scrollViewportRef: A,
|
|
34155
34167
|
panelWidth: t,
|
|
34156
34168
|
panelHeight: n,
|
|
34157
34169
|
panelHeaderHeight: r,
|
|
34158
|
-
panelResizableWidth:
|
|
34170
|
+
panelResizableWidth: ee,
|
|
34159
34171
|
zIndex: a,
|
|
34160
34172
|
panelTopOffset: i
|
|
34161
34173
|
})] });
|