@magemetrics/ai 0.0.39 → 0.0.40
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 +1290 -1281
- package/dist/react/index.d.ts +1 -0
- package/dist/web-component/{browser-6VS_4eco.js → browser-DSh6QxsE.js} +1 -1
- package/dist/web-component/{web-component-Bkvh5GBk.js → web-component-Do6GLPMb.js} +60 -51
- package/dist/web-component/web-component.es.d.ts +1 -0
- package/dist/web-component/web-component.es.js +1 -1
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -15928,7 +15928,7 @@ class She {
|
|
|
15928
15928
|
close: () => {
|
|
15929
15929
|
this.conn = null;
|
|
15930
15930
|
}
|
|
15931
|
-
}), import("./browser-
|
|
15931
|
+
}), import("./browser-DSh6QxsE.js").then((t) => t.b).then(({ default: t }) => {
|
|
15932
15932
|
this.conn = new t(this.endpointURL(), void 0, {
|
|
15933
15933
|
headers: this.headers
|
|
15934
15934
|
}), this.setupConnection();
|
|
@@ -21910,7 +21910,7 @@ const Yme = (e, t) => {
|
|
|
21910
21910
|
loading: !0
|
|
21911
21911
|
}), o = U.useRef(Symbol("initial")), { data: s } = qme(t), { mutateAsync: l, isPending: u } = Gme();
|
|
21912
21912
|
U.useEffect(() => {
|
|
21913
|
-
rme(r, "0.0.
|
|
21913
|
+
rme(r, "0.0.40");
|
|
21914
21914
|
}, [r]), U.useEffect(() => {
|
|
21915
21915
|
if (console.debug("Main Supabase auth effect re-running."), console.debug(
|
|
21916
21916
|
`Effect dependencies: apiInformation=${!!s}, externalJwt='${n}', isExchangingTokens=${u}, processedJwtRef='${String(o.current)}'`
|
|
@@ -34826,26 +34826,27 @@ ${n}`);
|
|
|
34826
34826
|
},
|
|
34827
34827
|
staleTime: 60 * 1e3
|
|
34828
34828
|
}), k1e = () => Pi(U1e()), P1e = ({
|
|
34829
|
-
|
|
34829
|
+
label: e,
|
|
34830
|
+
startFlow: t
|
|
34830
34831
|
}) => {
|
|
34831
|
-
const { data:
|
|
34832
|
+
const { data: n, status: r } = k1e(), i = U.useMemo(() => n == null ? void 0 : n.slice(0, 3), [n]);
|
|
34832
34833
|
return /* @__PURE__ */ I.jsxs("div", { className: "mm:flex mm:flex-col mm:gap-4 mm:flex-1", children: [
|
|
34833
|
-
/* @__PURE__ */ I.jsx(ct, { as: "h2", className: "mm:uppercase mm:font-semibold mm:text-base", children:
|
|
34834
|
+
/* @__PURE__ */ I.jsx(ct, { as: "h2", className: "mm:uppercase mm:font-semibold mm:text-base", children: e }),
|
|
34834
34835
|
/* @__PURE__ */ I.jsx(
|
|
34835
34836
|
"div",
|
|
34836
34837
|
{
|
|
34837
34838
|
className: st(
|
|
34838
34839
|
"mm:flex mm:flex-col mm:md:flex-row mm:items-stretch mm:flex-nowrap mm:gap-1.5"
|
|
34839
34840
|
),
|
|
34840
|
-
children:
|
|
34841
|
+
children: r === "success" ? i == null ? void 0 : i.map((a) => /* @__PURE__ */ I.jsx(
|
|
34841
34842
|
F1e,
|
|
34842
34843
|
{
|
|
34843
|
-
startFlow:
|
|
34844
|
-
starter:
|
|
34845
|
-
explanation:
|
|
34846
|
-
type:
|
|
34844
|
+
startFlow: t,
|
|
34845
|
+
starter: a.starter,
|
|
34846
|
+
explanation: a.explanation,
|
|
34847
|
+
type: a.type
|
|
34847
34848
|
},
|
|
34848
|
-
|
|
34849
|
+
a.starter
|
|
34849
34850
|
)) : /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
|
|
34850
34851
|
/* @__PURE__ */ I.jsx(RE, {}),
|
|
34851
34852
|
/* @__PURE__ */ I.jsx(RE, {}),
|
|
@@ -34879,27 +34880,28 @@ ${n}`);
|
|
|
34879
34880
|
) })
|
|
34880
34881
|
] }), m5 = ({
|
|
34881
34882
|
label: e,
|
|
34882
|
-
|
|
34883
|
-
|
|
34884
|
-
|
|
34885
|
-
|
|
34883
|
+
recommendationsLabel: t,
|
|
34884
|
+
showRecentChats: n,
|
|
34885
|
+
showRecommendations: r,
|
|
34886
|
+
showBackdrop: i,
|
|
34887
|
+
onClose: a
|
|
34886
34888
|
}) => {
|
|
34887
|
-
const [
|
|
34888
|
-
onSuccess: (
|
|
34889
|
-
|
|
34890
|
-
}
|
|
34891
|
-
}),
|
|
34892
|
-
|
|
34893
|
-
}),
|
|
34894
|
-
|
|
34895
|
-
},
|
|
34896
|
-
() =>
|
|
34897
|
-
[
|
|
34898
|
-
),
|
|
34889
|
+
const [o, s] = U.useState(""), [l, u] = U.useState(!1), A = U.useRef(null), f = Oh(rA), { mutate: h } = Jge({
|
|
34890
|
+
onSuccess: (x) => {
|
|
34891
|
+
f(x.flowId);
|
|
34892
|
+
}
|
|
34893
|
+
}), p = Yve(() => {
|
|
34894
|
+
u(!1), a == null || a();
|
|
34895
|
+
}), v = (x) => {
|
|
34896
|
+
h(x.trim());
|
|
34897
|
+
}, g = U.useMemo(
|
|
34898
|
+
() => o.length > 30 || /[\r\n]/.test(o) ? o.slice(0, 30).replace(/[\r\n]/g, " ") + "…" : o,
|
|
34899
|
+
[o]
|
|
34900
|
+
), w = l && r, b = l && n, B = l && i;
|
|
34899
34901
|
return U.useEffect(() => {
|
|
34900
|
-
|
|
34901
|
-
}, [
|
|
34902
|
-
|
|
34902
|
+
A.current && (A.current.style.height = "auto", l ? A.current.style.height = `${A.current.scrollHeight}px` : A.current.style.height = "2.25rem");
|
|
34903
|
+
}, [o, l]), /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
|
|
34904
|
+
B && /* @__PURE__ */ I.jsx(
|
|
34903
34905
|
no.div,
|
|
34904
34906
|
{
|
|
34905
34907
|
variants: R$,
|
|
@@ -34922,9 +34924,9 @@ ${n}`);
|
|
|
34922
34924
|
"div",
|
|
34923
34925
|
{
|
|
34924
34926
|
className: "mm:flex mm:flex-col mm:pb-4 mm:flex-1 mm:gap-3",
|
|
34925
|
-
ref:
|
|
34927
|
+
ref: p,
|
|
34926
34928
|
children: [
|
|
34927
|
-
|
|
34929
|
+
w && /* @__PURE__ */ I.jsx(ia, { asChild: !0, children: /* @__PURE__ */ I.jsx(
|
|
34928
34930
|
no.div,
|
|
34929
34931
|
{
|
|
34930
34932
|
initial: { opacity: 0 },
|
|
@@ -34936,14 +34938,20 @@ ${n}`);
|
|
|
34936
34938
|
},
|
|
34937
34939
|
style: { overflow: "hidden", originY: 1 },
|
|
34938
34940
|
className: "mm:border-none",
|
|
34939
|
-
children: /* @__PURE__ */ I.jsx(
|
|
34941
|
+
children: /* @__PURE__ */ I.jsx(
|
|
34942
|
+
P1e,
|
|
34943
|
+
{
|
|
34944
|
+
label: t,
|
|
34945
|
+
startFlow: v
|
|
34946
|
+
}
|
|
34947
|
+
)
|
|
34940
34948
|
}
|
|
34941
34949
|
) }),
|
|
34942
34950
|
/* @__PURE__ */ I.jsx(ia, { className: "mm:relative mm:z-1", children: /* @__PURE__ */ I.jsxs(
|
|
34943
34951
|
_u,
|
|
34944
34952
|
{
|
|
34945
|
-
direction:
|
|
34946
|
-
className:
|
|
34953
|
+
direction: l ? "column" : "row",
|
|
34954
|
+
className: l ? "mm:gap-2" : "mm:gap-4",
|
|
34947
34955
|
children: [
|
|
34948
34956
|
/* @__PURE__ */ I.jsxs(Yt, { className: "mm:justify-between mm:items-center", children: [
|
|
34949
34957
|
/* @__PURE__ */ I.jsx(
|
|
@@ -34955,18 +34963,18 @@ ${n}`);
|
|
|
34955
34963
|
children: e
|
|
34956
34964
|
}
|
|
34957
34965
|
),
|
|
34958
|
-
|
|
34966
|
+
b && /* @__PURE__ */ I.jsx(O1e, {})
|
|
34959
34967
|
] }),
|
|
34960
34968
|
/* @__PURE__ */ I.jsx(
|
|
34961
34969
|
"form",
|
|
34962
34970
|
{
|
|
34963
|
-
onSubmit: (
|
|
34964
|
-
|
|
34971
|
+
onSubmit: (x) => {
|
|
34972
|
+
x.preventDefault(), o.length > 0 && v(o);
|
|
34965
34973
|
},
|
|
34966
34974
|
className: st(
|
|
34967
34975
|
"mm:p-[1px] mm:rounded-[4px] mm:w-full",
|
|
34968
|
-
!
|
|
34969
|
-
|
|
34976
|
+
!l && "mm:bg-muted",
|
|
34977
|
+
l && "mm-highlight-gradient mm:shadow-secondary/20"
|
|
34970
34978
|
),
|
|
34971
34979
|
children: /* @__PURE__ */ I.jsxs(_u, { className: "mm:bg-background mm:rounded-[3px] mm:flex-grow", children: [
|
|
34972
34980
|
/* @__PURE__ */ I.jsx(
|
|
@@ -34974,18 +34982,18 @@ ${n}`);
|
|
|
34974
34982
|
{
|
|
34975
34983
|
className: st(
|
|
34976
34984
|
"mm:leading-6 mm:w-full mm:resize-none mm:box-border mm:border-none mm:rounded-[3px] mm:outline-none mm:duration-200 mm:ease-in-out mm:max-h-[500px] mm:px-2 mm:py-1.5 mm:font-serif",
|
|
34977
|
-
!
|
|
34985
|
+
!l && "mm:overflow-hidden"
|
|
34978
34986
|
),
|
|
34979
|
-
ref:
|
|
34980
|
-
onChange: (
|
|
34981
|
-
|
|
34987
|
+
ref: A,
|
|
34988
|
+
onChange: (x) => {
|
|
34989
|
+
s(x.target.value);
|
|
34982
34990
|
},
|
|
34983
|
-
value:
|
|
34991
|
+
value: l ? o : g,
|
|
34984
34992
|
onFocus: () => {
|
|
34985
|
-
|
|
34993
|
+
u(!0);
|
|
34986
34994
|
},
|
|
34987
|
-
onKeyDown: (
|
|
34988
|
-
|
|
34995
|
+
onKeyDown: (x) => {
|
|
34996
|
+
x.key === "Enter" && !x.shiftKey && (x.preventDefault(), v(o));
|
|
34989
34997
|
}
|
|
34990
34998
|
}
|
|
34991
34999
|
),
|
|
@@ -34994,13 +35002,13 @@ ${n}`);
|
|
|
34994
35002
|
{
|
|
34995
35003
|
variant: "icon",
|
|
34996
35004
|
type: "submit",
|
|
34997
|
-
className: st(!
|
|
35005
|
+
className: st(!l && "mm:self-center"),
|
|
34998
35006
|
children: /* @__PURE__ */ I.jsx(
|
|
34999
35007
|
fee,
|
|
35000
35008
|
{
|
|
35001
35009
|
size: 18,
|
|
35002
35010
|
className: st(
|
|
35003
|
-
|
|
35011
|
+
o.length > 0 && "mm:fill-secondary"
|
|
35004
35012
|
)
|
|
35005
35013
|
}
|
|
35006
35014
|
)
|
|
@@ -83366,13 +83374,14 @@ const ort = ({
|
|
|
83366
83374
|
onClose: e,
|
|
83367
83375
|
startOptions: t
|
|
83368
83376
|
}) => {
|
|
83369
|
-
const n = pg(rA), r = pg(Em), a = !!n && r === "conversation", o = (t == null ? void 0 : t.showRecentChats) ?? !1, s = (t == null ? void 0 : t.showRecommendations) ?? !1, l = (t == null ? void 0 : t.showBackdrop) ?? !1, u = (t == null ? void 0 : t.label) || "Ask your data about";
|
|
83377
|
+
const n = pg(rA), r = pg(Em), a = !!n && r === "conversation", o = (t == null ? void 0 : t.showRecentChats) ?? !1, s = (t == null ? void 0 : t.showRecommendations) ?? !1, l = (t == null ? void 0 : t.showBackdrop) ?? !1, u = (t == null ? void 0 : t.label) || "Ask your data about", A = (t == null ? void 0 : t.recommendationsLabel) || "Recommendations based on your data";
|
|
83370
83378
|
return /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
|
|
83371
83379
|
/* @__PURE__ */ I.jsx(Q1e, { children: /* @__PURE__ */ I.jsx(Drt, { opened: a }) }),
|
|
83372
83380
|
!a && /* @__PURE__ */ I.jsx(
|
|
83373
83381
|
D1e,
|
|
83374
83382
|
{
|
|
83375
83383
|
label: u,
|
|
83384
|
+
recommendationsLabel: A,
|
|
83376
83385
|
showRecentChats: o,
|
|
83377
83386
|
showRecommendations: s,
|
|
83378
83387
|
showBackdrop: l,
|