@magemetrics/ai 0.0.57 → 0.0.58

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/react/ai.js CHANGED
@@ -2407,7 +2407,7 @@ const VS = C.object({
2407
2407
  })
2408
2408
  }), b0 = (l, t) => {
2409
2409
  const e = qg({ baseUrl: l });
2410
- return e.use(e0), e.use(i0("0.0.57")), e.use(H2(t)), e;
2410
+ return e.use(e0), e.use(i0("0.0.58")), e.use(H2(t)), e;
2411
2411
  }, sd = "mm-ai-sp-token", qn = "mm-ai-check-key";
2412
2412
  class JS extends EventTarget {
2413
2413
  config;
@@ -2705,7 +2705,7 @@ class JS extends EventTarget {
2705
2705
  * Initialize the API client with Supabase headers
2706
2706
  */
2707
2707
  initializeApiClient() {
2708
- this.internalApiClient = qg({ baseUrl: this.config.apiUrl }), this.internalApiClient.use(e0), this.internalApiClient.use(this.createSupabaseHeaderMiddleware()), this.internalApiClient.use(i0("0.0.57"));
2708
+ this.internalApiClient = qg({ baseUrl: this.config.apiUrl }), this.internalApiClient.use(e0), this.internalApiClient.use(this.createSupabaseHeaderMiddleware()), this.internalApiClient.use(i0("0.0.58"));
2709
2709
  }
2710
2710
  /**
2711
2711
  * Handle the authentication logic (check session or exchange token)
@@ -3551,7 +3551,7 @@ const ec = /* @__PURE__ */ new Map(), Tk = (l, t, e, s) => new w2({
3551
3551
  transport: new S2({
3552
3552
  api: `${t}/api/v1/chat/${l}`,
3553
3553
  headers: {
3554
- [t0]: "0.0.57"
3554
+ [t0]: "0.0.58"
3555
3555
  },
3556
3556
  prepareSendMessagesRequest({ messages: n, id: o }) {
3557
3557
  return { body: { message: n.at(-1), id: o } };
@@ -4202,7 +4202,7 @@ const Qk = Me.memo(({ flowId: l }) => {
4202
4202
  const [e, s] = oe(""), {
4203
4203
  chat: { sendMessage: n }
4204
4204
  } = ps(l), o = (h) => {
4205
- h.preventDefault(), n({ text: e }), s("");
4205
+ h.preventDefault(), e.trim().length !== 0 && (n({ text: e }), s(""));
4206
4206
  };
4207
4207
  return /* @__PURE__ */ L("form", { onSubmit: o, className: Ft("mm:flex mm:group"), children: /* @__PURE__ */ L(Zs, { mode: "wait", children: t ? /* @__PURE__ */ L(
4208
4208
  Fu,
@@ -6369,11 +6369,11 @@ ${e}
6369
6369
  children: l
6370
6370
  }
6371
6371
  ), ox = ({ flowId: l }) => {
6372
- const { data: t, isFetching: e } = mk(l);
6373
- return !t || e ? null : /* @__PURE__ */ L(Si, { children: /* @__PURE__ */ L(ne, { className: "mm:justify-between mm:flex-nowrap mm:overflow-hidden mm:select-none", children: /* @__PURE__ */ nt(ne, { className: "mm:flex-1 mm:gap-1 mm:flex-nowrap mm:overflow-hidden", children: [
6372
+ const { data: t } = mk(l);
6373
+ return t ? /* @__PURE__ */ L(Si, { children: /* @__PURE__ */ L(ne, { className: "mm:justify-between mm:flex-nowrap mm:overflow-hidden mm:select-none", children: /* @__PURE__ */ nt(ne, { className: "mm:flex-1 mm:gap-1 mm:flex-nowrap mm:overflow-hidden", children: [
6374
6374
  /* @__PURE__ */ L(ie, { className: "mm:items-center mm:justify-center mm:flex-[0_0_30px]", children: /* @__PURE__ */ L(xi, { className: "mm:size-3 mm:border-1" }) }),
6375
6375
  /* @__PURE__ */ L(Zs, { mode: "wait", children: /* @__PURE__ */ L(EM, { children: t.status || "Starting your report..." }, t.status || "Starting your report...") })
6376
- ] }) }) });
6376
+ ] }) }) }) : null;
6377
6377
  }, OM = ({
6378
6378
  flowId: l,
6379
6379
  explainability: t,
@@ -20571,7 +20571,7 @@ const jR = new Cte({
20571
20571
  })
20572
20572
  }), LV = (t, e) => {
20573
20573
  const n = vV({ baseUrl: t });
20574
- return n.use(U6), n.use(Q6("0.0.57")), n.use(qJ(e)), n;
20574
+ return n.use(U6), n.use(Q6("0.0.58")), n.use(qJ(e)), n;
20575
20575
  }, GR = "mm-ai-sp-token", qC = "mm-ai-check-key";
20576
20576
  class jte extends EventTarget {
20577
20577
  config;
@@ -20869,7 +20869,7 @@ class jte extends EventTarget {
20869
20869
  * Initialize the API client with Supabase headers
20870
20870
  */
20871
20871
  initializeApiClient() {
20872
- this.internalApiClient = vV({ baseUrl: this.config.apiUrl }), this.internalApiClient.use(U6), this.internalApiClient.use(this.createSupabaseHeaderMiddleware()), this.internalApiClient.use(Q6("0.0.57"));
20872
+ this.internalApiClient = vV({ baseUrl: this.config.apiUrl }), this.internalApiClient.use(U6), this.internalApiClient.use(this.createSupabaseHeaderMiddleware()), this.internalApiClient.use(Q6("0.0.58"));
20873
20873
  }
20874
20874
  /**
20875
20875
  * Handle the authentication logic (check session or exchange token)
@@ -39013,7 +39013,7 @@ const Tk = /* @__PURE__ */ new Map(), Nme = (t, e, n, r) => new kO({
39013
39013
  transport: new tW({
39014
39014
  api: `${e}/api/v1/chat/${t}`,
39015
39015
  headers: {
39016
- [L6]: "0.0.57"
39016
+ [L6]: "0.0.58"
39017
39017
  },
39018
39018
  prepareSendMessagesRequest({ messages: i, id: s }) {
39019
39019
  return { body: { message: i.at(-1), id: s } };
@@ -45534,7 +45534,7 @@ const mye = "data:application/octet-stream;base64,UklWRQcAjOdcoAGsAa0BsQHEAeAB4Q
45534
45534
  const [n, r] = ce.useState(""), {
45535
45535
  chat: { sendMessage: i }
45536
45536
  } = rf(t), s = (o) => {
45537
- o.preventDefault(), i({ text: n }), r("");
45537
+ o.preventDefault(), n.trim().length !== 0 && (i({ text: n }), r(""));
45538
45538
  };
45539
45539
  return /* @__PURE__ */ z.jsx("form", { onSubmit: s, className: sr("mm:flex mm:group"), children: /* @__PURE__ */ z.jsx(Cg, { mode: "wait", children: e ? /* @__PURE__ */ z.jsx(
45540
45540
  IN,
@@ -66572,11 +66572,11 @@ const Ma = {
66572
66572
  children: t
66573
66573
  }
66574
66574
  ), $Y = ({ flowId: t }) => {
66575
- const { data: e, isFetching: n } = xAe(t);
66576
- return !e || n ? null : /* @__PURE__ */ z.jsx(Du, { children: /* @__PURE__ */ z.jsx(ui, { className: "mm:justify-between mm:flex-nowrap mm:overflow-hidden mm:select-none", children: /* @__PURE__ */ z.jsxs(ui, { className: "mm:flex-1 mm:gap-1 mm:flex-nowrap mm:overflow-hidden", children: [
66575
+ const { data: e } = xAe(t);
66576
+ return e ? /* @__PURE__ */ z.jsx(Du, { children: /* @__PURE__ */ z.jsx(ui, { className: "mm:justify-between mm:flex-nowrap mm:overflow-hidden mm:select-none", children: /* @__PURE__ */ z.jsxs(ui, { className: "mm:flex-1 mm:gap-1 mm:flex-nowrap mm:overflow-hidden", children: [
66577
66577
  /* @__PURE__ */ z.jsx(Yr, { className: "mm:items-center mm:justify-center mm:flex-[0_0_30px]", children: /* @__PURE__ */ z.jsx(jh, { className: "mm:size-3 mm:border-1" }) }),
66578
66578
  /* @__PURE__ */ z.jsx(Cg, { mode: "wait", children: /* @__PURE__ */ z.jsx(O2e, { children: e.status || "Starting your report..." }, e.status || "Starting your report...") })
66579
- ] }) }) });
66579
+ ] }) }) }) : null;
66580
66580
  }, F2e = ({
66581
66581
  flowId: t,
66582
66582
  explainability: e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magemetrics/ai",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@ai-sdk/react": "2.0.19",