@floegence/floe-webapp-core 0.77.2 → 0.77.3

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,9 +1,9 @@
1
1
  import { createEffect as R, onCleanup as V } from "solid-js";
2
2
  import { lockBodyStyle as G } from "../utils/bodyStyleLock.js";
3
- import { deferAfterPaint as D } from "../utils/defer.js";
3
+ import { deferAfterPaint as S } from "../utils/defer.js";
4
4
  import { getFocusableElements as J, getFirstFocusableElement as Q } from "../utils/focus.js";
5
5
  import { matchKeybind as U } from "../utils/keybind.js";
6
- const S = /* @__PURE__ */ new WeakMap();
6
+ const D = /* @__PURE__ */ new WeakMap();
7
7
  function K(t) {
8
8
  return typeof Node < "u" && t instanceof Node;
9
9
  }
@@ -29,29 +29,29 @@ function Y(t, o) {
29
29
  }
30
30
  function oe(t) {
31
31
  const o = () => c(t.lockBodyScroll, !0), r = () => c(t.trapFocus, !0), a = () => {
32
- const i = c(
32
+ const l = c(
33
33
  t.closeOnEscape,
34
34
  !0
35
35
  );
36
- return i === !1 ? "none" : i === "inside" ? "inside" : i === "none" ? "none" : "always";
36
+ return l === !1 ? "none" : l === "inside" ? "inside" : l === "none" ? "none" : "always";
37
37
  }, W = () => c(t.blockHotkeys, !0), A = () => c(t.restoreFocus, !0), x = () => c(t.blockWheel, "none"), I = () => c(t.blockTouchMove, "none"), N = () => c(t.autoFocus, !0);
38
38
  R(() => {
39
39
  if (!t.open() || typeof document > "u") return;
40
- const i = o(), b = r(), d = a(), m = c(t.escapeKeyPhase, "capture"), q = W(), j = A(), h = x(), k = I(), E = N(), l = S.get(document) ?? [];
41
- S.set(document, l);
40
+ const l = o(), b = r(), d = a(), m = c(t.escapeKeyPhase, "capture"), q = W(), j = A(), h = x(), k = I(), E = N(), i = D.get(document) ?? [];
41
+ D.set(document, i);
42
42
  const v = {
43
- global: i || d === "always",
43
+ global: l || d === "always",
44
44
  contains: (e) => p(t.root(), e, t.containsTarget)
45
45
  };
46
- l.push(v);
46
+ i.push(v);
47
47
  let w = !0;
48
- const u = (e) => w && !l.slice(l.indexOf(v) + 1).some((n) => n.global || n.contains(e)), g = document.activeElement instanceof HTMLElement ? document.activeElement : null, z = i ? G({ overflow: "hidden" }) : null;
49
- D(() => {
48
+ const u = (e) => w && !i.slice(i.indexOf(v) + 1).some((n) => n.global || n.contains(e)), g = document.activeElement instanceof HTMLElement ? document.activeElement : null, z = l ? G({ overflow: "hidden" }) : null;
49
+ S(() => {
50
50
  const e = t.root();
51
51
  if (!e?.isConnected || !u(e) || E === !1 || v.contains(document.activeElement)) return;
52
52
  const n = typeof E == "object" ? E.selector : void 0, y = (n ? e.querySelector(n) : null) ?? e.querySelector("[data-floe-autofocus]") ?? Q(e) ?? e;
53
53
  try {
54
- y.focus();
54
+ y.focus({ preventScroll: !0 });
55
55
  } catch {
56
56
  }
57
57
  });
@@ -125,16 +125,16 @@ function oe(t) {
125
125
  capture: !0,
126
126
  passive: !1
127
127
  }), V(() => {
128
- w = !1, l.splice(l.indexOf(v), 1), b && document.removeEventListener("keydown", T, !0), d !== "none" && C.removeEventListener(
128
+ w = !1, i.splice(i.indexOf(v), 1), b && document.removeEventListener("keydown", T, !0), d !== "none" && C.removeEventListener(
129
129
  "keydown",
130
130
  L,
131
131
  m === "capture"
132
- ), document.removeEventListener("keydown", M), h !== "none" && (document.removeEventListener("wheel", O, !0), document.removeEventListener("wheel", B)), k !== "none" && document.removeEventListener("touchmove", F, !0), z?.(), j && g && g.isConnected && D(() => {
132
+ ), document.removeEventListener("keydown", M), h !== "none" && (document.removeEventListener("wheel", O, !0), document.removeEventListener("wheel", B)), k !== "none" && document.removeEventListener("touchmove", F, !0), z?.(), j && g && g.isConnected && S(() => {
133
133
  if (typeof document > "u") return;
134
134
  const e = document.activeElement;
135
135
  if (!(e && e !== document.body && e !== document.documentElement))
136
136
  try {
137
- g.focus();
137
+ g.focus({ preventScroll: !0 });
138
138
  } catch {
139
139
  }
140
140
  });