@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
package/dist/esm/internals.mjs
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
1
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
18
2
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
19
3
|
}) : x)(function(x) {
|
|
@@ -119,184 +103,6 @@ var setCurrentFps = (d) => {
|
|
|
119
103
|
// src/components/Timeline/timeline-scroll-logic.ts
|
|
120
104
|
import { interpolate } from "remotion";
|
|
121
105
|
|
|
122
|
-
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
123
|
-
var zodSafeParse = (schema, data) => {
|
|
124
|
-
return schema.safeParse(data);
|
|
125
|
-
};
|
|
126
|
-
var getZodDef = (schema) => {
|
|
127
|
-
if (schema._def)
|
|
128
|
-
return schema._def;
|
|
129
|
-
if (schema._zod)
|
|
130
|
-
return schema._zod.def;
|
|
131
|
-
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
132
|
-
};
|
|
133
|
-
var v3TypeNameMap = {
|
|
134
|
-
ZodString: "string",
|
|
135
|
-
ZodNumber: "number",
|
|
136
|
-
ZodBoolean: "boolean",
|
|
137
|
-
ZodObject: "object",
|
|
138
|
-
ZodArray: "array",
|
|
139
|
-
ZodEnum: "enum",
|
|
140
|
-
ZodUnion: "union",
|
|
141
|
-
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
142
|
-
ZodOptional: "optional",
|
|
143
|
-
ZodNullable: "nullable",
|
|
144
|
-
ZodDefault: "default",
|
|
145
|
-
ZodTuple: "tuple",
|
|
146
|
-
ZodDate: "date",
|
|
147
|
-
ZodAny: "any",
|
|
148
|
-
ZodUnknown: "unknown",
|
|
149
|
-
ZodBigInt: "bigint",
|
|
150
|
-
ZodNull: "null",
|
|
151
|
-
ZodUndefined: "undefined",
|
|
152
|
-
ZodEffects: "effects",
|
|
153
|
-
ZodLiteral: "literal",
|
|
154
|
-
ZodRecord: "record",
|
|
155
|
-
ZodNever: "never",
|
|
156
|
-
ZodVoid: "void",
|
|
157
|
-
ZodNaN: "nan",
|
|
158
|
-
ZodSymbol: "symbol",
|
|
159
|
-
ZodIntersection: "intersection",
|
|
160
|
-
ZodMap: "map",
|
|
161
|
-
ZodSet: "set",
|
|
162
|
-
ZodLazy: "lazy",
|
|
163
|
-
ZodFunction: "function",
|
|
164
|
-
ZodNativeEnum: "nativeEnum",
|
|
165
|
-
ZodCatch: "catch",
|
|
166
|
-
ZodPromise: "promise",
|
|
167
|
-
ZodBranded: "branded",
|
|
168
|
-
ZodPipeline: "pipeline"
|
|
169
|
-
};
|
|
170
|
-
var isZodV3Schema = (schema) => {
|
|
171
|
-
const def = getZodDef(schema);
|
|
172
|
-
return "typeName" in def;
|
|
173
|
-
};
|
|
174
|
-
var getZodSchemaType = (schema) => {
|
|
175
|
-
const def = getZodDef(schema);
|
|
176
|
-
if ("typeName" in def) {
|
|
177
|
-
const { typeName } = def;
|
|
178
|
-
return v3TypeNameMap[typeName] ?? typeName;
|
|
179
|
-
}
|
|
180
|
-
const { type } = def;
|
|
181
|
-
if (type === "union" && def.discriminator !== undefined) {
|
|
182
|
-
return "discriminatedUnion";
|
|
183
|
-
}
|
|
184
|
-
return type;
|
|
185
|
-
};
|
|
186
|
-
var getZodSchemaDescription = (schema) => {
|
|
187
|
-
if (isZodV3Schema(schema)) {
|
|
188
|
-
return getZodDef(schema).description;
|
|
189
|
-
}
|
|
190
|
-
return schema.description;
|
|
191
|
-
};
|
|
192
|
-
var getObjectShape = (schema) => {
|
|
193
|
-
const { shape } = getZodDef(schema);
|
|
194
|
-
return typeof shape === "function" ? shape() : shape;
|
|
195
|
-
};
|
|
196
|
-
var getArrayElement = (schema) => {
|
|
197
|
-
const def = getZodDef(schema);
|
|
198
|
-
return isZodV3Schema(schema) ? def.type : def.element;
|
|
199
|
-
};
|
|
200
|
-
var getInnerType = (schema) => {
|
|
201
|
-
return getZodDef(schema).innerType;
|
|
202
|
-
};
|
|
203
|
-
var getEffectsInner = (schema) => {
|
|
204
|
-
return getZodDef(schema).schema;
|
|
205
|
-
};
|
|
206
|
-
var getLiteralValue = (schema) => {
|
|
207
|
-
const def = getZodDef(schema);
|
|
208
|
-
if (isZodV3Schema(schema)) {
|
|
209
|
-
return def.value;
|
|
210
|
-
}
|
|
211
|
-
return def.values?.[0];
|
|
212
|
-
};
|
|
213
|
-
var getEnumValues = (schema) => {
|
|
214
|
-
const def = getZodDef(schema);
|
|
215
|
-
if (isZodV3Schema(schema)) {
|
|
216
|
-
return def.values;
|
|
217
|
-
}
|
|
218
|
-
const { entries } = def;
|
|
219
|
-
return Object.values(entries);
|
|
220
|
-
};
|
|
221
|
-
var getFirstEnumValue = (schema) => {
|
|
222
|
-
const def = getZodDef(schema);
|
|
223
|
-
if (isZodV3Schema(schema)) {
|
|
224
|
-
if (def.typeName === "ZodNativeEnum") {
|
|
225
|
-
const vals = Object.values(def.values);
|
|
226
|
-
return vals[0];
|
|
227
|
-
}
|
|
228
|
-
return def.values[0];
|
|
229
|
-
}
|
|
230
|
-
const { entries } = def;
|
|
231
|
-
const pairs = Object.entries(entries);
|
|
232
|
-
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
233
|
-
if (hasReverseMapping) {
|
|
234
|
-
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
235
|
-
if (forwardPairs.length > 0) {
|
|
236
|
-
return forwardPairs[0][1];
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return Object.values(entries)[0];
|
|
240
|
-
};
|
|
241
|
-
var getUnionOptions = (schema) => {
|
|
242
|
-
return getZodDef(schema).options;
|
|
243
|
-
};
|
|
244
|
-
var getDefaultValue = (schema) => {
|
|
245
|
-
const dv = getZodDef(schema).defaultValue;
|
|
246
|
-
return typeof dv === "function" ? dv() : dv;
|
|
247
|
-
};
|
|
248
|
-
var getDiscriminator = (schema) => {
|
|
249
|
-
return getZodDef(schema).discriminator;
|
|
250
|
-
};
|
|
251
|
-
var getDiscriminatedOptionKeys = (schema) => {
|
|
252
|
-
const def = getZodDef(schema);
|
|
253
|
-
const discriminator = getDiscriminator(schema);
|
|
254
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
255
|
-
return [...def.optionsMap.keys()];
|
|
256
|
-
}
|
|
257
|
-
const options = getUnionOptions(schema);
|
|
258
|
-
return options.map((option) => {
|
|
259
|
-
const shape = getObjectShape(option);
|
|
260
|
-
const discriminatorSchema = shape[discriminator];
|
|
261
|
-
return getLiteralValue(discriminatorSchema);
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
265
|
-
const def = getZodDef(schema);
|
|
266
|
-
const discriminator = getDiscriminator(schema);
|
|
267
|
-
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
268
|
-
return def.optionsMap.get(discriminatorValue);
|
|
269
|
-
}
|
|
270
|
-
const options = getUnionOptions(schema);
|
|
271
|
-
return options.find((option) => {
|
|
272
|
-
const shape = getObjectShape(option);
|
|
273
|
-
const discriminatorSchema = shape[discriminator];
|
|
274
|
-
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
var getIntersectionSchemas = (schema) => {
|
|
278
|
-
const def = getZodDef(schema);
|
|
279
|
-
return { left: def.left, right: def.right };
|
|
280
|
-
};
|
|
281
|
-
var getTupleItems = (schema) => {
|
|
282
|
-
return getZodDef(schema).items;
|
|
283
|
-
};
|
|
284
|
-
var getRecordValueType = (schema) => {
|
|
285
|
-
return getZodDef(schema).valueType;
|
|
286
|
-
};
|
|
287
|
-
var getRecordKeyType = (schema) => {
|
|
288
|
-
return getZodDef(schema).keyType;
|
|
289
|
-
};
|
|
290
|
-
var getPipelineOutput = (schema) => {
|
|
291
|
-
return getZodDef(schema).out;
|
|
292
|
-
};
|
|
293
|
-
var getPipelineInput = (schema) => {
|
|
294
|
-
return getZodDef(schema).in;
|
|
295
|
-
};
|
|
296
|
-
var getBrandedInner = (schema) => {
|
|
297
|
-
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
106
|
// src/helpers/timeline-layout.ts
|
|
301
107
|
var TIMELINE_PADDING = 16;
|
|
302
108
|
var TIMELINE_BORDER = 1;
|
|
@@ -304,28 +110,17 @@ var TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
304
110
|
var TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
305
111
|
var SCHEMA_FIELD_ROW_HEIGHT = 26;
|
|
306
112
|
var UNSUPPORTED_FIELD_ROW_HEIGHT = 26;
|
|
307
|
-
var SUPPORTED_SCHEMA_TYPES = new Set([
|
|
308
|
-
"number",
|
|
309
|
-
"string",
|
|
310
|
-
"boolean",
|
|
311
|
-
"enum",
|
|
312
|
-
"date",
|
|
313
|
-
"array",
|
|
314
|
-
"object",
|
|
315
|
-
"optional",
|
|
316
|
-
"nullable",
|
|
317
|
-
"default"
|
|
318
|
-
]);
|
|
113
|
+
var SUPPORTED_SCHEMA_TYPES = new Set(["number", "boolean"]);
|
|
319
114
|
var getSchemaFields = (controls) => {
|
|
320
115
|
if (!controls) {
|
|
321
116
|
return null;
|
|
322
117
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const typeName = getZodSchemaType(fieldSchema);
|
|
118
|
+
return Object.entries(controls.schema).map(([key, fieldSchema]) => {
|
|
119
|
+
const typeName = fieldSchema.type;
|
|
326
120
|
const supported = SUPPORTED_SCHEMA_TYPES.has(typeName);
|
|
327
121
|
return {
|
|
328
122
|
key,
|
|
123
|
+
description: fieldSchema.description,
|
|
329
124
|
typeName,
|
|
330
125
|
supported,
|
|
331
126
|
rowHeight: supported ? SCHEMA_FIELD_ROW_HEIGHT : UNSUPPORTED_FIELD_ROW_HEIGHT,
|
|
@@ -11278,6 +11073,184 @@ import { Internals as Internals30 } from "remotion";
|
|
|
11278
11073
|
// src/api/save-default-props.ts
|
|
11279
11074
|
import { getRemotionEnvironment as getRemotionEnvironment4 } from "remotion";
|
|
11280
11075
|
|
|
11076
|
+
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
11077
|
+
var zodSafeParse = (schema, data) => {
|
|
11078
|
+
return schema.safeParse(data);
|
|
11079
|
+
};
|
|
11080
|
+
var getZodDef = (schema) => {
|
|
11081
|
+
if (schema._def)
|
|
11082
|
+
return schema._def;
|
|
11083
|
+
if (schema._zod)
|
|
11084
|
+
return schema._zod.def;
|
|
11085
|
+
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
11086
|
+
};
|
|
11087
|
+
var v3TypeNameMap = {
|
|
11088
|
+
ZodString: "string",
|
|
11089
|
+
ZodNumber: "number",
|
|
11090
|
+
ZodBoolean: "boolean",
|
|
11091
|
+
ZodObject: "object",
|
|
11092
|
+
ZodArray: "array",
|
|
11093
|
+
ZodEnum: "enum",
|
|
11094
|
+
ZodUnion: "union",
|
|
11095
|
+
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
11096
|
+
ZodOptional: "optional",
|
|
11097
|
+
ZodNullable: "nullable",
|
|
11098
|
+
ZodDefault: "default",
|
|
11099
|
+
ZodTuple: "tuple",
|
|
11100
|
+
ZodDate: "date",
|
|
11101
|
+
ZodAny: "any",
|
|
11102
|
+
ZodUnknown: "unknown",
|
|
11103
|
+
ZodBigInt: "bigint",
|
|
11104
|
+
ZodNull: "null",
|
|
11105
|
+
ZodUndefined: "undefined",
|
|
11106
|
+
ZodEffects: "effects",
|
|
11107
|
+
ZodLiteral: "literal",
|
|
11108
|
+
ZodRecord: "record",
|
|
11109
|
+
ZodNever: "never",
|
|
11110
|
+
ZodVoid: "void",
|
|
11111
|
+
ZodNaN: "nan",
|
|
11112
|
+
ZodSymbol: "symbol",
|
|
11113
|
+
ZodIntersection: "intersection",
|
|
11114
|
+
ZodMap: "map",
|
|
11115
|
+
ZodSet: "set",
|
|
11116
|
+
ZodLazy: "lazy",
|
|
11117
|
+
ZodFunction: "function",
|
|
11118
|
+
ZodNativeEnum: "nativeEnum",
|
|
11119
|
+
ZodCatch: "catch",
|
|
11120
|
+
ZodPromise: "promise",
|
|
11121
|
+
ZodBranded: "branded",
|
|
11122
|
+
ZodPipeline: "pipeline"
|
|
11123
|
+
};
|
|
11124
|
+
var isZodV3Schema = (schema) => {
|
|
11125
|
+
const def = getZodDef(schema);
|
|
11126
|
+
return "typeName" in def;
|
|
11127
|
+
};
|
|
11128
|
+
var getZodSchemaType = (schema) => {
|
|
11129
|
+
const def = getZodDef(schema);
|
|
11130
|
+
if ("typeName" in def) {
|
|
11131
|
+
const { typeName } = def;
|
|
11132
|
+
return v3TypeNameMap[typeName] ?? typeName;
|
|
11133
|
+
}
|
|
11134
|
+
const { type } = def;
|
|
11135
|
+
if (type === "union" && def.discriminator !== undefined) {
|
|
11136
|
+
return "discriminatedUnion";
|
|
11137
|
+
}
|
|
11138
|
+
return type;
|
|
11139
|
+
};
|
|
11140
|
+
var getZodSchemaDescription = (schema) => {
|
|
11141
|
+
if (isZodV3Schema(schema)) {
|
|
11142
|
+
return getZodDef(schema).description;
|
|
11143
|
+
}
|
|
11144
|
+
return schema.description;
|
|
11145
|
+
};
|
|
11146
|
+
var getObjectShape = (schema) => {
|
|
11147
|
+
const { shape } = getZodDef(schema);
|
|
11148
|
+
return typeof shape === "function" ? shape() : shape;
|
|
11149
|
+
};
|
|
11150
|
+
var getArrayElement = (schema) => {
|
|
11151
|
+
const def = getZodDef(schema);
|
|
11152
|
+
return isZodV3Schema(schema) ? def.type : def.element;
|
|
11153
|
+
};
|
|
11154
|
+
var getInnerType = (schema) => {
|
|
11155
|
+
return getZodDef(schema).innerType;
|
|
11156
|
+
};
|
|
11157
|
+
var getEffectsInner = (schema) => {
|
|
11158
|
+
return getZodDef(schema).schema;
|
|
11159
|
+
};
|
|
11160
|
+
var getLiteralValue = (schema) => {
|
|
11161
|
+
const def = getZodDef(schema);
|
|
11162
|
+
if (isZodV3Schema(schema)) {
|
|
11163
|
+
return def.value;
|
|
11164
|
+
}
|
|
11165
|
+
return def.values?.[0];
|
|
11166
|
+
};
|
|
11167
|
+
var getEnumValues = (schema) => {
|
|
11168
|
+
const def = getZodDef(schema);
|
|
11169
|
+
if (isZodV3Schema(schema)) {
|
|
11170
|
+
return def.values;
|
|
11171
|
+
}
|
|
11172
|
+
const { entries } = def;
|
|
11173
|
+
return Object.values(entries);
|
|
11174
|
+
};
|
|
11175
|
+
var getFirstEnumValue = (schema) => {
|
|
11176
|
+
const def = getZodDef(schema);
|
|
11177
|
+
if (isZodV3Schema(schema)) {
|
|
11178
|
+
if (def.typeName === "ZodNativeEnum") {
|
|
11179
|
+
const vals = Object.values(def.values);
|
|
11180
|
+
return vals[0];
|
|
11181
|
+
}
|
|
11182
|
+
return def.values[0];
|
|
11183
|
+
}
|
|
11184
|
+
const { entries } = def;
|
|
11185
|
+
const pairs = Object.entries(entries);
|
|
11186
|
+
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
11187
|
+
if (hasReverseMapping) {
|
|
11188
|
+
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
11189
|
+
if (forwardPairs.length > 0) {
|
|
11190
|
+
return forwardPairs[0][1];
|
|
11191
|
+
}
|
|
11192
|
+
}
|
|
11193
|
+
return Object.values(entries)[0];
|
|
11194
|
+
};
|
|
11195
|
+
var getUnionOptions = (schema) => {
|
|
11196
|
+
return getZodDef(schema).options;
|
|
11197
|
+
};
|
|
11198
|
+
var getDefaultValue = (schema) => {
|
|
11199
|
+
const dv = getZodDef(schema).defaultValue;
|
|
11200
|
+
return typeof dv === "function" ? dv() : dv;
|
|
11201
|
+
};
|
|
11202
|
+
var getDiscriminator = (schema) => {
|
|
11203
|
+
return getZodDef(schema).discriminator;
|
|
11204
|
+
};
|
|
11205
|
+
var getDiscriminatedOptionKeys = (schema) => {
|
|
11206
|
+
const def = getZodDef(schema);
|
|
11207
|
+
const discriminator = getDiscriminator(schema);
|
|
11208
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11209
|
+
return [...def.optionsMap.keys()];
|
|
11210
|
+
}
|
|
11211
|
+
const options = getUnionOptions(schema);
|
|
11212
|
+
return options.map((option) => {
|
|
11213
|
+
const shape = getObjectShape(option);
|
|
11214
|
+
const discriminatorSchema = shape[discriminator];
|
|
11215
|
+
return getLiteralValue(discriminatorSchema);
|
|
11216
|
+
});
|
|
11217
|
+
};
|
|
11218
|
+
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
11219
|
+
const def = getZodDef(schema);
|
|
11220
|
+
const discriminator = getDiscriminator(schema);
|
|
11221
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
11222
|
+
return def.optionsMap.get(discriminatorValue);
|
|
11223
|
+
}
|
|
11224
|
+
const options = getUnionOptions(schema);
|
|
11225
|
+
return options.find((option) => {
|
|
11226
|
+
const shape = getObjectShape(option);
|
|
11227
|
+
const discriminatorSchema = shape[discriminator];
|
|
11228
|
+
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
11229
|
+
});
|
|
11230
|
+
};
|
|
11231
|
+
var getIntersectionSchemas = (schema) => {
|
|
11232
|
+
const def = getZodDef(schema);
|
|
11233
|
+
return { left: def.left, right: def.right };
|
|
11234
|
+
};
|
|
11235
|
+
var getTupleItems = (schema) => {
|
|
11236
|
+
return getZodDef(schema).items;
|
|
11237
|
+
};
|
|
11238
|
+
var getRecordValueType = (schema) => {
|
|
11239
|
+
return getZodDef(schema).valueType;
|
|
11240
|
+
};
|
|
11241
|
+
var getRecordKeyType = (schema) => {
|
|
11242
|
+
return getZodDef(schema).keyType;
|
|
11243
|
+
};
|
|
11244
|
+
var getPipelineOutput = (schema) => {
|
|
11245
|
+
return getZodDef(schema).out;
|
|
11246
|
+
};
|
|
11247
|
+
var getPipelineInput = (schema) => {
|
|
11248
|
+
return getZodDef(schema).in;
|
|
11249
|
+
};
|
|
11250
|
+
var getBrandedInner = (schema) => {
|
|
11251
|
+
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
11252
|
+
};
|
|
11253
|
+
|
|
11281
11254
|
// src/components/RenderModal/SchemaEditor/extract-enum-json-paths.ts
|
|
11282
11255
|
var extractEnumJsonPaths = ({
|
|
11283
11256
|
schema,
|
|
@@ -13629,7 +13602,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
13629
13602
|
return {
|
|
13630
13603
|
...inputBaseStyle,
|
|
13631
13604
|
backgroundColor: "transparent",
|
|
13632
|
-
borderColor: "transparent"
|
|
13605
|
+
borderColor: "transparent",
|
|
13606
|
+
padding: "4px 6px"
|
|
13633
13607
|
};
|
|
13634
13608
|
}, []);
|
|
13635
13609
|
const span = useMemo69(() => ({
|
|
@@ -21175,7 +21149,7 @@ var Inner2 = () => {
|
|
|
21175
21149
|
|
|
21176
21150
|
// src/components/Timeline/TimelineList.tsx
|
|
21177
21151
|
import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
21178
|
-
import { useRef as
|
|
21152
|
+
import { useRef as useRef40 } from "react";
|
|
21179
21153
|
|
|
21180
21154
|
// src/components/Timeline/TimelineListItem.tsx
|
|
21181
21155
|
import {
|
|
@@ -21220,6 +21194,7 @@ import {
|
|
|
21220
21194
|
useContext as useContext67,
|
|
21221
21195
|
useEffect as useEffect67,
|
|
21222
21196
|
useMemo as useMemo104,
|
|
21197
|
+
useRef as useRef37,
|
|
21223
21198
|
useState as useState70
|
|
21224
21199
|
} from "react";
|
|
21225
21200
|
import { Internals as Internals49 } from "remotion";
|
|
@@ -21237,19 +21212,15 @@ var draggerStyle = {
|
|
|
21237
21212
|
width: 80,
|
|
21238
21213
|
marginLeft: "auto"
|
|
21239
21214
|
};
|
|
21215
|
+
var checkboxContainer = {
|
|
21216
|
+
marginLeft: "auto"
|
|
21217
|
+
};
|
|
21240
21218
|
var notEditableBackground = {
|
|
21241
21219
|
backgroundColor: "rgba(255, 0, 0, 0.2)",
|
|
21242
21220
|
borderRadius: 3,
|
|
21243
21221
|
padding: "0 4px"
|
|
21244
21222
|
};
|
|
21245
|
-
var TimelineNumberField = ({
|
|
21246
|
-
field,
|
|
21247
|
-
canUpdate,
|
|
21248
|
-
onSave,
|
|
21249
|
-
onSavingChange,
|
|
21250
|
-
onDragValueChange,
|
|
21251
|
-
onDragEnd
|
|
21252
|
-
}) => {
|
|
21223
|
+
var TimelineNumberField = ({ field, codeValue, canUpdate, onSave, onDragValueChange, onDragEnd }) => {
|
|
21253
21224
|
const [dragValue, setDragValue] = useState69(null);
|
|
21254
21225
|
const dragging = useRef36(false);
|
|
21255
21226
|
const onValueChange = useCallback98((newVal) => {
|
|
@@ -21259,56 +21230,60 @@ var TimelineNumberField = ({
|
|
|
21259
21230
|
}, [onDragValueChange, field.key]);
|
|
21260
21231
|
useEffect66(() => {
|
|
21261
21232
|
setDragValue(null);
|
|
21262
|
-
onSavingChange(false);
|
|
21263
21233
|
onDragEnd();
|
|
21264
|
-
}, [field.currentValue,
|
|
21234
|
+
}, [field.currentValue, onDragEnd]);
|
|
21265
21235
|
const onValueChangeEnd = useCallback98((newVal) => {
|
|
21266
|
-
if (canUpdate && newVal !==
|
|
21267
|
-
onSavingChange(true);
|
|
21236
|
+
if (canUpdate && newVal !== codeValue) {
|
|
21268
21237
|
onSave(field.key, newVal).catch(() => {
|
|
21269
|
-
onSavingChange(false);
|
|
21270
21238
|
setDragValue(null);
|
|
21271
21239
|
});
|
|
21272
21240
|
} else {
|
|
21273
21241
|
setDragValue(null);
|
|
21274
21242
|
}
|
|
21275
|
-
}, [canUpdate, onSave,
|
|
21243
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21276
21244
|
const onTextChange = useCallback98((newVal) => {
|
|
21277
21245
|
if (canUpdate) {
|
|
21278
21246
|
const parsed = Number(newVal);
|
|
21279
|
-
if (!Number.isNaN(parsed) && parsed !==
|
|
21247
|
+
if (!Number.isNaN(parsed) && parsed !== codeValue) {
|
|
21280
21248
|
setDragValue(parsed);
|
|
21281
|
-
onSavingChange(true);
|
|
21282
21249
|
onSave(field.key, parsed).catch(() => {
|
|
21283
|
-
onSavingChange(false);
|
|
21284
21250
|
setDragValue(null);
|
|
21285
21251
|
});
|
|
21286
21252
|
}
|
|
21287
21253
|
}
|
|
21288
|
-
}, [canUpdate, onSave,
|
|
21254
|
+
}, [canUpdate, onSave, field.key, codeValue]);
|
|
21289
21255
|
return /* @__PURE__ */ jsx192(InputDragger, {
|
|
21290
21256
|
type: "number",
|
|
21291
|
-
value: dragValue ??
|
|
21257
|
+
value: dragValue ?? codeValue,
|
|
21292
21258
|
style: draggerStyle,
|
|
21293
21259
|
status: "ok",
|
|
21294
21260
|
onValueChange,
|
|
21295
21261
|
onValueChangeEnd,
|
|
21296
21262
|
onTextChange,
|
|
21297
|
-
min:
|
|
21298
|
-
max:
|
|
21299
|
-
step:
|
|
21263
|
+
min: field.fieldSchema.type === "number" ? field.fieldSchema.min ?? -Infinity : -Infinity,
|
|
21264
|
+
max: field.fieldSchema.type === "number" ? field.fieldSchema.max ?? Infinity : Infinity,
|
|
21265
|
+
step: field.fieldSchema.type === "number" ? field.fieldSchema.step ?? 1 : 1,
|
|
21300
21266
|
rightAlign: true
|
|
21301
21267
|
});
|
|
21302
21268
|
};
|
|
21303
|
-
var
|
|
21304
|
-
|
|
21305
|
-
|
|
21306
|
-
|
|
21307
|
-
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
|
|
21311
|
-
|
|
21269
|
+
var TimelineBooleanField = ({ field, codeValue, canUpdate, onSave }) => {
|
|
21270
|
+
const checked = Boolean(codeValue);
|
|
21271
|
+
const onChange = useCallback98(() => {
|
|
21272
|
+
if (canUpdate) {
|
|
21273
|
+
onSave(field.key, !checked);
|
|
21274
|
+
}
|
|
21275
|
+
}, [canUpdate, onSave, field.key, checked]);
|
|
21276
|
+
return /* @__PURE__ */ jsx192("div", {
|
|
21277
|
+
style: checkboxContainer,
|
|
21278
|
+
children: /* @__PURE__ */ jsx192(Checkbox, {
|
|
21279
|
+
checked,
|
|
21280
|
+
onChange,
|
|
21281
|
+
name: field.key,
|
|
21282
|
+
disabled: !canUpdate
|
|
21283
|
+
})
|
|
21284
|
+
});
|
|
21285
|
+
};
|
|
21286
|
+
var TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, canUpdate }) => {
|
|
21312
21287
|
const wrapperStyle = canUpdate === null || canUpdate === false ? notEditableBackground : undefined;
|
|
21313
21288
|
if (!field.supported) {
|
|
21314
21289
|
return /* @__PURE__ */ jsx192("span", {
|
|
@@ -21331,31 +21306,34 @@ var TimelineFieldValue = ({
|
|
|
21331
21306
|
})
|
|
21332
21307
|
});
|
|
21333
21308
|
}
|
|
21309
|
+
const effectiveCodeValue = propStatus.codeValue ?? field.currentValue ?? field.fieldSchema.default;
|
|
21334
21310
|
if (field.typeName === "number") {
|
|
21335
21311
|
return /* @__PURE__ */ jsx192("span", {
|
|
21336
21312
|
style: wrapperStyle,
|
|
21337
21313
|
children: /* @__PURE__ */ jsx192(TimelineNumberField, {
|
|
21338
21314
|
field,
|
|
21315
|
+
codeValue: effectiveCodeValue,
|
|
21339
21316
|
canUpdate,
|
|
21340
21317
|
onSave,
|
|
21341
|
-
onSavingChange,
|
|
21342
21318
|
onDragValueChange,
|
|
21343
21319
|
onDragEnd
|
|
21344
21320
|
})
|
|
21345
21321
|
});
|
|
21346
21322
|
}
|
|
21323
|
+
if (field.typeName === "boolean") {
|
|
21324
|
+
return /* @__PURE__ */ jsx192("span", {
|
|
21325
|
+
style: wrapperStyle,
|
|
21326
|
+
children: /* @__PURE__ */ jsx192(TimelineBooleanField, {
|
|
21327
|
+
field,
|
|
21328
|
+
codeValue: effectiveCodeValue,
|
|
21329
|
+
canUpdate,
|
|
21330
|
+
onSave
|
|
21331
|
+
})
|
|
21332
|
+
});
|
|
21333
|
+
}
|
|
21347
21334
|
return /* @__PURE__ */ jsx192("span", {
|
|
21348
21335
|
style: { ...unsupportedLabel, fontStyle: "normal" },
|
|
21349
|
-
children: String(
|
|
21350
|
-
});
|
|
21351
|
-
};
|
|
21352
|
-
var TimelineFieldSavingSpinner = ({ saving }) => {
|
|
21353
|
-
if (!saving) {
|
|
21354
|
-
return null;
|
|
21355
|
-
}
|
|
21356
|
-
return /* @__PURE__ */ jsx192(Spinner, {
|
|
21357
|
-
duration: 0.5,
|
|
21358
|
-
size: 12
|
|
21336
|
+
children: String(effectiveCodeValue)
|
|
21359
21337
|
});
|
|
21360
21338
|
};
|
|
21361
21339
|
|
|
@@ -21387,30 +21365,20 @@ var fieldLabelRow = {
|
|
|
21387
21365
|
gap: 6
|
|
21388
21366
|
};
|
|
21389
21367
|
var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatus }) => {
|
|
21390
|
-
const [saving, setSaving] = useState70(false);
|
|
21391
|
-
const onSavingChange = useCallback99((s) => {
|
|
21392
|
-
setSaving(s);
|
|
21393
|
-
}, []);
|
|
21394
21368
|
return /* @__PURE__ */ jsxs92("div", {
|
|
21395
21369
|
style: { ...fieldRow, height: field.rowHeight },
|
|
21396
21370
|
children: [
|
|
21397
|
-
/* @__PURE__ */
|
|
21371
|
+
/* @__PURE__ */ jsx193("div", {
|
|
21398
21372
|
style: fieldLabelRow,
|
|
21399
|
-
children:
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
}),
|
|
21404
|
-
/* @__PURE__ */ jsx193(TimelineFieldSavingSpinner, {
|
|
21405
|
-
saving
|
|
21406
|
-
})
|
|
21407
|
-
]
|
|
21373
|
+
children: /* @__PURE__ */ jsx193("span", {
|
|
21374
|
+
style: fieldName,
|
|
21375
|
+
children: field.description ?? field.key
|
|
21376
|
+
})
|
|
21408
21377
|
}),
|
|
21409
21378
|
/* @__PURE__ */ jsx193(TimelineFieldValue, {
|
|
21410
21379
|
field,
|
|
21411
21380
|
propStatus,
|
|
21412
21381
|
onSave,
|
|
21413
|
-
onSavingChange,
|
|
21414
21382
|
onDragValueChange,
|
|
21415
21383
|
onDragEnd,
|
|
21416
21384
|
canUpdate: propStatus?.canUpdate ?? false
|
|
@@ -21420,6 +21388,8 @@ var TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatu
|
|
|
21420
21388
|
};
|
|
21421
21389
|
var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
21422
21390
|
const [propStatuses, setPropStatuses] = useState70(null);
|
|
21391
|
+
const { previewServerState: state, subscribeToEvent } = useContext67(StudioServerConnectionCtx);
|
|
21392
|
+
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
21423
21393
|
const schemaFields = useMemo104(() => getSchemaFields(sequence.controls), [sequence.controls]);
|
|
21424
21394
|
const validatedLocation = useMemo104(() => {
|
|
21425
21395
|
if (!originalLocation || !originalLocation.source || !originalLocation.line) {
|
|
@@ -21431,17 +21401,32 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21431
21401
|
column: originalLocation.column ?? 0
|
|
21432
21402
|
};
|
|
21433
21403
|
}, [originalLocation]);
|
|
21404
|
+
const locationSource = validatedLocation?.source ?? null;
|
|
21405
|
+
const locationLine = validatedLocation?.line ?? null;
|
|
21406
|
+
const locationColumn = validatedLocation?.column ?? null;
|
|
21407
|
+
const schemaKeysString = useMemo104(() => schemaFields ? schemaFields.map((f) => f.key).join(",") : null, [schemaFields]);
|
|
21408
|
+
const currentLocationSource = useRef37(locationSource);
|
|
21409
|
+
currentLocationSource.current = locationSource;
|
|
21410
|
+
const currentLocationLine = useRef37(locationLine);
|
|
21411
|
+
currentLocationLine.current = locationLine;
|
|
21412
|
+
const currentLocationColumn = useRef37(locationColumn);
|
|
21413
|
+
currentLocationColumn.current = locationColumn;
|
|
21434
21414
|
useEffect67(() => {
|
|
21435
|
-
if (!
|
|
21415
|
+
if (!clientId || !locationSource || !locationLine || locationColumn === null || !schemaKeysString) {
|
|
21436
21416
|
setPropStatuses(null);
|
|
21437
21417
|
return;
|
|
21438
21418
|
}
|
|
21439
|
-
|
|
21440
|
-
|
|
21441
|
-
|
|
21442
|
-
|
|
21443
|
-
|
|
21419
|
+
const keys = schemaKeysString.split(",");
|
|
21420
|
+
callApi("/api/subscribe-to-sequence-props", {
|
|
21421
|
+
fileName: locationSource,
|
|
21422
|
+
line: locationLine,
|
|
21423
|
+
column: locationColumn,
|
|
21424
|
+
keys,
|
|
21425
|
+
clientId
|
|
21444
21426
|
}).then((result) => {
|
|
21427
|
+
if (currentLocationSource.current !== locationSource || currentLocationLine.current !== locationLine || currentLocationColumn.current !== locationColumn) {
|
|
21428
|
+
return;
|
|
21429
|
+
}
|
|
21445
21430
|
if (result.canUpdate) {
|
|
21446
21431
|
setPropStatuses(result.props);
|
|
21447
21432
|
} else {
|
|
@@ -21450,7 +21435,43 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21450
21435
|
}).catch(() => {
|
|
21451
21436
|
setPropStatuses(null);
|
|
21452
21437
|
});
|
|
21453
|
-
|
|
21438
|
+
return () => {
|
|
21439
|
+
callApi("/api/unsubscribe-from-sequence-props", {
|
|
21440
|
+
fileName: locationSource,
|
|
21441
|
+
line: locationLine,
|
|
21442
|
+
column: locationColumn,
|
|
21443
|
+
clientId
|
|
21444
|
+
}).catch(() => {});
|
|
21445
|
+
};
|
|
21446
|
+
}, [
|
|
21447
|
+
clientId,
|
|
21448
|
+
locationSource,
|
|
21449
|
+
locationLine,
|
|
21450
|
+
locationColumn,
|
|
21451
|
+
schemaKeysString
|
|
21452
|
+
]);
|
|
21453
|
+
useEffect67(() => {
|
|
21454
|
+
if (!locationSource || !locationLine || locationColumn === null) {
|
|
21455
|
+
return;
|
|
21456
|
+
}
|
|
21457
|
+
const listener = (event) => {
|
|
21458
|
+
if (event.type !== "sequence-props-updated") {
|
|
21459
|
+
return;
|
|
21460
|
+
}
|
|
21461
|
+
if (event.fileName !== currentLocationSource.current || event.line !== currentLocationLine.current || event.column !== currentLocationColumn.current) {
|
|
21462
|
+
return;
|
|
21463
|
+
}
|
|
21464
|
+
if (event.result.canUpdate) {
|
|
21465
|
+
setPropStatuses(event.result.props);
|
|
21466
|
+
} else {
|
|
21467
|
+
setPropStatuses(null);
|
|
21468
|
+
}
|
|
21469
|
+
};
|
|
21470
|
+
const unsub = subscribeToEvent("sequence-props-updated", listener);
|
|
21471
|
+
return () => {
|
|
21472
|
+
unsub();
|
|
21473
|
+
};
|
|
21474
|
+
}, [locationSource, locationLine, locationColumn, subscribeToEvent]);
|
|
21454
21475
|
const expandedHeight = useMemo104(() => getExpandedTrackHeight(sequence.controls), [sequence.controls]);
|
|
21455
21476
|
const { setOverride, clearOverrides } = useContext67(Internals49.SequenceControlOverrideContext);
|
|
21456
21477
|
const onSave = useCallback99((key4, value) => {
|
|
@@ -21461,23 +21482,27 @@ var TimelineExpandedSection = ({ sequence, originalLocation }) => {
|
|
|
21461
21482
|
if (!status || !status.canUpdate) {
|
|
21462
21483
|
return Promise.reject(new Error("Cannot save"));
|
|
21463
21484
|
}
|
|
21485
|
+
const field = schemaFields?.find((f) => f.key === key4);
|
|
21486
|
+
const defaultValue = field && field.fieldSchema.default !== undefined ? JSON.stringify(field.fieldSchema.default) : null;
|
|
21464
21487
|
return callApi("/api/save-sequence-props", {
|
|
21465
21488
|
fileName: validatedLocation.source,
|
|
21466
21489
|
line: validatedLocation.line,
|
|
21467
21490
|
column: validatedLocation.column,
|
|
21468
21491
|
key: key4,
|
|
21469
21492
|
value: JSON.stringify(value),
|
|
21470
|
-
enumPaths: []
|
|
21493
|
+
enumPaths: [],
|
|
21494
|
+
defaultValue
|
|
21471
21495
|
}).then(() => {
|
|
21472
21496
|
return;
|
|
21473
21497
|
});
|
|
21474
|
-
}, [propStatuses, validatedLocation]);
|
|
21498
|
+
}, [propStatuses, validatedLocation, schemaFields]);
|
|
21499
|
+
const overrideId = sequence.controls?.overrideId ?? sequence.id;
|
|
21475
21500
|
const onDragValueChange = useCallback99((key4, value) => {
|
|
21476
|
-
setOverride(
|
|
21477
|
-
}, [setOverride,
|
|
21501
|
+
setOverride(overrideId, key4, value);
|
|
21502
|
+
}, [setOverride, overrideId]);
|
|
21478
21503
|
const onDragEnd = useCallback99(() => {
|
|
21479
|
-
clearOverrides(
|
|
21480
|
-
}, [clearOverrides,
|
|
21504
|
+
clearOverrides(overrideId);
|
|
21505
|
+
}, [clearOverrides, overrideId]);
|
|
21481
21506
|
return /* @__PURE__ */ jsx193("div", {
|
|
21482
21507
|
style: { ...expandedSectionBase, height: expandedHeight },
|
|
21483
21508
|
children: schemaFields ? schemaFields.map((field) => /* @__PURE__ */ jsx193(TimelineFieldRow, {
|
|
@@ -21752,7 +21777,8 @@ var arrowButton = {
|
|
|
21752
21777
|
lineHeight: 1
|
|
21753
21778
|
};
|
|
21754
21779
|
var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
21755
|
-
const
|
|
21780
|
+
const { previewServerState } = useContext69(StudioServerConnectionCtx);
|
|
21781
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
21756
21782
|
const { hidden, setHidden } = useContext69(Internals50.SequenceVisibilityToggleContext);
|
|
21757
21783
|
const { expandedTracks, toggleTrack } = useContext69(ExpandedTracksContext);
|
|
21758
21784
|
const [originalLocation, setOriginalLocation] = useState72(null);
|
|
@@ -21766,7 +21792,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
21766
21792
|
console.error("Could not get original location of Sequence", err);
|
|
21767
21793
|
});
|
|
21768
21794
|
}, [sequence.stack]);
|
|
21769
|
-
const isExpanded = expandedTracks[sequence.id] ?? false;
|
|
21795
|
+
const isExpanded = visualModeEnabled && (expandedTracks[sequence.id] ?? false);
|
|
21770
21796
|
const onToggleExpand = useCallback102(() => {
|
|
21771
21797
|
toggleTrack(sequence.id);
|
|
21772
21798
|
}, [sequence.id, toggleTrack]);
|
|
@@ -21858,7 +21884,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
21858
21884
|
};
|
|
21859
21885
|
|
|
21860
21886
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
21861
|
-
import { useContext as useContext70, useEffect as useEffect70, useMemo as useMemo107, useRef as
|
|
21887
|
+
import { useContext as useContext70, useEffect as useEffect70, useMemo as useMemo107, useRef as useRef39 } from "react";
|
|
21862
21888
|
import { Internals as Internals52 } from "remotion";
|
|
21863
21889
|
|
|
21864
21890
|
// src/components/TimeValue.tsx
|
|
@@ -21867,7 +21893,7 @@ import {
|
|
|
21867
21893
|
useCallback as useCallback103,
|
|
21868
21894
|
useEffect as useEffect69,
|
|
21869
21895
|
useImperativeHandle as useImperativeHandle13,
|
|
21870
|
-
useRef as
|
|
21896
|
+
useRef as useRef38
|
|
21871
21897
|
} from "react";
|
|
21872
21898
|
import { Internals as Internals51, useCurrentFrame } from "remotion";
|
|
21873
21899
|
import { jsx as jsx197, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
@@ -21900,7 +21926,7 @@ var TimeValue = () => {
|
|
|
21900
21926
|
const isStill = useIsStill();
|
|
21901
21927
|
const { seek, play, pause, toggle } = PlayerInternals17.usePlayer();
|
|
21902
21928
|
const keybindings = useKeybinding();
|
|
21903
|
-
const ref =
|
|
21929
|
+
const ref = useRef38(null);
|
|
21904
21930
|
const onTextChange = useCallback103((newVal) => {
|
|
21905
21931
|
seek(parseInt(newVal, 10));
|
|
21906
21932
|
}, [seek]);
|
|
@@ -22028,7 +22054,7 @@ var TimelineTimeIndicators = () => {
|
|
|
22028
22054
|
});
|
|
22029
22055
|
};
|
|
22030
22056
|
var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
|
|
22031
|
-
const ref =
|
|
22057
|
+
const ref = useRef39(null);
|
|
22032
22058
|
useEffect70(() => {
|
|
22033
22059
|
const currentRef = ref.current;
|
|
22034
22060
|
if (!currentRef) {
|
|
@@ -22111,7 +22137,7 @@ var container42 = {
|
|
|
22111
22137
|
background: BACKGROUND
|
|
22112
22138
|
};
|
|
22113
22139
|
var TimelineList = ({ timeline }) => {
|
|
22114
|
-
const ref =
|
|
22140
|
+
const ref = useRef40(null);
|
|
22115
22141
|
const size4 = PlayerInternals18.useElementSize(ref, {
|
|
22116
22142
|
shouldApplyCssTransforms: false,
|
|
22117
22143
|
triggerOnWindowResize: false
|
|
@@ -22260,21 +22286,10 @@ var getTimelineSequenceLayout = ({
|
|
|
22260
22286
|
postmountDisplay
|
|
22261
22287
|
}) => {
|
|
22262
22288
|
const maxMediaSequenceDuration = (maxMediaDuration ?? Infinity) - startFromMedia;
|
|
22263
|
-
const lastFrame =
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
const
|
|
22267
|
-
const shouldAddHalfAFrameAtStart = startFrom > 0;
|
|
22268
|
-
if (shouldAddHalfAFrameAtEnd) {
|
|
22269
|
-
spatialDuration += 0.5;
|
|
22270
|
-
naturalSpatialDuration += 0.5;
|
|
22271
|
-
}
|
|
22272
|
-
if (shouldAddHalfAFrameAtStart) {
|
|
22273
|
-
spatialDuration += 0.5;
|
|
22274
|
-
naturalSpatialDuration += 0.5;
|
|
22275
|
-
}
|
|
22276
|
-
const startFromWithOffset = shouldAddHalfAFrameAtStart ? startFrom - 0.5 : startFrom;
|
|
22277
|
-
const marginLeft = lastFrame === 0 ? 0 : startFromWithOffset / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22289
|
+
const lastFrame = video.durationInFrames ?? 1;
|
|
22290
|
+
const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames, lastFrame - startFrom);
|
|
22291
|
+
const naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames);
|
|
22292
|
+
const marginLeft = lastFrame === 0 ? 0 : startFrom / lastFrame * (windowWidth - TIMELINE_PADDING * 2);
|
|
22278
22293
|
const nonNegativeMarginLeft = Math.min(marginLeft, 0);
|
|
22279
22294
|
const width = getWidthOfTrack({
|
|
22280
22295
|
durationInFrames,
|
|
@@ -22363,7 +22378,7 @@ var useMaxMediaDuration = (s, fps) => {
|
|
|
22363
22378
|
|
|
22364
22379
|
// src/components/AudioWaveform.tsx
|
|
22365
22380
|
import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
|
|
22366
|
-
import { useEffect as useEffect73, useMemo as useMemo110, useRef as
|
|
22381
|
+
import { useEffect as useEffect73, useMemo as useMemo110, useRef as useRef41, useState as useState74 } from "react";
|
|
22367
22382
|
import { Internals as Internals54 } from "remotion";
|
|
22368
22383
|
|
|
22369
22384
|
// src/components/AudioWaveformBar.tsx
|
|
@@ -22422,12 +22437,12 @@ var AudioWaveform = ({
|
|
|
22422
22437
|
}) => {
|
|
22423
22438
|
const [metadata, setMetadata] = useState74(null);
|
|
22424
22439
|
const [error, setError] = useState74(null);
|
|
22425
|
-
const mountState =
|
|
22440
|
+
const mountState = useRef41({ isMounted: true });
|
|
22426
22441
|
const vidConf = Internals54.useUnsafeVideoConfig();
|
|
22427
22442
|
if (vidConf === null) {
|
|
22428
22443
|
throw new Error("Expected video config");
|
|
22429
22444
|
}
|
|
22430
|
-
const canvas =
|
|
22445
|
+
const canvas = useRef41(null);
|
|
22431
22446
|
useEffect73(() => {
|
|
22432
22447
|
const { current } = mountState;
|
|
22433
22448
|
current.isMounted = true;
|
|
@@ -22627,7 +22642,8 @@ var relativeFrameStyle = {
|
|
|
22627
22642
|
fontSize: 11,
|
|
22628
22643
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
22629
22644
|
color: "white",
|
|
22630
|
-
opacity: 0.5
|
|
22645
|
+
opacity: 0.5,
|
|
22646
|
+
whiteSpace: "nowrap"
|
|
22631
22647
|
};
|
|
22632
22648
|
var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
22633
22649
|
return /* @__PURE__ */ jsx205("div", {
|
|
@@ -22637,7 +22653,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
|
22637
22653
|
};
|
|
22638
22654
|
|
|
22639
22655
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
22640
|
-
import { useEffect as useEffect74, useRef as
|
|
22656
|
+
import { useEffect as useEffect74, useRef as useRef42, useState as useState75 } from "react";
|
|
22641
22657
|
import { useVideoConfig as useVideoConfig5 } from "remotion";
|
|
22642
22658
|
|
|
22643
22659
|
// src/helpers/extract-frames.ts
|
|
@@ -22685,15 +22701,22 @@ async function extractFrames({
|
|
|
22685
22701
|
return;
|
|
22686
22702
|
}
|
|
22687
22703
|
const sink = new VideoSampleSink(videoTrack);
|
|
22688
|
-
|
|
22689
|
-
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22693
|
-
|
|
22694
|
-
|
|
22704
|
+
const sampleIterator = sink.samplesAtTimestamps(timestamps);
|
|
22705
|
+
try {
|
|
22706
|
+
for await (const videoSample of sampleIterator) {
|
|
22707
|
+
if (signal?.aborted) {
|
|
22708
|
+
videoSample?.close();
|
|
22709
|
+
break;
|
|
22710
|
+
}
|
|
22711
|
+
if (!videoSample) {
|
|
22712
|
+
continue;
|
|
22713
|
+
}
|
|
22714
|
+
onVideoSample(videoSample);
|
|
22695
22715
|
}
|
|
22696
|
-
|
|
22716
|
+
} finally {
|
|
22717
|
+
try {
|
|
22718
|
+
await sampleIterator.return?.();
|
|
22719
|
+
} catch {}
|
|
22697
22720
|
}
|
|
22698
22721
|
} catch (error) {
|
|
22699
22722
|
if (error instanceof InputDisposedError2) {
|
|
@@ -22966,9 +22989,9 @@ var TimelineVideoInfo = ({
|
|
|
22966
22989
|
playbackRate
|
|
22967
22990
|
}) => {
|
|
22968
22991
|
const { fps } = useVideoConfig5();
|
|
22969
|
-
const ref =
|
|
22992
|
+
const ref = useRef42(null);
|
|
22970
22993
|
const [error, setError] = useState75(null);
|
|
22971
|
-
const aspectRatio =
|
|
22994
|
+
const aspectRatio = useRef42(getAspectRatioFromCache(src));
|
|
22972
22995
|
useEffect74(() => {
|
|
22973
22996
|
return () => {
|
|
22974
22997
|
clearFramesForSrc(src);
|
|
@@ -23036,46 +23059,59 @@ var TimelineVideoInfo = ({
|
|
|
23036
23059
|
},
|
|
23037
23060
|
src,
|
|
23038
23061
|
onVideoSample: (sample) => {
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23057
|
-
|
|
23058
|
-
|
|
23062
|
+
let frame2;
|
|
23063
|
+
try {
|
|
23064
|
+
frame2 = sample.toVideoFrame();
|
|
23065
|
+
const scale = HEIGHT / frame2.displayHeight * window.devicePixelRatio;
|
|
23066
|
+
const transformed = resizeVideoFrame({
|
|
23067
|
+
frame: frame2,
|
|
23068
|
+
scale
|
|
23069
|
+
});
|
|
23070
|
+
if (transformed !== frame2) {
|
|
23071
|
+
frame2.close();
|
|
23072
|
+
}
|
|
23073
|
+
frame2 = undefined;
|
|
23074
|
+
const databaseKey = makeFrameDatabaseKey(src, transformed.timestamp);
|
|
23075
|
+
const existingFrame = frameDatabase.get(databaseKey);
|
|
23076
|
+
if (existingFrame) {
|
|
23077
|
+
existingFrame.frame.close();
|
|
23078
|
+
}
|
|
23079
|
+
frameDatabase.set(databaseKey, {
|
|
23080
|
+
frame: transformed,
|
|
23081
|
+
lastUsed: Date.now()
|
|
23082
|
+
});
|
|
23083
|
+
if (aspectRatio.current === null) {
|
|
23084
|
+
throw new Error("Aspect ratio is not set");
|
|
23085
|
+
}
|
|
23086
|
+
ensureSlots({
|
|
23087
|
+
filledSlots,
|
|
23088
|
+
fromSeconds,
|
|
23089
|
+
toSeconds,
|
|
23090
|
+
naturalWidth,
|
|
23091
|
+
aspectRatio: aspectRatio.current
|
|
23092
|
+
});
|
|
23093
|
+
fillFrameWhereItFits({
|
|
23094
|
+
ctx,
|
|
23095
|
+
filledSlots,
|
|
23096
|
+
visualizationWidth: naturalWidth,
|
|
23097
|
+
frame: transformed,
|
|
23098
|
+
segmentDuration: toSeconds - fromSeconds,
|
|
23099
|
+
fromSeconds
|
|
23100
|
+
});
|
|
23101
|
+
} catch (e) {
|
|
23102
|
+
if (frame2) {
|
|
23103
|
+
frame2.close();
|
|
23104
|
+
}
|
|
23105
|
+
throw e;
|
|
23106
|
+
} finally {
|
|
23107
|
+
sample.close();
|
|
23059
23108
|
}
|
|
23060
|
-
ensureSlots({
|
|
23061
|
-
filledSlots,
|
|
23062
|
-
fromSeconds,
|
|
23063
|
-
toSeconds,
|
|
23064
|
-
naturalWidth,
|
|
23065
|
-
aspectRatio: aspectRatio.current
|
|
23066
|
-
});
|
|
23067
|
-
fillFrameWhereItFits({
|
|
23068
|
-
ctx,
|
|
23069
|
-
filledSlots,
|
|
23070
|
-
visualizationWidth: naturalWidth,
|
|
23071
|
-
frame: transformed,
|
|
23072
|
-
segmentDuration: toSeconds - fromSeconds,
|
|
23073
|
-
fromSeconds
|
|
23074
|
-
});
|
|
23075
|
-
sample.close();
|
|
23076
23109
|
},
|
|
23077
23110
|
signal: controller.signal
|
|
23078
23111
|
}).then(() => {
|
|
23112
|
+
if (controller.signal.aborted) {
|
|
23113
|
+
return;
|
|
23114
|
+
}
|
|
23079
23115
|
fillWithCachedFrames({
|
|
23080
23116
|
ctx,
|
|
23081
23117
|
naturalWidth,
|
|
@@ -23251,7 +23287,8 @@ var getExpandedPlaceholderStyle = (controls) => ({
|
|
|
23251
23287
|
});
|
|
23252
23288
|
var TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
23253
23289
|
const { expandedTracks } = useContext73(ExpandedTracksContext);
|
|
23254
|
-
const
|
|
23290
|
+
const { previewServerState } = useContext73(StudioServerConnectionCtx);
|
|
23291
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23255
23292
|
const timelineStyle = useMemo112(() => {
|
|
23256
23293
|
return {
|
|
23257
23294
|
...timelineContent,
|
|
@@ -24892,7 +24929,7 @@ import {
|
|
|
24892
24929
|
useContext as useContext85,
|
|
24893
24930
|
useEffect as useEffect80,
|
|
24894
24931
|
useMemo as useMemo121,
|
|
24895
|
-
useRef as
|
|
24932
|
+
useRef as useRef44,
|
|
24896
24933
|
useState as useState81
|
|
24897
24934
|
} from "react";
|
|
24898
24935
|
import { Internals as Internals63 } from "remotion";
|
|
@@ -25765,7 +25802,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
25765
25802
|
};
|
|
25766
25803
|
|
|
25767
25804
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
25768
|
-
import { useEffect as useEffect79, useMemo as useMemo120, useRef as
|
|
25805
|
+
import { useEffect as useEffect79, useMemo as useMemo120, useRef as useRef43, useState as useState80 } from "react";
|
|
25769
25806
|
import { jsx as jsx227, jsxs as jsxs116, Fragment as Fragment36 } from "react/jsx-runtime";
|
|
25770
25807
|
var container50 = {
|
|
25771
25808
|
paddingLeft: 16,
|
|
@@ -25795,7 +25832,7 @@ var labelContainer = {
|
|
|
25795
25832
|
};
|
|
25796
25833
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
25797
25834
|
const [hovered, setIsHovered] = useState80(false);
|
|
25798
|
-
const ref =
|
|
25835
|
+
const ref = useRef43(null);
|
|
25799
25836
|
const keybindings = useKeybinding();
|
|
25800
25837
|
useEffect79(() => {
|
|
25801
25838
|
const { current } = ref;
|
|
@@ -25973,7 +26010,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
25973
26010
|
selectedIndex: 0
|
|
25974
26011
|
});
|
|
25975
26012
|
}, [initialMode, invocationTimestamp]);
|
|
25976
|
-
const inputRef =
|
|
26013
|
+
const inputRef = useRef44(null);
|
|
25977
26014
|
const selectComposition = useSelectComposition();
|
|
25978
26015
|
const closeMenu = useCallback112(() => {
|
|
25979
26016
|
return;
|
|
@@ -26733,7 +26770,7 @@ import {
|
|
|
26733
26770
|
useEffect as useEffect83,
|
|
26734
26771
|
useMemo as useMemo132,
|
|
26735
26772
|
useReducer as useReducer2,
|
|
26736
|
-
useRef as
|
|
26773
|
+
useRef as useRef46,
|
|
26737
26774
|
useState as useState87
|
|
26738
26775
|
} from "react";
|
|
26739
26776
|
|
|
@@ -28476,12 +28513,12 @@ import { BrowserSafeApis as BrowserSafeApis6 } from "@remotion/renderer/client";
|
|
|
28476
28513
|
import { useCallback as useCallback124, useMemo as useMemo127 } from "react";
|
|
28477
28514
|
|
|
28478
28515
|
// src/helpers/use-file-existence.ts
|
|
28479
|
-
import { useContext as useContext87, useEffect as useEffect82, useRef as
|
|
28516
|
+
import { useContext as useContext87, useEffect as useEffect82, useRef as useRef45, useState as useState86 } from "react";
|
|
28480
28517
|
var useFileExistence = (outName) => {
|
|
28481
28518
|
const [exists, setExists] = useState86(false);
|
|
28482
28519
|
const { previewServerState: state, subscribeToEvent } = useContext87(StudioServerConnectionCtx);
|
|
28483
28520
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
28484
|
-
const currentOutName =
|
|
28521
|
+
const currentOutName = useRef45("");
|
|
28485
28522
|
currentOutName.current = outName;
|
|
28486
28523
|
useEffect82(() => {
|
|
28487
28524
|
if (!clientId) {
|
|
@@ -29869,7 +29906,7 @@ var RenderModal = ({
|
|
|
29869
29906
|
resolved: { result: resolvedComposition },
|
|
29870
29907
|
unresolved: unresolvedComposition
|
|
29871
29908
|
} = context;
|
|
29872
|
-
const isMounted =
|
|
29909
|
+
const isMounted = useRef46(true);
|
|
29873
29910
|
const [isVideo] = useState87(() => {
|
|
29874
29911
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
29875
29912
|
});
|
|
@@ -30864,9 +30901,9 @@ import {
|
|
|
30864
30901
|
getEncodableAudioCodecs,
|
|
30865
30902
|
getSupportedAudioCodecsForContainer
|
|
30866
30903
|
} from "@remotion/web-renderer";
|
|
30867
|
-
import { useEffect as useEffect84, useRef as
|
|
30904
|
+
import { useEffect as useEffect84, useRef as useRef47, useState as useState88 } from "react";
|
|
30868
30905
|
var useEncodableAudioCodecs = (container61) => {
|
|
30869
|
-
const cacheRef =
|
|
30906
|
+
const cacheRef = useRef47({});
|
|
30870
30907
|
const [codecsByContainer, setCodecsByContainer] = useState88(() => {
|
|
30871
30908
|
return {
|
|
30872
30909
|
[container61]: getSupportedAudioCodecsForContainer(container61)
|
|
@@ -30906,9 +30943,9 @@ import {
|
|
|
30906
30943
|
getEncodableVideoCodecs,
|
|
30907
30944
|
getSupportedVideoCodecsForContainer
|
|
30908
30945
|
} from "@remotion/web-renderer";
|
|
30909
|
-
import { useEffect as useEffect85, useRef as
|
|
30946
|
+
import { useEffect as useEffect85, useRef as useRef48, useState as useState89 } from "react";
|
|
30910
30947
|
var useEncodableVideoCodecs = (container61) => {
|
|
30911
|
-
const cacheRef =
|
|
30948
|
+
const cacheRef = useRef48({});
|
|
30912
30949
|
const [codecsByContainer, setCodecsByContainer] = useState89(() => {
|
|
30913
30950
|
return {
|
|
30914
30951
|
[container61]: getSupportedVideoCodecsForContainer(container61)
|
|
@@ -33247,15 +33284,15 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
33247
33284
|
};
|
|
33248
33285
|
|
|
33249
33286
|
// src/components/ShowGuidesProvider.tsx
|
|
33250
|
-
import { useCallback as useCallback143, useMemo as useMemo146, useRef as
|
|
33287
|
+
import { useCallback as useCallback143, useMemo as useMemo146, useRef as useRef49, useState as useState99 } from "react";
|
|
33251
33288
|
import { jsx as jsx286 } from "react/jsx-runtime";
|
|
33252
33289
|
var ShowGuidesProvider = ({ children }) => {
|
|
33253
33290
|
const [guidesList, setGuidesList] = useState99(() => loadGuidesList());
|
|
33254
33291
|
const [selectedGuideId, setSelectedGuideId] = useState99(null);
|
|
33255
33292
|
const [hoveredGuideId, setHoveredGuideId] = useState99(null);
|
|
33256
33293
|
const [editorShowGuides, setEditorShowGuidesState] = useState99(() => loadEditorShowGuidesOption());
|
|
33257
|
-
const shouldCreateGuideRef =
|
|
33258
|
-
const shouldDeleteGuideRef =
|
|
33294
|
+
const shouldCreateGuideRef = useRef49(false);
|
|
33295
|
+
const shouldDeleteGuideRef = useRef49(false);
|
|
33259
33296
|
const setEditorShowGuides = useCallback143((newValue) => {
|
|
33260
33297
|
setEditorShowGuidesState((prevState) => {
|
|
33261
33298
|
const newVal = newValue(prevState);
|