@remotion/studio 4.0.429 → 4.0.431
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/components/NewComposition/InputDragger.js +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +87 -20
- package/dist/components/Timeline/TimelineListItem.js +5 -2
- package/dist/components/Timeline/TimelineSchemaField.d.ts +0 -1
- package/dist/components/Timeline/TimelineSchemaField.js +33 -16
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineTracks.js +4 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +49 -34
- package/dist/esm/{chunk-0rv5nqc6.js → chunk-3msfwcwh.js} +407 -354
- package/dist/esm/internals.mjs +407 -354
- package/dist/esm/previewEntry.mjs +407 -355
- package/dist/esm/renderEntry.mjs +1 -2
- package/dist/helpers/extract-frames.js +23 -7
- package/dist/helpers/get-timeline-sequence-layout.js +4 -18
- package/dist/helpers/timeline-layout.d.ts +3 -3
- package/dist/helpers/timeline-layout.js +4 -16
- package/dist/previewEntry.js +0 -1
- package/dist/renderEntry.js +0 -1
- package/package.json +12 -11
package/dist/esm/internals.mjs
CHANGED
|
@@ -119,184 +119,6 @@ var setCurrentFps = (d) => {
|
|
|
119
119
|
// src/components/Timeline/timeline-scroll-logic.ts
|
|
120
120
|
import { interpolate } from "remotion";
|
|
121
121
|
|
|
122
|
-
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
123
|
-
var zodSafeParse = (schema, data) => {
|
|
124
|
-
return schema.safeParse(data);
|
|
125
|
-
};
|
|
126
|
-
var getZodDef = (schema) => {
|
|
127
|
-
if (schema._def)
|
|
128
|
-
return schema._def;
|
|
129
|
-
if (schema._zod)
|
|
130
|
-
return schema._zod.def;
|
|
131
|
-
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
132
|
-
};
|
|
133
|
-
var v3TypeNameMap = {
|
|
134
|
-
ZodString: "string",
|
|
135
|
-
ZodNumber: "number",
|
|
136
|
-
ZodBoolean: "boolean",
|
|
137
|
-
ZodObject: "object",
|
|
138
|
-
ZodArray: "array",
|
|
139
|
-
ZodEnum: "enum",
|
|
140
|
-
ZodUnion: "union",
|
|
141
|
-
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
142
|
-
ZodOptional: "optional",
|
|
143
|
-
ZodNullable: "nullable",
|
|
144
|
-
ZodDefault: "default",
|
|
145
|
-
ZodTuple: "tuple",
|
|
146
|
-
ZodDate: "date",
|
|
147
|
-
ZodAny: "any",
|
|
148
|
-
ZodUnknown: "unknown",
|
|
149
|
-
ZodBigInt: "bigint",
|
|
150
|
-
ZodNull: "null",
|
|
151
|
-
ZodUndefined: "undefined",
|
|
152
|
-
ZodEffects: "effects",
|
|
153
|
-
ZodLiteral: "literal",
|
|
154
|
-
ZodRecord: "record",
|
|
155
|
-
ZodNever: "never",
|
|
156
|
-
ZodVoid: "void",
|
|
157
|
-
ZodNaN: "nan",
|
|
158
|
-
ZodSymbol: "symbol",
|
|
159
|
-
ZodIntersection: "intersection",
|
|
160
|
-
ZodMap: "map",
|
|
161
|
-
ZodSet: "set",
|
|
162
|
-
ZodLazy: "lazy",
|
|
163
|
-
ZodFunction: "function",
|
|
164
|
-
ZodNativeEnum: "nativeEnum",
|
|
165
|
-
ZodCatch: "catch",
|
|
166
|
-
ZodPromise: "promise",
|
|
167
|
-
ZodBranded: "branded",
|
|
168
|
-
ZodPipeline: "pipeline"
|
|
169
|
-
};
|
|
170
|
-
var isZodV3Schema = (schema) => {
|
|
171
|
-
const def = getZodDef(schema);
|
|
172
|
-
return "typeName" in def;
|
|
173
|
-
};
|
|
174
|
-
var getZodSchemaType = (schema) => {
|
|
175
|
-
const def = getZodDef(schema);
|
|
176
|
-
if ("typeName" in def) {
|
|
177
|
-
const { typeName } = def;
|
|
178
|
-
return v3TypeNameMap[typeName] ?? typeName;
|
|
179
|
-
}
|
|
180
|
-
const { type } = def;
|
|
181
|
-
if (type === "union" && def.discriminator !== undefined) {
|
|
182
|
-
return "discriminatedUnion";
|
|
183
|
-
}
|
|
184
|
-
return type;
|
|
185
|
-
};
|
|
186
|
-
var getZodSchemaDescription = (schema) => {
|
|
187
|
-
if (isZodV3Schema(schema)) {
|
|
188
|
-
return getZodDef(schema).description;
|
|
189
|
-
}
|
|
190
|
-
return schema.description;
|
|
191
|
-
};
|
|
192
|
-
var getObjectShape = (schema) => {
|
|
193
|
-
const { shape } = getZodDef(schema);
|
|
194
|
-
return typeof shape === "function" ? shape() : shape;
|
|
195
|
-
};
|
|
196
|
-
var getArrayElement = (schema) => {
|
|
197
|
-
const def = getZodDef(schema);
|
|
198
|
-
return isZodV3Schema(schema) ? def.type : def.element;
|
|
199
|
-
};
|
|
200
|
-
var getInnerType = (schema) => {
|
|
201
|
-
return getZodDef(schema).innerType;
|
|
202
|
-
};
|
|
203
|
-
var getEffectsInner = (schema) => {
|
|
204
|
-
return getZodDef(schema).schema;
|
|
205
|
-
};
|
|
206
|
-
var getLiteralValue = (schema) => {
|
|
207
|
-
const def = getZodDef(schema);
|
|
208
|
-
if (isZodV3Schema(schema)) {
|
|
209
|
-
return def.value;
|
|
210
|
-
}
|
|
211
|
-
return def.values?.[0];
|
|
212
|
-
};
|
|
213
|
-
var getEnumValues = (schema) => {
|
|
214
|
-
const def = getZodDef(schema);
|
|
215
|
-
if (isZodV3Schema(schema)) {
|
|
216
|
-
return def.values;
|
|
217
|
-
}
|
|
218
|
-
const { entries } = def;
|
|
219
|
-
return Object.values(entries);
|
|
220
|
-
};
|
|
221
|
-
var getFirstEnumValue = (schema) => {
|
|
222
|
-
const def = getZodDef(schema);
|
|
223
|
-
if (isZodV3Schema(schema)) {
|
|
224
|
-
if (def.typeName === "ZodNativeEnum") {
|
|
225
|
-
const vals = Object.values(def.values);
|
|
226
|
-
return vals[0];
|
|
227
|
-
}
|
|
228
|
-
return def.values[0];
|
|
229
|
-
}
|
|
230
|
-
const { entries } = def;
|
|
231
|
-
const pairs = Object.entries(entries);
|
|
232
|
-
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
233
|
-
if (hasReverseMapping) {
|
|
234
|
-
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
235
|
-
if (forwardPairs.length > 0) {
|
|
236
|
-
return forwardPairs[0][1];
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return Object.values(entries)[0];
|
|
240
|
-
};
|
|
241
|
-
var getUnionOptions = (schema) => {
|
|
242
|
-
return getZodDef(schema).options;
|
|
243
|
-
};
|
|
244
|
-
var getDefaultValue = (schema) => {
|
|
245
|
-
const dv = getZodDef(schema).defaultValue;
|
|
246
|
-
return typeof dv === "function" ? dv() : dv;
|
|
247
|
-
};
|
|
248
|
-
var getDiscriminator = (schema) => {
|
|
249
|
-
return getZodDef(schema).discriminator;
|
|
250
|
-
};
|
|
251
|
-
var getDiscriminatedOptionKeys = (schema) => {
|
|
252
|
-
const def = getZodDef(schema);
|
|
253
|
-
const discriminator = getDiscriminator(schema);
|
|
254
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
255
|
-
return [...def.optionsMap.keys()];
|
|
256
|
-
}
|
|
257
|
-
const options = getUnionOptions(schema);
|
|
258
|
-
return options.map((option) => {
|
|
259
|
-
const shape = getObjectShape(option);
|
|
260
|
-
const discriminatorSchema = shape[discriminator];
|
|
261
|
-
return getLiteralValue(discriminatorSchema);
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
265
|
-
const def = getZodDef(schema);
|
|
266
|
-
const discriminator = getDiscriminator(schema);
|
|
267
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
268
|
-
return def.optionsMap.get(discriminatorValue);
|
|
269
|
-
}
|
|
270
|
-
const options = getUnionOptions(schema);
|
|
271
|
-
return options.find((option) => {
|
|
272
|
-
const shape = getObjectShape(option);
|
|
273
|
-
const discriminatorSchema = shape[discriminator];
|
|
274
|
-
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
var getIntersectionSchemas = (schema) => {
|
|
278
|
-
const def = getZodDef(schema);
|
|
279
|
-
return { left: def.left, right: def.right };
|
|
280
|
-
};
|
|
281
|
-
var getTupleItems = (schema) => {
|
|
282
|
-
return getZodDef(schema).items;
|
|
283
|
-
};
|
|
284
|
-
var getRecordValueType = (schema) => {
|
|
285
|
-
return getZodDef(schema).valueType;
|
|
286
|
-
};
|
|
287
|
-
var getRecordKeyType = (schema) => {
|
|
288
|
-
return getZodDef(schema).keyType;
|
|
289
|
-
};
|
|
290
|
-
var getPipelineOutput = (schema) => {
|
|
291
|
-
return getZodDef(schema).out;
|
|
292
|
-
};
|
|
293
|
-
var getPipelineInput = (schema) => {
|
|
294
|
-
return getZodDef(schema).in;
|
|
295
|
-
};
|
|
296
|
-
var getBrandedInner = (schema) => {
|
|
297
|
-
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
122
|
// src/helpers/timeline-layout.ts
|
|
301
123
|
var TIMELINE_PADDING = 16;
|
|
302
124
|
var TIMELINE_BORDER = 1;
|
|
@@ -304,28 +126,17 @@ var TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
304
126
|
var TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
305
127
|
var SCHEMA_FIELD_ROW_HEIGHT = 26;
|
|
306
128
|
var UNSUPPORTED_FIELD_ROW_HEIGHT = 26;
|
|
307
|
-
var SUPPORTED_SCHEMA_TYPES = new Set([
|
|
308
|
-
"number",
|
|
309
|
-
"string",
|
|
310
|
-
"boolean",
|
|
311
|
-
"enum",
|
|
312
|
-
"date",
|
|
313
|
-
"array",
|
|
314
|
-
"object",
|
|
315
|
-
"optional",
|
|
316
|
-
"nullable",
|
|
317
|
-
"default"
|
|
318
|
-
]);
|
|
129
|
+
var SUPPORTED_SCHEMA_TYPES = new Set(["number", "boolean"]);
|
|
319
130
|
var getSchemaFields = (controls) => {
|
|
320
131
|
if (!controls) {
|
|
321
132
|
return null;
|
|
322
133
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const typeName = getZodSchemaType(fieldSchema);
|
|
134
|
+
return Object.entries(controls.schema).map(([key, fieldSchema]) => {
|
|
135
|
+
const typeName = fieldSchema.type;
|
|
326
136
|
const supported = SUPPORTED_SCHEMA_TYPES.has(typeName);
|
|
327
137
|
return {
|
|
328
138
|
key,
|
|
139
|
+
description: fieldSchema.description,
|
|
329
140
|
typeName,
|
|
330
141
|
supported,
|
|
331
142
|
rowHeight: supported ? SCHEMA_FIELD_ROW_HEIGHT : UNSUPPORTED_FIELD_ROW_HEIGHT,
|
|
@@ -11278,6 +11089,184 @@ import { Internals as Internals30 } from "remotion";
|
|
|
11278
11089
|
// src/api/save-default-props.ts
|
|
11279
11090
|
import { getRemotionEnvironment as getRemotionEnvironment4 } from "remotion";
|
|
11280
11091
|
|
|
11092
|
+
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
11093
|
+
var zodSafeParse = (schema, data) => {
|
|
11094
|
+
return schema.safeParse(data);
|
|
11095
|
+
};
|
|
11096
|
+
var getZodDef = (schema) => {
|
|
11097
|
+
if (schema._def)
|
|
11098
|
+
return schema._def;
|
|
11099
|
+
if (schema._zod)
|
|
11100
|
+
return schema._zod.def;
|
|
11101
|
+
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
11102
|
+
};
|
|
11103
|
+
var v3TypeNameMap = {
|
|
11104
|
+
ZodString: "string",
|
|
11105
|
+
ZodNumber: "number",
|
|
11106
|
+
ZodBoolean: "boolean",
|
|
11107
|
+
ZodObject: "object",
|
|
11108
|
+
ZodArray: "array",
|
|
11109
|
+
ZodEnum: "enum",
|
|
11110
|
+
ZodUnion: "union",
|
|
11111
|
+
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
11112
|
+
ZodOptional: "optional",
|
|
11113
|
+
ZodNullable: "nullable",
|
|
11114
|
+
ZodDefault: "default",
|
|
11115
|
+
ZodTuple: "tuple",
|
|
11116
|
+
ZodDate: "date",
|
|
11117
|
+
ZodAny: "any",
|
|
11118
|
+
ZodUnknown: "unknown",
|
|
11119
|
+
ZodBigInt: "bigint",
|
|
11120
|
+
ZodNull: "null",
|
|
11121
|
+
ZodUndefined: "undefined",
|
|
11122
|
+
ZodEffects: "effects",
|
|
11123
|
+
ZodLiteral: "literal",
|
|
11124
|
+
ZodRecord: "record",
|
|
11125
|
+
ZodNever: "never",
|
|
11126
|
+
ZodVoid: "void",
|
|
11127
|
+
ZodNaN: "nan",
|
|
11128
|
+
ZodSymbol: "symbol",
|
|
11129
|
+
ZodIntersection: "intersection",
|
|
11130
|
+
ZodMap: "map",
|
|
11131
|
+
ZodSet: "set",
|
|
11132
|
+
ZodLazy: "lazy",
|
|
11133
|
+
ZodFunction: "function",
|
|
11134
|
+
ZodNativeEnum: "nativeEnum",
|
|
11135
|
+
ZodCatch: "catch",
|
|
11136
|
+
ZodPromise: "promise",
|
|
11137
|
+
ZodBranded: "branded",
|
|
11138
|
+
ZodPipeline: "pipeline"
|
|
11139
|
+
};
|
|
11140
|
+
var isZodV3Schema = (schema) => {
|
|
11141
|
+
const def = getZodDef(schema);
|
|
11142
|
+
return "typeName" in def;
|
|
11143
|
+
};
|
|
11144
|
+
var getZodSchemaType = (schema) => {
|
|
11145
|
+
const def = getZodDef(schema);
|
|
11146
|
+
if ("typeName" in def) {
|
|
11147
|
+
const { typeName } = def;
|
|
11148
|
+
return v3TypeNameMap[typeName] ?? typeName;
|
|
11149
|
+
}
|
|
11150
|
+
const { type } = def;
|
|
11151
|
+
if (type === "union" && def.discriminator !== undefined) {
|
|
11152
|
+
return "discriminatedUnion";
|
|
11153
|
+
}
|
|
11154
|
+
return type;
|
|
11155
|
+
};
|
|
11156
|
+
var getZodSchemaDescription = (schema) => {
|
|
11157
|
+
if (isZodV3Schema(schema)) {
|
|
11158
|
+
return getZodDef(schema).description;
|
|
11159
|
+
}
|
|
11160
|
+
return schema.description;
|
|
11161
|
+
};
|
|
11162
|
+
var getObjectShape = (schema) => {
|
|
11163
|
+
const { shape } = getZodDef(schema);
|
|
11164
|
+
return typeof shape === "function" ? shape() : shape;
|
|
11165
|
+
};
|
|
11166
|
+
var getArrayElement = (schema) => {
|
|
11167
|
+
const def = getZodDef(schema);
|
|
11168
|
+
return isZodV3Schema(schema) ? def.type : def.element;
|
|
11169
|
+
};
|
|
11170
|
+
var getInnerType = (schema) => {
|
|
11171
|
+
return getZodDef(schema).innerType;
|
|
11172
|
+
};
|
|
11173
|
+
var getEffectsInner = (schema) => {
|
|
11174
|
+
return getZodDef(schema).schema;
|
|
11175
|
+
};
|
|
11176
|
+
var getLiteralValue = (schema) => {
|
|
11177
|
+
const def = getZodDef(schema);
|
|
11178
|
+
if (isZodV3Schema(schema)) {
|
|
11179
|
+
return def.value;
|
|
11180
|
+
}
|
|
11181
|
+
return def.values?.[0];
|
|
11182
|
+
};
|
|
11183
|
+
var getEnumValues = (schema) => {
|
|
11184
|
+
const def = getZodDef(schema);
|
|
11185
|
+
if (isZodV3Schema(schema)) {
|
|
11186
|
+
return def.values;
|
|
11187
|
+
}
|
|
11188
|
+
const { entries } = def;
|
|
11189
|
+
return Object.values(entries);
|
|
11190
|
+
};
|
|
11191
|
+
var getFirstEnumValue = (schema) => {
|
|
11192
|
+
const def = getZodDef(schema);
|
|
11193
|
+
if (isZodV3Schema(schema)) {
|
|
11194
|
+
if (def.typeName === "ZodNativeEnum") {
|
|
11195
|
+
const vals = Object.values(def.values);
|
|
11196
|
+
return vals[0];
|
|
11197
|
+
}
|
|
11198
|
+
return def.values[0];
|
|
11199
|
+
}
|
|
11200
|
+
const { entries } = def;
|
|
11201
|
+
const pairs = Object.entries(entries);
|
|
11202
|
+
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
11203
|
+
if (hasReverseMapping) {
|
|
11204
|
+
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
11205
|
+
if (forwardPairs.length > 0) {
|
|
11206
|
+
return forwardPairs[0][1];
|
|
11207
|
+
}
|
|
11208
|
+
}
|
|
11209
|
+
return Object.values(entries)[0];
|
|
11210
|
+
};
|
|
11211
|
+
var getUnionOptions = (schema) => {
|
|
11212
|
+
return getZodDef(schema).options;
|
|
11213
|
+
};
|
|
11214
|
+
var getDefaultValue = (schema) => {
|
|
11215
|
+
const dv = getZodDef(schema).defaultValue;
|
|
11216
|
+
return typeof dv === "function" ? dv() : dv;
|
|
11217
|
+
};
|
|
11218
|
+
var getDiscriminator = (schema) => {
|
|
11219
|
+
return getZodDef(schema).discriminator;
|
|
11220
|
+
};
|
|
11221
|
+
var getDiscriminatedOptionKeys = (schema) => {
|
|
11222
|
+
const def = getZodDef(schema);
|
|
11223
|
+
const discriminator = getDiscriminator(schema);
|
|
11224
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11225
|
+
return [...def.optionsMap.keys()];
|
|
11226
|
+
}
|
|
11227
|
+
const options = getUnionOptions(schema);
|
|
11228
|
+
return options.map((option) => {
|
|
11229
|
+
const shape = getObjectShape(option);
|
|
11230
|
+
const discriminatorSchema = shape[discriminator];
|
|
11231
|
+
return getLiteralValue(discriminatorSchema);
|
|
11232
|
+
});
|
|
11233
|
+
};
|
|
11234
|
+
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
11235
|
+
const def = getZodDef(schema);
|
|
11236
|
+
const discriminator = getDiscriminator(schema);
|
|
11237
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11238
|
+
return def.optionsMap.get(discriminatorValue);
|
|
11239
|
+
}
|
|
11240
|
+
const options = getUnionOptions(schema);
|
|
11241
|
+
return options.find((option) => {
|
|
11242
|
+
const shape = getObjectShape(option);
|
|
11243
|
+
const discriminatorSchema = shape[discriminator];
|
|
11244
|
+
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
11245
|
+
});
|
|
11246
|
+
};
|
|
11247
|
+
var getIntersectionSchemas = (schema) => {
|
|
11248
|
+
const def = getZodDef(schema);
|
|
11249
|
+
return { left: def.left, right: def.right };
|
|
11250
|
+
};
|
|
11251
|
+
var getTupleItems = (schema) => {
|
|
11252
|
+
return getZodDef(schema).items;
|
|
11253
|
+
};
|
|
11254
|
+
var getRecordValueType = (schema) => {
|
|
11255
|
+
return getZodDef(schema).valueType;
|
|
11256
|
+
};
|
|
11257
|
+
var getRecordKeyType = (schema) => {
|
|
11258
|
+
return getZodDef(schema).keyType;
|
|
11259
|
+
};
|
|
11260
|
+
var getPipelineOutput = (schema) => {
|
|
11261
|
+
return getZodDef(schema).out;
|
|
11262
|
+
};
|
|
11263
|
+
var getPipelineInput = (schema) => {
|
|
11264
|
+
return getZodDef(schema).in;
|
|
11265
|
+
};
|
|
11266
|
+
var getBrandedInner = (schema) => {
|
|
11267
|
+
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
11268
|
+
};
|
|
11269
|
+
|
|
11281
11270
|
// src/components/RenderModal/SchemaEditor/extract-enum-json-paths.ts
|
|
11282
11271
|
var extractEnumJsonPaths = ({
|
|
11283
11272
|
schema,
|
|
@@ -13629,7 +13618,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
13629
13618
|
return {
|
|
13630
13619
|
...inputBaseStyle,
|
|
13631
13620
|
backgroundColor: "transparent",
|
|
13632
|
-
borderColor: "transparent"
|
|
13621
|
+
borderColor: "transparent",
|
|
13622
|
+
padding: "4px 6px"
|
|
13633
13623
|
};
|
|
13634
13624
|
}, []);
|
|
13635
13625
|
const span = useMemo69(() => ({
|
|
@@ -21175,7 +21165,7 @@ var Inner2 = () => {
|
|
|
21175
21165
|
|
|
21176
21166
|
// src/components/Timeline/TimelineList.tsx
|
|
21177
21167
|
import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
21178
|
-
import { useRef as
|
|
21168
|
+
import { useRef as useRef40 } from "react";
|
|
21179
21169
|
|
|
21180
21170
|
// src/components/Timeline/TimelineListItem.tsx
|
|
21181
21171
|
import {
|
|
@@ -21220,6 +21210,7 @@ import {
|
|
|
21220
21210
|
useContext as useContext67,
|
|
21221
21211
|
useEffect as useEffect67,
|
|
21222
21212
|
useMemo as useMemo104,
|
|
21213
|
+
useRef as useRef37,
|
|
21223
21214
|
useState as useState70
|
|
21224
21215
|
} from "react";
|
|
21225
21216
|
import { Internals as Internals49 } from "remotion";
|
|
@@ -21237,19 +21228,15 @@ var draggerStyle = {
|
|
|
21237
21228
|
width: 80,
|
|
21238
21229
|
marginLeft: "auto"
|
|
21239
21230
|
};
|
|
21231
|
+
var checkboxContainer = {
|
|
21232
|
+
marginLeft: "auto"
|
|
21233
|
+
};
|
|
21240
21234
|
var notEditableBackground = {
|
|
21241
21235
|
backgroundColor: "rgba(255, 0, 0, 0.2)",
|
|
21242
21236
|
borderRadius: 3,
|
|
21243
21237
|
padding: "0 4px"
|
|
21244
21238
|
};
|
|
21245
|
-
var TimelineNumberField = ({
|
|
21246
|
-
field,
|
|
21247
|
-
canUpdate,
|
|
21248
|
-
onSave,
|
|
21249
|
-
onSavingChange,
|
|
21250
|
-
onDragValueChange,
|
|
21251
|
-
onDragEnd
|
|
21252
|
-
}) => {
|
|
21239
|
+
var TimelineNumberField = ({ field, codeValue, canUpdate, onSave, onDragValueChange, onDragEnd }) => {
|
|
21253
21240
|
const [dragValue, setDragValue] = useState69(null);
|
|
21254
21241
|
const dragging = useRef36(false);
|
|
21255
21242
|
const onValueChange = useCallback98((newVal) => {
|
|
@@ -21259,56 +21246,60 @@ var TimelineNumberField = ({
|
|
|
21259
21246
|
}, [onDragValueChange, field.key]);
|
|
21260
21247
|
useEffect66(() => {
|
|
21261
21248
|
setDragValue(null);
|
|
21262
|
-
onSavingChange(false);
|
|
21263
21249
|
onDragEnd();
|
|
21264
|
-
}, [field.currentValue,
|
|
21250
|
+
}, [field.currentValue, onDragEnd]);
|
|
21265
21251
|
const onValueChangeEnd = useCallback98((newVal) => {
|
|
21266
|
-
if (canUpdate && newVal !==
|
|
21267
|
-
onSavingChange(true);
|
|
21252
|
+
if (canUpdate && newVal !== codeValue) {
|
|
21268
21253
|
onSave(field.key, newVal).catch(() => {
|
|
21269
|
-
onSavingChange(false);
|
|
21270
21254
|
setDragValue(null);
|
|
21271
21255
|
});
|
|
21272
21256
|
} else {
|
|
21273
21257
|
setDragValue(null);
|
|
21274
21258
|
}
|
|
21275
|
-
}, [canUpdate, onSave,
|
|
21259
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21276
21260
|
const onTextChange = useCallback98((newVal) => {
|
|
21277
21261
|
if (canUpdate) {
|
|
21278
21262
|
const parsed = Number(newVal);
|
|
21279
|
-
if (!Number.isNaN(parsed) && parsed !==
|
|
21263
|
+
if (!Number.isNaN(parsed) && parsed !== codeValue) {
|
|
21280
21264
|
setDragValue(parsed);
|
|
21281
|
-
onSavingChange(true);
|
|
21282
21265
|
onSave(field.key, parsed).catch(() => {
|
|
21283
|
-
onSavingChange(false);
|
|
21284
21266
|
setDragValue(null);
|
|
21285
21267
|
});
|
|
21286
21268
|
}
|
|
21287
21269
|
}
|
|
21288
|
-
}, [canUpdate, onSave,
|
|
21270
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21289
21271
|
return /* @__PURE__ */ jsx192(InputDragger, {
|
|
21290
21272
|
type: "number",
|
|
21291
|
-
value: dragValue ??
|
|
21273
|
+
value: dragValue ?? codeValue,
|
|
21292
21274
|
style: draggerStyle,
|
|
21293
21275
|
status: "ok",
|
|
21294
21276
|
onValueChange,
|
|
21295
21277
|
onValueChangeEnd,
|
|
21296
21278
|
onTextChange,
|
|
21297
|
-
min:
|
|
21298
|
-
max:
|
|
21299
|
-
step:
|
|
21279
|
+
min: field.fieldSchema.type === "number" ? field.fieldSchema.min ?? -Infinity : -Infinity,
|
|
21280
|
+
max: field.fieldSchema.type === "number" ? field.fieldSchema.max ?? Infinity : Infinity,
|
|
21281
|
+
step: field.fieldSchema.type === "number" ? field.fieldSchema.step ?? 1 : 1,
|
|
21300
21282
|
rightAlign: true
|
|
21301
21283
|
});
|
|
21302
21284
|
};
|
|
21303
|
-
var
|
|
21304
|
-
|
|
21305
|
-
|
|
21306
|
-
|
|
21307
|
-
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
|
|
21311
|
-
|
|
21285
|
+
var TimelineBooleanField = ({ field, codeValue, canUpdate, onSave }) => {
|
|
21286
|
+
const checked = Boolean(codeValue);
|
|
21287
|
+
const onChange = useCallback98(() => {
|
|
21288
|
+
if (canUpdate) {
|
|
21289
|
+
onSave(field.key, !checked);
|
|
21290
|
+
}
|
|
21291
|
+
}, [canUpdate, onSave, field.key, checked]);
|
|
21292
|
+
return /* @__PURE__ */ jsx192("div", {
|
|
21293
|
+
style: checkboxContainer,
|
|
21294
|
+
children: /* @__PURE__ */ jsx192(Checkbox, {
|
|
21295
|
+
checked,
|
|
21296
|
+
onChange,
|
|
21297
|
+
name: field.key,
|
|
21298
|
+
disabled: !canUpdate
|
|
21299
|
+
})
|
|
21300
|
+
});
|
|
21301
|
+
};
|
|
21302
|
+
var TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, canUpdate }) => {
|
|
21312
21303
|
const wrapperStyle = canUpdate === null || canUpdate === false ? notEditableBackground : undefined;
|
|
21313
21304
|
if (!field.supported) {
|
|
21314
21305
|
return /* @__PURE__ */ jsx192("span", {
|
|
@@ -21331,31 +21322,34 @@ var TimelineFieldValue = ({
|
|
|
21331
21322
|
})
|
|
21332
21323
|
});
|
|
21333
21324
|
}
|
|
21325
|
+
const effectiveCodeValue = propStatus.codeValue ?? field.currentValue ?? field.fieldSchema.default;
|
|
21334
21326
|
if (field.typeName === "number") {
|
|
21335
21327
|
return /* @__PURE__ */ jsx192("span", {
|
|
21336
21328
|
style: wrapperStyle,
|
|
21337
21329
|
children: /* @__PURE__ */ jsx192(TimelineNumberField, {
|
|
21338
21330
|
field,
|
|
21331
|
+
codeValue: effectiveCodeValue,
|
|
21339
21332
|
canUpdate,
|
|
21340
21333
|
onSave,
|
|
21341
|
-
onSavingChange,
|
|
21342
21334
|
onDragValueChange,
|
|
21343
21335
|
onDragEnd
|
|
21344
21336
|
})
|
|
21345
21337
|
});
|
|
21346
21338
|
}
|
|
21339
|
+
if (field.typeName === "boolean") {
|
|
21340
|
+
return /* @__PURE__ */ jsx192("span", {
|
|
21341
|
+
style: wrapperStyle,
|
|
21342
|
+
children: /* @__PURE__ */ jsx192(TimelineBooleanField, {
|
|
21343
|
+
field,
|
|
21344
|
+
codeValue: effectiveCodeValue,
|
|
21345
|
+
canUpdate,
|
|
21346
|
+
onSave
|
|
21347
|
+
})
|
|
21348
|
+
});
|
|
21349
|
+
}
|
|
21347
21350
|
return /* @__PURE__ */ jsx192("span", {
|
|
21348
21351
|
style: { ...unsupportedLabel, fontStyle: "normal" },
|
|
21349
|
-
children: String(
|
|
21350
|
-
});
|
|
21351
|
-
};
|
|
21352
|
-
var TimelineFieldSavingSpinner = ({ saving }) => {
|
|
21353
|
-
if (!saving) {
|
|
21354
|
-
return null;
|
|
21355
|
-
}
|
|
21356
|
-
return /* @__PURE__ */ jsx192(Spinner, {
|
|
21357
|
-
duration: 0.5,
|
|
21358
|
-
size: 12
|
|
21352
|
+
children: String(effectiveCodeValue)
|
|
21359
21353
|
});
|
|
21360
21354
|
};
|
|
21361
21355
|
|
|
@@ -21387,30 +21381,20 @@ var fieldLabelRow = {
|
|
|
21387
21381
|
gap: 6
|
|
21388
21382
|
};
|
|
21389
21383
|
var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatus }) => {
|
|
21390
|
-
const [saving, setSaving] = useState70(false);
|
|
21391
|
-
const onSavingChange = useCallback99((s) => {
|
|
21392
|
-
setSaving(s);
|
|
21393
|
-
}, []);
|
|
21394
21384
|
return /* @__PURE__ */ jsxs92("div", {
|
|
21395
21385
|
style: { ...fieldRow, height: field.rowHeight },
|
|
21396
21386
|
children: [
|
|
21397
|
-
/* @__PURE__ */
|
|
21387
|
+
/* @__PURE__ */ jsx193("div", {
|
|
21398
21388
|
style: fieldLabelRow,
|
|
21399
|
-
children:
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
}),
|
|
21404
|
-
/* @__PURE__ */ jsx193(TimelineFieldSavingSpinner, {
|
|
21405
|
-
saving
|
|
21406
|
-
})
|
|
21407
|
-
]
|
|
21389
|
+
children: /* @__PURE__ */ jsx193("span", {
|
|
21390
|
+
style: fieldName,
|
|
21391
|
+
children: field.description ?? field.key
|
|
21392
|
+
})
|
|
21408
21393
|
}),
|
|
21409
21394
|
/* @__PURE__ */ jsx193(TimelineFieldValue, {
|
|
21410
21395
|
field,
|
|
21411
21396
|
propStatus,
|
|
21412
21397
|
onSave,
|
|
21413
|
-
onSavingChange,
|
|
21414
21398
|
onDragValueChange,
|
|
21415
21399
|
onDragEnd,
|
|
21416
21400
|
canUpdate: propStatus?.canUpdate ?? false
|
|
@@ -21420,6 +21404,8 @@ var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatu
|
|
|
21420
21404
|
};
|
|
21421
21405
|
var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
21422
21406
|
const [propStatuses, setPropStatuses] = useState70(null);
|
|
21407
|
+
const { previewServerState: state, subscribeToEvent } = useContext67(StudioServerConnectionCtx);
|
|
21408
|
+
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
21423
21409
|
const schemaFields = useMemo104(() => getSchemaFields(sequence.controls), [sequence.controls]);
|
|
21424
21410
|
const validatedLocation = useMemo104(() => {
|
|
21425
21411
|
if (!originalLocation || !originalLocation.source || !originalLocation.line) {
|
|
@@ -21431,17 +21417,32 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21431
21417
|
column: originalLocation.column ?? 0
|
|
21432
21418
|
};
|
|
21433
21419
|
}, [originalLocation]);
|
|
21420
|
+
const locationSource = validatedLocation?.source ?? null;
|
|
21421
|
+
const locationLine = validatedLocation?.line ?? null;
|
|
21422
|
+
const locationColumn = validatedLocation?.column ?? null;
|
|
21423
|
+
const schemaKeysString = useMemo104(() => schemaFields ? schemaFields.map((f) => f.key).join(",") : null, [schemaFields]);
|
|
21424
|
+
const currentLocationSource = useRef37(locationSource);
|
|
21425
|
+
currentLocationSource.current = locationSource;
|
|
21426
|
+
const currentLocationLine = useRef37(locationLine);
|
|
21427
|
+
currentLocationLine.current = locationLine;
|
|
21428
|
+
const currentLocationColumn = useRef37(locationColumn);
|
|
21429
|
+
currentLocationColumn.current = locationColumn;
|
|
21434
21430
|
useEffect67(() => {
|
|
21435
|
-
if (!
|
|
21431
|
+
if (!clientId || !locationSource || !locationLine || locationColumn === null || !schemaKeysString) {
|
|
21436
21432
|
setPropStatuses(null);
|
|
21437
21433
|
return;
|
|
21438
21434
|
}
|
|
21439
|
-
|
|
21440
|
-
|
|
21441
|
-
|
|
21442
|
-
|
|
21443
|
-
|
|
21435
|
+
const keys = schemaKeysString.split(",");
|
|
21436
|
+
callApi("/api/subscribe-to-sequence-props", {
|
|
21437
|
+
fileName: locationSource,
|
|
21438
|
+
line: locationLine,
|
|
21439
|
+
column: locationColumn,
|
|
21440
|
+
keys,
|
|
21441
|
+
clientId
|
|
21444
21442
|
}).then((result) => {
|
|
21443
|
+
if (currentLocationSource.current !== locationSource || currentLocationLine.current !== locationLine || currentLocationColumn.current !== locationColumn) {
|
|
21444
|
+
return;
|
|
21445
|
+
}
|
|
21445
21446
|
if (result.canUpdate) {
|
|
21446
21447
|
setPropStatuses(result.props);
|
|
21447
21448
|
} else {
|
|
@@ -21450,7 +21451,43 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21450
21451
|
}).catch(() => {
|
|
21451
21452
|
setPropStatuses(null);
|
|
21452
21453
|
});
|
|
21453
|
-
|
|
21454
|
+
return () => {
|
|
21455
|
+
callApi("/api/unsubscribe-from-sequence-props", {
|
|
21456
|
+
fileName: locationSource,
|
|
21457
|
+
line: locationLine,
|
|
21458
|
+
column: locationColumn,
|
|
21459
|
+
clientId
|
|
21460
|
+
}).catch(() => {});
|
|
21461
|
+
};
|
|
21462
|
+
}, [
|
|
21463
|
+
clientId,
|
|
21464
|
+
locationSource,
|
|
21465
|
+
locationLine,
|
|
21466
|
+
locationColumn,
|
|
21467
|
+
schemaKeysString
|
|
21468
|
+
]);
|
|
21469
|
+
useEffect67(() => {
|
|
21470
|
+
if (!locationSource || !locationLine || locationColumn === null) {
|
|
21471
|
+
return;
|
|
21472
|
+
}
|
|
21473
|
+
const listener = (event) => {
|
|
21474
|
+
if (event.type !== "sequence-props-updated") {
|
|
21475
|
+
return;
|
|
21476
|
+
}
|
|
21477
|
+
if (event.fileName !== currentLocationSource.current || event.line !== currentLocationLine.current || event.column !== currentLocationColumn.current) {
|
|
21478
|
+
return;
|
|
21479
|
+
}
|
|
21480
|
+
if (event.result.canUpdate) {
|
|
21481
|
+
setPropStatuses(event.result.props);
|
|
21482
|
+
} else {
|
|
21483
|
+
setPropStatuses(null);
|
|
21484
|
+
}
|
|
21485
|
+
};
|
|
21486
|
+
const unsub = subscribeToEvent("sequence-props-updated", listener);
|
|
21487
|
+
return () => {
|
|
21488
|
+
unsub();
|
|
21489
|
+
};
|
|
21490
|
+
}, [locationSource, locationLine, locationColumn, subscribeToEvent]);
|
|
21454
21491
|
const expandedHeight = useMemo104(() => getExpandedTrackHeight(sequence.controls), [sequence.controls]);
|
|
21455
21492
|
const { setOverride, clearOverrides } = useContext67(Internals49.SequenceControlOverrideContext);
|
|
21456
21493
|
const onSave = useCallback99((key4, value) => {
|
|
@@ -21461,23 +21498,27 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21461
21498
|
if (!status || !status.canUpdate) {
|
|
21462
21499
|
return Promise.reject(new Error("Cannot save"));
|
|
21463
21500
|
}
|
|
21501
|
+
const field = schemaFields?.find((f) => f.key === key4);
|
|
21502
|
+
const defaultValue = field && field.fieldSchema.default !== undefined ? JSON.stringify(field.fieldSchema.default) : null;
|
|
21464
21503
|
return callApi("/api/save-sequence-props", {
|
|
21465
21504
|
fileName: validatedLocation.source,
|
|
21466
21505
|
line: validatedLocation.line,
|
|
21467
21506
|
column: validatedLocation.column,
|
|
21468
21507
|
key: key4,
|
|
21469
21508
|
value: JSON.stringify(value),
|
|
21470
|
-
enumPaths: []
|
|
21509
|
+
enumPaths: [],
|
|
21510
|
+
defaultValue
|
|
21471
21511
|
}).then(() => {
|
|
21472
21512
|
return;
|
|
21473
21513
|
});
|
|
21474
|
-
}, [propStatuses, validatedLocation]);
|
|
21514
|
+
}, [propStatuses, validatedLocation, schemaFields]);
|
|
21515
|
+
const overrideId = sequence.controls?.overrideId ?? sequence.id;
|
|
21475
21516
|
const onDragValueChange = useCallback99((key4, value) => {
|
|
21476
|
-
setOverride(
|
|
21477
|
-
}, [setOverride,
|
|
21517
|
+
setOverride(overrideId, key4, value);
|
|
21518
|
+
}, [setOverride, overrideId]);
|
|
21478
21519
|
const onDragEnd = useCallback99(() => {
|
|
21479
|
-
clearOverrides(
|
|
21480
|
-
}, [clearOverrides,
|
|
21520
|
+
clearOverrides(overrideId);
|
|
21521
|
+
}, [clearOverrides, overrideId]);
|
|
21481
21522
|
return /* @__PURE__ */ jsx193("div", {
|
|
21482
21523
|
style: { ...expandedSectionBase, height: expandedHeight },
|
|
21483
21524
|
children: schemaFields ? schemaFields.map((field) => /* @__PURE__ */ jsx193(TimelineFieldRow, {
|
|
@@ -21752,7 +21793,8 @@ var arrowButton = {
|
|
|
21752
21793
|
lineHeight: 1
|
|
21753
21794
|
};
|
|
21754
21795
|
var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
21755
|
-
const
|
|
21796
|
+
const { previewServerState } = useContext69(StudioServerConnectionCtx);
|
|
21797
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
21756
21798
|
const { hidden, setHidden } = useContext69(Internals50.SequenceVisibilityToggleContext);
|
|
21757
21799
|
const { expandedTracks, toggleTrack } = useContext69(ExpandedTracksContext);
|
|
21758
21800
|
const [originalLocation, setOriginalLocation] = useState72(null);
|
|
@@ -21766,7 +21808,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
21766
21808
|
console.error("Could not get original location of Sequence", err);
|
|
21767
21809
|
});
|
|
21768
21810
|
}, [sequence.stack]);
|
|
21769
|
-
const isExpanded = expandedTracks[sequence.id] ?? false;
|
|
21811
|
+
const isExpanded = visualModeEnabled && (expandedTracks[sequence.id] ?? false);
|
|
21770
21812
|
const onToggleExpand = useCallback102(() => {
|
|
21771
21813
|
toggleTrack(sequence.id);
|
|
21772
21814
|
}, [sequence.id, toggleTrack]);
|
|
@@ -21858,7 +21900,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
21858
21900
|
};
|
|
21859
21901
|
|
|
21860
21902
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
21861
|
-
import { useContext as useContext70, useEffect as useEffect70, useMemo as useMemo107, useRef as
|
|
21903
|
+
import { useContext as useContext70, useEffect as useEffect70, useMemo as useMemo107, useRef as useRef39 } from "react";
|
|
21862
21904
|
import { Internals as Internals52 } from "remotion";
|
|
21863
21905
|
|
|
21864
21906
|
// src/components/TimeValue.tsx
|
|
@@ -21867,7 +21909,7 @@ import {
|
|
|
21867
21909
|
useCallback as useCallback103,
|
|
21868
21910
|
useEffect as useEffect69,
|
|
21869
21911
|
useImperativeHandle as useImperativeHandle13,
|
|
21870
|
-
useRef as
|
|
21912
|
+
useRef as useRef38
|
|
21871
21913
|
} from "react";
|
|
21872
21914
|
import { Internals as Internals51, useCurrentFrame } from "remotion";
|
|
21873
21915
|
import { jsx as jsx197, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
@@ -21900,7 +21942,7 @@ var TimeValue = () => {
|
|
|
21900
21942
|
const isStill = useIsStill();
|
|
21901
21943
|
const { seek, play, pause, toggle } = PlayerInternals17.usePlayer();
|
|
21902
21944
|
const keybindings = useKeybinding();
|
|
21903
|
-
const ref =
|
|
21945
|
+
const ref = useRef38(null);
|
|
21904
21946
|
const onTextChange = useCallback103((newVal) => {
|
|
21905
21947
|
seek(parseInt(newVal, 10));
|
|
21906
21948
|
}, [seek]);
|
|
@@ -22028,7 +22070,7 @@ var TimelineTimeIndicators = () => {
|
|
|
22028
22070
|
});
|
|
22029
22071
|
};
|
|
22030
22072
|
var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
|
|
22031
|
-
const ref =
|
|
22073
|
+
const ref = useRef39(null);
|
|
22032
22074
|
useEffect70(() => {
|
|
22033
22075
|
const currentRef = ref.current;
|
|
22034
22076
|
if (!currentRef) {
|
|
@@ -22111,7 +22153,7 @@ var container42 = {
|
|
|
22111
22153
|
background: BACKGROUND
|
|
22112
22154
|
};
|
|
22113
22155
|
var TimelineList = ({ timeline }) => {
|
|
22114
|
-
const ref =
|
|
22156
|
+
const ref = useRef40(null);
|
|
22115
22157
|
const size4 = PlayerInternals18.useElementSize(ref, {
|
|
22116
22158
|
shouldApplyCssTransforms: false,
|
|
22117
22159
|
triggerOnWindowResize: false
|
|
@@ -22260,21 +22302,10 @@ var getTimelineSequenceLayout = ({
|
|
|
22260
22302
|
postmountDisplay
|
|
22261
22303
|
}) => {
|
|
22262
22304
|
const maxMediaSequenceDuration = (maxMediaDuration ?? Infinity) - startFromMedia;
|
|
22263
|
-
const lastFrame =
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
const
|
|
22267
|
-
const shouldAddHalfAFrameAtStart = startFrom > 0;
|
|
22268
|
-
if (shouldAddHalfAFrameAtEnd) {
|
|
22269
|
-
spatialDuration += 0.5;
|
|
22270
|
-
naturalSpatialDuration += 0.5;
|
|
22271
|
-
}
|
|
22272
|
-
if (shouldAddHalfAFrameAtStart) {
|
|
22273
|
-
spatialDuration += 0.5;
|
|
22274
|
-
naturalSpatialDuration += 0.5;
|
|
22275
|
-
}
|
|
22276
|
-
const startFromWithOffset = shouldAddHalfAFrameAtStart ? startFrom - 0.5 : startFrom;
|
|
22277
|
-
const marginLeft = lastFrame === 0 ? 0 : startFromWithOffset / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22305
|
+
const lastFrame = video.durationInFrames ?? 1;
|
|
22306
|
+
const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames, lastFrame - startFrom);
|
|
22307
|
+
const naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames);
|
|
22308
|
+
const marginLeft = lastFrame === 0 ? 0 : startFrom / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22278
22309
|
const nonNegativeMarginLeft = Math.min(marginLeft, 0);
|
|
22279
22310
|
const width = getWidthOfTrack({
|
|
22280
22311
|
durationInFrames,
|
|
@@ -22363,7 +22394,7 @@ var useMaxMediaDuration = (s, fps) => {
|
|
|
22363
22394
|
|
|
22364
22395
|
// src/components/AudioWaveform.tsx
|
|
22365
22396
|
import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
|
|
22366
|
-
import { useEffect as useEffect73, useMemo as useMemo110, useRef as
|
|
22397
|
+
import { useEffect as useEffect73, useMemo as useMemo110, useRef as useRef41, useState as useState74 } from "react";
|
|
22367
22398
|
import { Internals as Internals54 } from "remotion";
|
|
22368
22399
|
|
|
22369
22400
|
// src/components/AudioWaveformBar.tsx
|
|
@@ -22422,12 +22453,12 @@ var AudioWaveform = ({
|
|
|
22422
22453
|
}) => {
|
|
22423
22454
|
const [metadata, setMetadata] = useState74(null);
|
|
22424
22455
|
const [error, setError] = useState74(null);
|
|
22425
|
-
const mountState =
|
|
22456
|
+
const mountState = useRef41({ isMounted: true });
|
|
22426
22457
|
const vidConf = Internals54.useUnsafeVideoConfig();
|
|
22427
22458
|
if (vidConf === null) {
|
|
22428
22459
|
throw new Error("Expected video config");
|
|
22429
22460
|
}
|
|
22430
|
-
const canvas =
|
|
22461
|
+
const canvas = useRef41(null);
|
|
22431
22462
|
useEffect73(() => {
|
|
22432
22463
|
const { current } = mountState;
|
|
22433
22464
|
current.isMounted = true;
|
|
@@ -22627,7 +22658,8 @@ var relativeFrameStyle = {
|
|
|
22627
22658
|
fontSize: 11,
|
|
22628
22659
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
22629
22660
|
color: "white",
|
|
22630
|
-
opacity: 0.5
|
|
22661
|
+
opacity: 0.5,
|
|
22662
|
+
whiteSpace: "nowrap"
|
|
22631
22663
|
};
|
|
22632
22664
|
var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
22633
22665
|
return /* @__PURE__ */ jsx205("div", {
|
|
@@ -22637,7 +22669,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
|
22637
22669
|
};
|
|
22638
22670
|
|
|
22639
22671
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
22640
|
-
import { useEffect as useEffect74, useRef as
|
|
22672
|
+
import { useEffect as useEffect74, useRef as useRef42, useState as useState75 } from "react";
|
|
22641
22673
|
import { useVideoConfig as useVideoConfig5 } from "remotion";
|
|
22642
22674
|
|
|
22643
22675
|
// src/helpers/extract-frames.ts
|
|
@@ -22685,15 +22717,22 @@ async function extractFrames({
|
|
|
22685
22717
|
return;
|
|
22686
22718
|
}
|
|
22687
22719
|
const sink = new VideoSampleSink(videoTrack);
|
|
22688
|
-
|
|
22689
|
-
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22693
|
-
|
|
22694
|
-
|
|
22720
|
+
const sampleIterator = sink.samplesAtTimestamps(timestamps);
|
|
22721
|
+
try {
|
|
22722
|
+
for await (const videoSample of sampleIterator) {
|
|
22723
|
+
if (signal?.aborted) {
|
|
22724
|
+
videoSample?.close();
|
|
22725
|
+
break;
|
|
22726
|
+
}
|
|
22727
|
+
if (!videoSample) {
|
|
22728
|
+
continue;
|
|
22729
|
+
}
|
|
22730
|
+
onVideoSample(videoSample);
|
|
22695
22731
|
}
|
|
22696
|
-
|
|
22732
|
+
} finally {
|
|
22733
|
+
try {
|
|
22734
|
+
await sampleIterator.return?.();
|
|
22735
|
+
} catch {}
|
|
22697
22736
|
}
|
|
22698
22737
|
} catch (error) {
|
|
22699
22738
|
if (error instanceof InputDisposedError2) {
|
|
@@ -22966,9 +23005,9 @@ var TimelineVideoInfo = ({
|
|
|
22966
23005
|
playbackRate
|
|
22967
23006
|
}) => {
|
|
22968
23007
|
const { fps } = useVideoConfig5();
|
|
22969
|
-
const ref =
|
|
23008
|
+
const ref = useRef42(null);
|
|
22970
23009
|
const [error, setError] = useState75(null);
|
|
22971
|
-
const aspectRatio =
|
|
23010
|
+
const aspectRatio = useRef42(getAspectRatioFromCache(src));
|
|
22972
23011
|
useEffect74(() => {
|
|
22973
23012
|
return () => {
|
|
22974
23013
|
clearFramesForSrc(src);
|
|
@@ -23036,46 +23075,59 @@ var TimelineVideoInfo = ({
|
|
|
23036
23075
|
},
|
|
23037
23076
|
src,
|
|
23038
23077
|
onVideoSample: (sample) => {
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23057
|
-
|
|
23058
|
-
|
|
23078
|
+
let frame2;
|
|
23079
|
+
try {
|
|
23080
|
+
frame2 = sample.toVideoFrame();
|
|
23081
|
+
const scale = HEIGHT / frame2.displayHeight * window.devicePixelRatio;
|
|
23082
|
+
const transformed = resizeVideoFrame({
|
|
23083
|
+
frame: frame2,
|
|
23084
|
+
scale
|
|
23085
|
+
});
|
|
23086
|
+
if (transformed !== frame2) {
|
|
23087
|
+
frame2.close();
|
|
23088
|
+
}
|
|
23089
|
+
frame2 = undefined;
|
|
23090
|
+
const databaseKey = makeFrameDatabaseKey(src, transformed.timestamp);
|
|
23091
|
+
const existingFrame = frameDatabase.get(databaseKey);
|
|
23092
|
+
if (existingFrame) {
|
|
23093
|
+
existingFrame.frame.close();
|
|
23094
|
+
}
|
|
23095
|
+
frameDatabase.set(databaseKey, {
|
|
23096
|
+
frame: transformed,
|
|
23097
|
+
lastUsed: Date.now()
|
|
23098
|
+
});
|
|
23099
|
+
if (aspectRatio.current === null) {
|
|
23100
|
+
throw new Error("Aspect ratio is not set");
|
|
23101
|
+
}
|
|
23102
|
+
ensureSlots({
|
|
23103
|
+
filledSlots,
|
|
23104
|
+
fromSeconds,
|
|
23105
|
+
toSeconds,
|
|
23106
|
+
naturalWidth,
|
|
23107
|
+
aspectRatio: aspectRatio.current
|
|
23108
|
+
});
|
|
23109
|
+
fillFrameWhereItFits({
|
|
23110
|
+
ctx,
|
|
23111
|
+
filledSlots,
|
|
23112
|
+
visualizationWidth: naturalWidth,
|
|
23113
|
+
frame: transformed,
|
|
23114
|
+
segmentDuration: toSeconds - fromSeconds,
|
|
23115
|
+
fromSeconds
|
|
23116
|
+
});
|
|
23117
|
+
} catch (e) {
|
|
23118
|
+
if (frame2) {
|
|
23119
|
+
frame2.close();
|
|
23120
|
+
}
|
|
23121
|
+
throw e;
|
|
23122
|
+
} finally {
|
|
23123
|
+
sample.close();
|
|
23059
23124
|
}
|
|
23060
|
-
ensureSlots({
|
|
23061
|
-
filledSlots,
|
|
23062
|
-
fromSeconds,
|
|
23063
|
-
toSeconds,
|
|
23064
|
-
naturalWidth,
|
|
23065
|
-
aspectRatio: aspectRatio.current
|
|
23066
|
-
});
|
|
23067
|
-
fillFrameWhereItFits({
|
|
23068
|
-
ctx,
|
|
23069
|
-
filledSlots,
|
|
23070
|
-
visualizationWidth: naturalWidth,
|
|
23071
|
-
frame: transformed,
|
|
23072
|
-
segmentDuration: toSeconds - fromSeconds,
|
|
23073
|
-
fromSeconds
|
|
23074
|
-
});
|
|
23075
|
-
sample.close();
|
|
23076
23125
|
},
|
|
23077
23126
|
signal: controller.signal
|
|
23078
23127
|
}).then(() => {
|
|
23128
|
+
if (controller.signal.aborted) {
|
|
23129
|
+
return;
|
|
23130
|
+
}
|
|
23079
23131
|
fillWithCachedFrames({
|
|
23080
23132
|
ctx,
|
|
23081
23133
|
naturalWidth,
|
|
@@ -23251,7 +23303,8 @@ var getExpandedPlaceholderStyle = (controls) => ({
|
|
|
23251
23303
|
});
|
|
23252
23304
|
var TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
23253
23305
|
const { expandedTracks } = useContext73(ExpandedTracksContext);
|
|
23254
|
-
const
|
|
23306
|
+
const { previewServerState } = useContext73(StudioServerConnectionCtx);
|
|
23307
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23255
23308
|
const timelineStyle = useMemo112(() => {
|
|
23256
23309
|
return {
|
|
23257
23310
|
...timelineContent,
|
|
@@ -24892,7 +24945,7 @@ import {
|
|
|
24892
24945
|
useContext as useContext85,
|
|
24893
24946
|
useEffect as useEffect80,
|
|
24894
24947
|
useMemo as useMemo121,
|
|
24895
|
-
useRef as
|
|
24948
|
+
useRef as useRef44,
|
|
24896
24949
|
useState as useState81
|
|
24897
24950
|
} from "react";
|
|
24898
24951
|
import { Internals as Internals63 } from "remotion";
|
|
@@ -25765,7 +25818,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
25765
25818
|
};
|
|
25766
25819
|
|
|
25767
25820
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
25768
|
-
import { useEffect as useEffect79, useMemo as useMemo120, useRef as
|
|
25821
|
+
import { useEffect as useEffect79, useMemo as useMemo120, useRef as useRef43, useState as useState80 } from "react";
|
|
25769
25822
|
import { jsx as jsx227, jsxs as jsxs116, Fragment as Fragment36 } from "react/jsx-runtime";
|
|
25770
25823
|
var container50 = {
|
|
25771
25824
|
paddingLeft: 16,
|
|
@@ -25795,7 +25848,7 @@ var labelContainer = {
|
|
|
25795
25848
|
};
|
|
25796
25849
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
25797
25850
|
const [hovered, setIsHovered] = useState80(false);
|
|
25798
|
-
const ref =
|
|
25851
|
+
const ref = useRef43(null);
|
|
25799
25852
|
const keybindings = useKeybinding();
|
|
25800
25853
|
useEffect79(() => {
|
|
25801
25854
|
const { current } = ref;
|
|
@@ -25973,7 +26026,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
25973
26026
|
selectedIndex: 0
|
|
25974
26027
|
});
|
|
25975
26028
|
}, [initialMode, invocationTimestamp]);
|
|
25976
|
-
const inputRef =
|
|
26029
|
+
const inputRef = useRef44(null);
|
|
25977
26030
|
const selectComposition = useSelectComposition();
|
|
25978
26031
|
const closeMenu = useCallback112(() => {
|
|
25979
26032
|
return;
|
|
@@ -26733,7 +26786,7 @@ import {
|
|
|
26733
26786
|
useEffect as useEffect83,
|
|
26734
26787
|
useMemo as useMemo132,
|
|
26735
26788
|
useReducer as useReducer2,
|
|
26736
|
-
useRef as
|
|
26789
|
+
useRef as useRef46,
|
|
26737
26790
|
useState as useState87
|
|
26738
26791
|
} from "react";
|
|
26739
26792
|
|
|
@@ -28476,12 +28529,12 @@ import { BrowserSafeApis as BrowserSafeApis6 } from "@remotion/renderer/client";
|
|
|
28476
28529
|
import { useCallback as useCallback124, useMemo as useMemo127 } from "react";
|
|
28477
28530
|
|
|
28478
28531
|
// src/helpers/use-file-existence.ts
|
|
28479
|
-
import { useContext as useContext87, useEffect as useEffect82, useRef as
|
|
28532
|
+
import { useContext as useContext87, useEffect as useEffect82, useRef as useRef45, useState as useState86 } from "react";
|
|
28480
28533
|
var useFileExistence = (outName) => {
|
|
28481
28534
|
const [exists, setExists] = useState86(false);
|
|
28482
28535
|
const { previewServerState: state, subscribeToEvent } = useContext87(StudioServerConnectionCtx);
|
|
28483
28536
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
28484
|
-
const currentOutName =
|
|
28537
|
+
const currentOutName = useRef45("");
|
|
28485
28538
|
currentOutName.current = outName;
|
|
28486
28539
|
useEffect82(() => {
|
|
28487
28540
|
if (!clientId) {
|
|
@@ -29869,7 +29922,7 @@ var RenderModal = ({
|
|
|
29869
29922
|
resolved: { result: resolvedComposition },
|
|
29870
29923
|
unresolved: unresolvedComposition
|
|
29871
29924
|
} = context;
|
|
29872
|
-
const isMounted =
|
|
29925
|
+
const isMounted = useRef46(true);
|
|
29873
29926
|
const [isVideo] = useState87(() => {
|
|
29874
29927
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
29875
29928
|
});
|
|
@@ -30864,9 +30917,9 @@ import {
|
|
|
30864
30917
|
getEncodableAudioCodecs,
|
|
30865
30918
|
getSupportedAudioCodecsForContainer
|
|
30866
30919
|
} from "@remotion/web-renderer";
|
|
30867
|
-
import { useEffect as useEffect84, useRef as
|
|
30920
|
+
import { useEffect as useEffect84, useRef as useRef47, useState as useState88 } from "react";
|
|
30868
30921
|
var useEncodableAudioCodecs = (container61) => {
|
|
30869
|
-
const cacheRef =
|
|
30922
|
+
const cacheRef = useRef47({});
|
|
30870
30923
|
const [codecsByContainer, setCodecsByContainer] = useState88(() => {
|
|
30871
30924
|
return {
|
|
30872
30925
|
[container61]: getSupportedAudioCodecsForContainer(container61)
|
|
@@ -30906,9 +30959,9 @@ import {
|
|
|
30906
30959
|
getEncodableVideoCodecs,
|
|
30907
30960
|
getSupportedVideoCodecsForContainer
|
|
30908
30961
|
} from "@remotion/web-renderer";
|
|
30909
|
-
import { useEffect as useEffect85, useRef as
|
|
30962
|
+
import { useEffect as useEffect85, useRef as useRef48, useState as useState89 } from "react";
|
|
30910
30963
|
var useEncodableVideoCodecs = (container61) => {
|
|
30911
|
-
const cacheRef =
|
|
30964
|
+
const cacheRef = useRef48({});
|
|
30912
30965
|
const [codecsByContainer, setCodecsByContainer] = useState89(() => {
|
|
30913
30966
|
return {
|
|
30914
30967
|
[container61]: getSupportedVideoCodecsForContainer(container61)
|
|
@@ -33247,15 +33300,15 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
33247
33300
|
};
|
|
33248
33301
|
|
|
33249
33302
|
// src/components/ShowGuidesProvider.tsx
|
|
33250
|
-
import { useCallback as useCallback143, useMemo as useMemo146, useRef as
|
|
33303
|
+
import { useCallback as useCallback143, useMemo as useMemo146, useRef as useRef49, useState as useState99 } from "react";
|
|
33251
33304
|
import { jsx as jsx286 } from "react/jsx-runtime";
|
|
33252
33305
|
var ShowGuidesProvider = ({ children }) => {
|
|
33253
33306
|
const [guidesList, setGuidesList] = useState99(() => loadGuidesList());
|
|
33254
33307
|
const [selectedGuideId, setSelectedGuideId] = useState99(null);
|
|
33255
33308
|
const [hoveredGuideId, setHoveredGuideId] = useState99(null);
|
|
33256
33309
|
const [editorShowGuides, setEditorShowGuidesState] = useState99(() => loadEditorShowGuidesOption());
|
|
33257
|
-
const shouldCreateGuideRef =
|
|
33258
|
-
const shouldDeleteGuideRef =
|
|
33310
|
+
const shouldCreateGuideRef = useRef49(false);
|
|
33311
|
+
const shouldDeleteGuideRef = useRef49(false);
|
|
33259
33312
|
const setEditorShowGuides = useCallback143((newValue) => {
|
|
33260
33313
|
setEditorShowGuidesState((prevState) => {
|
|
33261
33314
|
const newVal = newValue(prevState);
|