@cliquify.me/animations 9.0.12 → 9.0.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.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as N, Fragment as H } from "react/jsx-runtime";
2
- import C, { useMemo as W } from "react";
3
- import { interpolate as B, Easing as A } from "remotion";
4
- const z = () => ({
1
+ import { jsx as X, Fragment as U } from "react/jsx-runtime";
2
+ import L, { useMemo as q } from "react";
3
+ import { interpolate as H, Easing as y } from "remotion";
4
+ const D = () => ({
5
5
  scale: (t) => ({ transform: `scale(${t})` }),
6
6
  growIn: (t) => ({ transform: `scale(${t})` }),
7
7
  shrinkIn: (t) => ({ transform: `scale(${t})` }),
@@ -81,329 +81,343 @@ const z = () => ({
81
81
  transform: `translateY(${t}px)`,
82
82
  overflow: "hidden"
83
83
  }),
84
- moveTranslateY: (t) => ({ transform: `translateY(${t}%)` })
85
- }), Z = (t, f = 0) => {
86
- const s = [], c = t / 5;
87
- for (let m = 0; m < 6; m += 1)
88
- s.push(m * c + f);
89
- return s;
90
- }, q = (t, f, s, c = !1) => {
91
- const { from: m, to: a, ease: $ } = f, u = f.durationInFrames || 30, p = Number(m), o = Number(a), e = Math.max(1, Number(u));
92
- if (isNaN(p) || isNaN(o))
84
+ moveTranslateY: (t) => ({ transform: `translateY(${t}%)` }),
85
+ "hide-show": (t) => ({ opacity: t }),
86
+ hide: (t) => ({ opacity: t }),
87
+ show: (t) => ({ opacity: t }),
88
+ borderRadius: (t) => ({
89
+ borderRadius: `${t}px`,
90
+ overflow: "hidden"
91
+ }),
92
+ "corner-radius": (t) => ({
93
+ borderRadius: `${t}px`,
94
+ overflow: "hidden"
95
+ })
96
+ }), z = (t, l = 0) => {
97
+ const e = [], r = t / 5;
98
+ for (let i = 0; i < 6; i += 1)
99
+ e.push(i * r + l);
100
+ return e;
101
+ }, G = (t, l, e, r = !1) => {
102
+ const { from: i, to: s, ease: g } = l, p = l.durationInFrames || 30, d = Number(i), a = Number(s), n = Math.max(1, Number(p));
103
+ if (isNaN(d) || isNaN(a))
93
104
  return console.error("Invalid animation values:", {
94
- from: m,
95
- to: a,
96
- animationDurationInFrames: u,
97
- property: f.property
98
- }), p;
99
- u === void 0 && console.warn(
100
- `durationInFrames is undefined for animation: ${f.property}. Using 1 frame as default.`
105
+ from: i,
106
+ to: s,
107
+ animationDurationInFrames: p,
108
+ property: l.property
109
+ }), d;
110
+ p === void 0 && console.warn(
111
+ `durationInFrames is undefined for animation: ${l.property}. Using 1 frame as default.`
101
112
  );
102
- const n = f.delay || 0;
103
- let l;
104
- if (f.property === "moveScaleIn" ? l = c ? [
105
- s - e - n,
106
- s - e * 0.5 - n
113
+ const c = l.delay || 0;
114
+ if (l.property === "hide-show" || l.property === "hide" || l.property === "show")
115
+ return t < c ? d : a;
116
+ let $;
117
+ if (l.property === "moveScaleIn" ? $ = r ? [
118
+ e - n - c,
119
+ e - n * 0.5 - c
107
120
  ] : [
108
- n + e * 0.5,
109
- n + e
110
- ] : f.property === "moveTranslateY" ? l = c ? [
111
- s - e * 0.5 - n,
112
- s - n
121
+ c + n * 0.5,
122
+ c + n
123
+ ] : l.property === "moveTranslateY" ? $ = r ? [
124
+ e - n * 0.5 - c,
125
+ e - c
113
126
  ] : [
114
- n,
115
- n + e * 0.5
116
- ] : l = c ? [
117
- s - e - n,
118
- s - n
127
+ c,
128
+ c + n * 0.5
129
+ ] : $ = r ? [
130
+ e - n - c,
131
+ e - c
119
132
  ] : [
120
- n,
121
- n + e
122
- ], f.property.includes("shake")) {
123
- const d = c ? Z(
124
- e,
125
- s - e - n
126
- ) : Z(e, n);
127
- return B(
133
+ c,
134
+ c + n
135
+ ], l.property.includes("shake")) {
136
+ const b = r ? z(
137
+ n,
138
+ e - n - c
139
+ ) : z(n, c);
140
+ return H(
128
141
  t,
129
- d,
130
- [0, p, o, p, o, 0],
142
+ b,
143
+ [0, d, a, d, a, 0],
131
144
  {
132
145
  extrapolateLeft: "clamp",
133
146
  extrapolateRight: "clamp",
134
- easing: $
147
+ easing: g
135
148
  }
136
149
  );
137
150
  }
138
- return B(t, l, [p, o], {
151
+ return H(t, $, [d, a], {
139
152
  extrapolateLeft: "clamp",
140
153
  extrapolateRight: "clamp",
141
- easing: $
154
+ easing: g
142
155
  });
143
- }, U = (t, f, s, c) => {
144
- var u, p, o, e, n;
145
- const { property: m } = t;
146
- if (m === "move") {
147
- const l = Number(((u = t.details) == null ? void 0 : u.fromX) ?? t.from ?? 0), d = Number(((p = t.details) == null ? void 0 : p.toX) ?? t.to ?? 0), S = Number(((o = t.details) == null ? void 0 : o.fromY) ?? 0), M = Number(((e = t.details) == null ? void 0 : e.toY) ?? 0), x = Number(((n = t.details) == null ? void 0 : n.scale) || 1) || 1, Y = t.delay || 0, V = t.durationInFrames || 30, y = c ? [s - V - Y, s - Y] : [Y, Y + V], F = B(f, y, [l, d], {
156
+ }, Z = (t) => {
157
+ if (t == null) return 0;
158
+ if (typeof t == "number")
159
+ return Number.isNaN(t) ? 0 : t;
160
+ if (typeof t == "object") {
161
+ if (t.rotate !== void 0 && t.rotate !== null) {
162
+ const i = parseFloat(String(t.rotate));
163
+ if (!Number.isNaN(i)) return i;
164
+ }
165
+ if (t.rotation !== void 0 && t.rotation !== null) {
166
+ const i = parseFloat(String(t.rotation));
167
+ if (!Number.isNaN(i)) return i;
168
+ }
169
+ return t.transform ? Z(t.transform) : 0;
170
+ }
171
+ const l = String(t), e = /rotate\((-?[\d.]+)deg\)/.exec(l);
172
+ if (e)
173
+ return parseFloat(e[1]) || 0;
174
+ const r = /matrix\(([^)]+)\)/.exec(l);
175
+ if (r) {
176
+ const i = r[1].split(",").map((s) => parseFloat(s.trim()));
177
+ if (i.length >= 4) {
178
+ const [s, g] = i;
179
+ return Math.atan2(g, s) * (180 / Math.PI);
180
+ }
181
+ }
182
+ return 0;
183
+ }, W = (t, l, e, r, i) => {
184
+ var d, a, n, c, $;
185
+ const { property: s } = t;
186
+ if (s === "move") {
187
+ const b = Number(((d = t.details) == null ? void 0 : d.fromX) ?? t.from ?? 0), w = Number(((a = t.details) == null ? void 0 : a.toX) ?? t.to ?? 0), R = Number(((n = t.details) == null ? void 0 : n.fromY) ?? 0), N = Number(((c = t.details) == null ? void 0 : c.toY) ?? 0), j = Number((($ = t.details) == null ? void 0 : $.scale) || 1) || 1;
188
+ let A = i;
189
+ if (A == null || Number.isNaN(A)) {
190
+ const Y = t.details;
191
+ A = Z((Y == null ? void 0 : Y.rotate) ?? (Y == null ? void 0 : Y.rotation) ?? (Y == null ? void 0 : Y.transform));
192
+ }
193
+ const E = t.delay || 0, B = t.durationInFrames || 30, u = r ? [e - B - E, e - E] : [E, E + B], M = H(l, u, [b, w], {
148
194
  extrapolateLeft: "clamp",
149
195
  extrapolateRight: "clamp",
150
196
  easing: t.ease
151
- }), i = B(f, y, [S, M], {
197
+ }), f = H(l, u, [R, N], {
152
198
  extrapolateLeft: "clamp",
153
199
  extrapolateRight: "clamp",
154
200
  easing: t.ease
155
- }), X = F / x, g = i / x;
201
+ }), v = (A || 0) * Math.PI / 180, m = Math.cos(v), S = Math.sin(v), h = M * m + f * S, x = -M * S + f * m, F = h / j, I = x / j;
156
202
  return {
157
- transform: `translateX(${X}px) translateY(${g}px)`
203
+ transform: `translateX(${F}px) translateY(${I}px)`
158
204
  };
159
205
  }
160
- const a = q(f, t, s, c), $ = z();
161
- return ($[m] || $.default)(a);
162
- }, I = (t, f, s, c = !1, m = !1) => C.useMemo(() => {
206
+ const g = G(l, t, e, r), p = D();
207
+ return (p[s] || p.default)(g);
208
+ }, T = (t, l, e, r = !1, i = !1, s) => L.useMemo(() => {
163
209
  if (t.length === 0) return {};
164
- const a = t.filter(
165
- ($) => $.from !== void 0 && $.to !== void 0
210
+ const g = t.filter(
211
+ (p) => p.from !== void 0 && p.to !== void 0
166
212
  );
167
- if (a.length !== t.length && console.error("Some animations are invalid and will be ignored"), m) {
168
- const $ = [], u = {};
169
- a.reverse().forEach((e) => {
170
- const n = U(e, s, f, !1);
171
- if (e.persist === !0 && s - (e.delay || 0) >= e.durationInFrames) {
172
- const d = e.to, S = z(), M = e.property === "move" ? (() => {
173
- var i, X, g;
174
- const x = Number(((i = e.details) == null ? void 0 : i.toX) ?? e.to ?? 0), Y = Number(((X = e.details) == null ? void 0 : X.toY) ?? 0), V = Number(((g = e.details) == null ? void 0 : g.scale) || 1) || 1, y = x / V, F = Y / V;
175
- return {
176
- transform: `translateX(${y}px) translateY(${F}px)`
177
- };
178
- })() : (S[e.property] || S.default)(d);
179
- Object.keys(M).forEach((x) => {
180
- x === "transform" ? u[x] = u[x] ? {
181
- [x]: `${u[x][x]} ${M[x]}`
182
- } : M : u[x] = M;
183
- });
184
- }
185
- $.push(n);
186
- });
187
- const o = { ...$.reduce(
188
- (e, n) => (Object.keys(n).forEach((l) => {
189
- l === "transform" || l === "filter" ? e[l] = e[l] ? `${e[l]} ${n[l]}` : n[l] : e[l] = n[l];
190
- }), e),
213
+ if (g.length !== t.length && console.error("Some animations are invalid and will be ignored"), i) {
214
+ const p = [];
215
+ return g.reverse().forEach((a) => {
216
+ const n = W(
217
+ a,
218
+ e,
219
+ l,
220
+ !1,
221
+ s
222
+ );
223
+ p.push(n);
224
+ }), p.reduce(
225
+ (a, n) => (Object.keys(n).forEach((c) => {
226
+ c === "transform" || c === "filter" ? a[c] = a[c] ? `${a[c]} ${n[c]}` : n[c] : a[c] = n[c];
227
+ }), a),
191
228
  {}
192
- ) };
193
- return Object.keys(u).forEach((e) => {
194
- const n = u[e];
195
- (e === "transform" || e === "filter") && n[e] ? o[e] = o[e] ? `${o[e]} ${n[e]}` : String(n[e]) : n[e] !== void 0 && (o[e] = n[e]);
196
- }), o;
229
+ );
197
230
  } else
198
- return a.map((u) => U(u, s, f, c)).reduce(
199
- (u, p) => (Object.keys(p).forEach((o) => {
200
- o === "transform" || o === "filter" ? u[o] = u[o] ? `${u[o]} ${p[o]}` : p[o] : u[o] = p[o];
201
- }), u),
231
+ return g.map((d) => W(d, e, l, r, s)).reduce(
232
+ (d, a) => (Object.keys(a).forEach((n) => {
233
+ n === "transform" || n === "filter" ? d[n] = d[n] ? `${d[n]} ${a[n]}` : a[n] : d[n] = a[n];
234
+ }), d),
202
235
  {}
203
236
  );
204
- }, [t, s, f, c]), j = (t) => t ? Array.isArray(t) ? t : [t] : [], et = (...t) => {
205
- const f = [];
206
- return t.forEach((s) => {
207
- Array.isArray(s) ? f.push(...s) : s && f.push(s);
208
- }), f.filter((s) => s !== void 0).reduce((s, c) => s.find(
209
- (a) => a.property === c.property
210
- ) ? s.map(
211
- (a) => a.property === c.property ? {
212
- ...a,
213
- from: Math.min(a.from, c.from),
214
- to: Math.max(a.to, c.to),
237
+ }, [t, e, l, r, s]), P = (t) => t ? Array.isArray(t) ? t : [t] : [], rt = (...t) => {
238
+ const l = [];
239
+ return t.forEach((e) => {
240
+ Array.isArray(e) ? l.push(...e) : e && l.push(e);
241
+ }), l.filter((e) => e !== void 0).reduce((e, r) => e.find(
242
+ (s) => s.property === r.property
243
+ ) ? e.map(
244
+ (s) => s.property === r.property ? {
245
+ ...s,
246
+ from: Math.min(s.from, r.from),
247
+ to: Math.max(s.to, r.to),
215
248
  durationInFrames: Math.max(
216
- a.durationInFrames,
217
- c.durationInFrames
249
+ s.durationInFrames,
250
+ r.durationInFrames
218
251
  ),
219
- delay: Math.min(a.delay || 0, c.delay || 0),
220
- ease: ($) => (a.ease($) + c.ease($)) / 2
252
+ delay: Math.min(s.delay || 0, r.delay || 0),
253
+ ease: (g) => (s.ease(g) + r.ease(g)) / 2
221
254
  // Average the easing functions
222
- } : a
223
- ) : [...s, c], []);
224
- }, rt = ({
255
+ } : s
256
+ ) : [...e, r], []);
257
+ }, ot = ({
225
258
  animationIn: t,
226
- animationOut: f,
227
- durationInFrames: s,
228
- children: c,
229
- style: m = {},
230
- frame: a,
231
- isTransition: $ = !1,
232
- basicCharAnimationsIn: u = [],
233
- basicCharAnimationsOut: p = []
259
+ animationOut: l,
260
+ durationInFrames: e,
261
+ children: r,
262
+ style: i = {},
263
+ frame: s,
264
+ isTransition: g = !1,
265
+ basicCharAnimationsIn: p = [],
266
+ basicCharAnimationsOut: d = []
234
267
  }) => {
235
- var b;
236
- const o = I(
237
- j(t),
268
+ const a = Z(
269
+ (i == null ? void 0 : i.transform) || (i == null ? void 0 : i.rotate) || (i == null ? void 0 : i.rotation)
270
+ ), n = T(
271
+ P(t),
272
+ e,
238
273
  s,
239
- a,
240
- !1
241
- ), e = I(
242
- j(f),
274
+ !1,
275
+ !1,
276
+ a
277
+ ), c = T(
278
+ P(l),
279
+ e,
243
280
  s,
244
- a,
245
- !0
246
- ), n = I(
247
- j(u),
281
+ !0,
282
+ !1,
283
+ a
284
+ ), $ = T(
285
+ P(p),
286
+ e,
248
287
  s,
249
- a,
250
- !0
251
- ), l = I(
252
- j(p),
288
+ !0,
289
+ !1,
290
+ a
291
+ ), b = T(
292
+ P(d),
293
+ e,
253
294
  s,
254
- a,
255
- !0
256
- ), d = C.useMemo(() => {
257
- const h = Object.keys(o).length > 0, v = t == null ? void 0 : t.reduce(
258
- (O, R) => Math.min(O, R.delay || 0),
295
+ !0,
296
+ !1,
297
+ a
298
+ ), w = L.useMemo(() => {
299
+ const f = Object.keys(n).length > 0, v = t == null ? void 0 : t.reduce(
300
+ (S, h) => Math.min(S, h.delay || 0),
259
301
  1 / 0
260
- ), w = a - (v || 0);
261
- return h && w < 0 ? { visibility: $ ? "visible" : "hidden" } : o;
262
- }, [o, a, t]), S = C.useMemo(() => {
263
- if (a > s)
264
- return { visibility: $ ? "visible" : "hidden" };
265
- const h = j(f);
266
- if (!h || h.length === 0) return {};
302
+ ), m = s - (v || 0);
303
+ return f && m < 0 ? { visibility: g ? "visible" : "hidden" } : n;
304
+ }, [n, s, t, g]), R = L.useMemo(() => {
305
+ if (s > e)
306
+ return { visibility: g ? "visible" : "hidden" };
307
+ const f = P(l);
308
+ if (!f || f.length === 0) return {};
267
309
  let v = 0;
268
- h.forEach((O) => {
269
- const R = (O.durationInFrames || 0) + (O.delay || 0);
270
- R > v && (v = R);
310
+ f.forEach((S) => {
311
+ const h = (S.durationInFrames || 0) + (S.delay || 0);
312
+ h > v && (v = h);
271
313
  });
272
- const w = Math.max(0, s - v);
273
- return a < w ? {} : e;
274
- }, [e, a, f, s, $]), x = ((m == null ? void 0 : m.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), Y = x ? parseFloat(x[1]) : 0, V = -Y, y = C.useMemo(() => {
275
- const h = {
276
- ...d
277
- // , ...timedStyle
314
+ const m = Math.max(0, e - v);
315
+ return s < m ? {} : c;
316
+ }, [c, s, l, e, g]), N = L.useMemo(() => {
317
+ const f = {
318
+ ...w
278
319
  };
279
- return Object.entries(S).forEach(([v, w]) => {
280
- v === "transform" ? h[v] = `${h[v] || ""} ${w || ""}`.trim() : v in h && typeof h[v] == "number" && typeof w == "number" ? h[v] = h[v] * w : h[v] = w;
281
- }), h;
282
- }, [d, S]);
283
- if ((b = y.transform) != null && b.includes("rotate")) {
284
- const h = y.transform;
285
- y.transform = h.replace(
286
- /rotate\(([^)]+)deg\)/,
287
- (v, w) => `rotate(${parseFloat(w) - V}deg)`
288
- );
289
- }
290
- const F = W(() => {
291
- const h = y.transform || "", {
320
+ return Object.entries(R).forEach(([v, m]) => {
321
+ v === "transform" ? f[v] = `${f[v] || ""} ${m || ""}`.trim() : v in f && typeof f[v] == "number" && typeof m == "number" ? f[v] = f[v] * m : f[v] = m;
322
+ }), f;
323
+ }, [w, R]), j = q(() => {
324
+ const f = N.transform || "", {
292
325
  translateX: v,
293
- translateY: w,
294
- scale: O,
295
- rotation: R,
296
- rotateX: P,
297
- rotateY: r,
298
- rotateZ: E
299
- } = G(h);
300
- return `${v} ${w} ${O} ${R || `rotate(${Y}deg)`} ${P} ${r} ${E}`.trim();
301
- }, [y, Y]);
302
- let i = o;
303
- Y > 0 && i.transform && i.transform.includes("translateX") && (i = {
304
- ...i,
305
- transform: i.transform.replace(
306
- /translateX\(([^)]+)\)/g,
307
- (h, v) => `translateX(${parseFloat(v)}%)`
308
- )
309
- });
310
- const {
311
- top: X,
312
- left: g,
313
- position: T,
314
- transform: _,
315
- ...L
316
- } = m || {};
317
- return /* @__PURE__ */ N(
326
+ translateY: m,
327
+ scale: S,
328
+ rotation: h,
329
+ rotateX: x,
330
+ rotateY: F,
331
+ rotateZ: I
332
+ } = J(f);
333
+ return `${h} ${v} ${m} ${S} ${x} ${F} ${I}`.trim();
334
+ }, [N]), {
335
+ top: A,
336
+ left: E,
337
+ position: B,
338
+ transform: u,
339
+ ...M
340
+ } = i || {};
341
+ return /* @__PURE__ */ X(
318
342
  "div",
319
343
  {
320
344
  style: {
321
345
  width: "100%",
322
346
  height: "100%",
323
- overflow: y.overflow || n.overflow || l.overflow || "visible",
347
+ overflow: N.overflow || $.overflow || b.overflow || "visible",
324
348
  pointerEvents: "none"
325
349
  },
326
- children: /* @__PURE__ */ N(
350
+ children: /* @__PURE__ */ X(
327
351
  "div",
328
352
  {
329
353
  style: {
330
354
  width: "100%",
331
355
  height: "100%",
332
- ...L,
333
- ...y,
334
- rotate: `${V}deg`,
356
+ ...M,
357
+ ...N,
335
358
  overflow: "visible",
336
- transform: F,
359
+ transform: j,
337
360
  pointerEvents: "none",
338
- background: Object.keys(y).length === 0 ? "transparent" : y.backgroundColor
361
+ background: Object.keys(N).length === 0 ? "transparent" : N.backgroundColor
339
362
  },
340
- children: c
363
+ children: r
341
364
  }
342
365
  )
343
366
  }
344
367
  );
345
- }, G = (t) => {
346
- let f = "", s = "", c = "scale(1)", m = "", a = "", $ = "", u = "";
347
- const p = t.match(/translateX\([^)]+\)/g);
348
- p && (f = p[p.length - 1]);
349
- const o = t.match(/translateY\([^)]+\)/g);
350
- o && (s = o[o.length - 1]);
351
- const e = t.match(/scale\([^)]+\)/g);
352
- e && (c = e[e.length - 1]);
353
- const n = t.match(/rotate\([^)]+\)/g);
354
- n && (m = n[n.length - 1]);
355
- const l = t.match(/rotateX\([^)]+\)/g);
356
- l && (a = l[l.length - 1]);
357
- const d = t.match(/rotateY\([^)]+\)/g);
358
- d && ($ = d[d.length - 1]);
359
- const S = t.match(/rotateZ\([^)]+\)/g);
360
- return S && (u = S[S.length - 1]), { translateX: f, translateY: s, scale: c, rotation: m, rotateX: a, rotateY: $, rotateZ: u };
368
+ }, J = (t) => {
369
+ let l = "", e = "", r = "scale(1)", i = "", s = "", g = "", p = "";
370
+ const d = t.match(/translateX\([^)]+\)/g);
371
+ d && (l = d[d.length - 1]);
372
+ const a = t.match(/translateY\([^)]+\)/g);
373
+ a && (e = a[a.length - 1]);
374
+ const n = t.match(/scale\([^)]+\)/g);
375
+ n && (r = n[n.length - 1]);
376
+ const c = t.match(/rotate\([^)]+\)/g);
377
+ c && (i = c[c.length - 1]);
378
+ const $ = t.match(/rotateX\([^)]+\)/g);
379
+ $ && (s = $[$.length - 1]);
380
+ const b = t.match(/rotateY\([^)]+\)/g);
381
+ b && (g = b[b.length - 1]);
382
+ const w = t.match(/rotateZ\([^)]+\)/g);
383
+ return w && (p = w[w.length - 1]), { translateX: l, translateY: e, scale: r, rotation: i, rotateX: s, rotateY: g, rotateZ: p };
361
384
  }, st = ({
362
385
  animationTimed: t,
363
- durationInFrames: f,
364
- children: s,
365
- style: c = {},
366
- frame: m
386
+ durationInFrames: l,
387
+ children: e,
388
+ style: r = {},
389
+ frame: i
367
390
  }) => {
368
- var l;
369
- const a = I(
370
- j(t),
371
- f,
372
- m,
391
+ const s = Z(
392
+ (r == null ? void 0 : r.transform) || (r == null ? void 0 : r.rotate) || (r == null ? void 0 : r.rotation)
393
+ ), g = T(
394
+ P(t),
395
+ l,
396
+ i,
373
397
  !1,
374
- !0
375
- ), u = ((c == null ? void 0 : c.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), p = u ? parseFloat(u[1]) : 0, o = -p, e = C.useMemo(() => ({
376
- ...a
377
- }), [a]);
378
- if ((l = e.transform) != null && l.includes("rotate")) {
379
- const d = e.transform;
380
- e.transform = d.replace(
381
- /rotate\(([^)]+)deg\)/,
382
- (S, M) => `rotate(${parseFloat(M) - o}deg)`
383
- );
384
- }
385
- let n = e;
386
- return p > 0 && n.transform && n.transform.includes("translateX") && (n = {
387
- ...n,
388
- transform: n.transform.replace(
389
- /translateX\(([^)]+)\)/g,
390
- (d, S) => `translateX(${parseFloat(S)}%)`
391
- )
392
- }), /* @__PURE__ */ N(
398
+ !0,
399
+ s
400
+ ), p = L.useMemo(() => ({
401
+ ...g
402
+ }), [g]), d = !!p.borderRadius;
403
+ return /* @__PURE__ */ X(
393
404
  "div",
394
405
  {
395
406
  style: {
396
- overflow: e.overflow || "visible",
407
+ overflow: d ? "hidden" : p.overflow || "visible",
408
+ borderRadius: p.borderRadius,
397
409
  pointerEvents: "none",
398
- height: c.height || "100%",
399
- width: c.width || "100%",
400
- ...n
410
+ height: r.height || "100%",
411
+ width: r.width || "100%",
412
+ ...p,
413
+ ...d ? { overflow: "hidden" } : {}
401
414
  },
402
- children: /* @__PURE__ */ N(
415
+ children: /* @__PURE__ */ X(
403
416
  "div",
404
417
  {
405
418
  style: {
406
- overflow: "visible",
419
+ overflow: d ? "hidden" : "visible",
420
+ borderRadius: p.borderRadius,
407
421
  pointerEvents: "none",
408
422
  height: "100%",
409
423
  width: "100%",
@@ -411,79 +425,79 @@ const z = () => ({
411
425
  alignItems: "center",
412
426
  justifyContent: "center"
413
427
  },
414
- children: s
428
+ children: e
415
429
  }
416
430
  )
417
431
  }
418
432
  );
419
- }, J = (t) => {
433
+ }, K = (t) => {
420
434
  if (typeof (t == null ? void 0 : t.ease) == "function")
421
435
  return t.ease;
422
436
  switch (t == null ? void 0 : t.easing) {
423
437
  case "ease-in":
424
438
  case "accelerate":
425
- return A.in(A.cubic);
439
+ return y.in(y.cubic);
426
440
  case "ease-out":
427
441
  case "smooth":
428
442
  case "slowDown":
429
- return A.out(A.cubic);
443
+ return y.out(y.cubic);
430
444
  case "ease-in-out":
431
445
  case "natural":
432
446
  case "swing":
433
- return A.inOut(A.cubic);
447
+ return y.inOut(y.cubic);
434
448
  case "bounce":
435
- return A.bounce;
449
+ return y.bounce;
436
450
  case "elastic":
437
- return A.elastic(1);
451
+ return y.elastic(1);
438
452
  case "overshoot":
439
453
  case "impulse":
440
- return A.out(A.back(1.7));
454
+ return y.out(y.back(1.7));
441
455
  case "none":
442
456
  case "linear":
443
457
  default:
444
- return A.linear;
458
+ return y.linear;
445
459
  }
446
- }, K = ({
460
+ }, O = ({
447
461
  children: t,
448
- currentWidth: f,
449
- currentHeight: s,
450
- frame: c,
451
- item: m,
452
- keyframeAnimations: a,
453
- durationInFrames: $
462
+ currentWidth: l,
463
+ currentHeight: e,
464
+ frame: r,
465
+ item: i,
466
+ keyframeAnimations: s,
467
+ durationInFrames: g
454
468
  }) => {
455
- var R, P;
456
- if (!a || !Array.isArray(a) || a.length === 0)
457
- return /* @__PURE__ */ N(H, { children: t });
458
- const u = (r) => {
459
- var E, D;
460
- return !!((E = r == null ? void 0 : r.property) != null && E.includes("maskReveal") || (D = r == null ? void 0 : r.id) != null && D.includes("maskReveal"));
461
- }, p = (r) => {
462
- var E, D;
463
- return !!((r == null ? void 0 : r.type) === "exit" || (E = r == null ? void 0 : r.property) != null && E.includes("Out") || (D = r == null ? void 0 : r.id) != null && D.includes("Out"));
464
- }, o = a.find(
465
- (r) => u(r) && !p(r)
466
- ), e = a.find(
467
- (r) => u(r) && p(r)
469
+ var _, k;
470
+ if (!s || !Array.isArray(s) || s.length === 0)
471
+ return /* @__PURE__ */ X(U, { children: t });
472
+ const p = (o) => {
473
+ var V, C;
474
+ return !!((V = o == null ? void 0 : o.property) != null && V.includes("maskReveal") || (C = o == null ? void 0 : o.id) != null && C.includes("maskReveal"));
475
+ }, d = (o) => {
476
+ var V, C;
477
+ return !!((o == null ? void 0 : o.type) === "exit" || (V = o == null ? void 0 : o.property) != null && V.includes("Out") || (C = o == null ? void 0 : o.id) != null && C.includes("Out"));
478
+ }, a = s.find(
479
+ (o) => p(o) && !d(o)
480
+ ), n = s.find(
481
+ (o) => p(o) && d(o)
468
482
  );
469
- if (!o && !e)
470
- return /* @__PURE__ */ N(H, { children: t });
471
- const n = Math.max(1, $ || 300);
472
- let l = null, d = !1, S = 30, M = 0;
473
- if (e) {
474
- const r = Math.max(1, Number(e.durationInFrames || 30)), E = Math.max(0, Number(e.delay || 0)), D = Math.max(0, n - r - E);
475
- c >= D && (l = e, d = !0, S = r, M = c - D);
483
+ if (!a && !n)
484
+ return /* @__PURE__ */ X(U, { children: t });
485
+ const c = Math.max(1, g || 300);
486
+ let $ = null, b = !1, w = 30, R = 0;
487
+ if (n) {
488
+ const o = Math.max(1, Number(n.durationInFrames || 30)), V = Math.max(0, Number(n.delay || 0)), C = Math.max(0, c - o - V);
489
+ r >= C && ($ = n, b = !0, w = o, R = r - C);
476
490
  }
477
- if (!l && o) {
478
- l = o, d = !1, S = Math.max(1, Number(o.durationInFrames || 30));
479
- const r = Math.max(0, Number(o.delay || 0));
480
- M = c - r;
491
+ if (!$ && a) {
492
+ $ = a, b = !1, w = Math.max(1, Number(a.durationInFrames || 30));
493
+ const o = Math.max(0, Number(a.delay || 0));
494
+ R = r - o;
481
495
  }
482
- if (!l)
483
- return /* @__PURE__ */ N(H, { children: t });
484
- const x = o ? Math.max(0, Number(o.delay || 0)) : 0, Y = o ? Math.max(1, Number(o.durationInFrames || 30)) : 30;
485
- if (!d && o && c >= x + Y)
486
- return /* @__PURE__ */ N(
496
+ if (!$)
497
+ return /* @__PURE__ */ X(U, { children: t });
498
+ const N = a ? Math.max(0, Number(a.delay || 0)) : 0, j = a ? Math.max(1, Number(a.durationInFrames || 30)) : 30;
499
+ if (!b && a && r >= N + j)
500
+ return /* @__PURE__ */ X(
487
501
  "div",
488
502
  {
489
503
  style: {
@@ -495,8 +509,8 @@ const z = () => ({
495
509
  children: t
496
510
  }
497
511
  );
498
- if (!d && o && c < x)
499
- return /* @__PURE__ */ N(
512
+ if (!b && a && r < N)
513
+ return /* @__PURE__ */ X(
500
514
  "div",
501
515
  {
502
516
  style: {
@@ -508,72 +522,72 @@ const z = () => ({
508
522
  children: t
509
523
  }
510
524
  );
511
- const V = Math.max(0, M), y = Math.min(Math.max(0, V / S), 1), F = J(l), i = Math.max(0, Math.min(1, F(y))), X = String(l.property || l.id || ""), g = ((R = l.details) == null ? void 0 : R.direction) || "up", T = X.includes("ShrinkScale"), _ = X.includes("CenterScale"), L = X.includes("Slide") || X.includes("slide");
512
- let b, h = "";
513
- if (_) {
514
- const r = d ? 50 * i : 50 * (1 - i);
515
- b = `inset(
516
- ${r}%
525
+ const A = Math.max(0, R), E = Math.min(Math.max(0, A / w), 1), B = K($), u = Math.max(0, Math.min(1, B(E))), M = String($.property || $.id || ""), f = ((_ = $.details) == null ? void 0 : _.direction) || "up", v = M.includes("ShrinkScale"), m = M.includes("CenterScale"), S = M.includes("Slide") || M.includes("slide");
526
+ let h, x = "";
527
+ if (m) {
528
+ const o = b ? 50 * u : 50 * (1 - u);
529
+ h = `inset(
530
+ ${o}%
517
531
  0%
518
- ${r}%
532
+ ${o}%
519
533
  0%
520
534
  )`;
521
- } else if (T) {
522
- const r = d ? 25 * i : 25 * (1 - i);
523
- b = `inset(
524
- ${r}%
525
- ${r}%
526
- ${r}%
527
- ${r}%
535
+ } else if (v) {
536
+ const o = b ? 25 * u : 25 * (1 - u);
537
+ h = `inset(
538
+ ${o}%
539
+ ${o}%
540
+ ${o}%
541
+ ${o}%
528
542
  )`;
529
- } else if (L)
530
- b = "inset(0% 0% 0% 0%)", d ? g === "down" ? h = `translateY(${100 * i}%)` : g === "left" ? h = `translateX(${-100 * i}%)` : g === "right" ? h = `translateX(${100 * i}%)` : h = `translateY(${-100 * i}%)` : g === "down" ? h = `translateY(${-100 * (1 - i)}%)` : g === "left" ? h = `translateX(${100 * (1 - i)}%)` : g === "right" ? h = `translateX(${-100 * (1 - i)}%)` : h = `translateY(${100 * (1 - i)}%)`;
531
- else if (X.includes("Center"))
532
- b = `circle(${d ? 150 * (1 - i) : 150 * i}% at 50% 50%)`;
533
- else if (X.includes("Corner")) {
534
- const r = d ? i : 1 - i;
535
- g === "down" ? b = `inset(0 ${100 * r}% ${100 * r}% 0)` : g === "up" ? b = `inset(${100 * r}% ${100 * r}% 0 0)` : g === "left" ? b = `inset(0 0 ${100 * r}% ${100 * r}%)` : g === "right" ? b = `inset(${100 * r}% 0 0 ${100 * r}%)` : b = `inset(0 ${100 * r}% ${100 * r}% 0)`;
543
+ } else if (S)
544
+ h = "inset(0% 0% 0% 0%)", b ? f === "down" ? x = `translateY(${100 * u}%)` : f === "left" ? x = `translateX(${-100 * u}%)` : f === "right" ? x = `translateX(${100 * u}%)` : x = `translateY(${-100 * u}%)` : f === "down" ? x = `translateY(${-100 * (1 - u)}%)` : f === "left" ? x = `translateX(${100 * (1 - u)}%)` : f === "right" ? x = `translateX(${-100 * (1 - u)}%)` : x = `translateY(${100 * (1 - u)}%)`;
545
+ else if (M.includes("Center"))
546
+ h = `circle(${b ? 150 * (1 - u) : 150 * u}% at 50% 50%)`;
547
+ else if (M.includes("Corner")) {
548
+ const o = b ? u : 1 - u;
549
+ f === "down" ? h = `inset(0 ${100 * o}% ${100 * o}% 0)` : f === "up" ? h = `inset(${100 * o}% ${100 * o}% 0 0)` : f === "left" ? h = `inset(0 0 ${100 * o}% ${100 * o}%)` : f === "right" ? h = `inset(${100 * o}% 0 0 ${100 * o}%)` : h = `inset(0 ${100 * o}% ${100 * o}% 0)`;
536
550
  } else
537
- d ? g === "down" ? b = `inset(${100 * i}% 0 0 0)` : g === "left" ? b = `inset(0 ${100 * i}% 0 0)` : g === "right" ? b = `inset(0 0 0 ${100 * i}%)` : b = `inset(0 0 ${100 * i}% 0)` : g === "down" ? b = `inset(0 0 ${100 * (1 - i)}% 0)` : g === "left" ? b = `inset(0 0 0 ${100 * (1 - i)}%)` : g === "right" ? b = `inset(0 ${100 * (1 - i)}% 0 0)` : b = `inset(${100 * (1 - i)}% 0 0 0)`;
538
- const v = !!((P = l == null ? void 0 : l.details) != null && P.scale || l != null && l.scale);
539
- let w = 1;
540
- _ || T ? w = d ? 1 + 0.5 * i : 1.5 - 0.5 * i : v && (w = d ? 1 - 0.2 * i : 0.8 + 0.2 * i);
541
- const O = [h, `scale(${w})`].filter(Boolean).join(" ");
551
+ b ? f === "down" ? h = `inset(${100 * u}% 0 0 0)` : f === "left" ? h = `inset(0 ${100 * u}% 0 0)` : f === "right" ? h = `inset(0 0 0 ${100 * u}%)` : h = `inset(0 0 ${100 * u}% 0)` : f === "down" ? h = `inset(0 0 ${100 * (1 - u)}% 0)` : f === "left" ? h = `inset(0 0 0 ${100 * (1 - u)}%)` : f === "right" ? h = `inset(0 ${100 * (1 - u)}% 0 0)` : h = `inset(${100 * (1 - u)}% 0 0 0)`;
552
+ const F = !!((k = $ == null ? void 0 : $.details) != null && k.scale || $ != null && $.scale);
553
+ let I = 1;
554
+ m || v ? I = b ? 1 + 0.5 * u : 1.5 - 0.5 * u : F && (I = b ? 1 - 0.2 * u : 0.8 + 0.2 * u);
555
+ const Y = [x, `scale(${I})`].filter(Boolean).join(" ");
542
556
  return console.log("[MaskAnim] Rendering:", {
543
- propName: X,
544
- frame: c,
545
- localFrame: M,
546
- animDuration: S,
547
- progress: y,
548
- easedProgress: i,
549
- isOut: d,
550
- isShrinkScale: T,
551
- isCenterScale: _,
552
- isSlide: L,
553
- direction: g,
554
- clipPath: b,
555
- translateTransform: h,
556
- isScale: v,
557
- scaleValue: w,
558
- innerTransform: O
559
- }), /* @__PURE__ */ N(
557
+ propName: M,
558
+ frame: r,
559
+ localFrame: R,
560
+ animDuration: w,
561
+ progress: E,
562
+ easedProgress: u,
563
+ isOut: b,
564
+ isShrinkScale: v,
565
+ isCenterScale: m,
566
+ isSlide: S,
567
+ direction: f,
568
+ clipPath: h,
569
+ translateTransform: x,
570
+ isScale: F,
571
+ scaleValue: I,
572
+ innerTransform: Y
573
+ }), /* @__PURE__ */ X(
560
574
  "div",
561
575
  {
562
576
  style: {
563
- width: f !== void 0 ? f : "100%",
564
- height: s !== void 0 ? s : "100%",
577
+ width: l !== void 0 ? l : "100%",
578
+ height: e !== void 0 ? e : "100%",
565
579
  position: "relative",
566
- clipPath: b,
567
- WebkitClipPath: b,
580
+ clipPath: h,
581
+ WebkitClipPath: h,
568
582
  overflow: "hidden"
569
583
  },
570
- children: /* @__PURE__ */ N(
584
+ children: /* @__PURE__ */ X(
571
585
  "div",
572
586
  {
573
587
  style: {
574
588
  width: "100%",
575
589
  height: "100%",
576
- transform: O,
590
+ transform: Y,
577
591
  transformOrigin: "center"
578
592
  },
579
593
  children: t
@@ -581,13 +595,13 @@ const z = () => ({
581
595
  )
582
596
  }
583
597
  );
584
- }, ot = K;
598
+ }, nt = O;
585
599
  export {
586
- rt as BoxAnim,
600
+ ot as BoxAnim,
587
601
  st as ContentAnim,
588
- ot as MaskAnim,
589
- et as combine,
590
- j as combineAnimations,
591
- G as extractTransformations,
592
- I as useAnimation
602
+ nt as MaskAnim,
603
+ rt as combine,
604
+ P as combineAnimations,
605
+ J as extractTransformations,
606
+ T as useAnimation
593
607
  };
package/dist/index.umd.js CHANGED
@@ -1,11 +1,11 @@
1
- (function(Y,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react"),require("remotion")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","remotion"],w):(Y=typeof globalThis<"u"?globalThis:Y||self,w(Y.animations={},Y.jsxRuntime,Y.React,Y.remotion))})(this,function(Y,w,I,X){"use strict";const Z=()=>({scale:t=>({transform:`scale(${t})`}),growIn:t=>({transform:`scale(${t})`}),shrinkIn:t=>({transform:`scale(${t})`}),shrinkOut:t=>({transform:`scale(${t})`}),opacity:t=>({opacity:t}),translateX:t=>({transform:`translateX(${t}%)`}),translateY:t=>({transform:`translateY(${t}%)`}),rotate:t=>({transform:`rotate(${t}deg)`}),spin:t=>({transform:`rotate(${t}deg)`}),spinIn:t=>({transform:`rotate(${t}deg)`}),twistIn:t=>({transform:`rotate(${t}deg)`}),twistOut:t=>({transform:`rotate(${t}deg)`}),moveScaleIn:t=>({transform:`scale(${t})`}),spinOut:t=>({transform:`rotate(${t}deg)`}),default:()=>({}),rotateY:t=>({transform:`rotateY(${t}deg)`}),rotateX:t=>({transform:`rotateX(${t}deg)`}),blur:t=>({filter:`blur(${t}px)`}),blurIn:t=>({filter:`blur(${t}px)`}),blurOut:t=>({filter:`blur(${t}px)`}),blurV2In:t=>({filter:`blur(${t}px)`}),blurSlide:t=>({filter:`blur(${t}px)`,transform:`translateY(${t*5}%)`}),blurSlideV2In: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}px)`}),shakeVerticalIn:t=>({transform:`translateY(${t}px)`}),shakeHorizontalOut:t=>({transform:`translateX(${t}px)`}),shakeVerticalOut:t=>({transform:`translateY(${t}px)`}),maskUpIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskUpOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),moveTranslateY:t=>({transform:`translateY(${t}%)`})}),q=(t,f=0)=>{const s=[],c=t/5;for(let $=0;$<6;$+=1)s.push($*c+f);return s},z=(t,f,s,c=!1)=>{const{from:$,to:o,ease:g}=f,u=f.durationInFrames||30,p=Number($),n=Number(o),e=Math.max(1,Number(u));if(isNaN(p)||isNaN(n))return console.error("Invalid animation values:",{from:$,to:o,animationDurationInFrames:u,property:f.property}),p;u===void 0&&console.warn(`durationInFrames is undefined for animation: ${f.property}. Using 1 frame as default.`);const a=f.delay||0;let l;if(f.property==="moveScaleIn"?l=c?[s-e-a,s-e*.5-a]:[a+e*.5,a+e]:f.property==="moveTranslateY"?l=c?[s-e*.5-a,s-a]:[a,a+e*.5]:l=c?[s-e-a,s-a]:[a,a+e],f.property.includes("shake")){const d=c?q(e,s-e-a):q(e,a);return X.interpolate(t,d,[0,p,n,p,n,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:g})}return X.interpolate(t,l,[p,n],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:g})},U=(t,f,s,c)=>{var u,p,n,e,a;const{property:$}=t;if($==="move"){const l=Number(((u=t.details)==null?void 0:u.fromX)??t.from??0),d=Number(((p=t.details)==null?void 0:p.toX)??t.to??0),S=Number(((n=t.details)==null?void 0:n.fromY)??0),A=Number(((e=t.details)==null?void 0:e.toY)??0),x=Number(((a=t.details)==null?void 0:a.scale)||1)||1,E=t.delay||0,O=t.durationInFrames||30,M=c?[s-O-E,s-E]:[E,E+O],C=X.interpolate(f,M,[l,d],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),i=X.interpolate(f,M,[S,A],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),N=C/x,m=i/x;return{transform:`translateX(${N}px) translateY(${m}px)`}}const o=z(f,t,s,c),g=Z();return(g[$]||g.default)(o)},P=(t,f,s,c=!1,$=!1)=>I.useMemo(()=>{if(t.length===0)return{};const o=t.filter(g=>g.from!==void 0&&g.to!==void 0);if(o.length!==t.length&&console.error("Some animations are invalid and will be ignored"),$){const g=[],u={};o.reverse().forEach(e=>{const a=U(e,s,f,!1);if(e.persist===!0&&s-(e.delay||0)>=e.durationInFrames){const d=e.to,S=Z(),A=e.property==="move"?(()=>{var i,N,m;const x=Number(((i=e.details)==null?void 0:i.toX)??e.to??0),E=Number(((N=e.details)==null?void 0:N.toY)??0),O=Number(((m=e.details)==null?void 0:m.scale)||1)||1,M=x/O,C=E/O;return{transform:`translateX(${M}px) translateY(${C}px)`}})():(S[e.property]||S.default)(d);Object.keys(A).forEach(x=>{x==="transform"?u[x]=u[x]?{[x]:`${u[x][x]} ${A[x]}`}:A:u[x]=A})}g.push(a)});const n={...g.reduce((e,a)=>(Object.keys(a).forEach(l=>{l==="transform"||l==="filter"?e[l]=e[l]?`${e[l]} ${a[l]}`:a[l]:e[l]=a[l]}),e),{})};return Object.keys(u).forEach(e=>{const a=u[e];(e==="transform"||e==="filter")&&a[e]?n[e]=n[e]?`${n[e]} ${a[e]}`:String(a[e]):a[e]!==void 0&&(n[e]=a[e])}),n}else return o.map(u=>U(u,s,f,c)).reduce((u,p)=>(Object.keys(p).forEach(n=>{n==="transform"||n==="filter"?u[n]=u[n]?`${u[n]} ${p[n]}`:p[n]:u[n]=p[n]}),u),{})},[t,s,f,c]),T=t=>t?Array.isArray(t)?t:[t]:[],G=(...t)=>{const f=[];return t.forEach(s=>{Array.isArray(s)?f.push(...s):s&&f.push(s)}),f.filter(s=>s!==void 0).reduce((s,c)=>s.find(o=>o.property===c.property)?s.map(o=>o.property===c.property?{...o,from:Math.min(o.from,c.from),to:Math.max(o.to,c.to),durationInFrames:Math.max(o.durationInFrames,c.durationInFrames),delay:Math.min(o.delay||0,c.delay||0),ease:g=>(o.ease(g)+c.ease(g))/2}:o):[...s,c],[])},J=({animationIn:t,animationOut:f,durationInFrames:s,children:c,style:$={},frame:o,isTransition:g=!1,basicCharAnimationsIn:u=[],basicCharAnimationsOut:p=[]})=>{var b;const n=P(T(t),s,o,!1),e=P(T(f),s,o,!0),a=P(T(u),s,o,!0),l=P(T(p),s,o,!0),d=I.useMemo(()=>{const h=Object.keys(n).length>0,v=t==null?void 0:t.reduce((V,F)=>Math.min(V,F.delay||0),1/0),y=o-(v||0);return h&&y<0?{visibility:g?"visible":"hidden"}:n},[n,o,t]),S=I.useMemo(()=>{if(o>s)return{visibility:g?"visible":"hidden"};const h=T(f);if(!h||h.length===0)return{};let v=0;h.forEach(V=>{const F=(V.durationInFrames||0)+(V.delay||0);F>v&&(v=F)});const y=Math.max(0,s-v);return o<y?{}:e},[e,o,f,s,g]),x=(($==null?void 0:$.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),E=x?parseFloat(x[1]):0,O=-E,M=I.useMemo(()=>{const h={...d};return Object.entries(S).forEach(([v,y])=>{v==="transform"?h[v]=`${h[v]||""} ${y||""}`.trim():v in h&&typeof h[v]=="number"&&typeof y=="number"?h[v]=h[v]*y:h[v]=y}),h},[d,S]);if((b=M.transform)!=null&&b.includes("rotate")){const h=M.transform;M.transform=h.replace(/rotate\(([^)]+)deg\)/,(v,y)=>`rotate(${parseFloat(y)-O}deg)`)}const C=I.useMemo(()=>{const h=M.transform||"",{translateX:v,translateY:y,scale:V,rotation:F,rotateX:H,rotateY:r,rotateZ:j}=W(h);return`${v} ${y} ${V} ${F||`rotate(${E}deg)`} ${H} ${r} ${j}`.trim()},[M,E]);let i=n;E>0&&i.transform&&i.transform.includes("translateX")&&(i={...i,transform:i.transform.replace(/translateX\(([^)]+)\)/g,(h,v)=>`translateX(${parseFloat(v)}%)`)});const{top:N,left:m,position:_,transform:B,...L}=$||{};return w.jsx("div",{style:{width:"100%",height:"100%",overflow:M.overflow||a.overflow||l.overflow||"visible",pointerEvents:"none"},children:w.jsx("div",{style:{width:"100%",height:"100%",...L,...M,rotate:`${O}deg`,overflow:"visible",transform:C,pointerEvents:"none",background:Object.keys(M).length===0?"transparent":M.backgroundColor},children:c})})},W=t=>{let f="",s="",c="scale(1)",$="",o="",g="",u="";const p=t.match(/translateX\([^)]+\)/g);p&&(f=p[p.length-1]);const n=t.match(/translateY\([^)]+\)/g);n&&(s=n[n.length-1]);const e=t.match(/scale\([^)]+\)/g);e&&(c=e[e.length-1]);const a=t.match(/rotate\([^)]+\)/g);a&&($=a[a.length-1]);const l=t.match(/rotateX\([^)]+\)/g);l&&(o=l[l.length-1]);const d=t.match(/rotateY\([^)]+\)/g);d&&(g=d[d.length-1]);const S=t.match(/rotateZ\([^)]+\)/g);return S&&(u=S[S.length-1]),{translateX:f,translateY:s,scale:c,rotation:$,rotateX:o,rotateY:g,rotateZ:u}},K=({animationTimed:t,durationInFrames:f,children:s,style:c={},frame:$})=>{var l;const o=P(T(t),f,$,!1,!0),u=((c==null?void 0:c.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),p=u?parseFloat(u[1]):0,n=-p,e=I.useMemo(()=>({...o}),[o]);if((l=e.transform)!=null&&l.includes("rotate")){const d=e.transform;e.transform=d.replace(/rotate\(([^)]+)deg\)/,(S,A)=>`rotate(${parseFloat(A)-n}deg)`)}let a=e;return p>0&&a.transform&&a.transform.includes("translateX")&&(a={...a,transform:a.transform.replace(/translateX\(([^)]+)\)/g,(d,S)=>`translateX(${parseFloat(S)}%)`)}),w.jsx("div",{style:{overflow:e.overflow||"visible",pointerEvents:"none",height:c.height||"100%",width:c.width||"100%",...a},children:w.jsx("div",{style:{overflow:"visible",pointerEvents:"none",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:s})})},Q=t=>{if(typeof(t==null?void 0:t.ease)=="function")return t.ease;switch(t==null?void 0:t.easing){case"ease-in":case"accelerate":return X.Easing.in(X.Easing.cubic);case"ease-out":case"smooth":case"slowDown":return X.Easing.out(X.Easing.cubic);case"ease-in-out":case"natural":case"swing":return X.Easing.inOut(X.Easing.cubic);case"bounce":return X.Easing.bounce;case"elastic":return X.Easing.elastic(1);case"overshoot":case"impulse":return X.Easing.out(X.Easing.back(1.7));case"none":case"linear":default:return X.Easing.linear}},R=({children:t,currentWidth:f,currentHeight:s,frame:c,item:$,keyframeAnimations:o,durationInFrames:g})=>{var F,H;if(!o||!Array.isArray(o)||o.length===0)return w.jsx(w.Fragment,{children:t});const u=r=>{var j,D;return!!((j=r==null?void 0:r.property)!=null&&j.includes("maskReveal")||(D=r==null?void 0:r.id)!=null&&D.includes("maskReveal"))},p=r=>{var j,D;return!!((r==null?void 0:r.type)==="exit"||(j=r==null?void 0:r.property)!=null&&j.includes("Out")||(D=r==null?void 0:r.id)!=null&&D.includes("Out"))},n=o.find(r=>u(r)&&!p(r)),e=o.find(r=>u(r)&&p(r));if(!n&&!e)return w.jsx(w.Fragment,{children:t});const a=Math.max(1,g||300);let l=null,d=!1,S=30,A=0;if(e){const r=Math.max(1,Number(e.durationInFrames||30)),j=Math.max(0,Number(e.delay||0)),D=Math.max(0,a-r-j);c>=D&&(l=e,d=!0,S=r,A=c-D)}if(!l&&n){l=n,d=!1,S=Math.max(1,Number(n.durationInFrames||30));const r=Math.max(0,Number(n.delay||0));A=c-r}if(!l)return w.jsx(w.Fragment,{children:t});const x=n?Math.max(0,Number(n.delay||0)):0,E=n?Math.max(1,Number(n.durationInFrames||30)):30;if(!d&&n&&c>=x+E)return w.jsx("div",{style:{width:"100%",height:"100%",position:"relative",overflow:"visible"},children:t});if(!d&&n&&c<x)return w.jsx("div",{style:{width:"100%",height:"100%",position:"relative",visibility:"hidden"},children:t});const O=Math.max(0,A),M=Math.min(Math.max(0,O/S),1),C=Q(l),i=Math.max(0,Math.min(1,C(M))),N=String(l.property||l.id||""),m=((F=l.details)==null?void 0:F.direction)||"up",_=N.includes("ShrinkScale"),B=N.includes("CenterScale"),L=N.includes("Slide")||N.includes("slide");let b,h="";if(B){const r=d?50*i:50*(1-i);b=`inset(
2
- ${r}%
1
+ (function(M,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("remotion")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","remotion"],x):(M=typeof globalThis<"u"?globalThis:M||self,x(M.animations={},M.jsxRuntime,M.React,M.remotion))})(this,function(M,x,P,w){"use strict";const z=()=>({scale:t=>({transform:`scale(${t})`}),growIn:t=>({transform:`scale(${t})`}),shrinkIn:t=>({transform:`scale(${t})`}),shrinkOut:t=>({transform:`scale(${t})`}),opacity:t=>({opacity:t}),translateX:t=>({transform:`translateX(${t}%)`}),translateY:t=>({transform:`translateY(${t}%)`}),rotate:t=>({transform:`rotate(${t}deg)`}),spin:t=>({transform:`rotate(${t}deg)`}),spinIn:t=>({transform:`rotate(${t}deg)`}),twistIn:t=>({transform:`rotate(${t}deg)`}),twistOut:t=>({transform:`rotate(${t}deg)`}),moveScaleIn:t=>({transform:`scale(${t})`}),spinOut:t=>({transform:`rotate(${t}deg)`}),default:()=>({}),rotateY:t=>({transform:`rotateY(${t}deg)`}),rotateX:t=>({transform:`rotateX(${t}deg)`}),blur:t=>({filter:`blur(${t}px)`}),blurIn:t=>({filter:`blur(${t}px)`}),blurOut:t=>({filter:`blur(${t}px)`}),blurV2In:t=>({filter:`blur(${t}px)`}),blurSlide:t=>({filter:`blur(${t}px)`,transform:`translateY(${t*5}%)`}),blurSlideV2In: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}px)`}),shakeVerticalIn:t=>({transform:`translateY(${t}px)`}),shakeHorizontalOut:t=>({transform:`translateX(${t}px)`}),shakeVerticalOut:t=>({transform:`translateY(${t}px)`}),maskUpIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskUpOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),moveTranslateY:t=>({transform:`translateY(${t}%)`}),"hide-show":t=>({opacity:t}),hide:t=>({opacity:t}),show:t=>({opacity:t}),borderRadius:t=>({borderRadius:`${t}px`,overflow:"hidden"}),"corner-radius":t=>({borderRadius:`${t}px`,overflow:"hidden"})}),Z=(t,i=0)=>{const e=[],r=t/5;for(let l=0;l<6;l+=1)e.push(l*r+i);return e},O=(t,i,e,r=!1)=>{const{from:l,to:o,ease:$}=i,p=i.durationInFrames||30,d=Number(l),a=Number(o),n=Math.max(1,Number(p));if(isNaN(d)||isNaN(a))return console.error("Invalid animation values:",{from:l,to:o,animationDurationInFrames:p,property:i.property}),d;p===void 0&&console.warn(`durationInFrames is undefined for animation: ${i.property}. Using 1 frame as default.`);const c=i.delay||0;if(i.property==="hide-show"||i.property==="hide"||i.property==="show")return t<c?d:a;let g;if(i.property==="moveScaleIn"?g=r?[e-n-c,e-n*.5-c]:[c+n*.5,c+n]:i.property==="moveTranslateY"?g=r?[e-n*.5-c,e-c]:[c,c+n*.5]:g=r?[e-n-c,e-c]:[c,c+n],i.property.includes("shake")){const b=r?Z(n,e-n-c):Z(n,c);return w.interpolate(t,b,[0,d,a,d,a,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:$})}return w.interpolate(t,g,[d,a],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:$})},H=t=>{if(t==null)return 0;if(typeof t=="number")return Number.isNaN(t)?0:t;if(typeof t=="object"){if(t.rotate!==void 0&&t.rotate!==null){const l=parseFloat(String(t.rotate));if(!Number.isNaN(l))return l}if(t.rotation!==void 0&&t.rotation!==null){const l=parseFloat(String(t.rotation));if(!Number.isNaN(l))return l}return t.transform?H(t.transform):0}const i=String(t),e=/rotate\((-?[\d.]+)deg\)/.exec(i);if(e)return parseFloat(e[1])||0;const r=/matrix\(([^)]+)\)/.exec(i);if(r){const l=r[1].split(",").map(o=>parseFloat(o.trim()));if(l.length>=4){const[o,$]=l;return Math.atan2($,o)*(180/Math.PI)}}return 0},q=(t,i,e,r,l)=>{var d,a,n,c,g;const{property:o}=t;if(o==="move"){const b=Number(((d=t.details)==null?void 0:d.fromX)??t.from??0),Y=Number(((a=t.details)==null?void 0:a.toX)??t.to??0),E=Number(((n=t.details)==null?void 0:n.fromY)??0),X=Number(((c=t.details)==null?void 0:c.toY)??0),L=Number(((g=t.details)==null?void 0:g.scale)||1)||1;let I=l;if(I==null||Number.isNaN(I)){const A=t.details;I=H((A==null?void 0:A.rotate)??(A==null?void 0:A.rotation)??(A==null?void 0:A.transform))}const j=t.delay||0,k=t.durationInFrames||30,u=r?[e-k-j,e-j]:[j,j+k],y=w.interpolate(i,u,[b,Y],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),f=w.interpolate(i,u,[E,X],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),v=(I||0)*Math.PI/180,m=Math.cos(v),N=Math.sin(v),h=y*m+f*N,S=-y*N+f*m,R=h/L,C=S/L;return{transform:`translateX(${R}px) translateY(${C}px)`}}const $=O(i,t,e,r),p=z();return(p[o]||p.default)($)},B=(t,i,e,r=!1,l=!1,o)=>P.useMemo(()=>{if(t.length===0)return{};const $=t.filter(p=>p.from!==void 0&&p.to!==void 0);if($.length!==t.length&&console.error("Some animations are invalid and will be ignored"),l){const p=[];return $.reverse().forEach(a=>{const n=q(a,e,i,!1,o);p.push(n)}),p.reduce((a,n)=>(Object.keys(n).forEach(c=>{c==="transform"||c==="filter"?a[c]=a[c]?`${a[c]} ${n[c]}`:n[c]:a[c]=n[c]}),a),{})}else return $.map(d=>q(d,e,i,r,o)).reduce((d,a)=>(Object.keys(a).forEach(n=>{n==="transform"||n==="filter"?d[n]=d[n]?`${d[n]} ${a[n]}`:a[n]:d[n]=a[n]}),d),{})},[t,e,i,r,o]),F=t=>t?Array.isArray(t)?t:[t]:[],D=(...t)=>{const i=[];return t.forEach(e=>{Array.isArray(e)?i.push(...e):e&&i.push(e)}),i.filter(e=>e!==void 0).reduce((e,r)=>e.find(o=>o.property===r.property)?e.map(o=>o.property===r.property?{...o,from:Math.min(o.from,r.from),to:Math.max(o.to,r.to),durationInFrames:Math.max(o.durationInFrames,r.durationInFrames),delay:Math.min(o.delay||0,r.delay||0),ease:$=>(o.ease($)+r.ease($))/2}:o):[...e,r],[])},G=({animationIn:t,animationOut:i,durationInFrames:e,children:r,style:l={},frame:o,isTransition:$=!1,basicCharAnimationsIn:p=[],basicCharAnimationsOut:d=[]})=>{const a=H((l==null?void 0:l.transform)||(l==null?void 0:l.rotate)||(l==null?void 0:l.rotation)),n=B(F(t),e,o,!1,!1,a),c=B(F(i),e,o,!0,!1,a),g=B(F(p),e,o,!0,!1,a),b=B(F(d),e,o,!0,!1,a),Y=P.useMemo(()=>{const f=Object.keys(n).length>0,v=t==null?void 0:t.reduce((N,h)=>Math.min(N,h.delay||0),1/0),m=o-(v||0);return f&&m<0?{visibility:$?"visible":"hidden"}:n},[n,o,t,$]),E=P.useMemo(()=>{if(o>e)return{visibility:$?"visible":"hidden"};const f=F(i);if(!f||f.length===0)return{};let v=0;f.forEach(N=>{const h=(N.durationInFrames||0)+(N.delay||0);h>v&&(v=h)});const m=Math.max(0,e-v);return o<m?{}:c},[c,o,i,e,$]),X=P.useMemo(()=>{const f={...Y};return Object.entries(E).forEach(([v,m])=>{v==="transform"?f[v]=`${f[v]||""} ${m||""}`.trim():v in f&&typeof f[v]=="number"&&typeof m=="number"?f[v]=f[v]*m:f[v]=m}),f},[Y,E]),L=P.useMemo(()=>{const f=X.transform||"",{translateX:v,translateY:m,scale:N,rotation:h,rotateX:S,rotateY:R,rotateZ:C}=U(f);return`${h} ${v} ${m} ${N} ${S} ${R} ${C}`.trim()},[X]),{top:I,left:j,position:k,transform:u,...y}=l||{};return x.jsx("div",{style:{width:"100%",height:"100%",overflow:X.overflow||g.overflow||b.overflow||"visible",pointerEvents:"none"},children:x.jsx("div",{style:{width:"100%",height:"100%",...y,...X,overflow:"visible",transform:L,pointerEvents:"none",background:Object.keys(X).length===0?"transparent":X.backgroundColor},children:r})})},U=t=>{let i="",e="",r="scale(1)",l="",o="",$="",p="";const d=t.match(/translateX\([^)]+\)/g);d&&(i=d[d.length-1]);const a=t.match(/translateY\([^)]+\)/g);a&&(e=a[a.length-1]);const n=t.match(/scale\([^)]+\)/g);n&&(r=n[n.length-1]);const c=t.match(/rotate\([^)]+\)/g);c&&(l=c[c.length-1]);const g=t.match(/rotateX\([^)]+\)/g);g&&(o=g[g.length-1]);const b=t.match(/rotateY\([^)]+\)/g);b&&($=b[b.length-1]);const Y=t.match(/rotateZ\([^)]+\)/g);return Y&&(p=Y[Y.length-1]),{translateX:i,translateY:e,scale:r,rotation:l,rotateX:o,rotateY:$,rotateZ:p}},J=({animationTimed:t,durationInFrames:i,children:e,style:r={},frame:l})=>{const o=H((r==null?void 0:r.transform)||(r==null?void 0:r.rotate)||(r==null?void 0:r.rotation)),$=B(F(t),i,l,!1,!0,o),p=P.useMemo(()=>({...$}),[$]),d=!!p.borderRadius;return x.jsx("div",{style:{overflow:d?"hidden":p.overflow||"visible",borderRadius:p.borderRadius,pointerEvents:"none",height:r.height||"100%",width:r.width||"100%",...p,...d?{overflow:"hidden"}:{}},children:x.jsx("div",{style:{overflow:d?"hidden":"visible",borderRadius:p.borderRadius,pointerEvents:"none",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e})})},K=t=>{if(typeof(t==null?void 0:t.ease)=="function")return t.ease;switch(t==null?void 0:t.easing){case"ease-in":case"accelerate":return w.Easing.in(w.Easing.cubic);case"ease-out":case"smooth":case"slowDown":return w.Easing.out(w.Easing.cubic);case"ease-in-out":case"natural":case"swing":return w.Easing.inOut(w.Easing.cubic);case"bounce":return w.Easing.bounce;case"elastic":return w.Easing.elastic(1);case"overshoot":case"impulse":return w.Easing.out(w.Easing.back(1.7));case"none":case"linear":default:return w.Easing.linear}},Q=({children:t,currentWidth:i,currentHeight:e,frame:r,item:l,keyframeAnimations:o,durationInFrames:$})=>{var W,_;if(!o||!Array.isArray(o)||o.length===0)return x.jsx(x.Fragment,{children:t});const p=s=>{var V,T;return!!((V=s==null?void 0:s.property)!=null&&V.includes("maskReveal")||(T=s==null?void 0:s.id)!=null&&T.includes("maskReveal"))},d=s=>{var V,T;return!!((s==null?void 0:s.type)==="exit"||(V=s==null?void 0:s.property)!=null&&V.includes("Out")||(T=s==null?void 0:s.id)!=null&&T.includes("Out"))},a=o.find(s=>p(s)&&!d(s)),n=o.find(s=>p(s)&&d(s));if(!a&&!n)return x.jsx(x.Fragment,{children:t});const c=Math.max(1,$||300);let g=null,b=!1,Y=30,E=0;if(n){const s=Math.max(1,Number(n.durationInFrames||30)),V=Math.max(0,Number(n.delay||0)),T=Math.max(0,c-s-V);r>=T&&(g=n,b=!0,Y=s,E=r-T)}if(!g&&a){g=a,b=!1,Y=Math.max(1,Number(a.durationInFrames||30));const s=Math.max(0,Number(a.delay||0));E=r-s}if(!g)return x.jsx(x.Fragment,{children:t});const X=a?Math.max(0,Number(a.delay||0)):0,L=a?Math.max(1,Number(a.durationInFrames||30)):30;if(!b&&a&&r>=X+L)return x.jsx("div",{style:{width:"100%",height:"100%",position:"relative",overflow:"visible"},children:t});if(!b&&a&&r<X)return x.jsx("div",{style:{width:"100%",height:"100%",position:"relative",visibility:"hidden"},children:t});const I=Math.max(0,E),j=Math.min(Math.max(0,I/Y),1),k=K(g),u=Math.max(0,Math.min(1,k(j))),y=String(g.property||g.id||""),f=((W=g.details)==null?void 0:W.direction)||"up",v=y.includes("ShrinkScale"),m=y.includes("CenterScale"),N=y.includes("Slide")||y.includes("slide");let h,S="";if(m){const s=b?50*u:50*(1-u);h=`inset(
2
+ ${s}%
3
3
  0%
4
- ${r}%
4
+ ${s}%
5
5
  0%
6
- )`}else if(_){const r=d?25*i:25*(1-i);b=`inset(
7
- ${r}%
8
- ${r}%
9
- ${r}%
10
- ${r}%
11
- )`}else if(L)b="inset(0% 0% 0% 0%)",d?m==="down"?h=`translateY(${100*i}%)`:m==="left"?h=`translateX(${-100*i}%)`:m==="right"?h=`translateX(${100*i}%)`:h=`translateY(${-100*i}%)`:m==="down"?h=`translateY(${-100*(1-i)}%)`:m==="left"?h=`translateX(${100*(1-i)}%)`:m==="right"?h=`translateX(${-100*(1-i)}%)`:h=`translateY(${100*(1-i)}%)`;else if(N.includes("Center"))b=`circle(${d?150*(1-i):150*i}% at 50% 50%)`;else if(N.includes("Corner")){const r=d?i:1-i;m==="down"?b=`inset(0 ${100*r}% ${100*r}% 0)`:m==="up"?b=`inset(${100*r}% ${100*r}% 0 0)`:m==="left"?b=`inset(0 0 ${100*r}% ${100*r}%)`:m==="right"?b=`inset(${100*r}% 0 0 ${100*r}%)`:b=`inset(0 ${100*r}% ${100*r}% 0)`}else d?m==="down"?b=`inset(${100*i}% 0 0 0)`:m==="left"?b=`inset(0 ${100*i}% 0 0)`:m==="right"?b=`inset(0 0 0 ${100*i}%)`:b=`inset(0 0 ${100*i}% 0)`:m==="down"?b=`inset(0 0 ${100*(1-i)}% 0)`:m==="left"?b=`inset(0 0 0 ${100*(1-i)}%)`:m==="right"?b=`inset(0 ${100*(1-i)}% 0 0)`:b=`inset(${100*(1-i)}% 0 0 0)`;const v=!!((H=l==null?void 0:l.details)!=null&&H.scale||l!=null&&l.scale);let y=1;B||_?y=d?1+.5*i:1.5-.5*i:v&&(y=d?1-.2*i:.8+.2*i);const V=[h,`scale(${y})`].filter(Boolean).join(" ");return console.log("[MaskAnim] Rendering:",{propName:N,frame:c,localFrame:A,animDuration:S,progress:M,easedProgress:i,isOut:d,isShrinkScale:_,isCenterScale:B,isSlide:L,direction:m,clipPath:b,translateTransform:h,isScale:v,scaleValue:y,innerTransform:V}),w.jsx("div",{style:{width:f!==void 0?f:"100%",height:s!==void 0?s:"100%",position:"relative",clipPath:b,WebkitClipPath:b,overflow:"hidden"},children:w.jsx("div",{style:{width:"100%",height:"100%",transform:V,transformOrigin:"center"},children:t})})};Y.BoxAnim=J,Y.ContentAnim=K,Y.MaskAnim=R,Y.combine=G,Y.combineAnimations=T,Y.extractTransformations=W,Y.useAnimation=P,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
6
+ )`}else if(v){const s=b?25*u:25*(1-u);h=`inset(
7
+ ${s}%
8
+ ${s}%
9
+ ${s}%
10
+ ${s}%
11
+ )`}else if(N)h="inset(0% 0% 0% 0%)",b?f==="down"?S=`translateY(${100*u}%)`:f==="left"?S=`translateX(${-100*u}%)`:f==="right"?S=`translateX(${100*u}%)`:S=`translateY(${-100*u}%)`:f==="down"?S=`translateY(${-100*(1-u)}%)`:f==="left"?S=`translateX(${100*(1-u)}%)`:f==="right"?S=`translateX(${-100*(1-u)}%)`:S=`translateY(${100*(1-u)}%)`;else if(y.includes("Center"))h=`circle(${b?150*(1-u):150*u}% at 50% 50%)`;else if(y.includes("Corner")){const s=b?u:1-u;f==="down"?h=`inset(0 ${100*s}% ${100*s}% 0)`:f==="up"?h=`inset(${100*s}% ${100*s}% 0 0)`:f==="left"?h=`inset(0 0 ${100*s}% ${100*s}%)`:f==="right"?h=`inset(${100*s}% 0 0 ${100*s}%)`:h=`inset(0 ${100*s}% ${100*s}% 0)`}else b?f==="down"?h=`inset(${100*u}% 0 0 0)`:f==="left"?h=`inset(0 ${100*u}% 0 0)`:f==="right"?h=`inset(0 0 0 ${100*u}%)`:h=`inset(0 0 ${100*u}% 0)`:f==="down"?h=`inset(0 0 ${100*(1-u)}% 0)`:f==="left"?h=`inset(0 0 0 ${100*(1-u)}%)`:f==="right"?h=`inset(0 ${100*(1-u)}% 0 0)`:h=`inset(${100*(1-u)}% 0 0 0)`;const R=!!((_=g==null?void 0:g.details)!=null&&_.scale||g!=null&&g.scale);let C=1;m||v?C=b?1+.5*u:1.5-.5*u:R&&(C=b?1-.2*u:.8+.2*u);const A=[S,`scale(${C})`].filter(Boolean).join(" ");return console.log("[MaskAnim] Rendering:",{propName:y,frame:r,localFrame:E,animDuration:Y,progress:j,easedProgress:u,isOut:b,isShrinkScale:v,isCenterScale:m,isSlide:N,direction:f,clipPath:h,translateTransform:S,isScale:R,scaleValue:C,innerTransform:A}),x.jsx("div",{style:{width:i!==void 0?i:"100%",height:e!==void 0?e:"100%",position:"relative",clipPath:h,WebkitClipPath:h,overflow:"hidden"},children:x.jsx("div",{style:{width:"100%",height:"100%",transform:A,transformOrigin:"center"},children:t})})};M.BoxAnim=G,M.ContentAnim=J,M.MaskAnim=Q,M.combine=D,M.combineAnimations=F,M.extractTransformations=U,M.useAnimation=B,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
@@ -9,6 +9,11 @@ export interface Animation {
9
9
  delay?: number;
10
10
  persist?: boolean;
11
11
  }
12
- export declare const useAnimation: (animations: Animation[], durationInFrames: number, frame: number, isOut?: boolean, isTimed?: boolean) => React.CSSProperties;
12
+ export declare const extractRotationAngle: (transformOrDetails?: string | number | {
13
+ rotate?: any;
14
+ rotation?: any;
15
+ transform?: string;
16
+ }) => number;
17
+ export declare const useAnimation: (animations: Animation[], durationInFrames: number, frame: number, isOut?: boolean, isTimed?: boolean, rotationAngle?: number) => React.CSSProperties;
13
18
  export declare const combineAnimations: (animations: Animation | Animation[] | undefined) => Animation[];
14
19
  export declare const combine: (...animations: (Animation | Animation[] | undefined)[]) => Animation[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cliquify.me/animations",
3
- "version": "9.0.12",
3
+ "version": "9.0.13",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -26,8 +26,8 @@
26
26
  "typescript": "^5.3.3",
27
27
  "vite": "^5.2.0",
28
28
  "vite-plugin-dts": "^3.9.1",
29
- "@cliquify.me/typescript-config": "0.0.2",
30
- "@cliquify.me/types": "8.0.11"
29
+ "@cliquify.me/types": "8.0.12",
30
+ "@cliquify.me/typescript-config": "0.0.2"
31
31
  },
32
32
  "dependencies": {
33
33
  "remotion": "4.0.506",
@@ -38,7 +38,7 @@
38
38
  "@designcombo/events": "^1.0.2",
39
39
  "react": "^18.2.0 || ^19.0.0",
40
40
  "remotion": "4.0.506",
41
- "@cliquify.me/types": "8.0.11"
41
+ "@cliquify.me/types": "8.0.12"
42
42
  },
43
43
  "scripts": {
44
44
  "dev": "vite",