@remotion/vercel 4.0.507 → 4.0.508
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 +184 -32
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -305,9 +305,45 @@ var parseTransformOriginValue = (output, parts) => {
|
|
|
305
305
|
});
|
|
306
306
|
return {
|
|
307
307
|
kind: "translate",
|
|
308
|
-
values: [x.value, y.value, z.value],
|
|
309
|
-
units: [x.unit, y.unit, z.unit],
|
|
310
|
-
dimensions: parts[2] === undefined ? 2 : 3
|
|
308
|
+
values: [x.value, y.value, z.value, 0],
|
|
309
|
+
units: [x.unit, y.unit, z.unit, null],
|
|
310
|
+
dimensions: parts[2] === undefined ? 2 : 3,
|
|
311
|
+
axisRotation: false
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
var parseAxisRotationValue = (output) => {
|
|
315
|
+
const parts = output.trim().split(/\\s+/);
|
|
316
|
+
const keywordAxis = parts.length === 2 ? parts[0].toLowerCase() : null;
|
|
317
|
+
if (keywordAxis === "x" || keywordAxis === "y" || keywordAxis === "z") {
|
|
318
|
+
const keywordAngle = parseStringInterpolationComponent(parts[1], output);
|
|
319
|
+
if (keywordAngle.kind !== "rotate") {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
return {
|
|
323
|
+
kind: "rotate",
|
|
324
|
+
values: keywordAxis === "x" ? [1, 0, 0, keywordAngle.value] : keywordAxis === "y" ? [0, 1, 0, keywordAngle.value] : [0, 0, 1, keywordAngle.value],
|
|
325
|
+
units: [null, null, null, keywordAngle.unit],
|
|
326
|
+
dimensions: 4,
|
|
327
|
+
axisRotation: true
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (parts.length !== 4) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
const axis = parts.slice(0, 3).map(Number);
|
|
334
|
+
if (!axis.every(Number.isFinite)) {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
const vectorAngle = parseStringInterpolationComponent(parts[3], output);
|
|
338
|
+
if (vectorAngle.kind !== "rotate") {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
kind: "rotate",
|
|
343
|
+
values: [axis[0], axis[1], axis[2], vectorAngle.value],
|
|
344
|
+
units: [null, null, null, vectorAngle.unit],
|
|
345
|
+
dimensions: 4,
|
|
346
|
+
axisRotation: true
|
|
311
347
|
};
|
|
312
348
|
};
|
|
313
349
|
var parseStringInterpolationValue = (output) => {
|
|
@@ -317,11 +353,16 @@ var parseStringInterpolationValue = (output) => {
|
|
|
317
353
|
}
|
|
318
354
|
return {
|
|
319
355
|
kind: "scale",
|
|
320
|
-
values: [output, output, 1],
|
|
321
|
-
units: [null, null, null],
|
|
322
|
-
dimensions: 1
|
|
356
|
+
values: [output, output, 1, 0],
|
|
357
|
+
units: [null, null, null, null],
|
|
358
|
+
dimensions: 1,
|
|
359
|
+
axisRotation: false
|
|
323
360
|
};
|
|
324
361
|
}
|
|
362
|
+
const axisRotation = parseAxisRotationValue(output);
|
|
363
|
+
if (axisRotation !== null) {
|
|
364
|
+
return axisRotation;
|
|
365
|
+
}
|
|
325
366
|
const parts = output.trim().split(/\\s+/);
|
|
326
367
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
327
368
|
throw new TypeError(\`String outputRange values must contain 1 to 3 components, but got "\${output}"\`);
|
|
@@ -342,24 +383,35 @@ var parseStringInterpolationValue = (output) => {
|
|
|
342
383
|
const z = parsed[2]?.value ?? 1;
|
|
343
384
|
return {
|
|
344
385
|
kind,
|
|
345
|
-
values: [x, y, z],
|
|
346
|
-
units: [null, null, null],
|
|
347
|
-
dimensions: parsed.length
|
|
386
|
+
values: [x, y, z, 0],
|
|
387
|
+
units: [null, null, null, null],
|
|
388
|
+
dimensions: parsed.length,
|
|
389
|
+
axisRotation: false
|
|
348
390
|
};
|
|
349
391
|
}
|
|
350
392
|
return {
|
|
351
393
|
kind,
|
|
352
|
-
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
353
|
-
units: [
|
|
354
|
-
|
|
394
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0, 0],
|
|
395
|
+
units: [
|
|
396
|
+
parsed[0].unit,
|
|
397
|
+
parsed[1]?.unit ?? null,
|
|
398
|
+
parsed[2]?.unit ?? null,
|
|
399
|
+
null
|
|
400
|
+
],
|
|
401
|
+
dimensions: parsed.length,
|
|
402
|
+
axisRotation: false
|
|
355
403
|
};
|
|
356
404
|
};
|
|
357
405
|
var serializeStringInterpolationValue = ({
|
|
358
406
|
kind,
|
|
359
407
|
values,
|
|
360
408
|
units,
|
|
361
|
-
dimensions
|
|
409
|
+
dimensions,
|
|
410
|
+
axisRotation
|
|
362
411
|
}) => {
|
|
412
|
+
if (axisRotation) {
|
|
413
|
+
return \`\${stringifyNumber(values[0])} \${stringifyNumber(values[1])} \${stringifyNumber(values[2])} \${stringifyNumber(values[3])}\${units[3]}\`;
|
|
414
|
+
}
|
|
363
415
|
if (kind === "scale") {
|
|
364
416
|
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
365
417
|
}
|
|
@@ -527,7 +579,26 @@ var interpolateString = ({
|
|
|
527
579
|
outputRange,
|
|
528
580
|
options
|
|
529
581
|
}) => {
|
|
530
|
-
const
|
|
582
|
+
const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
583
|
+
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
584
|
+
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed) => {
|
|
585
|
+
if (parsed.kind !== "rotate") {
|
|
586
|
+
return parsed;
|
|
587
|
+
}
|
|
588
|
+
if (parsed.axisRotation) {
|
|
589
|
+
return parsed;
|
|
590
|
+
}
|
|
591
|
+
if (parsed.dimensions !== 1) {
|
|
592
|
+
throw new TypeError("Cannot interpolate a multi-angle rotate value with an axis rotation");
|
|
593
|
+
}
|
|
594
|
+
return {
|
|
595
|
+
kind: "rotate",
|
|
596
|
+
values: [0, 0, 1, parsed.values[0]],
|
|
597
|
+
units: [null, null, null, parsed.units[0]],
|
|
598
|
+
dimensions: 4,
|
|
599
|
+
axisRotation: true
|
|
600
|
+
};
|
|
601
|
+
}) : initiallyParsedOutputRange;
|
|
531
602
|
const kind = parsedOutputRange[0]?.kind;
|
|
532
603
|
if (kind === undefined) {
|
|
533
604
|
throw new Error("outputRange must have at least 1 element");
|
|
@@ -539,12 +610,16 @@ var interpolateString = ({
|
|
|
539
610
|
}
|
|
540
611
|
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
541
612
|
const units = [
|
|
613
|
+
null,
|
|
542
614
|
null,
|
|
543
615
|
null,
|
|
544
616
|
null
|
|
545
617
|
];
|
|
546
618
|
if (kind !== "scale") {
|
|
547
619
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
620
|
+
if (hasAxisRotation && axis < 3) {
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
548
623
|
for (const parsed of parsedOutputRange) {
|
|
549
624
|
const unit = parsed.units[axis];
|
|
550
625
|
if (unit === null) {
|
|
@@ -563,7 +638,7 @@ var interpolateString = ({
|
|
|
563
638
|
}
|
|
564
639
|
}
|
|
565
640
|
}
|
|
566
|
-
const values = [0, 0, 0];
|
|
641
|
+
const values = [0, 0, 0, 0];
|
|
567
642
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
568
643
|
values[axis] = interpolateNumber({
|
|
569
644
|
input,
|
|
@@ -576,7 +651,8 @@ var interpolateString = ({
|
|
|
576
651
|
kind,
|
|
577
652
|
values,
|
|
578
653
|
units,
|
|
579
|
-
dimensions
|
|
654
|
+
dimensions,
|
|
655
|
+
axisRotation: hasAxisRotation
|
|
580
656
|
});
|
|
581
657
|
};
|
|
582
658
|
var validateTupleOutputRange = (outputRange) => {
|
|
@@ -2064,9 +2140,45 @@ var parseTransformOriginValue = (output, parts) => {
|
|
|
2064
2140
|
});
|
|
2065
2141
|
return {
|
|
2066
2142
|
kind: "translate",
|
|
2067
|
-
values: [x.value, y.value, z.value],
|
|
2068
|
-
units: [x.unit, y.unit, z.unit],
|
|
2069
|
-
dimensions: parts[2] === undefined ? 2 : 3
|
|
2143
|
+
values: [x.value, y.value, z.value, 0],
|
|
2144
|
+
units: [x.unit, y.unit, z.unit, null],
|
|
2145
|
+
dimensions: parts[2] === undefined ? 2 : 3,
|
|
2146
|
+
axisRotation: false
|
|
2147
|
+
};
|
|
2148
|
+
};
|
|
2149
|
+
var parseAxisRotationValue = (output) => {
|
|
2150
|
+
const parts = output.trim().split(/\\s+/);
|
|
2151
|
+
const keywordAxis = parts.length === 2 ? parts[0].toLowerCase() : null;
|
|
2152
|
+
if (keywordAxis === "x" || keywordAxis === "y" || keywordAxis === "z") {
|
|
2153
|
+
const keywordAngle = parseStringInterpolationComponent(parts[1], output);
|
|
2154
|
+
if (keywordAngle.kind !== "rotate") {
|
|
2155
|
+
return null;
|
|
2156
|
+
}
|
|
2157
|
+
return {
|
|
2158
|
+
kind: "rotate",
|
|
2159
|
+
values: keywordAxis === "x" ? [1, 0, 0, keywordAngle.value] : keywordAxis === "y" ? [0, 1, 0, keywordAngle.value] : [0, 0, 1, keywordAngle.value],
|
|
2160
|
+
units: [null, null, null, keywordAngle.unit],
|
|
2161
|
+
dimensions: 4,
|
|
2162
|
+
axisRotation: true
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
if (parts.length !== 4) {
|
|
2166
|
+
return null;
|
|
2167
|
+
}
|
|
2168
|
+
const axis = parts.slice(0, 3).map(Number);
|
|
2169
|
+
if (!axis.every(Number.isFinite)) {
|
|
2170
|
+
return null;
|
|
2171
|
+
}
|
|
2172
|
+
const vectorAngle = parseStringInterpolationComponent(parts[3], output);
|
|
2173
|
+
if (vectorAngle.kind !== "rotate") {
|
|
2174
|
+
return null;
|
|
2175
|
+
}
|
|
2176
|
+
return {
|
|
2177
|
+
kind: "rotate",
|
|
2178
|
+
values: [axis[0], axis[1], axis[2], vectorAngle.value],
|
|
2179
|
+
units: [null, null, null, vectorAngle.unit],
|
|
2180
|
+
dimensions: 4,
|
|
2181
|
+
axisRotation: true
|
|
2070
2182
|
};
|
|
2071
2183
|
};
|
|
2072
2184
|
var parseStringInterpolationValue = (output) => {
|
|
@@ -2076,11 +2188,16 @@ var parseStringInterpolationValue = (output) => {
|
|
|
2076
2188
|
}
|
|
2077
2189
|
return {
|
|
2078
2190
|
kind: "scale",
|
|
2079
|
-
values: [output, output, 1],
|
|
2080
|
-
units: [null, null, null],
|
|
2081
|
-
dimensions: 1
|
|
2191
|
+
values: [output, output, 1, 0],
|
|
2192
|
+
units: [null, null, null, null],
|
|
2193
|
+
dimensions: 1,
|
|
2194
|
+
axisRotation: false
|
|
2082
2195
|
};
|
|
2083
2196
|
}
|
|
2197
|
+
const axisRotation = parseAxisRotationValue(output);
|
|
2198
|
+
if (axisRotation !== null) {
|
|
2199
|
+
return axisRotation;
|
|
2200
|
+
}
|
|
2084
2201
|
const parts = output.trim().split(/\\s+/);
|
|
2085
2202
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
2086
2203
|
throw new TypeError(\`String outputRange values must contain 1 to 3 components, but got "\${output}"\`);
|
|
@@ -2101,24 +2218,35 @@ var parseStringInterpolationValue = (output) => {
|
|
|
2101
2218
|
const z = parsed[2]?.value ?? 1;
|
|
2102
2219
|
return {
|
|
2103
2220
|
kind,
|
|
2104
|
-
values: [x, y, z],
|
|
2105
|
-
units: [null, null, null],
|
|
2106
|
-
dimensions: parsed.length
|
|
2221
|
+
values: [x, y, z, 0],
|
|
2222
|
+
units: [null, null, null, null],
|
|
2223
|
+
dimensions: parsed.length,
|
|
2224
|
+
axisRotation: false
|
|
2107
2225
|
};
|
|
2108
2226
|
}
|
|
2109
2227
|
return {
|
|
2110
2228
|
kind,
|
|
2111
|
-
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
2112
|
-
units: [
|
|
2113
|
-
|
|
2229
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0, 0],
|
|
2230
|
+
units: [
|
|
2231
|
+
parsed[0].unit,
|
|
2232
|
+
parsed[1]?.unit ?? null,
|
|
2233
|
+
parsed[2]?.unit ?? null,
|
|
2234
|
+
null
|
|
2235
|
+
],
|
|
2236
|
+
dimensions: parsed.length,
|
|
2237
|
+
axisRotation: false
|
|
2114
2238
|
};
|
|
2115
2239
|
};
|
|
2116
2240
|
var serializeStringInterpolationValue = ({
|
|
2117
2241
|
kind,
|
|
2118
2242
|
values,
|
|
2119
2243
|
units,
|
|
2120
|
-
dimensions
|
|
2244
|
+
dimensions,
|
|
2245
|
+
axisRotation
|
|
2121
2246
|
}) => {
|
|
2247
|
+
if (axisRotation) {
|
|
2248
|
+
return \`\${stringifyNumber(values[0])} \${stringifyNumber(values[1])} \${stringifyNumber(values[2])} \${stringifyNumber(values[3])}\${units[3]}\`;
|
|
2249
|
+
}
|
|
2122
2250
|
if (kind === "scale") {
|
|
2123
2251
|
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
2124
2252
|
}
|
|
@@ -2286,7 +2414,26 @@ var interpolateString = ({
|
|
|
2286
2414
|
outputRange,
|
|
2287
2415
|
options
|
|
2288
2416
|
}) => {
|
|
2289
|
-
const
|
|
2417
|
+
const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
2418
|
+
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
2419
|
+
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed) => {
|
|
2420
|
+
if (parsed.kind !== "rotate") {
|
|
2421
|
+
return parsed;
|
|
2422
|
+
}
|
|
2423
|
+
if (parsed.axisRotation) {
|
|
2424
|
+
return parsed;
|
|
2425
|
+
}
|
|
2426
|
+
if (parsed.dimensions !== 1) {
|
|
2427
|
+
throw new TypeError("Cannot interpolate a multi-angle rotate value with an axis rotation");
|
|
2428
|
+
}
|
|
2429
|
+
return {
|
|
2430
|
+
kind: "rotate",
|
|
2431
|
+
values: [0, 0, 1, parsed.values[0]],
|
|
2432
|
+
units: [null, null, null, parsed.units[0]],
|
|
2433
|
+
dimensions: 4,
|
|
2434
|
+
axisRotation: true
|
|
2435
|
+
};
|
|
2436
|
+
}) : initiallyParsedOutputRange;
|
|
2290
2437
|
const kind = parsedOutputRange[0]?.kind;
|
|
2291
2438
|
if (kind === undefined) {
|
|
2292
2439
|
throw new Error("outputRange must have at least 1 element");
|
|
@@ -2298,12 +2445,16 @@ var interpolateString = ({
|
|
|
2298
2445
|
}
|
|
2299
2446
|
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
2300
2447
|
const units = [
|
|
2448
|
+
null,
|
|
2301
2449
|
null,
|
|
2302
2450
|
null,
|
|
2303
2451
|
null
|
|
2304
2452
|
];
|
|
2305
2453
|
if (kind !== "scale") {
|
|
2306
2454
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
2455
|
+
if (hasAxisRotation && axis < 3) {
|
|
2456
|
+
continue;
|
|
2457
|
+
}
|
|
2307
2458
|
for (const parsed of parsedOutputRange) {
|
|
2308
2459
|
const unit = parsed.units[axis];
|
|
2309
2460
|
if (unit === null) {
|
|
@@ -2322,7 +2473,7 @@ var interpolateString = ({
|
|
|
2322
2473
|
}
|
|
2323
2474
|
}
|
|
2324
2475
|
}
|
|
2325
|
-
const values = [0, 0, 0];
|
|
2476
|
+
const values = [0, 0, 0, 0];
|
|
2326
2477
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
2327
2478
|
values[axis] = interpolateNumber({
|
|
2328
2479
|
input,
|
|
@@ -2335,7 +2486,8 @@ var interpolateString = ({
|
|
|
2335
2486
|
kind,
|
|
2336
2487
|
values,
|
|
2337
2488
|
units,
|
|
2338
|
-
dimensions
|
|
2489
|
+
dimensions,
|
|
2490
|
+
axisRotation: hasAxisRotation
|
|
2339
2491
|
});
|
|
2340
2492
|
};
|
|
2341
2493
|
var validateTupleOutputRange = (outputRange) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/vercel",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.508",
|
|
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.508",
|
|
27
|
+
"remotion": "4.0.508"
|
|
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.508",
|
|
42
42
|
"@vercel/blob": "2.3.0",
|
|
43
43
|
"@vercel/sandbox": "1.6.0",
|
|
44
44
|
"eslint": "9.19.0",
|