@cliquify.me/animations 9.0.11 → 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 A, Fragment as H } from "react/jsx-runtime";
2
- import I, { useMemo as W } from "react";
3
- import { interpolate as P, Easing as X } 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 = [], i = t / 5;
87
- for (let m = 0; m < 6; m += 1)
88
- s.push(m * i + f);
89
- return s;
90
- }, q = (t, f, s, i = !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 = i ? [
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 = i ? [
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 = i ? [
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 = i ? Z(
124
- e,
125
- s - e - n
126
- ) : Z(e, n);
127
- return P(
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 P(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, i) => {
144
- var u, p, o, e;
145
- const { property: m } = t;
146
- if (m === "move") {
147
- const n = Number(((u = t.details) == null ? void 0 : u.fromX) ?? t.from ?? 0), l = Number(((p = t.details) == null ? void 0 : p.toX) ?? t.to ?? 0), d = Number(((o = t.details) == null ? void 0 : o.fromY) ?? 0), x = Number(((e = t.details) == null ? void 0 : e.toY) ?? 0), S = t.delay || 0, v = t.durationInFrames || 30, Y = i ? [s - v - S, s - S] : [S, S + v], V = P(f, Y, [n, l], {
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
- }), M = P(f, Y, [d, x], {
197
+ }), f = H(l, u, [R, N], {
152
198
  extrapolateLeft: "clamp",
153
199
  extrapolateRight: "clamp",
154
200
  easing: t.ease
155
- });
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(${V}%) translateY(${M}%)`
203
+ transform: `translateX(${F}px) translateY(${I}px)`
158
204
  };
159
205
  }
160
- const a = q(f, t, s, i), $ = z();
161
- return ($[m] || $.default)(a);
162
- }, j = (t, f, s, i = !1, m = !1) => I.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, x = z(), S = e.property === "move" ? (() => {
173
- var V, M;
174
- const v = Number(((V = e.details) == null ? void 0 : V.toX) ?? e.to ?? 0), Y = Number(((M = e.details) == null ? void 0 : M.toY) ?? 0);
175
- return {
176
- transform: `translateX(${v}%) translateY(${Y}%)`
177
- };
178
- })() : (x[e.property] || x.default)(d);
179
- Object.keys(S).forEach((v) => {
180
- v === "transform" ? u[v] = u[v] ? {
181
- [v]: `${u[v][v]} ${S[v]}`
182
- } : S : u[v] = S;
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, i)).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, i]), F = (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, i) => s.find(
209
- (a) => a.property === i.property
210
- ) ? s.map(
211
- (a) => a.property === i.property ? {
212
- ...a,
213
- from: Math.min(a.from, i.from),
214
- to: Math.max(a.to, i.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
- i.durationInFrames
249
+ s.durationInFrames,
250
+ r.durationInFrames
218
251
  ),
219
- delay: Math.min(a.delay || 0, i.delay || 0),
220
- ease: ($) => (a.ease($) + i.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, i], []);
224
- }, rt = ({
255
+ } : s
256
+ ) : [...e, r], []);
257
+ }, ot = ({
225
258
  animationIn: t,
226
- animationOut: f,
227
- durationInFrames: s,
228
- children: i,
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 g;
236
- const o = j(
237
- F(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 = j(
242
- F(f),
274
+ !1,
275
+ !1,
276
+ a
277
+ ), c = T(
278
+ P(l),
279
+ e,
243
280
  s,
244
- a,
245
- !0
246
- ), n = j(
247
- F(u),
281
+ !0,
282
+ !1,
283
+ a
284
+ ), $ = T(
285
+ P(p),
286
+ e,
248
287
  s,
249
- a,
250
- !0
251
- ), l = j(
252
- F(p),
288
+ !0,
289
+ !1,
290
+ a
291
+ ), b = T(
292
+ P(d),
293
+ e,
253
294
  s,
254
- a,
255
- !0
256
- ), d = I.useMemo(() => {
257
- const h = Object.keys(o).length > 0, b = t == null ? void 0 : t.reduce(
258
- (N, O) => Math.min(N, O.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
- ), y = a - (b || 0);
261
- return h && y < 0 ? { visibility: $ ? "visible" : "hidden" } : o;
262
- }, [o, a, t]), x = I.useMemo(() => {
263
- if (a > s)
264
- return { visibility: $ ? "visible" : "hidden" };
265
- const h = F(f);
266
- if (!h || h.length === 0) return {};
267
- let b = 0;
268
- h.forEach((N) => {
269
- const O = (N.durationInFrames || 0) + (N.delay || 0);
270
- O > b && (b = O);
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 {};
309
+ let v = 0;
310
+ f.forEach((S) => {
311
+ const h = (S.durationInFrames || 0) + (S.delay || 0);
312
+ h > v && (v = h);
271
313
  });
272
- const y = Math.max(0, s - b);
273
- return a < y ? {} : e;
274
- }, [e, a, f, s, $]), v = ((m == null ? void 0 : m.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), Y = v ? parseFloat(v[1]) : 0, V = -Y, M = I.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(x).forEach(([b, y]) => {
280
- b === "transform" ? h[b] = `${h[b] || ""} ${y || ""}`.trim() : b in h && typeof h[b] == "number" && typeof y == "number" ? h[b] = h[b] * y : h[b] = y;
281
- }), h;
282
- }, [d, x]);
283
- if ((g = M.transform) != null && g.includes("rotate")) {
284
- const h = M.transform;
285
- M.transform = h.replace(
286
- /rotate\(([^)]+)deg\)/,
287
- (b, y) => `rotate(${parseFloat(y) - V}deg)`
288
- );
289
- }
290
- const B = W(() => {
291
- const h = M.transform || "", {
292
- translateX: b,
293
- translateY: y,
294
- scale: N,
295
- rotation: O,
296
- rotateX: L,
297
- rotateY: r,
298
- rotateZ: R
299
- } = G(h);
300
- return `${b} ${y} ${N} ${O || `rotate(${Y}deg)`} ${L} ${r} ${R}`.trim();
301
- }, [M, Y]);
302
- let c = o;
303
- Y > 0 && c.transform && c.transform.includes("translateX") && (c = {
304
- ...c,
305
- transform: c.transform.replace(
306
- /translateX\(([^)]+)\)/g,
307
- (h, b) => `translateX(${parseFloat(b)}%)`
308
- )
309
- });
310
- const {
311
- top: E,
312
- left: w,
313
- position: C,
314
- transform: T,
315
- ..._
316
- } = m || {};
317
- return /* @__PURE__ */ A(
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 || "", {
325
+ translateX: v,
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: M.overflow || n.overflow || l.overflow || "visible",
347
+ overflow: N.overflow || $.overflow || b.overflow || "visible",
324
348
  pointerEvents: "none"
325
349
  },
326
- children: /* @__PURE__ */ A(
350
+ children: /* @__PURE__ */ X(
327
351
  "div",
328
352
  {
329
353
  style: {
330
354
  width: "100%",
331
355
  height: "100%",
332
- ..._,
333
356
  ...M,
334
- rotate: `${V}deg`,
357
+ ...N,
335
358
  overflow: "visible",
336
- transform: B,
359
+ transform: j,
337
360
  pointerEvents: "none",
338
- background: Object.keys(M).length === 0 ? "transparent" : M.backgroundColor
361
+ background: Object.keys(N).length === 0 ? "transparent" : N.backgroundColor
339
362
  },
340
- children: i
363
+ children: r
341
364
  }
342
365
  )
343
366
  }
344
367
  );
345
- }, G = (t) => {
346
- let f = "", s = "", i = "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 && (i = 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 x = t.match(/rotateZ\([^)]+\)/g);
360
- return x && (u = x[x.length - 1]), { translateX: f, translateY: s, scale: i, 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: i = {},
366
- frame: m
386
+ durationInFrames: l,
387
+ children: e,
388
+ style: r = {},
389
+ frame: i
367
390
  }) => {
368
- var l;
369
- const a = j(
370
- F(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 = ((i == null ? void 0 : i.transform) || "").match(/rotate\((-?[\d.]+)deg\)/), p = u ? parseFloat(u[1]) : 0, o = -p, e = I.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
- (x, S) => `rotate(${parseFloat(S) - 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, x) => `translateX(${parseFloat(x)}%)`
391
- )
392
- }), /* @__PURE__ */ A(
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: i.height || "100%",
399
- width: i.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__ */ A(
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,105 +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 X.in(X.cubic);
439
+ return y.in(y.cubic);
426
440
  case "ease-out":
427
441
  case "smooth":
428
442
  case "slowDown":
429
- return X.out(X.cubic);
443
+ return y.out(y.cubic);
430
444
  case "ease-in-out":
431
445
  case "natural":
432
446
  case "swing":
433
- return X.inOut(X.cubic);
447
+ return y.inOut(y.cubic);
434
448
  case "bounce":
435
- return X.bounce;
449
+ return y.bounce;
436
450
  case "elastic":
437
- return X.elastic(1);
451
+ return y.elastic(1);
438
452
  case "overshoot":
439
453
  case "impulse":
440
- return X.out(X.back(1.7));
454
+ return y.out(y.back(1.7));
441
455
  case "none":
442
456
  case "linear":
443
457
  default:
444
- return X.linear;
458
+ return y.linear;
445
459
  }
446
- }, K = ({
460
+ }, O = ({
447
461
  children: t,
448
- currentWidth: f,
449
- currentHeight: s,
450
- frame: i,
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 O, L;
456
- if (!a || !Array.isArray(a) || a.length === 0)
457
- return /* @__PURE__ */ A(H, { children: t });
458
- const u = (r) => {
459
- var R, D;
460
- return !!((R = r == null ? void 0 : r.property) != null && R.includes("maskReveal") || (D = r == null ? void 0 : r.id) != null && D.includes("maskReveal"));
461
- }, p = (r) => {
462
- var R, D;
463
- return !!((r == null ? void 0 : r.type) === "exit" || (R = r == null ? void 0 : r.property) != null && R.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__ */ A(H, { children: t });
471
- const n = Math.max(
472
- 1,
473
- $ || 300
474
- );
475
- let l = null, d = !1, x = 30, S = 0;
476
- if (e) {
477
- const r = Math.max(
478
- 1,
479
- Number(e.durationInFrames || 30)
480
- ), R = Math.max(
481
- 0,
482
- Number(e.delay || 0)
483
- ), D = Math.max(
484
- 0,
485
- n - r - R
486
- );
487
- i >= D && (l = e, d = !0, x = r, S = i - 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);
488
490
  }
489
- if (!l && o) {
490
- l = o, d = !1, x = Math.max(
491
- 1,
492
- Number(o.durationInFrames || 30)
493
- );
494
- const r = Math.max(
495
- 0,
496
- Number(o.delay || 0)
497
- );
498
- S = i - 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;
499
495
  }
500
- if (!l)
501
- return /* @__PURE__ */ A(H, { children: t });
502
- const v = o ? Math.max(
503
- 0,
504
- Number(o.delay || 0)
505
- ) : 0, Y = o ? Math.max(
506
- 1,
507
- Number(
508
- o.durationInFrames || 30
509
- )
510
- ) : 30;
511
- if (!d && o && i >= v + Y)
512
- return /* @__PURE__ */ A(
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(
513
501
  "div",
514
502
  {
515
503
  style: {
@@ -521,8 +509,8 @@ const z = () => ({
521
509
  children: t
522
510
  }
523
511
  );
524
- if (!d && o && i < v)
525
- return /* @__PURE__ */ A(
512
+ if (!b && a && r < N)
513
+ return /* @__PURE__ */ X(
526
514
  "div",
527
515
  {
528
516
  style: {
@@ -534,92 +522,72 @@ const z = () => ({
534
522
  children: t
535
523
  }
536
524
  );
537
- const V = Math.max(
538
- 0,
539
- S
540
- ), M = Math.min(
541
- Math.max(
542
- 0,
543
- V / x
544
- ),
545
- 1
546
- ), B = J(l), c = Math.max(
547
- 0,
548
- Math.min(
549
- 1,
550
- B(M)
551
- )
552
- ), E = String(
553
- l.property || l.id || ""
554
- ), w = ((O = l.details) == null ? void 0 : O.direction) || "up", C = E.includes("ShrinkScale"), T = E.includes("CenterScale"), _ = E.includes("Slide") || E.includes("slide");
555
- let g, h = "";
556
- if (T) {
557
- const r = d ? 50 * c : 50 * (1 - c);
558
- g = `inset(
559
- ${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}%
560
531
  0%
561
- ${r}%
532
+ ${o}%
562
533
  0%
563
534
  )`;
564
- } else if (C) {
565
- const r = d ? 25 * c : 25 * (1 - c);
566
- g = `inset(
567
- ${r}%
568
- ${r}%
569
- ${r}%
570
- ${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}%
571
542
  )`;
572
- } else if (_)
573
- g = "inset(0% 0% 0% 0%)", d ? w === "down" ? h = `translateY(${100 * c}%)` : w === "left" ? h = `translateX(${-100 * c}%)` : w === "right" ? h = `translateX(${100 * c}%)` : h = `translateY(${-100 * c}%)` : w === "down" ? h = `translateY(${-100 * (1 - c)}%)` : w === "left" ? h = `translateX(${100 * (1 - c)}%)` : w === "right" ? h = `translateX(${-100 * (1 - c)}%)` : h = `translateY(${100 * (1 - c)}%)`;
574
- else if (E.includes("Center"))
575
- g = `circle(${d ? 150 * (1 - c) : 150 * c}% at 50% 50%)`;
576
- else if (E.includes("Corner")) {
577
- const r = d ? c : 1 - c;
578
- w === "down" ? g = `inset(0 ${100 * r}% ${100 * r}% 0)` : w === "up" ? g = `inset(${100 * r}% ${100 * r}% 0 0)` : w === "left" ? g = `inset(0 0 ${100 * r}% ${100 * r}%)` : w === "right" ? g = `inset(${100 * r}% 0 0 ${100 * r}%)` : g = `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)`;
579
550
  } else
580
- d ? w === "down" ? g = `inset(${100 * c}% 0 0 0)` : w === "left" ? g = `inset(0 ${100 * c}% 0 0)` : w === "right" ? g = `inset(0 0 0 ${100 * c}%)` : g = `inset(0 0 ${100 * c}% 0)` : w === "down" ? g = `inset(0 0 ${100 * (1 - c)}% 0)` : w === "left" ? g = `inset(0 0 0 ${100 * (1 - c)}%)` : w === "right" ? g = `inset(0 ${100 * (1 - c)}% 0 0)` : g = `inset(${100 * (1 - c)}% 0 0 0)`;
581
- const b = !!((L = l == null ? void 0 : l.details) != null && L.scale || l != null && l.scale);
582
- let y = 1;
583
- T || C ? y = d ? 1 + 0.5 * c : 1.5 - 0.5 * c : b && (y = d ? 1 - 0.2 * c : 0.8 + 0.2 * c);
584
- const N = [
585
- h,
586
- `scale(${y})`
587
- ].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(" ");
588
556
  return console.log("[MaskAnim] Rendering:", {
589
- propName: E,
590
- frame: i,
591
- localFrame: S,
592
- animDuration: x,
593
- progress: M,
594
- easedProgress: c,
595
- isOut: d,
596
- isShrinkScale: C,
597
- isCenterScale: T,
598
- isSlide: _,
599
- direction: w,
600
- clipPath: g,
601
- translateTransform: h,
602
- isScale: b,
603
- scaleValue: y,
604
- innerTransform: N
605
- }), /* @__PURE__ */ A(
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(
606
574
  "div",
607
575
  {
608
576
  style: {
609
- width: f !== void 0 ? f : "100%",
610
- height: s !== void 0 ? s : "100%",
577
+ width: l !== void 0 ? l : "100%",
578
+ height: e !== void 0 ? e : "100%",
611
579
  position: "relative",
612
- clipPath: g,
613
- WebkitClipPath: g,
580
+ clipPath: h,
581
+ WebkitClipPath: h,
614
582
  overflow: "hidden"
615
583
  },
616
- children: /* @__PURE__ */ A(
584
+ children: /* @__PURE__ */ X(
617
585
  "div",
618
586
  {
619
587
  style: {
620
588
  width: "100%",
621
589
  height: "100%",
622
- transform: N,
590
+ transform: Y,
623
591
  transformOrigin: "center"
624
592
  },
625
593
  children: t
@@ -627,13 +595,13 @@ const z = () => ({
627
595
  )
628
596
  }
629
597
  );
630
- }, ot = K;
598
+ }, nt = O;
631
599
  export {
632
- rt as BoxAnim,
600
+ ot as BoxAnim,
633
601
  st as ContentAnim,
634
- ot as MaskAnim,
635
- et as combine,
636
- F as combineAnimations,
637
- G as extractTransformations,
638
- j as useAnimation
602
+ nt as MaskAnim,
603
+ rt as combine,
604
+ P as combineAnimations,
605
+ J as extractTransformations,
606
+ T as useAnimation
639
607
  };
package/dist/index.umd.js CHANGED
@@ -1,11 +1,11 @@
1
- (function(X,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):(X=typeof globalThis<"u"?globalThis:X||self,S(X.animations={},X.jsxRuntime,X.React,X.remotion))})(this,function(X,S,C,A){"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=[],i=t/5;for(let $=0;$<6;$+=1)s.push($*i+f);return s},z=(t,f,s,i=!1)=>{const{from:$,to:a,ease:g}=f,u=f.durationInFrames||30,p=Number($),n=Number(a),e=Math.max(1,Number(u));if(isNaN(p)||isNaN(n))return console.error("Invalid animation values:",{from:$,to:a,animationDurationInFrames:u,property:f.property}),p;u===void 0&&console.warn(`durationInFrames is undefined for animation: ${f.property}. Using 1 frame as default.`);const o=f.delay||0;let l;if(f.property==="moveScaleIn"?l=i?[s-e-o,s-e*.5-o]:[o+e*.5,o+e]:f.property==="moveTranslateY"?l=i?[s-e*.5-o,s-o]:[o,o+e*.5]:l=i?[s-e-o,s-o]:[o,o+e],f.property.includes("shake")){const d=i?q(e,s-e-o):q(e,o);return A.interpolate(t,d,[0,p,n,p,n,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:g})}return A.interpolate(t,l,[p,n],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:g})},U=(t,f,s,i)=>{var u,p,n,e;const{property:$}=t;if($==="move"){const o=Number(((u=t.details)==null?void 0:u.fromX)??t.from??0),l=Number(((p=t.details)==null?void 0:p.toX)??t.to??0),d=Number(((n=t.details)==null?void 0:n.fromY)??0),x=Number(((e=t.details)==null?void 0:e.toY)??0),w=t.delay||0,v=t.durationInFrames||30,E=i?[s-v-w,s-w]:[w,w+v],O=A.interpolate(f,E,[o,l],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),Y=A.interpolate(f,E,[d,x],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease});return{transform:`translateX(${O}%) translateY(${Y}%)`}}const a=z(f,t,s,i),g=Z();return(g[$]||g.default)(a)},I=(t,f,s,i=!1,$=!1)=>C.useMemo(()=>{if(t.length===0)return{};const a=t.filter(g=>g.from!==void 0&&g.to!==void 0);if(a.length!==t.length&&console.error("Some animations are invalid and will be ignored"),$){const g=[],u={};a.reverse().forEach(e=>{const o=U(e,s,f,!1);if(e.persist===!0&&s-(e.delay||0)>=e.durationInFrames){const d=e.to,x=Z(),w=e.property==="move"?(()=>{var O,Y;const v=Number(((O=e.details)==null?void 0:O.toX)??e.to??0),E=Number(((Y=e.details)==null?void 0:Y.toY)??0);return{transform:`translateX(${v}%) translateY(${E}%)`}})():(x[e.property]||x.default)(d);Object.keys(w).forEach(v=>{v==="transform"?u[v]=u[v]?{[v]:`${u[v][v]} ${w[v]}`}:w:u[v]=w})}g.push(o)});const n={...g.reduce((e,o)=>(Object.keys(o).forEach(l=>{l==="transform"||l==="filter"?e[l]=e[l]?`${e[l]} ${o[l]}`:o[l]:e[l]=o[l]}),e),{})};return Object.keys(u).forEach(e=>{const o=u[e];(e==="transform"||e==="filter")&&o[e]?n[e]=n[e]?`${n[e]} ${o[e]}`:String(o[e]):o[e]!==void 0&&(n[e]=o[e])}),n}else return a.map(u=>U(u,s,f,i)).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,i]),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,i)=>s.find(a=>a.property===i.property)?s.map(a=>a.property===i.property?{...a,from:Math.min(a.from,i.from),to:Math.max(a.to,i.to),durationInFrames:Math.max(a.durationInFrames,i.durationInFrames),delay:Math.min(a.delay||0,i.delay||0),ease:g=>(a.ease(g)+i.ease(g))/2}:a):[...s,i],[])},J=({animationIn:t,animationOut:f,durationInFrames:s,children:i,style:$={},frame:a,isTransition:g=!1,basicCharAnimationsIn:u=[],basicCharAnimationsOut:p=[]})=>{var m;const n=I(T(t),s,a,!1),e=I(T(f),s,a,!0),o=I(T(u),s,a,!0),l=I(T(p),s,a,!0),d=C.useMemo(()=>{const h=Object.keys(n).length>0,b=t==null?void 0:t.reduce((N,V)=>Math.min(N,V.delay||0),1/0),M=a-(b||0);return h&&M<0?{visibility:g?"visible":"hidden"}:n},[n,a,t]),x=C.useMemo(()=>{if(a>s)return{visibility:g?"visible":"hidden"};const h=T(f);if(!h||h.length===0)return{};let b=0;h.forEach(N=>{const V=(N.durationInFrames||0)+(N.delay||0);V>b&&(b=V)});const M=Math.max(0,s-b);return a<M?{}:e},[e,a,f,s,g]),v=(($==null?void 0:$.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),E=v?parseFloat(v[1]):0,O=-E,Y=C.useMemo(()=>{const h={...d};return Object.entries(x).forEach(([b,M])=>{b==="transform"?h[b]=`${h[b]||""} ${M||""}`.trim():b in h&&typeof h[b]=="number"&&typeof M=="number"?h[b]=h[b]*M:h[b]=M}),h},[d,x]);if((m=Y.transform)!=null&&m.includes("rotate")){const h=Y.transform;Y.transform=h.replace(/rotate\(([^)]+)deg\)/,(b,M)=>`rotate(${parseFloat(M)-O}deg)`)}const H=C.useMemo(()=>{const h=Y.transform||"",{translateX:b,translateY:M,scale:N,rotation:V,rotateX:L,rotateY:r,rotateZ:F}=W(h);return`${b} ${M} ${N} ${V||`rotate(${E}deg)`} ${L} ${r} ${F}`.trim()},[Y,E]);let c=n;E>0&&c.transform&&c.transform.includes("translateX")&&(c={...c,transform:c.transform.replace(/translateX\(([^)]+)\)/g,(h,b)=>`translateX(${parseFloat(b)}%)`)});const{top:j,left:y,position:P,transform:_,...B}=$||{};return S.jsx("div",{style:{width:"100%",height:"100%",overflow:Y.overflow||o.overflow||l.overflow||"visible",pointerEvents:"none"},children:S.jsx("div",{style:{width:"100%",height:"100%",...B,...Y,rotate:`${O}deg`,overflow:"visible",transform:H,pointerEvents:"none",background:Object.keys(Y).length===0?"transparent":Y.backgroundColor},children:i})})},W=t=>{let f="",s="",i="scale(1)",$="",a="",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&&(i=e[e.length-1]);const o=t.match(/rotate\([^)]+\)/g);o&&($=o[o.length-1]);const l=t.match(/rotateX\([^)]+\)/g);l&&(a=l[l.length-1]);const d=t.match(/rotateY\([^)]+\)/g);d&&(g=d[d.length-1]);const x=t.match(/rotateZ\([^)]+\)/g);return x&&(u=x[x.length-1]),{translateX:f,translateY:s,scale:i,rotation:$,rotateX:a,rotateY:g,rotateZ:u}},K=({animationTimed:t,durationInFrames:f,children:s,style:i={},frame:$})=>{var l;const a=I(T(t),f,$,!1,!0),u=((i==null?void 0:i.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),p=u?parseFloat(u[1]):0,n=-p,e=C.useMemo(()=>({...a}),[a]);if((l=e.transform)!=null&&l.includes("rotate")){const d=e.transform;e.transform=d.replace(/rotate\(([^)]+)deg\)/,(x,w)=>`rotate(${parseFloat(w)-n}deg)`)}let o=e;return p>0&&o.transform&&o.transform.includes("translateX")&&(o={...o,transform:o.transform.replace(/translateX\(([^)]+)\)/g,(d,x)=>`translateX(${parseFloat(x)}%)`)}),S.jsx("div",{style:{overflow:e.overflow||"visible",pointerEvents:"none",height:i.height||"100%",width:i.width||"100%",...o},children:S.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 A.Easing.in(A.Easing.cubic);case"ease-out":case"smooth":case"slowDown":return A.Easing.out(A.Easing.cubic);case"ease-in-out":case"natural":case"swing":return A.Easing.inOut(A.Easing.cubic);case"bounce":return A.Easing.bounce;case"elastic":return A.Easing.elastic(1);case"overshoot":case"impulse":return A.Easing.out(A.Easing.back(1.7));case"none":case"linear":default:return A.Easing.linear}},R=({children:t,currentWidth:f,currentHeight:s,frame:i,item:$,keyframeAnimations:a,durationInFrames:g})=>{var V,L;if(!a||!Array.isArray(a)||a.length===0)return S.jsx(S.Fragment,{children:t});const u=r=>{var F,D;return!!((F=r==null?void 0:r.property)!=null&&F.includes("maskReveal")||(D=r==null?void 0:r.id)!=null&&D.includes("maskReveal"))},p=r=>{var F,D;return!!((r==null?void 0:r.type)==="exit"||(F=r==null?void 0:r.property)!=null&&F.includes("Out")||(D=r==null?void 0:r.id)!=null&&D.includes("Out"))},n=a.find(r=>u(r)&&!p(r)),e=a.find(r=>u(r)&&p(r));if(!n&&!e)return S.jsx(S.Fragment,{children:t});const o=Math.max(1,g||300);let l=null,d=!1,x=30,w=0;if(e){const r=Math.max(1,Number(e.durationInFrames||30)),F=Math.max(0,Number(e.delay||0)),D=Math.max(0,o-r-F);i>=D&&(l=e,d=!0,x=r,w=i-D)}if(!l&&n){l=n,d=!1,x=Math.max(1,Number(n.durationInFrames||30));const r=Math.max(0,Number(n.delay||0));w=i-r}if(!l)return S.jsx(S.Fragment,{children:t});const v=n?Math.max(0,Number(n.delay||0)):0,E=n?Math.max(1,Number(n.durationInFrames||30)):30;if(!d&&n&&i>=v+E)return S.jsx("div",{style:{width:"100%",height:"100%",position:"relative",overflow:"visible"},children:t});if(!d&&n&&i<v)return S.jsx("div",{style:{width:"100%",height:"100%",position:"relative",visibility:"hidden"},children:t});const O=Math.max(0,w),Y=Math.min(Math.max(0,O/x),1),H=Q(l),c=Math.max(0,Math.min(1,H(Y))),j=String(l.property||l.id||""),y=((V=l.details)==null?void 0:V.direction)||"up",P=j.includes("ShrinkScale"),_=j.includes("CenterScale"),B=j.includes("Slide")||j.includes("slide");let m,h="";if(_){const r=d?50*c:50*(1-c);m=`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(P){const r=d?25*c:25*(1-c);m=`inset(
7
- ${r}%
8
- ${r}%
9
- ${r}%
10
- ${r}%
11
- )`}else if(B)m="inset(0% 0% 0% 0%)",d?y==="down"?h=`translateY(${100*c}%)`:y==="left"?h=`translateX(${-100*c}%)`:y==="right"?h=`translateX(${100*c}%)`:h=`translateY(${-100*c}%)`:y==="down"?h=`translateY(${-100*(1-c)}%)`:y==="left"?h=`translateX(${100*(1-c)}%)`:y==="right"?h=`translateX(${-100*(1-c)}%)`:h=`translateY(${100*(1-c)}%)`;else if(j.includes("Center"))m=`circle(${d?150*(1-c):150*c}% at 50% 50%)`;else if(j.includes("Corner")){const r=d?c:1-c;y==="down"?m=`inset(0 ${100*r}% ${100*r}% 0)`:y==="up"?m=`inset(${100*r}% ${100*r}% 0 0)`:y==="left"?m=`inset(0 0 ${100*r}% ${100*r}%)`:y==="right"?m=`inset(${100*r}% 0 0 ${100*r}%)`:m=`inset(0 ${100*r}% ${100*r}% 0)`}else d?y==="down"?m=`inset(${100*c}% 0 0 0)`:y==="left"?m=`inset(0 ${100*c}% 0 0)`:y==="right"?m=`inset(0 0 0 ${100*c}%)`:m=`inset(0 0 ${100*c}% 0)`:y==="down"?m=`inset(0 0 ${100*(1-c)}% 0)`:y==="left"?m=`inset(0 0 0 ${100*(1-c)}%)`:y==="right"?m=`inset(0 ${100*(1-c)}% 0 0)`:m=`inset(${100*(1-c)}% 0 0 0)`;const b=!!((L=l==null?void 0:l.details)!=null&&L.scale||l!=null&&l.scale);let M=1;_||P?M=d?1+.5*c:1.5-.5*c:b&&(M=d?1-.2*c:.8+.2*c);const N=[h,`scale(${M})`].filter(Boolean).join(" ");return console.log("[MaskAnim] Rendering:",{propName:j,frame:i,localFrame:w,animDuration:x,progress:Y,easedProgress:c,isOut:d,isShrinkScale:P,isCenterScale:_,isSlide:B,direction:y,clipPath:m,translateTransform:h,isScale:b,scaleValue:M,innerTransform:N}),S.jsx("div",{style:{width:f!==void 0?f:"100%",height:s!==void 0?s:"100%",position:"relative",clipPath:m,WebkitClipPath:m,overflow:"hidden"},children:S.jsx("div",{style:{width:"100%",height:"100%",transform:N,transformOrigin:"center"},children:t})})};X.BoxAnim=J,X.ContentAnim=K,X.MaskAnim=R,X.combine=G,X.combineAnimations=T,X.extractTransformations=W,X.useAnimation=I,Object.defineProperty(X,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"})});
package/dist/mask.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export declare const MaskWrapper: ({ children, currentWidth: _currentWidth, currentHeight: _currentHeight, frame, item: _item, keyframeAnimations, durationInFrames: itemDurationInFrames, }: {
3
+ export declare const MaskWrapper: ({ children, currentWidth: _currentWidth, currentHeight: _currentHeight, frame, item: _item, keyframeAnimations, durationInFrames: itemDurationInFrames }: {
4
4
  children: React.ReactNode;
5
5
  currentWidth?: number;
6
6
  currentHeight?: number;
@@ -9,7 +9,7 @@ export declare const MaskWrapper: ({ children, currentWidth: _currentWidth, curr
9
9
  keyframeAnimations: any;
10
10
  durationInFrames?: number;
11
11
  }) => React.JSX.Element;
12
- export declare const MaskAnim: ({ children, currentWidth: _currentWidth, currentHeight: _currentHeight, frame, item: _item, keyframeAnimations, durationInFrames: itemDurationInFrames, }: {
12
+ export declare const MaskAnim: ({ children, currentWidth: _currentWidth, currentHeight: _currentHeight, frame, item: _item, keyframeAnimations, durationInFrames: itemDurationInFrames }: {
13
13
  children: React.ReactNode;
14
14
  currentWidth?: number;
15
15
  currentHeight?: number;
@@ -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.11",
3
+ "version": "9.0.13",
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": "8.0.10",
29
+ "@cliquify.me/types": "8.0.12",
30
30
  "@cliquify.me/typescript-config": "0.0.2"
31
31
  },
32
32
  "dependencies": {
@@ -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.10"
41
+ "@cliquify.me/types": "8.0.12"
42
42
  },
43
43
  "scripts": {
44
44
  "dev": "vite",