@remotion/animation-utils 4.0.232 → 4.0.233
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/esm/index.mjs +47 -44
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -133,32 +133,6 @@ var breakDownValueIntoUnitNumberAndFunctions = (value) => {
|
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
// src/transformation-helpers/interpolate-styles/index.tsx
|
|
136
|
-
function checkInputRange(arr) {
|
|
137
|
-
if (arr.length < 2) {
|
|
138
|
-
throw new Error("inputRange must have at least 2 elements");
|
|
139
|
-
}
|
|
140
|
-
for (let index = 0;index < arr.length; index++) {
|
|
141
|
-
if (typeof arr[index] !== "number") {
|
|
142
|
-
throw new Error(`inputRange must contain only numbers`);
|
|
143
|
-
}
|
|
144
|
-
if (arr[index] === -Infinity || arr[index] === Infinity) {
|
|
145
|
-
throw new Error(`inputRange must contain only finite numbers, but got [${arr.join(",")}]`);
|
|
146
|
-
}
|
|
147
|
-
if (index > 0 && !(arr[index] > arr[index - 1])) {
|
|
148
|
-
throw new Error(`inputRange must be strictly monotonically non-decreasing but got [${arr.join(",")}]`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function checkStylesRange(arr) {
|
|
153
|
-
if (arr.length < 2) {
|
|
154
|
-
throw new Error("outputStyles must have at least 2 elements");
|
|
155
|
-
}
|
|
156
|
-
for (const index in arr) {
|
|
157
|
-
if (typeof arr[index] !== "object") {
|
|
158
|
-
throw new Error("outputStyles must contain only objects");
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
136
|
var interpolatedPropertyPart = ({
|
|
163
137
|
inputValue,
|
|
164
138
|
inputRange,
|
|
@@ -283,6 +257,32 @@ var interpolateStylesFunction = ({
|
|
|
283
257
|
};
|
|
284
258
|
}, {});
|
|
285
259
|
};
|
|
260
|
+
function checkInputRange(arr) {
|
|
261
|
+
if (arr.length < 2) {
|
|
262
|
+
throw new Error("inputRange must have at least 2 elements");
|
|
263
|
+
}
|
|
264
|
+
for (let index = 0;index < arr.length; index++) {
|
|
265
|
+
if (typeof arr[index] !== "number") {
|
|
266
|
+
throw new Error(`inputRange must contain only numbers`);
|
|
267
|
+
}
|
|
268
|
+
if (arr[index] === -Infinity || arr[index] === Infinity) {
|
|
269
|
+
throw new Error(`inputRange must contain only finite numbers, but got [${arr.join(",")}]`);
|
|
270
|
+
}
|
|
271
|
+
if (index > 0 && !(arr[index] > arr[index - 1])) {
|
|
272
|
+
throw new Error(`inputRange must be strictly monotonically non-decreasing but got [${arr.join(",")}]`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function checkStylesRange(arr) {
|
|
277
|
+
if (arr.length < 2) {
|
|
278
|
+
throw new Error("outputStyles must have at least 2 elements");
|
|
279
|
+
}
|
|
280
|
+
for (const index in arr) {
|
|
281
|
+
if (typeof arr[index] !== "object") {
|
|
282
|
+
throw new Error("outputStyles must contain only objects");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
286
|
var interpolateStyles = (input, inputRange, outputStylesRange, options) => {
|
|
287
287
|
if (typeof input === "undefined") {
|
|
288
288
|
throw new Error("input can not be undefined");
|
|
@@ -374,6 +374,21 @@ var isUnitWithString = (input, units) => {
|
|
|
374
374
|
};
|
|
375
375
|
|
|
376
376
|
// src/transformation-helpers/make-transform/transform-functions.ts
|
|
377
|
+
var checkNumber = ({
|
|
378
|
+
num,
|
|
379
|
+
param,
|
|
380
|
+
api
|
|
381
|
+
}) => {
|
|
382
|
+
if (typeof num === "undefined") {
|
|
383
|
+
throw new TypeError(`Argument passed to "${api}" for param "${param}" is undefined`);
|
|
384
|
+
}
|
|
385
|
+
if (typeof num !== "number") {
|
|
386
|
+
throw new TypeError(`Argument passed to "${api}" for param "${param}" is ${JSON.stringify(num)}`);
|
|
387
|
+
}
|
|
388
|
+
if (!Number.isFinite(num)) {
|
|
389
|
+
throw new TypeError(`Argument passed to "${api}" for param "${param}" is ${JSON.stringify(num)} (must be finite)`);
|
|
390
|
+
}
|
|
391
|
+
};
|
|
377
392
|
function matrix(a, b, c, d, tx, ty) {
|
|
378
393
|
checkNumber({ num: a, param: "a", api: "matrix" });
|
|
379
394
|
checkNumber({ num: b, param: "b", api: "matrix" });
|
|
@@ -506,7 +521,8 @@ function skew(...args) {
|
|
|
506
521
|
"skew(angle: number, unit: AngleUnit): string;",
|
|
507
522
|
"skew(angleX: number, angleY: number): string;",
|
|
508
523
|
"skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;"
|
|
509
|
-
].join(
|
|
524
|
+
].join(`
|
|
525
|
+
`));
|
|
510
526
|
}
|
|
511
527
|
function skewX(angle, unit = "deg") {
|
|
512
528
|
if (isUnitWithString(angle, angleUnits)) {
|
|
@@ -559,7 +575,8 @@ function translate(...args) {
|
|
|
559
575
|
`translate(x: number, y: number)`,
|
|
560
576
|
`translate(translation: number, unit: LengthPercentageUnit)`,
|
|
561
577
|
`translate(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit): string;`
|
|
562
|
-
].join(
|
|
578
|
+
].join(`
|
|
579
|
+
`));
|
|
563
580
|
}
|
|
564
581
|
function translate3d(...args) {
|
|
565
582
|
if (arguments.length === 3) {
|
|
@@ -593,7 +610,8 @@ function translate3d(...args) {
|
|
|
593
610
|
`translate3d() supports only the following signatures:`,
|
|
594
611
|
`translate3d(x: LengthPercentageUnitString, y: LengthPercentageUnitString, z: LengthPercentageUnitString)`,
|
|
595
612
|
`translate3d(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit, z: number, unitZ: LengthUnit)`
|
|
596
|
-
].join(
|
|
613
|
+
].join(`
|
|
614
|
+
`));
|
|
597
615
|
}
|
|
598
616
|
function translateX(x, unit = "px") {
|
|
599
617
|
if (isUnitWithString(x, lengthPercentageUnits)) {
|
|
@@ -616,21 +634,6 @@ function translateZ(z, unit = "px") {
|
|
|
616
634
|
checkNumber({ num: z, param: "z", api: "translateZ" });
|
|
617
635
|
return `translateZ(${z}${unit})`;
|
|
618
636
|
}
|
|
619
|
-
var checkNumber = ({
|
|
620
|
-
num,
|
|
621
|
-
param,
|
|
622
|
-
api
|
|
623
|
-
}) => {
|
|
624
|
-
if (typeof num === "undefined") {
|
|
625
|
-
throw new TypeError(`Argument passed to "${api}" for param "${param}" is undefined`);
|
|
626
|
-
}
|
|
627
|
-
if (typeof num !== "number") {
|
|
628
|
-
throw new TypeError(`Argument passed to "${api}" for param "${param}" is ${JSON.stringify(num)}`);
|
|
629
|
-
}
|
|
630
|
-
if (!Number.isFinite(num)) {
|
|
631
|
-
throw new TypeError(`Argument passed to "${api}" for param "${param}" is ${JSON.stringify(num)} (must be finite)`);
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
637
|
|
|
635
638
|
// src/transformation-helpers/make-transform/index.ts
|
|
636
639
|
function makeTransform(transforms) {
|
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.
|
|
10
|
+
"version": "4.0.233",
|
|
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.
|
|
16
|
+
"remotion": "4.0.233"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"eslint": "9.14.0",
|
|
28
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
28
|
+
"@remotion/eslint-config-internal": "4.0.233"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
"./package.json": "./package.json",
|