@remotion/studio-shared 4.0.507 → 4.0.509
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/api-requests.d.ts +26 -1
- package/dist/canvas-capture.d.ts +19 -0
- package/dist/canvas-capture.js +70 -0
- package/dist/codemods.d.ts +8 -0
- package/dist/config-method-lifecycles.d.ts +1 -0
- package/dist/config-method-lifecycles.js +1 -0
- package/dist/effect-catalog.js +66 -0
- package/dist/effect-clipboard-data.d.ts +2 -0
- package/dist/effect-clipboard-data.js +8 -6
- package/dist/esm/index.mjs +296 -112
- package/dist/esm/keyframe-interpolation-function.mjs +13 -2
- package/dist/esm/studio-html.mjs +2 -0
- package/dist/event-source-event.d.ts +4 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +11 -2
- package/dist/keyframe-interpolation-function.d.ts +4 -0
- package/dist/keyframe-interpolation-function.js +11 -3
- package/dist/optimistic-add-keyframe.js +8 -2
- package/dist/package-info.d.ts +2 -2
- package/dist/package-info.js +4 -0
- package/dist/react-refresh-event.d.ts +1 -0
- package/dist/react-refresh-event.js +4 -0
- package/dist/render-job.d.ts +1 -0
- package/dist/sequence-node-path-mutation.d.ts +13 -0
- package/dist/sequence-node-path-mutation.js +2 -0
- package/dist/sequence-prop-clipboard-data.d.ts +21 -0
- package/dist/sequence-prop-clipboard-data.js +45 -0
- package/dist/studio-html.d.ts +2 -1
- package/dist/studio-html.js +2 -1
- package/dist/terminal.d.ts +1 -0
- package/dist/terminal.js +2 -0
- package/package.json +5 -5
package/dist/esm/index.mjs
CHANGED
|
@@ -37,6 +37,59 @@ var stripAnsi = (str) => {
|
|
|
37
37
|
}
|
|
38
38
|
return str.replace(ansiRegex(), "");
|
|
39
39
|
};
|
|
40
|
+
// src/canvas-capture.ts
|
|
41
|
+
var CANVAS_CAPTURE_METADATA_TAG = "REMOTION_CAPTURE_DATA";
|
|
42
|
+
var isRecord = (value) => {
|
|
43
|
+
return typeof value === "object" && value !== null;
|
|
44
|
+
};
|
|
45
|
+
var isFiniteNumber = (value) => {
|
|
46
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
47
|
+
};
|
|
48
|
+
var parseCanvasCaptureData = (metadata) => {
|
|
49
|
+
if (!isRecord(metadata) || !isRecord(metadata.raw)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const rawCaptureData = metadata.raw[CANVAS_CAPTURE_METADATA_TAG];
|
|
53
|
+
if (typeof rawCaptureData !== "string") {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
let parsed;
|
|
57
|
+
try {
|
|
58
|
+
parsed = JSON.parse(rawCaptureData);
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (!isRecord(parsed) || !isRecord(parsed.captureMetadata) || !isFiniteNumber(parsed.captureMetadata.density) || parsed.captureMetadata.density <= 0 || !Array.isArray(parsed.mouseMovements) || !Array.isArray(parsed.pointerClicks)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const mouseMovements = [];
|
|
66
|
+
for (const movement of parsed.mouseMovements) {
|
|
67
|
+
if (!isRecord(movement) || !isFiniteNumber(movement.timeInSeconds) || movement.timeInSeconds < 0 || movement.canvasX !== null && !isFiniteNumber(movement.canvasX) || movement.canvasY !== null && !isFiniteNumber(movement.canvasY) || typeof movement.cursor !== "string") {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
mouseMovements.push({
|
|
71
|
+
timeInSeconds: movement.timeInSeconds,
|
|
72
|
+
canvasX: movement.canvasX,
|
|
73
|
+
canvasY: movement.canvasY,
|
|
74
|
+
cursor: movement.cursor
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const pointerClicks = [];
|
|
78
|
+
for (const click of parsed.pointerClicks) {
|
|
79
|
+
if (!isRecord(click) || !isFiniteNumber(click.timeInSeconds) || click.timeInSeconds < 0 || click.type !== "pointer-down" && click.type !== "pointer-up") {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
pointerClicks.push({
|
|
83
|
+
timeInSeconds: click.timeInSeconds,
|
|
84
|
+
type: click.type
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
captureMetadata: { density: parsed.captureMetadata.density },
|
|
89
|
+
mouseMovements: mouseMovements.sort((a, b) => a.timeInSeconds - b.timeInSeconds),
|
|
90
|
+
pointerClicks: pointerClicks.sort((a, b) => a.timeInSeconds - b.timeInSeconds)
|
|
91
|
+
};
|
|
92
|
+
};
|
|
40
93
|
// src/composition-drag-data.ts
|
|
41
94
|
var compositionDragDataToSymbolicatedStack = (dragData) => {
|
|
42
95
|
if (dragData.compositionFile === null) {
|
|
@@ -50,6 +103,8 @@ var compositionDragDataToSymbolicatedStack = (dragData) => {
|
|
|
50
103
|
originalScriptCode: null
|
|
51
104
|
};
|
|
52
105
|
};
|
|
106
|
+
// src/react-refresh-event.ts
|
|
107
|
+
var REACT_REFRESH_FINISHED_EVENT = "remotion-react-refresh-finished";
|
|
53
108
|
// src/config-file-change.ts
|
|
54
109
|
var getConfigFileChangeMessage = (changeType) => {
|
|
55
110
|
if (changeType === "restart") {
|
|
@@ -108,6 +163,7 @@ var configMethodLifecycles = {
|
|
|
108
163
|
setEnforceAudioTrack: "runtime",
|
|
109
164
|
setEntryPoint: "restart",
|
|
110
165
|
setEveryNthFrame: "runtime",
|
|
166
|
+
setExperimentalKeepAudioContextAlive: "reload",
|
|
111
167
|
setExperimentalRspackEnabled: "restart",
|
|
112
168
|
setForSeamlessAacConcatenation: "runtime",
|
|
113
169
|
setForceNewStudioEnabled: "restart",
|
|
@@ -463,14 +519,14 @@ var detectFileType = (data) => {
|
|
|
463
519
|
return { type: "unknown" };
|
|
464
520
|
};
|
|
465
521
|
// src/easing-clipboard-data.ts
|
|
466
|
-
var
|
|
522
|
+
var isRecord2 = (value) => {
|
|
467
523
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
468
524
|
};
|
|
469
|
-
var
|
|
525
|
+
var isFiniteNumber2 = (value) => {
|
|
470
526
|
return typeof value === "number" && Number.isFinite(value);
|
|
471
527
|
};
|
|
472
528
|
var isKeyframeEasing = (value) => {
|
|
473
|
-
return
|
|
529
|
+
return isRecord2(value) && (value.type === "linear" || value.type === "step1" || value.type === "bezier" && isFiniteNumber2(value.x1) && isFiniteNumber2(value.y1) && isFiniteNumber2(value.x2) && isFiniteNumber2(value.y2) || value.type === "spring" && isFiniteNumber2(value.damping) && isFiniteNumber2(value.mass) && isFiniteNumber2(value.stiffness) && (value.allowTail === undefined || value.allowTail === null || typeof value.allowTail === "boolean") && (value.durationRestThreshold === undefined || value.durationRestThreshold === null || isFiniteNumber2(value.durationRestThreshold)) && typeof value.overshootClamping === "boolean");
|
|
474
530
|
};
|
|
475
531
|
var normalizeKeyframeEasing = (easing) => {
|
|
476
532
|
if (easing.type !== "spring") {
|
|
@@ -485,7 +541,7 @@ var normalizeKeyframeEasing = (easing) => {
|
|
|
485
541
|
var parseEasingClipboardDataResult = (value) => {
|
|
486
542
|
try {
|
|
487
543
|
const parsed = JSON.parse(value);
|
|
488
|
-
if (!
|
|
544
|
+
if (!isRecord2(parsed)) {
|
|
489
545
|
return { status: "invalid" };
|
|
490
546
|
}
|
|
491
547
|
if (parsed.remotionClipboard !== "easing") {
|
|
@@ -575,6 +631,17 @@ var EFFECT_CATALOG = [
|
|
|
575
631
|
config: {}
|
|
576
632
|
}
|
|
577
633
|
},
|
|
634
|
+
{
|
|
635
|
+
id: "effects-color-correction",
|
|
636
|
+
category: "Color",
|
|
637
|
+
label: "colorCorrection()",
|
|
638
|
+
description: "Combined primary color adjustments",
|
|
639
|
+
effect: {
|
|
640
|
+
name: "colorCorrection",
|
|
641
|
+
importPath: "@remotion/effects/color-correction",
|
|
642
|
+
config: {}
|
|
643
|
+
}
|
|
644
|
+
},
|
|
578
645
|
{
|
|
579
646
|
id: "effects-color-key",
|
|
580
647
|
category: "Color",
|
|
@@ -599,6 +666,17 @@ var EFFECT_CATALOG = [
|
|
|
599
666
|
config: {}
|
|
600
667
|
}
|
|
601
668
|
},
|
|
669
|
+
{
|
|
670
|
+
id: "effects-exposure",
|
|
671
|
+
category: "Color",
|
|
672
|
+
label: "exposure()",
|
|
673
|
+
description: "Stop-based exposure adjustment",
|
|
674
|
+
effect: {
|
|
675
|
+
name: "exposure",
|
|
676
|
+
importPath: "@remotion/effects/exposure",
|
|
677
|
+
config: {}
|
|
678
|
+
}
|
|
679
|
+
},
|
|
602
680
|
{
|
|
603
681
|
id: "effects-grayscale",
|
|
604
682
|
category: "Color",
|
|
@@ -632,6 +710,17 @@ var EFFECT_CATALOG = [
|
|
|
632
710
|
config: {}
|
|
633
711
|
}
|
|
634
712
|
},
|
|
713
|
+
{
|
|
714
|
+
id: "effects-levels",
|
|
715
|
+
category: "Color",
|
|
716
|
+
label: "levels()",
|
|
717
|
+
description: "Black point, white point, and gamma",
|
|
718
|
+
effect: {
|
|
719
|
+
name: "levels",
|
|
720
|
+
importPath: "@remotion/effects/levels",
|
|
721
|
+
config: {}
|
|
722
|
+
}
|
|
723
|
+
},
|
|
635
724
|
{
|
|
636
725
|
id: "effects-saturation",
|
|
637
726
|
category: "Color",
|
|
@@ -643,6 +732,17 @@ var EFFECT_CATALOG = [
|
|
|
643
732
|
config: {}
|
|
644
733
|
}
|
|
645
734
|
},
|
|
735
|
+
{
|
|
736
|
+
id: "effects-shadows-highlights",
|
|
737
|
+
category: "Color",
|
|
738
|
+
label: "shadowsHighlights()",
|
|
739
|
+
description: "Recover dark and bright tonal regions",
|
|
740
|
+
effect: {
|
|
741
|
+
name: "shadowsHighlights",
|
|
742
|
+
importPath: "@remotion/effects/shadows-highlights",
|
|
743
|
+
config: {}
|
|
744
|
+
}
|
|
745
|
+
},
|
|
646
746
|
{
|
|
647
747
|
id: "effects-tint",
|
|
648
748
|
category: "Color",
|
|
@@ -656,6 +756,28 @@ var EFFECT_CATALOG = [
|
|
|
656
756
|
}
|
|
657
757
|
}
|
|
658
758
|
},
|
|
759
|
+
{
|
|
760
|
+
id: "effects-white-balance",
|
|
761
|
+
category: "Color",
|
|
762
|
+
label: "whiteBalance()",
|
|
763
|
+
description: "Temperature and tint correction",
|
|
764
|
+
effect: {
|
|
765
|
+
name: "whiteBalance",
|
|
766
|
+
importPath: "@remotion/effects/white-balance",
|
|
767
|
+
config: {}
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
id: "effects-vibrance",
|
|
772
|
+
category: "Color",
|
|
773
|
+
label: "vibrance()",
|
|
774
|
+
description: "Selective saturation adjustment",
|
|
775
|
+
effect: {
|
|
776
|
+
name: "vibrance",
|
|
777
|
+
importPath: "@remotion/effects/vibrance",
|
|
778
|
+
config: {}
|
|
779
|
+
}
|
|
780
|
+
},
|
|
659
781
|
{
|
|
660
782
|
id: "effects-linear-gradient",
|
|
661
783
|
category: "Color",
|
|
@@ -1309,7 +1431,7 @@ var KEYFRAME_FIELD_TYPE_SUPPORT = {
|
|
|
1309
1431
|
boolean: false,
|
|
1310
1432
|
"remotion-captions": false,
|
|
1311
1433
|
color: true,
|
|
1312
|
-
enum:
|
|
1434
|
+
enum: true,
|
|
1313
1435
|
"font-family": false,
|
|
1314
1436
|
hidden: true,
|
|
1315
1437
|
number: true,
|
|
@@ -1327,7 +1449,7 @@ var KEYFRAME_FIELD_TYPE_INTERPOLATION = {
|
|
|
1327
1449
|
boolean: "unsupported",
|
|
1328
1450
|
"remotion-captions": "unsupported",
|
|
1329
1451
|
color: "interpolateColors",
|
|
1330
|
-
enum: "
|
|
1452
|
+
enum: "interpolate",
|
|
1331
1453
|
"font-family": "unsupported",
|
|
1332
1454
|
hidden: "infer",
|
|
1333
1455
|
number: "infer",
|
|
@@ -1351,6 +1473,9 @@ var isInteractivitySchemaFieldKeyframable = (field) => {
|
|
|
1351
1473
|
if (!field) {
|
|
1352
1474
|
return true;
|
|
1353
1475
|
}
|
|
1476
|
+
if (field.type === "enum") {
|
|
1477
|
+
return field.keyframable === true;
|
|
1478
|
+
}
|
|
1354
1479
|
return KEYFRAME_FIELD_TYPE_SUPPORT[field.type] && field.keyframable !== false;
|
|
1355
1480
|
};
|
|
1356
1481
|
var findFieldInSchema = (schema, key) => {
|
|
@@ -1377,6 +1502,13 @@ var isSchemaFieldKeyframable = ({
|
|
|
1377
1502
|
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
1378
1503
|
return isInteractivitySchemaFieldKeyframable(field);
|
|
1379
1504
|
};
|
|
1505
|
+
var isSchemaFieldHoldOnly = ({
|
|
1506
|
+
schema,
|
|
1507
|
+
key
|
|
1508
|
+
}) => {
|
|
1509
|
+
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
1510
|
+
return field?.type === "enum" && field.keyframable === true;
|
|
1511
|
+
};
|
|
1380
1512
|
var getKeyframeInterpolationFunctionForSchemaField = ({
|
|
1381
1513
|
schema,
|
|
1382
1514
|
key
|
|
@@ -1405,16 +1537,16 @@ var getKeyframeInterpolationFunction = ({
|
|
|
1405
1537
|
};
|
|
1406
1538
|
|
|
1407
1539
|
// src/effect-clipboard-data.ts
|
|
1408
|
-
var
|
|
1540
|
+
var isRecord3 = (value) => {
|
|
1409
1541
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1410
1542
|
};
|
|
1411
1543
|
var extrapolateTypes = new Set(["extend", "identity", "clamp", "wrap"]);
|
|
1412
1544
|
var outputOptions = new Set(["linear", "perceptual-scale"]);
|
|
1413
|
-
var
|
|
1545
|
+
var isFiniteNumber3 = (value) => {
|
|
1414
1546
|
return typeof value === "number" && Number.isFinite(value);
|
|
1415
1547
|
};
|
|
1416
1548
|
var isEasing = (value) => {
|
|
1417
|
-
return
|
|
1549
|
+
return isRecord3(value) && (value.type === "linear" || value.type === "step1" || value.type === "bezier" && isFiniteNumber3(value.x1) && isFiniteNumber3(value.y1) && isFiniteNumber3(value.x2) && isFiniteNumber3(value.y2) || value.type === "spring" && isFiniteNumber3(value.damping) && isFiniteNumber3(value.mass) && isFiniteNumber3(value.stiffness) && (value.allowTail === undefined || value.allowTail === null || typeof value.allowTail === "boolean") && (value.durationRestThreshold === undefined || value.durationRestThreshold === null || isFiniteNumber3(value.durationRestThreshold)) && typeof value.overshootClamping === "boolean");
|
|
1418
1550
|
};
|
|
1419
1551
|
var normalizeEasing = (easing) => {
|
|
1420
1552
|
if (easing.type !== "spring") {
|
|
@@ -1426,7 +1558,7 @@ var normalizeEasing = (easing) => {
|
|
|
1426
1558
|
durationRestThreshold: easing.durationRestThreshold ?? null
|
|
1427
1559
|
};
|
|
1428
1560
|
};
|
|
1429
|
-
var
|
|
1561
|
+
var normalizeEffectClipboardParam = (param) => {
|
|
1430
1562
|
if (param.type === "static") {
|
|
1431
1563
|
return param;
|
|
1432
1564
|
}
|
|
@@ -1440,18 +1572,18 @@ var normalizeSnapshot = (snapshot) => {
|
|
|
1440
1572
|
...snapshot,
|
|
1441
1573
|
params: Object.fromEntries(Object.entries(snapshot.params).map(([key, param]) => [
|
|
1442
1574
|
key,
|
|
1443
|
-
|
|
1575
|
+
normalizeEffectClipboardParam(param)
|
|
1444
1576
|
]))
|
|
1445
1577
|
};
|
|
1446
1578
|
};
|
|
1447
1579
|
var isKeyframe = (value) => {
|
|
1448
|
-
return
|
|
1580
|
+
return isRecord3(value) && isFiniteNumber3(value.frame) && "value" in value;
|
|
1449
1581
|
};
|
|
1450
1582
|
var isClamping = (value) => {
|
|
1451
|
-
return
|
|
1583
|
+
return isRecord3(value) && typeof value.left === "string" && extrapolateTypes.has(value.left) && typeof value.right === "string" && extrapolateTypes.has(value.right);
|
|
1452
1584
|
};
|
|
1453
1585
|
var isEffectClipboardParam = (value) => {
|
|
1454
|
-
if (!
|
|
1586
|
+
if (!isRecord3(value)) {
|
|
1455
1587
|
return false;
|
|
1456
1588
|
}
|
|
1457
1589
|
if (value.type === "static") {
|
|
@@ -1463,18 +1595,18 @@ var isEffectClipboardParam = (value) => {
|
|
|
1463
1595
|
const { posterize } = value;
|
|
1464
1596
|
const { output } = value;
|
|
1465
1597
|
const easingLength = Array.isArray(value.keyframes) && value.keyframes.length > 0 ? value.keyframes.length - 1 : null;
|
|
1466
|
-
return typeof value.interpolationFunction === "string" && isKeyframeInterpolationFunction(value.interpolationFunction) && Array.isArray(value.keyframes) && value.keyframes.length > 0 && value.keyframes.every(isKeyframe) && Array.isArray(value.easing) && value.easing.length === easingLength && value.easing.every(isEasing) && isClamping(value.clamping) && (output === undefined || value.interpolationFunction === "interpolate" && typeof output === "string" && outputOptions.has(output)) && (posterize === undefined ||
|
|
1598
|
+
return typeof value.interpolationFunction === "string" && isKeyframeInterpolationFunction(value.interpolationFunction) && Array.isArray(value.keyframes) && value.keyframes.length > 0 && value.keyframes.every(isKeyframe) && Array.isArray(value.easing) && value.easing.length === easingLength && value.easing.every(isEasing) && isClamping(value.clamping) && (output === undefined || value.interpolationFunction === "interpolate" && typeof output === "string" && outputOptions.has(output)) && (posterize === undefined || isFiniteNumber3(posterize) && posterize > 0);
|
|
1467
1599
|
};
|
|
1468
1600
|
var isEffectClipboardSnapshotV3 = (value) => {
|
|
1469
|
-
if (!
|
|
1601
|
+
if (!isRecord3(value)) {
|
|
1470
1602
|
return false;
|
|
1471
1603
|
}
|
|
1472
|
-
return typeof value.callee === "string" && typeof value.importPath === "string" &&
|
|
1604
|
+
return typeof value.callee === "string" && typeof value.importPath === "string" && isRecord3(value.params) && Object.values(value.params).every(isEffectClipboardParam);
|
|
1473
1605
|
};
|
|
1474
1606
|
var parseEffectClipboardDataResult = (value) => {
|
|
1475
1607
|
try {
|
|
1476
1608
|
const parsed = JSON.parse(value);
|
|
1477
|
-
if (!
|
|
1609
|
+
if (!isRecord3(parsed)) {
|
|
1478
1610
|
return { status: "invalid" };
|
|
1479
1611
|
}
|
|
1480
1612
|
if (parsed.remotionClipboard !== "effects") {
|
|
@@ -1522,7 +1654,7 @@ var parseEffectClipboardData = (value) => {
|
|
|
1522
1654
|
var parseEffectPropClipboardDataResult = (value) => {
|
|
1523
1655
|
try {
|
|
1524
1656
|
const parsed = JSON.parse(value);
|
|
1525
|
-
if (!
|
|
1657
|
+
if (!isRecord3(parsed)) {
|
|
1526
1658
|
return { status: "invalid" };
|
|
1527
1659
|
}
|
|
1528
1660
|
if (parsed.remotionClipboard !== "effect-prop") {
|
|
@@ -1537,7 +1669,7 @@ var parseEffectPropClipboardDataResult = (value) => {
|
|
|
1537
1669
|
if (parsed.type !== "effect-prop") {
|
|
1538
1670
|
return { status: "invalid" };
|
|
1539
1671
|
}
|
|
1540
|
-
if (!
|
|
1672
|
+
if (!isRecord3(parsed.effect)) {
|
|
1541
1673
|
return { status: "invalid" };
|
|
1542
1674
|
}
|
|
1543
1675
|
if (typeof parsed.effect.callee !== "string" || typeof parsed.effect.importPath !== "string") {
|
|
@@ -1560,7 +1692,7 @@ var parseEffectPropClipboardDataResult = (value) => {
|
|
|
1560
1692
|
importPath: parsed.effect.importPath
|
|
1561
1693
|
},
|
|
1562
1694
|
key: parsed.key,
|
|
1563
|
-
param:
|
|
1695
|
+
param: normalizeEffectClipboardParam(parsed.param)
|
|
1564
1696
|
}
|
|
1565
1697
|
};
|
|
1566
1698
|
} catch {
|
|
@@ -1574,6 +1706,131 @@ var parseEffectPropClipboardData = (value) => {
|
|
|
1574
1706
|
}
|
|
1575
1707
|
return result.data;
|
|
1576
1708
|
};
|
|
1709
|
+
// src/keyframe-clipboard-data.ts
|
|
1710
|
+
var KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT = {
|
|
1711
|
+
array: false,
|
|
1712
|
+
asset: false,
|
|
1713
|
+
boolean: false,
|
|
1714
|
+
"remotion-captions": false,
|
|
1715
|
+
color: true,
|
|
1716
|
+
enum: false,
|
|
1717
|
+
"font-family": false,
|
|
1718
|
+
hidden: false,
|
|
1719
|
+
number: true,
|
|
1720
|
+
"rotation-css": true,
|
|
1721
|
+
"rotation-degrees": true,
|
|
1722
|
+
scale: true,
|
|
1723
|
+
"text-content": false,
|
|
1724
|
+
"transform-origin": true,
|
|
1725
|
+
translate: true,
|
|
1726
|
+
"uv-coordinate": true
|
|
1727
|
+
};
|
|
1728
|
+
var isRecord4 = (value) => {
|
|
1729
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1730
|
+
};
|
|
1731
|
+
var isKeyframeClipboardFieldType = (value) => {
|
|
1732
|
+
return typeof value === "string" && Object.hasOwn(KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT, value) && KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT[value];
|
|
1733
|
+
};
|
|
1734
|
+
var isKeyframeClipboardEntry = (value) => {
|
|
1735
|
+
return isRecord4(value) && Number.isInteger(value.frameOffset) && Object.hasOwn(value, "value");
|
|
1736
|
+
};
|
|
1737
|
+
var areValidKeyframes = (value) => {
|
|
1738
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
1739
|
+
return false;
|
|
1740
|
+
}
|
|
1741
|
+
let previousOffset = -1;
|
|
1742
|
+
for (const keyframe of value) {
|
|
1743
|
+
if (!isKeyframeClipboardEntry(keyframe) || keyframe.frameOffset <= previousOffset) {
|
|
1744
|
+
return false;
|
|
1745
|
+
}
|
|
1746
|
+
previousOffset = keyframe.frameOffset;
|
|
1747
|
+
}
|
|
1748
|
+
return value[0]?.frameOffset === 0;
|
|
1749
|
+
};
|
|
1750
|
+
var isKeyframeClipboardField = (value) => {
|
|
1751
|
+
return isRecord4(value) && (value.type === "sequence" || value.type === "effect") && typeof value.fieldKey === "string";
|
|
1752
|
+
};
|
|
1753
|
+
var parseEasings = ({
|
|
1754
|
+
value,
|
|
1755
|
+
keyframeCount
|
|
1756
|
+
}) => {
|
|
1757
|
+
if (Array.isArray(value) && value.length === Math.max(0, keyframeCount - 1) && value.every(isKeyframeEasing)) {
|
|
1758
|
+
return value.map(normalizeKeyframeEasing);
|
|
1759
|
+
}
|
|
1760
|
+
return null;
|
|
1761
|
+
};
|
|
1762
|
+
var parseKeyframeClipboardDataResult = (value) => {
|
|
1763
|
+
try {
|
|
1764
|
+
const parsed = JSON.parse(value);
|
|
1765
|
+
if (!isRecord4(parsed) || parsed.remotionClipboard !== "keyframe") {
|
|
1766
|
+
return { status: "invalid" };
|
|
1767
|
+
}
|
|
1768
|
+
if (parsed.version !== 1) {
|
|
1769
|
+
return { status: "unsupported-version", version: parsed.version };
|
|
1770
|
+
}
|
|
1771
|
+
const easing = parseEasings({
|
|
1772
|
+
value: parsed.easing,
|
|
1773
|
+
keyframeCount: Array.isArray(parsed.keyframes) ? parsed.keyframes.length : 0
|
|
1774
|
+
});
|
|
1775
|
+
if (parsed.type !== "keyframe" || !areValidKeyframes(parsed.keyframes) || easing === null || parsed.field !== null && !isKeyframeClipboardField(parsed.field) || parsed.fieldType !== null && !isKeyframeClipboardFieldType(parsed.fieldType)) {
|
|
1776
|
+
return { status: "invalid" };
|
|
1777
|
+
}
|
|
1778
|
+
return {
|
|
1779
|
+
status: "valid",
|
|
1780
|
+
data: {
|
|
1781
|
+
type: "keyframe",
|
|
1782
|
+
version: 1,
|
|
1783
|
+
remotionClipboard: "keyframe",
|
|
1784
|
+
fieldType: parsed.fieldType,
|
|
1785
|
+
field: parsed.field,
|
|
1786
|
+
keyframes: parsed.keyframes,
|
|
1787
|
+
easing
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
} catch {
|
|
1791
|
+
return { status: "invalid" };
|
|
1792
|
+
}
|
|
1793
|
+
};
|
|
1794
|
+
var parseKeyframeClipboardData = (value) => {
|
|
1795
|
+
const result = parseKeyframeClipboardDataResult(value);
|
|
1796
|
+
return result.status === "valid" ? result.data : null;
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
// src/sequence-prop-clipboard-data.ts
|
|
1800
|
+
var isRecord5 = (value) => {
|
|
1801
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1802
|
+
};
|
|
1803
|
+
var parseSequencePropClipboardDataResult = (value) => {
|
|
1804
|
+
try {
|
|
1805
|
+
const parsed = JSON.parse(value);
|
|
1806
|
+
if (!isRecord5(parsed) || parsed.remotionClipboard !== "sequence-prop") {
|
|
1807
|
+
return { status: "invalid" };
|
|
1808
|
+
}
|
|
1809
|
+
if (parsed.version !== 1) {
|
|
1810
|
+
return { status: "unsupported-version", version: parsed.version };
|
|
1811
|
+
}
|
|
1812
|
+
if (parsed.type !== "sequence-prop" || typeof parsed.key !== "string" || !isKeyframeClipboardFieldType(parsed.fieldType) || !isEffectClipboardParam(parsed.param)) {
|
|
1813
|
+
return { status: "invalid" };
|
|
1814
|
+
}
|
|
1815
|
+
return {
|
|
1816
|
+
status: "valid",
|
|
1817
|
+
data: {
|
|
1818
|
+
type: "sequence-prop",
|
|
1819
|
+
version: 1,
|
|
1820
|
+
remotionClipboard: "sequence-prop",
|
|
1821
|
+
key: parsed.key,
|
|
1822
|
+
fieldType: parsed.fieldType,
|
|
1823
|
+
param: normalizeEffectClipboardParam(parsed.param)
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
} catch {
|
|
1827
|
+
return { status: "invalid" };
|
|
1828
|
+
}
|
|
1829
|
+
};
|
|
1830
|
+
var parseSequencePropClipboardData = (value) => {
|
|
1831
|
+
const result = parseSequencePropClipboardDataResult(value);
|
|
1832
|
+
return result.status === "valid" ? result.data : null;
|
|
1833
|
+
};
|
|
1577
1834
|
// src/format-bytes.ts
|
|
1578
1835
|
var BYTE_UNITS = ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
1579
1836
|
var BIBYTE_UNITS = [
|
|
@@ -1751,95 +2008,6 @@ var hotMiddlewareOptions = {
|
|
|
1751
2008
|
reload: true,
|
|
1752
2009
|
warn: true
|
|
1753
2010
|
};
|
|
1754
|
-
// src/keyframe-clipboard-data.ts
|
|
1755
|
-
var KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT = {
|
|
1756
|
-
array: false,
|
|
1757
|
-
asset: false,
|
|
1758
|
-
boolean: false,
|
|
1759
|
-
"remotion-captions": false,
|
|
1760
|
-
color: true,
|
|
1761
|
-
enum: false,
|
|
1762
|
-
"font-family": false,
|
|
1763
|
-
hidden: false,
|
|
1764
|
-
number: true,
|
|
1765
|
-
"rotation-css": true,
|
|
1766
|
-
"rotation-degrees": true,
|
|
1767
|
-
scale: true,
|
|
1768
|
-
"text-content": false,
|
|
1769
|
-
"transform-origin": true,
|
|
1770
|
-
translate: true,
|
|
1771
|
-
"uv-coordinate": true
|
|
1772
|
-
};
|
|
1773
|
-
var isRecord3 = (value) => {
|
|
1774
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1775
|
-
};
|
|
1776
|
-
var isKeyframeClipboardFieldType = (value) => {
|
|
1777
|
-
return typeof value === "string" && Object.hasOwn(KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT, value) && KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT[value];
|
|
1778
|
-
};
|
|
1779
|
-
var isKeyframeClipboardEntry = (value) => {
|
|
1780
|
-
return isRecord3(value) && Number.isInteger(value.frameOffset) && Object.hasOwn(value, "value");
|
|
1781
|
-
};
|
|
1782
|
-
var areValidKeyframes = (value) => {
|
|
1783
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
1784
|
-
return false;
|
|
1785
|
-
}
|
|
1786
|
-
let previousOffset = -1;
|
|
1787
|
-
for (const keyframe of value) {
|
|
1788
|
-
if (!isKeyframeClipboardEntry(keyframe) || keyframe.frameOffset <= previousOffset) {
|
|
1789
|
-
return false;
|
|
1790
|
-
}
|
|
1791
|
-
previousOffset = keyframe.frameOffset;
|
|
1792
|
-
}
|
|
1793
|
-
return value[0]?.frameOffset === 0;
|
|
1794
|
-
};
|
|
1795
|
-
var isKeyframeClipboardField = (value) => {
|
|
1796
|
-
return isRecord3(value) && (value.type === "sequence" || value.type === "effect") && typeof value.fieldKey === "string";
|
|
1797
|
-
};
|
|
1798
|
-
var parseEasings = ({
|
|
1799
|
-
value,
|
|
1800
|
-
keyframeCount
|
|
1801
|
-
}) => {
|
|
1802
|
-
if (Array.isArray(value) && value.length === Math.max(0, keyframeCount - 1) && value.every(isKeyframeEasing)) {
|
|
1803
|
-
return value.map(normalizeKeyframeEasing);
|
|
1804
|
-
}
|
|
1805
|
-
return null;
|
|
1806
|
-
};
|
|
1807
|
-
var parseKeyframeClipboardDataResult = (value) => {
|
|
1808
|
-
try {
|
|
1809
|
-
const parsed = JSON.parse(value);
|
|
1810
|
-
if (!isRecord3(parsed) || parsed.remotionClipboard !== "keyframe") {
|
|
1811
|
-
return { status: "invalid" };
|
|
1812
|
-
}
|
|
1813
|
-
if (parsed.version !== 1) {
|
|
1814
|
-
return { status: "unsupported-version", version: parsed.version };
|
|
1815
|
-
}
|
|
1816
|
-
const easing = parseEasings({
|
|
1817
|
-
value: parsed.easing,
|
|
1818
|
-
keyframeCount: Array.isArray(parsed.keyframes) ? parsed.keyframes.length : 0
|
|
1819
|
-
});
|
|
1820
|
-
if (parsed.type !== "keyframe" || !areValidKeyframes(parsed.keyframes) || easing === null || parsed.field !== null && !isKeyframeClipboardField(parsed.field) || parsed.fieldType !== null && !isKeyframeClipboardFieldType(parsed.fieldType)) {
|
|
1821
|
-
return { status: "invalid" };
|
|
1822
|
-
}
|
|
1823
|
-
return {
|
|
1824
|
-
status: "valid",
|
|
1825
|
-
data: {
|
|
1826
|
-
type: "keyframe",
|
|
1827
|
-
version: 1,
|
|
1828
|
-
remotionClipboard: "keyframe",
|
|
1829
|
-
fieldType: parsed.fieldType,
|
|
1830
|
-
field: parsed.field,
|
|
1831
|
-
keyframes: parsed.keyframes,
|
|
1832
|
-
easing
|
|
1833
|
-
}
|
|
1834
|
-
};
|
|
1835
|
-
} catch {
|
|
1836
|
-
return { status: "invalid" };
|
|
1837
|
-
}
|
|
1838
|
-
};
|
|
1839
|
-
var parseKeyframeClipboardData = (value) => {
|
|
1840
|
-
const result = parseKeyframeClipboardDataResult(value);
|
|
1841
|
-
return result.status === "valid" ? result.data : null;
|
|
1842
|
-
};
|
|
1843
2011
|
// src/keyframe-easing-presets.ts
|
|
1844
2012
|
var LINEAR_KEYFRAME_EASING = { type: "linear" };
|
|
1845
2013
|
var HOLD_KEYFRAME_EASING = { type: "step1" };
|
|
@@ -2081,6 +2249,7 @@ var allPackages = [
|
|
|
2081
2249
|
"design",
|
|
2082
2250
|
"studio-protocol",
|
|
2083
2251
|
"light-leaks",
|
|
2252
|
+
"mac-cursors",
|
|
2084
2253
|
"rough-notation",
|
|
2085
2254
|
"starburst",
|
|
2086
2255
|
"vercel",
|
|
@@ -2213,6 +2382,7 @@ var descriptions = {
|
|
|
2213
2382
|
design: "Design system",
|
|
2214
2383
|
"studio-protocol": "Create Element payloads and request installation into Remotion Studio",
|
|
2215
2384
|
"light-leaks": "Light leak effects for Remotion",
|
|
2385
|
+
"mac-cursors": "Internal macOS cursor components for Remotion",
|
|
2216
2386
|
"rough-notation": "Rough annotation primitives for Remotion",
|
|
2217
2387
|
"player-a11y": "Internal accessibility wrapper around @remotion/player",
|
|
2218
2388
|
starburst: "Starburst ray effect for Remotion",
|
|
@@ -2326,6 +2496,7 @@ var installableMap = {
|
|
|
2326
2496
|
packageName: "@remotion/light-leaks",
|
|
2327
2497
|
releaseVersion: VERSION
|
|
2328
2498
|
}),
|
|
2499
|
+
"mac-cursors": false,
|
|
2329
2500
|
"rough-notation": true,
|
|
2330
2501
|
starburst: shouldReleasePackage({
|
|
2331
2502
|
packageName: "@remotion/starburst",
|
|
@@ -2432,6 +2603,7 @@ var apiDocs = {
|
|
|
2432
2603
|
design: "https://www.remotion.dev/design",
|
|
2433
2604
|
"studio-protocol": "https://www.remotion.dev/docs/studio-protocol",
|
|
2434
2605
|
"light-leaks": "https://www.remotion.dev/docs/light-leaks",
|
|
2606
|
+
"mac-cursors": null,
|
|
2435
2607
|
"rough-notation": "https://www.remotion.dev/docs/rough-notation",
|
|
2436
2608
|
starburst: "https://www.remotion.dev/docs/starburst",
|
|
2437
2609
|
vercel: "https://www.remotion.dev/docs/vercel/api",
|
|
@@ -3000,6 +3172,7 @@ var studioHtml = ({
|
|
|
3000
3172
|
installedDependencies,
|
|
3001
3173
|
packageManager,
|
|
3002
3174
|
audioLatencyHint,
|
|
3175
|
+
experimentalKeepAudioContextAlive,
|
|
3003
3176
|
sampleRate,
|
|
3004
3177
|
logLevel,
|
|
3005
3178
|
mode,
|
|
@@ -3024,6 +3197,7 @@ var studioHtml = ({
|
|
|
3024
3197
|
<body>
|
|
3025
3198
|
<script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
|
|
3026
3199
|
<script>window.remotion_audioLatencyHint = "${audioLatencyHint}";</script>
|
|
3200
|
+
<script>window.remotion_experimentalKeepAudioContextAlive = ${experimentalKeepAudioContextAlive};</script>
|
|
3027
3201
|
<script>window.remotion_sampleRate = ${sampleRate};</script>
|
|
3028
3202
|
<script>window.remotion_previewSampleRate = ${sampleRate};</script>
|
|
3029
3203
|
${mode === "dev" ? `<script>window.remotion_logLevel = "${logLevel}";</script>` : ""}
|
|
@@ -3095,6 +3269,10 @@ var addKeyframeToPropStatus = ({
|
|
|
3095
3269
|
schema
|
|
3096
3270
|
}) => {
|
|
3097
3271
|
if (status.status === "keyframed") {
|
|
3272
|
+
const defaultEasing = isSchemaFieldHoldOnly({
|
|
3273
|
+
schema,
|
|
3274
|
+
key: fieldKey
|
|
3275
|
+
}) ? HOLD_KEYFRAME_EASING : LINEAR_KEYFRAME_EASING;
|
|
3098
3276
|
const existingIndex = status.keyframes.findIndex((kf) => kf.frame === frame);
|
|
3099
3277
|
if (existingIndex !== -1) {
|
|
3100
3278
|
const updatedKeyframes = status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
|
|
@@ -3111,10 +3289,10 @@ var addKeyframeToPropStatus = ({
|
|
|
3111
3289
|
easingLength: easing.length,
|
|
3112
3290
|
keyframeCount: keyframes.length
|
|
3113
3291
|
});
|
|
3114
|
-
const easingToDuplicate = easingIndexToDuplicate === null ?
|
|
3292
|
+
const easingToDuplicate = easingIndexToDuplicate === null ? defaultEasing : easing[easingIndexToDuplicate];
|
|
3115
3293
|
easing.splice(insertedKeyframeIndex, 0, easingToDuplicate);
|
|
3116
3294
|
while (easing.length < keyframes.length - 1) {
|
|
3117
|
-
easing.push(
|
|
3295
|
+
easing.push(defaultEasing);
|
|
3118
3296
|
}
|
|
3119
3297
|
return {
|
|
3120
3298
|
...status,
|
|
@@ -3743,6 +3921,8 @@ export {
|
|
|
3743
3921
|
stringifyDefaultProps,
|
|
3744
3922
|
splitAnsi,
|
|
3745
3923
|
parseSpringEasingConfig,
|
|
3924
|
+
parseSequencePropClipboardDataResult,
|
|
3925
|
+
parseSequencePropClipboardData,
|
|
3746
3926
|
parseKeyframeClipboardDataResult,
|
|
3747
3927
|
parseKeyframeClipboardData,
|
|
3748
3928
|
parseEffectPropClipboardDataResult,
|
|
@@ -3751,6 +3931,7 @@ export {
|
|
|
3751
3931
|
parseEffectClipboardData,
|
|
3752
3932
|
parseEasingClipboardDataResult,
|
|
3753
3933
|
parseEasingClipboardData,
|
|
3934
|
+
parseCanvasCaptureData,
|
|
3754
3935
|
packages,
|
|
3755
3936
|
optimisticUpdateSequenceKeyframeSettings,
|
|
3756
3937
|
optimisticUpdateForPropStatuses,
|
|
@@ -3769,6 +3950,7 @@ export {
|
|
|
3769
3950
|
isValidPackageName,
|
|
3770
3951
|
isUrl,
|
|
3771
3952
|
isSchemaFieldKeyframable,
|
|
3953
|
+
isSchemaFieldHoldOnly,
|
|
3772
3954
|
isKeyframeInterpolationFunction,
|
|
3773
3955
|
isKeyframeClipboardFieldType,
|
|
3774
3956
|
isInteractivitySchemaFieldKeyframable,
|
|
@@ -3809,6 +3991,7 @@ export {
|
|
|
3809
3991
|
apiDocs,
|
|
3810
3992
|
SCHEMA_FIELD_ROW_HEIGHT,
|
|
3811
3993
|
SCHEMA_FIELD_GROUPS,
|
|
3994
|
+
REACT_REFRESH_FINISHED_EVENT,
|
|
3812
3995
|
QUAD_KEYFRAME_EASING,
|
|
3813
3996
|
LINEAR_KEYFRAME_EASING,
|
|
3814
3997
|
KEYFRAME_EASING_PRESETS,
|
|
@@ -3819,6 +4002,7 @@ export {
|
|
|
3819
4002
|
DEFAULT_SPRING_EASING,
|
|
3820
4003
|
DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS,
|
|
3821
4004
|
CUBIC_KEYFRAME_EASING,
|
|
4005
|
+
CANVAS_CAPTURE_METADATA_TAG,
|
|
3822
4006
|
BORDER_RADIUS_SHORTHAND_KEY,
|
|
3823
4007
|
BORDER_RADIUS_LONGHAND_KEYS
|
|
3824
4008
|
};
|