@floegence/floe-webapp-core 0.91.5 → 0.93.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,10 +1,10 @@
1
- import { createMemo as q, untrack as u, createSignal as P, createEffect as w, onCleanup as A } from "solid-js";
1
+ import { createMemo as q, untrack as f, createSignal as L, createEffect as w, onCleanup as A } from "solid-js";
2
2
  const O = 120;
3
- function v() {
3
+ function N() {
4
4
  const e = globalThis.matchMedia;
5
5
  return typeof e != "function" ? !1 : e.call(globalThis, "(prefers-reduced-motion: reduce)").matches;
6
6
  }
7
- function p(e) {
7
+ function d(e) {
8
8
  const t = globalThis.requestAnimationFrame;
9
9
  return typeof t == "function" ? t.call(globalThis, e) : globalThis.setTimeout(e, 16);
10
10
  }
@@ -25,77 +25,82 @@ function W(e) {
25
25
  function _(e) {
26
26
  const t = globalThis.getComputedStyle;
27
27
  if (!e || typeof t != "function") return null;
28
- const i = t.call(globalThis, e), c = i.transitionDuration.split(","), a = { properties: /* @__PURE__ */ new Set(), longestMs: 0 };
29
- return i.transitionProperty.split(",").forEach((f, l) => {
30
- const n = f.trim();
28
+ const i = t.call(globalThis, e), c = i.transitionDuration.split(","), l = { properties: /* @__PURE__ */ new Set(), longestMs: 0 };
29
+ return i.transitionProperty.split(",").forEach((m, a) => {
30
+ const n = m.trim();
31
31
  if (n === "" || n === "none") return;
32
- const r = W(c[l % c.length] ?? "0s");
33
- r === null || r <= 1 || (a.properties.add(n), a.longestMs = Math.max(a.longestMs, r));
34
- }), a.properties.size > 0 ? a : null;
32
+ const r = W(c[a % c.length] ?? "0s");
33
+ r === null || r <= 1 || (l.properties.add(n), l.longestMs = Math.max(l.longestMs, r));
34
+ }), l.properties.size > 0 ? l : null;
35
35
  }
36
36
  function z(e) {
37
- const t = q(() => e.open()), i = u(t), [c, a] = P(i), [f, l] = P(i ? "entering" : "exiting");
38
- let n = null, r = null, d = null;
37
+ const t = q(() => e.open()), i = f(t), [c, l] = L(i), [m, a] = L(
38
+ i ? "entering" : "exiting"
39
+ );
40
+ let n = null, r = null, g = null;
39
41
  const h = () => {
40
42
  n !== null && (R(n), n = null);
41
- }, g = () => {
42
- r !== null && (globalThis.clearTimeout(r), r = null), d?.(), d = null;
43
+ }, T = () => {
44
+ r !== null && (globalThis.clearTimeout(r), r = null), g?.(), g = null;
43
45
  };
44
46
  return w(() => {
45
47
  if (t()) {
46
- if (h(), g(), u(c) && u(f) === "exiting") {
47
- l("open");
48
+ if (h(), T(), f(c) && f(m) === "exiting") {
49
+ a("open");
48
50
  return;
49
51
  }
50
- a(!0), l("entering"), n = p(() => {
51
- n = null, u(t) && l("open");
52
+ l(!0), a("entering"), n = d(() => {
53
+ if (n = null, f(t)) {
54
+ const u = e.element?.();
55
+ u?.isConnected && globalThis.getComputedStyle?.(u).opacity, a("open");
56
+ }
52
57
  });
53
58
  return;
54
59
  }
55
- if (h(), !u(c)) {
56
- l("exiting");
60
+ if (h(), !f(c)) {
61
+ a("exiting");
57
62
  return;
58
63
  }
59
- l("exiting");
60
- const T = () => {
61
- n = null, g(), u(t) || a(!1);
62
- }, o = e.element?.(), x = v() ? null : _(o);
63
- if (o && x) {
64
- const b = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set();
64
+ a("exiting");
65
+ const x = () => {
66
+ n = null, T(), f(t) || l(!1);
67
+ }, o = e.element?.(), M = N() ? null : _(o);
68
+ if (o && M) {
69
+ const u = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set();
65
70
  let F = !1;
66
71
  const S = () => {
67
- F || (F = !0, T());
68
- }, L = (s) => s.target === o && x.properties.has(s.propertyName), N = (s) => {
69
- L(s) && b.add(s.propertyName);
70
- }, m = (s) => {
71
- if (L(s)) {
72
- b.add(s.propertyName), E.add(s.propertyName);
73
- for (const C of b)
74
- if (!E.has(C)) return;
72
+ F || (F = !0, x());
73
+ }, v = (s) => s.target === o && M.properties.has(s.propertyName), C = (s) => {
74
+ v(s) && u.add(s.propertyName);
75
+ }, p = (s) => {
76
+ if (v(s)) {
77
+ u.add(s.propertyName), E.add(s.propertyName);
78
+ for (const D of u)
79
+ if (!E.has(D)) return;
75
80
  S();
76
81
  }
77
82
  };
78
- o.addEventListener("transitionrun", N), o.addEventListener("transitionend", m), o.addEventListener("transitioncancel", m), d = () => {
79
- o.removeEventListener("transitionrun", N), o.removeEventListener("transitionend", m), o.removeEventListener("transitioncancel", m);
83
+ o.addEventListener("transitionrun", C), o.addEventListener("transitionend", p), o.addEventListener("transitioncancel", p), g = () => {
84
+ o.removeEventListener("transitionrun", C), o.removeEventListener("transitionend", p), o.removeEventListener("transitioncancel", p);
80
85
  };
81
- const D = Math.max(x.longestMs, e.exitDurationMs ?? 0) + O;
82
- r = globalThis.setTimeout(S, D);
86
+ const P = Math.max(M.longestMs, e.exitDurationMs ?? 0) + O;
87
+ r = globalThis.setTimeout(S, P);
83
88
  return;
84
89
  }
85
- const M = v() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 160), y = () => {
90
+ const y = N() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 160), b = () => {
86
91
  n = null, r = globalThis.setTimeout(() => {
87
- r = null, M <= 1 ? T() : n = p(T);
88
- }, M);
92
+ r = null, y <= 1 ? x() : n = d(x);
93
+ }, y);
89
94
  };
90
- M <= 1 ? y() : n = p(() => {
91
- n = p(y);
95
+ y <= 1 ? b() : n = d(() => {
96
+ n = d(b);
92
97
  });
93
98
  }), A(() => {
94
- h(), g();
99
+ h(), T();
95
100
  }), {
96
101
  mounted: c,
97
- state: f,
98
- exiting: () => f() === "exiting"
102
+ state: m,
103
+ exiting: () => m() === "exiting"
99
104
  };
100
105
  }
101
106
  export {
@@ -1,4 +1,4 @@
1
- export { PromptCard, type PromptCardProps } from './PromptCard';
1
+ export { PromptCard, capturePromptCardAnchor, type PromptCardProps } from './PromptCard';
2
2
  export { FeedbackIndicator, type FeedbackIndicatorProps, type FeedbackIndicatorEntry } from './FeedbackIndicator';
3
3
  export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './Button';
4
4
  export { StableText, type StableTextProps } from './StableText';
package/dist/floe.css CHANGED
@@ -1007,12 +1007,12 @@
1007
1007
  * positioning layer never animates, and typing never schedules a motion loop. */
1008
1008
  .floe-prompt-card-positioner { position: fixed; pointer-events: none; width: min(24rem, var(--floe-prompt-max-width)); }
1009
1009
  .floe-prompt-card {
1010
- --floe-floating-enter-duration: var(--floe-duration-base);
1010
+ --floe-floating-enter-duration: var(--floe-duration-slow);
1011
1011
  --floe-floating-exit-duration: var(--floe-duration-fast);
1012
- --floe-floating-enter-y: -0.25rem;
1013
- --floe-floating-exit-y: -0.125rem;
1014
- --floe-floating-enter-scale: 0.985;
1015
- --floe-floating-exit-scale: 0.995;
1012
+ --floe-floating-enter-y: -0.75rem;
1013
+ --floe-floating-exit-y: -0.375rem;
1014
+ --floe-floating-enter-scale: 0.975;
1015
+ --floe-floating-exit-scale: 0.985;
1016
1016
  --floe-floating-origin: var(--floe-prompt-origin-x) top;
1017
1017
  display: flex; flex-direction: column; min-width: 0;
1018
1018
  max-height: var(--floe-prompt-max-height);
@@ -1026,15 +1026,14 @@
1026
1026
  line-height: var(--floe-line-body);
1027
1027
  }
1028
1028
  .floe-prompt-card[data-floating-side='top'] {
1029
- --floe-floating-enter-y: 0.25rem;
1030
- --floe-floating-exit-y: 0.125rem;
1029
+ --floe-floating-enter-y: 0.75rem;
1030
+ --floe-floating-exit-y: 0.375rem;
1031
1031
  --floe-floating-origin: var(--floe-prompt-origin-x) bottom;
1032
1032
  }
1033
1033
  .floe-prompt-card[data-floating-side='edge'] {
1034
- --floe-floating-enter-y: 0;
1035
- --floe-floating-exit-y: 0;
1036
- --floe-floating-enter-scale: 1;
1037
- --floe-floating-exit-scale: 1;
1034
+ --floe-floating-enter-y: 0.5rem;
1035
+ --floe-floating-exit-y: 0.25rem;
1036
+ --floe-floating-origin: center;
1038
1037
  }
1039
1038
  .floe-prompt-card-header {
1040
1039
  display: flex; align-items: center; flex-shrink: 0;