@floegence/floe-webapp-core 0.71.0 → 0.72.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/SurfaceFloatingLayer.js +35 -26
- package/dist/components/ui/surfaceFloatingBoundary.js +31 -40
- package/dist/floe.css +6 -4
- 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,12 +1,13 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { createComponent as S, Portal as v, use as h, spread as g, mergeProps as A, insert as P, template as R } from "solid-js/web";
|
|
2
|
+
import { observeViewport as w } from "../../viewport.js";
|
|
3
|
+
import { splitProps as _, createSignal as b, onMount as x, onCleanup as C, createMemo as s } from "solid-js";
|
|
4
|
+
import { cn as T } from "../../utils/cn.js";
|
|
5
|
+
import { LOCAL_INTERACTION_SURFACE_ATTR as z } from "./localInteractionSurface.js";
|
|
6
|
+
import { clampMenuPosition as M } from "./menuUtils.js";
|
|
7
|
+
import { readSurfaceSafeArea as F, resolveFloatingBoundary as L } from "./surfaceFloatingBoundary.js";
|
|
8
|
+
import { resolveSurfacePortalHost as $, SURFACE_FLOATING_LAYER_ATTR as E, resolveSurfacePortalMount as O, isSurfacePortalMode as B, projectSurfacePortalPosition as I } from "./dialogSurfaceScope.js";
|
|
9
|
+
var N = /* @__PURE__ */ R("<div>");
|
|
10
|
+
function j() {
|
|
10
11
|
return {
|
|
11
12
|
left: 0,
|
|
12
13
|
top: 0,
|
|
@@ -16,42 +17,50 @@ function B() {
|
|
|
16
17
|
height: 0
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const [e,
|
|
20
|
+
function J(c) {
|
|
21
|
+
const [e, f] = _(c, ["position", "owner", "boundary", "estimatedSize", "clamp", "class", "style", "children", "layerRef"]), [a, p] = b();
|
|
22
|
+
x(() => C(w(window, p)));
|
|
23
|
+
const r = s(() => $({
|
|
21
24
|
owner: e.owner ?? null
|
|
22
|
-
})),
|
|
25
|
+
})), n = () => B(r()), u = s(() => (e.position, a()?.safeArea ?? F())), i = () => L(r(), e.boundary, u()) ?? j(), m = () => e.clamp !== !1 && !!e.estimatedSize, d = s(() => {
|
|
23
26
|
const t = e.position;
|
|
24
|
-
return !
|
|
25
|
-
}),
|
|
27
|
+
return !m() || !e.estimatedSize ? t : M(t, e.estimatedSize, i());
|
|
28
|
+
}), l = () => {
|
|
29
|
+
const t = I(d(), r()), o = a()?.fixedOffset;
|
|
30
|
+
return n() || !o ? t : {
|
|
31
|
+
x: t.x + o.left,
|
|
32
|
+
y: t.y + o.top
|
|
33
|
+
};
|
|
34
|
+
}, y = () => ({
|
|
26
35
|
...e.style ?? {},
|
|
27
|
-
...e.boundary !== void 0 && (
|
|
36
|
+
...e.boundary !== void 0 && (i().width <= 16 || i().height <= 16) ? {
|
|
28
37
|
visibility: "hidden",
|
|
29
38
|
"pointer-events": "none"
|
|
30
39
|
} : {},
|
|
31
|
-
left: `${
|
|
32
|
-
top: `${
|
|
40
|
+
left: `${l().x}px`,
|
|
41
|
+
top: `${l().y}px`
|
|
33
42
|
});
|
|
34
|
-
return
|
|
43
|
+
return S(v, {
|
|
35
44
|
get mount() {
|
|
36
|
-
return
|
|
45
|
+
return O(r());
|
|
37
46
|
},
|
|
38
47
|
get children() {
|
|
39
|
-
var t =
|
|
40
|
-
return typeof
|
|
48
|
+
var t = N(), o = e.layerRef;
|
|
49
|
+
return typeof o == "function" ? h(o, t) : e.layerRef = t, g(t, A(f, {
|
|
41
50
|
get class() {
|
|
42
|
-
return
|
|
51
|
+
return T(n() ? "absolute z-20" : "fixed z-50", e.class);
|
|
43
52
|
},
|
|
44
53
|
get style() {
|
|
45
|
-
return
|
|
54
|
+
return y();
|
|
46
55
|
}
|
|
47
56
|
}, {
|
|
48
|
-
[
|
|
57
|
+
[E]: "true"
|
|
49
58
|
}, () => ({
|
|
50
|
-
[
|
|
59
|
+
[z]: n() ? "true" : void 0
|
|
51
60
|
})), !1, !0), P(t, () => e.children), t;
|
|
52
61
|
}
|
|
53
62
|
});
|
|
54
63
|
}
|
|
55
64
|
export {
|
|
56
|
-
|
|
65
|
+
J as SurfaceFloatingLayer
|
|
57
66
|
};
|
|
@@ -1,53 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isSurfacePortalMode as
|
|
3
|
-
function m(...
|
|
4
|
-
const
|
|
5
|
-
return { left:
|
|
1
|
+
import { readViewportSnapshot as f } from "../../viewport.js";
|
|
2
|
+
import { isSurfacePortalMode as l, resolveSurfacePortalBoundaryRect as h } from "./dialogSurfaceScope.js";
|
|
3
|
+
function m(...i) {
|
|
4
|
+
const e = Math.max(...i.map((t) => t.left)), n = Math.max(...i.map((t) => t.top)), o = Math.max(e, Math.min(...i.map((t) => t.right))), r = Math.max(n, Math.min(...i.map((t) => t.bottom)));
|
|
5
|
+
return { left: e, top: n, right: o, bottom: r, width: o - e, height: r - n };
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const e = document.createElement("div");
|
|
10
|
-
e.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px)", document.documentElement.append(e);
|
|
11
|
-
const t = getComputedStyle(e), i = (a) => Math.max(0, Number.parseFloat(a) || 0), o = {
|
|
12
|
-
top: i(t.paddingTop),
|
|
13
|
-
right: i(t.paddingRight),
|
|
14
|
-
bottom: i(t.paddingBottom),
|
|
15
|
-
left: i(t.paddingLeft)
|
|
16
|
-
};
|
|
17
|
-
return e.remove(), o;
|
|
7
|
+
function p() {
|
|
8
|
+
return typeof window > "u" ? { top: 0, right: 0, bottom: 0, left: 0 } : f(window).safeArea;
|
|
18
9
|
}
|
|
19
|
-
function c(
|
|
20
|
-
if (
|
|
21
|
-
const o =
|
|
22
|
-
left: o.
|
|
23
|
-
top:
|
|
24
|
-
right: o.
|
|
25
|
-
bottom:
|
|
26
|
-
width: o.
|
|
27
|
-
height: o.
|
|
10
|
+
function c(i, e, n = { top: 0, right: 0, bottom: 0, left: 0 }) {
|
|
11
|
+
if (e === null || typeof window > "u" || i.mode === "surface" && !l(i)) return null;
|
|
12
|
+
const { visible: o } = f(window), r = {
|
|
13
|
+
left: o.left + n.left,
|
|
14
|
+
top: o.top + n.top,
|
|
15
|
+
right: o.right - n.right,
|
|
16
|
+
bottom: o.bottom - n.bottom,
|
|
17
|
+
width: o.width,
|
|
18
|
+
height: o.height
|
|
28
19
|
};
|
|
29
|
-
let
|
|
30
|
-
if (
|
|
31
|
-
if (!
|
|
20
|
+
let t;
|
|
21
|
+
if (e instanceof HTMLElement) {
|
|
22
|
+
if (!e.isConnected || e.closest('[inert], [hidden], [aria-hidden="true"]'))
|
|
32
23
|
return null;
|
|
33
|
-
|
|
24
|
+
t = e.getBoundingClientRect();
|
|
34
25
|
} else
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
t = e;
|
|
27
|
+
return t && ![
|
|
28
|
+
t.left,
|
|
29
|
+
t.top,
|
|
30
|
+
t.right,
|
|
31
|
+
t.bottom,
|
|
32
|
+
t.width,
|
|
33
|
+
t.height
|
|
43
34
|
].every(Number.isFinite) ? null : m(
|
|
44
35
|
r,
|
|
45
|
-
|
|
46
|
-
...
|
|
36
|
+
...l(i) ? [h(i)] : [],
|
|
37
|
+
...t ? [t] : []
|
|
47
38
|
);
|
|
48
39
|
}
|
|
49
40
|
export {
|
|
50
41
|
m as intersectSurfaceRects,
|
|
51
|
-
|
|
42
|
+
p as readSurfaceSafeArea,
|
|
52
43
|
c as resolveFloatingBoundary
|
|
53
44
|
};
|
package/dist/floe.css
CHANGED
|
@@ -707,10 +707,6 @@
|
|
|
707
707
|
pointer-events: auto;
|
|
708
708
|
transform-origin: bottom center;
|
|
709
709
|
transition:
|
|
710
|
-
left 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
711
|
-
top 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
712
|
-
width 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
713
|
-
height 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
714
710
|
border-radius 200ms ease,
|
|
715
711
|
border-color 180ms ease,
|
|
716
712
|
opacity 120ms ease;
|
|
@@ -728,6 +724,12 @@
|
|
|
728
724
|
.floe-bottom-bar-companion[data-companion-phase='expanding'],
|
|
729
725
|
.floe-bottom-bar-companion[data-companion-phase='collapsing'] {
|
|
730
726
|
will-change: left, top, width, height;
|
|
727
|
+
transition:
|
|
728
|
+
left 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
729
|
+
top 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
730
|
+
width 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
731
|
+
height 360ms cubic-bezier(0.22, 0.8, 0.24, 1),
|
|
732
|
+
border-radius 200ms ease, border-color 180ms ease, opacity 120ms ease;
|
|
731
733
|
}
|
|
732
734
|
|
|
733
735
|
.floe-bottom-bar-companion[data-companion-visibility='hidden'],
|