bstp-agent-widget 0.2.46 → 0.2.47
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 +44 -38
- package/dist/agent-widget.js.map +1 -1
- package/dist/bstp-agent-widget.css +1 -1
- package/package.json +1 -1
- package/src/lib/index.d.ts +3 -0
package/dist/agent-widget.js
CHANGED
|
@@ -15691,12 +15691,12 @@ var ub = ({ ...e }) => {
|
|
|
15691
15691
|
};
|
|
15692
15692
|
ub.Body = cb, ub.Footer = lb;
|
|
15693
15693
|
var db = {
|
|
15694
|
-
root: "
|
|
15695
|
-
inner: "
|
|
15696
|
-
content: "
|
|
15697
|
-
header: "
|
|
15698
|
-
body: "
|
|
15699
|
-
title: "
|
|
15694
|
+
root: "_root_nppjj_1",
|
|
15695
|
+
inner: "_inner_nppjj_6",
|
|
15696
|
+
content: "_content_nppjj_12",
|
|
15697
|
+
header: "_header_nppjj_19",
|
|
15698
|
+
body: "_body_nppjj_29",
|
|
15699
|
+
title: "_title_nppjj_34"
|
|
15700
15700
|
};
|
|
15701
15701
|
//#endregion
|
|
15702
15702
|
//#region node_modules/marked/lib/marked.esm.js
|
|
@@ -23747,8 +23747,8 @@ 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: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0 }) {
|
|
23751
|
-
let
|
|
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, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1 }) {
|
|
23751
|
+
let A = Math.max(280, S + b.offset);
|
|
23752
23752
|
return f(() => {
|
|
23753
23753
|
if (typeof document > "u") return;
|
|
23754
23754
|
let t = document.documentElement;
|
|
@@ -23756,13 +23756,13 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23756
23756
|
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23757
23757
|
return;
|
|
23758
23758
|
}
|
|
23759
|
-
return t.style.setProperty("--agent-widget-drawer-width", `${
|
|
23759
|
+
return t.style.setProperty("--agent-widget-drawer-width", `${A}px`), () => {
|
|
23760
23760
|
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23761
23761
|
};
|
|
23762
|
-
}, [e,
|
|
23762
|
+
}, [e, A]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
|
|
23763
23763
|
opened: e,
|
|
23764
23764
|
onClose: t,
|
|
23765
|
-
size:
|
|
23765
|
+
size: A,
|
|
23766
23766
|
zIndex: n,
|
|
23767
23767
|
withinPortal: r,
|
|
23768
23768
|
overlayProps: i ? {
|
|
@@ -23784,7 +23784,10 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23784
23784
|
},
|
|
23785
23785
|
styles: { content: {
|
|
23786
23786
|
marginTop: C,
|
|
23787
|
-
|
|
23787
|
+
marginRight: D,
|
|
23788
|
+
height: `calc(100dvh - ${C}px)`,
|
|
23789
|
+
borderRadius: O,
|
|
23790
|
+
boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none"
|
|
23788
23791
|
} },
|
|
23789
23792
|
title: /* @__PURE__ */ T(Y, { children: /* @__PURE__ */ E(kl, {
|
|
23790
23793
|
gap: "xs",
|
|
@@ -29120,59 +29123,62 @@ var XF = 1e4, ZF = {
|
|
|
29120
29123
|
};
|
|
29121
29124
|
function QF({ ui: e }) {
|
|
29122
29125
|
YF();
|
|
29123
|
-
let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = {
|
|
29126
|
+
let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = e?.drawerRightOffset ?? 0, u = e?.drawerBorderRadius ?? 0, d = e?.drawerShadow ?? !1, f = {
|
|
29124
29127
|
bottom: e?.fabBottomOffset ?? ZF.bottom,
|
|
29125
29128
|
right: e?.fabRightOffset ?? ZF.right
|
|
29126
|
-
}, { messages:
|
|
29129
|
+
}, { messages: p, composerText: m, setComposerText: h, isLoading: g, error: v, sendMessage: y, sendInitialMessage: b, canSend: x } = zF(), { runtimeInfo: S, refreshRuntimeInfo: C } = BF(), D = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), O = VF({ axis: "y" }), k = VF({
|
|
29127
29130
|
axis: "x",
|
|
29128
29131
|
direction: -1
|
|
29129
|
-
}),
|
|
29132
|
+
}), A = UF([p.length, g]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = WF({
|
|
29130
29133
|
lang: GF(),
|
|
29131
29134
|
continuous: !0,
|
|
29132
29135
|
pauseOnSubmit: !0,
|
|
29133
|
-
onTextChange:
|
|
29134
|
-
}),
|
|
29136
|
+
onTextChange: h
|
|
29137
|
+
}), ee = _(() => /* @__PURE__ */ T(Xd, {
|
|
29135
29138
|
fw: 800,
|
|
29136
29139
|
children: "Agent Chat"
|
|
29137
|
-
}), []),
|
|
29138
|
-
n(), await
|
|
29140
|
+
}), []), te = async () => {
|
|
29141
|
+
n(), await C(), await b();
|
|
29139
29142
|
};
|
|
29140
29143
|
return /* @__PURE__ */ E(w, { children: [!t && /* @__PURE__ */ T(nk, {
|
|
29141
|
-
onClick: () => void
|
|
29144
|
+
onClick: () => void te(),
|
|
29142
29145
|
zIndex: i,
|
|
29143
|
-
position:
|
|
29146
|
+
position: f,
|
|
29144
29147
|
color: e?.accentColor,
|
|
29145
29148
|
label: e?.fabButtonLabel
|
|
29146
29149
|
}), /* @__PURE__ */ T(XO, {
|
|
29147
29150
|
opened: t,
|
|
29148
29151
|
onClose: () => {
|
|
29149
|
-
|
|
29152
|
+
j && P(), r();
|
|
29150
29153
|
},
|
|
29151
29154
|
zIndex: i,
|
|
29152
29155
|
withinPortal: a,
|
|
29153
29156
|
withOverlay: o,
|
|
29154
29157
|
topOffset: c,
|
|
29155
29158
|
drawerBaseWidth: s,
|
|
29156
|
-
|
|
29157
|
-
|
|
29158
|
-
|
|
29159
|
-
|
|
29160
|
-
|
|
29161
|
-
|
|
29159
|
+
drawerRightOffset: l,
|
|
29160
|
+
drawerBorderRadius: u,
|
|
29161
|
+
drawerShadow: d,
|
|
29162
|
+
messages: p,
|
|
29163
|
+
composerText: m,
|
|
29164
|
+
onComposerTextChange: h,
|
|
29165
|
+
isLoading: g,
|
|
29166
|
+
error: v,
|
|
29167
|
+
canSend: x,
|
|
29162
29168
|
onSubmit: () => {
|
|
29163
|
-
|
|
29169
|
+
j && P(), F(), y(m);
|
|
29164
29170
|
},
|
|
29165
|
-
isListening:
|
|
29166
|
-
isVoiceSupported:
|
|
29171
|
+
isListening: j,
|
|
29172
|
+
isVoiceSupported: M,
|
|
29167
29173
|
onToggleVoice: () => {
|
|
29168
|
-
|
|
29174
|
+
j ? P() : (h(""), N());
|
|
29169
29175
|
},
|
|
29170
|
-
drawerTitle:
|
|
29171
|
-
runtimeInfo:
|
|
29172
|
-
scrollViewportRef:
|
|
29173
|
-
drawerDraggable:
|
|
29174
|
-
drawerResizableWidth:
|
|
29175
|
-
drawerResizableHeight:
|
|
29176
|
+
drawerTitle: ee,
|
|
29177
|
+
runtimeInfo: S,
|
|
29178
|
+
scrollViewportRef: A,
|
|
29179
|
+
drawerDraggable: D,
|
|
29180
|
+
drawerResizableWidth: k,
|
|
29181
|
+
drawerResizableHeight: O
|
|
29176
29182
|
})] });
|
|
29177
29183
|
}
|
|
29178
29184
|
//#endregion
|