@floegence/floe-webapp-core 0.35.13 → 0.35.14

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.
@@ -1,7 +1,7 @@
1
- import { insert as a, createComponent as c, effect as k, className as v, template as f, Dynamic as I, memo as L, setAttribute as w, use as F, delegateEvents as W } from "solid-js/web";
2
- import { createSignal as C, onMount as M, onCleanup as R, Show as x, For as j } from "solid-js";
1
+ import { insert as a, createComponent as c, effect as k, className as v, template as f, Dynamic as _, memo as I, setAttribute as w, use as L, delegateEvents as F } from "solid-js/web";
2
+ import { createSignal as C, onMount as W, onCleanup as M, Show as x, For as R } from "solid-js";
3
3
  import { cn as b } from "../../utils/cn.js";
4
- import { deferNonBlocking as $ } from "../../utils/defer.js";
4
+ import { deferNonBlocking as j } from "../../utils/defer.js";
5
5
  var q = /* @__PURE__ */ f('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), z = /* @__PURE__ */ f('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ f('<nav data-floe-shell-slot=mobile-tab-bar style=border-top-color:var(--bottom-bar-border)><div class="relative h-14"><div class="h-full flex items-center overflow-x-auto scrollbar-hide snap-x snap-mandatory"style=-webkit-overflow-scrolling:touch>'), E = /* @__PURE__ */ f("<span>"), N = /* @__PURE__ */ f('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), T = /* @__PURE__ */ f("<button type=button role=tab><div></div><span>");
6
6
  function K(e) {
7
7
  let n;
@@ -20,14 +20,14 @@ function K(e) {
20
20
  });
21
21
  }
22
22
  };
23
- return M(() => {
23
+ return W(() => {
24
24
  d();
25
25
  const o = e.items.findIndex((l) => l.id === e.activeId);
26
26
  if (o > 0 && n) {
27
27
  const l = n.scrollWidth / e.items.length;
28
28
  n.scrollLeft = Math.max(0, l * o - n.clientWidth / 2 + l / 2);
29
29
  }
30
- }), R(() => {
30
+ }), M(() => {
31
31
  r !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(r), r = null);
32
32
  }), (() => {
33
33
  var o = B(), l = o.firstChild, u = l.firstChild;
@@ -47,7 +47,7 @@ function K(e) {
47
47
  }
48
48
  }), u), u.addEventListener("scroll", h);
49
49
  var y = n;
50
- return typeof y == "function" ? F(y, u) : n = u, a(u, c(j, {
50
+ return typeof y == "function" ? L(y, u) : n = u, a(u, c(R, {
51
51
  get each() {
52
52
  return e.items;
53
53
  },
@@ -58,8 +58,8 @@ function K(e) {
58
58
  },
59
59
  onClick: () => {
60
60
  "vibrate" in navigator && navigator.vibrate(10);
61
- const A = m.onClick, S = e.onSelect, _ = m.id;
62
- m.onClick ? $(() => A()) : $(() => S(_));
61
+ const $ = m.onClick, A = e.onSelect, S = m.id;
62
+ m.onClick ? j(() => $()) : A(S);
63
63
  }
64
64
  })
65
65
  })), k(() => v(o, b(
@@ -74,7 +74,7 @@ function D(e) {
74
74
  const n = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
75
75
  return (() => {
76
76
  var i = T(), s = i.firstChild, g = s.nextSibling;
77
- return i.$$click = () => e.onClick(), a(s, c(I, {
77
+ return i.$$click = () => e.onClick(), a(s, c(_, {
78
78
  get component() {
79
79
  return e.item.icon;
80
80
  },
@@ -86,7 +86,7 @@ function D(e) {
86
86
  get children() {
87
87
  var t = E();
88
88
  return a(t, (() => {
89
- var r = L(() => typeof n() == "number" && n() > 99);
89
+ var r = I(() => typeof n() == "number" && n() > 99);
90
90
  return () => r() ? "99+" : n();
91
91
  })()), k(() => v(t, b("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-[10px] font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
92
92
  }
@@ -98,7 +98,7 @@ function D(e) {
98
98
  return N();
99
99
  }
100
100
  }), null), k((t) => {
101
- var r = b("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-all duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), d = e.item.label, h = e.isActive, o = b("relative transition-transform duration-150", e.isActive && "scale-110"), l = b("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
101
+ var r = b("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color] duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), d = e.item.label, h = e.isActive, o = b("relative transition-transform duration-150", e.isActive && "scale-110"), l = b("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
102
102
  return r !== t.e && v(i, t.e = r), d !== t.t && w(i, "aria-label", t.t = d), h !== t.a && w(i, "aria-selected", t.a = h), o !== t.o && v(s, t.o = o), l !== t.i && v(g, t.i = l), t;
103
103
  }, {
104
104
  e: void 0,
@@ -109,7 +109,7 @@ function D(e) {
109
109
  }), i;
110
110
  })();
111
111
  }
112
- W(["click"]);
112
+ F(["click"]);
113
113
  export {
114
114
  K as MobileTabBar
115
115
  };
@@ -1,6 +1,8 @@
1
1
  export interface ResizeHandleProps {
2
2
  direction: 'horizontal' | 'vertical';
3
3
  onResize: (delta: number) => void;
4
+ onResizeStart?: () => void;
5
+ onResizeEnd?: () => void;
4
6
  class?: string;
5
7
  }
6
8
  /**
@@ -1,58 +1,59 @@
1
- import { effect as A, className as f, setAttribute as C, template as R, use as F, delegateEvents as S } from "solid-js/web";
2
- import { createSignal as k, onCleanup as q } from "solid-js";
3
- import { cn as p } from "../../utils/cn.js";
4
- import { lockBodyStyle as B } from "../../utils/bodyStyleLock.js";
5
- var E = /* @__PURE__ */ R("<div role=separator style=touch-action:none><div></div><div>");
6
- function N(i) {
7
- const [l, v] = k(!1);
8
- let o = 0, r = 0, u = null, s, a = null, c = null;
9
- const g = (t) => {
1
+ import { effect as D, className as f, setAttribute as A, template as C, use as S, delegateEvents as k } from "solid-js/web";
2
+ import { createSignal as F, onCleanup as H } from "solid-js";
3
+ import { cn as g } from "../../utils/cn.js";
4
+ import { startHotInteraction as E } from "../../utils/hotInteraction.js";
5
+ var q = /* @__PURE__ */ C("<div role=separator style=touch-action:none><div></div><div>");
6
+ function N(e) {
7
+ const [a, p] = F(!1);
8
+ let n = 0, o = 0, s = null, u, l = null, c = null;
9
+ const v = (t) => {
10
10
  if (!t) {
11
11
  c?.(), c = null;
12
12
  return;
13
13
  }
14
- c?.(), c = B({
15
- cursor: i.direction === "horizontal" ? "col-resize" : "row-resize",
16
- "user-select": "none"
14
+ c?.(), c = E({
15
+ kind: "resize",
16
+ cursor: e.direction === "horizontal" ? "col-resize" : "row-resize",
17
+ lockUserSelect: !0
17
18
  });
18
19
  }, m = () => {
19
- if (!l()) return;
20
- a !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(a), a = null);
21
- const t = r - o;
22
- t !== 0 && (i.onResize(t), o = r), v(!1), u = null, g(!1);
23
- }, h = (t) => i.direction === "horizontal" ? t.clientX : t.clientY, x = (t) => {
24
- t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), u = t.pointerId, v(!0), o = h(t), r = o, g(!0), s?.setPointerCapture(t.pointerId));
25
- }, $ = (t) => {
26
- if (!(!l() || u !== t.pointerId) && (r = h(t), a === null)) {
20
+ if (!a()) return;
21
+ l !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(l), l = null);
22
+ const t = o - n;
23
+ t !== 0 && (e.onResize(t), n = o), p(!1), s = null, v(!1), e.onResizeEnd?.();
24
+ }, h = (t) => e.direction === "horizontal" ? t.clientX : t.clientY, x = (t) => {
25
+ t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), s = t.pointerId, p(!0), n = h(t), o = n, v(!0), e.onResizeStart?.(), u?.setPointerCapture(t.pointerId));
26
+ }, R = (t) => {
27
+ if (!(!a() || s !== t.pointerId) && (o = h(t), l === null)) {
27
28
  if (typeof requestAnimationFrame > "u") {
28
- const n = r - o;
29
- n !== 0 && (i.onResize(n), o = r);
29
+ const i = o - n;
30
+ i !== 0 && (e.onResize(i), n = o);
30
31
  return;
31
32
  }
32
- a = requestAnimationFrame(() => {
33
- if (a = null, !l()) return;
34
- const n = r - o;
35
- n !== 0 && (i.onResize(n), o = r);
33
+ l = requestAnimationFrame(() => {
34
+ if (l = null, !a()) return;
35
+ const i = o - n;
36
+ i !== 0 && (e.onResize(i), n = o);
36
37
  });
37
38
  }
38
39
  }, y = (t) => {
39
- if (u === t.pointerId) {
40
+ if (s === t.pointerId) {
40
41
  try {
41
- s?.releasePointerCapture(t.pointerId);
42
+ u?.releasePointerCapture(t.pointerId);
42
43
  } catch {
43
44
  }
44
45
  m();
45
46
  }
46
47
  };
47
- q(() => m());
48
- const d = () => i.direction === "horizontal";
48
+ H(() => m());
49
+ const d = () => e.direction === "horizontal";
49
50
  return (() => {
50
- var t = E(), n = t.firstChild, D = n.nextSibling;
51
- t.addEventListener("pointercancel", y), t.$$pointerup = y, t.$$pointermove = $, t.$$pointerdown = x;
52
- var b = s;
53
- return typeof b == "function" ? F(b, t) : s = t, A((e) => {
54
- var z = p("absolute z-20 group", d() ? "top-0 right-0 w-1 h-full cursor-col-resize hover:w-1.5" : "left-0 top-0 h-1 w-full cursor-row-resize hover:h-1.5", "transition-all duration-100", l() && "bg-primary", !l() && "hover:bg-primary/50", i.class), w = d() ? "vertical" : "horizontal", P = p("absolute pointer-events-none", d() ? "top-0 bottom-0 left-1/2 w-px -translate-x-1/2" : "left-0 right-0 top-1/2 h-px -translate-y-1/2", l() && "bg-primary opacity-100", !l() && "bg-primary/50 opacity-0 group-hover:opacity-100"), I = p("absolute opacity-0 group-hover:opacity-100 transition-opacity duration-150", d() ? "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-0.5 h-8 rounded-full bg-muted-foreground/30" : "left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 h-0.5 w-8 rounded-full bg-muted-foreground/30");
55
- return z !== e.e && f(t, e.e = z), w !== e.t && C(t, "aria-orientation", e.t = w), P !== e.a && f(n, e.a = P), I !== e.o && f(D, e.o = I), e;
51
+ var t = q(), i = t.firstChild, $ = i.nextSibling;
52
+ t.addEventListener("pointercancel", y), t.$$pointerup = y, t.$$pointermove = R, t.$$pointerdown = x;
53
+ var z = u;
54
+ return typeof z == "function" ? S(z, t) : u = t, D((r) => {
55
+ var b = g("absolute z-20 group", d() ? "top-0 right-0 w-1 h-full cursor-col-resize hover:w-1.5 transition-[background-color,width] duration-100" : "left-0 top-0 h-1 w-full cursor-row-resize hover:h-1.5 transition-[background-color,height] duration-100", a() && "bg-primary", !a() && "hover:bg-primary/50", e.class), w = d() ? "vertical" : "horizontal", I = g("absolute pointer-events-none", d() ? "top-0 bottom-0 left-1/2 w-px -translate-x-1/2" : "left-0 right-0 top-1/2 h-px -translate-y-1/2", a() && "bg-primary opacity-100", !a() && "bg-primary/50 opacity-0 group-hover:opacity-100"), P = g("absolute opacity-0 group-hover:opacity-100 transition-opacity duration-150", d() ? "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-0.5 h-8 rounded-full bg-muted-foreground/30" : "left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 h-0.5 w-8 rounded-full bg-muted-foreground/30");
56
+ return b !== r.e && f(t, r.e = b), w !== r.t && A(t, "aria-orientation", r.t = w), I !== r.a && f(i, r.a = I), P !== r.o && f($, r.o = P), r;
56
57
  }, {
57
58
  e: void 0,
58
59
  t: void 0,
@@ -61,7 +62,7 @@ function N(i) {
61
62
  }), t;
62
63
  })();
63
64
  }
64
- S(["pointerdown", "pointermove", "pointerup"]);
65
+ k(["pointerdown", "pointermove", "pointerup"]);
65
66
  export {
66
67
  N as ResizeHandle
67
68
  };