@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
|
@@ -100,184 +100,6 @@ var setCurrentFps = (d) => {
|
|
|
100
100
|
// src/components/Timeline/timeline-scroll-logic.ts
|
|
101
101
|
import { interpolate } from "remotion";
|
|
102
102
|
|
|
103
|
-
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
104
|
-
var zodSafeParse = (schema, data) => {
|
|
105
|
-
return schema.safeParse(data);
|
|
106
|
-
};
|
|
107
|
-
var getZodDef = (schema) => {
|
|
108
|
-
if (schema._def)
|
|
109
|
-
return schema._def;
|
|
110
|
-
if (schema._zod)
|
|
111
|
-
return schema._zod.def;
|
|
112
|
-
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
113
|
-
};
|
|
114
|
-
var v3TypeNameMap = {
|
|
115
|
-
ZodString: "string",
|
|
116
|
-
ZodNumber: "number",
|
|
117
|
-
ZodBoolean: "boolean",
|
|
118
|
-
ZodObject: "object",
|
|
119
|
-
ZodArray: "array",
|
|
120
|
-
ZodEnum: "enum",
|
|
121
|
-
ZodUnion: "union",
|
|
122
|
-
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
123
|
-
ZodOptional: "optional",
|
|
124
|
-
ZodNullable: "nullable",
|
|
125
|
-
ZodDefault: "default",
|
|
126
|
-
ZodTuple: "tuple",
|
|
127
|
-
ZodDate: "date",
|
|
128
|
-
ZodAny: "any",
|
|
129
|
-
ZodUnknown: "unknown",
|
|
130
|
-
ZodBigInt: "bigint",
|
|
131
|
-
ZodNull: "null",
|
|
132
|
-
ZodUndefined: "undefined",
|
|
133
|
-
ZodEffects: "effects",
|
|
134
|
-
ZodLiteral: "literal",
|
|
135
|
-
ZodRecord: "record",
|
|
136
|
-
ZodNever: "never",
|
|
137
|
-
ZodVoid: "void",
|
|
138
|
-
ZodNaN: "nan",
|
|
139
|
-
ZodSymbol: "symbol",
|
|
140
|
-
ZodIntersection: "intersection",
|
|
141
|
-
ZodMap: "map",
|
|
142
|
-
ZodSet: "set",
|
|
143
|
-
ZodLazy: "lazy",
|
|
144
|
-
ZodFunction: "function",
|
|
145
|
-
ZodNativeEnum: "nativeEnum",
|
|
146
|
-
ZodCatch: "catch",
|
|
147
|
-
ZodPromise: "promise",
|
|
148
|
-
ZodBranded: "branded",
|
|
149
|
-
ZodPipeline: "pipeline"
|
|
150
|
-
};
|
|
151
|
-
var isZodV3Schema = (schema) => {
|
|
152
|
-
const def = getZodDef(schema);
|
|
153
|
-
return "typeName" in def;
|
|
154
|
-
};
|
|
155
|
-
var getZodSchemaType = (schema) => {
|
|
156
|
-
const def = getZodDef(schema);
|
|
157
|
-
if ("typeName" in def) {
|
|
158
|
-
const { typeName } = def;
|
|
159
|
-
return v3TypeNameMap[typeName] ?? typeName;
|
|
160
|
-
}
|
|
161
|
-
const { type } = def;
|
|
162
|
-
if (type === "union" && def.discriminator !== undefined) {
|
|
163
|
-
return "discriminatedUnion";
|
|
164
|
-
}
|
|
165
|
-
return type;
|
|
166
|
-
};
|
|
167
|
-
var getZodSchemaDescription = (schema) => {
|
|
168
|
-
if (isZodV3Schema(schema)) {
|
|
169
|
-
return getZodDef(schema).description;
|
|
170
|
-
}
|
|
171
|
-
return schema.description;
|
|
172
|
-
};
|
|
173
|
-
var getObjectShape = (schema) => {
|
|
174
|
-
const { shape } = getZodDef(schema);
|
|
175
|
-
return typeof shape === "function" ? shape() : shape;
|
|
176
|
-
};
|
|
177
|
-
var getArrayElement = (schema) => {
|
|
178
|
-
const def = getZodDef(schema);
|
|
179
|
-
return isZodV3Schema(schema) ? def.type : def.element;
|
|
180
|
-
};
|
|
181
|
-
var getInnerType = (schema) => {
|
|
182
|
-
return getZodDef(schema).innerType;
|
|
183
|
-
};
|
|
184
|
-
var getEffectsInner = (schema) => {
|
|
185
|
-
return getZodDef(schema).schema;
|
|
186
|
-
};
|
|
187
|
-
var getLiteralValue = (schema) => {
|
|
188
|
-
const def = getZodDef(schema);
|
|
189
|
-
if (isZodV3Schema(schema)) {
|
|
190
|
-
return def.value;
|
|
191
|
-
}
|
|
192
|
-
return def.values?.[0];
|
|
193
|
-
};
|
|
194
|
-
var getEnumValues = (schema) => {
|
|
195
|
-
const def = getZodDef(schema);
|
|
196
|
-
if (isZodV3Schema(schema)) {
|
|
197
|
-
return def.values;
|
|
198
|
-
}
|
|
199
|
-
const { entries } = def;
|
|
200
|
-
return Object.values(entries);
|
|
201
|
-
};
|
|
202
|
-
var getFirstEnumValue = (schema) => {
|
|
203
|
-
const def = getZodDef(schema);
|
|
204
|
-
if (isZodV3Schema(schema)) {
|
|
205
|
-
if (def.typeName === "ZodNativeEnum") {
|
|
206
|
-
const vals = Object.values(def.values);
|
|
207
|
-
return vals[0];
|
|
208
|
-
}
|
|
209
|
-
return def.values[0];
|
|
210
|
-
}
|
|
211
|
-
const { entries } = def;
|
|
212
|
-
const pairs = Object.entries(entries);
|
|
213
|
-
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
214
|
-
if (hasReverseMapping) {
|
|
215
|
-
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
216
|
-
if (forwardPairs.length > 0) {
|
|
217
|
-
return forwardPairs[0][1];
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return Object.values(entries)[0];
|
|
221
|
-
};
|
|
222
|
-
var getUnionOptions = (schema) => {
|
|
223
|
-
return getZodDef(schema).options;
|
|
224
|
-
};
|
|
225
|
-
var getDefaultValue = (schema) => {
|
|
226
|
-
const dv = getZodDef(schema).defaultValue;
|
|
227
|
-
return typeof dv === "function" ? dv() : dv;
|
|
228
|
-
};
|
|
229
|
-
var getDiscriminator = (schema) => {
|
|
230
|
-
return getZodDef(schema).discriminator;
|
|
231
|
-
};
|
|
232
|
-
var getDiscriminatedOptionKeys = (schema) => {
|
|
233
|
-
const def = getZodDef(schema);
|
|
234
|
-
const discriminator = getDiscriminator(schema);
|
|
235
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
236
|
-
return [...def.optionsMap.keys()];
|
|
237
|
-
}
|
|
238
|
-
const options = getUnionOptions(schema);
|
|
239
|
-
return options.map((option) => {
|
|
240
|
-
const shape = getObjectShape(option);
|
|
241
|
-
const discriminatorSchema = shape[discriminator];
|
|
242
|
-
return getLiteralValue(discriminatorSchema);
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
246
|
-
const def = getZodDef(schema);
|
|
247
|
-
const discriminator = getDiscriminator(schema);
|
|
248
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
249
|
-
return def.optionsMap.get(discriminatorValue);
|
|
250
|
-
}
|
|
251
|
-
const options = getUnionOptions(schema);
|
|
252
|
-
return options.find((option) => {
|
|
253
|
-
const shape = getObjectShape(option);
|
|
254
|
-
const discriminatorSchema = shape[discriminator];
|
|
255
|
-
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
256
|
-
});
|
|
257
|
-
};
|
|
258
|
-
var getIntersectionSchemas = (schema) => {
|
|
259
|
-
const def = getZodDef(schema);
|
|
260
|
-
return { left: def.left, right: def.right };
|
|
261
|
-
};
|
|
262
|
-
var getTupleItems = (schema) => {
|
|
263
|
-
return getZodDef(schema).items;
|
|
264
|
-
};
|
|
265
|
-
var getRecordValueType = (schema) => {
|
|
266
|
-
return getZodDef(schema).valueType;
|
|
267
|
-
};
|
|
268
|
-
var getRecordKeyType = (schema) => {
|
|
269
|
-
return getZodDef(schema).keyType;
|
|
270
|
-
};
|
|
271
|
-
var getPipelineOutput = (schema) => {
|
|
272
|
-
return getZodDef(schema).out;
|
|
273
|
-
};
|
|
274
|
-
var getPipelineInput = (schema) => {
|
|
275
|
-
return getZodDef(schema).in;
|
|
276
|
-
};
|
|
277
|
-
var getBrandedInner = (schema) => {
|
|
278
|
-
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
279
|
-
};
|
|
280
|
-
|
|
281
103
|
// src/helpers/timeline-layout.ts
|
|
282
104
|
var TIMELINE_PADDING = 16;
|
|
283
105
|
var TIMELINE_BORDER = 1;
|
|
@@ -285,28 +107,17 @@ var TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
285
107
|
var TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
286
108
|
var SCHEMA_FIELD_ROW_HEIGHT = 26;
|
|
287
109
|
var UNSUPPORTED_FIELD_ROW_HEIGHT = 26;
|
|
288
|
-
var SUPPORTED_SCHEMA_TYPES = new Set([
|
|
289
|
-
"number",
|
|
290
|
-
"string",
|
|
291
|
-
"boolean",
|
|
292
|
-
"enum",
|
|
293
|
-
"date",
|
|
294
|
-
"array",
|
|
295
|
-
"object",
|
|
296
|
-
"optional",
|
|
297
|
-
"nullable",
|
|
298
|
-
"default"
|
|
299
|
-
]);
|
|
110
|
+
var SUPPORTED_SCHEMA_TYPES = new Set(["number", "boolean"]);
|
|
300
111
|
var getSchemaFields = (controls) => {
|
|
301
112
|
if (!controls) {
|
|
302
113
|
return null;
|
|
303
114
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const typeName = getZodSchemaType(fieldSchema);
|
|
115
|
+
return Object.entries(controls.schema).map(([key, fieldSchema]) => {
|
|
116
|
+
const typeName = fieldSchema.type;
|
|
307
117
|
const supported = SUPPORTED_SCHEMA_TYPES.has(typeName);
|
|
308
118
|
return {
|
|
309
119
|
key,
|
|
120
|
+
description: fieldSchema.description,
|
|
310
121
|
typeName,
|
|
311
122
|
supported,
|
|
312
123
|
rowHeight: supported ? SCHEMA_FIELD_ROW_HEIGHT : UNSUPPORTED_FIELD_ROW_HEIGHT,
|
|
@@ -11259,6 +11070,184 @@ import { Internals as Internals30 } from "remotion";
|
|
|
11259
11070
|
// src/api/save-default-props.ts
|
|
11260
11071
|
import { getRemotionEnvironment as getRemotionEnvironment4 } from "remotion";
|
|
11261
11072
|
|
|
11073
|
+
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
11074
|
+
var zodSafeParse = (schema, data) => {
|
|
11075
|
+
return schema.safeParse(data);
|
|
11076
|
+
};
|
|
11077
|
+
var getZodDef = (schema) => {
|
|
11078
|
+
if (schema._def)
|
|
11079
|
+
return schema._def;
|
|
11080
|
+
if (schema._zod)
|
|
11081
|
+
return schema._zod.def;
|
|
11082
|
+
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
11083
|
+
};
|
|
11084
|
+
var v3TypeNameMap = {
|
|
11085
|
+
ZodString: "string",
|
|
11086
|
+
ZodNumber: "number",
|
|
11087
|
+
ZodBoolean: "boolean",
|
|
11088
|
+
ZodObject: "object",
|
|
11089
|
+
ZodArray: "array",
|
|
11090
|
+
ZodEnum: "enum",
|
|
11091
|
+
ZodUnion: "union",
|
|
11092
|
+
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
11093
|
+
ZodOptional: "optional",
|
|
11094
|
+
ZodNullable: "nullable",
|
|
11095
|
+
ZodDefault: "default",
|
|
11096
|
+
ZodTuple: "tuple",
|
|
11097
|
+
ZodDate: "date",
|
|
11098
|
+
ZodAny: "any",
|
|
11099
|
+
ZodUnknown: "unknown",
|
|
11100
|
+
ZodBigInt: "bigint",
|
|
11101
|
+
ZodNull: "null",
|
|
11102
|
+
ZodUndefined: "undefined",
|
|
11103
|
+
ZodEffects: "effects",
|
|
11104
|
+
ZodLiteral: "literal",
|
|
11105
|
+
ZodRecord: "record",
|
|
11106
|
+
ZodNever: "never",
|
|
11107
|
+
ZodVoid: "void",
|
|
11108
|
+
ZodNaN: "nan",
|
|
11109
|
+
ZodSymbol: "symbol",
|
|
11110
|
+
ZodIntersection: "intersection",
|
|
11111
|
+
ZodMap: "map",
|
|
11112
|
+
ZodSet: "set",
|
|
11113
|
+
ZodLazy: "lazy",
|
|
11114
|
+
ZodFunction: "function",
|
|
11115
|
+
ZodNativeEnum: "nativeEnum",
|
|
11116
|
+
ZodCatch: "catch",
|
|
11117
|
+
ZodPromise: "promise",
|
|
11118
|
+
ZodBranded: "branded",
|
|
11119
|
+
ZodPipeline: "pipeline"
|
|
11120
|
+
};
|
|
11121
|
+
var isZodV3Schema = (schema) => {
|
|
11122
|
+
const def = getZodDef(schema);
|
|
11123
|
+
return "typeName" in def;
|
|
11124
|
+
};
|
|
11125
|
+
var getZodSchemaType = (schema) => {
|
|
11126
|
+
const def = getZodDef(schema);
|
|
11127
|
+
if ("typeName" in def) {
|
|
11128
|
+
const { typeName } = def;
|
|
11129
|
+
return v3TypeNameMap[typeName] ?? typeName;
|
|
11130
|
+
}
|
|
11131
|
+
const { type } = def;
|
|
11132
|
+
if (type === "union" && def.discriminator !== undefined) {
|
|
11133
|
+
return "discriminatedUnion";
|
|
11134
|
+
}
|
|
11135
|
+
return type;
|
|
11136
|
+
};
|
|
11137
|
+
var getZodSchemaDescription = (schema) => {
|
|
11138
|
+
if (isZodV3Schema(schema)) {
|
|
11139
|
+
return getZodDef(schema).description;
|
|
11140
|
+
}
|
|
11141
|
+
return schema.description;
|
|
11142
|
+
};
|
|
11143
|
+
var getObjectShape = (schema) => {
|
|
11144
|
+
const { shape } = getZodDef(schema);
|
|
11145
|
+
return typeof shape === "function" ? shape() : shape;
|
|
11146
|
+
};
|
|
11147
|
+
var getArrayElement = (schema) => {
|
|
11148
|
+
const def = getZodDef(schema);
|
|
11149
|
+
return isZodV3Schema(schema) ? def.type : def.element;
|
|
11150
|
+
};
|
|
11151
|
+
var getInnerType = (schema) => {
|
|
11152
|
+
return getZodDef(schema).innerType;
|
|
11153
|
+
};
|
|
11154
|
+
var getEffectsInner = (schema) => {
|
|
11155
|
+
return getZodDef(schema).schema;
|
|
11156
|
+
};
|
|
11157
|
+
var getLiteralValue = (schema) => {
|
|
11158
|
+
const def = getZodDef(schema);
|
|
11159
|
+
if (isZodV3Schema(schema)) {
|
|
11160
|
+
return def.value;
|
|
11161
|
+
}
|
|
11162
|
+
return def.values?.[0];
|
|
11163
|
+
};
|
|
11164
|
+
var getEnumValues = (schema) => {
|
|
11165
|
+
const def = getZodDef(schema);
|
|
11166
|
+
if (isZodV3Schema(schema)) {
|
|
11167
|
+
return def.values;
|
|
11168
|
+
}
|
|
11169
|
+
const { entries } = def;
|
|
11170
|
+
return Object.values(entries);
|
|
11171
|
+
};
|
|
11172
|
+
var getFirstEnumValue = (schema) => {
|
|
11173
|
+
const def = getZodDef(schema);
|
|
11174
|
+
if (isZodV3Schema(schema)) {
|
|
11175
|
+
if (def.typeName === "ZodNativeEnum") {
|
|
11176
|
+
const vals = Object.values(def.values);
|
|
11177
|
+
return vals[0];
|
|
11178
|
+
}
|
|
11179
|
+
return def.values[0];
|
|
11180
|
+
}
|
|
11181
|
+
const { entries } = def;
|
|
11182
|
+
const pairs = Object.entries(entries);
|
|
11183
|
+
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
11184
|
+
if (hasReverseMapping) {
|
|
11185
|
+
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
11186
|
+
if (forwardPairs.length > 0) {
|
|
11187
|
+
return forwardPairs[0][1];
|
|
11188
|
+
}
|
|
11189
|
+
}
|
|
11190
|
+
return Object.values(entries)[0];
|
|
11191
|
+
};
|
|
11192
|
+
var getUnionOptions = (schema) => {
|
|
11193
|
+
return getZodDef(schema).options;
|
|
11194
|
+
};
|
|
11195
|
+
var getDefaultValue = (schema) => {
|
|
11196
|
+
const dv = getZodDef(schema).defaultValue;
|
|
11197
|
+
return typeof dv === "function" ? dv() : dv;
|
|
11198
|
+
};
|
|
11199
|
+
var getDiscriminator = (schema) => {
|
|
11200
|
+
return getZodDef(schema).discriminator;
|
|
11201
|
+
};
|
|
11202
|
+
var getDiscriminatedOptionKeys = (schema) => {
|
|
11203
|
+
const def = getZodDef(schema);
|
|
11204
|
+
const discriminator = getDiscriminator(schema);
|
|
11205
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11206
|
+
return [...def.optionsMap.keys()];
|
|
11207
|
+
}
|
|
11208
|
+
const options = getUnionOptions(schema);
|
|
11209
|
+
return options.map((option) => {
|
|
11210
|
+
const shape = getObjectShape(option);
|
|
11211
|
+
const discriminatorSchema = shape[discriminator];
|
|
11212
|
+
return getLiteralValue(discriminatorSchema);
|
|
11213
|
+
});
|
|
11214
|
+
};
|
|
11215
|
+
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
11216
|
+
const def = getZodDef(schema);
|
|
11217
|
+
const discriminator = getDiscriminator(schema);
|
|
11218
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11219
|
+
return def.optionsMap.get(discriminatorValue);
|
|
11220
|
+
}
|
|
11221
|
+
const options = getUnionOptions(schema);
|
|
11222
|
+
return options.find((option) => {
|
|
11223
|
+
const shape = getObjectShape(option);
|
|
11224
|
+
const discriminatorSchema = shape[discriminator];
|
|
11225
|
+
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
11226
|
+
});
|
|
11227
|
+
};
|
|
11228
|
+
var getIntersectionSchemas = (schema) => {
|
|
11229
|
+
const def = getZodDef(schema);
|
|
11230
|
+
return { left: def.left, right: def.right };
|
|
11231
|
+
};
|
|
11232
|
+
var getTupleItems = (schema) => {
|
|
11233
|
+
return getZodDef(schema).items;
|
|
11234
|
+
};
|
|
11235
|
+
var getRecordValueType = (schema) => {
|
|
11236
|
+
return getZodDef(schema).valueType;
|
|
11237
|
+
};
|
|
11238
|
+
var getRecordKeyType = (schema) => {
|
|
11239
|
+
return getZodDef(schema).keyType;
|
|
11240
|
+
};
|
|
11241
|
+
var getPipelineOutput = (schema) => {
|
|
11242
|
+
return getZodDef(schema).out;
|
|
11243
|
+
};
|
|
11244
|
+
var getPipelineInput = (schema) => {
|
|
11245
|
+
return getZodDef(schema).in;
|
|
11246
|
+
};
|
|
11247
|
+
var getBrandedInner = (schema) => {
|
|
11248
|
+
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
11249
|
+
};
|
|
11250
|
+
|
|
11262
11251
|
// src/components/RenderModal/SchemaEditor/extract-enum-json-paths.ts
|
|
11263
11252
|
var extractEnumJsonPaths = ({
|
|
11264
11253
|
schema,
|
|
@@ -13610,7 +13599,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
13610
13599
|
return {
|
|
13611
13600
|
...inputBaseStyle,
|
|
13612
13601
|
backgroundColor: "transparent",
|
|
13613
|
-
borderColor: "transparent"
|
|
13602
|
+
borderColor: "transparent",
|
|
13603
|
+
padding: "4px 6px"
|
|
13614
13604
|
};
|
|
13615
13605
|
}, []);
|
|
13616
13606
|
const span = useMemo69(() => ({
|
|
@@ -21156,7 +21146,7 @@ var Inner2 = () => {
|
|
|
21156
21146
|
|
|
21157
21147
|
// src/components/Timeline/TimelineList.tsx
|
|
21158
21148
|
import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
21159
|
-
import { useRef as
|
|
21149
|
+
import { useRef as useRef40 } from "react";
|
|
21160
21150
|
|
|
21161
21151
|
// src/components/Timeline/TimelineListItem.tsx
|
|
21162
21152
|
import {
|
|
@@ -21201,6 +21191,7 @@ import {
|
|
|
21201
21191
|
useContext as useContext67,
|
|
21202
21192
|
useEffect as useEffect67,
|
|
21203
21193
|
useMemo as useMemo104,
|
|
21194
|
+
useRef as useRef37,
|
|
21204
21195
|
useState as useState70
|
|
21205
21196
|
} from "react";
|
|
21206
21197
|
import { Internals as Internals49 } from "remotion";
|
|
@@ -21218,19 +21209,15 @@ var draggerStyle = {
|
|
|
21218
21209
|
width: 80,
|
|
21219
21210
|
marginLeft: "auto"
|
|
21220
21211
|
};
|
|
21212
|
+
var checkboxContainer = {
|
|
21213
|
+
marginLeft: "auto"
|
|
21214
|
+
};
|
|
21221
21215
|
var notEditableBackground = {
|
|
21222
21216
|
backgroundColor: "rgba(255, 0, 0, 0.2)",
|
|
21223
21217
|
borderRadius: 3,
|
|
21224
21218
|
padding: "0 4px"
|
|
21225
21219
|
};
|
|
21226
|
-
var TimelineNumberField = ({
|
|
21227
|
-
field,
|
|
21228
|
-
canUpdate,
|
|
21229
|
-
onSave,
|
|
21230
|
-
onSavingChange,
|
|
21231
|
-
onDragValueChange,
|
|
21232
|
-
onDragEnd
|
|
21233
|
-
}) => {
|
|
21220
|
+
var TimelineNumberField = ({ field, codeValue, canUpdate, onSave, onDragValueChange, onDragEnd }) => {
|
|
21234
21221
|
const [dragValue, setDragValue] = useState69(null);
|
|
21235
21222
|
const dragging = useRef36(false);
|
|
21236
21223
|
const onValueChange = useCallback98((newVal) => {
|
|
@@ -21240,56 +21227,60 @@ var TimelineNumberField = ({
|
|
|
21240
21227
|
}, [onDragValueChange, field.key]);
|
|
21241
21228
|
useEffect66(() => {
|
|
21242
21229
|
setDragValue(null);
|
|
21243
|
-
onSavingChange(false);
|
|
21244
21230
|
onDragEnd();
|
|
21245
|
-
}, [field.currentValue,
|
|
21231
|
+
}, [field.currentValue, onDragEnd]);
|
|
21246
21232
|
const onValueChangeEnd = useCallback98((newVal) => {
|
|
21247
|
-
if (canUpdate && newVal !==
|
|
21248
|
-
onSavingChange(true);
|
|
21233
|
+
if (canUpdate && newVal !== codeValue) {
|
|
21249
21234
|
onSave(field.key, newVal).catch(() => {
|
|
21250
|
-
onSavingChange(false);
|
|
21251
21235
|
setDragValue(null);
|
|
21252
21236
|
});
|
|
21253
21237
|
} else {
|
|
21254
21238
|
setDragValue(null);
|
|
21255
21239
|
}
|
|
21256
|
-
}, [canUpdate, onSave,
|
|
21240
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21257
21241
|
const onTextChange = useCallback98((newVal) => {
|
|
21258
21242
|
if (canUpdate) {
|
|
21259
21243
|
const parsed = Number(newVal);
|
|
21260
|
-
if (!Number.isNaN(parsed) && parsed !==
|
|
21244
|
+
if (!Number.isNaN(parsed) && parsed !== codeValue) {
|
|
21261
21245
|
setDragValue(parsed);
|
|
21262
|
-
onSavingChange(true);
|
|
21263
21246
|
onSave(field.key, parsed).catch(() => {
|
|
21264
|
-
onSavingChange(false);
|
|
21265
21247
|
setDragValue(null);
|
|
21266
21248
|
});
|
|
21267
21249
|
}
|
|
21268
21250
|
}
|
|
21269
|
-
}, [canUpdate, onSave,
|
|
21251
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21270
21252
|
return /* @__PURE__ */ jsx192(InputDragger, {
|
|
21271
21253
|
type: "number",
|
|
21272
|
-
value: dragValue ??
|
|
21254
|
+
value: dragValue ?? codeValue,
|
|
21273
21255
|
style: draggerStyle,
|
|
21274
21256
|
status: "ok",
|
|
21275
21257
|
onValueChange,
|
|
21276
21258
|
onValueChangeEnd,
|
|
21277
21259
|
onTextChange,
|
|
21278
|
-
min:
|
|
21279
|
-
max:
|
|
21280
|
-
step:
|
|
21260
|
+
min: field.fieldSchema.type === "number" ? field.fieldSchema.min ?? -Infinity : -Infinity,
|
|
21261
|
+
max: field.fieldSchema.type === "number" ? field.fieldSchema.max ?? Infinity : Infinity,
|
|
21262
|
+
step: field.fieldSchema.type === "number" ? field.fieldSchema.step ?? 1 : 1,
|
|
21281
21263
|
rightAlign: true
|
|
21282
21264
|
});
|
|
21283
21265
|
};
|
|
21284
|
-
var
|
|
21285
|
-
|
|
21286
|
-
|
|
21287
|
-
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
21292
|
-
|
|
21266
|
+
var TimelineBooleanField = ({ field, codeValue, canUpdate, onSave }) => {
|
|
21267
|
+
const checked = Boolean(codeValue);
|
|
21268
|
+
const onChange = useCallback98(() => {
|
|
21269
|
+
if (canUpdate) {
|
|
21270
|
+
onSave(field.key, !checked);
|
|
21271
|
+
}
|
|
21272
|
+
}, [canUpdate, onSave, field.key, checked]);
|
|
21273
|
+
return /* @__PURE__ */ jsx192("div", {
|
|
21274
|
+
style: checkboxContainer,
|
|
21275
|
+
children: /* @__PURE__ */ jsx192(Checkbox, {
|
|
21276
|
+
checked,
|
|
21277
|
+
onChange,
|
|
21278
|
+
name: field.key,
|
|
21279
|
+
disabled: !canUpdate
|
|
21280
|
+
})
|
|
21281
|
+
});
|
|
21282
|
+
};
|
|
21283
|
+
var TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, canUpdate }) => {
|
|
21293
21284
|
const wrapperStyle = canUpdate === null || canUpdate === false ? notEditableBackground : undefined;
|
|
21294
21285
|
if (!field.supported) {
|
|
21295
21286
|
return /* @__PURE__ */ jsx192("span", {
|
|
@@ -21312,31 +21303,34 @@ var TimelineFieldValue = ({
|
|
|
21312
21303
|
})
|
|
21313
21304
|
});
|
|
21314
21305
|
}
|
|
21306
|
+
const effectiveCodeValue = propStatus.codeValue ?? field.currentValue ?? field.fieldSchema.default;
|
|
21315
21307
|
if (field.typeName === "number") {
|
|
21316
21308
|
return /* @__PURE__ */ jsx192("span", {
|
|
21317
21309
|
style: wrapperStyle,
|
|
21318
21310
|
children: /* @__PURE__ */ jsx192(TimelineNumberField, {
|
|
21319
21311
|
field,
|
|
21312
|
+
codeValue: effectiveCodeValue,
|
|
21320
21313
|
canUpdate,
|
|
21321
21314
|
onSave,
|
|
21322
|
-
onSavingChange,
|
|
21323
21315
|
onDragValueChange,
|
|
21324
21316
|
onDragEnd
|
|
21325
21317
|
})
|
|
21326
21318
|
});
|
|
21327
21319
|
}
|
|
21320
|
+
if (field.typeName === "boolean") {
|
|
21321
|
+
return /* @__PURE__ */ jsx192("span", {
|
|
21322
|
+
style: wrapperStyle,
|
|
21323
|
+
children: /* @__PURE__ */ jsx192(TimelineBooleanField, {
|
|
21324
|
+
field,
|
|
21325
|
+
codeValue: effectiveCodeValue,
|
|
21326
|
+
canUpdate,
|
|
21327
|
+
onSave
|
|
21328
|
+
})
|
|
21329
|
+
});
|
|
21330
|
+
}
|
|
21328
21331
|
return /* @__PURE__ */ jsx192("span", {
|
|
21329
21332
|
style: { ...unsupportedLabel, fontStyle: "normal" },
|
|
21330
|
-
children: String(
|
|
21331
|
-
});
|
|
21332
|
-
};
|
|
21333
|
-
var TimelineFieldSavingSpinner = ({ saving }) => {
|
|
21334
|
-
if (!saving) {
|
|
21335
|
-
return null;
|
|
21336
|
-
}
|
|
21337
|
-
return /* @__PURE__ */ jsx192(Spinner, {
|
|
21338
|
-
duration: 0.5,
|
|
21339
|
-
size: 12
|
|
21333
|
+
children: String(effectiveCodeValue)
|
|
21340
21334
|
});
|
|
21341
21335
|
};
|
|
21342
21336
|
|
|
@@ -21368,30 +21362,20 @@ var fieldLabelRow = {
|
|
|
21368
21362
|
gap: 6
|
|
21369
21363
|
};
|
|
21370
21364
|
var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatus }) => {
|
|
21371
|
-
const [saving, setSaving] = useState70(false);
|
|
21372
|
-
const onSavingChange = useCallback99((s) => {
|
|
21373
|
-
setSaving(s);
|
|
21374
|
-
}, []);
|
|
21375
21365
|
return /* @__PURE__ */ jsxs92("div", {
|
|
21376
21366
|
style: { ...fieldRow, height: field.rowHeight },
|
|
21377
21367
|
children: [
|
|
21378
|
-
/* @__PURE__ */
|
|
21368
|
+
/* @__PURE__ */ jsx193("div", {
|
|
21379
21369
|
style: fieldLabelRow,
|
|
21380
|
-
children:
|
|
21381
|
-
|
|
21382
|
-
|
|
21383
|
-
|
|
21384
|
-
}),
|
|
21385
|
-
/* @__PURE__ */ jsx193(TimelineFieldSavingSpinner, {
|
|
21386
|
-
saving
|
|
21387
|
-
})
|
|
21388
|
-
]
|
|
21370
|
+
children: /* @__PURE__ */ jsx193("span", {
|
|
21371
|
+
style: fieldName,
|
|
21372
|
+
children: field.description ?? field.key
|
|
21373
|
+
})
|
|
21389
21374
|
}),
|
|
21390
21375
|
/* @__PURE__ */ jsx193(TimelineFieldValue, {
|
|
21391
21376
|
field,
|
|
21392
21377
|
propStatus,
|
|
21393
21378
|
onSave,
|
|
21394
|
-
onSavingChange,
|
|
21395
21379
|
onDragValueChange,
|
|
21396
21380
|
onDragEnd,
|
|
21397
21381
|
canUpdate: propStatus?.canUpdate ?? false
|
|
@@ -21401,6 +21385,8 @@ var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatu
|
|
|
21401
21385
|
};
|
|
21402
21386
|
var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
21403
21387
|
const [propStatuses, setPropStatuses] = useState70(null);
|
|
21388
|
+
const { previewServerState: state, subscribeToEvent } = useContext67(StudioServerConnectionCtx);
|
|
21389
|
+
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
21404
21390
|
const schemaFields = useMemo104(() => getSchemaFields(sequence.controls), [sequence.controls]);
|
|
21405
21391
|
const validatedLocation = useMemo104(() => {
|
|
21406
21392
|
if (!originalLocation || !originalLocation.source || !originalLocation.line) {
|
|
@@ -21412,17 +21398,32 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21412
21398
|
column: originalLocation.column ?? 0
|
|
21413
21399
|
};
|
|
21414
21400
|
}, [originalLocation]);
|
|
21401
|
+
const locationSource = validatedLocation?.source ?? null;
|
|
21402
|
+
const locationLine = validatedLocation?.line ?? null;
|
|
21403
|
+
const locationColumn = validatedLocation?.column ?? null;
|
|
21404
|
+
const schemaKeysString = useMemo104(() => schemaFields ? schemaFields.map((f) => f.key).join(",") : null, [schemaFields]);
|
|
21405
|
+
const currentLocationSource = useRef37(locationSource);
|
|
21406
|
+
currentLocationSource.current = locationSource;
|
|
21407
|
+
const currentLocationLine = useRef37(locationLine);
|
|
21408
|
+
currentLocationLine.current = locationLine;
|
|
21409
|
+
const currentLocationColumn = useRef37(locationColumn);
|
|
21410
|
+
currentLocationColumn.current = locationColumn;
|
|
21415
21411
|
useEffect67(() => {
|
|
21416
|
-
if (!
|
|
21412
|
+
if (!clientId || !locationSource || !locationLine || locationColumn === null || !schemaKeysString) {
|
|
21417
21413
|
setPropStatuses(null);
|
|
21418
21414
|
return;
|
|
21419
21415
|
}
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
|
|
21424
|
-
|
|
21416
|
+
const keys = schemaKeysString.split(",");
|
|
21417
|
+
callApi("/api/subscribe-to-sequence-props", {
|
|
21418
|
+
fileName: locationSource,
|
|
21419
|
+
line: locationLine,
|
|
21420
|
+
column: locationColumn,
|
|
21421
|
+
keys,
|
|
21422
|
+
clientId
|
|
21425
21423
|
}).then((result) => {
|
|
21424
|
+
if (currentLocationSource.current !== locationSource || currentLocationLine.current !== locationLine || currentLocationColumn.current !== locationColumn) {
|
|
21425
|
+
return;
|
|
21426
|
+
}
|
|
21426
21427
|
if (result.canUpdate) {
|
|
21427
21428
|
setPropStatuses(result.props);
|
|
21428
21429
|
} else {
|
|
@@ -21431,7 +21432,43 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21431
21432
|
}).catch(() => {
|
|
21432
21433
|
setPropStatuses(null);
|
|
21433
21434
|
});
|
|
21434
|
-
|
|
21435
|
+
return () => {
|
|
21436
|
+
callApi("/api/unsubscribe-from-sequence-props", {
|
|
21437
|
+
fileName: locationSource,
|
|
21438
|
+
line: locationLine,
|
|
21439
|
+
column: locationColumn,
|
|
21440
|
+
clientId
|
|
21441
|
+
}).catch(() => {});
|
|
21442
|
+
};
|
|
21443
|
+
}, [
|
|
21444
|
+
clientId,
|
|
21445
|
+
locationSource,
|
|
21446
|
+
locationLine,
|
|
21447
|
+
locationColumn,
|
|
21448
|
+
schemaKeysString
|
|
21449
|
+
]);
|
|
21450
|
+
useEffect67(() => {
|
|
21451
|
+
if (!locationSource || !locationLine || locationColumn === null) {
|
|
21452
|
+
return;
|
|
21453
|
+
}
|
|
21454
|
+
const listener = (event) => {
|
|
21455
|
+
if (event.type !== "sequence-props-updated") {
|
|
21456
|
+
return;
|
|
21457
|
+
}
|
|
21458
|
+
if (event.fileName !== currentLocationSource.current || event.line !== currentLocationLine.current || event.column !== currentLocationColumn.current) {
|
|
21459
|
+
return;
|
|
21460
|
+
}
|
|
21461
|
+
if (event.result.canUpdate) {
|
|
21462
|
+
setPropStatuses(event.result.props);
|
|
21463
|
+
} else {
|
|
21464
|
+
setPropStatuses(null);
|
|
21465
|
+
}
|
|
21466
|
+
};
|
|
21467
|
+
const unsub = subscribeToEvent("sequence-props-updated", listener);
|
|
21468
|
+
return () => {
|
|
21469
|
+
unsub();
|
|
21470
|
+
};
|
|
21471
|
+
}, [locationSource, locationLine, locationColumn, subscribeToEvent]);
|
|
21435
21472
|
const expandedHeight = useMemo104(() => getExpandedTrackHeight(sequence.controls), [sequence.controls]);
|
|
21436
21473
|
const { setOverride, clearOverrides } = useContext67(Internals49.SequenceControlOverrideContext);
|
|
21437
21474
|
const onSave = useCallback99((key4, value) => {
|
|
@@ -21442,23 +21479,27 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21442
21479
|
if (!status || !status.canUpdate) {
|
|
21443
21480
|
return Promise.reject(new Error("Cannot save"));
|
|
21444
21481
|
}
|
|
21482
|
+
const field = schemaFields?.find((f) => f.key === key4);
|
|
21483
|
+
const defaultValue = field && field.fieldSchema.default !== undefined ? JSON.stringify(field.fieldSchema.default) : null;
|
|
21445
21484
|
return callApi("/api/save-sequence-props", {
|
|
21446
21485
|
fileName: validatedLocation.source,
|
|
21447
21486
|
line: validatedLocation.line,
|
|
21448
21487
|
column: validatedLocation.column,
|
|
21449
21488
|
key: key4,
|
|
21450
21489
|
value: JSON.stringify(value),
|
|
21451
|
-
enumPaths: []
|
|
21490
|
+
enumPaths: [],
|
|
21491
|
+
defaultValue
|
|
21452
21492
|
}).then(() => {
|
|
21453
21493
|
return;
|
|
21454
21494
|
});
|
|
21455
|
-
}, [propStatuses, validatedLocation]);
|
|
21495
|
+
}, [propStatuses, validatedLocation, schemaFields]);
|
|
21496
|
+
const overrideId = sequence.controls?.overrideId ?? sequence.id;
|
|
21456
21497
|
const onDragValueChange = useCallback99((key4, value) => {
|
|
21457
|
-
setOverride(
|
|
21458
|
-
}, [setOverride,
|
|
21498
|
+
setOverride(overrideId, key4, value);
|
|
21499
|
+
}, [setOverride, overrideId]);
|
|
21459
21500
|
const onDragEnd = useCallback99(() => {
|
|
21460
|
-
clearOverrides(
|
|
21461
|
-
}, [clearOverrides,
|
|
21501
|
+
clearOverrides(overrideId);
|
|
21502
|
+
}, [clearOverrides, overrideId]);
|
|
21462
21503
|
return /* @__PURE__ */ jsx193("div", {
|
|
21463
21504
|
style: { ...expandedSectionBase, height: expandedHeight },
|
|
21464
21505
|
children: schemaFields ? schemaFields.map((field) => /* @__PURE__ */ jsx193(TimelineFieldRow, {
|
|
@@ -21733,7 +21774,8 @@ var arrowButton = {
|
|
|
21733
21774
|
lineHeight: 1
|
|
21734
21775
|
};
|
|
21735
21776
|
var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
21736
|
-
const
|
|
21777
|
+
const { previewServerState } = useContext69(StudioServerConnectionCtx);
|
|
21778
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
21737
21779
|
const { hidden, setHidden } = useContext69(Internals50.SequenceVisibilityToggleContext);
|
|
21738
21780
|
const { expandedTracks, toggleTrack } = useContext69(ExpandedTracksContext);
|
|
21739
21781
|
const [originalLocation, setOriginalLocation] = useState72(null);
|
|
@@ -21747,7 +21789,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
21747
21789
|
console.error("Could not get original location of Sequence", err);
|
|
21748
21790
|
});
|
|
21749
21791
|
}, [sequence.stack]);
|
|
21750
|
-
const isExpanded = expandedTracks[sequence.id] ?? false;
|
|
21792
|
+
const isExpanded = visualModeEnabled && (expandedTracks[sequence.id] ?? false);
|
|
21751
21793
|
const onToggleExpand = useCallback102(() => {
|
|
21752
21794
|
toggleTrack(sequence.id);
|
|
21753
21795
|
}, [sequence.id, toggleTrack]);
|
|
@@ -21839,7 +21881,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
21839
21881
|
};
|
|
21840
21882
|
|
|
21841
21883
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
21842
|
-
import { useContext as useContext70, useEffect as useEffect70, useMemo as useMemo107, useRef as
|
|
21884
|
+
import { useContext as useContext70, useEffect as useEffect70, useMemo as useMemo107, useRef as useRef39 } from "react";
|
|
21843
21885
|
import { Internals as Internals52 } from "remotion";
|
|
21844
21886
|
|
|
21845
21887
|
// src/components/TimeValue.tsx
|
|
@@ -21848,7 +21890,7 @@ import {
|
|
|
21848
21890
|
useCallback as useCallback103,
|
|
21849
21891
|
useEffect as useEffect69,
|
|
21850
21892
|
useImperativeHandle as useImperativeHandle13,
|
|
21851
|
-
useRef as
|
|
21893
|
+
useRef as useRef38
|
|
21852
21894
|
} from "react";
|
|
21853
21895
|
import { Internals as Internals51, useCurrentFrame } from "remotion";
|
|
21854
21896
|
import { jsx as jsx197, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
@@ -21881,7 +21923,7 @@ var TimeValue = () => {
|
|
|
21881
21923
|
const isStill = useIsStill();
|
|
21882
21924
|
const { seek, play, pause, toggle } = PlayerInternals17.usePlayer();
|
|
21883
21925
|
const keybindings = useKeybinding();
|
|
21884
|
-
const ref =
|
|
21926
|
+
const ref = useRef38(null);
|
|
21885
21927
|
const onTextChange = useCallback103((newVal) => {
|
|
21886
21928
|
seek(parseInt(newVal, 10));
|
|
21887
21929
|
}, [seek]);
|
|
@@ -22009,7 +22051,7 @@ var TimelineTimeIndicators = () => {
|
|
|
22009
22051
|
});
|
|
22010
22052
|
};
|
|
22011
22053
|
var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
|
|
22012
|
-
const ref =
|
|
22054
|
+
const ref = useRef39(null);
|
|
22013
22055
|
useEffect70(() => {
|
|
22014
22056
|
const currentRef = ref.current;
|
|
22015
22057
|
if (!currentRef) {
|
|
@@ -22092,7 +22134,7 @@ var container42 = {
|
|
|
22092
22134
|
background: BACKGROUND
|
|
22093
22135
|
};
|
|
22094
22136
|
var TimelineList = ({ timeline }) => {
|
|
22095
|
-
const ref =
|
|
22137
|
+
const ref = useRef40(null);
|
|
22096
22138
|
const size4 = PlayerInternals18.useElementSize(ref, {
|
|
22097
22139
|
shouldApplyCssTransforms: false,
|
|
22098
22140
|
triggerOnWindowResize: false
|
|
@@ -22241,21 +22283,10 @@ var getTimelineSequenceLayout = ({
|
|
|
22241
22283
|
postmountDisplay
|
|
22242
22284
|
}) => {
|
|
22243
22285
|
const maxMediaSequenceDuration = (maxMediaDuration ?? Infinity) - startFromMedia;
|
|
22244
|
-
const lastFrame =
|
|
22245
|
-
|
|
22246
|
-
|
|
22247
|
-
const
|
|
22248
|
-
const shouldAddHalfAFrameAtStart = startFrom > 0;
|
|
22249
|
-
if (shouldAddHalfAFrameAtEnd) {
|
|
22250
|
-
spatialDuration += 0.5;
|
|
22251
|
-
naturalSpatialDuration += 0.5;
|
|
22252
|
-
}
|
|
22253
|
-
if (shouldAddHalfAFrameAtStart) {
|
|
22254
|
-
spatialDuration += 0.5;
|
|
22255
|
-
naturalSpatialDuration += 0.5;
|
|
22256
|
-
}
|
|
22257
|
-
const startFromWithOffset = shouldAddHalfAFrameAtStart ? startFrom - 0.5 : startFrom;
|
|
22258
|
-
const marginLeft = lastFrame === 0 ? 0 : startFromWithOffset / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22286
|
+
const lastFrame = video.durationInFrames ?? 1;
|
|
22287
|
+
const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames, lastFrame - startFrom);
|
|
22288
|
+
const naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames);
|
|
22289
|
+
const marginLeft = lastFrame === 0 ? 0 : startFrom / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22259
22290
|
const nonNegativeMarginLeft = Math.min(marginLeft, 0);
|
|
22260
22291
|
const width = getWidthOfTrack({
|
|
22261
22292
|
durationInFrames,
|
|
@@ -22344,7 +22375,7 @@ var useMaxMediaDuration = (s, fps) => {
|
|
|
22344
22375
|
|
|
22345
22376
|
// src/components/AudioWaveform.tsx
|
|
22346
22377
|
import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
|
|
22347
|
-
import { useEffect as useEffect73, useMemo as useMemo110, useRef as
|
|
22378
|
+
import { useEffect as useEffect73, useMemo as useMemo110, useRef as useRef41, useState as useState74 } from "react";
|
|
22348
22379
|
import { Internals as Internals54 } from "remotion";
|
|
22349
22380
|
|
|
22350
22381
|
// src/components/AudioWaveformBar.tsx
|
|
@@ -22403,12 +22434,12 @@ var AudioWaveform = ({
|
|
|
22403
22434
|
}) => {
|
|
22404
22435
|
const [metadata, setMetadata] = useState74(null);
|
|
22405
22436
|
const [error, setError] = useState74(null);
|
|
22406
|
-
const mountState =
|
|
22437
|
+
const mountState = useRef41({ isMounted: true });
|
|
22407
22438
|
const vidConf = Internals54.useUnsafeVideoConfig();
|
|
22408
22439
|
if (vidConf === null) {
|
|
22409
22440
|
throw new Error("Expected video config");
|
|
22410
22441
|
}
|
|
22411
|
-
const canvas =
|
|
22442
|
+
const canvas = useRef41(null);
|
|
22412
22443
|
useEffect73(() => {
|
|
22413
22444
|
const { current } = mountState;
|
|
22414
22445
|
current.isMounted = true;
|
|
@@ -22608,7 +22639,8 @@ var relativeFrameStyle = {
|
|
|
22608
22639
|
fontSize: 11,
|
|
22609
22640
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
22610
22641
|
color: "white",
|
|
22611
|
-
opacity: 0.5
|
|
22642
|
+
opacity: 0.5,
|
|
22643
|
+
whiteSpace: "nowrap"
|
|
22612
22644
|
};
|
|
22613
22645
|
var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
22614
22646
|
return /* @__PURE__ */ jsx205("div", {
|
|
@@ -22618,7 +22650,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
|
22618
22650
|
};
|
|
22619
22651
|
|
|
22620
22652
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
22621
|
-
import { useEffect as useEffect74, useRef as
|
|
22653
|
+
import { useEffect as useEffect74, useRef as useRef42, useState as useState75 } from "react";
|
|
22622
22654
|
import { useVideoConfig as useVideoConfig5 } from "remotion";
|
|
22623
22655
|
|
|
22624
22656
|
// src/helpers/extract-frames.ts
|
|
@@ -22666,15 +22698,22 @@ async function extractFrames({
|
|
|
22666
22698
|
return;
|
|
22667
22699
|
}
|
|
22668
22700
|
const sink = new VideoSampleSink(videoTrack);
|
|
22669
|
-
|
|
22670
|
-
|
|
22671
|
-
|
|
22672
|
-
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
|
|
22701
|
+
const sampleIterator = sink.samplesAtTimestamps(timestamps);
|
|
22702
|
+
try {
|
|
22703
|
+
for await (const videoSample of sampleIterator) {
|
|
22704
|
+
if (signal?.aborted) {
|
|
22705
|
+
videoSample?.close();
|
|
22706
|
+
break;
|
|
22707
|
+
}
|
|
22708
|
+
if (!videoSample) {
|
|
22709
|
+
continue;
|
|
22710
|
+
}
|
|
22711
|
+
onVideoSample(videoSample);
|
|
22676
22712
|
}
|
|
22677
|
-
|
|
22713
|
+
} finally {
|
|
22714
|
+
try {
|
|
22715
|
+
await sampleIterator.return?.();
|
|
22716
|
+
} catch {}
|
|
22678
22717
|
}
|
|
22679
22718
|
} catch (error) {
|
|
22680
22719
|
if (error instanceof InputDisposedError2) {
|
|
@@ -22947,9 +22986,9 @@ var TimelineVideoInfo = ({
|
|
|
22947
22986
|
playbackRate
|
|
22948
22987
|
}) => {
|
|
22949
22988
|
const { fps } = useVideoConfig5();
|
|
22950
|
-
const ref =
|
|
22989
|
+
const ref = useRef42(null);
|
|
22951
22990
|
const [error, setError] = useState75(null);
|
|
22952
|
-
const aspectRatio =
|
|
22991
|
+
const aspectRatio = useRef42(getAspectRatioFromCache(src));
|
|
22953
22992
|
useEffect74(() => {
|
|
22954
22993
|
return () => {
|
|
22955
22994
|
clearFramesForSrc(src);
|
|
@@ -23017,46 +23056,59 @@ var TimelineVideoInfo = ({
|
|
|
23017
23056
|
},
|
|
23018
23057
|
src,
|
|
23019
23058
|
onVideoSample: (sample) => {
|
|
23020
|
-
|
|
23021
|
-
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23025
|
-
|
|
23026
|
-
|
|
23027
|
-
|
|
23028
|
-
|
|
23029
|
-
|
|
23030
|
-
|
|
23031
|
-
|
|
23032
|
-
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23036
|
-
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23059
|
+
let frame2;
|
|
23060
|
+
try {
|
|
23061
|
+
frame2 = sample.toVideoFrame();
|
|
23062
|
+
const scale = HEIGHT / frame2.displayHeight * window.devicePixelRatio;
|
|
23063
|
+
const transformed = resizeVideoFrame({
|
|
23064
|
+
frame: frame2,
|
|
23065
|
+
scale
|
|
23066
|
+
});
|
|
23067
|
+
if (transformed !== frame2) {
|
|
23068
|
+
frame2.close();
|
|
23069
|
+
}
|
|
23070
|
+
frame2 = undefined;
|
|
23071
|
+
const databaseKey = makeFrameDatabaseKey(src, transformed.timestamp);
|
|
23072
|
+
const existingFrame = frameDatabase.get(databaseKey);
|
|
23073
|
+
if (existingFrame) {
|
|
23074
|
+
existingFrame.frame.close();
|
|
23075
|
+
}
|
|
23076
|
+
frameDatabase.set(databaseKey, {
|
|
23077
|
+
frame: transformed,
|
|
23078
|
+
lastUsed: Date.now()
|
|
23079
|
+
});
|
|
23080
|
+
if (aspectRatio.current === null) {
|
|
23081
|
+
throw new Error("Aspect ratio is not set");
|
|
23082
|
+
}
|
|
23083
|
+
ensureSlots({
|
|
23084
|
+
filledSlots,
|
|
23085
|
+
fromSeconds,
|
|
23086
|
+
toSeconds,
|
|
23087
|
+
naturalWidth,
|
|
23088
|
+
aspectRatio: aspectRatio.current
|
|
23089
|
+
});
|
|
23090
|
+
fillFrameWhereItFits({
|
|
23091
|
+
ctx,
|
|
23092
|
+
filledSlots,
|
|
23093
|
+
visualizationWidth: naturalWidth,
|
|
23094
|
+
frame: transformed,
|
|
23095
|
+
segmentDuration: toSeconds - fromSeconds,
|
|
23096
|
+
fromSeconds
|
|
23097
|
+
});
|
|
23098
|
+
} catch (e) {
|
|
23099
|
+
if (frame2) {
|
|
23100
|
+
frame2.close();
|
|
23101
|
+
}
|
|
23102
|
+
throw e;
|
|
23103
|
+
} finally {
|
|
23104
|
+
sample.close();
|
|
23040
23105
|
}
|
|
23041
|
-
ensureSlots({
|
|
23042
|
-
filledSlots,
|
|
23043
|
-
fromSeconds,
|
|
23044
|
-
toSeconds,
|
|
23045
|
-
naturalWidth,
|
|
23046
|
-
aspectRatio: aspectRatio.current
|
|
23047
|
-
});
|
|
23048
|
-
fillFrameWhereItFits({
|
|
23049
|
-
ctx,
|
|
23050
|
-
filledSlots,
|
|
23051
|
-
visualizationWidth: naturalWidth,
|
|
23052
|
-
frame: transformed,
|
|
23053
|
-
segmentDuration: toSeconds - fromSeconds,
|
|
23054
|
-
fromSeconds
|
|
23055
|
-
});
|
|
23056
|
-
sample.close();
|
|
23057
23106
|
},
|
|
23058
23107
|
signal: controller.signal
|
|
23059
23108
|
}).then(() => {
|
|
23109
|
+
if (controller.signal.aborted) {
|
|
23110
|
+
return;
|
|
23111
|
+
}
|
|
23060
23112
|
fillWithCachedFrames({
|
|
23061
23113
|
ctx,
|
|
23062
23114
|
naturalWidth,
|
|
@@ -23232,7 +23284,8 @@ var getExpandedPlaceholderStyle = (controls) => ({
|
|
|
23232
23284
|
});
|
|
23233
23285
|
var TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
23234
23286
|
const { expandedTracks } = useContext73(ExpandedTracksContext);
|
|
23235
|
-
const
|
|
23287
|
+
const { previewServerState } = useContext73(StudioServerConnectionCtx);
|
|
23288
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23236
23289
|
const timelineStyle = useMemo112(() => {
|
|
23237
23290
|
return {
|
|
23238
23291
|
...timelineContent,
|
|
@@ -24873,7 +24926,7 @@ import {
|
|
|
24873
24926
|
useContext as useContext85,
|
|
24874
24927
|
useEffect as useEffect80,
|
|
24875
24928
|
useMemo as useMemo121,
|
|
24876
|
-
useRef as
|
|
24929
|
+
useRef as useRef44,
|
|
24877
24930
|
useState as useState81
|
|
24878
24931
|
} from "react";
|
|
24879
24932
|
import { Internals as Internals63 } from "remotion";
|
|
@@ -25746,7 +25799,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
25746
25799
|
};
|
|
25747
25800
|
|
|
25748
25801
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
25749
|
-
import { useEffect as useEffect79, useMemo as useMemo120, useRef as
|
|
25802
|
+
import { useEffect as useEffect79, useMemo as useMemo120, useRef as useRef43, useState as useState80 } from "react";
|
|
25750
25803
|
import { jsx as jsx227, jsxs as jsxs116, Fragment as Fragment36 } from "react/jsx-runtime";
|
|
25751
25804
|
var container50 = {
|
|
25752
25805
|
paddingLeft: 16,
|
|
@@ -25776,7 +25829,7 @@ var labelContainer = {
|
|
|
25776
25829
|
};
|
|
25777
25830
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
25778
25831
|
const [hovered, setIsHovered] = useState80(false);
|
|
25779
|
-
const ref =
|
|
25832
|
+
const ref = useRef43(null);
|
|
25780
25833
|
const keybindings = useKeybinding();
|
|
25781
25834
|
useEffect79(() => {
|
|
25782
25835
|
const { current } = ref;
|
|
@@ -25954,7 +26007,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
25954
26007
|
selectedIndex: 0
|
|
25955
26008
|
});
|
|
25956
26009
|
}, [initialMode, invocationTimestamp]);
|
|
25957
|
-
const inputRef =
|
|
26010
|
+
const inputRef = useRef44(null);
|
|
25958
26011
|
const selectComposition = useSelectComposition();
|
|
25959
26012
|
const closeMenu = useCallback112(() => {
|
|
25960
26013
|
return;
|
|
@@ -26714,7 +26767,7 @@ import {
|
|
|
26714
26767
|
useEffect as useEffect83,
|
|
26715
26768
|
useMemo as useMemo132,
|
|
26716
26769
|
useReducer as useReducer2,
|
|
26717
|
-
useRef as
|
|
26770
|
+
useRef as useRef46,
|
|
26718
26771
|
useState as useState87
|
|
26719
26772
|
} from "react";
|
|
26720
26773
|
|
|
@@ -28457,12 +28510,12 @@ import { BrowserSafeApis as BrowserSafeApis6 } from "@remotion/renderer/client";
|
|
|
28457
28510
|
import { useCallback as useCallback124, useMemo as useMemo127 } from "react";
|
|
28458
28511
|
|
|
28459
28512
|
// src/helpers/use-file-existence.ts
|
|
28460
|
-
import { useContext as useContext87, useEffect as useEffect82, useRef as
|
|
28513
|
+
import { useContext as useContext87, useEffect as useEffect82, useRef as useRef45, useState as useState86 } from "react";
|
|
28461
28514
|
var useFileExistence = (outName) => {
|
|
28462
28515
|
const [exists, setExists] = useState86(false);
|
|
28463
28516
|
const { previewServerState: state, subscribeToEvent } = useContext87(StudioServerConnectionCtx);
|
|
28464
28517
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
28465
|
-
const currentOutName =
|
|
28518
|
+
const currentOutName = useRef45("");
|
|
28466
28519
|
currentOutName.current = outName;
|
|
28467
28520
|
useEffect82(() => {
|
|
28468
28521
|
if (!clientId) {
|
|
@@ -29850,7 +29903,7 @@ var RenderModal = ({
|
|
|
29850
29903
|
resolved: { result: resolvedComposition },
|
|
29851
29904
|
unresolved: unresolvedComposition
|
|
29852
29905
|
} = context;
|
|
29853
|
-
const isMounted =
|
|
29906
|
+
const isMounted = useRef46(true);
|
|
29854
29907
|
const [isVideo] = useState87(() => {
|
|
29855
29908
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
29856
29909
|
});
|
|
@@ -30845,9 +30898,9 @@ import {
|
|
|
30845
30898
|
getEncodableAudioCodecs,
|
|
30846
30899
|
getSupportedAudioCodecsForContainer
|
|
30847
30900
|
} from "@remotion/web-renderer";
|
|
30848
|
-
import { useEffect as useEffect84, useRef as
|
|
30901
|
+
import { useEffect as useEffect84, useRef as useRef47, useState as useState88 } from "react";
|
|
30849
30902
|
var useEncodableAudioCodecs = (container61) => {
|
|
30850
|
-
const cacheRef =
|
|
30903
|
+
const cacheRef = useRef47({});
|
|
30851
30904
|
const [codecsByContainer, setCodecsByContainer] = useState88(() => {
|
|
30852
30905
|
return {
|
|
30853
30906
|
[container61]: getSupportedAudioCodecsForContainer(container61)
|
|
@@ -30887,9 +30940,9 @@ import {
|
|
|
30887
30940
|
getEncodableVideoCodecs,
|
|
30888
30941
|
getSupportedVideoCodecsForContainer
|
|
30889
30942
|
} from "@remotion/web-renderer";
|
|
30890
|
-
import { useEffect as useEffect85, useRef as
|
|
30943
|
+
import { useEffect as useEffect85, useRef as useRef48, useState as useState89 } from "react";
|
|
30891
30944
|
var useEncodableVideoCodecs = (container61) => {
|
|
30892
|
-
const cacheRef =
|
|
30945
|
+
const cacheRef = useRef48({});
|
|
30893
30946
|
const [codecsByContainer, setCodecsByContainer] = useState89(() => {
|
|
30894
30947
|
return {
|
|
30895
30948
|
[container61]: getSupportedVideoCodecsForContainer(container61)
|
|
@@ -33228,15 +33281,15 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
33228
33281
|
};
|
|
33229
33282
|
|
|
33230
33283
|
// src/components/ShowGuidesProvider.tsx
|
|
33231
|
-
import { useCallback as useCallback143, useMemo as useMemo146, useRef as
|
|
33284
|
+
import { useCallback as useCallback143, useMemo as useMemo146, useRef as useRef49, useState as useState99 } from "react";
|
|
33232
33285
|
import { jsx as jsx286 } from "react/jsx-runtime";
|
|
33233
33286
|
var ShowGuidesProvider = ({ children }) => {
|
|
33234
33287
|
const [guidesList, setGuidesList] = useState99(() => loadGuidesList());
|
|
33235
33288
|
const [selectedGuideId, setSelectedGuideId] = useState99(null);
|
|
33236
33289
|
const [hoveredGuideId, setHoveredGuideId] = useState99(null);
|
|
33237
33290
|
const [editorShowGuides, setEditorShowGuidesState] = useState99(() => loadEditorShowGuidesOption());
|
|
33238
|
-
const shouldCreateGuideRef =
|
|
33239
|
-
const shouldDeleteGuideRef =
|
|
33291
|
+
const shouldCreateGuideRef = useRef49(false);
|
|
33292
|
+
const shouldDeleteGuideRef = useRef49(false);
|
|
33240
33293
|
const setEditorShowGuides = useCallback143((newValue) => {
|
|
33241
33294
|
setEditorShowGuidesState((prevState) => {
|
|
33242
33295
|
const newVal = newValue(prevState);
|