@remotion/vercel 4.0.489 → 4.0.490
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 +98 -22
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -365,8 +365,20 @@ var serializeStringInterpolationValue = ({
|
|
|
365
365
|
}
|
|
366
366
|
return values.slice(0, dimensions).map((value, index) => \`\${stringifyNumber(value)}\${units[index]}\`).join(" ");
|
|
367
367
|
};
|
|
368
|
+
var toSignedArea = (scale) => {
|
|
369
|
+
if (scale === 0) {
|
|
370
|
+
return 0;
|
|
371
|
+
}
|
|
372
|
+
return Math.sign(scale) * scale * scale;
|
|
373
|
+
};
|
|
374
|
+
var fromSignedArea = (area) => {
|
|
375
|
+
if (area === 0) {
|
|
376
|
+
return 0;
|
|
377
|
+
}
|
|
378
|
+
return Math.sign(area) * Math.sqrt(Math.abs(area));
|
|
379
|
+
};
|
|
368
380
|
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
369
|
-
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
381
|
+
const { extrapolateLeft, extrapolateRight, easing, output } = options;
|
|
370
382
|
let result = input;
|
|
371
383
|
const [inputMin, inputMax] = inputRange;
|
|
372
384
|
const [outputMin, outputMax] = outputRange;
|
|
@@ -397,7 +409,13 @@ function interpolateFunction(input, inputRange, outputRange, options) {
|
|
|
397
409
|
}
|
|
398
410
|
result = (result - inputMin) / (inputMax - inputMin);
|
|
399
411
|
result = easing(result);
|
|
400
|
-
|
|
412
|
+
if (output === "perceptual-scale") {
|
|
413
|
+
const signedAreaMin = toSignedArea(outputMin);
|
|
414
|
+
const signedAreaMax = toSignedArea(outputMax);
|
|
415
|
+
result = fromSignedArea(result * (signedAreaMax - signedAreaMin) + signedAreaMin);
|
|
416
|
+
} else {
|
|
417
|
+
result = result * (outputMax - outputMin) + outputMin;
|
|
418
|
+
}
|
|
401
419
|
return result;
|
|
402
420
|
}
|
|
403
421
|
function findRange(input, inputRange) {
|
|
@@ -410,6 +428,9 @@ function findRange(input, inputRange) {
|
|
|
410
428
|
return i - 1;
|
|
411
429
|
}
|
|
412
430
|
var defaultEasing = (num) => num;
|
|
431
|
+
var resolveOutputOption = (output) => {
|
|
432
|
+
return output ?? "linear";
|
|
433
|
+
};
|
|
413
434
|
var shouldExtendRightForEasing = (easing) => {
|
|
414
435
|
return easing.remotionShouldExtendRight === true;
|
|
415
436
|
};
|
|
@@ -431,12 +452,14 @@ var interpolateSegment = ({
|
|
|
431
452
|
outputRange,
|
|
432
453
|
easing,
|
|
433
454
|
extrapolateLeft,
|
|
434
|
-
extrapolateRight
|
|
455
|
+
extrapolateRight,
|
|
456
|
+
output
|
|
435
457
|
}) => {
|
|
436
458
|
return interpolateFunction(input, inputRange, outputRange, {
|
|
437
459
|
easing,
|
|
438
460
|
extrapolateLeft,
|
|
439
|
-
extrapolateRight: input > inputRange[1] && extrapolateRight === "clamp" && shouldExtendRightForEasing(easing) ? "extend" : extrapolateRight
|
|
461
|
+
extrapolateRight: input > inputRange[1] && extrapolateRight === "clamp" && shouldExtendRightForEasing(easing) ? "extend" : extrapolateRight,
|
|
462
|
+
output
|
|
440
463
|
});
|
|
441
464
|
};
|
|
442
465
|
var interpolateNumber = ({
|
|
@@ -445,6 +468,7 @@ var interpolateNumber = ({
|
|
|
445
468
|
outputRange,
|
|
446
469
|
options
|
|
447
470
|
}) => {
|
|
471
|
+
const output = resolveOutputOption(options?.output);
|
|
448
472
|
if (inputRange.length === 1) {
|
|
449
473
|
return outputRange[0];
|
|
450
474
|
}
|
|
@@ -469,7 +493,8 @@ var interpolateNumber = ({
|
|
|
469
493
|
outputRange: [outputRange[range], outputRange[range + 1]],
|
|
470
494
|
easing,
|
|
471
495
|
extrapolateLeft,
|
|
472
|
-
extrapolateRight
|
|
496
|
+
extrapolateRight,
|
|
497
|
+
output
|
|
473
498
|
});
|
|
474
499
|
for (let segmentIndex = 0;segmentIndex < range; segmentIndex++) {
|
|
475
500
|
const previousEasing = resolveEasingForSegment({
|
|
@@ -489,7 +514,8 @@ var interpolateNumber = ({
|
|
|
489
514
|
outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
|
|
490
515
|
easing: previousEasing,
|
|
491
516
|
extrapolateLeft,
|
|
492
|
-
extrapolateRight: "extend"
|
|
517
|
+
extrapolateRight: "extend",
|
|
518
|
+
output
|
|
493
519
|
});
|
|
494
520
|
result += continuedSegmentValue - outputRange[segmentIndex + 1];
|
|
495
521
|
}
|
|
@@ -537,14 +563,18 @@ var interpolateString = ({
|
|
|
537
563
|
}
|
|
538
564
|
}
|
|
539
565
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
values
|
|
566
|
+
const values = [0, 0, 0];
|
|
567
|
+
for (let axis = 0;axis < dimensions; axis++) {
|
|
568
|
+
values[axis] = interpolateNumber({
|
|
543
569
|
input,
|
|
544
570
|
inputRange,
|
|
545
571
|
outputRange: parsedOutputRange.map((parsed) => parsed.values[axis]),
|
|
546
572
|
options
|
|
547
|
-
})
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
return serializeStringInterpolationValue({
|
|
576
|
+
kind,
|
|
577
|
+
values,
|
|
548
578
|
units,
|
|
549
579
|
dimensions
|
|
550
580
|
});
|
|
@@ -628,6 +658,12 @@ function assertValidInterpolatePosterizeOption(posterize) {
|
|
|
628
658
|
throw new Error(\`posterize must be a positive finite number, but got \${posterize}\`);
|
|
629
659
|
}
|
|
630
660
|
}
|
|
661
|
+
function assertValidInterpolateOutputOption(output) {
|
|
662
|
+
if (output === undefined || output === "linear" || output === "perceptual-scale") {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
throw new Error(\`output must be "linear" or "perceptual-scale", but got \${String(output)}\`);
|
|
666
|
+
}
|
|
631
667
|
function interpolate(input, inputRange, outputRange, options) {
|
|
632
668
|
if (typeof input === "undefined") {
|
|
633
669
|
throw new Error("input can not be undefined");
|
|
@@ -645,6 +681,7 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
645
681
|
checkValidInputRange(inputRange);
|
|
646
682
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
647
683
|
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
684
|
+
assertValidInterpolateOutputOption(options?.output);
|
|
648
685
|
if (typeof input !== "number") {
|
|
649
686
|
throw new TypeError("Cannot interpolate an input which is not a number");
|
|
650
687
|
}
|
|
@@ -777,7 +814,8 @@ var transformSchema = {
|
|
|
777
814
|
max: 100,
|
|
778
815
|
step: 0.01,
|
|
779
816
|
default: 1,
|
|
780
|
-
description: "Scale"
|
|
817
|
+
description: "Scale",
|
|
818
|
+
defaultKeyframeOutput: "perceptual-scale"
|
|
781
819
|
},
|
|
782
820
|
"style.rotate": {
|
|
783
821
|
type: "rotation-css",
|
|
@@ -1926,8 +1964,20 @@ var serializeStringInterpolationValue = ({
|
|
|
1926
1964
|
}
|
|
1927
1965
|
return values.slice(0, dimensions).map((value, index) => \`\${stringifyNumber(value)}\${units[index]}\`).join(" ");
|
|
1928
1966
|
};
|
|
1967
|
+
var toSignedArea = (scale) => {
|
|
1968
|
+
if (scale === 0) {
|
|
1969
|
+
return 0;
|
|
1970
|
+
}
|
|
1971
|
+
return Math.sign(scale) * scale * scale;
|
|
1972
|
+
};
|
|
1973
|
+
var fromSignedArea = (area) => {
|
|
1974
|
+
if (area === 0) {
|
|
1975
|
+
return 0;
|
|
1976
|
+
}
|
|
1977
|
+
return Math.sign(area) * Math.sqrt(Math.abs(area));
|
|
1978
|
+
};
|
|
1929
1979
|
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
1930
|
-
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
1980
|
+
const { extrapolateLeft, extrapolateRight, easing, output } = options;
|
|
1931
1981
|
let result = input;
|
|
1932
1982
|
const [inputMin, inputMax] = inputRange;
|
|
1933
1983
|
const [outputMin, outputMax] = outputRange;
|
|
@@ -1958,7 +2008,13 @@ function interpolateFunction(input, inputRange, outputRange, options) {
|
|
|
1958
2008
|
}
|
|
1959
2009
|
result = (result - inputMin) / (inputMax - inputMin);
|
|
1960
2010
|
result = easing(result);
|
|
1961
|
-
|
|
2011
|
+
if (output === "perceptual-scale") {
|
|
2012
|
+
const signedAreaMin = toSignedArea(outputMin);
|
|
2013
|
+
const signedAreaMax = toSignedArea(outputMax);
|
|
2014
|
+
result = fromSignedArea(result * (signedAreaMax - signedAreaMin) + signedAreaMin);
|
|
2015
|
+
} else {
|
|
2016
|
+
result = result * (outputMax - outputMin) + outputMin;
|
|
2017
|
+
}
|
|
1962
2018
|
return result;
|
|
1963
2019
|
}
|
|
1964
2020
|
function findRange(input, inputRange) {
|
|
@@ -1971,6 +2027,9 @@ function findRange(input, inputRange) {
|
|
|
1971
2027
|
return i - 1;
|
|
1972
2028
|
}
|
|
1973
2029
|
var defaultEasing = (num) => num;
|
|
2030
|
+
var resolveOutputOption = (output) => {
|
|
2031
|
+
return output ?? "linear";
|
|
2032
|
+
};
|
|
1974
2033
|
var shouldExtendRightForEasing = (easing) => {
|
|
1975
2034
|
return easing.remotionShouldExtendRight === true;
|
|
1976
2035
|
};
|
|
@@ -1992,12 +2051,14 @@ var interpolateSegment = ({
|
|
|
1992
2051
|
outputRange,
|
|
1993
2052
|
easing,
|
|
1994
2053
|
extrapolateLeft,
|
|
1995
|
-
extrapolateRight
|
|
2054
|
+
extrapolateRight,
|
|
2055
|
+
output
|
|
1996
2056
|
}) => {
|
|
1997
2057
|
return interpolateFunction(input, inputRange, outputRange, {
|
|
1998
2058
|
easing,
|
|
1999
2059
|
extrapolateLeft,
|
|
2000
|
-
extrapolateRight: input > inputRange[1] && extrapolateRight === "clamp" && shouldExtendRightForEasing(easing) ? "extend" : extrapolateRight
|
|
2060
|
+
extrapolateRight: input > inputRange[1] && extrapolateRight === "clamp" && shouldExtendRightForEasing(easing) ? "extend" : extrapolateRight,
|
|
2061
|
+
output
|
|
2001
2062
|
});
|
|
2002
2063
|
};
|
|
2003
2064
|
var interpolateNumber = ({
|
|
@@ -2006,6 +2067,7 @@ var interpolateNumber = ({
|
|
|
2006
2067
|
outputRange,
|
|
2007
2068
|
options
|
|
2008
2069
|
}) => {
|
|
2070
|
+
const output = resolveOutputOption(options?.output);
|
|
2009
2071
|
if (inputRange.length === 1) {
|
|
2010
2072
|
return outputRange[0];
|
|
2011
2073
|
}
|
|
@@ -2030,7 +2092,8 @@ var interpolateNumber = ({
|
|
|
2030
2092
|
outputRange: [outputRange[range], outputRange[range + 1]],
|
|
2031
2093
|
easing,
|
|
2032
2094
|
extrapolateLeft,
|
|
2033
|
-
extrapolateRight
|
|
2095
|
+
extrapolateRight,
|
|
2096
|
+
output
|
|
2034
2097
|
});
|
|
2035
2098
|
for (let segmentIndex = 0;segmentIndex < range; segmentIndex++) {
|
|
2036
2099
|
const previousEasing = resolveEasingForSegment({
|
|
@@ -2050,7 +2113,8 @@ var interpolateNumber = ({
|
|
|
2050
2113
|
outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
|
|
2051
2114
|
easing: previousEasing,
|
|
2052
2115
|
extrapolateLeft,
|
|
2053
|
-
extrapolateRight: "extend"
|
|
2116
|
+
extrapolateRight: "extend",
|
|
2117
|
+
output
|
|
2054
2118
|
});
|
|
2055
2119
|
result += continuedSegmentValue - outputRange[segmentIndex + 1];
|
|
2056
2120
|
}
|
|
@@ -2098,14 +2162,18 @@ var interpolateString = ({
|
|
|
2098
2162
|
}
|
|
2099
2163
|
}
|
|
2100
2164
|
}
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
values
|
|
2165
|
+
const values = [0, 0, 0];
|
|
2166
|
+
for (let axis = 0;axis < dimensions; axis++) {
|
|
2167
|
+
values[axis] = interpolateNumber({
|
|
2104
2168
|
input,
|
|
2105
2169
|
inputRange,
|
|
2106
2170
|
outputRange: parsedOutputRange.map((parsed) => parsed.values[axis]),
|
|
2107
2171
|
options
|
|
2108
|
-
})
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
return serializeStringInterpolationValue({
|
|
2175
|
+
kind,
|
|
2176
|
+
values,
|
|
2109
2177
|
units,
|
|
2110
2178
|
dimensions
|
|
2111
2179
|
});
|
|
@@ -2189,6 +2257,12 @@ function assertValidInterpolatePosterizeOption(posterize) {
|
|
|
2189
2257
|
throw new Error(\`posterize must be a positive finite number, but got \${posterize}\`);
|
|
2190
2258
|
}
|
|
2191
2259
|
}
|
|
2260
|
+
function assertValidInterpolateOutputOption(output) {
|
|
2261
|
+
if (output === undefined || output === "linear" || output === "perceptual-scale") {
|
|
2262
|
+
return;
|
|
2263
|
+
}
|
|
2264
|
+
throw new Error(\`output must be "linear" or "perceptual-scale", but got \${String(output)}\`);
|
|
2265
|
+
}
|
|
2192
2266
|
function interpolate(input, inputRange, outputRange, options) {
|
|
2193
2267
|
if (typeof input === "undefined") {
|
|
2194
2268
|
throw new Error("input can not be undefined");
|
|
@@ -2206,6 +2280,7 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
2206
2280
|
checkValidInputRange(inputRange);
|
|
2207
2281
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
2208
2282
|
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
2283
|
+
assertValidInterpolateOutputOption(options?.output);
|
|
2209
2284
|
if (typeof input !== "number") {
|
|
2210
2285
|
throw new TypeError("Cannot interpolate an input which is not a number");
|
|
2211
2286
|
}
|
|
@@ -2338,7 +2413,8 @@ var transformSchema = {
|
|
|
2338
2413
|
max: 100,
|
|
2339
2414
|
step: 0.01,
|
|
2340
2415
|
default: 1,
|
|
2341
|
-
description: "Scale"
|
|
2416
|
+
description: "Scale",
|
|
2417
|
+
defaultKeyframeOutput: "perceptual-scale"
|
|
2342
2418
|
},
|
|
2343
2419
|
"style.rotate": {
|
|
2344
2420
|
type: "rotation-css",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/vercel",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.490",
|
|
4
4
|
"description": "Render Remotion videos on Vercel Sandbox",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"remotion": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.490",
|
|
27
|
+
"remotion": "4.0.490"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@vercel/sandbox": ">=1.0.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
41
|
+
"@remotion/eslint-config-internal": "4.0.490",
|
|
42
42
|
"@vercel/blob": "2.3.0",
|
|
43
43
|
"@vercel/sandbox": "1.6.0",
|
|
44
44
|
"eslint": "9.19.0",
|