@remotion/studio-shared 4.0.508 → 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 +4 -0
- 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 +11 -0
- package/dist/effect-clipboard-data.d.ts +2 -0
- package/dist/effect-clipboard-data.js +8 -6
- package/dist/esm/index.mjs +234 -112
- package/dist/esm/keyframe-interpolation-function.mjs +13 -2
- package/dist/esm/studio-html.mjs +2 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +9 -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/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/package.json +5 -5
package/dist/api-requests.d.ts
CHANGED
|
@@ -270,6 +270,9 @@ export type GoogleFontSourceEdit = {
|
|
|
270
270
|
export type SaveSequencePropSourceEdit = {
|
|
271
271
|
type: 'google-font';
|
|
272
272
|
font: GoogleFontSourceEdit;
|
|
273
|
+
} | {
|
|
274
|
+
type: 'clipboard-param';
|
|
275
|
+
param: EffectClipboardParam;
|
|
273
276
|
};
|
|
274
277
|
export type SaveSequencePropEdit = {
|
|
275
278
|
fileName: string;
|
|
@@ -669,6 +672,7 @@ export type InsertJsxElementRequest = {
|
|
|
669
672
|
};
|
|
670
673
|
export type InsertJsxElementResponse = {
|
|
671
674
|
success: true;
|
|
675
|
+
insertedNodePath: Pick<SequencePropsSubscriptionKey, 'absolutePath' | 'nodePath'> | null;
|
|
672
676
|
nodePathMutation: SequenceNodePathMutation;
|
|
673
677
|
} | {
|
|
674
678
|
success: false;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const CANVAS_CAPTURE_METADATA_TAG = "REMOTION_CAPTURE_DATA";
|
|
2
|
+
export type CanvasCaptureMouseMovement = {
|
|
3
|
+
readonly timeInSeconds: number;
|
|
4
|
+
readonly canvasX: number | null;
|
|
5
|
+
readonly canvasY: number | null;
|
|
6
|
+
readonly cursor: string;
|
|
7
|
+
};
|
|
8
|
+
export type CanvasCapturePointerClick = {
|
|
9
|
+
readonly timeInSeconds: number;
|
|
10
|
+
readonly type: 'pointer-down' | 'pointer-up';
|
|
11
|
+
};
|
|
12
|
+
export type CanvasCaptureData = {
|
|
13
|
+
readonly captureMetadata: {
|
|
14
|
+
readonly density: number;
|
|
15
|
+
};
|
|
16
|
+
readonly mouseMovements: CanvasCaptureMouseMovement[];
|
|
17
|
+
readonly pointerClicks: CanvasCapturePointerClick[];
|
|
18
|
+
};
|
|
19
|
+
export declare const parseCanvasCaptureData: (metadata: unknown) => CanvasCaptureData | null;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCanvasCaptureData = exports.CANVAS_CAPTURE_METADATA_TAG = void 0;
|
|
4
|
+
exports.CANVAS_CAPTURE_METADATA_TAG = 'REMOTION_CAPTURE_DATA';
|
|
5
|
+
const isRecord = (value) => {
|
|
6
|
+
return typeof value === 'object' && value !== null;
|
|
7
|
+
};
|
|
8
|
+
const isFiniteNumber = (value) => {
|
|
9
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
10
|
+
};
|
|
11
|
+
const parseCanvasCaptureData = (metadata) => {
|
|
12
|
+
if (!isRecord(metadata) || !isRecord(metadata.raw)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const rawCaptureData = metadata.raw[exports.CANVAS_CAPTURE_METADATA_TAG];
|
|
16
|
+
if (typeof rawCaptureData !== 'string') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
let parsed;
|
|
20
|
+
try {
|
|
21
|
+
parsed = JSON.parse(rawCaptureData);
|
|
22
|
+
}
|
|
23
|
+
catch (_a) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (!isRecord(parsed) ||
|
|
27
|
+
!isRecord(parsed.captureMetadata) ||
|
|
28
|
+
!isFiniteNumber(parsed.captureMetadata.density) ||
|
|
29
|
+
parsed.captureMetadata.density <= 0 ||
|
|
30
|
+
!Array.isArray(parsed.mouseMovements) ||
|
|
31
|
+
!Array.isArray(parsed.pointerClicks)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const mouseMovements = [];
|
|
35
|
+
for (const movement of parsed.mouseMovements) {
|
|
36
|
+
if (!isRecord(movement) ||
|
|
37
|
+
!isFiniteNumber(movement.timeInSeconds) ||
|
|
38
|
+
movement.timeInSeconds < 0 ||
|
|
39
|
+
(movement.canvasX !== null && !isFiniteNumber(movement.canvasX)) ||
|
|
40
|
+
(movement.canvasY !== null && !isFiniteNumber(movement.canvasY)) ||
|
|
41
|
+
typeof movement.cursor !== 'string') {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
mouseMovements.push({
|
|
45
|
+
timeInSeconds: movement.timeInSeconds,
|
|
46
|
+
canvasX: movement.canvasX,
|
|
47
|
+
canvasY: movement.canvasY,
|
|
48
|
+
cursor: movement.cursor,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const pointerClicks = [];
|
|
52
|
+
for (const click of parsed.pointerClicks) {
|
|
53
|
+
if (!isRecord(click) ||
|
|
54
|
+
!isFiniteNumber(click.timeInSeconds) ||
|
|
55
|
+
click.timeInSeconds < 0 ||
|
|
56
|
+
(click.type !== 'pointer-down' && click.type !== 'pointer-up')) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
pointerClicks.push({
|
|
60
|
+
timeInSeconds: click.timeInSeconds,
|
|
61
|
+
type: click.type,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
captureMetadata: { density: parsed.captureMetadata.density },
|
|
66
|
+
mouseMovements: mouseMovements.sort((a, b) => a.timeInSeconds - b.timeInSeconds),
|
|
67
|
+
pointerClicks: pointerClicks.sort((a, b) => a.timeInSeconds - b.timeInSeconds),
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
exports.parseCanvasCaptureData = parseCanvasCaptureData;
|
package/dist/codemods.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CanvasCaptureData } from './canvas-capture';
|
|
1
2
|
import type { EnumPath } from './stringify-default-props';
|
|
2
3
|
export type VisualControlChange = {
|
|
3
4
|
id: string;
|
|
@@ -20,6 +21,13 @@ export type RecastCodemod = {
|
|
|
20
21
|
newWidth: number;
|
|
21
22
|
newFps: number;
|
|
22
23
|
newDurationInFrames: number;
|
|
24
|
+
canvasCapture: {
|
|
25
|
+
readonly videoFileName: string;
|
|
26
|
+
readonly videoHeight: number;
|
|
27
|
+
readonly videoWidth: number;
|
|
28
|
+
readonly keyframeFps: number;
|
|
29
|
+
readonly data: CanvasCaptureData;
|
|
30
|
+
} | null;
|
|
23
31
|
} | {
|
|
24
32
|
type: 'duplicate-composition';
|
|
25
33
|
idToDuplicate: string;
|
|
@@ -45,6 +45,7 @@ export declare const configMethodLifecycles: {
|
|
|
45
45
|
readonly setEnforceAudioTrack: "runtime";
|
|
46
46
|
readonly setEntryPoint: "restart";
|
|
47
47
|
readonly setEveryNthFrame: "runtime";
|
|
48
|
+
readonly setExperimentalKeepAudioContextAlive: "reload";
|
|
48
49
|
readonly setExperimentalRspackEnabled: "restart";
|
|
49
50
|
readonly setForSeamlessAacConcatenation: "runtime";
|
|
50
51
|
readonly setForceNewStudioEnabled: "restart";
|
|
@@ -48,6 +48,7 @@ exports.configMethodLifecycles = {
|
|
|
48
48
|
setEnforceAudioTrack: 'runtime',
|
|
49
49
|
setEntryPoint: 'restart',
|
|
50
50
|
setEveryNthFrame: 'runtime',
|
|
51
|
+
setExperimentalKeepAudioContextAlive: 'reload',
|
|
51
52
|
setExperimentalRspackEnabled: 'restart',
|
|
52
53
|
setForSeamlessAacConcatenation: 'runtime',
|
|
53
54
|
setForceNewStudioEnabled: 'restart',
|
package/dist/effect-catalog.js
CHANGED
|
@@ -65,6 +65,17 @@ exports.EFFECT_CATALOG = [
|
|
|
65
65
|
config: {},
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
id: 'effects-color-correction',
|
|
70
|
+
category: 'Color',
|
|
71
|
+
label: 'colorCorrection()',
|
|
72
|
+
description: 'Combined primary color adjustments',
|
|
73
|
+
effect: {
|
|
74
|
+
name: 'colorCorrection',
|
|
75
|
+
importPath: '@remotion/effects/color-correction',
|
|
76
|
+
config: {},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
68
79
|
{
|
|
69
80
|
id: 'effects-color-key',
|
|
70
81
|
category: 'Color',
|
|
@@ -67,6 +67,8 @@ export type EffectPropClipboardDataParseResult = {
|
|
|
67
67
|
} | {
|
|
68
68
|
readonly status: 'invalid';
|
|
69
69
|
};
|
|
70
|
+
export declare const normalizeEffectClipboardParam: (param: EffectClipboardParam) => EffectClipboardParam;
|
|
71
|
+
export declare const isEffectClipboardParam: (value: unknown) => value is EffectClipboardParam;
|
|
70
72
|
export declare const parseEffectClipboardDataResult: (value: string) => EffectClipboardDataParseResult;
|
|
71
73
|
export declare const parseEffectClipboardData: (value: string) => EffectClipboardData | null;
|
|
72
74
|
export declare const parseEffectPropClipboardDataResult: (value: string) => EffectPropClipboardDataParseResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseEffectPropClipboardData = exports.parseEffectPropClipboardDataResult = exports.parseEffectClipboardData = exports.parseEffectClipboardDataResult = void 0;
|
|
3
|
+
exports.parseEffectPropClipboardData = exports.parseEffectPropClipboardDataResult = exports.parseEffectClipboardData = exports.parseEffectClipboardDataResult = exports.isEffectClipboardParam = exports.normalizeEffectClipboardParam = void 0;
|
|
4
4
|
const keyframe_interpolation_function_1 = require("./keyframe-interpolation-function");
|
|
5
5
|
const isRecord = (value) => {
|
|
6
6
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -42,7 +42,7 @@ const normalizeEasing = (easing) => {
|
|
|
42
42
|
durationRestThreshold: (_b = easing.durationRestThreshold) !== null && _b !== void 0 ? _b : null,
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
const
|
|
45
|
+
const normalizeEffectClipboardParam = (param) => {
|
|
46
46
|
if (param.type === 'static') {
|
|
47
47
|
return param;
|
|
48
48
|
}
|
|
@@ -51,12 +51,13 @@ const normalizeParam = (param) => {
|
|
|
51
51
|
easing: param.easing.map(normalizeEasing),
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
+
exports.normalizeEffectClipboardParam = normalizeEffectClipboardParam;
|
|
54
55
|
const normalizeSnapshot = (snapshot) => {
|
|
55
56
|
return {
|
|
56
57
|
...snapshot,
|
|
57
58
|
params: Object.fromEntries(Object.entries(snapshot.params).map(([key, param]) => [
|
|
58
59
|
key,
|
|
59
|
-
|
|
60
|
+
(0, exports.normalizeEffectClipboardParam)(param),
|
|
60
61
|
])),
|
|
61
62
|
};
|
|
62
63
|
};
|
|
@@ -100,6 +101,7 @@ const isEffectClipboardParam = (value) => {
|
|
|
100
101
|
outputOptions.has(output))) &&
|
|
101
102
|
(posterize === undefined || (isFiniteNumber(posterize) && posterize > 0)));
|
|
102
103
|
};
|
|
104
|
+
exports.isEffectClipboardParam = isEffectClipboardParam;
|
|
103
105
|
const isEffectClipboardSnapshotV3 = (value) => {
|
|
104
106
|
if (!isRecord(value)) {
|
|
105
107
|
return false;
|
|
@@ -107,7 +109,7 @@ const isEffectClipboardSnapshotV3 = (value) => {
|
|
|
107
109
|
return (typeof value.callee === 'string' &&
|
|
108
110
|
typeof value.importPath === 'string' &&
|
|
109
111
|
isRecord(value.params) &&
|
|
110
|
-
Object.values(value.params).every(isEffectClipboardParam));
|
|
112
|
+
Object.values(value.params).every(exports.isEffectClipboardParam));
|
|
111
113
|
};
|
|
112
114
|
const parseEffectClipboardDataResult = (value) => {
|
|
113
115
|
try {
|
|
@@ -189,7 +191,7 @@ const parseEffectPropClipboardDataResult = (value) => {
|
|
|
189
191
|
if (typeof parsed.key !== 'string') {
|
|
190
192
|
return { status: 'invalid' };
|
|
191
193
|
}
|
|
192
|
-
if (!isEffectClipboardParam(parsed.param)) {
|
|
194
|
+
if (!(0, exports.isEffectClipboardParam)(parsed.param)) {
|
|
193
195
|
return { status: 'invalid' };
|
|
194
196
|
}
|
|
195
197
|
return {
|
|
@@ -203,7 +205,7 @@ const parseEffectPropClipboardDataResult = (value) => {
|
|
|
203
205
|
importPath: parsed.effect.importPath,
|
|
204
206
|
},
|
|
205
207
|
key: parsed.key,
|
|
206
|
-
param:
|
|
208
|
+
param: (0, exports.normalizeEffectClipboardParam)(parsed.param),
|
|
207
209
|
},
|
|
208
210
|
};
|
|
209
211
|
}
|
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) {
|
|
@@ -110,6 +163,7 @@ var configMethodLifecycles = {
|
|
|
110
163
|
setEnforceAudioTrack: "runtime",
|
|
111
164
|
setEntryPoint: "restart",
|
|
112
165
|
setEveryNthFrame: "runtime",
|
|
166
|
+
setExperimentalKeepAudioContextAlive: "reload",
|
|
113
167
|
setExperimentalRspackEnabled: "restart",
|
|
114
168
|
setForSeamlessAacConcatenation: "runtime",
|
|
115
169
|
setForceNewStudioEnabled: "restart",
|
|
@@ -465,14 +519,14 @@ var detectFileType = (data) => {
|
|
|
465
519
|
return { type: "unknown" };
|
|
466
520
|
};
|
|
467
521
|
// src/easing-clipboard-data.ts
|
|
468
|
-
var
|
|
522
|
+
var isRecord2 = (value) => {
|
|
469
523
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
470
524
|
};
|
|
471
|
-
var
|
|
525
|
+
var isFiniteNumber2 = (value) => {
|
|
472
526
|
return typeof value === "number" && Number.isFinite(value);
|
|
473
527
|
};
|
|
474
528
|
var isKeyframeEasing = (value) => {
|
|
475
|
-
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");
|
|
476
530
|
};
|
|
477
531
|
var normalizeKeyframeEasing = (easing) => {
|
|
478
532
|
if (easing.type !== "spring") {
|
|
@@ -487,7 +541,7 @@ var normalizeKeyframeEasing = (easing) => {
|
|
|
487
541
|
var parseEasingClipboardDataResult = (value) => {
|
|
488
542
|
try {
|
|
489
543
|
const parsed = JSON.parse(value);
|
|
490
|
-
if (!
|
|
544
|
+
if (!isRecord2(parsed)) {
|
|
491
545
|
return { status: "invalid" };
|
|
492
546
|
}
|
|
493
547
|
if (parsed.remotionClipboard !== "easing") {
|
|
@@ -577,6 +631,17 @@ var EFFECT_CATALOG = [
|
|
|
577
631
|
config: {}
|
|
578
632
|
}
|
|
579
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
|
+
},
|
|
580
645
|
{
|
|
581
646
|
id: "effects-color-key",
|
|
582
647
|
category: "Color",
|
|
@@ -1366,7 +1431,7 @@ var KEYFRAME_FIELD_TYPE_SUPPORT = {
|
|
|
1366
1431
|
boolean: false,
|
|
1367
1432
|
"remotion-captions": false,
|
|
1368
1433
|
color: true,
|
|
1369
|
-
enum:
|
|
1434
|
+
enum: true,
|
|
1370
1435
|
"font-family": false,
|
|
1371
1436
|
hidden: true,
|
|
1372
1437
|
number: true,
|
|
@@ -1384,7 +1449,7 @@ var KEYFRAME_FIELD_TYPE_INTERPOLATION = {
|
|
|
1384
1449
|
boolean: "unsupported",
|
|
1385
1450
|
"remotion-captions": "unsupported",
|
|
1386
1451
|
color: "interpolateColors",
|
|
1387
|
-
enum: "
|
|
1452
|
+
enum: "interpolate",
|
|
1388
1453
|
"font-family": "unsupported",
|
|
1389
1454
|
hidden: "infer",
|
|
1390
1455
|
number: "infer",
|
|
@@ -1408,6 +1473,9 @@ var isInteractivitySchemaFieldKeyframable = (field) => {
|
|
|
1408
1473
|
if (!field) {
|
|
1409
1474
|
return true;
|
|
1410
1475
|
}
|
|
1476
|
+
if (field.type === "enum") {
|
|
1477
|
+
return field.keyframable === true;
|
|
1478
|
+
}
|
|
1411
1479
|
return KEYFRAME_FIELD_TYPE_SUPPORT[field.type] && field.keyframable !== false;
|
|
1412
1480
|
};
|
|
1413
1481
|
var findFieldInSchema = (schema, key) => {
|
|
@@ -1434,6 +1502,13 @@ var isSchemaFieldKeyframable = ({
|
|
|
1434
1502
|
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
1435
1503
|
return isInteractivitySchemaFieldKeyframable(field);
|
|
1436
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
|
+
};
|
|
1437
1512
|
var getKeyframeInterpolationFunctionForSchemaField = ({
|
|
1438
1513
|
schema,
|
|
1439
1514
|
key
|
|
@@ -1462,16 +1537,16 @@ var getKeyframeInterpolationFunction = ({
|
|
|
1462
1537
|
};
|
|
1463
1538
|
|
|
1464
1539
|
// src/effect-clipboard-data.ts
|
|
1465
|
-
var
|
|
1540
|
+
var isRecord3 = (value) => {
|
|
1466
1541
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1467
1542
|
};
|
|
1468
1543
|
var extrapolateTypes = new Set(["extend", "identity", "clamp", "wrap"]);
|
|
1469
1544
|
var outputOptions = new Set(["linear", "perceptual-scale"]);
|
|
1470
|
-
var
|
|
1545
|
+
var isFiniteNumber3 = (value) => {
|
|
1471
1546
|
return typeof value === "number" && Number.isFinite(value);
|
|
1472
1547
|
};
|
|
1473
1548
|
var isEasing = (value) => {
|
|
1474
|
-
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");
|
|
1475
1550
|
};
|
|
1476
1551
|
var normalizeEasing = (easing) => {
|
|
1477
1552
|
if (easing.type !== "spring") {
|
|
@@ -1483,7 +1558,7 @@ var normalizeEasing = (easing) => {
|
|
|
1483
1558
|
durationRestThreshold: easing.durationRestThreshold ?? null
|
|
1484
1559
|
};
|
|
1485
1560
|
};
|
|
1486
|
-
var
|
|
1561
|
+
var normalizeEffectClipboardParam = (param) => {
|
|
1487
1562
|
if (param.type === "static") {
|
|
1488
1563
|
return param;
|
|
1489
1564
|
}
|
|
@@ -1497,18 +1572,18 @@ var normalizeSnapshot = (snapshot) => {
|
|
|
1497
1572
|
...snapshot,
|
|
1498
1573
|
params: Object.fromEntries(Object.entries(snapshot.params).map(([key, param]) => [
|
|
1499
1574
|
key,
|
|
1500
|
-
|
|
1575
|
+
normalizeEffectClipboardParam(param)
|
|
1501
1576
|
]))
|
|
1502
1577
|
};
|
|
1503
1578
|
};
|
|
1504
1579
|
var isKeyframe = (value) => {
|
|
1505
|
-
return
|
|
1580
|
+
return isRecord3(value) && isFiniteNumber3(value.frame) && "value" in value;
|
|
1506
1581
|
};
|
|
1507
1582
|
var isClamping = (value) => {
|
|
1508
|
-
return
|
|
1583
|
+
return isRecord3(value) && typeof value.left === "string" && extrapolateTypes.has(value.left) && typeof value.right === "string" && extrapolateTypes.has(value.right);
|
|
1509
1584
|
};
|
|
1510
1585
|
var isEffectClipboardParam = (value) => {
|
|
1511
|
-
if (!
|
|
1586
|
+
if (!isRecord3(value)) {
|
|
1512
1587
|
return false;
|
|
1513
1588
|
}
|
|
1514
1589
|
if (value.type === "static") {
|
|
@@ -1520,18 +1595,18 @@ var isEffectClipboardParam = (value) => {
|
|
|
1520
1595
|
const { posterize } = value;
|
|
1521
1596
|
const { output } = value;
|
|
1522
1597
|
const easingLength = Array.isArray(value.keyframes) && value.keyframes.length > 0 ? value.keyframes.length - 1 : null;
|
|
1523
|
-
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);
|
|
1524
1599
|
};
|
|
1525
1600
|
var isEffectClipboardSnapshotV3 = (value) => {
|
|
1526
|
-
if (!
|
|
1601
|
+
if (!isRecord3(value)) {
|
|
1527
1602
|
return false;
|
|
1528
1603
|
}
|
|
1529
|
-
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);
|
|
1530
1605
|
};
|
|
1531
1606
|
var parseEffectClipboardDataResult = (value) => {
|
|
1532
1607
|
try {
|
|
1533
1608
|
const parsed = JSON.parse(value);
|
|
1534
|
-
if (!
|
|
1609
|
+
if (!isRecord3(parsed)) {
|
|
1535
1610
|
return { status: "invalid" };
|
|
1536
1611
|
}
|
|
1537
1612
|
if (parsed.remotionClipboard !== "effects") {
|
|
@@ -1579,7 +1654,7 @@ var parseEffectClipboardData = (value) => {
|
|
|
1579
1654
|
var parseEffectPropClipboardDataResult = (value) => {
|
|
1580
1655
|
try {
|
|
1581
1656
|
const parsed = JSON.parse(value);
|
|
1582
|
-
if (!
|
|
1657
|
+
if (!isRecord3(parsed)) {
|
|
1583
1658
|
return { status: "invalid" };
|
|
1584
1659
|
}
|
|
1585
1660
|
if (parsed.remotionClipboard !== "effect-prop") {
|
|
@@ -1594,7 +1669,7 @@ var parseEffectPropClipboardDataResult = (value) => {
|
|
|
1594
1669
|
if (parsed.type !== "effect-prop") {
|
|
1595
1670
|
return { status: "invalid" };
|
|
1596
1671
|
}
|
|
1597
|
-
if (!
|
|
1672
|
+
if (!isRecord3(parsed.effect)) {
|
|
1598
1673
|
return { status: "invalid" };
|
|
1599
1674
|
}
|
|
1600
1675
|
if (typeof parsed.effect.callee !== "string" || typeof parsed.effect.importPath !== "string") {
|
|
@@ -1617,7 +1692,7 @@ var parseEffectPropClipboardDataResult = (value) => {
|
|
|
1617
1692
|
importPath: parsed.effect.importPath
|
|
1618
1693
|
},
|
|
1619
1694
|
key: parsed.key,
|
|
1620
|
-
param:
|
|
1695
|
+
param: normalizeEffectClipboardParam(parsed.param)
|
|
1621
1696
|
}
|
|
1622
1697
|
};
|
|
1623
1698
|
} catch {
|
|
@@ -1631,6 +1706,131 @@ var parseEffectPropClipboardData = (value) => {
|
|
|
1631
1706
|
}
|
|
1632
1707
|
return result.data;
|
|
1633
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
|
+
};
|
|
1634
1834
|
// src/format-bytes.ts
|
|
1635
1835
|
var BYTE_UNITS = ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
1636
1836
|
var BIBYTE_UNITS = [
|
|
@@ -1808,95 +2008,6 @@ var hotMiddlewareOptions = {
|
|
|
1808
2008
|
reload: true,
|
|
1809
2009
|
warn: true
|
|
1810
2010
|
};
|
|
1811
|
-
// src/keyframe-clipboard-data.ts
|
|
1812
|
-
var KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT = {
|
|
1813
|
-
array: false,
|
|
1814
|
-
asset: false,
|
|
1815
|
-
boolean: false,
|
|
1816
|
-
"remotion-captions": false,
|
|
1817
|
-
color: true,
|
|
1818
|
-
enum: false,
|
|
1819
|
-
"font-family": false,
|
|
1820
|
-
hidden: false,
|
|
1821
|
-
number: true,
|
|
1822
|
-
"rotation-css": true,
|
|
1823
|
-
"rotation-degrees": true,
|
|
1824
|
-
scale: true,
|
|
1825
|
-
"text-content": false,
|
|
1826
|
-
"transform-origin": true,
|
|
1827
|
-
translate: true,
|
|
1828
|
-
"uv-coordinate": true
|
|
1829
|
-
};
|
|
1830
|
-
var isRecord3 = (value) => {
|
|
1831
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1832
|
-
};
|
|
1833
|
-
var isKeyframeClipboardFieldType = (value) => {
|
|
1834
|
-
return typeof value === "string" && Object.hasOwn(KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT, value) && KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT[value];
|
|
1835
|
-
};
|
|
1836
|
-
var isKeyframeClipboardEntry = (value) => {
|
|
1837
|
-
return isRecord3(value) && Number.isInteger(value.frameOffset) && Object.hasOwn(value, "value");
|
|
1838
|
-
};
|
|
1839
|
-
var areValidKeyframes = (value) => {
|
|
1840
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
1841
|
-
return false;
|
|
1842
|
-
}
|
|
1843
|
-
let previousOffset = -1;
|
|
1844
|
-
for (const keyframe of value) {
|
|
1845
|
-
if (!isKeyframeClipboardEntry(keyframe) || keyframe.frameOffset <= previousOffset) {
|
|
1846
|
-
return false;
|
|
1847
|
-
}
|
|
1848
|
-
previousOffset = keyframe.frameOffset;
|
|
1849
|
-
}
|
|
1850
|
-
return value[0]?.frameOffset === 0;
|
|
1851
|
-
};
|
|
1852
|
-
var isKeyframeClipboardField = (value) => {
|
|
1853
|
-
return isRecord3(value) && (value.type === "sequence" || value.type === "effect") && typeof value.fieldKey === "string";
|
|
1854
|
-
};
|
|
1855
|
-
var parseEasings = ({
|
|
1856
|
-
value,
|
|
1857
|
-
keyframeCount
|
|
1858
|
-
}) => {
|
|
1859
|
-
if (Array.isArray(value) && value.length === Math.max(0, keyframeCount - 1) && value.every(isKeyframeEasing)) {
|
|
1860
|
-
return value.map(normalizeKeyframeEasing);
|
|
1861
|
-
}
|
|
1862
|
-
return null;
|
|
1863
|
-
};
|
|
1864
|
-
var parseKeyframeClipboardDataResult = (value) => {
|
|
1865
|
-
try {
|
|
1866
|
-
const parsed = JSON.parse(value);
|
|
1867
|
-
if (!isRecord3(parsed) || parsed.remotionClipboard !== "keyframe") {
|
|
1868
|
-
return { status: "invalid" };
|
|
1869
|
-
}
|
|
1870
|
-
if (parsed.version !== 1) {
|
|
1871
|
-
return { status: "unsupported-version", version: parsed.version };
|
|
1872
|
-
}
|
|
1873
|
-
const easing = parseEasings({
|
|
1874
|
-
value: parsed.easing,
|
|
1875
|
-
keyframeCount: Array.isArray(parsed.keyframes) ? parsed.keyframes.length : 0
|
|
1876
|
-
});
|
|
1877
|
-
if (parsed.type !== "keyframe" || !areValidKeyframes(parsed.keyframes) || easing === null || parsed.field !== null && !isKeyframeClipboardField(parsed.field) || parsed.fieldType !== null && !isKeyframeClipboardFieldType(parsed.fieldType)) {
|
|
1878
|
-
return { status: "invalid" };
|
|
1879
|
-
}
|
|
1880
|
-
return {
|
|
1881
|
-
status: "valid",
|
|
1882
|
-
data: {
|
|
1883
|
-
type: "keyframe",
|
|
1884
|
-
version: 1,
|
|
1885
|
-
remotionClipboard: "keyframe",
|
|
1886
|
-
fieldType: parsed.fieldType,
|
|
1887
|
-
field: parsed.field,
|
|
1888
|
-
keyframes: parsed.keyframes,
|
|
1889
|
-
easing
|
|
1890
|
-
}
|
|
1891
|
-
};
|
|
1892
|
-
} catch {
|
|
1893
|
-
return { status: "invalid" };
|
|
1894
|
-
}
|
|
1895
|
-
};
|
|
1896
|
-
var parseKeyframeClipboardData = (value) => {
|
|
1897
|
-
const result = parseKeyframeClipboardDataResult(value);
|
|
1898
|
-
return result.status === "valid" ? result.data : null;
|
|
1899
|
-
};
|
|
1900
2011
|
// src/keyframe-easing-presets.ts
|
|
1901
2012
|
var LINEAR_KEYFRAME_EASING = { type: "linear" };
|
|
1902
2013
|
var HOLD_KEYFRAME_EASING = { type: "step1" };
|
|
@@ -3061,6 +3172,7 @@ var studioHtml = ({
|
|
|
3061
3172
|
installedDependencies,
|
|
3062
3173
|
packageManager,
|
|
3063
3174
|
audioLatencyHint,
|
|
3175
|
+
experimentalKeepAudioContextAlive,
|
|
3064
3176
|
sampleRate,
|
|
3065
3177
|
logLevel,
|
|
3066
3178
|
mode,
|
|
@@ -3085,6 +3197,7 @@ var studioHtml = ({
|
|
|
3085
3197
|
<body>
|
|
3086
3198
|
<script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
|
|
3087
3199
|
<script>window.remotion_audioLatencyHint = "${audioLatencyHint}";</script>
|
|
3200
|
+
<script>window.remotion_experimentalKeepAudioContextAlive = ${experimentalKeepAudioContextAlive};</script>
|
|
3088
3201
|
<script>window.remotion_sampleRate = ${sampleRate};</script>
|
|
3089
3202
|
<script>window.remotion_previewSampleRate = ${sampleRate};</script>
|
|
3090
3203
|
${mode === "dev" ? `<script>window.remotion_logLevel = "${logLevel}";</script>` : ""}
|
|
@@ -3156,6 +3269,10 @@ var addKeyframeToPropStatus = ({
|
|
|
3156
3269
|
schema
|
|
3157
3270
|
}) => {
|
|
3158
3271
|
if (status.status === "keyframed") {
|
|
3272
|
+
const defaultEasing = isSchemaFieldHoldOnly({
|
|
3273
|
+
schema,
|
|
3274
|
+
key: fieldKey
|
|
3275
|
+
}) ? HOLD_KEYFRAME_EASING : LINEAR_KEYFRAME_EASING;
|
|
3159
3276
|
const existingIndex = status.keyframes.findIndex((kf) => kf.frame === frame);
|
|
3160
3277
|
if (existingIndex !== -1) {
|
|
3161
3278
|
const updatedKeyframes = status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
|
|
@@ -3172,10 +3289,10 @@ var addKeyframeToPropStatus = ({
|
|
|
3172
3289
|
easingLength: easing.length,
|
|
3173
3290
|
keyframeCount: keyframes.length
|
|
3174
3291
|
});
|
|
3175
|
-
const easingToDuplicate = easingIndexToDuplicate === null ?
|
|
3292
|
+
const easingToDuplicate = easingIndexToDuplicate === null ? defaultEasing : easing[easingIndexToDuplicate];
|
|
3176
3293
|
easing.splice(insertedKeyframeIndex, 0, easingToDuplicate);
|
|
3177
3294
|
while (easing.length < keyframes.length - 1) {
|
|
3178
|
-
easing.push(
|
|
3295
|
+
easing.push(defaultEasing);
|
|
3179
3296
|
}
|
|
3180
3297
|
return {
|
|
3181
3298
|
...status,
|
|
@@ -3804,6 +3921,8 @@ export {
|
|
|
3804
3921
|
stringifyDefaultProps,
|
|
3805
3922
|
splitAnsi,
|
|
3806
3923
|
parseSpringEasingConfig,
|
|
3924
|
+
parseSequencePropClipboardDataResult,
|
|
3925
|
+
parseSequencePropClipboardData,
|
|
3807
3926
|
parseKeyframeClipboardDataResult,
|
|
3808
3927
|
parseKeyframeClipboardData,
|
|
3809
3928
|
parseEffectPropClipboardDataResult,
|
|
@@ -3812,6 +3931,7 @@ export {
|
|
|
3812
3931
|
parseEffectClipboardData,
|
|
3813
3932
|
parseEasingClipboardDataResult,
|
|
3814
3933
|
parseEasingClipboardData,
|
|
3934
|
+
parseCanvasCaptureData,
|
|
3815
3935
|
packages,
|
|
3816
3936
|
optimisticUpdateSequenceKeyframeSettings,
|
|
3817
3937
|
optimisticUpdateForPropStatuses,
|
|
@@ -3830,6 +3950,7 @@ export {
|
|
|
3830
3950
|
isValidPackageName,
|
|
3831
3951
|
isUrl,
|
|
3832
3952
|
isSchemaFieldKeyframable,
|
|
3953
|
+
isSchemaFieldHoldOnly,
|
|
3833
3954
|
isKeyframeInterpolationFunction,
|
|
3834
3955
|
isKeyframeClipboardFieldType,
|
|
3835
3956
|
isInteractivitySchemaFieldKeyframable,
|
|
@@ -3881,6 +4002,7 @@ export {
|
|
|
3881
4002
|
DEFAULT_SPRING_EASING,
|
|
3882
4003
|
DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS,
|
|
3883
4004
|
CUBIC_KEYFRAME_EASING,
|
|
4005
|
+
CANVAS_CAPTURE_METADATA_TAG,
|
|
3884
4006
|
BORDER_RADIUS_SHORTHAND_KEY,
|
|
3885
4007
|
BORDER_RADIUS_LONGHAND_KEYS
|
|
3886
4008
|
};
|
|
@@ -9,7 +9,7 @@ var KEYFRAME_FIELD_TYPE_SUPPORT = {
|
|
|
9
9
|
boolean: false,
|
|
10
10
|
"remotion-captions": false,
|
|
11
11
|
color: true,
|
|
12
|
-
enum:
|
|
12
|
+
enum: true,
|
|
13
13
|
"font-family": false,
|
|
14
14
|
hidden: true,
|
|
15
15
|
number: true,
|
|
@@ -27,7 +27,7 @@ var KEYFRAME_FIELD_TYPE_INTERPOLATION = {
|
|
|
27
27
|
boolean: "unsupported",
|
|
28
28
|
"remotion-captions": "unsupported",
|
|
29
29
|
color: "interpolateColors",
|
|
30
|
-
enum: "
|
|
30
|
+
enum: "interpolate",
|
|
31
31
|
"font-family": "unsupported",
|
|
32
32
|
hidden: "infer",
|
|
33
33
|
number: "infer",
|
|
@@ -51,6 +51,9 @@ var isInteractivitySchemaFieldKeyframable = (field) => {
|
|
|
51
51
|
if (!field) {
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
|
+
if (field.type === "enum") {
|
|
55
|
+
return field.keyframable === true;
|
|
56
|
+
}
|
|
54
57
|
return KEYFRAME_FIELD_TYPE_SUPPORT[field.type] && field.keyframable !== false;
|
|
55
58
|
};
|
|
56
59
|
var findFieldInSchema = (schema, key) => {
|
|
@@ -77,6 +80,13 @@ var isSchemaFieldKeyframable = ({
|
|
|
77
80
|
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
78
81
|
return isInteractivitySchemaFieldKeyframable(field);
|
|
79
82
|
};
|
|
83
|
+
var isSchemaFieldHoldOnly = ({
|
|
84
|
+
schema,
|
|
85
|
+
key
|
|
86
|
+
}) => {
|
|
87
|
+
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
88
|
+
return field?.type === "enum" && field.keyframable === true;
|
|
89
|
+
};
|
|
80
90
|
var getKeyframeInterpolationFunctionForSchemaField = ({
|
|
81
91
|
schema,
|
|
82
92
|
key
|
|
@@ -106,6 +116,7 @@ var getKeyframeInterpolationFunction = ({
|
|
|
106
116
|
export {
|
|
107
117
|
keyframeInterpolationFunctions,
|
|
108
118
|
isSchemaFieldKeyframable,
|
|
119
|
+
isSchemaFieldHoldOnly,
|
|
109
120
|
isKeyframeInterpolationFunction,
|
|
110
121
|
isInteractivitySchemaFieldKeyframable,
|
|
111
122
|
getKeyframeInterpolationFunctionForSchemaField,
|
package/dist/esm/studio-html.mjs
CHANGED
|
@@ -22,6 +22,7 @@ var studioHtml = ({
|
|
|
22
22
|
installedDependencies,
|
|
23
23
|
packageManager,
|
|
24
24
|
audioLatencyHint,
|
|
25
|
+
experimentalKeepAudioContextAlive,
|
|
25
26
|
sampleRate,
|
|
26
27
|
logLevel,
|
|
27
28
|
mode,
|
|
@@ -46,6 +47,7 @@ var studioHtml = ({
|
|
|
46
47
|
<body>
|
|
47
48
|
<script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
|
|
48
49
|
<script>window.remotion_audioLatencyHint = "${audioLatencyHint}";</script>
|
|
50
|
+
<script>window.remotion_experimentalKeepAudioContextAlive = ${experimentalKeepAudioContextAlive};</script>
|
|
49
51
|
<script>window.remotion_sampleRate = ${sampleRate};</script>
|
|
50
52
|
<script>window.remotion_previewSampleRate = ${sampleRate};</script>
|
|
51
53
|
${mode === "dev" ? `<script>window.remotion_logLevel = "${logLevel}";</script>` : ""}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { splitAnsi, stripAnsi } from './ansi';
|
|
|
2
2
|
export type { TerminalId } from './terminal';
|
|
3
3
|
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddEffectRequest, AddEffectResponse, AddKeyframesRequest, AddKeyframesResponse, AddRenderRequest, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, BatchUpdateEffectKeyframeSettings, BatchUpdateKeyframeSettingsRequest, BatchUpdateKeyframeSettingsResponse, BatchUpdateSequenceKeyframeSettings, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, CancelRenderResponse, CaptionPatch, CompositionComponentInfoRequest, CompositionComponentInfoResponse, ConvertFigmaClipboardToSvgRequest, ConvertFigmaClipboardToSvgResponse, CopyRenderOutputToAssetRequest, CopyRenderOutputToAssetResponse, CopyStillToClipboardRequest, DeleteEffectKeyframe, DeleteEffectRequest, DeleteEffectRequestItem, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeRequestItem, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, DeleteStaticFileRequest, DeleteStaticFileResponse, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, DuplicateEffectRequest, DuplicateEffectRequestItem, DuplicateEffectResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, EditorPickerId, ElementInstallExpectedFileState, ElementInstallRequest, ElementInstallSource, FindInFileRequest, FindInFileResponse, GetDefaultCodingAgentInfoRequest, GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoRequest, GetDefaultEditorInfoResponse, GoogleFontSourceEdit, InsertElementFileConflict, InsertElementRequest, InsertElementResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertableCompositionElement, InsertableCompositionElementPosition, InstallPackageRequest, InstallPackageResponse, LogStudioErrorRequest, LogStudioErrorResponse, MoveEffectKeyframe, MoveKeyframesRequest, MoveKeyframesResponse, MoveSequenceKeyframe, OpenInCodingAgentRequest, OpenInCodingAgentResponse, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, OpenInTerminalRequest, OpenInTerminalResponse, PackageInstallSpec, PasteEffectsRequest, PasteEffectsResponse, PrepareElementInstallRequest, PrepareElementInstallResponse, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveInlineCaptionPatchesRequest, SaveMultipleEffectPropsEdit, SaveMultipleEffectPropsRequest, SaveMultipleEffectPropsResponse, SaveMultipleEffectPropsResult, SaveSequencePropEdit, SaveSequencePropSourceEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SplitJsxSequenceRequest, SplitJsxSequenceResponse, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateConfigRequest, UpdateConfigResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateElementInstallTargetRequest, UpdateElementInstallTargetResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse, type AddEffectKeyframe, type AddSequenceKeyframe, type ConfigUpdate, type ConfigValue, type KeyframeSettings, } from './api-requests';
|
|
4
4
|
export type { BrowserStudioOperations } from './browser-studio-operations';
|
|
5
|
+
export type { CanvasCaptureData, CanvasCaptureMouseMovement, CanvasCapturePointerClick, } from './canvas-capture';
|
|
6
|
+
export { CANVAS_CAPTURE_METADATA_TAG, parseCanvasCaptureData, } from './canvas-capture';
|
|
5
7
|
export type { SequenceNodePathMutation, SequenceNodePathRemapping, } from './sequence-node-path-mutation';
|
|
6
8
|
export type { ApplyVisualControlCodemod, RecastCodemod } from './codemods';
|
|
7
9
|
export { compositionDragDataToSymbolicatedStack } from './composition-drag-data';
|
|
@@ -13,6 +15,7 @@ export { detectFileType, isImageFileType, type FileDimensions, type FileType, ty
|
|
|
13
15
|
export { parseEasingClipboardData, parseEasingClipboardDataResult, type EasingClipboardData, type EasingClipboardDataParseResult, } from './easing-clipboard-data';
|
|
14
16
|
export { EFFECT_CATALOG, getEffectCatalogCategories, getEffectDocumentationLink, getEffectDocumentationPath, getEffectPreviewAlt, getEffectPreviewSource, type EffectCatalogCategory, type EffectCatalogItem, } from './effect-catalog';
|
|
15
17
|
export { parseEffectClipboardData, parseEffectClipboardDataResult, parseEffectPropClipboardData, parseEffectPropClipboardDataResult, type EffectClipboardClamping, type EffectClipboardData, type EffectClipboardDataParseResult, type EffectClipboardEasing, type EffectClipboardExtrapolateType, type EffectClipboardInterpolationFunction, type EffectClipboardKeyframe, type EffectClipboardKeyframedParam, type EffectClipboardParam, type EffectClipboardPasteType, type EffectClipboardSnapshot, type EffectClipboardStaticParam, type EffectPropClipboardData, type EffectPropClipboardDataParseResult, } from './effect-clipboard-data';
|
|
18
|
+
export { parseSequencePropClipboardData, parseSequencePropClipboardDataResult, type SequencePropClipboardData, type SequencePropClipboardDataParseResult, } from './sequence-prop-clipboard-data';
|
|
16
19
|
export { EventSourceEvent } from './event-source-event';
|
|
17
20
|
export { formatBytes } from './format-bytes';
|
|
18
21
|
export { getAllSchemaKeys, getAssetSchemaKeys } from './get-all-keys';
|
|
@@ -23,7 +26,7 @@ export type { GitSource } from './git-source';
|
|
|
23
26
|
export { HotMiddlewareMessage, HotMiddlewareOptions, ModuleMap, hotMiddlewareOptions, } from './hot-middleware';
|
|
24
27
|
export { isKeyframeClipboardFieldType, parseKeyframeClipboardData, parseKeyframeClipboardDataResult, type KeyframeClipboardData, type KeyframeClipboardDataParseResult, type KeyframeClipboardFieldType, } from './keyframe-clipboard-data';
|
|
25
28
|
export { CUBIC_KEYFRAME_EASING, EASE_KEYFRAME_EASING, HOLD_KEYFRAME_EASING, KEYFRAME_EASING_PRESETS, LINEAR_KEYFRAME_EASING, QUAD_KEYFRAME_EASING, getBackKeyframeEasing, getOutKeyframeEasing, getPolyKeyframeEasing, type KeyframeEasing, type KeyframeEasingPreset, } from './keyframe-easing-presets';
|
|
26
|
-
export { canEditEasingForInterpolationFunction, getKeyframeInterpolationFunction, getKeyframeInterpolationFunctionForSchemaField, isInteractivitySchemaFieldKeyframable, isKeyframeInterpolationFunction, isSchemaFieldKeyframable, keyframeInterpolationFunctions, type KeyframeInterpolationFunction, } from './keyframe-interpolation-function';
|
|
29
|
+
export { canEditEasingForInterpolationFunction, getKeyframeInterpolationFunction, isSchemaFieldHoldOnly, getKeyframeInterpolationFunctionForSchemaField, isInteractivitySchemaFieldKeyframable, isKeyframeInterpolationFunction, isSchemaFieldKeyframable, keyframeInterpolationFunctions, type KeyframeInterpolationFunction, } from './keyframe-interpolation-function';
|
|
27
30
|
export { DEFAULT_TIMELINE_TRACKS } from './max-timeline-tracks';
|
|
28
31
|
export { Pkgs, apiDocs, descriptions, extraPackages, installableMap, packages, type ExtraPackage, } from './package-info';
|
|
29
32
|
export { PackageManager } from './package-manager';
|
package/dist/index.js
CHANGED
|
@@ -14,12 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.getStylePropertyLonghandKeys = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_GROUPS = exports.isValidPackageName = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForEffectImportPath = exports.parseSpringEasingConfig = exports.DEFAULT_SPRING_EASING = exports.packages = exports.installableMap = exports.extraPackages = void 0;
|
|
17
|
+
exports.isKeyframeInterpolationFunction = exports.isInteractivitySchemaFieldKeyframable = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldHoldOnly = exports.getKeyframeInterpolationFunction = exports.canEditEasingForInterpolationFunction = exports.getPolyKeyframeEasing = exports.getOutKeyframeEasing = exports.getBackKeyframeEasing = exports.QUAD_KEYFRAME_EASING = exports.LINEAR_KEYFRAME_EASING = exports.KEYFRAME_EASING_PRESETS = exports.HOLD_KEYFRAME_EASING = exports.EASE_KEYFRAME_EASING = exports.CUBIC_KEYFRAME_EASING = exports.parseKeyframeClipboardDataResult = exports.parseKeyframeClipboardData = exports.isKeyframeClipboardFieldType = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getDefaultOutLocation = exports.getAssetSchemaKeys = exports.getAllSchemaKeys = exports.formatBytes = exports.parseSequencePropClipboardDataResult = exports.parseSequencePropClipboardData = exports.parseEffectPropClipboardDataResult = exports.parseEffectPropClipboardData = exports.parseEffectClipboardDataResult = exports.parseEffectClipboardData = exports.getEffectPreviewSource = exports.getEffectPreviewAlt = exports.getEffectDocumentationPath = exports.getEffectDocumentationLink = exports.getEffectCatalogCategories = exports.EFFECT_CATALOG = exports.parseEasingClipboardDataResult = exports.parseEasingClipboardData = exports.isImageFileType = exports.detectFileType = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.configMethodLifecycles = exports.getConfigFileChangeMessage = exports.REACT_REFRESH_FINISHED_EVENT = exports.compositionDragDataToSymbolicatedStack = exports.parseCanvasCaptureData = exports.CANVAS_CAPTURE_METADATA_TAG = exports.stripAnsi = exports.splitAnsi = void 0;
|
|
18
|
+
exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.getStylePropertyLonghandKeys = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_GROUPS = exports.isValidPackageName = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForEffectImportPath = exports.parseSpringEasingConfig = exports.DEFAULT_SPRING_EASING = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.keyframeInterpolationFunctions = exports.isSchemaFieldKeyframable = void 0;
|
|
19
19
|
const ansi_1 = require("./ansi");
|
|
20
20
|
Object.defineProperty(exports, "splitAnsi", { enumerable: true, get: function () { return ansi_1.splitAnsi; } });
|
|
21
21
|
Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return ansi_1.stripAnsi; } });
|
|
22
22
|
__exportStar(require("./api-requests"), exports);
|
|
23
|
+
const canvas_capture_1 = require("./canvas-capture");
|
|
24
|
+
Object.defineProperty(exports, "CANVAS_CAPTURE_METADATA_TAG", { enumerable: true, get: function () { return canvas_capture_1.CANVAS_CAPTURE_METADATA_TAG; } });
|
|
25
|
+
Object.defineProperty(exports, "parseCanvasCaptureData", { enumerable: true, get: function () { return canvas_capture_1.parseCanvasCaptureData; } });
|
|
23
26
|
const composition_drag_data_1 = require("./composition-drag-data");
|
|
24
27
|
Object.defineProperty(exports, "compositionDragDataToSymbolicatedStack", { enumerable: true, get: function () { return composition_drag_data_1.compositionDragDataToSymbolicatedStack; } });
|
|
25
28
|
const react_refresh_event_1 = require("./react-refresh-event");
|
|
@@ -48,6 +51,9 @@ Object.defineProperty(exports, "parseEffectClipboardData", { enumerable: true, g
|
|
|
48
51
|
Object.defineProperty(exports, "parseEffectClipboardDataResult", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectClipboardDataResult; } });
|
|
49
52
|
Object.defineProperty(exports, "parseEffectPropClipboardData", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectPropClipboardData; } });
|
|
50
53
|
Object.defineProperty(exports, "parseEffectPropClipboardDataResult", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectPropClipboardDataResult; } });
|
|
54
|
+
const sequence_prop_clipboard_data_1 = require("./sequence-prop-clipboard-data");
|
|
55
|
+
Object.defineProperty(exports, "parseSequencePropClipboardData", { enumerable: true, get: function () { return sequence_prop_clipboard_data_1.parseSequencePropClipboardData; } });
|
|
56
|
+
Object.defineProperty(exports, "parseSequencePropClipboardDataResult", { enumerable: true, get: function () { return sequence_prop_clipboard_data_1.parseSequencePropClipboardDataResult; } });
|
|
51
57
|
const format_bytes_1 = require("./format-bytes");
|
|
52
58
|
Object.defineProperty(exports, "formatBytes", { enumerable: true, get: function () { return format_bytes_1.formatBytes; } });
|
|
53
59
|
const get_all_keys_1 = require("./get-all-keys");
|
|
@@ -78,6 +84,7 @@ Object.defineProperty(exports, "getPolyKeyframeEasing", { enumerable: true, get:
|
|
|
78
84
|
const keyframe_interpolation_function_1 = require("./keyframe-interpolation-function");
|
|
79
85
|
Object.defineProperty(exports, "canEditEasingForInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.canEditEasingForInterpolationFunction; } });
|
|
80
86
|
Object.defineProperty(exports, "getKeyframeInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.getKeyframeInterpolationFunction; } });
|
|
87
|
+
Object.defineProperty(exports, "isSchemaFieldHoldOnly", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isSchemaFieldHoldOnly; } });
|
|
81
88
|
Object.defineProperty(exports, "getKeyframeInterpolationFunctionForSchemaField", { enumerable: true, get: function () { return keyframe_interpolation_function_1.getKeyframeInterpolationFunctionForSchemaField; } });
|
|
82
89
|
Object.defineProperty(exports, "isInteractivitySchemaFieldKeyframable", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isInteractivitySchemaFieldKeyframable; } });
|
|
83
90
|
Object.defineProperty(exports, "isKeyframeInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isKeyframeInterpolationFunction; } });
|
|
@@ -8,6 +8,10 @@ export declare const isSchemaFieldKeyframable: ({ schema, key, }: {
|
|
|
8
8
|
schema: InteractivitySchema | null;
|
|
9
9
|
key: string;
|
|
10
10
|
}) => boolean;
|
|
11
|
+
export declare const isSchemaFieldHoldOnly: ({ schema, key, }: {
|
|
12
|
+
schema: InteractivitySchema | null;
|
|
13
|
+
key: string;
|
|
14
|
+
}) => boolean;
|
|
11
15
|
export declare const getKeyframeInterpolationFunctionForSchemaField: ({ schema, key, }: {
|
|
12
16
|
schema: InteractivitySchema | null;
|
|
13
17
|
key: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getKeyframeInterpolationFunction = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldKeyframable = exports.isInteractivitySchemaFieldKeyframable = exports.canEditEasingForInterpolationFunction = exports.isKeyframeInterpolationFunction = exports.keyframeInterpolationFunctions = void 0;
|
|
3
|
+
exports.getKeyframeInterpolationFunction = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldHoldOnly = exports.isSchemaFieldKeyframable = exports.isInteractivitySchemaFieldKeyframable = exports.canEditEasingForInterpolationFunction = exports.isKeyframeInterpolationFunction = exports.keyframeInterpolationFunctions = void 0;
|
|
4
4
|
exports.keyframeInterpolationFunctions = [
|
|
5
5
|
'interpolate',
|
|
6
6
|
'interpolateColors',
|
|
@@ -13,7 +13,7 @@ const KEYFRAME_FIELD_TYPE_SUPPORT = {
|
|
|
13
13
|
boolean: false,
|
|
14
14
|
'remotion-captions': false,
|
|
15
15
|
color: true,
|
|
16
|
-
enum:
|
|
16
|
+
enum: true,
|
|
17
17
|
'font-family': false,
|
|
18
18
|
hidden: true,
|
|
19
19
|
number: true,
|
|
@@ -31,7 +31,7 @@ const KEYFRAME_FIELD_TYPE_INTERPOLATION = {
|
|
|
31
31
|
boolean: 'unsupported',
|
|
32
32
|
'remotion-captions': 'unsupported',
|
|
33
33
|
color: 'interpolateColors',
|
|
34
|
-
enum: '
|
|
34
|
+
enum: 'interpolate',
|
|
35
35
|
'font-family': 'unsupported',
|
|
36
36
|
hidden: 'infer',
|
|
37
37
|
number: 'infer',
|
|
@@ -58,6 +58,9 @@ const isInteractivitySchemaFieldKeyframable = (field) => {
|
|
|
58
58
|
if (!field) {
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
|
+
if (field.type === 'enum') {
|
|
62
|
+
return field.keyframable === true;
|
|
63
|
+
}
|
|
61
64
|
return KEYFRAME_FIELD_TYPE_SUPPORT[field.type] && field.keyframable !== false;
|
|
62
65
|
};
|
|
63
66
|
exports.isInteractivitySchemaFieldKeyframable = isInteractivitySchemaFieldKeyframable;
|
|
@@ -83,6 +86,11 @@ const isSchemaFieldKeyframable = ({ schema, key, }) => {
|
|
|
83
86
|
return (0, exports.isInteractivitySchemaFieldKeyframable)(field);
|
|
84
87
|
};
|
|
85
88
|
exports.isSchemaFieldKeyframable = isSchemaFieldKeyframable;
|
|
89
|
+
const isSchemaFieldHoldOnly = ({ schema, key, }) => {
|
|
90
|
+
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
91
|
+
return (field === null || field === void 0 ? void 0 : field.type) === 'enum' && field.keyframable === true;
|
|
92
|
+
};
|
|
93
|
+
exports.isSchemaFieldHoldOnly = isSchemaFieldHoldOnly;
|
|
86
94
|
const getKeyframeInterpolationFunctionForSchemaField = ({ schema, key, }) => {
|
|
87
95
|
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
88
96
|
if (!field) {
|
|
@@ -13,6 +13,12 @@ const getEasingIndexToDuplicate = ({ insertedKeyframeIndex, easingLength, keyfra
|
|
|
13
13
|
const addKeyframeToPropStatus = ({ status, fieldKey, frame, value, schema, }) => {
|
|
14
14
|
var _a;
|
|
15
15
|
if (status.status === 'keyframed') {
|
|
16
|
+
const defaultEasing = (0, keyframe_interpolation_function_1.isSchemaFieldHoldOnly)({
|
|
17
|
+
schema,
|
|
18
|
+
key: fieldKey,
|
|
19
|
+
})
|
|
20
|
+
? keyframe_easing_presets_1.HOLD_KEYFRAME_EASING
|
|
21
|
+
: keyframe_easing_presets_1.LINEAR_KEYFRAME_EASING;
|
|
16
22
|
const existingIndex = status.keyframes.findIndex((kf) => kf.frame === frame);
|
|
17
23
|
if (existingIndex !== -1) {
|
|
18
24
|
const updatedKeyframes = status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
|
|
@@ -30,11 +36,11 @@ const addKeyframeToPropStatus = ({ status, fieldKey, frame, value, schema, }) =>
|
|
|
30
36
|
keyframeCount: keyframes.length,
|
|
31
37
|
});
|
|
32
38
|
const easingToDuplicate = easingIndexToDuplicate === null
|
|
33
|
-
?
|
|
39
|
+
? defaultEasing
|
|
34
40
|
: easing[easingIndexToDuplicate];
|
|
35
41
|
easing.splice(insertedKeyframeIndex, 0, easingToDuplicate);
|
|
36
42
|
while (easing.length < keyframes.length - 1) {
|
|
37
|
-
easing.push(
|
|
43
|
+
easing.push(defaultEasing);
|
|
38
44
|
}
|
|
39
45
|
return {
|
|
40
46
|
...status,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EffectClipboardParam } from './effect-clipboard-data';
|
|
2
|
+
import type { KeyframeClipboardFieldType } from './keyframe-clipboard-data';
|
|
3
|
+
export type SequencePropClipboardData = {
|
|
4
|
+
readonly type: 'sequence-prop';
|
|
5
|
+
readonly version: 1;
|
|
6
|
+
readonly remotionClipboard: 'sequence-prop';
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly fieldType: KeyframeClipboardFieldType;
|
|
9
|
+
readonly param: EffectClipboardParam;
|
|
10
|
+
};
|
|
11
|
+
export type SequencePropClipboardDataParseResult = {
|
|
12
|
+
readonly status: 'valid';
|
|
13
|
+
readonly data: SequencePropClipboardData;
|
|
14
|
+
} | {
|
|
15
|
+
readonly status: 'unsupported-version';
|
|
16
|
+
readonly version: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
readonly status: 'invalid';
|
|
19
|
+
};
|
|
20
|
+
export declare const parseSequencePropClipboardDataResult: (value: string) => SequencePropClipboardDataParseResult;
|
|
21
|
+
export declare const parseSequencePropClipboardData: (value: string) => SequencePropClipboardData | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSequencePropClipboardData = exports.parseSequencePropClipboardDataResult = void 0;
|
|
4
|
+
const effect_clipboard_data_1 = require("./effect-clipboard-data");
|
|
5
|
+
const keyframe_clipboard_data_1 = require("./keyframe-clipboard-data");
|
|
6
|
+
const isRecord = (value) => {
|
|
7
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
|
+
};
|
|
9
|
+
const parseSequencePropClipboardDataResult = (value) => {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(value);
|
|
12
|
+
if (!isRecord(parsed) || parsed.remotionClipboard !== 'sequence-prop') {
|
|
13
|
+
return { status: 'invalid' };
|
|
14
|
+
}
|
|
15
|
+
if (parsed.version !== 1) {
|
|
16
|
+
return { status: 'unsupported-version', version: parsed.version };
|
|
17
|
+
}
|
|
18
|
+
if (parsed.type !== 'sequence-prop' ||
|
|
19
|
+
typeof parsed.key !== 'string' ||
|
|
20
|
+
!(0, keyframe_clipboard_data_1.isKeyframeClipboardFieldType)(parsed.fieldType) ||
|
|
21
|
+
!(0, effect_clipboard_data_1.isEffectClipboardParam)(parsed.param)) {
|
|
22
|
+
return { status: 'invalid' };
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
status: 'valid',
|
|
26
|
+
data: {
|
|
27
|
+
type: 'sequence-prop',
|
|
28
|
+
version: 1,
|
|
29
|
+
remotionClipboard: 'sequence-prop',
|
|
30
|
+
key: parsed.key,
|
|
31
|
+
fieldType: parsed.fieldType,
|
|
32
|
+
param: (0, effect_clipboard_data_1.normalizeEffectClipboardParam)(parsed.param),
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (_a) {
|
|
37
|
+
return { status: 'invalid' };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.parseSequencePropClipboardDataResult = parseSequencePropClipboardDataResult;
|
|
41
|
+
const parseSequencePropClipboardData = (value) => {
|
|
42
|
+
const result = (0, exports.parseSequencePropClipboardDataResult)(value);
|
|
43
|
+
return result.status === 'valid' ? result.data : null;
|
|
44
|
+
};
|
|
45
|
+
exports.parseSequencePropClipboardData = parseSequencePropClipboardData;
|
package/dist/studio-html.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type StudioHtmlOptions = {
|
|
|
15
15
|
completedClientRenders?: unknown | null;
|
|
16
16
|
numberOfAudioTags: number;
|
|
17
17
|
audioLatencyHint: AudioContextLatencyCategory;
|
|
18
|
+
experimentalKeepAudioContextAlive: boolean;
|
|
18
19
|
sampleRate: number | null;
|
|
19
20
|
publicFiles: StaticFile[];
|
|
20
21
|
publicFolderExists: string | null;
|
|
@@ -32,4 +33,4 @@ export type StudioHtmlOptions = {
|
|
|
32
33
|
readOnlyStudio?: boolean;
|
|
33
34
|
studioRuntimeConfig?: StudioRuntimeConfig;
|
|
34
35
|
};
|
|
35
|
-
export declare const studioHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }: StudioHtmlOptions) => string;
|
|
36
|
+
export declare const studioHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, experimentalKeepAudioContextAlive, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }: StudioHtmlOptions) => string;
|
package/dist/studio-html.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.studioHtml = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
|
-
const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }) => {
|
|
5
|
+
const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, experimentalKeepAudioContextAlive, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }) => {
|
|
6
6
|
const scriptUrl = bundleScriptUrl !== null && bundleScriptUrl !== void 0 ? bundleScriptUrl : `${publicPath}bundle.js`;
|
|
7
7
|
const isRelativeBundle = mode === 'bundle' && publicPath === './';
|
|
8
8
|
const staticBaseValue = isRelativeBundle
|
|
@@ -28,6 +28,7 @@ const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHa
|
|
|
28
28
|
<body>
|
|
29
29
|
<script>window.remotion_numberOfAudioTags = ${numberOfAudioTags};</script>
|
|
30
30
|
<script>window.remotion_audioLatencyHint = "${audioLatencyHint}";</script>
|
|
31
|
+
<script>window.remotion_experimentalKeepAudioContextAlive = ${experimentalKeepAudioContextAlive};</script>
|
|
31
32
|
<script>window.remotion_sampleRate = ${sampleRate};</script>
|
|
32
33
|
<script>window.remotion_previewSampleRate = ${sampleRate};</script>
|
|
33
34
|
${mode === 'dev' ? `<script>window.remotion_logLevel = "${logLevel}";</script>` : ''}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-shared"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio-shared",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.509",
|
|
7
7
|
"description": "Internal package for shared objects between the Studio backend and frontend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"module": "dist/esm/index.mjs",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@remotion/studio-protocol": "4.0.
|
|
25
|
-
"remotion": "4.0.
|
|
24
|
+
"@remotion/studio-protocol": "4.0.509",
|
|
25
|
+
"remotion": "4.0.509"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@remotion/renderer": "4.0.
|
|
29
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
28
|
+
"@remotion/renderer": "4.0.509",
|
|
29
|
+
"@remotion/eslint-config-internal": "4.0.509",
|
|
30
30
|
"eslint": "9.19.0",
|
|
31
31
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
32
32
|
},
|