@remotion/animation-utils 4.0.213 → 4.0.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  // src/transformation-helpers/interpolate-styles/index.tsx
2
- import {interpolate, interpolateColors} from "remotion";
2
+ import { interpolate, interpolateColors } from "remotion";
3
3
 
4
4
  // src/transformation-helpers/interpolate-styles/utils.ts
5
- import {NoReactInternals} from "remotion/no-react";
5
+ import { NoReactInternals } from "remotion/no-react";
6
6
 
7
7
  // src/transformation-helpers/interpolate-styles/constants.ts
8
8
  var NUMBER = "[-+]?\\d*\\.?\\d+";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { InterpolateOptions } from 'remotion';
3
2
  import type { Style } from '../../type';
4
3
  /**
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getColorMatchers = exports.breakDownValueIntoUnitNumberAndFunctions = void 0;
3
+ exports.breakDownValueIntoUnitNumberAndFunctions = void 0;
4
+ exports.getColorMatchers = getColorMatchers;
4
5
  const no_react_1 = require("remotion/no-react");
5
6
  const constants_1 = require("./constants");
6
7
  function call(...args) {
@@ -31,7 +32,6 @@ function getColorMatchers() {
31
32
  }
32
33
  return cachedMatchers;
33
34
  }
34
- exports.getColorMatchers = getColorMatchers;
35
35
  const extractOrderedPartsOfValue = (value) => {
36
36
  const parts = [];
37
37
  let remainingValue = value;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.translateZ = exports.translateY = exports.translateX = exports.translate3d = exports.translate = exports.skewY = exports.skewX = exports.skew = exports.scaleZ = exports.scaleY = exports.scaleX = exports.scale3d = exports.scale = exports.rotateZ = exports.rotateY = exports.rotateX = exports.rotate3d = exports.rotate = exports.perspective = exports.matrix3d = exports.matrix = exports.makeTransform = void 0;
3
+ exports.translateZ = exports.translateY = exports.translateX = exports.translate3d = exports.translate = exports.skewY = exports.skewX = exports.skew = exports.scaleZ = exports.scaleY = exports.scaleX = exports.scale3d = exports.scale = exports.rotateZ = exports.rotateY = exports.rotateX = exports.rotate3d = exports.rotate = exports.perspective = exports.matrix3d = exports.matrix = void 0;
4
+ exports.makeTransform = makeTransform;
4
5
  const transform_functions_1 = require("./transform-functions");
5
6
  Object.defineProperty(exports, "matrix", { enumerable: true, get: function () { return transform_functions_1.matrix; } });
6
7
  Object.defineProperty(exports, "matrix3d", { enumerable: true, get: function () { return transform_functions_1.matrix3d; } });
@@ -26,4 +27,3 @@ Object.defineProperty(exports, "translateZ", { enumerable: true, get: function (
26
27
  function makeTransform(transforms) {
27
28
  return transforms.join(' ');
28
29
  }
29
- exports.makeTransform = makeTransform;
@@ -2,7 +2,27 @@
2
2
  /* eslint-disable no-redeclare */
3
3
  /* eslint-disable max-params */
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.translateZ = exports.translateY = exports.translateX = exports.translate3d = exports.translate = exports.skewY = exports.skewX = exports.skew = exports.scaleZ = exports.scaleY = exports.scaleX = exports.scale3d = exports.scale = exports.rotateZ = exports.rotateY = exports.rotateX = exports.rotate3d = exports.rotate = exports.perspective = exports.matrix3d = exports.matrix = void 0;
5
+ exports.matrix = matrix;
6
+ exports.matrix3d = matrix3d;
7
+ exports.perspective = perspective;
8
+ exports.rotate = rotate;
9
+ exports.rotate3d = rotate3d;
10
+ exports.rotateX = rotateX;
11
+ exports.rotateY = rotateY;
12
+ exports.rotateZ = rotateZ;
13
+ exports.scale = scale;
14
+ exports.scale3d = scale3d;
15
+ exports.scaleX = scaleX;
16
+ exports.scaleY = scaleY;
17
+ exports.scaleZ = scaleZ;
18
+ exports.skew = skew;
19
+ exports.skewX = skewX;
20
+ exports.skewY = skewY;
21
+ exports.translate = translate;
22
+ exports.translate3d = translate3d;
23
+ exports.translateX = translateX;
24
+ exports.translateY = translateY;
25
+ exports.translateZ = translateZ;
6
26
  const type_1 = require("../../type");
7
27
  const is_unit_with_string_1 = require("./is-unit-with-string");
8
28
  /* Matrix transformation */
@@ -26,7 +46,6 @@ function matrix(a, b, c, d, tx, ty) {
26
46
  checkNumber({ num: ty, param: 'ty', api: 'matrix' });
27
47
  return `matrix(${a}, ${b}, ${c}, ${d}, ${tx}, ${ty})`;
28
48
  }
29
- exports.matrix = matrix;
30
49
  function matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4) {
31
50
  checkNumber({ num: a1, param: 'a1', api: 'matrix3d' });
32
51
  checkNumber({ num: b1, param: 'b1', api: 'matrix3d' });
@@ -46,7 +65,6 @@ function matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4
46
65
  checkNumber({ num: d4, param: 'd4', api: 'matrix3d' });
47
66
  return `matrix3d(${a1}, ${b1}, ${c1}, ${d1}, ${a2}, ${b2}, ${c2}, ${d2}, ${a3}, ${b3}, ${c3}, ${d3}, ${a4}, ${b4}, ${c4}, ${d4})`;
48
67
  }
49
- exports.matrix3d = matrix3d;
50
68
  function perspective(length, unit = 'px') {
51
69
  if ((0, is_unit_with_string_1.isUnitWithString)(length, type_1.lengthUnits)) {
52
70
  return `perspective(${length})`;
@@ -54,7 +72,6 @@ function perspective(length, unit = 'px') {
54
72
  checkNumber({ num: length, param: 'length', api: 'perspective' });
55
73
  return `perspective(${length}${unit})`;
56
74
  }
57
- exports.perspective = perspective;
58
75
  function rotate(angle, unit = 'deg') {
59
76
  if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
60
77
  return `rotate(${angle})`;
@@ -62,7 +79,6 @@ function rotate(angle, unit = 'deg') {
62
79
  checkNumber({ num: angle, param: 'angle', api: 'rotate' });
63
80
  return `rotate(${angle}${unit})`;
64
81
  }
65
- exports.rotate = rotate;
66
82
  function rotate3d(x, y, z, angle, unit = 'deg') {
67
83
  checkNumber({ num: x, param: 'x', api: 'rotate3d' });
68
84
  checkNumber({ num: y, param: 'y', api: 'rotate3d' });
@@ -73,7 +89,6 @@ function rotate3d(x, y, z, angle, unit = 'deg') {
73
89
  checkNumber({ num: angle, param: 'angle', api: 'rotate3d' });
74
90
  return `rotate3d(${x}, ${y}, ${z}, ${angle}${unit})`;
75
91
  }
76
- exports.rotate3d = rotate3d;
77
92
  function rotateX(angle, unit = 'deg') {
78
93
  if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
79
94
  return `rotateX(${angle})`;
@@ -81,7 +96,6 @@ function rotateX(angle, unit = 'deg') {
81
96
  checkNumber({ num: angle, param: 'angle', api: 'rotateX' });
82
97
  return `rotateX(${angle}${unit})`;
83
98
  }
84
- exports.rotateX = rotateX;
85
99
  function rotateY(angle, unit = 'deg') {
86
100
  if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
87
101
  return `rotateY(${angle})`;
@@ -89,7 +103,6 @@ function rotateY(angle, unit = 'deg') {
89
103
  checkNumber({ num: angle, param: 'angle', api: 'rotateY' });
90
104
  return `rotateY(${angle}${unit})`;
91
105
  }
92
- exports.rotateY = rotateY;
93
106
  function rotateZ(angle, unit = 'deg') {
94
107
  if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
95
108
  return `rotateZ(${angle})`;
@@ -97,35 +110,29 @@ function rotateZ(angle, unit = 'deg') {
97
110
  checkNumber({ num: angle, param: 'angle', api: 'rotateZ' });
98
111
  return `rotateZ(${angle}${unit})`;
99
112
  }
100
- exports.rotateZ = rotateZ;
101
113
  /* Scale */
102
114
  function scale(x, y = x) {
103
115
  checkNumber({ num: x, param: 'x', api: 'scale' });
104
116
  return `scale(${x}, ${y})`;
105
117
  }
106
- exports.scale = scale;
107
118
  function scale3d(x, y, z) {
108
119
  checkNumber({ num: x, param: 'x', api: 'scale3d' });
109
120
  checkNumber({ num: y, param: 'y', api: 'scale3d' });
110
121
  checkNumber({ num: z, param: 'z', api: 'scale3d' });
111
122
  return `scale3d(${x}, ${y}, ${z})`;
112
123
  }
113
- exports.scale3d = scale3d;
114
124
  function scaleX(x) {
115
125
  checkNumber({ num: x, param: 'x', api: 'scaleX' });
116
126
  return `scaleX(${x})`;
117
127
  }
118
- exports.scaleX = scaleX;
119
128
  function scaleY(y) {
120
129
  checkNumber({ num: y, param: 'y', api: 'scaleY' });
121
130
  return `scaleY(${y})`;
122
131
  }
123
- exports.scaleY = scaleY;
124
132
  function scaleZ(z) {
125
133
  checkNumber({ num: z, param: 'z', api: 'scaleZ' });
126
134
  return `scaleZ(${z})`;
127
135
  }
128
- exports.scaleZ = scaleZ;
129
136
  function skew(...args) {
130
137
  const [arg1, arg2, arg3, arg4] = args;
131
138
  if (arguments.length === 1) {
@@ -175,7 +182,6 @@ function skew(...args) {
175
182
  'skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;',
176
183
  ].join('\n'));
177
184
  }
178
- exports.skew = skew;
179
185
  function skewX(angle, unit = 'deg') {
180
186
  if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
181
187
  return `skewX(${angle})`;
@@ -183,7 +189,6 @@ function skewX(angle, unit = 'deg') {
183
189
  checkNumber({ num: angle, param: 'angle', api: 'skewX' });
184
190
  return `skewX(${angle}${unit})`;
185
191
  }
186
- exports.skewX = skewX;
187
192
  function skewY(angle, unit = 'deg') {
188
193
  if ((0, is_unit_with_string_1.isUnitWithString)(angle, type_1.angleUnits)) {
189
194
  return `skewY(${angle})`;
@@ -191,7 +196,6 @@ function skewY(angle, unit = 'deg') {
191
196
  checkNumber({ num: angle, param: 'angle', api: 'skewY' });
192
197
  return `skewY(${angle}${unit})`;
193
198
  }
194
- exports.skewY = skewY;
195
199
  function translate(...args) {
196
200
  const [arg1, arg2, arg3, arg4] = args;
197
201
  if (arguments.length === 1) {
@@ -238,7 +242,6 @@ function translate(...args) {
238
242
  `translate(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit): string;`,
239
243
  ].join('\n'));
240
244
  }
241
- exports.translate = translate;
242
245
  function translate3d(...args) {
243
246
  if (arguments.length === 3) {
244
247
  const [x, y, z] = args;
@@ -275,7 +278,6 @@ function translate3d(...args) {
275
278
  `translate3d(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit, z: number, unitZ: LengthUnit)`,
276
279
  ].join('\n'));
277
280
  }
278
- exports.translate3d = translate3d;
279
281
  function translateX(x, unit = 'px') {
280
282
  if ((0, is_unit_with_string_1.isUnitWithString)(x, type_1.lengthPercentageUnits)) {
281
283
  return `translateX(${x})`;
@@ -283,7 +285,6 @@ function translateX(x, unit = 'px') {
283
285
  checkNumber({ num: x, param: 'x', api: 'translateX' });
284
286
  return `translateX(${x}${unit})`;
285
287
  }
286
- exports.translateX = translateX;
287
288
  function translateY(y, unit = 'px') {
288
289
  if ((0, is_unit_with_string_1.isUnitWithString)(y, type_1.lengthPercentageUnits)) {
289
290
  return `translateY(${y})`;
@@ -291,7 +292,6 @@ function translateY(y, unit = 'px') {
291
292
  checkNumber({ num: y, param: 'y', api: 'translateY' });
292
293
  return `translateY(${y}${unit})`;
293
294
  }
294
- exports.translateY = translateY;
295
295
  function translateZ(z, unit = 'px') {
296
296
  if ((0, is_unit_with_string_1.isUnitWithString)(z, type_1.lengthUnits)) {
297
297
  return `translateZ(${z})`;
@@ -299,4 +299,3 @@ function translateZ(z, unit = 'px') {
299
299
  checkNumber({ num: z, param: 'z', api: 'translateZ' });
300
300
  return `translateZ(${z}${unit})`;
301
301
  }
302
- exports.translateZ = translateZ;
package/dist/type.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { breakDownValueIntoUnitNumberAndFunctions } from './transformation-helpers/interpolate-styles/utils';
3
2
  import type { matrix, matrix3d, perspective, rotate, rotate3d, rotateX, rotateY, rotateZ, scale, scale3d, scaleX, scaleY, scaleZ, skew, skewX, skewY, translate, translate3d, translateX, translateY, translateZ } from './transformation-helpers/make-transform';
4
3
  export declare const lengthUnits: readonly ["px", "em", "rem", "pt", "cap", "ch", "ex", "ic", "lh", "rlh", "vmax", "vmin", "vb", "vi", "cqw", "vh", "vw", "cqh", "cqi", "cqb", "cqmin", "cqmax", "cm", "mm", "Q", "in", "pc"];
@@ -28,4 +27,4 @@ type CSSPropertiesKey = keyof Style;
28
27
  type CSSPropertiesValue = Style[CSSPropertiesKey];
29
28
  type UnitNumberAndFunctions = ReturnType<typeof breakDownValueIntoUnitNumberAndFunctions>;
30
29
  type UnitNumberAndFunction = UnitNumberAndFunctions[0];
31
- export type { AngleUnit, CSSPropertiesKey, CSSPropertiesValue, ColorMatchers, LengthPercentageUnit, LengthUnit, Style, TransformFunctionReturnType, UnitNumberAndFunction, };
30
+ export type { AngleUnit, ColorMatchers, CSSPropertiesKey, CSSPropertiesValue, LengthPercentageUnit, LengthUnit, Style, TransformFunctionReturnType, UnitNumberAndFunction, };
package/package.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "name": "Chetan Karwa",
8
8
  "email": "cbkarwa@gmail.com"
9
9
  },
10
- "version": "4.0.213",
10
+ "version": "4.0.215",
11
11
  "description": "Helpers for animating CSS properties",
12
12
  "main": "./dist/index.js",
13
13
  "module": "./dist/index.mjs",
14
14
  "types": "./dist/index.d.ts",
15
15
  "dependencies": {
16
- "remotion": "4.0.213"
16
+ "remotion": "4.0.215"
17
17
  },
18
18
  "files": [
19
19
  "dist",
@@ -43,7 +43,7 @@
43
43
  "scripts": {
44
44
  "formatting": "prettier src --check",
45
45
  "lint": "eslint src --ext ts,tsx",
46
- "build": "bun --env-file=../.env.bundle bundle.ts",
46
+ "make": "bun --env-file=../.env.bundle bundle.ts",
47
47
  "test": "bun test src"
48
48
  }
49
49
  }