@cliquify.me/animations 8.0.2 → 9.0.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/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as S } from "react/jsx-runtime";
2
- import X, { useMemo as T } from "react";
3
- import { interpolate as R, Easing as M } from "remotion";
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import X, { useMemo as C } from "react";
3
+ import { interpolate as R, Easing as w } from "remotion";
4
4
  const I = () => ({
5
5
  scale: (t) => ({ transform: `scale(${t})` }),
6
6
  opacity: (t) => ({ opacity: t }),
@@ -11,7 +11,27 @@ const I = () => ({
11
11
  rotateY: (t) => ({ transform: `rotateY(${t}deg)` }),
12
12
  rotateX: (t) => ({ transform: `rotateX(${t}deg)` }),
13
13
  blur: (t) => ({ filter: `blur(${t}px)` }),
14
- brightness: (t) => ({ filter: `brightness(${t})` }),
14
+ brightness: (t) => ({ filter: `brightness(${t}%)` }),
15
+ contrast: (t) => ({ filter: `contrast(${t}%)` }),
16
+ grayscale: (t) => ({ filter: `grayscale(${t}%)` }),
17
+ hue: (t) => ({ filter: `hue-rotate(${t}deg)` }),
18
+ saturation: (t) => ({ filter: `saturate(${t}%)` }),
19
+ vignette: (t) => ({
20
+ filter: `contrast(${100 + t * 20}%) brightness(${100 - t * 20}%)`
21
+ }),
22
+ noise: (t) => ({
23
+ filter: `contrast(${100 + t * 40}%) brightness(${100 + t * 20}%)`
24
+ }),
25
+ pixelate: (t) => ({ filter: `contrast(${100 + t * 2}%)` }),
26
+ chromaticAberration: (t) => ({
27
+ filter: `hue-rotate(${t * 10}deg) contrast(110%)`
28
+ }),
29
+ lightLeak: (t) => ({
30
+ filter: `brightness(${100 + t * 50}%) saturate(${100 + t * 30}%)`
31
+ }),
32
+ duotone: (t) => ({
33
+ filter: `sepia(${t * 100}%) hue-rotate(${t * 180}deg)`
34
+ }),
15
35
  shakeHorizontalIn: (t) => ({
16
36
  transform: `translateX(${t}%)`,
17
37
  overflow: "hidden"
@@ -28,33 +48,33 @@ const I = () => ({
28
48
  transform: `translateY(${t}%)`,
29
49
  overflow: "hidden"
30
50
  })
31
- }), j = (t, n = 0) => {
32
- const e = [], l = t / 5;
33
- for (let s = 0; s < 6; s += 1)
34
- e.push(s * l + n);
35
- return e;
36
- }, D = (t, n, e, l = !1) => {
37
- const { from: s, to: o, ease: d } = n, r = n.durationInFrames || 30, i = Number(s), c = Number(o), a = Math.max(1, Number(r));
38
- if (isNaN(i) || isNaN(c))
51
+ }), j = (t, l = 0) => {
52
+ const r = [], c = t / 5;
53
+ for (let a = 0; a < 6; a += 1)
54
+ r.push(a * c + l);
55
+ return r;
56
+ }, T = (t, l, r, c = !1) => {
57
+ const { from: a, to: o, ease: d } = l, n = l.durationInFrames || 30, f = Number(a), i = Number(o), e = Math.max(1, Number(n));
58
+ if (isNaN(f) || isNaN(i))
39
59
  return console.error("Invalid animation values:", {
40
- from: s,
60
+ from: a,
41
61
  to: o,
42
- animationDurationInFrames: r,
43
- property: n.property
44
- }), i;
45
- r === void 0 && console.warn(
46
- `durationInFrames is undefined for animation: ${n.property}. Using 1 frame as default.`
62
+ animationDurationInFrames: n,
63
+ property: l.property
64
+ }), f;
65
+ n === void 0 && console.warn(
66
+ `durationInFrames is undefined for animation: ${l.property}. Using 1 frame as default.`
47
67
  );
48
- const f = l ? [e - r, e] : [0, a];
49
- if (n.property.includes("shake")) {
50
- const u = l ? j(
51
- a,
52
- e - r
53
- ) : j(a);
68
+ const s = l.delay || 0, u = c ? [r - e - s, r - s] : [s, s + e];
69
+ if (l.property.includes("shake")) {
70
+ const p = c ? j(
71
+ e,
72
+ r - e - s
73
+ ) : j(e, s);
54
74
  return R(
55
75
  t,
56
- u,
57
- [0, i, c, i, c, 0],
76
+ p,
77
+ [0, f, i, f, i, 0],
58
78
  {
59
79
  extrapolateLeft: "clamp",
60
80
  extrapolateRight: "clamp",
@@ -62,238 +82,232 @@ const I = () => ({
62
82
  }
63
83
  );
64
84
  }
65
- return R(t, f, [i, c], {
85
+ return R(t, u, [f, i], {
66
86
  extrapolateLeft: "clamp",
67
87
  extrapolateRight: "clamp",
68
88
  easing: d
69
89
  });
70
- }, V = (t, n, e, l) => {
71
- const s = n - (t.delay || 0) * (l ? -1 : 1) + (l ? 1 : 0), { property: o, durationInFrames: d } = t;
72
- if (!l && s > d) return {};
73
- const r = D(
74
- s,
75
- t,
76
- e,
77
- l
78
- ), i = I();
79
- return (i[o] || i.default)(r);
80
- }, A = (t, n, e, l = !1, s = !1) => X.useMemo(() => {
90
+ }, V = (t, l, r, c) => {
91
+ const { property: a } = t, o = T(l, t, r, c), d = I();
92
+ return (d[a] || d.default)(o);
93
+ }, E = (t, l, r, c = !1, a = !1) => X.useMemo(() => {
81
94
  if (t.length === 0) return {};
82
95
  const o = t.filter(
83
96
  (d) => d.from !== void 0 && d.to !== void 0
84
97
  );
85
- if (o.length !== t.length && console.error("Some animations are invalid and will be ignored"), s) {
86
- const d = [], r = {};
87
- o.reverse().forEach((a) => {
88
- const f = V(a, e, n, !1);
89
- if (a.persist === !0 && e - (a.delay || 0) >= a.durationInFrames) {
90
- const v = a.to, g = I(), h = (g[a.property] || g.default)(v);
91
- Object.keys(h).forEach((b) => {
92
- b === "transform" ? r[b] = r[b] ? {
93
- [b]: `${r[b][b]} ${h[b]}`
94
- } : h : r[b] = h;
98
+ if (o.length !== t.length && console.error("Some animations are invalid and will be ignored"), a) {
99
+ const d = [], n = {};
100
+ o.reverse().forEach((e) => {
101
+ const s = V(e, r, l, !1);
102
+ if (e.persist === !0 && r - (e.delay || 0) >= e.durationInFrames) {
103
+ const p = e.to, v = I(), h = (v[e.property] || v.default)(p);
104
+ Object.keys(h).forEach(($) => {
105
+ $ === "transform" ? n[$] = n[$] ? {
106
+ [$]: `${n[$][$]} ${h[$]}`
107
+ } : h : n[$] = h;
95
108
  });
96
109
  }
97
- d.push(f);
110
+ d.push(s);
98
111
  });
99
- const c = { ...d.reduce(
100
- (a, f) => (Object.keys(f).forEach((u) => {
101
- u === "transform" ? a[u] = a[u] ? `${a[u]} ${f[u]}` : f[u] : a[u] = f[u];
102
- }), a),
112
+ const i = { ...d.reduce(
113
+ (e, s) => (Object.keys(s).forEach((u) => {
114
+ u === "transform" || u === "filter" ? e[u] = e[u] ? `${e[u]} ${s[u]}` : s[u] : e[u] = s[u];
115
+ }), e),
103
116
  {}
104
117
  ) };
105
- return Object.keys(r).forEach((a) => {
106
- const f = r[a];
107
- a === "transform" && f.transform ? c.transform = c.transform ? `${c.transform} ${f.transform}` : f.transform : f[a] !== void 0 && (c[a] = f[a]);
108
- }), c;
118
+ return Object.keys(n).forEach((e) => {
119
+ const s = n[e];
120
+ (e === "transform" || e === "filter") && s[e] ? i[e] = i[e] ? `${i[e]} ${s[e]}` : String(s[e]) : s[e] !== void 0 && (i[e] = s[e]);
121
+ }), i;
109
122
  } else
110
- return o.map((r) => V(r, e, n, l)).reduce(
111
- (r, i) => (Object.keys(i).forEach((c) => {
112
- c === "transform" ? r[c] = r[c] ? `${r[c]} ${i[c]}` : i[c] : r[c] = i[c];
113
- }), r),
123
+ return o.map((n) => V(n, r, l, c)).reduce(
124
+ (n, f) => (Object.keys(f).forEach((i) => {
125
+ i === "transform" || i === "filter" ? n[i] = n[i] ? `${n[i]} ${f[i]}` : f[i] : n[i] = f[i];
126
+ }), n),
114
127
  {}
115
128
  );
116
- }, [t, e, n, l]), E = (t) => t ? Array.isArray(t) ? t : [t] : [], L = (...t) => {
117
- const n = [];
118
- return t.forEach((e) => {
119
- Array.isArray(e) ? n.push(...e) : e && n.push(e);
120
- }), n.filter((e) => e !== void 0).reduce((e, l) => e.find(
121
- (o) => o.property === l.property
122
- ) ? e.map(
123
- (o) => o.property === l.property ? {
129
+ }, [t, r, l, c]), A = (t) => t ? Array.isArray(t) ? t : [t] : [], P = (...t) => {
130
+ const l = [];
131
+ return t.forEach((r) => {
132
+ Array.isArray(r) ? l.push(...r) : r && l.push(r);
133
+ }), l.filter((r) => r !== void 0).reduce((r, c) => r.find(
134
+ (o) => o.property === c.property
135
+ ) ? r.map(
136
+ (o) => o.property === c.property ? {
124
137
  ...o,
125
- from: Math.min(o.from, l.from),
126
- to: Math.max(o.to, l.to),
138
+ from: Math.min(o.from, c.from),
139
+ to: Math.max(o.to, c.to),
127
140
  durationInFrames: Math.max(
128
141
  o.durationInFrames,
129
- l.durationInFrames
142
+ c.durationInFrames
130
143
  ),
131
- delay: Math.min(o.delay || 0, l.delay || 0),
132
- ease: (d) => (o.ease(d) + l.ease(d)) / 2
144
+ delay: Math.min(o.delay || 0, c.delay || 0),
145
+ ease: (d) => (o.ease(d) + c.ease(d)) / 2
133
146
  // Average the easing functions
134
147
  } : o
135
- ) : [...e, l], []);
136
- }, W = ({
148
+ ) : [...r, c], []);
149
+ }, z = ({
137
150
  animationIn: t,
138
- animationOut: n,
139
- durationInFrames: e,
140
- children: l,
141
- style: s = {},
151
+ animationOut: l,
152
+ durationInFrames: r,
153
+ children: c,
154
+ style: a = {},
142
155
  frame: o,
143
156
  isTransition: d = !1
144
157
  }) => {
145
- var Y;
146
- const r = A(
147
- E(t),
148
- e,
158
+ var F;
159
+ const n = E(
160
+ A(t),
161
+ r,
149
162
  o,
150
163
  !1
151
- ), i = A(
152
- E(n),
153
- e,
164
+ ), f = E(
165
+ A(l),
166
+ r,
154
167
  o,
155
168
  !0
156
- ), c = X.useMemo(() => {
157
- const p = Object.keys(r).length > 0, m = t == null ? void 0 : t.reduce(
158
- (w, x) => Math.min(w, x.delay || 0),
169
+ ), i = X.useMemo(() => {
170
+ const m = Object.keys(n).length > 0, g = t == null ? void 0 : t.reduce(
171
+ (M, S) => Math.min(M, S.delay || 0),
159
172
  1 / 0
160
- ), $ = o - (m || 0);
161
- return p && $ < 0 ? { visibility: d ? "visible" : "hidden" } : r;
162
- }, [r, o, t]), a = X.useMemo(() => {
163
- const p = (n == null ? void 0 : n.length) > 0, m = n == null ? void 0 : n.reduce(
164
- ($, w) => {
165
- const x = w.delay || 0;
166
- return Math.max($, x);
167
- },
168
- 0
169
- );
170
- return p && o > e - m ? { visibility: d ? "visible" : "hidden" } : i;
171
- }, [i, o, n]), u = ((s == null ? void 0 : s.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), v = u ? parseFloat(u[1]) : 0, g = -v, h = X.useMemo(() => {
172
- const p = {
173
- ...c
173
+ ), b = o - (g || 0);
174
+ return m && b < 0 ? { visibility: d ? "visible" : "hidden" } : n;
175
+ }, [n, o, t]), e = X.useMemo(() => {
176
+ if (o >= r)
177
+ return { visibility: d ? "visible" : "hidden" };
178
+ const m = A(l);
179
+ if (!m || m.length === 0) return {};
180
+ let g = 0;
181
+ m.forEach((M) => {
182
+ const S = (M.durationInFrames || 0) + (M.delay || 0);
183
+ S > g && (g = S);
184
+ });
185
+ const b = Math.max(0, r - g);
186
+ return o < b ? {} : f;
187
+ }, [f, o, l, r, d]), u = ((a == null ? void 0 : a.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), p = u ? parseFloat(u[1]) : 0, v = -p, h = X.useMemo(() => {
188
+ const m = {
189
+ ...i
174
190
  // , ...timedStyle
175
191
  };
176
- return Object.entries(a).forEach(([m, $]) => {
177
- m === "transform" ? p[m] = `${p[m] || ""} ${$ || ""}`.trim() : m in p && typeof p[m] == "number" && typeof $ == "number" ? p[m] = p[m] * $ : p[m] = $;
178
- }), p;
179
- }, [c, a]);
180
- if ((Y = h.transform) != null && Y.includes("rotate")) {
181
- const p = h.transform;
182
- h.transform = p.replace(
192
+ return Object.entries(e).forEach(([g, b]) => {
193
+ g === "transform" ? m[g] = `${m[g] || ""} ${b || ""}`.trim() : g in m && typeof m[g] == "number" && typeof b == "number" ? m[g] = m[g] * b : m[g] = b;
194
+ }), m;
195
+ }, [i, e]);
196
+ if ((F = h.transform) != null && F.includes("rotate")) {
197
+ const m = h.transform;
198
+ h.transform = m.replace(
183
199
  /rotate\(([^)]+)deg\)/,
184
- (m, $) => `rotate(${parseFloat($) - g}deg)`
200
+ (g, b) => `rotate(${parseFloat(b) - v}deg)`
185
201
  );
186
202
  }
187
- const b = T(() => {
188
- const p = h.transform || "", {
189
- translateX: m,
190
- translateY: $,
191
- scale: w,
192
- rotation: x,
193
- rotateX: C,
203
+ const $ = C(() => {
204
+ const m = h.transform || "", {
205
+ translateX: g,
206
+ translateY: b,
207
+ scale: M,
208
+ rotation: S,
209
+ rotateX: O,
194
210
  rotateY: H,
195
211
  rotateZ: N
196
- } = Z(p);
197
- return `${m} ${$} ${w} ${x || `rotate(${v}deg)`} ${C} ${H} ${N}`.trim();
198
- }, [h, v]);
199
- let y = r;
200
- return v > 0 && y.transform && y.transform.includes("translateX") && (y = {
212
+ } = D(m);
213
+ return `${g} ${b} ${M} ${S || `rotate(${p}deg)`} ${O} ${H} ${N}`.trim();
214
+ }, [h, p]);
215
+ let y = n;
216
+ return p > 0 && y.transform && y.transform.includes("translateX") && (y = {
201
217
  ...y,
202
218
  transform: y.transform.replace(
203
219
  /translateX\(([^)]+)\)/g,
204
- (p, m) => `translateX(${parseFloat(m)}%)`
220
+ (m, g) => `translateX(${parseFloat(g)}%)`
205
221
  )
206
- }), /* @__PURE__ */ S(
222
+ }), /* @__PURE__ */ x(
207
223
  "div",
208
224
  {
209
225
  style: {
226
+ transform: "scale(1)",
210
227
  overflow: h.overflow || "visible",
211
228
  pointerEvents: "none",
212
- ...y,
213
- transform: (y.transform || "") + ` -rotate(${g}deg) scale(1)`,
214
- background: Object.keys(h).length === 0 ? "transparent" : h.backgroundColor,
215
229
  display: "flex",
216
230
  justifyContent: "center"
217
231
  },
218
- children: /* @__PURE__ */ S(
232
+ children: /* @__PURE__ */ x(
219
233
  "div",
220
234
  {
221
235
  style: {
222
- ...s,
236
+ ...a,
223
237
  ...h,
224
- rotate: `${g}deg`,
238
+ rotate: `${v}deg`,
225
239
  overflow: "visible",
226
- transform: b,
240
+ transform: $,
227
241
  pointerEvents: "none",
228
242
  background: Object.keys(h).length === 0 ? "transparent" : h.backgroundColor
229
243
  },
230
- children: l
244
+ children: c
231
245
  }
232
246
  )
233
247
  }
234
248
  );
235
- }, Z = (t) => {
236
- let n = "", e = "", l = "scale(1)", s = "", o = "", d = "", r = "";
237
- const i = t.match(/translateX\([^)]+\)/);
238
- i && (n = i[0]);
239
- const c = t.match(/translateY\([^)]+\)/);
240
- c && (e = c[0]);
241
- const a = t.match(/scale\([^)]+\)/);
242
- a && (l = a[0]);
243
- const f = t.match(/rotate\([^)]+\)/);
244
- f && (s = f[0]);
245
- const u = t.match(/rotateX\([^)]+\)/);
246
- u && (o = u[0]);
247
- const v = t.match(/rotateY\([^)]+\)/);
248
- v && (d = v[0]);
249
- const g = t.match(/rotateZ\([^)]+\)/);
250
- return g && (r = g[0]), { translateX: n, translateY: e, scale: l, rotation: s, rotateX: o, rotateY: d, rotateZ: r };
251
- }, B = ({
249
+ }, D = (t) => {
250
+ let l = "", r = "", c = "scale(1)", a = "", o = "", d = "", n = "";
251
+ const f = t.match(/translateX\([^)]+\)/g);
252
+ f && (l = f[f.length - 1]);
253
+ const i = t.match(/translateY\([^)]+\)/g);
254
+ i && (r = i[i.length - 1]);
255
+ const e = t.match(/scale\([^)]+\)/g);
256
+ e && (c = e[e.length - 1]);
257
+ const s = t.match(/rotate\([^)]+\)/g);
258
+ s && (a = s[s.length - 1]);
259
+ const u = t.match(/rotateX\([^)]+\)/g);
260
+ u && (o = u[u.length - 1]);
261
+ const p = t.match(/rotateY\([^)]+\)/g);
262
+ p && (d = p[p.length - 1]);
263
+ const v = t.match(/rotateZ\([^)]+\)/g);
264
+ return v && (n = v[v.length - 1]), { translateX: l, translateY: r, scale: c, rotation: a, rotateX: o, rotateY: d, rotateZ: n };
265
+ }, W = ({
252
266
  animationTimed: t,
253
- durationInFrames: n,
254
- children: e,
255
- style: l = {},
256
- frame: s
267
+ durationInFrames: l,
268
+ children: r,
269
+ style: c = {},
270
+ frame: a
257
271
  }) => {
258
272
  var u;
259
- const o = A(
260
- E(t),
261
- n,
262
- s,
273
+ const o = E(
274
+ A(t),
275
+ l,
276
+ a,
263
277
  !1,
264
278
  !0
265
- ), r = ((l == null ? void 0 : l.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), i = r ? parseFloat(r[1]) : 0, c = -i, a = X.useMemo(() => ({
279
+ ), n = ((c == null ? void 0 : c.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), f = n ? parseFloat(n[1]) : 0, i = -f, e = X.useMemo(() => ({
266
280
  ...o
267
281
  }), [o]);
268
- if ((u = a.transform) != null && u.includes("rotate")) {
269
- const v = a.transform;
270
- a.transform = v.replace(
282
+ if ((u = e.transform) != null && u.includes("rotate")) {
283
+ const p = e.transform;
284
+ e.transform = p.replace(
271
285
  /rotate\(([^)]+)deg\)/,
272
- (g, h) => `rotate(${parseFloat(h) - c}deg)`
286
+ (v, h) => `rotate(${parseFloat(h) - i}deg)`
273
287
  );
274
288
  }
275
- let f = a;
276
- return i > 0 && f.transform && f.transform.includes("translateX") && (f = {
277
- ...f,
278
- transform: f.transform.replace(
289
+ let s = e;
290
+ return f > 0 && s.transform && s.transform.includes("translateX") && (s = {
291
+ ...s,
292
+ transform: s.transform.replace(
279
293
  /translateX\(([^)]+)\)/g,
280
- (v, g) => `translateX(${parseFloat(g)}px)`
294
+ (p, v) => `translateX(${parseFloat(v)}px)`
281
295
  )
282
- }), /* @__PURE__ */ S(
296
+ }), /* @__PURE__ */ x(
283
297
  "div",
284
298
  {
285
299
  style: {
286
- overflow: a.overflow || "visible",
300
+ overflow: e.overflow || "visible",
287
301
  pointerEvents: "none",
288
- height: l.height,
289
- width: l.width,
290
- ...f
302
+ height: c.height,
303
+ width: c.width,
304
+ ...s
291
305
  },
292
- children: /* @__PURE__ */ S(
306
+ children: /* @__PURE__ */ x(
293
307
  "div",
294
308
  {
295
309
  style: {
296
- ...a,
310
+ ...e,
297
311
  overflow: "visible",
298
312
  pointerEvents: "none",
299
313
  height: "100%",
@@ -302,53 +316,53 @@ const I = () => ({
302
316
  alignItems: "center",
303
317
  justifyContent: "center"
304
318
  },
305
- children: e
319
+ children: r
306
320
  }
307
321
  )
308
322
  }
309
323
  );
310
- }, F = (t) => {
324
+ }, Y = (t) => {
311
325
  if (typeof (t == null ? void 0 : t.ease) == "function") return t.ease;
312
326
  switch (t == null ? void 0 : t.easing) {
313
327
  case "ease-in":
314
- return M.in(M.cubic);
328
+ return w.in(w.cubic);
315
329
  case "ease-out":
316
- return M.out(M.cubic);
330
+ return w.out(w.cubic);
317
331
  case "ease-in-out":
318
- return M.inOut(M.cubic);
332
+ return w.inOut(w.cubic);
319
333
  case "linear":
320
334
  default:
321
- return M.linear;
335
+ return w.linear;
322
336
  }
323
- }, U = ({
337
+ }, B = ({
324
338
  children: t,
325
- frame: n,
326
- item: e,
327
- keyframeAnimations: l
339
+ frame: l,
340
+ item: r,
341
+ keyframeAnimations: c
328
342
  }) => {
329
- var g, h;
330
- const s = l ? [...l].reverse().find((b) => b.property.includes("maskReveal")) : void 0, o = ((g = e.details.crop) == null ? void 0 : g.width) || e.details.width, d = ((h = e.details.crop) == null ? void 0 : h.height) || e.details.height;
331
- let r = 1, i = r, c = d, a = 0, f = 0, u = o, v;
332
- return (n || 0) - e.display.from >= 0 && (s == null ? void 0 : s.property) === "maskRevealIn" ? (r = Math.min((n || 0) / s.durationInFrames, 1), i = Math.max(0, Math.min(1, F(s)(r))), c = d * i) : (n || 0) - e.display.from >= 0 && (s == null ? void 0 : s.property) === "maskRevealCenterIn" ? (r = Math.min((n || 0) / s.durationInFrames, 1), i = Math.max(0, Math.min(1, F(s)(r))), u = o, c = d, a = 0, f = 0, v = `circle(${Math.max(o, d) * i}px at 50% 50%)`) : (n || 0) - e.display.from >= 0 && (s == null ? void 0 : s.property) === "maskRevealCornerIn" && (r = Math.min((n || 0) / s.durationInFrames, 1), i = Math.max(0, Math.min(1, F(s)(r))), u = o * i, c = d * i, a = o - u, f = 0), /* @__PURE__ */ S(
343
+ var v, h;
344
+ const a = c ? [...c].reverse().find(($) => $.property.includes("maskReveal")) : void 0, o = ((v = r.details.crop) == null ? void 0 : v.width) || r.details.width, d = ((h = r.details.crop) == null ? void 0 : h.height) || r.details.height;
345
+ let n = 1, f = n, i = d, e = 0, s = 0, u = o, p;
346
+ return (l || 0) >= 0 && (a == null ? void 0 : a.property) === "maskRevealIn" ? (n = Math.min((l || 0) / a.durationInFrames, 1), f = Math.max(0, Math.min(1, Y(a)(n))), i = d * f) : (l || 0) >= 0 && (a == null ? void 0 : a.property) === "maskRevealCenterIn" ? (n = Math.min((l || 0) / a.durationInFrames, 1), f = Math.max(0, Math.min(1, Y(a)(n))), u = o, i = d, e = 0, s = 0, p = `circle(${Math.max(o, d) * f}px at 50% 50%)`) : (l || 0) >= 0 && (a == null ? void 0 : a.property) === "maskRevealCornerIn" && (n = Math.min((l || 0) / a.durationInFrames, 1), f = Math.max(0, Math.min(1, Y(a)(n))), u = o * f, i = d * f, e = o - u, s = 0), /* @__PURE__ */ x(
333
347
  "div",
334
348
  {
335
349
  style: {
336
350
  width: o,
337
351
  height: d,
338
352
  position: "relative",
339
- overflow: i < 1 ? "hidden" : "visible"
353
+ overflow: f < 1 ? "hidden" : "visible"
340
354
  },
341
- children: /* @__PURE__ */ S(
355
+ children: /* @__PURE__ */ x(
342
356
  "div",
343
357
  {
344
358
  style: {
345
359
  position: "absolute",
346
- left: a,
347
- top: f,
360
+ left: e,
361
+ top: s,
348
362
  width: u,
349
- height: c,
350
- overflow: i < 1 ? "hidden" : "visible",
351
- clipPath: v
363
+ height: i,
364
+ overflow: f < 1 ? "hidden" : "visible",
365
+ clipPath: p
352
366
  },
353
367
  children: t
354
368
  }
@@ -357,11 +371,11 @@ const I = () => ({
357
371
  );
358
372
  };
359
373
  export {
360
- W as BoxAnim,
361
- B as ContentAnim,
362
- U as MaskAnim,
363
- L as combine,
364
- E as combineAnimations,
365
- Z as extractTransformations,
366
- A as useAnimation
374
+ z as BoxAnim,
375
+ W as ContentAnim,
376
+ B as MaskAnim,
377
+ P as combine,
378
+ A as combineAnimations,
379
+ D as extractTransformations,
380
+ E as useAnimation
367
381
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(g,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react/jsx-runtime"),require("react"),require("remotion")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","remotion"],M):(g=typeof globalThis<"u"?globalThis:g||self,M(g.animations={},g.jsxRuntime,g.React,g.remotion))})(this,function(g,M,x,S){"use strict";const Y=()=>({scale:t=>({transform:`scale(${t})`}),opacity:t=>({opacity:t}),translateX:t=>({transform:`translateX(${t}%)`}),translateY:t=>({transform:`translateY(${t}%)`}),rotate:t=>({transform:`rotate(${t}deg)`}),default:()=>({}),rotateY:t=>({transform:`rotateY(${t}deg)`}),rotateX:t=>({transform:`rotateX(${t}deg)`}),blur:t=>({filter:`blur(${t}px)`}),brightness:t=>({filter:`brightness(${t})`}),shakeHorizontalIn:t=>({transform:`translateX(${t}%)`,overflow:"hidden"}),shakeVerticalIn:t=>({transform:`translateY(${t}%)`,overflow:"hidden"}),shakeHorizontalOut:t=>({transform:`translateX(${t}%)`,overflow:"hidden"}),shakeVerticalOut:t=>({transform:`translateY(${t}%)`,overflow:"hidden"})}),V=(t,o=0)=>{const e=[],l=t/5;for(let s=0;s<6;s+=1)e.push(s*l+o);return e},H=(t,o,e,l=!1)=>{const{from:s,to:n,ease:d}=o,r=o.durationInFrames||30,i=Number(s),c=Number(n),a=Math.max(1,Number(r));if(isNaN(i)||isNaN(c))return console.error("Invalid animation values:",{from:s,to:n,animationDurationInFrames:r,property:o.property}),i;r===void 0&&console.warn(`durationInFrames is undefined for animation: ${o.property}. Using 1 frame as default.`);const f=l?[e-r,e]:[0,a];if(o.property.includes("shake")){const u=l?V(a,e-r):V(a);return S.interpolate(t,u,[0,i,c,i,c,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:d})}return S.interpolate(t,f,[i,c],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:d})},I=(t,o,e,l)=>{const s=o-(t.delay||0)*(l?-1:1)+(l?1:0),{property:n,durationInFrames:d}=t;if(!l&&s>d)return{};const r=H(s,t,e,l),i=Y();return(i[n]||i.default)(r)},A=(t,o,e,l=!1,s=!1)=>x.useMemo(()=>{if(t.length===0)return{};const n=t.filter(d=>d.from!==void 0&&d.to!==void 0);if(n.length!==t.length&&console.error("Some animations are invalid and will be ignored"),s){const d=[],r={};n.reverse().forEach(a=>{const f=I(a,e,o,!1);if(a.persist===!0&&e-(a.delay||0)>=a.durationInFrames){const v=a.to,b=Y(),h=(b[a.property]||b.default)(v);Object.keys(h).forEach($=>{$==="transform"?r[$]=r[$]?{[$]:`${r[$][$]} ${h[$]}`}:h:r[$]=h})}d.push(f)});const c={...d.reduce((a,f)=>(Object.keys(f).forEach(u=>{u==="transform"?a[u]=a[u]?`${a[u]} ${f[u]}`:f[u]:a[u]=f[u]}),a),{})};return Object.keys(r).forEach(a=>{const f=r[a];a==="transform"&&f.transform?c.transform=c.transform?`${c.transform} ${f.transform}`:f.transform:f[a]!==void 0&&(c[a]=f[a])}),c}else return n.map(r=>I(r,e,o,l)).reduce((r,i)=>(Object.keys(i).forEach(c=>{c==="transform"?r[c]=r[c]?`${r[c]} ${i[c]}`:i[c]:r[c]=i[c]}),r),{})},[t,e,o,l]),j=t=>t?Array.isArray(t)?t:[t]:[],N=(...t)=>{const o=[];return t.forEach(e=>{Array.isArray(e)?o.push(...e):e&&o.push(e)}),o.filter(e=>e!==void 0).reduce((e,l)=>e.find(n=>n.property===l.property)?e.map(n=>n.property===l.property?{...n,from:Math.min(n.from,l.from),to:Math.max(n.to,l.to),durationInFrames:Math.max(n.durationInFrames,l.durationInFrames),delay:Math.min(n.delay||0,l.delay||0),ease:d=>(n.ease(d)+l.ease(d))/2}:n):[...e,l],[])},R=({animationIn:t,animationOut:o,durationInFrames:e,children:l,style:s={},frame:n,isTransition:d=!1})=>{var C;const r=A(j(t),e,n,!1),i=A(j(o),e,n,!0),c=x.useMemo(()=>{const p=Object.keys(r).length>0,m=t==null?void 0:t.reduce((E,X)=>Math.min(E,X.delay||0),1/0),y=n-(m||0);return p&&y<0?{visibility:d?"visible":"hidden"}:r},[r,n,t]),a=x.useMemo(()=>{const p=(o==null?void 0:o.length)>0,m=o==null?void 0:o.reduce((y,E)=>{const X=E.delay||0;return Math.max(y,X)},0);return p&&n>e-m?{visibility:d?"visible":"hidden"}:i},[i,n,o]),u=((s==null?void 0:s.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),v=u?parseFloat(u[1]):0,b=-v,h=x.useMemo(()=>{const p={...c};return Object.entries(a).forEach(([m,y])=>{m==="transform"?p[m]=`${p[m]||""} ${y||""}`.trim():m in p&&typeof p[m]=="number"&&typeof y=="number"?p[m]=p[m]*y:p[m]=y}),p},[c,a]);if((C=h.transform)!=null&&C.includes("rotate")){const p=h.transform;h.transform=p.replace(/rotate\(([^)]+)deg\)/,(m,y)=>`rotate(${parseFloat(y)-b}deg)`)}const $=x.useMemo(()=>{const p=h.transform||"",{translateX:m,translateY:y,scale:E,rotation:X,rotateX:Z,rotateY:_,rotateZ:q}=T(p);return`${m} ${y} ${E} ${X||`rotate(${v}deg)`} ${Z} ${_} ${q}`.trim()},[h,v]);let w=r;return v>0&&w.transform&&w.transform.includes("translateX")&&(w={...w,transform:w.transform.replace(/translateX\(([^)]+)\)/g,(p,m)=>`translateX(${parseFloat(m)}%)`)}),M.jsx("div",{style:{overflow:h.overflow||"visible",pointerEvents:"none",...w,transform:(w.transform||"")+` -rotate(${b}deg) scale(1)`,background:Object.keys(h).length===0?"transparent":h.backgroundColor,display:"flex",justifyContent:"center"},children:M.jsx("div",{style:{...s,...h,rotate:`${b}deg`,overflow:"visible",transform:$,pointerEvents:"none",background:Object.keys(h).length===0?"transparent":h.backgroundColor},children:l})})},T=t=>{let o="",e="",l="scale(1)",s="",n="",d="",r="";const i=t.match(/translateX\([^)]+\)/);i&&(o=i[0]);const c=t.match(/translateY\([^)]+\)/);c&&(e=c[0]);const a=t.match(/scale\([^)]+\)/);a&&(l=a[0]);const f=t.match(/rotate\([^)]+\)/);f&&(s=f[0]);const u=t.match(/rotateX\([^)]+\)/);u&&(n=u[0]);const v=t.match(/rotateY\([^)]+\)/);v&&(d=v[0]);const b=t.match(/rotateZ\([^)]+\)/);return b&&(r=b[0]),{translateX:o,translateY:e,scale:l,rotation:s,rotateX:n,rotateY:d,rotateZ:r}},D=({animationTimed:t,durationInFrames:o,children:e,style:l={},frame:s})=>{var u;const n=A(j(t),o,s,!1,!0),r=((l==null?void 0:l.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),i=r?parseFloat(r[1]):0,c=-i,a=x.useMemo(()=>({...n}),[n]);if((u=a.transform)!=null&&u.includes("rotate")){const v=a.transform;a.transform=v.replace(/rotate\(([^)]+)deg\)/,(b,h)=>`rotate(${parseFloat(h)-c}deg)`)}let f=a;return i>0&&f.transform&&f.transform.includes("translateX")&&(f={...f,transform:f.transform.replace(/translateX\(([^)]+)\)/g,(v,b)=>`translateX(${parseFloat(b)}px)`)}),M.jsx("div",{style:{overflow:a.overflow||"visible",pointerEvents:"none",height:l.height,width:l.width,...f},children:M.jsx("div",{style:{...a,overflow:"visible",pointerEvents:"none",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e})})},F=t=>{if(typeof(t==null?void 0:t.ease)=="function")return t.ease;switch(t==null?void 0:t.easing){case"ease-in":return S.Easing.in(S.Easing.cubic);case"ease-out":return S.Easing.out(S.Easing.cubic);case"ease-in-out":return S.Easing.inOut(S.Easing.cubic);case"linear":default:return S.Easing.linear}},P=({children:t,frame:o,item:e,keyframeAnimations:l})=>{var b,h;const s=l?[...l].reverse().find($=>$.property.includes("maskReveal")):void 0,n=((b=e.details.crop)==null?void 0:b.width)||e.details.width,d=((h=e.details.crop)==null?void 0:h.height)||e.details.height;let r=1,i=r,c=d,a=0,f=0,u=n,v;return(o||0)-e.display.from>=0&&(s==null?void 0:s.property)==="maskRevealIn"?(r=Math.min((o||0)/s.durationInFrames,1),i=Math.max(0,Math.min(1,F(s)(r))),c=d*i):(o||0)-e.display.from>=0&&(s==null?void 0:s.property)==="maskRevealCenterIn"?(r=Math.min((o||0)/s.durationInFrames,1),i=Math.max(0,Math.min(1,F(s)(r))),u=n,c=d,a=0,f=0,v=`circle(${Math.max(n,d)*i}px at 50% 50%)`):(o||0)-e.display.from>=0&&(s==null?void 0:s.property)==="maskRevealCornerIn"&&(r=Math.min((o||0)/s.durationInFrames,1),i=Math.max(0,Math.min(1,F(s)(r))),u=n*i,c=d*i,a=n-u,f=0),M.jsx("div",{style:{width:n,height:d,position:"relative",overflow:i<1?"hidden":"visible"},children:M.jsx("div",{style:{position:"absolute",left:a,top:f,width:u,height:c,overflow:i<1?"hidden":"visible",clipPath:v},children:t})})};g.BoxAnim=R,g.ContentAnim=D,g.MaskAnim=P,g.combine=N,g.combineAnimations=j,g.extractTransformations=T,g.useAnimation=A,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
1
+ (function(v,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react/jsx-runtime"),require("react"),require("remotion")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","remotion"],S):(v=typeof globalThis<"u"?globalThis:v||self,S(v.animations={},v.jsxRuntime,v.React,v.remotion))})(this,function(v,S,x,w){"use strict";const F=()=>({scale:t=>({transform:`scale(${t})`}),opacity:t=>({opacity:t}),translateX:t=>({transform:`translateX(${t}%)`}),translateY:t=>({transform:`translateY(${t}%)`}),rotate:t=>({transform:`rotate(${t}deg)`}),default:()=>({}),rotateY:t=>({transform:`rotateY(${t}deg)`}),rotateX:t=>({transform:`rotateX(${t}deg)`}),blur:t=>({filter:`blur(${t}px)`}),brightness:t=>({filter:`brightness(${t}%)`}),contrast:t=>({filter:`contrast(${t}%)`}),grayscale:t=>({filter:`grayscale(${t}%)`}),hue:t=>({filter:`hue-rotate(${t}deg)`}),saturation:t=>({filter:`saturate(${t}%)`}),vignette:t=>({filter:`contrast(${100+t*20}%) brightness(${100-t*20}%)`}),noise:t=>({filter:`contrast(${100+t*40}%) brightness(${100+t*20}%)`}),pixelate:t=>({filter:`contrast(${100+t*2}%)`}),chromaticAberration:t=>({filter:`hue-rotate(${t*10}deg) contrast(110%)`}),lightLeak:t=>({filter:`brightness(${100+t*50}%) saturate(${100+t*30}%)`}),duotone:t=>({filter:`sepia(${t*100}%) hue-rotate(${t*180}deg)`}),shakeHorizontalIn:t=>({transform:`translateX(${t}%)`,overflow:"hidden"}),shakeVerticalIn:t=>({transform:`translateY(${t}%)`,overflow:"hidden"}),shakeHorizontalOut:t=>({transform:`translateX(${t}%)`,overflow:"hidden"}),shakeVerticalOut:t=>({transform:`translateY(${t}%)`,overflow:"hidden"})}),V=(t,i=0)=>{const r=[],c=t/5;for(let a=0;a<6;a+=1)r.push(a*c+i);return r},C=(t,i,r,c=!1)=>{const{from:a,to:n,ease:d}=i,o=i.durationInFrames||30,f=Number(a),l=Number(n),e=Math.max(1,Number(o));if(isNaN(f)||isNaN(l))return console.error("Invalid animation values:",{from:a,to:n,animationDurationInFrames:o,property:i.property}),f;o===void 0&&console.warn(`durationInFrames is undefined for animation: ${i.property}. Using 1 frame as default.`);const s=i.delay||0,u=c?[r-e-s,r-s]:[s,s+e];if(i.property.includes("shake")){const p=c?V(e,r-e-s):V(e,s);return w.interpolate(t,p,[0,f,l,f,l,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:d})}return w.interpolate(t,u,[f,l],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:d})},T=(t,i,r,c)=>{const{property:a}=t,n=C(i,t,r,c),d=F();return(d[a]||d.default)(n)},j=(t,i,r,c=!1,a=!1)=>x.useMemo(()=>{if(t.length===0)return{};const n=t.filter(d=>d.from!==void 0&&d.to!==void 0);if(n.length!==t.length&&console.error("Some animations are invalid and will be ignored"),a){const d=[],o={};n.reverse().forEach(e=>{const s=T(e,r,i,!1);if(e.persist===!0&&r-(e.delay||0)>=e.durationInFrames){const p=e.to,$=F(),h=($[e.property]||$.default)(p);Object.keys(h).forEach(b=>{b==="transform"?o[b]=o[b]?{[b]:`${o[b][b]} ${h[b]}`}:h:o[b]=h})}d.push(s)});const l={...d.reduce((e,s)=>(Object.keys(s).forEach(u=>{u==="transform"||u==="filter"?e[u]=e[u]?`${e[u]} ${s[u]}`:s[u]:e[u]=s[u]}),e),{})};return Object.keys(o).forEach(e=>{const s=o[e];(e==="transform"||e==="filter")&&s[e]?l[e]=l[e]?`${l[e]} ${s[e]}`:String(s[e]):s[e]!==void 0&&(l[e]=s[e])}),l}else return n.map(o=>T(o,r,i,c)).reduce((o,f)=>(Object.keys(f).forEach(l=>{l==="transform"||l==="filter"?o[l]=o[l]?`${o[l]} ${f[l]}`:f[l]:o[l]=f[l]}),o),{})},[t,r,i,c]),A=t=>t?Array.isArray(t)?t:[t]:[],H=(...t)=>{const i=[];return t.forEach(r=>{Array.isArray(r)?i.push(...r):r&&i.push(r)}),i.filter(r=>r!==void 0).reduce((r,c)=>r.find(n=>n.property===c.property)?r.map(n=>n.property===c.property?{...n,from:Math.min(n.from,c.from),to:Math.max(n.to,c.to),durationInFrames:Math.max(n.durationInFrames,c.durationInFrames),delay:Math.min(n.delay||0,c.delay||0),ease:d=>(n.ease(d)+c.ease(d))/2}:n):[...r,c],[])},N=({animationIn:t,animationOut:i,durationInFrames:r,children:c,style:a={},frame:n,isTransition:d=!1})=>{var I;const o=j(A(t),r,n,!1),f=j(A(i),r,n,!0),l=x.useMemo(()=>{const m=Object.keys(o).length>0,g=t==null?void 0:t.reduce((y,X)=>Math.min(y,X.delay||0),1/0),M=n-(g||0);return m&&M<0?{visibility:d?"visible":"hidden"}:o},[o,n,t]),e=x.useMemo(()=>{if(n>=r)return{visibility:d?"visible":"hidden"};const m=A(i);if(!m||m.length===0)return{};let g=0;m.forEach(y=>{const X=(y.durationInFrames||0)+(y.delay||0);X>g&&(g=X)});const M=Math.max(0,r-g);return n<M?{}:f},[f,n,i,r,d]),u=((a==null?void 0:a.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),p=u?parseFloat(u[1]):0,$=-p,h=x.useMemo(()=>{const m={...l};return Object.entries(e).forEach(([g,M])=>{g==="transform"?m[g]=`${m[g]||""} ${M||""}`.trim():g in m&&typeof m[g]=="number"&&typeof M=="number"?m[g]=m[g]*M:m[g]=M}),m},[l,e]);if((I=h.transform)!=null&&I.includes("rotate")){const m=h.transform;h.transform=m.replace(/rotate\(([^)]+)deg\)/,(g,M)=>`rotate(${parseFloat(M)-$}deg)`)}const b=x.useMemo(()=>{const m=h.transform||"",{translateX:g,translateY:M,scale:y,rotation:X,rotateX:P,rotateY:Z,rotateZ:_}=O(m);return`${g} ${M} ${y} ${X||`rotate(${p}deg)`} ${P} ${Z} ${_}`.trim()},[h,p]);let E=o;return p>0&&E.transform&&E.transform.includes("translateX")&&(E={...E,transform:E.transform.replace(/translateX\(([^)]+)\)/g,(m,g)=>`translateX(${parseFloat(g)}%)`)}),S.jsx("div",{style:{transform:"scale(1)",overflow:h.overflow||"visible",pointerEvents:"none",display:"flex",justifyContent:"center"},children:S.jsx("div",{style:{...a,...h,rotate:`${$}deg`,overflow:"visible",transform:b,pointerEvents:"none",background:Object.keys(h).length===0?"transparent":h.backgroundColor},children:c})})},O=t=>{let i="",r="",c="scale(1)",a="",n="",d="",o="";const f=t.match(/translateX\([^)]+\)/g);f&&(i=f[f.length-1]);const l=t.match(/translateY\([^)]+\)/g);l&&(r=l[l.length-1]);const e=t.match(/scale\([^)]+\)/g);e&&(c=e[e.length-1]);const s=t.match(/rotate\([^)]+\)/g);s&&(a=s[s.length-1]);const u=t.match(/rotateX\([^)]+\)/g);u&&(n=u[u.length-1]);const p=t.match(/rotateY\([^)]+\)/g);p&&(d=p[p.length-1]);const $=t.match(/rotateZ\([^)]+\)/g);return $&&(o=$[$.length-1]),{translateX:i,translateY:r,scale:c,rotation:a,rotateX:n,rotateY:d,rotateZ:o}},R=({animationTimed:t,durationInFrames:i,children:r,style:c={},frame:a})=>{var u;const n=j(A(t),i,a,!1,!0),o=((c==null?void 0:c.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),f=o?parseFloat(o[1]):0,l=-f,e=x.useMemo(()=>({...n}),[n]);if((u=e.transform)!=null&&u.includes("rotate")){const p=e.transform;e.transform=p.replace(/rotate\(([^)]+)deg\)/,($,h)=>`rotate(${parseFloat(h)-l}deg)`)}let s=e;return f>0&&s.transform&&s.transform.includes("translateX")&&(s={...s,transform:s.transform.replace(/translateX\(([^)]+)\)/g,(p,$)=>`translateX(${parseFloat($)}px)`)}),S.jsx("div",{style:{overflow:e.overflow||"visible",pointerEvents:"none",height:c.height,width:c.width,...s},children:S.jsx("div",{style:{...e,overflow:"visible",pointerEvents:"none",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:r})})},Y=t=>{if(typeof(t==null?void 0:t.ease)=="function")return t.ease;switch(t==null?void 0:t.easing){case"ease-in":return w.Easing.in(w.Easing.cubic);case"ease-out":return w.Easing.out(w.Easing.cubic);case"ease-in-out":return w.Easing.inOut(w.Easing.cubic);case"linear":default:return w.Easing.linear}},D=({children:t,frame:i,item:r,keyframeAnimations:c})=>{var $,h;const a=c?[...c].reverse().find(b=>b.property.includes("maskReveal")):void 0,n=(($=r.details.crop)==null?void 0:$.width)||r.details.width,d=((h=r.details.crop)==null?void 0:h.height)||r.details.height;let o=1,f=o,l=d,e=0,s=0,u=n,p;return(i||0)>=0&&(a==null?void 0:a.property)==="maskRevealIn"?(o=Math.min((i||0)/a.durationInFrames,1),f=Math.max(0,Math.min(1,Y(a)(o))),l=d*f):(i||0)>=0&&(a==null?void 0:a.property)==="maskRevealCenterIn"?(o=Math.min((i||0)/a.durationInFrames,1),f=Math.max(0,Math.min(1,Y(a)(o))),u=n,l=d,e=0,s=0,p=`circle(${Math.max(n,d)*f}px at 50% 50%)`):(i||0)>=0&&(a==null?void 0:a.property)==="maskRevealCornerIn"&&(o=Math.min((i||0)/a.durationInFrames,1),f=Math.max(0,Math.min(1,Y(a)(o))),u=n*f,l=d*f,e=n-u,s=0),S.jsx("div",{style:{width:n,height:d,position:"relative",overflow:f<1?"hidden":"visible"},children:S.jsx("div",{style:{position:"absolute",left:e,top:s,width:u,height:l,overflow:f<1?"hidden":"visible",clipPath:p},children:t})})};v.BoxAnim=N,v.ContentAnim=R,v.MaskAnim=D,v.combine=H,v.combineAnimations=A,v.extractTransformations=O,v.useAnimation=j,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cliquify.me/animations",
3
- "version": "8.0.2",
3
+ "version": "9.0.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -26,7 +26,7 @@
26
26
  "typescript": "^5.3.3",
27
27
  "vite": "^5.2.0",
28
28
  "vite-plugin-dts": "^3.9.1",
29
- "@cliquify.me/types": "7.0.2",
29
+ "@cliquify.me/types": "8.0.0",
30
30
  "@cliquify.me/typescript-config": "0.0.2"
31
31
  },
32
32
  "dependencies": {
@@ -39,7 +39,7 @@
39
39
  "@designcombo/events": "^1.0.2",
40
40
  "react": "^18.2.0",
41
41
  "remotion": "4.0.221",
42
- "@cliquify.me/types": "7.0.2"
42
+ "@cliquify.me/types": "8.0.0"
43
43
  },
44
44
  "scripts": {
45
45
  "dev": "vite",