@lettuceai/crisp 1.6.1 → 1.6.2

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/index.js CHANGED
@@ -3410,12 +3410,16 @@ function Cr({ elapsedMs: e, analyser: t, level: n, frozen: r = !1 }) {
3410
3410
  //#endregion
3411
3411
  //#region src/lib/useModal.ts
3412
3412
  function wr(e, t, n, { lockScroll: r = !0 } = {}) {
3413
- ln(e, t), l(() => {
3413
+ ln(e, t);
3414
+ let i = p(t);
3415
+ d(() => {
3416
+ i.current = t;
3417
+ }), l(() => {
3414
3418
  if (!e) return;
3415
- let i = document.activeElement, a = document.body.style.overflow;
3419
+ let t = document.activeElement, a = document.body.style.overflow;
3416
3420
  r && (document.body.style.overflow = "hidden");
3417
3421
  let o = (e) => {
3418
- if (e.key === "Escape" && t(), e.key === "Tab" && n.current) {
3422
+ if (e.key === "Escape" && i.current(), e.key === "Tab" && n.current) {
3419
3423
  let t = Array.from(n.current.querySelectorAll("input, textarea, select, [data-autofocus], a[href], button:not([data-modal-chrome]), [data-modal-chrome]")).filter((e) => !e.hasAttribute("disabled"));
3420
3424
  if (t.length === 0) return;
3421
3425
  let r = t[0], i = t[t.length - 1];
@@ -3428,11 +3432,10 @@ function wr(e, t, n, { lockScroll: r = !0 } = {}) {
3428
3432
  (e?.querySelector("[data-autofocus]") ?? e)?.focus({ preventScroll: !0 });
3429
3433
  });
3430
3434
  return () => {
3431
- cancelAnimationFrame(s), document.removeEventListener("keydown", o), r && (document.body.style.overflow = a), i?.focus?.({ preventScroll: !0 });
3435
+ cancelAnimationFrame(s), document.removeEventListener("keydown", o), r && (document.body.style.overflow = a), t?.focus?.({ preventScroll: !0 });
3432
3436
  };
3433
3437
  }, [
3434
3438
  e,
3435
- t,
3436
3439
  n,
3437
3440
  r
3438
3441
  ]);
@@ -3467,7 +3470,7 @@ function jr({ open: e, onClose: t, title: n, description: r, leftAction: i, righ
3467
3470
  wr(e, ae, ee, { lockScroll: !re }), l(() => {
3468
3471
  e && F(S);
3469
3472
  }, [e, S]);
3470
- let oe = h === "auto" ? te ? "bottom" : "side" : h, I = oe === "bottom", L = b?.length ? b : null, se = L ? `${Math.round(L[Math.min(P, L.length - 1)] * 100)}${ie}` : void 0, ce = x(0), le = p(0), ue = p(null), de = p(!1), R = p(null), [fe, pe] = m(!1), me = w(ce, (e) => Math.max(0, e)), he = w(ce, (e) => {
3473
+ let oe = h === "auto" ? te ? "bottom" : "side" : h, I = oe === "bottom", L = b?.length ? b : null, se = L ? `calc(${Math.round(L[Math.min(P, L.length - 1)] * 100)}${ie} - var(--safe-top, 0px))` : void 0, ce = x(0), le = p(0), ue = p(null), de = p(!1), R = p(null), [fe, pe] = m(!1), me = w(ce, (e) => Math.max(0, e)), he = w(ce, (e) => {
3471
3474
  let t = le.current;
3472
3475
  return t ? 1 - Math.min(1, Math.max(0, e / t)) : 0;
3473
3476
  }), ge = (e, t, n = 0) => (ue.current?.stop(), ue.current = v(ce, e, N ? { duration: 0 } : {
@@ -3649,7 +3652,7 @@ function jr({ open: e, onClose: t, title: n, description: r, leftAction: i, righ
3649
3652
  transition: W.instant
3650
3653
  },
3651
3654
  transition: e ? W.sheetIn : W.settle,
3652
- className: U(we, e ? U("fixed inset-y-0 right-0 z-50 w-full border-l shadow-sheet pb-[var(--safe-bottom)]", Tr[_]) : U("relative z-50 w-full rounded-2xl border shadow-raised", re ? "max-h-[85%]" : "max-h-[85dvh]", Er[_]), T),
3655
+ className: U(we, e ? U("fixed inset-y-0 right-0 z-50 w-full border-l shadow-sheet pt-[var(--safe-top)] pb-[var(--safe-bottom)]", Tr[_]) : U("relative z-50 w-full rounded-2xl border shadow-raised", re ? "max-h-[85%]" : "max-h-[85dvh]", Er[_]), T),
3653
3656
  children: [
3654
3657
  Te,
3655
3658
  Ee,
@@ -7423,7 +7426,7 @@ function uo({ position: e = "bottom-center", bottomInset: t = 0 } = {}) {
7423
7426
  expand: !0,
7424
7427
  offset: {
7425
7428
  bottom: `calc(env(safe-area-inset-bottom) + ${16 + t}px)`,
7426
- top: 16,
7429
+ top: "calc(env(safe-area-inset-top) + 16px)",
7427
7430
  left: 16,
7428
7431
  right: 16
7429
7432
  },