@floegence/floe-webapp-core 0.71.0 → 0.73.0
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/layout/AppViewport.d.ts +9 -0
- package/dist/components/layout/AppViewport.js +31 -0
- package/dist/components/layout/BottomBarCompanion.js +168 -154
- package/dist/components/layout/MobileTabBar.d.ts +1 -0
- package/dist/components/layout/MobileTabBar.js +42 -41
- package/dist/components/layout/Shell.d.ts +6 -0
- package/dist/components/layout/Shell.js +158 -141
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/ui/Dialog.d.ts +2 -2
- package/dist/components/ui/Dialog.js +135 -115
- package/dist/components/ui/FloatingWindow.js +195 -188
- package/dist/components/ui/SurfaceFloatingLayer.js +35 -26
- package/dist/components/ui/floatingWindowGeometry.d.ts +12 -3
- package/dist/components/ui/floatingWindowGeometry.js +37 -37
- package/dist/components/ui/surfaceFloatingBoundary.js +31 -40
- package/dist/floe.css +30 -10
- package/dist/full.js +598 -596
- package/dist/layout.js +36 -34
- package/dist/styles.css +1 -1
- package/dist/viewport.d.ts +54 -0
- package/dist/viewport.js +90 -0
- package/package.json +5 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { insert as c, createComponent as d, effect as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { insert as c, createComponent as d, effect as $, className as v, setAttribute as A, template as b, Dynamic as W, memo as M, use as R, delegateEvents as z } from "solid-js/web";
|
|
2
|
+
import { createSignal as L, onMount as D, onCleanup as E, Show as S, For as j } from "solid-js";
|
|
3
3
|
import { cn as g } from "../../utils/cn.js";
|
|
4
|
-
import { deferNonBlocking as
|
|
4
|
+
import { deferNonBlocking as _ } from "../../utils/defer.js";
|
|
5
5
|
var q = /* @__PURE__ */ b('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ b('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), K = /* @__PURE__ */ b('<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"role=tablist aria-orientation=horizontal style=-webkit-overflow-scrolling:touch>'), N = /* @__PURE__ */ b("<span>"), T = /* @__PURE__ */ b('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), H = /* @__PURE__ */ b("<button type=button role=tab><div></div><span>");
|
|
6
6
|
function P(e) {
|
|
7
7
|
let i;
|
|
8
|
-
const [
|
|
8
|
+
const [a, u] = L(!1), [h, t] = L(!1);
|
|
9
9
|
let n = null;
|
|
10
10
|
const s = () => {
|
|
11
11
|
i && (u(i.scrollLeft > 0), t(i.scrollLeft < i.scrollWidth - i.clientWidth - 1));
|
|
@@ -19,35 +19,35 @@ function P(e) {
|
|
|
19
19
|
n = null, s();
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
}, k = () => e.items, w = (
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
if (
|
|
26
|
-
|
|
22
|
+
}, k = () => e.items, w = (r) => {
|
|
23
|
+
const l = k()[r];
|
|
24
|
+
if (l) {
|
|
25
|
+
if (l.onClick) {
|
|
26
|
+
_(() => l.onClick());
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
e.onSelect(
|
|
29
|
+
e.onSelect(l.id);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
return D(() => {
|
|
33
33
|
s();
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
i.scrollLeft = Math.max(0,
|
|
34
|
+
const r = e.items.findIndex((l) => l.id === e.activeId);
|
|
35
|
+
if (r > 0 && i) {
|
|
36
|
+
const l = i.scrollWidth / e.items.length;
|
|
37
|
+
i.scrollLeft = Math.max(0, l * r - i.clientWidth / 2 + l / 2);
|
|
38
38
|
}
|
|
39
39
|
}), E(() => {
|
|
40
40
|
n !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(n), n = null);
|
|
41
41
|
}), (() => {
|
|
42
|
-
var
|
|
43
|
-
c(
|
|
42
|
+
var r = K(), l = r.firstChild, m = l.firstChild;
|
|
43
|
+
c(l, d(S, {
|
|
44
44
|
get when() {
|
|
45
|
-
return
|
|
45
|
+
return a();
|
|
46
46
|
},
|
|
47
47
|
get children() {
|
|
48
48
|
return q();
|
|
49
49
|
}
|
|
50
|
-
}), m), c(
|
|
50
|
+
}), m), c(l, d(S, {
|
|
51
51
|
get when() {
|
|
52
52
|
return h();
|
|
53
53
|
},
|
|
@@ -55,15 +55,15 @@ function P(e) {
|
|
|
55
55
|
return B();
|
|
56
56
|
}
|
|
57
57
|
}), m), m.addEventListener("scroll", x);
|
|
58
|
-
var
|
|
59
|
-
return typeof
|
|
58
|
+
var I = i;
|
|
59
|
+
return typeof I == "function" ? R(I, m) : i = m, c(m, d(j, {
|
|
60
60
|
get each() {
|
|
61
61
|
return e.items;
|
|
62
62
|
},
|
|
63
|
-
children: (
|
|
64
|
-
item:
|
|
63
|
+
children: (o, y) => d(U, {
|
|
64
|
+
item: o,
|
|
65
65
|
get isActive() {
|
|
66
|
-
return e.activeId ===
|
|
66
|
+
return e.activeId === o.id;
|
|
67
67
|
},
|
|
68
68
|
get index() {
|
|
69
69
|
return y();
|
|
@@ -73,30 +73,31 @@ function P(e) {
|
|
|
73
73
|
},
|
|
74
74
|
onClick: () => {
|
|
75
75
|
"vibrate" in navigator && navigator.vibrate(10);
|
|
76
|
-
const f =
|
|
77
|
-
|
|
76
|
+
const f = o.onClick, C = e.onSelect, F = o.id;
|
|
77
|
+
o.onClick ? _(() => f()) : C(F);
|
|
78
78
|
},
|
|
79
79
|
onKeyboardSelect: (f) => w(f)
|
|
80
80
|
})
|
|
81
|
-
})),
|
|
82
|
-
var y = g(
|
|
81
|
+
})), $((o) => {
|
|
82
|
+
var y = e.hidden, f = g(
|
|
83
83
|
// Same safe-area rule as TopBar: keep the visual bar height stable, and
|
|
84
84
|
// add safe-area padding on an outer wrapper (avoid squeezing content).
|
|
85
85
|
"relative shrink-0 bg-background border-t border-border safe-bottom safe-left safe-right",
|
|
86
86
|
e.class
|
|
87
|
-
),
|
|
88
|
-
return y !==
|
|
87
|
+
), C = e.ariaLabel;
|
|
88
|
+
return y !== o.e && (r.hidden = o.e = y), f !== o.t && v(r, o.t = f), C !== o.a && A(r, "aria-label", o.a = C), o;
|
|
89
89
|
}, {
|
|
90
90
|
e: void 0,
|
|
91
|
-
t: void 0
|
|
92
|
-
|
|
91
|
+
t: void 0,
|
|
92
|
+
a: void 0
|
|
93
|
+
}), r;
|
|
93
94
|
})();
|
|
94
95
|
}
|
|
95
96
|
function U(e) {
|
|
96
97
|
const i = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
|
|
97
98
|
return (() => {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
99
|
+
var a = H(), u = a.firstChild, h = u.nextSibling;
|
|
100
|
+
return a.$$keydown = (t) => {
|
|
100
101
|
let n = null;
|
|
101
102
|
switch (t.key) {
|
|
102
103
|
case "ArrowRight":
|
|
@@ -117,12 +118,12 @@ function U(e) {
|
|
|
117
118
|
return;
|
|
118
119
|
}
|
|
119
120
|
t.preventDefault(), e.onKeyboardSelect(n);
|
|
120
|
-
},
|
|
121
|
+
}, a.$$click = () => e.onClick(), c(u, d(W, {
|
|
121
122
|
get component() {
|
|
122
123
|
return e.item.icon;
|
|
123
124
|
},
|
|
124
125
|
class: "w-6 h-6"
|
|
125
|
-
}), null), c(u, d(
|
|
126
|
+
}), null), c(u, d(S, {
|
|
126
127
|
get when() {
|
|
127
128
|
return i();
|
|
128
129
|
},
|
|
@@ -131,18 +132,18 @@ function U(e) {
|
|
|
131
132
|
return c(t, (() => {
|
|
132
133
|
var n = M(() => typeof i() == "number" && i() > 99);
|
|
133
134
|
return () => n() ? "99+" : i();
|
|
134
|
-
})()),
|
|
135
|
+
})()), $(() => v(t, g("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;
|
|
135
136
|
}
|
|
136
|
-
}), null), c(h, () => e.item.label), c(
|
|
137
|
+
}), null), c(h, () => e.item.label), c(a, d(S, {
|
|
137
138
|
get when() {
|
|
138
139
|
return e.isActive;
|
|
139
140
|
},
|
|
140
141
|
get children() {
|
|
141
142
|
return T();
|
|
142
143
|
}
|
|
143
|
-
}), null),
|
|
144
|
-
var n = g("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"), s = e.item.label, x = e.isActive, k = e.isActive ? 0 : -1, w = g("relative transition-transform duration-150", e.isActive && "scale-110"),
|
|
145
|
-
return n !== t.e && v(
|
|
144
|
+
}), null), $((t) => {
|
|
145
|
+
var n = g("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"), s = e.item.label, x = e.isActive, k = e.isActive ? 0 : -1, w = g("relative transition-transform duration-150", e.isActive && "scale-110"), r = g("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
|
|
146
|
+
return n !== t.e && v(a, t.e = n), s !== t.t && A(a, "aria-label", t.t = s), x !== t.a && A(a, "aria-selected", t.a = x), k !== t.o && A(a, "tabindex", t.o = k), w !== t.i && v(u, t.i = w), r !== t.n && v(h, t.n = r), t;
|
|
146
147
|
}, {
|
|
147
148
|
e: void 0,
|
|
148
149
|
t: void 0,
|
|
@@ -150,7 +151,7 @@ function U(e) {
|
|
|
150
151
|
o: void 0,
|
|
151
152
|
i: void 0,
|
|
152
153
|
n: void 0
|
|
153
|
-
}),
|
|
154
|
+
}), a;
|
|
154
155
|
})();
|
|
155
156
|
}
|
|
156
157
|
z(["click", "keydown"]);
|
|
@@ -26,6 +26,8 @@ export interface ShellSlotClassNames {
|
|
|
26
26
|
}
|
|
27
27
|
export interface ShellProps {
|
|
28
28
|
children: JSX.Element;
|
|
29
|
+
/** Fill a containing AppViewport or embedded host instead of the document viewport. */
|
|
30
|
+
fillParent?: boolean;
|
|
29
31
|
logo?: JSX.Element;
|
|
30
32
|
activityItems?: ActivityBarItem[];
|
|
31
33
|
activityBottomItems?: ActivityBarItem[];
|
|
@@ -41,6 +43,10 @@ export interface ShellProps {
|
|
|
41
43
|
activityBottomItemsMobileMode?: 'hidden' | 'topBar';
|
|
42
44
|
topBarActions?: JSX.Element;
|
|
43
45
|
bottomBarItems?: JSX.Element;
|
|
46
|
+
/** Stable content directly above mobile navigation, such as a composer anchor. */
|
|
47
|
+
mobileAccessory?: JSX.Element;
|
|
48
|
+
/** Hide navigation only while a focused editor is occluded by the soft keyboard. */
|
|
49
|
+
hideMobileNavigationWhenKeyboardOpen?: boolean;
|
|
44
50
|
sidebarContent?: (activeTab: string) => JSX.Element;
|
|
45
51
|
/** Defer user-requested Activity content commits until the selected control has painted. */
|
|
46
52
|
activitySelectionMode?: 'sync' | 'ui-first';
|