@levo-so/studio 0.3.8 → 0.3.10

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.
@@ -38,16 +38,18 @@ var l = Object.defineProperty, u = (e, t) => {
38
38
  defaultVariants: { size: "medium" },
39
39
  compoundVariants: []
40
40
  }), h = "_1gklkndn", g = a(null), _ = (e) => {
41
- let t = i(6), { popup: n, callbacks: r, children: a } = e, o;
42
- t[0] !== r || t[1] !== n ? (o = {
41
+ let t = i(8), { popup: n, callbacks: r, client: a, preview: o, children: c } = e, l;
42
+ t[0] !== r || t[1] !== a || t[2] !== n || t[3] !== o ? (l = {
43
43
  popup: n,
44
- callbacks: r
45
- }, t[0] = r, t[1] = n, t[2] = o) : o = t[2];
46
- let c;
47
- return t[3] !== a || t[4] !== o ? (c = /* @__PURE__ */ s(g.Provider, {
48
- value: o,
49
- children: a
50
- }), t[3] = a, t[4] = o, t[5] = c) : c = t[5], c;
44
+ callbacks: r,
45
+ client: a,
46
+ preview: o
47
+ }, t[0] = r, t[1] = a, t[2] = n, t[3] = o, t[4] = l) : l = t[4];
48
+ let u;
49
+ return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ s(g.Provider, {
50
+ value: l,
51
+ children: c
52
+ }), t[5] = c, t[6] = l, t[7] = u) : u = t[7], u;
51
53
  }, v = () => {
52
54
  let e = o(g);
53
55
  if (!e) throw Error("usePopupContext must be used within a PopupProvider");
@@ -67,14 +69,14 @@ var l = Object.defineProperty, u = (e, t) => {
67
69
  }, x = "zv6sjd1", S = "zv6sjd2 zv6sjd1", C = "zv6sjd3", w = "zv6sjd8", T = "zv6sjd9", E = "zv6sjda", D = (e) => {
68
70
  let t = i(6), n = y(), r = n?.callbacks?.onAction, a = b(), { action: o } = e.content, s;
69
71
  t[0] !== o || t[1] !== a || t[2] !== n || t[3] !== r || t[4] !== e ? (s = () => {
70
- o?.type === "redirect" && n && (r?.(e, {
72
+ o?.type === "redirect" && (!n || n.preview || (r?.(e, {
71
73
  action_type: "redirect",
72
74
  redirect_url: o.url,
73
75
  open_in_new_tab: !!o.openInNewTab
74
- }), a("cta_click"), o.openInNewTab ? window.open(o.url, "_blank", "noopener,noreferrer") : window.location.href = o.url);
76
+ }), a("cta_click"), o.openInNewTab ? window.open(o.url, "_blank", "noopener,noreferrer") : window.location.href = o.url));
75
77
  }, t[0] = o, t[1] = a, t[2] = n, t[3] = r, t[4] = e, t[5] = s) : s = t[5];
76
78
  let c = s;
77
79
  return o?.type === "redirect" && o.url ? c : null;
78
80
  };
79
81
  //#endregion
80
- export { u as _, y as a, p as c, m as d, f, D as g, v as h, E as i, w as l, x as m, C as n, S as o, h as p, T as r, _ as s, b as t, d as u };
82
+ export { S as a, w as c, f as d, h as f, u as g, D as h, E as i, d as l, v as m, C as n, _ as o, x as p, T as r, p as s, b as t, m as u };
@@ -1,30 +0,0 @@
1
- //#region ../../libraries/ai-chat/src/helpers.ts
2
- var e = (e, t = {
3
- hour: "numeric",
4
- minute: "2-digit"
5
- }) => {
6
- if (!e) return "";
7
- let n = e instanceof Date ? e : new Date(e);
8
- return Number.isNaN(n.getTime()) ? "" : n.toLocaleTimeString([], t);
9
- }, t = (e, t) => t ? `levo.site_chat.${e}.${t}` : null, n = (e, t) => {
10
- e.style.height = "auto", e.style.height = t === void 0 ? `${e.scrollHeight}px` : `${Math.min(e.scrollHeight, t)}px`;
11
- }, r = (e, t) => {
12
- e.setText(t);
13
- let n = document.activeElement?.closest("[data-ai-chat-root]") ?? document;
14
- requestAnimationFrame(() => {
15
- let e = n.querySelector("textarea[data-ai-chat-composer]");
16
- if (!e) return;
17
- e.focus();
18
- let t = e.value.length;
19
- e.setSelectionRange(t, t);
20
- });
21
- }, i = "w-72", a = "ai-chat-pill-gradient relative rounded-[30px] p-[2px] transition-shadow duration-300", o = "shadow-lg shadow-zinc-950/10", s = "shadow-md", c = "ai-chat-pill-surface min-h-14 w-full rounded-[28px] bg-white p-1.5", l = "ai-chat-pill-surface--stacked", u = "ai-chat-pill-input relative min-w-0", d = "ai-chat-pill-actions flex items-center gap-1.5", f = "ai-chat-pill-spark flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full text-blue-500 transition-[background-color,transform] duration-150 hover:bg-zinc-50 active:scale-95", p = "flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-[transform,box-shadow] duration-150 hover:scale-105 hover:shadow-md active:scale-95", m = "block h-6 max-h-[120px] w-full resize-none overflow-y-auto bg-transparent text-base text-zinc-900 leading-6 placeholder:text-zinc-400 focus:outline-none", h = 24, g = (e, t) => {
22
- e.classList.remove(l), t.style.height = "auto";
23
- let r = t.scrollHeight > h + 4;
24
- return e.classList.toggle(l, r), n(t, 120), r;
25
- }, _ = "ai-chat-pill-label pointer-events-none absolute inset-y-0 left-0 flex max-w-full items-center truncate bg-clip-text font-semibold text-[15px] text-transparent", v = {
26
- backgroundColor: "var(--color-brand, #0a0a0a)",
27
- color: "var(--color-brand-foreground, #fff)"
28
- }, y = (e) => e ? `Ask ${e}` : "Ask AI";
29
- //#endregion
30
- export { r as _, p as a, o as c, l as d, m as f, n as g, y as h, _ as i, f as l, g as m, a as n, v as o, i as p, u as r, s, d as t, c as u, e as v, t as y };