@lettuceai/crisp 1.6.1 → 1.6.3
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/components/AppBar.d.ts +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export interface AppBarProps {
|
|
|
17
17
|
* defaults to the window.
|
|
18
18
|
*/
|
|
19
19
|
scrollRef?: React.RefObject<HTMLElement | null>;
|
|
20
|
-
/**
|
|
20
|
+
/** Leave room for the status bar above (the top safe area, zero on the desktop). Default on. */
|
|
21
21
|
inset?: boolean;
|
|
22
22
|
className?: string;
|
|
23
23
|
}
|
package/dist/index.js
CHANGED
|
@@ -627,7 +627,7 @@ var wt = a(function({ className: e, id: t, rows: n = 4, autoGrow: r, maxRows: i
|
|
|
627
627
|
wt.displayName = "Textarea";
|
|
628
628
|
//#endregion
|
|
629
629
|
//#region src/components/AppBar.tsx
|
|
630
|
-
function Tt({ title: e, meta: t, onBack: n, backLabel: r, searchValue: i, onSearchChange: a, searchPlaceholder: o, actions: s, filters: c, scrollRef: u, inset: d, className: f }) {
|
|
630
|
+
function Tt({ title: e, meta: t, onBack: n, backLabel: r, searchValue: i, onSearchChange: a, searchPlaceholder: o, actions: s, filters: c, scrollRef: u, inset: d = !0, className: f }) {
|
|
631
631
|
let { strings: h } = G(), [g, _] = m(!1), [v, y] = m(!1), b = p(null);
|
|
632
632
|
l(() => {
|
|
633
633
|
let e = u?.current ?? window, t = () => u?.current ? u.current.scrollTop : window.scrollY, n = () => _(t() > 12);
|
|
@@ -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)
|
|
3413
|
+
ln(e, t);
|
|
3414
|
+
let i = p(t);
|
|
3415
|
+
d(() => {
|
|
3416
|
+
i.current = t;
|
|
3417
|
+
}), l(() => {
|
|
3414
3418
|
if (!e) return;
|
|
3415
|
-
let
|
|
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" &&
|
|
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),
|
|
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 ?
|
|
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:
|
|
7429
|
+
top: "calc(env(safe-area-inset-top) + 16px)",
|
|
7427
7430
|
left: 16,
|
|
7428
7431
|
right: 16
|
|
7429
7432
|
},
|