@floegence/floe-webapp-core 0.78.9 → 0.79.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,34 +1,53 @@
1
- import { insert as d, effect as u, className as f, setAttribute as p, style as m, template as w, use as h } from "solid-js/web";
2
- import { createSignal as V, onMount as b, onCleanup as s, untrack as y } from "solid-js";
3
- import { viewportStyle as g, observeViewport as E } from "../../viewport.js";
4
- var L = /* @__PURE__ */ w("<div data-floe-app-viewport style=position:fixed;inset:0;overflow:hidden;min-height:0>");
5
- function A(o) {
6
- const [i, v] = V();
7
- let n;
8
- return b(() => {
9
- const e = n?.ownerDocument.defaultView;
1
+ import { insert as d, effect as f, className as m, setAttribute as p, style as w, template as h, use as V } from "solid-js/web";
2
+ import { createSignal as b, onMount as y, onCleanup as l, untrack as E } from "solid-js";
3
+ import { viewportStyle as g, observeViewport as L } from "../../viewport.js";
4
+ import { isKeyboardEditingElement as M } from "../../utils/focus.js";
5
+ var x = /* @__PURE__ */ h("<div data-floe-app-viewport style=position:fixed;inset:0;overflow:hidden;min-height:0>");
6
+ function A(s) {
7
+ const [a, c] = b();
8
+ let i;
9
+ const u = () => {
10
+ const e = a();
11
+ if (!e) return {
12
+ height: "100dvh"
13
+ };
14
+ const r = g(e), t = i?.ownerDocument.defaultView?.visualViewport?.scale ?? 1;
15
+ return Math.abs(t - 1) < 0.01 ? {
16
+ ...r,
17
+ left: "0px",
18
+ top: "0px"
19
+ } : r;
20
+ };
21
+ return y(() => {
22
+ const e = i?.ownerDocument.defaultView;
10
23
  if (!e) return;
11
- const r = () => {
24
+ const r = (o) => {
25
+ if (o.button !== 0 || o.defaultPrevented || !e.matchMedia("(any-pointer: coarse)").matches || Math.abs((e.visualViewport?.scale ?? 1) - 1) >= 0.01) return;
26
+ const n = o.target;
27
+ !(n instanceof Element) || !M(n) || n.matches(":focus") || n.closest("[inert]") || n.focus({
28
+ preventScroll: !0
29
+ });
30
+ };
31
+ e.document.addEventListener("mousedown", r);
32
+ const t = () => {
12
33
  Math.abs((e.visualViewport?.scale ?? 1) - 1) >= 0.01 || (e.scrollX || e.scrollY) && e.scrollTo({
13
34
  left: 0,
14
35
  top: 0,
15
36
  behavior: "instant"
16
37
  });
17
38
  };
18
- e.addEventListener("scroll", r), e.visualViewport?.addEventListener("resize", r), r(), s(() => {
19
- e.removeEventListener("scroll", r), e.visualViewport?.removeEventListener("resize", r);
20
- }), s(E(e, (t) => {
21
- v(t), y(() => o.onViewportChange?.(t));
39
+ e.addEventListener("scroll", t), e.visualViewport?.addEventListener("resize", t), t(), l(() => {
40
+ e.document.removeEventListener("mousedown", r), e.removeEventListener("scroll", t), e.visualViewport?.removeEventListener("resize", t);
41
+ }), l(L(e, (o) => {
42
+ c(o), E(() => s.onViewportChange?.(o));
22
43
  }));
23
44
  }), (() => {
24
- var e = L(), r = n;
25
- return typeof r == "function" ? h(r, e) : n = e, d(e, () => o.children), u((t) => {
26
- var a = o.class, l = i()?.keyboardOpen || void 0, c = {
27
- ...i() ? g(i()) : {
28
- height: "100dvh"
29
- }
45
+ var e = x(), r = i;
46
+ return typeof r == "function" ? V(r, e) : i = e, d(e, () => s.children), f((t) => {
47
+ var o = s.class, n = a()?.keyboardOpen || void 0, v = {
48
+ ...u()
30
49
  };
31
- return a !== t.e && f(e, t.e = a), l !== t.t && p(e, "data-keyboard-open", t.t = l), t.a = m(e, c, t.a), t;
50
+ return o !== t.e && m(e, t.e = o), n !== t.t && p(e, "data-keyboard-open", t.t = n), t.a = w(e, v, t.a), t;
32
51
  }, {
33
52
  e: void 0,
34
53
  t: void 0,
@@ -27,6 +27,8 @@ export interface ShellSlotClassNames {
27
27
  mobileTabBar?: string;
28
28
  }
29
29
  export interface ShellProps {
30
+ /** Opt into a retained desktop sidebar overlay when the main area would be narrower. */
31
+ sidebarMinContentWidth?: number;
30
32
  /** Defaults to visible; hidden transfers the top safe area to Shell. */
31
33
  topBarMobileMode?: 'visible' | 'hidden';
32
34
  /** Fixed actions outside the horizontally scrolling mobile tabs. */