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