@udixio/ui-react 2.10.11 → 2.10.13

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,121 +0,0 @@
1
- let y = !1, h = null;
2
- function C() {
3
- if (typeof window > "u") return !1;
4
- try {
5
- if (window.CSS && typeof window.CSS.supports == "function")
6
- return CSS.supports("animation-timeline: view()") || CSS.supports("animation-timeline: scroll()") || CSS.supports("view-timeline-name: --a");
7
- } catch {
8
- }
9
- return !1;
10
- }
11
- function F() {
12
- return typeof window > "u" || !("matchMedia" in window) ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
13
- }
14
- function V(n, t) {
15
- return getComputedStyle(n).getPropertyValue(t).trim() || null;
16
- }
17
- function b(n) {
18
- if (!n) return null;
19
- const t = n.split(/\s+/), e = t[t.length - 1];
20
- if (!e) return null;
21
- if (e.endsWith("%")) {
22
- const r = parseFloat(e);
23
- if (!isNaN(r)) return Math.max(0, Math.min(100, r)) / 100;
24
- }
25
- return null;
26
- }
27
- function L(n) {
28
- const t = V(n, "--udx-range-start"), e = V(n, "--udx-range-end"), r = b(t) ?? 0.2, a = b(e) ?? 0.5, o = Math.max(0, Math.min(1, r)), l = Math.max(o + 1e-3, Math.min(1, a));
29
- return { start: o, end: l };
30
- }
31
- function i(n, t) {
32
- if (!n) return null;
33
- const e = n.trim(), r = parseFloat(e);
34
- return isNaN(r) ? null : r;
35
- }
36
- function p(n, t, e) {
37
- return n + (t - n) * e;
38
- }
39
- function N(n, t, e, r) {
40
- const a = t.opacity != null ? Number(t.opacity) : 1, o = e.opacity != null ? Number(e.opacity) : 1, l = p(a, o, r);
41
- n.style.opacity = String(l);
42
- const v = i(t["--tw-enter-translate-x"]) ?? i(t["--tw-exit-translate-x"]) ?? 0, g = i(t["--tw-enter-translate-y"]) ?? i(t["--tw-exit-translate-y"]) ?? 0, c = i(e["--tw-enter-translate-x"]) ?? i(e["--tw-exit-translate-x"]) ?? 0, u = i(e["--tw-enter-translate-y"]) ?? i(e["--tw-exit-translate-y"]) ?? 0, S = i(t["--tw-enter-scale"]) ?? i(t["--tw-exit-scale"]) ?? 1, M = i(e["--tw-enter-scale"]) ?? i(e["--tw-exit-scale"]) ?? 1, P = i(t["--tw-enter-rotate"]) ?? i(t["--tw-exit-rotate"]) ?? 0, f = i(e["--tw-enter-rotate"]) ?? i(e["--tw-exit-rotate"]) ?? 0, x = p(v, c, r), s = p(g, u, r), d = p(S, M, r), m = p(P, f, r), w = [];
43
- (x !== 0 || s !== 0) && w.push(`translate3d(${x}px, ${s}px, 0)`), d !== 1 && w.push(`scale(${d})`), m !== 0 && w.push(`rotate(${m}deg)`), n.style.transform = w.length ? w.join(" ") : "none";
44
- }
45
- function T(n) {
46
- const t = n.classList, e = t.contains("animate-in"), r = t.contains("animate-out");
47
- if (!e && !r) return null;
48
- const a = getComputedStyle(n), o = {
49
- opacity: i(a.getPropertyValue("--tw-enter-opacity")) ?? void 0,
50
- "--tw-enter-translate-x": a.getPropertyValue("--tw-enter-translate-x") || void 0,
51
- "--tw-enter-translate-y": a.getPropertyValue("--tw-enter-translate-y") || void 0,
52
- "--tw-enter-scale": a.getPropertyValue("--tw-enter-scale") || void 0,
53
- "--tw-enter-rotate": a.getPropertyValue("--tw-enter-rotate") || void 0
54
- }, l = {
55
- opacity: i(a.getPropertyValue("--tw-exit-opacity")) ?? void 0,
56
- "--tw-exit-translate-x": a.getPropertyValue("--tw-exit-translate-x") || void 0,
57
- "--tw-exit-translate-y": a.getPropertyValue("--tw-exit-translate-y") || void 0,
58
- "--tw-exit-scale": a.getPropertyValue("--tw-exit-scale") || void 0,
59
- "--tw-exit-rotate": a.getPropertyValue("--tw-exit-rotate") || void 0
60
- };
61
- return e ? {
62
- from: o,
63
- to: { opacity: 1, "--tw-enter-translate-x": "0", "--tw-enter-translate-y": "0", "--tw-enter-scale": "1", "--tw-enter-rotate": "0" }
64
- } : r ? {
65
- from: { opacity: 1, "--tw-exit-translate-x": "0", "--tw-exit-translate-y": "0", "--tw-exit-scale": "1", "--tw-exit-rotate": "0" },
66
- to: l
67
- } : null;
68
- }
69
- function $() {
70
- const n = [
71
- ".udx-view",
72
- ".udx-view-x",
73
- ".udx-view-y",
74
- ".udx-view-inline",
75
- ".udx-view-block",
76
- "[data-udx-view]"
77
- ].map((t) => `${t}.animate-in, ${t}.animate-out`).join(", ");
78
- return Array.from(document.querySelectorAll(n));
79
- }
80
- function k(n = {}) {
81
- if (y) return h || (() => {
82
- });
83
- if (typeof window > "u") return () => {
84
- };
85
- if (C() || F())
86
- return y = !0, () => {
87
- };
88
- y = !0;
89
- const t = n.once ?? !0, e = /* @__PURE__ */ new WeakSet();
90
- let r = null;
91
- const a = () => {
92
- const v = $(), g = window.innerHeight || 0;
93
- for (const c of v) {
94
- const u = c.getBoundingClientRect(), S = Math.min(u.bottom, g) - Math.max(u.top, 0), M = Math.max(0, Math.min(S, u.height)), P = u.height > 0 ? M / u.height : 0, { start: f, end: x } = L(c);
95
- let s = (P - f) / (x - f);
96
- s = Math.max(0, Math.min(1, s)), t && e.has(c) && s < 1 && (s = 1);
97
- const d = T(c);
98
- if (!d) continue;
99
- const { from: m, to: w } = d;
100
- N(c, m, w, s), s >= 1 && t && e.add(c);
101
- }
102
- }, o = () => {
103
- r == null && (r = window.requestAnimationFrame(() => {
104
- r = null, a();
105
- }));
106
- };
107
- a(), window.addEventListener("scroll", o, { passive: !0 }), window.addEventListener("resize", o);
108
- const l = new MutationObserver(() => {
109
- o();
110
- });
111
- return l.observe(document.documentElement, {
112
- childList: !0,
113
- subtree: !0,
114
- attributes: !0
115
- }), h = () => {
116
- window.removeEventListener("scroll", o), window.removeEventListener("resize", o), r != null && cancelAnimationFrame(r), l.disconnect(), y = !1, h = null;
117
- }, h;
118
- }
119
- export {
120
- k as initScrollViewFallback
121
- };