@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.
@@ -1,12 +1,13 @@
1
- import { createComponent as m, Portal as y, use as S, spread as v, mergeProps as h, insert as P, template as R } from "solid-js/web";
2
- import { splitProps as g, createMemo as n } from "solid-js";
3
- import { cn as A } from "../../utils/cn.js";
4
- import { LOCAL_INTERACTION_SURFACE_ATTR as _ } from "./localInteractionSurface.js";
5
- import { clampMenuPosition as b } from "./menuUtils.js";
6
- import { readSurfaceSafeArea as T, resolveFloatingBoundary as z } from "./surfaceFloatingBoundary.js";
7
- import { resolveSurfacePortalHost as C, SURFACE_FLOATING_LAYER_ATTR as w, resolveSurfacePortalMount as x, resolveSurfacePortalBoundaryRect as F, isSurfacePortalMode as L, projectSurfacePortalPosition as M } from "./dialogSurfaceScope.js";
8
- var $ = /* @__PURE__ */ R("<div>");
9
- function B() {
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 G(l) {
20
- const [e, c] = g(l, ["position", "owner", "boundary", "estimatedSize", "clamp", "class", "style", "children", "layerRef"]), o = n(() => C({
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
- })), i = () => L(o()), u = n(() => (e.position, T())), r = () => e.boundary === void 0 ? F(o()) : z(o(), e.boundary, u()) ?? B(), d = () => e.clamp !== !1 && !!e.estimatedSize, f = n(() => {
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 !d() || !e.estimatedSize ? t : b(t, e.estimatedSize, r());
25
- }), a = () => M(f(), o()), p = () => ({
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 && (r().width <= 16 || r().height <= 16) ? {
36
+ ...e.boundary !== void 0 && (i().width <= 16 || i().height <= 16) ? {
28
37
  visibility: "hidden",
29
38
  "pointer-events": "none"
30
39
  } : {},
31
- left: `${a().x}px`,
32
- top: `${a().y}px`
40
+ left: `${l().x}px`,
41
+ top: `${l().y}px`
33
42
  });
34
- return m(y, {
43
+ return S(v, {
35
44
  get mount() {
36
- return x(o());
45
+ return O(r());
37
46
  },
38
47
  get children() {
39
- var t = $(), s = e.layerRef;
40
- return typeof s == "function" ? S(s, t) : e.layerRef = t, v(t, h(c, {
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 A(i() ? "absolute z-20" : "fixed z-50", e.class);
51
+ return T(n() ? "absolute z-20" : "fixed z-50", e.class);
43
52
  },
44
53
  get style() {
45
- return p();
54
+ return y();
46
55
  }
47
56
  }, {
48
- [w]: "true"
57
+ [E]: "true"
49
58
  }, () => ({
50
- [_]: i() ? "true" : void 0
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
- G as SurfaceFloatingLayer
65
+ J as SurfaceFloatingLayer
57
66
  };
@@ -1,53 +1,44 @@
1
- import { resolveMobileKeyboardViewportMetrics as l } from "./mobileKeyboardViewport.js";
2
- import { isSurfacePortalMode as d, resolveSurfacePortalBoundaryRect as p } from "./dialogSurfaceScope.js";
3
- function m(...e) {
4
- const t = Math.max(...e.map((r) => r.left)), i = Math.max(...e.map((r) => r.top)), o = Math.max(t, Math.min(...e.map((r) => r.right))), a = Math.max(i, Math.min(...e.map((r) => r.bottom)));
5
- return { left: t, top: i, right: o, bottom: a, width: o - t, height: a - i };
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 s() {
8
- if (typeof document > "u") return { top: 0, right: 0, bottom: 0, left: 0 };
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(e, t, i = { top: 0, right: 0, bottom: 0, left: 0 }) {
20
- if (t === null || typeof window > "u" || e.mode === "surface" && !d(e)) return null;
21
- const o = l(window), a = window.innerHeight - o.bottomPx - o.heightPx, r = {
22
- left: o.leftPx + i.left,
23
- top: a + i.top,
24
- right: o.leftPx + o.widthPx - i.right,
25
- bottom: a + o.heightPx - i.bottom,
26
- width: o.widthPx,
27
- height: o.heightPx
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 n;
30
- if (t instanceof HTMLElement) {
31
- if (!t.isConnected || t.closest('[inert], [hidden], [aria-hidden="true"]'))
20
+ let t;
21
+ if (e instanceof HTMLElement) {
22
+ if (!e.isConnected || e.closest('[inert], [hidden], [aria-hidden="true"]'))
32
23
  return null;
33
- n = t.getBoundingClientRect();
24
+ t = e.getBoundingClientRect();
34
25
  } else
35
- n = t;
36
- return n && ![
37
- n.left,
38
- n.top,
39
- n.right,
40
- n.bottom,
41
- n.width,
42
- n.height
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
- p(e),
46
- ...n ? [n] : []
36
+ ...l(i) ? [h(i)] : [],
37
+ ...t ? [t] : []
47
38
  );
48
39
  }
49
40
  export {
50
41
  m as intersectSurfaceRects,
51
- s as readSurfaceSafeArea,
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'],