@remotion/vercel 4.0.537 → 4.0.539
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/add-bundle-to-sandbox.d.ts +1 -1
- package/dist/create-sandbox.d.ts +1 -1
- package/dist/esm/index.mjs +148 -104
- package/dist/get-render-progress.d.ts +1 -1
- package/dist/internals/disposable.d.ts +2 -1
- package/dist/internals/format-sandbox-error.d.ts +1 -1
- package/dist/internals/install-browser.d.ts +1 -1
- package/dist/internals/install-js-dependencies.d.ts +1 -1
- package/dist/internals/install-system-dependencies.d.ts +1 -1
- package/dist/internals/patch-compositor.d.ts +1 -1
- package/dist/render-still-on-vercel.d.ts +1 -1
- package/dist/upload-to-vercel-blob.d.ts +1 -1
- package/package.json +7 -7
package/dist/create-sandbox.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Sandbox } from '@vercel/sandbox';
|
|
|
2
2
|
import type { CreateSandboxOnProgress, VercelSandbox } from './types';
|
|
3
3
|
type CreateSandboxResources = NonNullable<NonNullable<Parameters<typeof Sandbox.create>[0]>['resources']>;
|
|
4
4
|
export declare const SANDBOX_CREATING_TIMEOUT: number;
|
|
5
|
-
export declare function createSandbox({ onProgress, resources, timeoutInMilliseconds }?: {
|
|
5
|
+
export declare function createSandbox({ onProgress, resources, timeoutInMilliseconds, }?: {
|
|
6
6
|
onProgress?: CreateSandboxOnProgress;
|
|
7
7
|
resources?: CreateSandboxResources;
|
|
8
8
|
timeoutInMilliseconds?: number;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -426,27 +426,30 @@ function springCalculation({
|
|
|
426
426
|
stiffness: config.stiffness ?? defaultSpringConfig.stiffness,
|
|
427
427
|
overshootClamping: config.overshootClamping ?? defaultSpringConfig.overshootClamping
|
|
428
428
|
};
|
|
429
|
-
const
|
|
430
|
-
frame,
|
|
429
|
+
const configKey = [
|
|
431
430
|
fps,
|
|
432
431
|
resolvedConfig.damping,
|
|
433
432
|
resolvedConfig.mass,
|
|
434
433
|
resolvedConfig.overshootClamping,
|
|
435
434
|
resolvedConfig.stiffness
|
|
436
435
|
].join("-");
|
|
436
|
+
const cacheKey = \`\${frame}-\${configKey}\`;
|
|
437
437
|
if (calculationCache[cacheKey]) {
|
|
438
438
|
return calculationCache[cacheKey];
|
|
439
439
|
}
|
|
440
|
-
|
|
440
|
+
const frameClamped = Math.max(0, frame);
|
|
441
|
+
const previousFrame = Math.ceil(frameClamped) - 1;
|
|
442
|
+
const previousAnimation = previousFrame >= 0 ? calculationCache[\`\${previousFrame}-\${configKey}\`] : undefined;
|
|
443
|
+
let animation = previousAnimation ?? {
|
|
441
444
|
lastTimestamp: 0,
|
|
442
445
|
current: from,
|
|
443
446
|
toValue: to,
|
|
444
447
|
velocity: 0,
|
|
445
448
|
prevPosition: 0
|
|
446
449
|
};
|
|
447
|
-
const frameClamped = Math.max(0, frame);
|
|
448
450
|
const unevenRest = frameClamped % 1;
|
|
449
|
-
|
|
451
|
+
const startFrame = previousAnimation ? previousFrame + 1 : 0;
|
|
452
|
+
for (let f = startFrame;f <= Math.floor(frameClamped); f++) {
|
|
450
453
|
const time = f / fps * 1000;
|
|
451
454
|
animation = advance({
|
|
452
455
|
animation,
|
|
@@ -574,12 +577,13 @@ function spring({
|
|
|
574
577
|
frame: durationProcessed,
|
|
575
578
|
config
|
|
576
579
|
});
|
|
577
|
-
const inner = config.overshootClamping ?
|
|
580
|
+
const inner = config.overshootClamping ? Math.min(spr.current, 1) : spr.current;
|
|
578
581
|
const interpolated = from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);
|
|
579
582
|
return interpolated;
|
|
580
583
|
}
|
|
581
584
|
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
582
585
|
var springEasingDurationInFrames = 30;
|
|
586
|
+
var easeBezier = null;
|
|
583
587
|
|
|
584
588
|
class Easing {
|
|
585
589
|
static step0(n) {
|
|
@@ -592,7 +596,8 @@ class Easing {
|
|
|
592
596
|
return t;
|
|
593
597
|
}
|
|
594
598
|
static ease(t) {
|
|
595
|
-
|
|
599
|
+
easeBezier ??= Easing.bezier(0.42, 0, 1, 1);
|
|
600
|
+
return easeBezier(t);
|
|
596
601
|
}
|
|
597
602
|
static quad(t) {
|
|
598
603
|
return t * t;
|
|
@@ -1108,6 +1113,20 @@ var interpolateSegment = ({
|
|
|
1108
1113
|
output
|
|
1109
1114
|
});
|
|
1110
1115
|
};
|
|
1116
|
+
var getInputForInterpolation = ({
|
|
1117
|
+
input,
|
|
1118
|
+
inputRange,
|
|
1119
|
+
options
|
|
1120
|
+
}) => {
|
|
1121
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
1122
|
+
const inputMin = inputRange[0];
|
|
1123
|
+
const inputMax = inputRange[inputRange.length - 1];
|
|
1124
|
+
if (inputRange.length === 1 || !(posterizedInput < inputMin && options?.extrapolateLeft === "wrap" || posterizedInput > inputMax && options?.extrapolateRight === "wrap")) {
|
|
1125
|
+
return posterizedInput;
|
|
1126
|
+
}
|
|
1127
|
+
const range = inputMax - inputMin;
|
|
1128
|
+
return ((posterizedInput - inputMin) % range + range) % range + inputMin;
|
|
1129
|
+
};
|
|
1111
1130
|
var interpolateNumber = ({
|
|
1112
1131
|
input,
|
|
1113
1132
|
inputRange,
|
|
@@ -1127,14 +1146,18 @@ var interpolateNumber = ({
|
|
|
1127
1146
|
if (options?.extrapolateRight !== undefined) {
|
|
1128
1147
|
extrapolateRight = options.extrapolateRight;
|
|
1129
1148
|
}
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1149
|
+
const resolvedInput = getInputForInterpolation({
|
|
1150
|
+
input,
|
|
1151
|
+
inputRange,
|
|
1152
|
+
options: options ?? null
|
|
1153
|
+
});
|
|
1154
|
+
const range = findRange(resolvedInput, inputRange);
|
|
1132
1155
|
const easing = resolveEasingForSegment({
|
|
1133
1156
|
easing: easingOption,
|
|
1134
1157
|
segmentIndex: range
|
|
1135
1158
|
});
|
|
1136
1159
|
let result = interpolateSegment({
|
|
1137
|
-
input:
|
|
1160
|
+
input: resolvedInput,
|
|
1138
1161
|
inputRange: [inputRange[range], inputRange[range + 1]],
|
|
1139
1162
|
outputRange: [outputRange[range], outputRange[range + 1]],
|
|
1140
1163
|
easing,
|
|
@@ -1151,11 +1174,11 @@ var interpolateNumber = ({
|
|
|
1151
1174
|
continue;
|
|
1152
1175
|
}
|
|
1153
1176
|
const previousSegmentEnd = inputRange[segmentIndex + 1];
|
|
1154
|
-
if (
|
|
1177
|
+
if (resolvedInput <= previousSegmentEnd) {
|
|
1155
1178
|
continue;
|
|
1156
1179
|
}
|
|
1157
1180
|
const continuedSegmentValue = interpolateSegment({
|
|
1158
|
-
input:
|
|
1181
|
+
input: resolvedInput,
|
|
1159
1182
|
inputRange: [inputRange[segmentIndex], previousSegmentEnd],
|
|
1160
1183
|
outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
|
|
1161
1184
|
easing: previousEasing,
|
|
@@ -1176,8 +1199,12 @@ var interpolateString = ({
|
|
|
1176
1199
|
}) => {
|
|
1177
1200
|
const initiallyParsedOutputRange = outputRange.map((output) => parseStringInterpolationValue(output, outputType));
|
|
1178
1201
|
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1202
|
+
const resolvedInput = getInputForInterpolation({
|
|
1203
|
+
input,
|
|
1204
|
+
inputRange,
|
|
1205
|
+
options: options ?? null
|
|
1206
|
+
});
|
|
1207
|
+
const segmentIndex = inputRange.length === 1 ? 0 : findRange(resolvedInput, inputRange);
|
|
1181
1208
|
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed, index) => {
|
|
1182
1209
|
if (parsed.kind !== "rotate") {
|
|
1183
1210
|
return parsed;
|
|
@@ -1301,31 +1328,24 @@ var interpolateDiscreteValue = ({
|
|
|
1301
1328
|
throw new TypeError(typeof outputRange[0] === "boolean" ? "Booleans can only be interpolated using Easing.step1" : "Non-numeric strings can only be interpolated using Easing.step1");
|
|
1302
1329
|
}
|
|
1303
1330
|
}
|
|
1304
|
-
const
|
|
1331
|
+
const resolvedInput = getInputForInterpolation({
|
|
1332
|
+
input,
|
|
1333
|
+
inputRange,
|
|
1334
|
+
options: options ?? null
|
|
1335
|
+
});
|
|
1305
1336
|
const inputMin = inputRange[0];
|
|
1306
1337
|
const inputMax = inputRange[inputRange.length - 1];
|
|
1307
|
-
let resolvedInput = posterizedInput;
|
|
1308
1338
|
if (resolvedInput < inputMin) {
|
|
1309
1339
|
if (options?.extrapolateLeft === "identity") {
|
|
1310
1340
|
throw new TypeError(typeof outputRange[0] === "boolean" ? 'extrapolateLeft: "identity" is not supported for booleans' : 'extrapolateLeft: "identity" is not supported for non-numeric strings');
|
|
1311
1341
|
}
|
|
1312
|
-
|
|
1313
|
-
const wrapRange = inputMax - inputMin;
|
|
1314
|
-
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
1315
|
-
} else {
|
|
1316
|
-
return outputRange[0];
|
|
1317
|
-
}
|
|
1342
|
+
return outputRange[0];
|
|
1318
1343
|
}
|
|
1319
1344
|
if (resolvedInput > inputMax) {
|
|
1320
1345
|
if (options?.extrapolateRight === "identity") {
|
|
1321
1346
|
throw new TypeError(typeof outputRange[0] === "boolean" ? 'extrapolateRight: "identity" is not supported for booleans' : 'extrapolateRight: "identity" is not supported for non-numeric strings');
|
|
1322
1347
|
}
|
|
1323
|
-
|
|
1324
|
-
const wrapRange = inputMax - inputMin;
|
|
1325
|
-
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
1326
|
-
} else {
|
|
1327
|
-
return outputRange[outputRange.length - 1];
|
|
1328
|
-
}
|
|
1348
|
+
return outputRange[outputRange.length - 1];
|
|
1329
1349
|
}
|
|
1330
1350
|
const range = findRange(resolvedInput, inputRange);
|
|
1331
1351
|
return resolvedInput >= inputRange[range + 1] ? outputRange[range + 1] : outputRange[range];
|
|
@@ -1990,23 +2010,23 @@ var MODERN_VALUE = "(?:none|[-+]?\\\\d*\\\\.?\\\\d+(?:%|deg|rad|grad|turn)?)";
|
|
|
1990
2010
|
function modernColorCall(name) {
|
|
1991
2011
|
return new RegExp(name + "\\\\(\\\\s*(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")(?:\\\\s*\\\\/\\\\s*(" + MODERN_VALUE + "))?\\\\s*\\\\)");
|
|
1992
2012
|
}
|
|
2013
|
+
var cachedMatchers = {
|
|
2014
|
+
rgb: undefined,
|
|
2015
|
+
rgba: undefined,
|
|
2016
|
+
hsl: undefined,
|
|
2017
|
+
hsla: undefined,
|
|
2018
|
+
hex3: undefined,
|
|
2019
|
+
hex4: undefined,
|
|
2020
|
+
hex5: undefined,
|
|
2021
|
+
hex6: undefined,
|
|
2022
|
+
hex8: undefined,
|
|
2023
|
+
oklch: undefined,
|
|
2024
|
+
oklab: undefined,
|
|
2025
|
+
lab: undefined,
|
|
2026
|
+
lch: undefined,
|
|
2027
|
+
hwb: undefined
|
|
2028
|
+
};
|
|
1993
2029
|
function getMatchers() {
|
|
1994
|
-
const cachedMatchers = {
|
|
1995
|
-
rgb: undefined,
|
|
1996
|
-
rgba: undefined,
|
|
1997
|
-
hsl: undefined,
|
|
1998
|
-
hsla: undefined,
|
|
1999
|
-
hex3: undefined,
|
|
2000
|
-
hex4: undefined,
|
|
2001
|
-
hex5: undefined,
|
|
2002
|
-
hex6: undefined,
|
|
2003
|
-
hex8: undefined,
|
|
2004
|
-
oklch: undefined,
|
|
2005
|
-
oklab: undefined,
|
|
2006
|
-
lab: undefined,
|
|
2007
|
-
lch: undefined,
|
|
2008
|
-
hwb: undefined
|
|
2009
|
-
};
|
|
2010
2030
|
if (cachedMatchers.rgb === undefined) {
|
|
2011
2031
|
cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
|
|
2012
2032
|
cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
|
@@ -2095,14 +2115,16 @@ function parseModernComponent(str, percentScale) {
|
|
|
2095
2115
|
function parseHueAngle(str) {
|
|
2096
2116
|
if (str === "none")
|
|
2097
2117
|
return 0;
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
if (str.endsWith("
|
|
2102
|
-
|
|
2103
|
-
if (str.endsWith("turn"))
|
|
2104
|
-
|
|
2105
|
-
|
|
2118
|
+
let degrees = Number.parseFloat(str);
|
|
2119
|
+
if (str.endsWith("grad")) {
|
|
2120
|
+
degrees *= 0.9;
|
|
2121
|
+
} else if (str.endsWith("rad")) {
|
|
2122
|
+
degrees = degrees * 180 / Math.PI;
|
|
2123
|
+
} else if (str.endsWith("turn")) {
|
|
2124
|
+
degrees *= 360;
|
|
2125
|
+
}
|
|
2126
|
+
const normalized = degrees % 360;
|
|
2127
|
+
return normalized < 0 ? (normalized + 360) % 360 : normalized;
|
|
2106
2128
|
}
|
|
2107
2129
|
function parseModernAlpha(str) {
|
|
2108
2130
|
if (str === undefined || str === "none")
|
|
@@ -3040,27 +3062,30 @@ function springCalculation({
|
|
|
3040
3062
|
stiffness: config.stiffness ?? defaultSpringConfig.stiffness,
|
|
3041
3063
|
overshootClamping: config.overshootClamping ?? defaultSpringConfig.overshootClamping
|
|
3042
3064
|
};
|
|
3043
|
-
const
|
|
3044
|
-
frame,
|
|
3065
|
+
const configKey = [
|
|
3045
3066
|
fps,
|
|
3046
3067
|
resolvedConfig.damping,
|
|
3047
3068
|
resolvedConfig.mass,
|
|
3048
3069
|
resolvedConfig.overshootClamping,
|
|
3049
3070
|
resolvedConfig.stiffness
|
|
3050
3071
|
].join("-");
|
|
3072
|
+
const cacheKey = \`\${frame}-\${configKey}\`;
|
|
3051
3073
|
if (calculationCache[cacheKey]) {
|
|
3052
3074
|
return calculationCache[cacheKey];
|
|
3053
3075
|
}
|
|
3054
|
-
|
|
3076
|
+
const frameClamped = Math.max(0, frame);
|
|
3077
|
+
const previousFrame = Math.ceil(frameClamped) - 1;
|
|
3078
|
+
const previousAnimation = previousFrame >= 0 ? calculationCache[\`\${previousFrame}-\${configKey}\`] : undefined;
|
|
3079
|
+
let animation = previousAnimation ?? {
|
|
3055
3080
|
lastTimestamp: 0,
|
|
3056
3081
|
current: from,
|
|
3057
3082
|
toValue: to,
|
|
3058
3083
|
velocity: 0,
|
|
3059
3084
|
prevPosition: 0
|
|
3060
3085
|
};
|
|
3061
|
-
const frameClamped = Math.max(0, frame);
|
|
3062
3086
|
const unevenRest = frameClamped % 1;
|
|
3063
|
-
|
|
3087
|
+
const startFrame = previousAnimation ? previousFrame + 1 : 0;
|
|
3088
|
+
for (let f = startFrame;f <= Math.floor(frameClamped); f++) {
|
|
3064
3089
|
const time = f / fps * 1000;
|
|
3065
3090
|
animation = advance({
|
|
3066
3091
|
animation,
|
|
@@ -3188,12 +3213,13 @@ function spring({
|
|
|
3188
3213
|
frame: durationProcessed,
|
|
3189
3214
|
config
|
|
3190
3215
|
});
|
|
3191
|
-
const inner = config.overshootClamping ?
|
|
3216
|
+
const inner = config.overshootClamping ? Math.min(spr.current, 1) : spr.current;
|
|
3192
3217
|
const interpolated = from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);
|
|
3193
3218
|
return interpolated;
|
|
3194
3219
|
}
|
|
3195
3220
|
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
3196
3221
|
var springEasingDurationInFrames = 30;
|
|
3222
|
+
var easeBezier = null;
|
|
3197
3223
|
|
|
3198
3224
|
class Easing {
|
|
3199
3225
|
static step0(n) {
|
|
@@ -3206,7 +3232,8 @@ class Easing {
|
|
|
3206
3232
|
return t;
|
|
3207
3233
|
}
|
|
3208
3234
|
static ease(t) {
|
|
3209
|
-
|
|
3235
|
+
easeBezier ??= Easing.bezier(0.42, 0, 1, 1);
|
|
3236
|
+
return easeBezier(t);
|
|
3210
3237
|
}
|
|
3211
3238
|
static quad(t) {
|
|
3212
3239
|
return t * t;
|
|
@@ -3722,6 +3749,20 @@ var interpolateSegment = ({
|
|
|
3722
3749
|
output
|
|
3723
3750
|
});
|
|
3724
3751
|
};
|
|
3752
|
+
var getInputForInterpolation = ({
|
|
3753
|
+
input,
|
|
3754
|
+
inputRange,
|
|
3755
|
+
options
|
|
3756
|
+
}) => {
|
|
3757
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
3758
|
+
const inputMin = inputRange[0];
|
|
3759
|
+
const inputMax = inputRange[inputRange.length - 1];
|
|
3760
|
+
if (inputRange.length === 1 || !(posterizedInput < inputMin && options?.extrapolateLeft === "wrap" || posterizedInput > inputMax && options?.extrapolateRight === "wrap")) {
|
|
3761
|
+
return posterizedInput;
|
|
3762
|
+
}
|
|
3763
|
+
const range = inputMax - inputMin;
|
|
3764
|
+
return ((posterizedInput - inputMin) % range + range) % range + inputMin;
|
|
3765
|
+
};
|
|
3725
3766
|
var interpolateNumber = ({
|
|
3726
3767
|
input,
|
|
3727
3768
|
inputRange,
|
|
@@ -3741,14 +3782,18 @@ var interpolateNumber = ({
|
|
|
3741
3782
|
if (options?.extrapolateRight !== undefined) {
|
|
3742
3783
|
extrapolateRight = options.extrapolateRight;
|
|
3743
3784
|
}
|
|
3744
|
-
const
|
|
3745
|
-
|
|
3785
|
+
const resolvedInput = getInputForInterpolation({
|
|
3786
|
+
input,
|
|
3787
|
+
inputRange,
|
|
3788
|
+
options: options ?? null
|
|
3789
|
+
});
|
|
3790
|
+
const range = findRange(resolvedInput, inputRange);
|
|
3746
3791
|
const easing = resolveEasingForSegment({
|
|
3747
3792
|
easing: easingOption,
|
|
3748
3793
|
segmentIndex: range
|
|
3749
3794
|
});
|
|
3750
3795
|
let result = interpolateSegment({
|
|
3751
|
-
input:
|
|
3796
|
+
input: resolvedInput,
|
|
3752
3797
|
inputRange: [inputRange[range], inputRange[range + 1]],
|
|
3753
3798
|
outputRange: [outputRange[range], outputRange[range + 1]],
|
|
3754
3799
|
easing,
|
|
@@ -3765,11 +3810,11 @@ var interpolateNumber = ({
|
|
|
3765
3810
|
continue;
|
|
3766
3811
|
}
|
|
3767
3812
|
const previousSegmentEnd = inputRange[segmentIndex + 1];
|
|
3768
|
-
if (
|
|
3813
|
+
if (resolvedInput <= previousSegmentEnd) {
|
|
3769
3814
|
continue;
|
|
3770
3815
|
}
|
|
3771
3816
|
const continuedSegmentValue = interpolateSegment({
|
|
3772
|
-
input:
|
|
3817
|
+
input: resolvedInput,
|
|
3773
3818
|
inputRange: [inputRange[segmentIndex], previousSegmentEnd],
|
|
3774
3819
|
outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
|
|
3775
3820
|
easing: previousEasing,
|
|
@@ -3790,8 +3835,12 @@ var interpolateString = ({
|
|
|
3790
3835
|
}) => {
|
|
3791
3836
|
const initiallyParsedOutputRange = outputRange.map((output) => parseStringInterpolationValue(output, outputType));
|
|
3792
3837
|
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
3793
|
-
const
|
|
3794
|
-
|
|
3838
|
+
const resolvedInput = getInputForInterpolation({
|
|
3839
|
+
input,
|
|
3840
|
+
inputRange,
|
|
3841
|
+
options: options ?? null
|
|
3842
|
+
});
|
|
3843
|
+
const segmentIndex = inputRange.length === 1 ? 0 : findRange(resolvedInput, inputRange);
|
|
3795
3844
|
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed, index) => {
|
|
3796
3845
|
if (parsed.kind !== "rotate") {
|
|
3797
3846
|
return parsed;
|
|
@@ -3915,31 +3964,24 @@ var interpolateDiscreteValue = ({
|
|
|
3915
3964
|
throw new TypeError(typeof outputRange[0] === "boolean" ? "Booleans can only be interpolated using Easing.step1" : "Non-numeric strings can only be interpolated using Easing.step1");
|
|
3916
3965
|
}
|
|
3917
3966
|
}
|
|
3918
|
-
const
|
|
3967
|
+
const resolvedInput = getInputForInterpolation({
|
|
3968
|
+
input,
|
|
3969
|
+
inputRange,
|
|
3970
|
+
options: options ?? null
|
|
3971
|
+
});
|
|
3919
3972
|
const inputMin = inputRange[0];
|
|
3920
3973
|
const inputMax = inputRange[inputRange.length - 1];
|
|
3921
|
-
let resolvedInput = posterizedInput;
|
|
3922
3974
|
if (resolvedInput < inputMin) {
|
|
3923
3975
|
if (options?.extrapolateLeft === "identity") {
|
|
3924
3976
|
throw new TypeError(typeof outputRange[0] === "boolean" ? 'extrapolateLeft: "identity" is not supported for booleans' : 'extrapolateLeft: "identity" is not supported for non-numeric strings');
|
|
3925
3977
|
}
|
|
3926
|
-
|
|
3927
|
-
const wrapRange = inputMax - inputMin;
|
|
3928
|
-
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
3929
|
-
} else {
|
|
3930
|
-
return outputRange[0];
|
|
3931
|
-
}
|
|
3978
|
+
return outputRange[0];
|
|
3932
3979
|
}
|
|
3933
3980
|
if (resolvedInput > inputMax) {
|
|
3934
3981
|
if (options?.extrapolateRight === "identity") {
|
|
3935
3982
|
throw new TypeError(typeof outputRange[0] === "boolean" ? 'extrapolateRight: "identity" is not supported for booleans' : 'extrapolateRight: "identity" is not supported for non-numeric strings');
|
|
3936
3983
|
}
|
|
3937
|
-
|
|
3938
|
-
const wrapRange = inputMax - inputMin;
|
|
3939
|
-
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
3940
|
-
} else {
|
|
3941
|
-
return outputRange[outputRange.length - 1];
|
|
3942
|
-
}
|
|
3984
|
+
return outputRange[outputRange.length - 1];
|
|
3943
3985
|
}
|
|
3944
3986
|
const range = findRange(resolvedInput, inputRange);
|
|
3945
3987
|
return resolvedInput >= inputRange[range + 1] ? outputRange[range + 1] : outputRange[range];
|
|
@@ -4604,23 +4646,23 @@ var MODERN_VALUE = "(?:none|[-+]?\\\\d*\\\\.?\\\\d+(?:%|deg|rad|grad|turn)?)";
|
|
|
4604
4646
|
function modernColorCall(name) {
|
|
4605
4647
|
return new RegExp(name + "\\\\(\\\\s*(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")\\\\s+(" + MODERN_VALUE + ")(?:\\\\s*\\\\/\\\\s*(" + MODERN_VALUE + "))?\\\\s*\\\\)");
|
|
4606
4648
|
}
|
|
4649
|
+
var cachedMatchers = {
|
|
4650
|
+
rgb: undefined,
|
|
4651
|
+
rgba: undefined,
|
|
4652
|
+
hsl: undefined,
|
|
4653
|
+
hsla: undefined,
|
|
4654
|
+
hex3: undefined,
|
|
4655
|
+
hex4: undefined,
|
|
4656
|
+
hex5: undefined,
|
|
4657
|
+
hex6: undefined,
|
|
4658
|
+
hex8: undefined,
|
|
4659
|
+
oklch: undefined,
|
|
4660
|
+
oklab: undefined,
|
|
4661
|
+
lab: undefined,
|
|
4662
|
+
lch: undefined,
|
|
4663
|
+
hwb: undefined
|
|
4664
|
+
};
|
|
4607
4665
|
function getMatchers() {
|
|
4608
|
-
const cachedMatchers = {
|
|
4609
|
-
rgb: undefined,
|
|
4610
|
-
rgba: undefined,
|
|
4611
|
-
hsl: undefined,
|
|
4612
|
-
hsla: undefined,
|
|
4613
|
-
hex3: undefined,
|
|
4614
|
-
hex4: undefined,
|
|
4615
|
-
hex5: undefined,
|
|
4616
|
-
hex6: undefined,
|
|
4617
|
-
hex8: undefined,
|
|
4618
|
-
oklch: undefined,
|
|
4619
|
-
oklab: undefined,
|
|
4620
|
-
lab: undefined,
|
|
4621
|
-
lch: undefined,
|
|
4622
|
-
hwb: undefined
|
|
4623
|
-
};
|
|
4624
4666
|
if (cachedMatchers.rgb === undefined) {
|
|
4625
4667
|
cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
|
|
4626
4668
|
cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
|
@@ -4709,14 +4751,16 @@ function parseModernComponent(str, percentScale) {
|
|
|
4709
4751
|
function parseHueAngle(str) {
|
|
4710
4752
|
if (str === "none")
|
|
4711
4753
|
return 0;
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
if (str.endsWith("
|
|
4716
|
-
|
|
4717
|
-
if (str.endsWith("turn"))
|
|
4718
|
-
|
|
4719
|
-
|
|
4754
|
+
let degrees = Number.parseFloat(str);
|
|
4755
|
+
if (str.endsWith("grad")) {
|
|
4756
|
+
degrees *= 0.9;
|
|
4757
|
+
} else if (str.endsWith("rad")) {
|
|
4758
|
+
degrees = degrees * 180 / Math.PI;
|
|
4759
|
+
} else if (str.endsWith("turn")) {
|
|
4760
|
+
degrees *= 360;
|
|
4761
|
+
}
|
|
4762
|
+
const normalized = degrees % 360;
|
|
4763
|
+
return normalized < 0 ? (normalized + 360) % 360 : normalized;
|
|
4720
4764
|
}
|
|
4721
4765
|
function parseModernAlpha(str) {
|
|
4722
4766
|
if (str === undefined || str === "none")
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Sandbox } from '@vercel/sandbox';
|
|
1
2
|
import type { VercelSandbox } from '../types';
|
|
2
|
-
export declare const createDisposableSandbox: (options:
|
|
3
|
+
export declare const createDisposableSandbox: (options: Parameters<typeof Sandbox.create>[0]) => Promise<VercelSandbox>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Sandbox } from '@vercel/sandbox';
|
|
2
|
-
export declare function installBrowser({ sandbox, onProgress }: {
|
|
2
|
+
export declare function installBrowser({ sandbox, onProgress, }: {
|
|
3
3
|
sandbox: Sandbox;
|
|
4
4
|
onProgress: (progress: number) => Promise<void>;
|
|
5
5
|
}): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Sandbox } from '@vercel/sandbox';
|
|
2
|
-
export declare function installSystemDependencies({ sandbox, onProgress }: {
|
|
2
|
+
export declare function installSystemDependencies({ sandbox, onProgress, }: {
|
|
3
3
|
sandbox: Sandbox;
|
|
4
4
|
onProgress: (progress: number) => Promise<void>;
|
|
5
5
|
}): Promise<void>;
|
|
@@ -9,6 +9,6 @@ import type { Sandbox } from '@vercel/sandbox';
|
|
|
9
9
|
*
|
|
10
10
|
* Only the `remotion` binary needs patching - ffmpeg/ffprobe work fine on glibc 2.34.
|
|
11
11
|
*/
|
|
12
|
-
export declare function patchCompositor({ sandbox }: {
|
|
12
|
+
export declare function patchCompositor({ sandbox, }: {
|
|
13
13
|
sandbox: Sandbox;
|
|
14
14
|
}): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sandbox } from '@vercel/sandbox';
|
|
2
2
|
import type { ChromiumOptions, LogLevel, RenderStillOnVercelProgress, StillImageFormat } from './types';
|
|
3
|
-
export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, onProgress, outputFile, frame, imageFormat, jpegQuality, envVariables, chromiumOptions, scale, logLevel, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, offthreadVideoThreads, licenseKey }: {
|
|
3
|
+
export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, onProgress, outputFile, frame, imageFormat, jpegQuality, envVariables, chromiumOptions, scale, logLevel, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, offthreadVideoThreads, licenseKey, }: {
|
|
4
4
|
sandbox: Sandbox;
|
|
5
5
|
compositionId: string;
|
|
6
6
|
inputProps: Record<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sandbox } from '@vercel/sandbox';
|
|
2
2
|
import type { VercelBlobAccess } from './types';
|
|
3
|
-
export declare function uploadToVercelBlob({ sandbox, sandboxFilePath, blobPath, contentType, blobToken, access }: {
|
|
3
|
+
export declare function uploadToVercelBlob({ sandbox, sandboxFilePath, blobPath, contentType, blobToken, access, }: {
|
|
4
4
|
sandbox: Sandbox;
|
|
5
5
|
sandboxFilePath: string;
|
|
6
6
|
blobPath?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/vercel",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.539",
|
|
4
4
|
"description": "Render Remotion videos on Vercel Sandbox",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"formatting": "oxfmt src --check",
|
|
14
14
|
"format": "oxfmt src",
|
|
15
15
|
"lint": "eslint src",
|
|
16
|
-
"watch": "
|
|
17
|
-
"make": "bun --env-file=../.env.bundle bundle.ts &&
|
|
16
|
+
"watch": "tsc -w",
|
|
17
|
+
"make": "bun --env-file=../.env.bundle bundle.ts && tsc && bun check -p tsconfig.scripts.json"
|
|
18
18
|
},
|
|
19
19
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
20
20
|
"contributors": [],
|
|
@@ -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.539",
|
|
27
|
+
"remotion": "4.0.539"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@vercel/sandbox": ">=1.0.0"
|
|
@@ -38,11 +38,11 @@
|
|
|
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.539",
|
|
42
42
|
"@vercel/blob": "2.3.0",
|
|
43
43
|
"@vercel/sandbox": "1.6.0",
|
|
44
44
|
"eslint": "9.19.0",
|
|
45
|
-
"
|
|
45
|
+
"typescript": "7.1.0-beta"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"remotion",
|