remotion 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/README.md +1 -0
- package/dist/cjs/Interactive.d.ts +10 -0
- package/dist/cjs/SequenceManager.d.ts +6 -0
- package/dist/cjs/SequenceManager.js +20 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +2 -1
- package/dist/cjs/audio/shared-audio-tags.js +22 -6
- package/dist/cjs/audio/wait-until-actually-resumed.d.ts +2 -1
- package/dist/cjs/audio/wait-until-actually-resumed.js +34 -4
- package/dist/cjs/buffering.js +17 -8
- package/dist/cjs/interactivity-schema.d.ts +10 -0
- package/dist/cjs/interactivity-schema.js +8 -0
- package/dist/cjs/internals.d.ts +6 -3
- package/dist/cjs/internals.js +4 -0
- package/dist/cjs/interpolate-keyframed-status.js +2 -0
- package/dist/cjs/interpolate.js +92 -11
- package/dist/cjs/portal-node.d.ts +3 -0
- package/dist/cjs/portal-node.js +22 -1
- package/dist/cjs/render-resource-manager.d.ts +13 -0
- package/dist/cjs/render-resource-manager.js +47 -0
- package/dist/cjs/sequence-node-path.d.ts +1 -1
- package/dist/cjs/use-current-scale.js +10 -6
- package/dist/cjs/use-schema.d.ts +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/with-interactivity-schema.js +3 -1
- package/dist/esm/index.mjs +296 -77
- package/dist/esm/no-react.mjs +100 -16
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/interpolate-translate.d.ts +0 -8
- package/dist/cjs/interpolate-translate.js +0 -70
- package/dist/cjs/sequence-field-schema.d.ts +0 -425
- package/dist/cjs/sequence-field-schema.js +0 -133
- package/dist/cjs/wrap-in-schema.d.ts +0 -20
- package/dist/cjs/wrap-in-schema.js +0 -203
package/dist/esm/no-react.mjs
CHANGED
|
@@ -191,9 +191,45 @@ var parseTransformOriginValue = (output, parts) => {
|
|
|
191
191
|
});
|
|
192
192
|
return {
|
|
193
193
|
kind: "translate",
|
|
194
|
-
values: [x.value, y.value, z.value],
|
|
195
|
-
units: [x.unit, y.unit, z.unit],
|
|
196
|
-
dimensions: parts[2] === undefined ? 2 : 3
|
|
194
|
+
values: [x.value, y.value, z.value, 0],
|
|
195
|
+
units: [x.unit, y.unit, z.unit, null],
|
|
196
|
+
dimensions: parts[2] === undefined ? 2 : 3,
|
|
197
|
+
axisRotation: false
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
var parseAxisRotationValue = (output) => {
|
|
201
|
+
const parts = output.trim().split(/\s+/);
|
|
202
|
+
const keywordAxis = parts.length === 2 ? parts[0].toLowerCase() : null;
|
|
203
|
+
if (keywordAxis === "x" || keywordAxis === "y" || keywordAxis === "z") {
|
|
204
|
+
const keywordAngle = parseStringInterpolationComponent(parts[1], output);
|
|
205
|
+
if (keywordAngle.kind !== "rotate") {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
kind: "rotate",
|
|
210
|
+
values: keywordAxis === "x" ? [1, 0, 0, keywordAngle.value] : keywordAxis === "y" ? [0, 1, 0, keywordAngle.value] : [0, 0, 1, keywordAngle.value],
|
|
211
|
+
units: [null, null, null, keywordAngle.unit],
|
|
212
|
+
dimensions: 4,
|
|
213
|
+
axisRotation: true
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
if (parts.length !== 4) {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
const axis = parts.slice(0, 3).map(Number);
|
|
220
|
+
if (!axis.every(Number.isFinite)) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
const vectorAngle = parseStringInterpolationComponent(parts[3], output);
|
|
224
|
+
if (vectorAngle.kind !== "rotate") {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
kind: "rotate",
|
|
229
|
+
values: [axis[0], axis[1], axis[2], vectorAngle.value],
|
|
230
|
+
units: [null, null, null, vectorAngle.unit],
|
|
231
|
+
dimensions: 4,
|
|
232
|
+
axisRotation: true
|
|
197
233
|
};
|
|
198
234
|
};
|
|
199
235
|
var parseStringInterpolationValue = (output) => {
|
|
@@ -203,11 +239,16 @@ var parseStringInterpolationValue = (output) => {
|
|
|
203
239
|
}
|
|
204
240
|
return {
|
|
205
241
|
kind: "scale",
|
|
206
|
-
values: [output, output, 1],
|
|
207
|
-
units: [null, null, null],
|
|
208
|
-
dimensions: 1
|
|
242
|
+
values: [output, output, 1, 0],
|
|
243
|
+
units: [null, null, null, null],
|
|
244
|
+
dimensions: 1,
|
|
245
|
+
axisRotation: false
|
|
209
246
|
};
|
|
210
247
|
}
|
|
248
|
+
const axisRotation = parseAxisRotationValue(output);
|
|
249
|
+
if (axisRotation !== null) {
|
|
250
|
+
return axisRotation;
|
|
251
|
+
}
|
|
211
252
|
const parts = output.trim().split(/\s+/);
|
|
212
253
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
213
254
|
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
@@ -228,24 +269,35 @@ var parseStringInterpolationValue = (output) => {
|
|
|
228
269
|
const z = parsed[2]?.value ?? 1;
|
|
229
270
|
return {
|
|
230
271
|
kind,
|
|
231
|
-
values: [x, y, z],
|
|
232
|
-
units: [null, null, null],
|
|
233
|
-
dimensions: parsed.length
|
|
272
|
+
values: [x, y, z, 0],
|
|
273
|
+
units: [null, null, null, null],
|
|
274
|
+
dimensions: parsed.length,
|
|
275
|
+
axisRotation: false
|
|
234
276
|
};
|
|
235
277
|
}
|
|
236
278
|
return {
|
|
237
279
|
kind,
|
|
238
|
-
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
239
|
-
units: [
|
|
240
|
-
|
|
280
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0, 0],
|
|
281
|
+
units: [
|
|
282
|
+
parsed[0].unit,
|
|
283
|
+
parsed[1]?.unit ?? null,
|
|
284
|
+
parsed[2]?.unit ?? null,
|
|
285
|
+
null
|
|
286
|
+
],
|
|
287
|
+
dimensions: parsed.length,
|
|
288
|
+
axisRotation: false
|
|
241
289
|
};
|
|
242
290
|
};
|
|
243
291
|
var serializeStringInterpolationValue = ({
|
|
244
292
|
kind,
|
|
245
293
|
values,
|
|
246
294
|
units,
|
|
247
|
-
dimensions
|
|
295
|
+
dimensions,
|
|
296
|
+
axisRotation
|
|
248
297
|
}) => {
|
|
298
|
+
if (axisRotation) {
|
|
299
|
+
return `${stringifyNumber(values[0])} ${stringifyNumber(values[1])} ${stringifyNumber(values[2])} ${stringifyNumber(values[3])}${units[3]}`;
|
|
300
|
+
}
|
|
249
301
|
if (kind === "scale") {
|
|
250
302
|
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
251
303
|
}
|
|
@@ -413,7 +465,26 @@ var interpolateString = ({
|
|
|
413
465
|
outputRange,
|
|
414
466
|
options
|
|
415
467
|
}) => {
|
|
416
|
-
const
|
|
468
|
+
const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
469
|
+
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
470
|
+
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed) => {
|
|
471
|
+
if (parsed.kind !== "rotate") {
|
|
472
|
+
return parsed;
|
|
473
|
+
}
|
|
474
|
+
if (parsed.axisRotation) {
|
|
475
|
+
return parsed;
|
|
476
|
+
}
|
|
477
|
+
if (parsed.dimensions !== 1) {
|
|
478
|
+
throw new TypeError("Cannot interpolate a multi-angle rotate value with an axis rotation");
|
|
479
|
+
}
|
|
480
|
+
return {
|
|
481
|
+
kind: "rotate",
|
|
482
|
+
values: [0, 0, 1, parsed.values[0]],
|
|
483
|
+
units: [null, null, null, parsed.units[0]],
|
|
484
|
+
dimensions: 4,
|
|
485
|
+
axisRotation: true
|
|
486
|
+
};
|
|
487
|
+
}) : initiallyParsedOutputRange;
|
|
417
488
|
const kind = parsedOutputRange[0]?.kind;
|
|
418
489
|
if (kind === undefined) {
|
|
419
490
|
throw new Error("outputRange must have at least 1 element");
|
|
@@ -425,12 +496,16 @@ var interpolateString = ({
|
|
|
425
496
|
}
|
|
426
497
|
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
427
498
|
const units = [
|
|
499
|
+
null,
|
|
428
500
|
null,
|
|
429
501
|
null,
|
|
430
502
|
null
|
|
431
503
|
];
|
|
432
504
|
if (kind !== "scale") {
|
|
433
505
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
506
|
+
if (hasAxisRotation && axis < 3) {
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
434
509
|
for (const parsed of parsedOutputRange) {
|
|
435
510
|
const unit = parsed.units[axis];
|
|
436
511
|
if (unit === null) {
|
|
@@ -449,7 +524,7 @@ var interpolateString = ({
|
|
|
449
524
|
}
|
|
450
525
|
}
|
|
451
526
|
}
|
|
452
|
-
const values = [0, 0, 0];
|
|
527
|
+
const values = [0, 0, 0, 0];
|
|
453
528
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
454
529
|
values[axis] = interpolateNumber({
|
|
455
530
|
input,
|
|
@@ -462,7 +537,8 @@ var interpolateString = ({
|
|
|
462
537
|
kind,
|
|
463
538
|
values,
|
|
464
539
|
units,
|
|
465
|
-
dimensions
|
|
540
|
+
dimensions,
|
|
541
|
+
axisRotation: hasAxisRotation
|
|
466
542
|
});
|
|
467
543
|
};
|
|
468
544
|
var validateTupleOutputRange = (outputRange) => {
|
|
@@ -843,7 +919,15 @@ var backgroundSchema = {
|
|
|
843
919
|
description: "Color"
|
|
844
920
|
}
|
|
845
921
|
};
|
|
922
|
+
var svgColorSchema = {
|
|
923
|
+
color: {
|
|
924
|
+
type: "color",
|
|
925
|
+
default: undefined,
|
|
926
|
+
description: "Current color"
|
|
927
|
+
}
|
|
928
|
+
};
|
|
846
929
|
var svgStrokeSchema = {
|
|
930
|
+
...svgColorSchema,
|
|
847
931
|
stroke: {
|
|
848
932
|
type: "color",
|
|
849
933
|
default: "none",
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.508",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-dom": "19.2.3",
|
|
36
36
|
"webpack": "5.105.0",
|
|
37
37
|
"zod": "4.4.3",
|
|
38
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
38
|
+
"@remotion/eslint-config-internal": "4.0.508",
|
|
39
39
|
"eslint": "9.19.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
41
41
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type InterpolateOptions } from './interpolate.js';
|
|
2
|
-
export type InterpolateTranslateOptions = InterpolateOptions;
|
|
3
|
-
export declare const interpolateTranslate: (input: number, inputRange: readonly number[], outputRange: readonly string[], options?: Partial<{
|
|
4
|
-
easing: import("./interpolate.js").EasingFunction | readonly import("./interpolate.js").EasingFunction[];
|
|
5
|
-
extrapolateLeft: import("./interpolate.js").ExtrapolateType;
|
|
6
|
-
extrapolateRight: import("./interpolate.js").ExtrapolateType;
|
|
7
|
-
posterize: number;
|
|
8
|
-
}> | undefined) => string;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.interpolateTranslate = void 0;
|
|
4
|
-
const interpolate_js_1 = require("./interpolate.js");
|
|
5
|
-
const pixelValueRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))px$/;
|
|
6
|
-
const parseTranslate = (value) => {
|
|
7
|
-
if (typeof value !== 'string') {
|
|
8
|
-
throw new TypeError(`outputRange must contain only strings, but got ${typeof value}`);
|
|
9
|
-
}
|
|
10
|
-
const parts = value.trim().split(/\s+/);
|
|
11
|
-
if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
|
|
12
|
-
throw new TypeError(`translate values must contain 1 to 3 pixel values, but got "${value}"`);
|
|
13
|
-
}
|
|
14
|
-
return parts.map((part) => {
|
|
15
|
-
const match = pixelValueRegex.exec(part);
|
|
16
|
-
if (match === null) {
|
|
17
|
-
throw new TypeError(`interpolateTranslate() only supports px values, but got "${part}" in "${value}"`);
|
|
18
|
-
}
|
|
19
|
-
return Number(match[1]);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
/*
|
|
23
|
-
* @description Allows you to map a range of values to CSS translate values using pixel units.
|
|
24
|
-
* @see [Documentation](https://remotion.dev/docs/interpolate-translate)
|
|
25
|
-
*/
|
|
26
|
-
const interpolateTranslate = (input, inputRange, outputRange, options) => {
|
|
27
|
-
var _a;
|
|
28
|
-
if (typeof input === 'undefined') {
|
|
29
|
-
throw new TypeError('input can not be undefined');
|
|
30
|
-
}
|
|
31
|
-
if (typeof inputRange === 'undefined') {
|
|
32
|
-
throw new TypeError('inputRange can not be undefined');
|
|
33
|
-
}
|
|
34
|
-
if (typeof outputRange === 'undefined') {
|
|
35
|
-
throw new TypeError('outputRange can not be undefined');
|
|
36
|
-
}
|
|
37
|
-
if (inputRange.length !== outputRange.length) {
|
|
38
|
-
throw new TypeError('inputRange (' +
|
|
39
|
-
inputRange.length +
|
|
40
|
-
' values provided) and outputRange (' +
|
|
41
|
-
outputRange.length +
|
|
42
|
-
' values provided) must have the same length');
|
|
43
|
-
}
|
|
44
|
-
const parsedOutputRange = outputRange.map((translateValue) => parseTranslate(translateValue));
|
|
45
|
-
const firstValueLength = (_a = parsedOutputRange[0]) === null || _a === void 0 ? void 0 : _a.length;
|
|
46
|
-
if (firstValueLength === undefined) {
|
|
47
|
-
throw new TypeError('outputRange must have at least 1 element');
|
|
48
|
-
}
|
|
49
|
-
for (const parsedTranslate of parsedOutputRange) {
|
|
50
|
-
if (parsedTranslate.length !== firstValueLength) {
|
|
51
|
-
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${parsedTranslate.length}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return new Array(firstValueLength)
|
|
55
|
-
.fill(true)
|
|
56
|
-
.map((_, index) => {
|
|
57
|
-
const outputValues = [];
|
|
58
|
-
for (const translateValue of parsedOutputRange) {
|
|
59
|
-
const value = translateValue[index];
|
|
60
|
-
if (value === undefined) {
|
|
61
|
-
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${translateValue.length}`);
|
|
62
|
-
}
|
|
63
|
-
outputValues.push(value);
|
|
64
|
-
}
|
|
65
|
-
const interpolatedValue = (0, interpolate_js_1.interpolate)(input, inputRange, outputValues, options);
|
|
66
|
-
return `${interpolatedValue}px`;
|
|
67
|
-
})
|
|
68
|
-
.join(' ');
|
|
69
|
-
};
|
|
70
|
-
exports.interpolateTranslate = interpolateTranslate;
|