bstp-agent-widget 0.2.64 → 0.2.65

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.
@@ -15427,29 +15427,29 @@ var Vy = { root: "m_8a5d1357" }, Hy = { order: 1 }, Uy = Mt((e, { order: t, size
15427
15427
  });
15428
15428
  Wy.classes = Vy, Wy.varsResolver = Uy, Wy.displayName = "@mantine/core/Title";
15429
15429
  var Gy = {
15430
- root: "_root_j8mpf_1",
15431
- resizeHandle: "_resizeHandle_j8mpf_15",
15432
- header: "_header_j8mpf_61",
15433
- headerLeft: "_headerLeft_j8mpf_72",
15434
- headerInfo: "_headerInfo_j8mpf_78",
15435
- orbContainer: "_orbContainer_j8mpf_84",
15436
- orbOuter: "_orbOuter_j8mpf_94",
15437
- orbPulse: "_orbPulse_j8mpf_1",
15438
- orbMiddle: "_orbMiddle_j8mpf_103",
15439
- orbInner: "_orbInner_j8mpf_112",
15440
- orbFloat: "_orbFloat_j8mpf_1",
15441
- headerMeta: "_headerMeta_j8mpf_124",
15442
- statusDot: "_statusDot_j8mpf_130",
15443
- statusText: "_statusText_j8mpf_144",
15444
- closeButton: "_closeButton_j8mpf_149",
15445
- topSubHeader: "_topSubHeader_j8mpf_153",
15446
- subHeaderLeft: "_subHeaderLeft_j8mpf_163",
15447
- subHeaderIcon: "_subHeaderIcon_j8mpf_169",
15448
- subHeaderTitle: "_subHeaderTitle_j8mpf_180",
15449
- subHeaderStatus: "_subHeaderStatus_j8mpf_186",
15450
- body: "_body_j8mpf_191",
15451
- title: "_title_j8mpf_199",
15452
- footer: "_footer_j8mpf_206"
15430
+ root: "_root_18dn5_1",
15431
+ resizeHandle: "_resizeHandle_18dn5_15",
15432
+ header: "_header_18dn5_61",
15433
+ headerLeft: "_headerLeft_18dn5_72",
15434
+ headerInfo: "_headerInfo_18dn5_78",
15435
+ orbContainer: "_orbContainer_18dn5_84",
15436
+ orbOuter: "_orbOuter_18dn5_94",
15437
+ orbPulse: "_orbPulse_18dn5_1",
15438
+ orbMiddle: "_orbMiddle_18dn5_103",
15439
+ orbInner: "_orbInner_18dn5_112",
15440
+ orbFloat: "_orbFloat_18dn5_1",
15441
+ headerMeta: "_headerMeta_18dn5_124",
15442
+ statusDot: "_statusDot_18dn5_130",
15443
+ statusText: "_statusText_18dn5_144",
15444
+ closeButton: "_closeButton_18dn5_149",
15445
+ topSubHeader: "_topSubHeader_18dn5_153",
15446
+ subHeaderLeft: "_subHeaderLeft_18dn5_163",
15447
+ subHeaderIcon: "_subHeaderIcon_18dn5_169",
15448
+ subHeaderTitle: "_subHeaderTitle_18dn5_180",
15449
+ subHeaderStatus: "_subHeaderStatus_18dn5_186",
15450
+ body: "_body_18dn5_191",
15451
+ title: "_title_18dn5_199",
15452
+ footer: "_footer_18dn5_206"
15453
15453
  };
15454
15454
  //#endregion
15455
15455
  //#region node_modules/marked/lib/marked.esm.js
@@ -23635,13 +23635,14 @@ function RO({ ...e }) {
23635
23635
  }
23636
23636
  //#endregion
23637
23637
  //#region src/components/AgentChat/AgentChatPanel.tsx
23638
- function zO({ visible: e, onClose: t, messages: n, composerText: r, onComposerTextChange: i, isLoading: a, error: o, canSend: s, onSubmit: c, isListening: l, isVoiceSupported: u, onToggleVoice: d, panelTitle: f, runtimeInfo: p, scrollViewportRef: m, panelWidth: h = 420, panelHeight: g = "100%", panelHeaderHeight: _ = 56, panelResizableWidth: v }) {
23639
- let y = v ? Math.max(280, h + v.offset) : h, b = p.hasCustomerToken && p.hasGenaiToken;
23638
+ function zO({ visible: e, onClose: t, messages: n, composerText: r, onComposerTextChange: i, isLoading: a, error: o, canSend: s, onSubmit: c, isListening: l, isVoiceSupported: u, onToggleVoice: d, panelTitle: f, runtimeInfo: p, scrollViewportRef: m, panelWidth: h = 420, panelHeight: g = "100%", panelHeaderHeight: _ = 56, panelResizableWidth: v, zIndex: y }) {
23639
+ let b = v ? Math.max(280, h + v.offset) : h, x = p.hasCustomerToken && p.hasGenaiToken;
23640
23640
  return e ? /* @__PURE__ */ E(Y, {
23641
23641
  className: Gy.root,
23642
23642
  style: {
23643
- width: y,
23643
+ width: b,
23644
23644
  height: g,
23645
+ zIndex: y,
23645
23646
  "--agent-widget-panel-header-height": `${_}px`
23646
23647
  },
23647
23648
  children: [
@@ -23678,10 +23679,10 @@ function zO({ visible: e, onClose: t, messages: n, composerText: r, onComposerTe
23678
23679
  children: [/* @__PURE__ */ T(Y, {
23679
23680
  className: Gy.statusDot,
23680
23681
  "data-loading": a || void 0,
23681
- "data-online": b || void 0
23682
+ "data-online": x || void 0
23682
23683
  }), /* @__PURE__ */ T(Xd, {
23683
23684
  className: Gy.statusText,
23684
- children: a ? "Typing…" : b ? "Online · Billing Intelligence" : "Offline"
23685
+ children: a ? "Typing…" : x ? "Online · Billing Intelligence" : "Offline"
23685
23686
  })]
23686
23687
  })]
23687
23688
  })]
@@ -23916,10 +23917,10 @@ function UO(e = {}) {
23916
23917
  };
23917
23918
  }
23918
23919
  var WO = {
23919
- root: "_root_1r0du_1",
23920
- button: "_button_1r0du_5",
23921
- icon: "_icon_1r0du_22",
23922
- label: "_label_1r0du_28"
23920
+ root: "_root_76f4f_2",
23921
+ button: "_button_76f4f_7",
23922
+ icon: "_icon_76f4f_24",
23923
+ label: "_label_76f4f_30"
23923
23924
  };
23924
23925
  //#endregion
23925
23926
  //#region src/components/AgentChat/AgentChatFab.tsx
@@ -23928,11 +23929,10 @@ function GO({ onClick: e, zIndex: t, position: n, color: r, label: i }) {
23928
23929
  return /* @__PURE__ */ T("div", {
23929
23930
  className: WO.root,
23930
23931
  style: {
23931
- bottom: `${n.bottom}px`,
23932
- right: `${n.right}px`,
23933
- zIndex: t,
23934
23932
  transform: s,
23935
- touchAction: l
23933
+ touchAction: l,
23934
+ zIndex: t,
23935
+ ...n
23936
23936
  },
23937
23937
  children: /* @__PURE__ */ T(_v, {
23938
23938
  label: "Open agent widget",
@@ -29009,7 +29009,13 @@ function zF(e = {}) {
29009
29009
  defaultValue: t,
29010
29010
  getInitialValueInEffect: !1
29011
29011
  });
29012
- return {
29012
+ return f(() => {
29013
+ if (typeof document > "u") return;
29014
+ let e = document.querySelector(".app-shell-content") || document.querySelector("main") || document.querySelector(".main-content") || document.body;
29015
+ return r ? e?.classList.add("panel-open") : (e?.classList.remove("panel-open"), e?.style.removeProperty("margin-right")), () => {
29016
+ e?.classList.remove("panel-open"), e?.style.removeProperty("margin-right");
29017
+ };
29018
+ }, [r]), {
29013
29019
  isOpen: r,
29014
29020
  open: u(() => {
29015
29021
  i(!0);
@@ -29033,72 +29039,75 @@ var BF = {
29033
29039
  }, VF = 1e4;
29034
29040
  function HF({ ui: e }) {
29035
29041
  RF();
29036
- let t = e?.panelWidth ?? 420, n = e?.panelHeight ?? "100%", r = e?.panelHeaderHeight ?? 56, i = {
29042
+ let t = e?.panelWidth ?? 420, n = e?.panelHeight ?? "100%", r = e?.panelHeaderHeight ?? 56, i = e?.zIndex ?? VF, a = {
29037
29043
  bottom: e?.fabBottomOffset ?? BF.bottom,
29038
29044
  right: e?.fabRightOffset ?? BF.right
29039
- }, { isOpen: a, open: o, close: s } = zF({
29045
+ }, { isOpen: o, open: s, close: c } = zF({
29040
29046
  defaultOpen: !1,
29041
29047
  persist: !0
29042
- }), { messages: c, composerText: l, setComposerText: d, isLoading: p, error: m, sendMessage: h, sendInitialMessage: g, canSend: y } = OF(), { runtimeInfo: b, refreshRuntimeInfo: x } = kF(), S = MF([c.length, p]), { isListening: C, isSupported: D, startListening: O, stopListening: k, reset: A } = NF({
29048
+ }), { messages: l, composerText: d, setComposerText: p, isLoading: m, error: h, sendMessage: g, sendInitialMessage: y, canSend: b } = OF(), { runtimeInfo: x, refreshRuntimeInfo: S } = kF(), C = MF([l.length, m]), { isListening: D, isSupported: O, startListening: k, stopListening: A, reset: j } = NF({
29043
29049
  lang: PF(),
29044
29050
  continuous: !0,
29045
29051
  pauseOnSubmit: !0,
29046
- onTextChange: d
29047
- }), j = _(() => /* @__PURE__ */ T(Xd, {
29052
+ onTextChange: p
29053
+ }), M = _(() => /* @__PURE__ */ T(Xd, {
29048
29054
  fw: 800,
29049
29055
  children: e?.panelTitle ?? "Agent Chat"
29050
- }), [e?.panelTitle]), M = v(!1), N = () => {
29051
- C && k(), A(), h(l);
29052
- }, P = () => {
29053
- C ? k() : (d(""), O());
29056
+ }), [e?.panelTitle]), N = v(!1), P = () => {
29057
+ D && A(), j(), g(d);
29054
29058
  }, F = () => {
29055
- C && k(), s();
29056
- }, ee = async () => {
29057
- o(), M.current || (M.current = !0, await x(), await g());
29059
+ D ? A() : (p(""), k());
29060
+ }, ee = () => {
29061
+ D && A(), c();
29062
+ }, te = async () => {
29063
+ s(), N.current || (N.current = !0, await S(), await y());
29058
29064
  };
29059
29065
  f(() => {
29060
- a && !M.current && (M.current = !0, (async () => {
29061
- await x(), await g();
29066
+ o && !N.current && (N.current = !0, (async () => {
29067
+ await S(), await y();
29062
29068
  })());
29063
- }, [a]);
29064
- let te = AF({
29069
+ }, [o]);
29070
+ let I = AF({
29065
29071
  axis: "x",
29066
29072
  direction: -1,
29067
29073
  onResizeChange: u((e) => {
29068
29074
  let n = Math.max(280, t + e);
29069
29075
  document.documentElement.style.setProperty("--agent-widget-panel-width", `${n}px`);
29076
+ let r = document.querySelector(".app-shell-content") || document.querySelector("main") || document.querySelector(".main-content") || document.body;
29077
+ r && (r.style.marginRight = `${n}px`);
29070
29078
  }, [t])
29071
29079
  });
29072
29080
  return f(() => {
29073
- if (a) return document.documentElement.style.setProperty("--agent-widget-panel-width", `${t}px`), () => {
29081
+ if (o) return document.documentElement.style.setProperty("--agent-widget-panel-width", `${t}px`), () => {
29074
29082
  document.documentElement.style.removeProperty("--agent-widget-panel-width");
29075
29083
  };
29076
- }, [a, t]), /* @__PURE__ */ E(w, { children: [!a && /* @__PURE__ */ T(GO, {
29077
- onClick: () => void ee(),
29078
- zIndex: VF,
29079
- position: i,
29084
+ }, [o, t]), /* @__PURE__ */ E(w, { children: [!o && /* @__PURE__ */ T(GO, {
29085
+ onClick: () => void te(),
29086
+ zIndex: i,
29087
+ position: a,
29080
29088
  color: e?.accentColor,
29081
29089
  label: e?.fabButtonLabel
29082
- }), a && /* @__PURE__ */ T(zO, {
29090
+ }), o && /* @__PURE__ */ T(zO, {
29083
29091
  visible: !0,
29084
- onClose: F,
29085
- messages: c,
29086
- composerText: l,
29087
- onComposerTextChange: d,
29088
- isLoading: p,
29089
- error: m,
29090
- canSend: y,
29091
- onSubmit: N,
29092
- isListening: C,
29093
- isVoiceSupported: D,
29094
- onToggleVoice: P,
29095
- panelTitle: j,
29096
- runtimeInfo: b,
29097
- scrollViewportRef: S,
29092
+ onClose: ee,
29093
+ messages: l,
29094
+ composerText: d,
29095
+ onComposerTextChange: p,
29096
+ isLoading: m,
29097
+ error: h,
29098
+ canSend: b,
29099
+ onSubmit: P,
29100
+ isListening: D,
29101
+ isVoiceSupported: O,
29102
+ onToggleVoice: F,
29103
+ panelTitle: M,
29104
+ runtimeInfo: x,
29105
+ scrollViewportRef: C,
29098
29106
  panelWidth: t,
29099
29107
  panelHeight: n,
29100
29108
  panelHeaderHeight: r,
29101
- panelResizableWidth: te
29109
+ panelResizableWidth: I,
29110
+ zIndex: i
29102
29111
  })] });
29103
29112
  }
29104
29113
  //#endregion