@remotion/vercel 4.0.506 → 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 +200 -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) => {
|
|
@@ -915,7 +991,15 @@ var backgroundSchema = {
|
|
|
915
991
|
description: "Color"
|
|
916
992
|
}
|
|
917
993
|
};
|
|
994
|
+
var svgColorSchema = {
|
|
995
|
+
color: {
|
|
996
|
+
type: "color",
|
|
997
|
+
default: undefined,
|
|
998
|
+
description: "Current color"
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
918
1001
|
var svgStrokeSchema = {
|
|
1002
|
+
...svgColorSchema,
|
|
919
1003
|
stroke: {
|
|
920
1004
|
type: "color",
|
|
921
1005
|
default: "none",
|
|
@@ -2056,9 +2140,45 @@ var parseTransformOriginValue = (output, parts) => {
|
|
|
2056
2140
|
});
|
|
2057
2141
|
return {
|
|
2058
2142
|
kind: "translate",
|
|
2059
|
-
values: [x.value, y.value, z.value],
|
|
2060
|
-
units: [x.unit, y.unit, z.unit],
|
|
2061
|
-
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
|
|
2062
2182
|
};
|
|
2063
2183
|
};
|
|
2064
2184
|
var parseStringInterpolationValue = (output) => {
|
|
@@ -2068,11 +2188,16 @@ var parseStringInterpolationValue = (output) => {
|
|
|
2068
2188
|
}
|
|
2069
2189
|
return {
|
|
2070
2190
|
kind: "scale",
|
|
2071
|
-
values: [output, output, 1],
|
|
2072
|
-
units: [null, null, null],
|
|
2073
|
-
dimensions: 1
|
|
2191
|
+
values: [output, output, 1, 0],
|
|
2192
|
+
units: [null, null, null, null],
|
|
2193
|
+
dimensions: 1,
|
|
2194
|
+
axisRotation: false
|
|
2074
2195
|
};
|
|
2075
2196
|
}
|
|
2197
|
+
const axisRotation = parseAxisRotationValue(output);
|
|
2198
|
+
if (axisRotation !== null) {
|
|
2199
|
+
return axisRotation;
|
|
2200
|
+
}
|
|
2076
2201
|
const parts = output.trim().split(/\\s+/);
|
|
2077
2202
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
2078
2203
|
throw new TypeError(\`String outputRange values must contain 1 to 3 components, but got "\${output}"\`);
|
|
@@ -2093,24 +2218,35 @@ var parseStringInterpolationValue = (output) => {
|
|
|
2093
2218
|
const z = parsed[2]?.value ?? 1;
|
|
2094
2219
|
return {
|
|
2095
2220
|
kind,
|
|
2096
|
-
values: [x, y, z],
|
|
2097
|
-
units: [null, null, null],
|
|
2098
|
-
dimensions: parsed.length
|
|
2221
|
+
values: [x, y, z, 0],
|
|
2222
|
+
units: [null, null, null, null],
|
|
2223
|
+
dimensions: parsed.length,
|
|
2224
|
+
axisRotation: false
|
|
2099
2225
|
};
|
|
2100
2226
|
}
|
|
2101
2227
|
return {
|
|
2102
2228
|
kind,
|
|
2103
|
-
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
2104
|
-
units: [
|
|
2105
|
-
|
|
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
|
|
2106
2238
|
};
|
|
2107
2239
|
};
|
|
2108
2240
|
var serializeStringInterpolationValue = ({
|
|
2109
2241
|
kind,
|
|
2110
2242
|
values,
|
|
2111
2243
|
units,
|
|
2112
|
-
dimensions
|
|
2244
|
+
dimensions,
|
|
2245
|
+
axisRotation
|
|
2113
2246
|
}) => {
|
|
2247
|
+
if (axisRotation) {
|
|
2248
|
+
return \`\${stringifyNumber(values[0])} \${stringifyNumber(values[1])} \${stringifyNumber(values[2])} \${stringifyNumber(values[3])}\${units[3]}\`;
|
|
2249
|
+
}
|
|
2114
2250
|
if (kind === "scale") {
|
|
2115
2251
|
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
2116
2252
|
}
|
|
@@ -2278,7 +2414,26 @@ var interpolateString = ({
|
|
|
2278
2414
|
outputRange,
|
|
2279
2415
|
options
|
|
2280
2416
|
}) => {
|
|
2281
|
-
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;
|
|
2282
2437
|
const kind = parsedOutputRange[0]?.kind;
|
|
2283
2438
|
if (kind === undefined) {
|
|
2284
2439
|
throw new Error("outputRange must have at least 1 element");
|
|
@@ -2290,12 +2445,16 @@ var interpolateString = ({
|
|
|
2290
2445
|
}
|
|
2291
2446
|
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
2292
2447
|
const units = [
|
|
2448
|
+
null,
|
|
2293
2449
|
null,
|
|
2294
2450
|
null,
|
|
2295
2451
|
null
|
|
2296
2452
|
];
|
|
2297
2453
|
if (kind !== "scale") {
|
|
2298
2454
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
2455
|
+
if (hasAxisRotation && axis < 3) {
|
|
2456
|
+
continue;
|
|
2457
|
+
}
|
|
2299
2458
|
for (const parsed of parsedOutputRange) {
|
|
2300
2459
|
const unit = parsed.units[axis];
|
|
2301
2460
|
if (unit === null) {
|
|
@@ -2314,7 +2473,7 @@ var interpolateString = ({
|
|
|
2314
2473
|
}
|
|
2315
2474
|
}
|
|
2316
2475
|
}
|
|
2317
|
-
const values = [0, 0, 0];
|
|
2476
|
+
const values = [0, 0, 0, 0];
|
|
2318
2477
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
2319
2478
|
values[axis] = interpolateNumber({
|
|
2320
2479
|
input,
|
|
@@ -2327,7 +2486,8 @@ var interpolateString = ({
|
|
|
2327
2486
|
kind,
|
|
2328
2487
|
values,
|
|
2329
2488
|
units,
|
|
2330
|
-
dimensions
|
|
2489
|
+
dimensions,
|
|
2490
|
+
axisRotation: hasAxisRotation
|
|
2331
2491
|
});
|
|
2332
2492
|
};
|
|
2333
2493
|
var validateTupleOutputRange = (outputRange) => {
|
|
@@ -2666,7 +2826,15 @@ var backgroundSchema = {
|
|
|
2666
2826
|
description: "Color"
|
|
2667
2827
|
}
|
|
2668
2828
|
};
|
|
2829
|
+
var svgColorSchema = {
|
|
2830
|
+
color: {
|
|
2831
|
+
type: "color",
|
|
2832
|
+
default: undefined,
|
|
2833
|
+
description: "Current color"
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2669
2836
|
var svgStrokeSchema = {
|
|
2837
|
+
...svgColorSchema,
|
|
2670
2838
|
stroke: {
|
|
2671
2839
|
type: "color",
|
|
2672
2840
|
default: "none",
|
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",
|