@remotion/studio-shared 4.0.469 → 4.0.470

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;
@@ -190,18 +207,29 @@ export type UnsubscribeFromSequencePropsRequest = {
190
207
  sequenceKeys: string[];
191
208
  effectKeys: string[][];
192
209
  };
193
- export type SaveSequencePropsRequest = {
210
+ export type SaveSequencePropEdit = {
194
211
  fileName: string;
195
212
  nodePath: SequencePropsSubscriptionKey;
196
213
  key: string;
197
214
  value: string;
198
215
  defaultValue: string | null;
199
216
  schema: SequenceSchema;
217
+ };
218
+ export type SaveSequencePropsRequest = {
219
+ edits: SaveSequencePropEdit[];
200
220
  clientId: string;
221
+ undoLabel: string | null;
222
+ redoLabel: string | null;
223
+ };
224
+ export type SaveSequencePropsResult = {
225
+ fileName: string;
226
+ nodePath: SequencePropsSubscriptionKey;
227
+ props: Record<string, CanUpdateSequencePropStatus>;
201
228
  };
202
229
  export type SaveSequencePropsResponse = {
203
230
  canUpdate: true;
204
231
  props: Record<string, CanUpdateSequencePropStatus>;
232
+ results: SaveSequencePropsResult[];
205
233
  } | {
206
234
  canUpdate: false;
207
235
  reason: CannotUpdateSequenceReason;
@@ -217,11 +245,57 @@ export type SaveEffectPropsRequest = {
217
245
  clientId: string;
218
246
  };
219
247
  export type SaveEffectPropsResponse = CanUpdateEffectPropsResponse;
220
- export type DeleteEffectRequest = {
248
+ export type DeleteSequenceKeyframeRequest = {
249
+ fileName: string;
250
+ nodePath: SequencePropsSubscriptionKey;
251
+ key: string;
252
+ frame: number;
253
+ schema: SequenceSchema;
254
+ clientId: string;
255
+ };
256
+ export type DeleteSequenceKeyframeResponse = SaveSequencePropsResponse;
257
+ export type AddSequenceKeyframeRequest = {
258
+ fileName: string;
259
+ nodePath: SequencePropsSubscriptionKey;
260
+ key: string;
261
+ frame: number;
262
+ value: string;
263
+ schema: SequenceSchema;
264
+ clientId: string;
265
+ };
266
+ export type AddSequenceKeyframeResponse = SaveSequencePropsResponse;
267
+ export type DeleteEffectKeyframeRequest = {
268
+ fileName: string;
269
+ sequenceNodePath: SequencePropsSubscriptionKey;
270
+ effectIndex: number;
271
+ key: string;
272
+ frame: number;
273
+ schema: SequenceSchema;
274
+ clientId: string;
275
+ };
276
+ export type DeleteEffectKeyframeResponse = SaveEffectPropsResponse;
277
+ export type AddEffectKeyframeRequest = {
221
278
  fileName: string;
222
279
  sequenceNodePath: SequencePropsSubscriptionKey;
223
280
  effectIndex: number;
281
+ key: string;
282
+ frame: number;
283
+ value: string;
284
+ schema: SequenceSchema;
285
+ clientId: string;
286
+ };
287
+ export type AddEffectKeyframeResponse = SaveEffectPropsResponse;
288
+ type BaseDeleteEffectRequestItem = {
289
+ fileName: string;
290
+ sequenceNodePath: SequencePropsSubscriptionKey;
224
291
  };
292
+ export type DeleteEffectRequestItem = (BaseDeleteEffectRequestItem & {
293
+ type: 'single-effect';
294
+ effectIndex: number;
295
+ }) | (BaseDeleteEffectRequestItem & {
296
+ type: 'all-effects';
297
+ });
298
+ export type DeleteEffectRequest = DeleteEffectRequestItem[];
225
299
  export type DeleteEffectResponse = {
226
300
  success: true;
227
301
  } | {
@@ -229,10 +303,13 @@ export type DeleteEffectResponse = {
229
303
  reason: string;
230
304
  stack: string;
231
305
  };
232
- export type DeleteJsxNodeRequest = {
306
+ export type DeleteJsxNodeRequestItem = {
233
307
  fileName: string;
234
308
  nodePath: SequenceNodePath;
235
309
  };
310
+ export type DeleteJsxNodeRequest = {
311
+ nodes: DeleteJsxNodeRequestItem[];
312
+ };
236
313
  export type DeleteJsxNodeResponse = {
237
314
  success: true;
238
315
  } | {
@@ -284,12 +361,18 @@ export type RedoResponse = {
284
361
  reason: string;
285
362
  };
286
363
  export type ApiRoutes = {
364
+ '/api/composition-component-info': ReqAndRes<CompositionComponentInfoRequest, CompositionComponentInfoResponse>;
287
365
  '/api/cancel': ReqAndRes<CancelRenderRequest, CancelRenderResponse>;
288
366
  '/api/render': ReqAndRes<AddRenderRequest, undefined>;
289
367
  '/api/unsubscribe-from-file-existence': ReqAndRes<UnsubscribeFromFileExistenceRequest, undefined>;
290
368
  '/api/subscribe-to-file-existence': ReqAndRes<SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse>;
291
369
  '/api/remove-render': ReqAndRes<RemoveRenderRequest, undefined>;
370
+ '/api/open-in-editor': ReqAndRes<OpenInEditorRequest, OpenInEditorResponse>;
292
371
  '/api/open-in-file-explorer': ReqAndRes<OpenInFileExplorerRequest, void>;
372
+ '/api/register-client-render': ReqAndRes<CompletedClientRender, void>;
373
+ '/api/unregister-client-render': ReqAndRes<{
374
+ id: string;
375
+ }, void>;
293
376
  '/api/update-default-props': ReqAndRes<UpdateDefaultPropsRequest, UpdateDefaultPropsResponse>;
294
377
  '/api/apply-visual-control-change': ReqAndRes<ApplyVisualControlRequest, ApplyVisualControlResponse>;
295
378
  '/api/subscribe-to-default-props': ReqAndRes<SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse>;
@@ -298,6 +381,10 @@ export type ApiRoutes = {
298
381
  '/api/unsubscribe-from-sequence-props': ReqAndRes<UnsubscribeFromSequencePropsRequest, undefined>;
299
382
  '/api/save-sequence-props': ReqAndRes<SaveSequencePropsRequest, SaveSequencePropsResponse>;
300
383
  '/api/save-effect-props': ReqAndRes<SaveEffectPropsRequest, SaveEffectPropsResponse>;
384
+ '/api/delete-sequence-keyframe': ReqAndRes<DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse>;
385
+ '/api/add-sequence-keyframe': ReqAndRes<AddSequenceKeyframeRequest, AddSequenceKeyframeResponse>;
386
+ '/api/delete-effect-keyframe': ReqAndRes<DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse>;
387
+ '/api/add-effect-keyframe': ReqAndRes<AddEffectKeyframeRequest, AddEffectKeyframeResponse>;
301
388
  '/api/delete-effect': ReqAndRes<DeleteEffectRequest, DeleteEffectResponse>;
302
389
  '/api/delete-jsx-node': ReqAndRes<DeleteJsxNodeRequest, DeleteJsxNodeResponse>;
303
390
  '/api/duplicate-jsx-node': ReqAndRes<DuplicateJsxNodeRequest, DuplicateJsxNodeResponse>;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
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 { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddRenderRequest, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, CancelRenderResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse, CopyStillToClipboardRequest, DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse, DeleteEffectRequest, DeleteEffectRequestItem, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeRequestItem, DeleteJsxNodeResponse, DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse, DeleteStaticFileRequest, DeleteStaticFileResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InstallPackageRequest, InstallPackageResponse, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, 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
5
  export { EventSourceEvent } from './event-source-event';
6
6
  export { formatBytes } from './format-bytes';
7
- export { getDefaultOutLocation } from './get-default-out-name';
8
7
  export { getAllSchemaKeys } from './get-all-keys';
8
+ export { getDefaultOutLocation } from './get-default-out-name';
9
9
  export { ErrorLocation, getLocationFromBuildError, } from './get-location-from-build-error';
10
10
  export { getProjectName } from './get-project-name';
11
11
  export type { GitSource } from './git-source';
@@ -22,7 +22,8 @@ export type { AnySchemaFieldInfo, CodeValues, DragOverrides, EffectSchemaFieldIn
22
22
  export { ScriptLine, SomeStackFrame, StackFrame, SymbolicatedStackFrame, } from './stack-types';
23
23
  export { EnumPath, stringifyDefaultProps } from './stringify-default-props';
24
24
  export type { VisualControlChange } from './codemods';
25
+ export { optimisticAddEffectKeyframe, optimisticAddSequenceKeyframe, } from './optimistic-add-keyframe';
26
+ export { optimisticDeleteEffectKeyframe, optimisticDeleteSequenceKeyframe, } from './optimistic-delete-keyframe';
25
27
  export { optimisticUpdateForCodeValues } from './optimistic-update-for-code-values';
26
28
  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';
29
+ export { stringifySequenceExpandedRowKey, stringifySequenceSubscriptionKey, } from './stringify-sequence-subscription-key';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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.optimisticDeleteSequenceKeyframe = 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.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; } });
@@ -8,10 +8,10 @@ const default_buffer_state_delay_in_milliseconds_1 = require("./default-buffer-s
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
9
  const format_bytes_1 = require("./format-bytes");
10
10
  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
11
  const get_all_keys_1 = require("./get-all-keys");
14
12
  Object.defineProperty(exports, "getAllSchemaKeys", { enumerable: true, get: function () { return get_all_keys_1.getAllSchemaKeys; } });
13
+ const get_default_out_name_1 = require("./get-default-out-name");
14
+ Object.defineProperty(exports, "getDefaultOutLocation", { enumerable: true, get: function () { return get_default_out_name_1.getDefaultOutLocation; } });
15
15
  const get_location_from_build_error_1 = require("./get-location-from-build-error");
16
16
  Object.defineProperty(exports, "getLocationFromBuildError", { enumerable: true, get: function () { return get_location_from_build_error_1.getLocationFromBuildError; } });
17
17
  const get_project_name_1 = require("./get-project-name");
@@ -32,11 +32,16 @@ Object.defineProperty(exports, "getEffectFieldsToShow", { enumerable: true, get:
32
32
  Object.defineProperty(exports, "getFieldsToShow", { enumerable: true, get: function () { return schema_field_info_1.getFieldsToShow; } });
33
33
  const stringify_default_props_1 = require("./stringify-default-props");
34
34
  Object.defineProperty(exports, "stringifyDefaultProps", { enumerable: true, get: function () { return stringify_default_props_1.stringifyDefaultProps; } });
35
+ const optimistic_add_keyframe_1 = require("./optimistic-add-keyframe");
36
+ Object.defineProperty(exports, "optimisticAddEffectKeyframe", { enumerable: true, get: function () { return optimistic_add_keyframe_1.optimisticAddEffectKeyframe; } });
37
+ Object.defineProperty(exports, "optimisticAddSequenceKeyframe", { enumerable: true, get: function () { return optimistic_add_keyframe_1.optimisticAddSequenceKeyframe; } });
38
+ const optimistic_delete_keyframe_1 = require("./optimistic-delete-keyframe");
39
+ Object.defineProperty(exports, "optimisticDeleteEffectKeyframe", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteEffectKeyframe; } });
40
+ Object.defineProperty(exports, "optimisticDeleteSequenceKeyframe", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteSequenceKeyframe; } });
35
41
  const optimistic_update_for_code_values_1 = require("./optimistic-update-for-code-values");
36
42
  Object.defineProperty(exports, "optimisticUpdateForCodeValues", { enumerable: true, get: function () { return optimistic_update_for_code_values_1.optimisticUpdateForCodeValues; } });
37
43
  const optimistic_update_for_effect_code_values_1 = require("./optimistic-update-for-effect-code-values");
38
44
  Object.defineProperty(exports, "optimisticUpdateForEffectCodeValues", { enumerable: true, get: function () { return optimistic_update_for_effect_code_values_1.optimisticUpdateForEffectCodeValues; } });
39
45
  const stringify_sequence_subscription_key_1 = require("./stringify-sequence-subscription-key");
46
+ Object.defineProperty(exports, "stringifySequenceExpandedRowKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceExpandedRowKey; } });
40
47
  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,98 @@
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
+ const initialKeyframes = frame === 0
14
+ ? [{ frame, value }]
15
+ : [
16
+ { frame: 0, value: staticValue },
17
+ { frame, value },
18
+ ];
19
+ return {
20
+ canUpdate: false,
21
+ reason: 'keyframed',
22
+ interpolationFunction: getInterpolationFunction(staticValue, value),
23
+ keyframes: initialKeyframes,
24
+ easing: frame === 0 ? [] : ['linear'],
25
+ clamping: { left: 'extend', right: 'extend' },
26
+ posterize: undefined,
27
+ };
28
+ }
29
+ if (status.reason !== 'keyframed') {
30
+ return status;
31
+ }
32
+ const existingIndex = status.keyframes.findIndex((kf) => kf.frame === frame);
33
+ if (existingIndex !== -1) {
34
+ const updatedKeyframes = status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
35
+ return {
36
+ ...status,
37
+ keyframes: updatedKeyframes,
38
+ };
39
+ }
40
+ const keyframes = [...status.keyframes, { frame, value }].sort((first, second) => first.frame - second.frame);
41
+ const easing = [...status.easing];
42
+ while (easing.length < keyframes.length - 1) {
43
+ easing.push('linear');
44
+ }
45
+ return {
46
+ ...status,
47
+ keyframes,
48
+ easing,
49
+ };
50
+ };
51
+ const optimisticAddSequenceKeyframe = ({ previous, fieldKey, frame, value, }) => {
52
+ if (!previous.canUpdate) {
53
+ return previous;
54
+ }
55
+ const status = previous.props[fieldKey];
56
+ if (!status) {
57
+ return previous;
58
+ }
59
+ return {
60
+ ...previous,
61
+ props: {
62
+ ...previous.props,
63
+ [fieldKey]: addKeyframeToPropStatus({ status, frame, value }),
64
+ },
65
+ };
66
+ };
67
+ exports.optimisticAddSequenceKeyframe = optimisticAddSequenceKeyframe;
68
+ const optimisticAddEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, value, }) => {
69
+ if (!previous.canUpdate) {
70
+ return previous;
71
+ }
72
+ const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
73
+ if (targetIndex === -1) {
74
+ return previous;
75
+ }
76
+ const target = previous.effects[targetIndex];
77
+ if (!target.canUpdate) {
78
+ return previous;
79
+ }
80
+ const status = target.props[fieldKey];
81
+ if (!status) {
82
+ return previous;
83
+ }
84
+ const updatedEffect = {
85
+ ...target,
86
+ props: {
87
+ ...target.props,
88
+ [fieldKey]: addKeyframeToPropStatus({ status, frame, value }),
89
+ },
90
+ };
91
+ const effects = [...previous.effects];
92
+ effects[targetIndex] = updatedEffect;
93
+ return {
94
+ ...previous,
95
+ effects,
96
+ };
97
+ };
98
+ exports.optimisticAddEffectKeyframe = optimisticAddEffectKeyframe;
@@ -0,0 +1,12 @@
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 optimisticDeleteEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, }: {
8
+ previous: CanUpdateSequencePropsResponse;
9
+ effectIndex: number;
10
+ fieldKey: string;
11
+ frame: number;
12
+ }) => CanUpdateSequencePropsResponse;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.optimisticDeleteEffectKeyframe = 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
+ // Easing holds one segment per gap between consecutive keyframes
17
+ // (keyframes.length - 1 entries). Drop the segment adjacent to the removed
18
+ // keyframe so the invariant keeps holding until the server responds.
19
+ const easing = [...status.easing];
20
+ if (easing.length > 0) {
21
+ const easingIndexToRemove = index === 0 ? 0 : index - 1;
22
+ easing.splice(easingIndexToRemove, 1);
23
+ }
24
+ return {
25
+ ...status,
26
+ keyframes,
27
+ easing,
28
+ };
29
+ };
30
+ const optimisticDeleteSequenceKeyframe = ({ previous, fieldKey, frame, }) => {
31
+ if (!previous.canUpdate) {
32
+ return previous;
33
+ }
34
+ const status = previous.props[fieldKey];
35
+ if (!status) {
36
+ return previous;
37
+ }
38
+ return {
39
+ ...previous,
40
+ props: {
41
+ ...previous.props,
42
+ [fieldKey]: removeKeyframeFromPropStatus({ status, frame }),
43
+ },
44
+ };
45
+ };
46
+ exports.optimisticDeleteSequenceKeyframe = optimisticDeleteSequenceKeyframe;
47
+ const optimisticDeleteEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, }) => {
48
+ if (!previous.canUpdate) {
49
+ return previous;
50
+ }
51
+ const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
52
+ if (targetIndex === -1) {
53
+ return previous;
54
+ }
55
+ const target = previous.effects[targetIndex];
56
+ if (!target.canUpdate) {
57
+ return previous;
58
+ }
59
+ const status = target.props[fieldKey];
60
+ if (!status) {
61
+ return previous;
62
+ }
63
+ const updatedEffect = {
64
+ ...target,
65
+ props: {
66
+ ...target.props,
67
+ [fieldKey]: removeKeyframeFromPropStatus({ status, frame }),
68
+ },
69
+ };
70
+ const effects = [...previous.effects];
71
+ effects[targetIndex] = updatedEffect;
72
+ return {
73
+ ...previous,
74
+ effects,
75
+ };
76
+ };
77
+ exports.optimisticDeleteEffectKeyframe = optimisticDeleteEffectKeyframe;
@@ -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.470",
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.470"
24
24
  },
25
25
  "devDependencies": {
26
- "@remotion/renderer": "4.0.469",
27
- "@remotion/eslint-config-internal": "4.0.469",
26
+ "@remotion/renderer": "4.0.470",
27
+ "@remotion/eslint-config-internal": "4.0.470",
28
28
  "eslint": "9.19.0",
29
29
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
30
30
  },