@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.
- package/dist/components/deck/WidgetResizeHandle.js +34 -33
- package/dist/components/file-browser/FileBrowser.js +77 -70
- package/dist/components/file-browser/FileBrowserContext.js +141 -140
- package/dist/components/file-browser/types.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +21 -21
- package/dist/components/layout/MobileTabBar.js +12 -12
- package/dist/components/layout/ResizeHandle.d.ts +2 -0
- package/dist/components/layout/ResizeHandle.js +38 -37
- package/dist/components/layout/Shell.js +164 -140
- package/dist/components/layout/Sidebar.js +8 -8
- package/dist/components/layout/SidebarPane.d.ts +2 -0
- package/dist/components/layout/SidebarPane.js +22 -16
- package/dist/components/ui/CommandPalette.js +47 -46
- package/dist/components/ui/FloatingWindow.d.ts +5 -1
- package/dist/components/ui/FloatingWindow.js +267 -194
- package/dist/components/ui/floatingWindowGeometry.d.ts +41 -0
- package/dist/components/ui/floatingWindowGeometry.js +65 -0
- package/dist/context/FileBrowserDragContext.js +45 -43
- package/dist/context/LayoutContext.d.ts +1 -0
- package/dist/context/LayoutContext.js +20 -19
- package/dist/floe.css +12 -0
- package/dist/hooks/useDeckDrag.js +39 -35
- package/dist/hooks/useFileBrowserDrag.js +74 -81
- package/dist/styles.css +1 -1
- package/dist/utils/hotInteraction.d.ts +9 -0
- package/dist/utils/hotInteraction.js +34 -0
- package/package.json +10 -10
- package/LICENSE +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { insert as a, createComponent as c, effect as k, className as v, template as f, Dynamic as
|
|
2
|
-
import { createSignal as C, onMount as
|
|
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
|
|
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
|
|
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
|
-
}),
|
|
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" ?
|
|
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
|
|
62
|
-
m.onClick ?
|
|
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(
|
|
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 =
|
|
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-
|
|
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
|
-
|
|
112
|
+
F(["click"]);
|
|
113
113
|
export {
|
|
114
114
|
K as MobileTabBar
|
|
115
115
|
};
|
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import { effect as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
var
|
|
6
|
-
function N(
|
|
7
|
-
const [
|
|
8
|
-
let
|
|
9
|
-
const
|
|
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 =
|
|
15
|
-
|
|
16
|
-
"
|
|
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 (!
|
|
20
|
-
|
|
21
|
-
const t =
|
|
22
|
-
t !== 0 && (
|
|
23
|
-
}, h = (t) =>
|
|
24
|
-
t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(),
|
|
25
|
-
},
|
|
26
|
-
if (!(!
|
|
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
|
|
29
|
-
|
|
29
|
+
const i = o - n;
|
|
30
|
+
i !== 0 && (e.onResize(i), n = o);
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
|
|
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 (
|
|
40
|
+
if (s === t.pointerId) {
|
|
40
41
|
try {
|
|
41
|
-
|
|
42
|
+
u?.releasePointerCapture(t.pointerId);
|
|
42
43
|
} catch {
|
|
43
44
|
}
|
|
44
45
|
m();
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
const d = () =>
|
|
48
|
+
H(() => m());
|
|
49
|
+
const d = () => e.direction === "horizontal";
|
|
49
50
|
return (() => {
|
|
50
|
-
var t =
|
|
51
|
-
t.addEventListener("pointercancel", y), t.$$pointerup = y, t.$$pointermove =
|
|
52
|
-
var
|
|
53
|
-
return typeof
|
|
54
|
-
var
|
|
55
|
-
return
|
|
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
|
-
|
|
65
|
+
k(["pointerdown", "pointermove", "pointerup"]);
|
|
65
66
|
export {
|
|
66
67
|
N as ResizeHandle
|
|
67
68
|
};
|