@remotion/studio-shared 4.0.469 → 4.0.471

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.
@@ -1,16 +1,33 @@
1
1
  import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
2
2
  import type { HardwareAccelerationOption } from '@remotion/renderer/client';
3
- import type { CannotUpdateSequenceReason } from 'remotion';
4
- import type { _InternalTypes, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, SequenceSchema, SequenceNodePath, SequencePropsSubscriptionKey } from 'remotion';
3
+ import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
5
4
  import type { RecastCodemod, VisualControlChange } from './codemods';
6
5
  import type { PackageManager } from './package-manager';
7
6
  import type { ProjectInfo } from './project-info';
8
- import type { RequiredChromiumOptions } from './render-job';
7
+ import type { CompletedClientRender, RequiredChromiumOptions } from './render-job';
9
8
  import type { SymbolicatedStackFrame } from './stack-types';
10
9
  import type { EnumPath } from './stringify-default-props';
11
10
  export type OpenInFileExplorerRequest = {
12
11
  directory: string;
13
12
  };
13
+ export type OpenInEditorRequest = {
14
+ stack: SymbolicatedStackFrame;
15
+ };
16
+ export type OpenInEditorResponse = {
17
+ success: boolean;
18
+ };
19
+ export type CompositionComponentInfoRequest = {
20
+ compositionFile: string;
21
+ compositionId: string;
22
+ };
23
+ export type CompositionComponentInfoResponse = {
24
+ location: {
25
+ source: string;
26
+ line: number;
27
+ column: number;
28
+ };
29
+ canAddSequence: boolean;
30
+ };
14
31
  export type CopyStillToClipboardRequest = {
15
32
  outName: string;
16
33
  binariesDirectory: string | null;
@@ -171,6 +188,7 @@ export type SubscribeToSequencePropsRequest = {
171
188
  fileName: string;
172
189
  line: number;
173
190
  column: number;
191
+ nodePath: SequenceNodePath | null;
174
192
  keys: string[];
175
193
  effects: string[][];
176
194
  clientId: string;
@@ -190,18 +208,29 @@ export type UnsubscribeFromSequencePropsRequest = {
190
208
  sequenceKeys: string[];
191
209
  effectKeys: string[][];
192
210
  };
193
- export type SaveSequencePropsRequest = {
211
+ export type SaveSequencePropEdit = {
194
212
  fileName: string;
195
213
  nodePath: SequencePropsSubscriptionKey;
196
214
  key: string;
197
215
  value: string;
198
216
  defaultValue: string | null;
199
217
  schema: SequenceSchema;
218
+ };
219
+ export type SaveSequencePropsRequest = {
220
+ edits: SaveSequencePropEdit[];
200
221
  clientId: string;
222
+ undoLabel: string | null;
223
+ redoLabel: string | null;
224
+ };
225
+ export type SaveSequencePropsResult = {
226
+ fileName: string;
227
+ nodePath: SequencePropsSubscriptionKey;
228
+ props: Record<string, CanUpdateSequencePropStatus>;
201
229
  };
202
230
  export type SaveSequencePropsResponse = {
203
231
  canUpdate: true;
204
232
  props: Record<string, CanUpdateSequencePropStatus>;
233
+ results: SaveSequencePropsResult[];
205
234
  } | {
206
235
  canUpdate: false;
207
236
  reason: CannotUpdateSequenceReason;
@@ -217,11 +246,90 @@ export type SaveEffectPropsRequest = {
217
246
  clientId: string;
218
247
  };
219
248
  export type SaveEffectPropsResponse = CanUpdateEffectPropsResponse;
220
- export type DeleteEffectRequest = {
249
+ export type AddEffectRequest = {
250
+ fileName: string;
251
+ sequenceNodePath: SequencePropsSubscriptionKey;
252
+ effectName: string;
253
+ effectImportPath: string;
254
+ effectConfig: Record<string, unknown>;
255
+ clientId: string;
256
+ };
257
+ export type AddEffectResponse = {
258
+ success: true;
259
+ } | {
260
+ success: false;
261
+ reason: string;
262
+ stack: string;
263
+ };
264
+ export type ReorderEffectRequest = {
265
+ fileName: string;
266
+ sequenceNodePath: SequencePropsSubscriptionKey;
267
+ fromIndex: number;
268
+ toIndex: number;
269
+ clientId: string;
270
+ };
271
+ export type ReorderEffectResponse = {
272
+ success: true;
273
+ } | {
274
+ success: false;
275
+ reason: string;
276
+ stack: string;
277
+ };
278
+ export type DeleteSequenceKeyframe = {
279
+ fileName: string;
280
+ nodePath: SequencePropsSubscriptionKey;
281
+ key: string;
282
+ frame: number;
283
+ schema: SequenceSchema;
284
+ };
285
+ export type AddSequenceKeyframeRequest = {
286
+ fileName: string;
287
+ nodePath: SequencePropsSubscriptionKey;
288
+ key: string;
289
+ frame: number;
290
+ value: string;
291
+ schema: SequenceSchema;
292
+ clientId: string;
293
+ };
294
+ export type AddSequenceKeyframeResponse = SaveSequencePropsResponse;
295
+ export type DeleteEffectKeyframe = {
221
296
  fileName: string;
222
297
  sequenceNodePath: SequencePropsSubscriptionKey;
223
298
  effectIndex: number;
299
+ key: string;
300
+ frame: number;
301
+ schema: SequenceSchema;
224
302
  };
303
+ export type DeleteKeyframesRequest = {
304
+ sequenceKeyframes: DeleteSequenceKeyframe[];
305
+ effectKeyframes: DeleteEffectKeyframe[];
306
+ clientId: string;
307
+ };
308
+ export type DeleteKeyframesResponse = {
309
+ success: true;
310
+ };
311
+ export type AddEffectKeyframeRequest = {
312
+ fileName: string;
313
+ sequenceNodePath: SequencePropsSubscriptionKey;
314
+ effectIndex: number;
315
+ key: string;
316
+ frame: number;
317
+ value: string;
318
+ schema: SequenceSchema;
319
+ clientId: string;
320
+ };
321
+ export type AddEffectKeyframeResponse = SaveEffectPropsResponse;
322
+ type BaseDeleteEffectRequestItem = {
323
+ fileName: string;
324
+ sequenceNodePath: SequencePropsSubscriptionKey;
325
+ };
326
+ export type DeleteEffectRequestItem = (BaseDeleteEffectRequestItem & {
327
+ type: 'single-effect';
328
+ effectIndex: number;
329
+ }) | (BaseDeleteEffectRequestItem & {
330
+ type: 'all-effects';
331
+ });
332
+ export type DeleteEffectRequest = DeleteEffectRequestItem[];
225
333
  export type DeleteEffectResponse = {
226
334
  success: true;
227
335
  } | {
@@ -229,10 +337,13 @@ export type DeleteEffectResponse = {
229
337
  reason: string;
230
338
  stack: string;
231
339
  };
232
- export type DeleteJsxNodeRequest = {
340
+ export type DeleteJsxNodeRequestItem = {
233
341
  fileName: string;
234
342
  nodePath: SequenceNodePath;
235
343
  };
344
+ export type DeleteJsxNodeRequest = {
345
+ nodes: DeleteJsxNodeRequestItem[];
346
+ };
236
347
  export type DeleteJsxNodeResponse = {
237
348
  success: true;
238
349
  } | {
@@ -251,6 +362,23 @@ export type DuplicateJsxNodeResponse = {
251
362
  reason: string;
252
363
  stack: string;
253
364
  };
365
+ export type InsertableCompositionElement = {
366
+ type: 'solid';
367
+ width: number;
368
+ height: number;
369
+ };
370
+ export type InsertJsxElementRequest = {
371
+ compositionFile: string;
372
+ compositionId: string;
373
+ element: InsertableCompositionElement;
374
+ };
375
+ export type InsertJsxElementResponse = {
376
+ success: true;
377
+ } | {
378
+ success: false;
379
+ reason: string;
380
+ stack: string;
381
+ };
254
382
  export type UpdateAvailableRequest = {};
255
383
  export type UpdateAvailableResponse = {
256
384
  currentVersion: string;
@@ -284,12 +412,18 @@ export type RedoResponse = {
284
412
  reason: string;
285
413
  };
286
414
  export type ApiRoutes = {
415
+ '/api/composition-component-info': ReqAndRes<CompositionComponentInfoRequest, CompositionComponentInfoResponse>;
287
416
  '/api/cancel': ReqAndRes<CancelRenderRequest, CancelRenderResponse>;
288
417
  '/api/render': ReqAndRes<AddRenderRequest, undefined>;
289
418
  '/api/unsubscribe-from-file-existence': ReqAndRes<UnsubscribeFromFileExistenceRequest, undefined>;
290
419
  '/api/subscribe-to-file-existence': ReqAndRes<SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse>;
291
420
  '/api/remove-render': ReqAndRes<RemoveRenderRequest, undefined>;
421
+ '/api/open-in-editor': ReqAndRes<OpenInEditorRequest, OpenInEditorResponse>;
292
422
  '/api/open-in-file-explorer': ReqAndRes<OpenInFileExplorerRequest, void>;
423
+ '/api/register-client-render': ReqAndRes<CompletedClientRender, void>;
424
+ '/api/unregister-client-render': ReqAndRes<{
425
+ id: string;
426
+ }, void>;
293
427
  '/api/update-default-props': ReqAndRes<UpdateDefaultPropsRequest, UpdateDefaultPropsResponse>;
294
428
  '/api/apply-visual-control-change': ReqAndRes<ApplyVisualControlRequest, ApplyVisualControlResponse>;
295
429
  '/api/subscribe-to-default-props': ReqAndRes<SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse>;
@@ -298,9 +432,15 @@ export type ApiRoutes = {
298
432
  '/api/unsubscribe-from-sequence-props': ReqAndRes<UnsubscribeFromSequencePropsRequest, undefined>;
299
433
  '/api/save-sequence-props': ReqAndRes<SaveSequencePropsRequest, SaveSequencePropsResponse>;
300
434
  '/api/save-effect-props': ReqAndRes<SaveEffectPropsRequest, SaveEffectPropsResponse>;
435
+ '/api/add-effect': ReqAndRes<AddEffectRequest, AddEffectResponse>;
436
+ '/api/reorder-effect': ReqAndRes<ReorderEffectRequest, ReorderEffectResponse>;
437
+ '/api/delete-keyframes': ReqAndRes<DeleteKeyframesRequest, DeleteKeyframesResponse>;
438
+ '/api/add-sequence-keyframe': ReqAndRes<AddSequenceKeyframeRequest, AddSequenceKeyframeResponse>;
439
+ '/api/add-effect-keyframe': ReqAndRes<AddEffectKeyframeRequest, AddEffectKeyframeResponse>;
301
440
  '/api/delete-effect': ReqAndRes<DeleteEffectRequest, DeleteEffectResponse>;
302
441
  '/api/delete-jsx-node': ReqAndRes<DeleteJsxNodeRequest, DeleteJsxNodeResponse>;
303
442
  '/api/duplicate-jsx-node': ReqAndRes<DuplicateJsxNodeRequest, DuplicateJsxNodeResponse>;
443
+ '/api/insert-jsx-element': ReqAndRes<InsertJsxElementRequest, InsertJsxElementResponse>;
304
444
  '/api/update-available': ReqAndRes<UpdateAvailableRequest, UpdateAvailableResponse>;
305
445
  '/api/apply-codemod': ReqAndRes<ApplyCodemodRequest, ApplyCodemodResponse>;
306
446
  '/api/project-info': ReqAndRes<ProjectInfoRequest, ProjectInfoResponse>;
@@ -0,0 +1,11 @@
1
+ export declare const EFFECT_DRAG_MIME_TYPE = "application/vnd.remotion.effect+json";
2
+ export type EffectDragData = {
3
+ type: 'remotion-effect';
4
+ version: 1;
5
+ effect: {
6
+ name: string;
7
+ importPath: string;
8
+ config: Record<string, unknown>;
9
+ };
10
+ };
11
+ export declare const parseEffectDragData: (value: string) => EffectDragData | null;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseEffectDragData = exports.EFFECT_DRAG_MIME_TYPE = void 0;
4
+ exports.EFFECT_DRAG_MIME_TYPE = 'application/vnd.remotion.effect+json';
5
+ const isRecord = (value) => {
6
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
7
+ };
8
+ const parseEffectDragData = (value) => {
9
+ try {
10
+ const parsed = JSON.parse(value);
11
+ if (!isRecord(parsed)) {
12
+ return null;
13
+ }
14
+ if (parsed.type !== 'remotion-effect' || parsed.version !== 1) {
15
+ return null;
16
+ }
17
+ if (!isRecord(parsed.effect)) {
18
+ return null;
19
+ }
20
+ const { name, importPath, config } = parsed.effect;
21
+ if (typeof name !== 'string' ||
22
+ typeof importPath !== 'string' ||
23
+ !isRecord(config)) {
24
+ return null;
25
+ }
26
+ return {
27
+ type: 'remotion-effect',
28
+ version: 1,
29
+ effect: {
30
+ name,
31
+ importPath,
32
+ config,
33
+ },
34
+ };
35
+ }
36
+ catch (_a) {
37
+ return null;
38
+ }
39
+ };
40
+ exports.parseEffectDragData = parseEffectDragData;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  export { splitAnsi, stripAnsi } from './ansi';
2
- export { AddRenderRequest, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UnsubscribeFromSequencePropsRequest, CancelRenderResponse, CopyStillToClipboardRequest, DeleteEffectRequest, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, DeleteStaticFileRequest, DeleteStaticFileResponse, InstallPackageRequest, InstallPackageResponse, OpenInFileExplorerRequest, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveSequencePropsRequest, SaveSequencePropsResponse, SimpleDiff, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, } from './api-requests';
2
+ export { AddEffectRequest, AddEffectResponse, AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddRenderRequest, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, CancelRenderResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse, CopyStillToClipboardRequest, DeleteEffectKeyframe, DeleteEffectRequest, DeleteEffectRequestItem, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeRequestItem, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, DeleteStaticFileRequest, DeleteStaticFileResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InstallPackageRequest, InstallPackageResponse, InsertableCompositionElement, InsertJsxElementRequest, InsertJsxElementResponse, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, ReorderEffectRequest, ReorderEffectResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveSequencePropEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, } from './api-requests';
3
3
  export type { ApplyVisualControlCodemod, RecastCodemod } from './codemods';
4
4
  export { DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS } from './default-buffer-state-delay-in-milliseconds';
5
+ export { EFFECT_DRAG_MIME_TYPE, parseEffectDragData, type EffectDragData, } from './effect-drag-data';
5
6
  export { EventSourceEvent } from './event-source-event';
6
7
  export { formatBytes } from './format-bytes';
7
- export { getDefaultOutLocation } from './get-default-out-name';
8
8
  export { getAllSchemaKeys } from './get-all-keys';
9
+ export { getDefaultOutLocation } from './get-default-out-name';
9
10
  export { ErrorLocation, getLocationFromBuildError, } from './get-location-from-build-error';
10
11
  export { getProjectName } from './get-project-name';
11
12
  export type { GitSource } from './git-source';
@@ -22,7 +23,8 @@ export type { AnySchemaFieldInfo, CodeValues, DragOverrides, EffectSchemaFieldIn
22
23
  export { ScriptLine, SomeStackFrame, StackFrame, SymbolicatedStackFrame, } from './stack-types';
23
24
  export { EnumPath, stringifyDefaultProps } from './stringify-default-props';
24
25
  export type { VisualControlChange } from './codemods';
26
+ export { optimisticAddEffectKeyframe, optimisticAddSequenceKeyframe, } from './optimistic-add-keyframe';
27
+ export { optimisticDeleteEffectKeyframe, optimisticDeleteEffectKeyframes, optimisticDeleteSequenceKeyframe, optimisticDeleteSequenceKeyframes, } from './optimistic-delete-keyframe';
25
28
  export { optimisticUpdateForCodeValues } from './optimistic-update-for-code-values';
26
29
  export { optimisticUpdateForEffectCodeValues } from './optimistic-update-for-effect-code-values';
27
- export { stringifySequenceSubscriptionKey } from './stringify-sequence-subscription-key';
28
- export { stringifySequenceExpandedRowKey } from './stringify-sequence-subscription-key';
30
+ export { stringifySequenceExpandedRowKey, stringifySequenceSubscriptionKey, } from './stringify-sequence-subscription-key';
package/dist/index.js CHANGED
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringifySequenceExpandedRowKey = exports.stringifySequenceSubscriptionKey = exports.optimisticUpdateForEffectCodeValues = exports.optimisticUpdateForCodeValues = exports.stringifyDefaultProps = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getAllSchemaKeys = exports.getDefaultOutLocation = exports.formatBytes = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.stripAnsi = exports.splitAnsi = void 0;
3
+ exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateForEffectCodeValues = exports.optimisticUpdateForCodeValues = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.stringifyDefaultProps = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getDefaultOutLocation = exports.getAllSchemaKeys = exports.formatBytes = exports.parseEffectDragData = exports.EFFECT_DRAG_MIME_TYPE = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.stripAnsi = exports.splitAnsi = void 0;
4
4
  const ansi_1 = require("./ansi");
5
5
  Object.defineProperty(exports, "splitAnsi", { enumerable: true, get: function () { return ansi_1.splitAnsi; } });
6
6
  Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return ansi_1.stripAnsi; } });
7
7
  const default_buffer_state_delay_in_milliseconds_1 = require("./default-buffer-state-delay-in-milliseconds");
8
8
  Object.defineProperty(exports, "DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS", { enumerable: true, get: function () { return default_buffer_state_delay_in_milliseconds_1.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS; } });
9
+ const effect_drag_data_1 = require("./effect-drag-data");
10
+ Object.defineProperty(exports, "EFFECT_DRAG_MIME_TYPE", { enumerable: true, get: function () { return effect_drag_data_1.EFFECT_DRAG_MIME_TYPE; } });
11
+ Object.defineProperty(exports, "parseEffectDragData", { enumerable: true, get: function () { return effect_drag_data_1.parseEffectDragData; } });
9
12
  const format_bytes_1 = require("./format-bytes");
10
13
  Object.defineProperty(exports, "formatBytes", { enumerable: true, get: function () { return format_bytes_1.formatBytes; } });
11
- const get_default_out_name_1 = require("./get-default-out-name");
12
- Object.defineProperty(exports, "getDefaultOutLocation", { enumerable: true, get: function () { return get_default_out_name_1.getDefaultOutLocation; } });
13
14
  const get_all_keys_1 = require("./get-all-keys");
14
15
  Object.defineProperty(exports, "getAllSchemaKeys", { enumerable: true, get: function () { return get_all_keys_1.getAllSchemaKeys; } });
16
+ const get_default_out_name_1 = require("./get-default-out-name");
17
+ Object.defineProperty(exports, "getDefaultOutLocation", { enumerable: true, get: function () { return get_default_out_name_1.getDefaultOutLocation; } });
15
18
  const get_location_from_build_error_1 = require("./get-location-from-build-error");
16
19
  Object.defineProperty(exports, "getLocationFromBuildError", { enumerable: true, get: function () { return get_location_from_build_error_1.getLocationFromBuildError; } });
17
20
  const get_project_name_1 = require("./get-project-name");
@@ -32,11 +35,18 @@ Object.defineProperty(exports, "getEffectFieldsToShow", { enumerable: true, get:
32
35
  Object.defineProperty(exports, "getFieldsToShow", { enumerable: true, get: function () { return schema_field_info_1.getFieldsToShow; } });
33
36
  const stringify_default_props_1 = require("./stringify-default-props");
34
37
  Object.defineProperty(exports, "stringifyDefaultProps", { enumerable: true, get: function () { return stringify_default_props_1.stringifyDefaultProps; } });
38
+ const optimistic_add_keyframe_1 = require("./optimistic-add-keyframe");
39
+ Object.defineProperty(exports, "optimisticAddEffectKeyframe", { enumerable: true, get: function () { return optimistic_add_keyframe_1.optimisticAddEffectKeyframe; } });
40
+ Object.defineProperty(exports, "optimisticAddSequenceKeyframe", { enumerable: true, get: function () { return optimistic_add_keyframe_1.optimisticAddSequenceKeyframe; } });
41
+ const optimistic_delete_keyframe_1 = require("./optimistic-delete-keyframe");
42
+ Object.defineProperty(exports, "optimisticDeleteEffectKeyframe", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteEffectKeyframe; } });
43
+ Object.defineProperty(exports, "optimisticDeleteEffectKeyframes", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteEffectKeyframes; } });
44
+ Object.defineProperty(exports, "optimisticDeleteSequenceKeyframe", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteSequenceKeyframe; } });
45
+ Object.defineProperty(exports, "optimisticDeleteSequenceKeyframes", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteSequenceKeyframes; } });
35
46
  const optimistic_update_for_code_values_1 = require("./optimistic-update-for-code-values");
36
47
  Object.defineProperty(exports, "optimisticUpdateForCodeValues", { enumerable: true, get: function () { return optimistic_update_for_code_values_1.optimisticUpdateForCodeValues; } });
37
48
  const optimistic_update_for_effect_code_values_1 = require("./optimistic-update-for-effect-code-values");
38
49
  Object.defineProperty(exports, "optimisticUpdateForEffectCodeValues", { enumerable: true, get: function () { return optimistic_update_for_effect_code_values_1.optimisticUpdateForEffectCodeValues; } });
39
50
  const stringify_sequence_subscription_key_1 = require("./stringify-sequence-subscription-key");
51
+ Object.defineProperty(exports, "stringifySequenceExpandedRowKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceExpandedRowKey; } });
40
52
  Object.defineProperty(exports, "stringifySequenceSubscriptionKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceSubscriptionKey; } });
41
- const stringify_sequence_subscription_key_2 = require("./stringify-sequence-subscription-key");
42
- Object.defineProperty(exports, "stringifySequenceExpandedRowKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_2.stringifySequenceExpandedRowKey; } });
@@ -0,0 +1,14 @@
1
+ import { type CanUpdateSequencePropsResponse } from 'remotion';
2
+ export declare const optimisticAddSequenceKeyframe: ({ previous, fieldKey, frame, value, }: {
3
+ previous: CanUpdateSequencePropsResponse;
4
+ fieldKey: string;
5
+ frame: number;
6
+ value: unknown;
7
+ }) => CanUpdateSequencePropsResponse;
8
+ export declare const optimisticAddEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, value, }: {
9
+ previous: CanUpdateSequencePropsResponse;
10
+ effectIndex: number;
11
+ fieldKey: string;
12
+ frame: number;
13
+ value: unknown;
14
+ }) => CanUpdateSequencePropsResponse;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.optimisticAddEffectKeyframe = exports.optimisticAddSequenceKeyframe = void 0;
4
+ const getInterpolationFunction = (staticValue, newValue) => {
5
+ return typeof staticValue === 'string' && typeof newValue === 'string'
6
+ ? 'interpolateColors'
7
+ : 'interpolate';
8
+ };
9
+ const addKeyframeToPropStatus = ({ status, frame, value, }) => {
10
+ var _a;
11
+ if (status.canUpdate) {
12
+ const staticValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : value;
13
+ return {
14
+ canUpdate: false,
15
+ reason: 'keyframed',
16
+ interpolationFunction: getInterpolationFunction(staticValue, value),
17
+ keyframes: [{ frame, value }],
18
+ easing: [],
19
+ clamping: { left: 'extend', right: 'extend' },
20
+ posterize: undefined,
21
+ };
22
+ }
23
+ if (status.reason !== 'keyframed') {
24
+ return status;
25
+ }
26
+ const existingIndex = status.keyframes.findIndex((kf) => kf.frame === frame);
27
+ if (existingIndex !== -1) {
28
+ const updatedKeyframes = status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
29
+ return {
30
+ ...status,
31
+ keyframes: updatedKeyframes,
32
+ };
33
+ }
34
+ const keyframes = [...status.keyframes, { frame, value }].sort((first, second) => first.frame - second.frame);
35
+ const easing = [...status.easing];
36
+ while (easing.length < keyframes.length - 1) {
37
+ easing.push('linear');
38
+ }
39
+ return {
40
+ ...status,
41
+ keyframes,
42
+ easing,
43
+ };
44
+ };
45
+ const optimisticAddSequenceKeyframe = ({ previous, fieldKey, frame, value, }) => {
46
+ if (!previous.canUpdate) {
47
+ return previous;
48
+ }
49
+ const status = previous.props[fieldKey];
50
+ if (!status) {
51
+ return previous;
52
+ }
53
+ return {
54
+ ...previous,
55
+ props: {
56
+ ...previous.props,
57
+ [fieldKey]: addKeyframeToPropStatus({ status, frame, value }),
58
+ },
59
+ };
60
+ };
61
+ exports.optimisticAddSequenceKeyframe = optimisticAddSequenceKeyframe;
62
+ const optimisticAddEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, value, }) => {
63
+ if (!previous.canUpdate) {
64
+ return previous;
65
+ }
66
+ const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
67
+ if (targetIndex === -1) {
68
+ return previous;
69
+ }
70
+ const target = previous.effects[targetIndex];
71
+ if (!target.canUpdate) {
72
+ return previous;
73
+ }
74
+ const status = target.props[fieldKey];
75
+ if (!status) {
76
+ return previous;
77
+ }
78
+ const updatedEffect = {
79
+ ...target,
80
+ props: {
81
+ ...target.props,
82
+ [fieldKey]: addKeyframeToPropStatus({ status, frame, value }),
83
+ },
84
+ };
85
+ const effects = [...previous.effects];
86
+ effects[targetIndex] = updatedEffect;
87
+ return {
88
+ ...previous,
89
+ effects,
90
+ };
91
+ };
92
+ exports.optimisticAddEffectKeyframe = optimisticAddEffectKeyframe;
@@ -0,0 +1,27 @@
1
+ import { type CanUpdateSequencePropsResponse } from 'remotion';
2
+ export declare const optimisticDeleteSequenceKeyframe: ({ previous, fieldKey, frame, }: {
3
+ previous: CanUpdateSequencePropsResponse;
4
+ fieldKey: string;
5
+ frame: number;
6
+ }) => CanUpdateSequencePropsResponse;
7
+ export declare const optimisticDeleteSequenceKeyframes: ({ previous, keyframes, }: {
8
+ previous: CanUpdateSequencePropsResponse;
9
+ keyframes: {
10
+ fieldKey: string;
11
+ frame: number;
12
+ }[];
13
+ }) => CanUpdateSequencePropsResponse;
14
+ export declare const optimisticDeleteEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, }: {
15
+ previous: CanUpdateSequencePropsResponse;
16
+ effectIndex: number;
17
+ fieldKey: string;
18
+ frame: number;
19
+ }) => CanUpdateSequencePropsResponse;
20
+ export declare const optimisticDeleteEffectKeyframes: ({ previous, keyframes, }: {
21
+ previous: CanUpdateSequencePropsResponse;
22
+ keyframes: {
23
+ effectIndex: number;
24
+ fieldKey: string;
25
+ frame: number;
26
+ }[];
27
+ }) => CanUpdateSequencePropsResponse;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = void 0;
4
+ const removeKeyframeFromPropStatus = ({ status, frame, }) => {
5
+ if (status.canUpdate) {
6
+ return status;
7
+ }
8
+ if (status.reason !== 'keyframed') {
9
+ return status;
10
+ }
11
+ const index = status.keyframes.findIndex((kf) => kf.frame === frame);
12
+ if (index === -1) {
13
+ return status;
14
+ }
15
+ const keyframes = status.keyframes.filter((_, i) => i !== index);
16
+ if (keyframes.length === 0) {
17
+ return {
18
+ canUpdate: true,
19
+ codeValue: status.keyframes[index].value,
20
+ };
21
+ }
22
+ // Easing holds one segment per gap between consecutive keyframes
23
+ // (keyframes.length - 1 entries). Drop the segment adjacent to the removed
24
+ // keyframe so the invariant keeps holding until the server responds.
25
+ const easing = [...status.easing];
26
+ if (easing.length > 0) {
27
+ const easingIndexToRemove = index === 0 ? 0 : index - 1;
28
+ easing.splice(easingIndexToRemove, 1);
29
+ }
30
+ return {
31
+ ...status,
32
+ keyframes,
33
+ easing,
34
+ };
35
+ };
36
+ const optimisticDeleteSequenceKeyframe = ({ previous, fieldKey, frame, }) => {
37
+ if (!previous.canUpdate) {
38
+ return previous;
39
+ }
40
+ const status = previous.props[fieldKey];
41
+ if (!status) {
42
+ return previous;
43
+ }
44
+ return {
45
+ ...previous,
46
+ props: {
47
+ ...previous.props,
48
+ [fieldKey]: removeKeyframeFromPropStatus({ status, frame }),
49
+ },
50
+ };
51
+ };
52
+ exports.optimisticDeleteSequenceKeyframe = optimisticDeleteSequenceKeyframe;
53
+ const optimisticDeleteSequenceKeyframes = ({ previous, keyframes, }) => {
54
+ return keyframes.reduce((current, keyframe) => (0, exports.optimisticDeleteSequenceKeyframe)({
55
+ previous: current,
56
+ fieldKey: keyframe.fieldKey,
57
+ frame: keyframe.frame,
58
+ }), previous);
59
+ };
60
+ exports.optimisticDeleteSequenceKeyframes = optimisticDeleteSequenceKeyframes;
61
+ const optimisticDeleteEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, }) => {
62
+ if (!previous.canUpdate) {
63
+ return previous;
64
+ }
65
+ const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
66
+ if (targetIndex === -1) {
67
+ return previous;
68
+ }
69
+ const target = previous.effects[targetIndex];
70
+ if (!target.canUpdate) {
71
+ return previous;
72
+ }
73
+ const status = target.props[fieldKey];
74
+ if (!status) {
75
+ return previous;
76
+ }
77
+ const updatedEffect = {
78
+ ...target,
79
+ props: {
80
+ ...target.props,
81
+ [fieldKey]: removeKeyframeFromPropStatus({ status, frame }),
82
+ },
83
+ };
84
+ const effects = [...previous.effects];
85
+ effects[targetIndex] = updatedEffect;
86
+ return {
87
+ ...previous,
88
+ effects,
89
+ };
90
+ };
91
+ exports.optimisticDeleteEffectKeyframe = optimisticDeleteEffectKeyframe;
92
+ const optimisticDeleteEffectKeyframes = ({ previous, keyframes, }) => {
93
+ return keyframes.reduce((current, keyframe) => (0, exports.optimisticDeleteEffectKeyframe)({
94
+ previous: current,
95
+ effectIndex: keyframe.effectIndex,
96
+ fieldKey: keyframe.fieldKey,
97
+ frame: keyframe.frame,
98
+ }), previous);
99
+ };
100
+ exports.optimisticDeleteEffectKeyframes = optimisticDeleteEffectKeyframes;
@@ -20,6 +20,7 @@ const getFieldsToShow = ({ getDragOverrides, codeValues, nodePath, schema, curre
20
20
  currentValue: currentRuntimeValueDotNotation,
21
21
  overrideValues: getDragOverrides(nodePath),
22
22
  propStatus: remotion_1.Internals.getCodeValuesCtx(codeValues, nodePath),
23
+ frame: null,
23
24
  });
24
25
  const activeSchema = remotion_1.Internals.flattenActiveSchema(schema, (key) => valuesDotNotation[key]);
25
26
  return Object.entries(activeSchema)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-shared"
4
4
  },
5
5
  "name": "@remotion/studio-shared",
6
- "version": "4.0.469",
6
+ "version": "4.0.471",
7
7
  "description": "Internal package for shared objects between the Studio backend and frontend",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -20,11 +20,11 @@
20
20
  "url": "https://github.com/remotion-dev/remotion/issues"
21
21
  },
22
22
  "dependencies": {
23
- "remotion": "4.0.469"
23
+ "remotion": "4.0.471"
24
24
  },
25
25
  "devDependencies": {
26
- "@remotion/renderer": "4.0.469",
27
- "@remotion/eslint-config-internal": "4.0.469",
26
+ "@remotion/renderer": "4.0.471",
27
+ "@remotion/eslint-config-internal": "4.0.471",
28
28
  "eslint": "9.19.0",
29
29
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
30
30
  },