@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.
- package/dist/components/ui/PromptCard.d.ts +7 -2
- package/dist/components/ui/PromptCard.js +152 -123
- package/dist/components/ui/Select.d.ts +10 -0
- package/dist/components/ui/Select.js +294 -220
- package/dist/components/ui/floatingPresence.js +50 -45
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/floe.css +10 -11
- package/dist/full.js +294 -293
- package/dist/styles.css +1 -1
- package/dist/ui.js +148 -147
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createMemo as q, untrack as
|
|
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
|
|
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
|
|
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(","),
|
|
29
|
-
return i.transitionProperty.split(",").forEach((
|
|
30
|
-
const n =
|
|
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[
|
|
33
|
-
r === null || r <= 1 || (
|
|
34
|
-
}),
|
|
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 =
|
|
38
|
-
|
|
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
|
-
},
|
|
42
|
-
r !== null && (globalThis.clearTimeout(r), r = 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(),
|
|
47
|
-
|
|
48
|
+
if (h(), T(), f(c) && f(m) === "exiting") {
|
|
49
|
+
a("open");
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
n = null,
|
|
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(), !
|
|
56
|
-
|
|
60
|
+
if (h(), !f(c)) {
|
|
61
|
+
a("exiting");
|
|
57
62
|
return;
|
|
58
63
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
n = null,
|
|
62
|
-
}, o = e.element?.(),
|
|
63
|
-
if (o &&
|
|
64
|
-
const
|
|
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,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
for (const
|
|
74
|
-
if (!E.has(
|
|
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",
|
|
79
|
-
o.removeEventListener("transitionrun",
|
|
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
|
|
82
|
-
r = globalThis.setTimeout(S,
|
|
86
|
+
const P = Math.max(M.longestMs, e.exitDurationMs ?? 0) + O;
|
|
87
|
+
r = globalThis.setTimeout(S, P);
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
|
-
const
|
|
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,
|
|
88
|
-
},
|
|
92
|
+
r = null, y <= 1 ? x() : n = d(x);
|
|
93
|
+
}, y);
|
|
89
94
|
};
|
|
90
|
-
|
|
91
|
-
n =
|
|
95
|
+
y <= 1 ? b() : n = d(() => {
|
|
96
|
+
n = d(b);
|
|
92
97
|
});
|
|
93
98
|
}), A(() => {
|
|
94
|
-
h(),
|
|
99
|
+
h(), T();
|
|
95
100
|
}), {
|
|
96
101
|
mounted: c,
|
|
97
|
-
state:
|
|
98
|
-
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-
|
|
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.
|
|
1013
|
-
--floe-floating-exit-y: -0.
|
|
1014
|
-
--floe-floating-enter-scale: 0.
|
|
1015
|
-
--floe-floating-exit-scale: 0.
|
|
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.
|
|
1030
|
-
--floe-floating-exit-y: 0.
|
|
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-
|
|
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;
|