@floegence/floe-webapp-core 0.48.0 → 0.48.2

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,54 +1,52 @@
1
- import { createSignal as f, createEffect as d, untrack as o, onCleanup as s } from "solid-js";
2
- function w() {
1
+ import { createMemo as w, untrack as o, createSignal as s, createEffect as x, onCleanup as g } from "solid-js";
2
+ function p() {
3
3
  return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
4
4
  }
5
- function x(e) {
5
+ function M(e) {
6
6
  return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : globalThis.setTimeout(e, 16);
7
7
  }
8
- function g(e) {
8
+ function T(e) {
9
9
  if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
10
10
  window.cancelAnimationFrame(e);
11
11
  return;
12
12
  }
13
13
  globalThis.clearTimeout(e);
14
14
  }
15
- function p(e) {
16
- return w() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 120);
17
- }
18
15
  function F(e) {
19
- const [u, a] = f(e.open()), [c, i] = f(
20
- e.open() ? "entering" : "exiting"
21
- );
16
+ return p() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 120);
17
+ }
18
+ function y(e) {
19
+ const i = w(() => e.open()), a = o(i), [c, l] = s(a), [f, r] = s(a ? "entering" : "exiting");
22
20
  let n = null, t = null;
23
- const r = () => {
24
- n !== null && (g(n), n = null);
25
- }, l = () => {
21
+ const u = () => {
22
+ n !== null && (T(n), n = null);
23
+ }, m = () => {
26
24
  t !== null && (globalThis.clearTimeout(t), t = null);
27
25
  };
28
- return d(() => {
29
- if (e.open()) {
30
- l(), r(), a(!0), i("entering"), n = x(() => {
31
- n = null, o(e.open) && i("open");
26
+ return x(() => {
27
+ if (i()) {
28
+ m(), u(), l(!0), r("entering"), n = M(() => {
29
+ n = null, o(i) && r("open");
32
30
  });
33
31
  return;
34
32
  }
35
- if (r(), !o(u)) {
36
- i("exiting");
33
+ if (u(), !o(c)) {
34
+ r("exiting");
37
35
  return;
38
36
  }
39
- i("exiting");
40
- const m = p(e);
37
+ r("exiting");
38
+ const d = F(e);
41
39
  t = globalThis.setTimeout(() => {
42
- t = null, o(e.open) || a(!1);
43
- }, m);
44
- }), s(() => {
45
- r(), l();
40
+ t = null, o(i) || l(!1);
41
+ }, d);
42
+ }), g(() => {
43
+ u(), m();
46
44
  }), {
47
- mounted: u,
48
- state: c,
49
- exiting: () => c() === "exiting"
45
+ mounted: c,
46
+ state: f,
47
+ exiting: () => f() === "exiting"
50
48
  };
51
49
  }
52
50
  export {
53
- F as createFloatingPresence
51
+ y as createFloatingPresence
54
52
  };