@remotion/studio-shared 4.0.475 → 4.0.477
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/api-requests.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
3
|
+
import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, JsxComponentIdentity, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
4
4
|
import type { RecastCodemod, VisualControlChange } from './codemods';
|
|
5
5
|
import type { ComponentProp } from './component-drag-data';
|
|
6
6
|
import type { EffectClipboardParam, EffectClipboardPasteType, EffectClipboardSnapshot } from './effect-clipboard-data';
|
|
@@ -201,6 +201,7 @@ export type SubscribeToSequencePropsRequest = {
|
|
|
201
201
|
line: number;
|
|
202
202
|
column: number;
|
|
203
203
|
nodePath: SequenceNodePath | null;
|
|
204
|
+
componentIdentity: JsxComponentIdentity | null;
|
|
204
205
|
keys: string[];
|
|
205
206
|
effects: string[][];
|
|
206
207
|
clientId: string;
|
|
@@ -479,12 +480,14 @@ export type InsertableCompositionElement = {
|
|
|
479
480
|
type: 'solid';
|
|
480
481
|
width: number;
|
|
481
482
|
height: number;
|
|
483
|
+
position: InsertableCompositionElementPosition | null;
|
|
482
484
|
} | {
|
|
483
485
|
type: 'component';
|
|
484
486
|
componentName: string;
|
|
485
487
|
importName: string;
|
|
486
488
|
importPath: string;
|
|
487
489
|
props: ComponentProp[];
|
|
490
|
+
position: InsertableCompositionElementPosition | null;
|
|
488
491
|
} | {
|
|
489
492
|
type: 'asset';
|
|
490
493
|
assetType: 'image' | 'video' | 'gif' | 'audio';
|
|
@@ -494,6 +497,11 @@ export type InsertableCompositionElement = {
|
|
|
494
497
|
width: number;
|
|
495
498
|
height: number;
|
|
496
499
|
} | null;
|
|
500
|
+
position: InsertableCompositionElementPosition | null;
|
|
501
|
+
};
|
|
502
|
+
export type InsertableCompositionElementPosition = {
|
|
503
|
+
x: number;
|
|
504
|
+
y: number;
|
|
497
505
|
};
|
|
498
506
|
export type InsertJsxElementRequest = {
|
|
499
507
|
compositionFile: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { splitAnsi, stripAnsi } from './ansi';
|
|
2
|
-
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddKeyframesRequest, AddKeyframesResponse, AddEffectRequest, AddEffectResponse, 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, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertableCompositionElement, InstallPackageRequest, InstallPackageResponse, LogStudioErrorRequest, LogStudioErrorResponse, MoveEffectKeyframe, MoveKeyframesRequest, MoveKeyframesResponse, MoveSequenceKeyframe, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, PasteEffectsRequest, PasteEffectsResponse, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveSequencePropEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse, type KeyframeSettings, type AddEffectKeyframe, type AddSequenceKeyframe, } from './api-requests';
|
|
2
|
+
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddKeyframesRequest, AddKeyframesResponse, AddEffectRequest, AddEffectResponse, 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, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertableCompositionElement, InsertableCompositionElementPosition, InstallPackageRequest, InstallPackageResponse, LogStudioErrorRequest, LogStudioErrorResponse, MoveEffectKeyframe, MoveKeyframesRequest, MoveKeyframesResponse, MoveSequenceKeyframe, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, PasteEffectsRequest, PasteEffectsResponse, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveSequencePropEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse, type KeyframeSettings, type AddEffectKeyframe, type AddSequenceKeyframe, } from './api-requests';
|
|
3
3
|
export { ASSET_DRAG_MIME_TYPE, makeAssetDragData, parseAssetDragData, type AssetDragData, } from './asset-drag-data';
|
|
4
4
|
export type { ApplyVisualControlCodemod, RecastCodemod } from './codemods';
|
|
5
5
|
export { COMPONENT_DRAG_MIME_TYPE, areComponentProps, isComponentIdentifier, isComponentImportPath, makeComponentDragData, parseComponentDragData, type ComponentDragData, type ComponentProp, } from './component-drag-data';
|
|
@@ -33,7 +33,7 @@ export { EnumPath, stringifyDefaultProps } from './stringify-default-props';
|
|
|
33
33
|
export type { VisualControlChange } from './codemods';
|
|
34
34
|
export { optimisticAddEffectKeyframe, optimisticAddSequenceKeyframe, } from './optimistic-add-keyframe';
|
|
35
35
|
export { optimisticDeleteEffectKeyframe, optimisticDeleteEffectKeyframes, optimisticDeleteSequenceKeyframe, optimisticDeleteSequenceKeyframes, } from './optimistic-delete-keyframe';
|
|
36
|
-
export { canMoveKeyframesWithoutCollisions, optimisticMoveEffectKeyframes, optimisticMoveSequenceKeyframes, type OptimisticKeyframeMove, } from './optimistic-move-keyframe';
|
|
36
|
+
export { canMoveKeyframesWithoutCollisions, moveKeyframesInPropStatus, optimisticMoveEffectKeyframes, optimisticMoveSequenceKeyframes, type OptimisticKeyframeMove, } from './optimistic-move-keyframe';
|
|
37
37
|
export { optimisticUpdateForEffectPropStatuses } from './optimistic-update-for-effect-prop-statuses';
|
|
38
38
|
export { optimisticUpdateForPropStatuses } from './optimistic-update-for-prop-statuses';
|
|
39
39
|
export { optimisticUpdateEffectKeyframeSettings, optimisticUpdateSequenceKeyframeSettings, } from './optimistic-update-keyframe-settings';
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.stringifyDefaultProps = exports.parseSfxDragData = exports.SFX_DRAG_MIME_TYPE = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForEffectImportPath = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.keyframeInterpolationFunctions = exports.isSequenceFieldSchemaKeyframable = exports.isSchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = exports.getKeyframeInterpolationFunctionForSchemaField = exports.getKeyframeInterpolationFunction = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getDefaultOutLocation = exports.getAllSchemaKeys = exports.formatBytes = exports.parseEffectDragData = exports.EFFECT_DRAG_MIME_TYPE = exports.parseEffectPropClipboardDataResult = exports.parseEffectPropClipboardData = exports.parseEffectClipboardDataResult = exports.parseEffectClipboardData = exports.isImageFileType = exports.detectFileType = exports.KEYFRAME_EASING_PRESETS = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.parseComponentDragData = exports.makeComponentDragData = exports.isComponentImportPath = exports.isComponentIdentifier = exports.areComponentProps = exports.COMPONENT_DRAG_MIME_TYPE = exports.parseAssetDragData = exports.makeAssetDragData = exports.ASSET_DRAG_MIME_TYPE = exports.stripAnsi = exports.splitAnsi = void 0;
|
|
18
|
-
exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = void 0;
|
|
18
|
+
exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = void 0;
|
|
19
19
|
const ansi_1 = require("./ansi");
|
|
20
20
|
Object.defineProperty(exports, "splitAnsi", { enumerable: true, get: function () { return ansi_1.splitAnsi; } });
|
|
21
21
|
Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return ansi_1.stripAnsi; } });
|
|
@@ -95,6 +95,7 @@ Object.defineProperty(exports, "optimisticDeleteSequenceKeyframe", { enumerable:
|
|
|
95
95
|
Object.defineProperty(exports, "optimisticDeleteSequenceKeyframes", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteSequenceKeyframes; } });
|
|
96
96
|
const optimistic_move_keyframe_1 = require("./optimistic-move-keyframe");
|
|
97
97
|
Object.defineProperty(exports, "canMoveKeyframesWithoutCollisions", { enumerable: true, get: function () { return optimistic_move_keyframe_1.canMoveKeyframesWithoutCollisions; } });
|
|
98
|
+
Object.defineProperty(exports, "moveKeyframesInPropStatus", { enumerable: true, get: function () { return optimistic_move_keyframe_1.moveKeyframesInPropStatus; } });
|
|
98
99
|
Object.defineProperty(exports, "optimisticMoveEffectKeyframes", { enumerable: true, get: function () { return optimistic_move_keyframe_1.optimisticMoveEffectKeyframes; } });
|
|
99
100
|
Object.defineProperty(exports, "optimisticMoveSequenceKeyframes", { enumerable: true, get: function () { return optimistic_move_keyframe_1.optimisticMoveSequenceKeyframes; } });
|
|
100
101
|
const optimistic_update_for_effect_prop_statuses_1 = require("./optimistic-update-for-effect-prop-statuses");
|
|
@@ -11,6 +11,13 @@ export declare const canMoveKeyframesWithoutCollisions: ({ status, moves, }: {
|
|
|
11
11
|
toFrame: number;
|
|
12
12
|
}[];
|
|
13
13
|
}) => boolean;
|
|
14
|
+
export declare const moveKeyframesInPropStatus: ({ status, moves, }: {
|
|
15
|
+
status: CanUpdateSequencePropStatus;
|
|
16
|
+
moves: readonly {
|
|
17
|
+
fromFrame: number;
|
|
18
|
+
toFrame: number;
|
|
19
|
+
}[];
|
|
20
|
+
}) => CanUpdateSequencePropStatus;
|
|
14
21
|
export declare const optimisticMoveSequenceKeyframes: ({ previous, keyframes, }: {
|
|
15
22
|
previous: CanUpdateSequencePropsResponse;
|
|
16
23
|
keyframes: readonly OptimisticKeyframeMove[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optimisticMoveEffectKeyframes = exports.optimisticMoveSequenceKeyframes = exports.canMoveKeyframesWithoutCollisions = void 0;
|
|
3
|
+
exports.optimisticMoveEffectKeyframes = exports.optimisticMoveSequenceKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = void 0;
|
|
4
4
|
const getMoveMap = (moves) => {
|
|
5
5
|
const moveMap = new Map();
|
|
6
6
|
for (const move of moves) {
|
|
@@ -14,62 +14,86 @@ const getMoveMap = (moves) => {
|
|
|
14
14
|
}
|
|
15
15
|
return moveMap;
|
|
16
16
|
};
|
|
17
|
-
const
|
|
18
|
-
var _a;
|
|
17
|
+
const getMovedKeyframes = ({ status, moves, }) => {
|
|
19
18
|
if (status.status !== 'keyframed') {
|
|
20
|
-
return
|
|
19
|
+
return null;
|
|
21
20
|
}
|
|
22
21
|
const moveMap = getMoveMap(moves);
|
|
23
22
|
if (moveMap === null) {
|
|
24
|
-
return
|
|
23
|
+
return null;
|
|
25
24
|
}
|
|
26
25
|
if (moveMap.size === 0) {
|
|
27
|
-
return
|
|
26
|
+
return { keyframes: status.keyframes, removedKeyframeIndexes: [] };
|
|
28
27
|
}
|
|
29
28
|
const frames = new Set(status.keyframes.map((keyframe) => keyframe.frame));
|
|
30
29
|
for (const fromFrame of moveMap.keys()) {
|
|
31
30
|
if (!frames.has(fromFrame)) {
|
|
32
|
-
return
|
|
31
|
+
return null;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
34
|
+
const movedFromFrames = new Set(moveMap.keys());
|
|
35
|
+
const movedToFrames = new Set(moveMap.values());
|
|
36
|
+
const removedKeyframeIndexes = [];
|
|
37
|
+
const nextKeyframes = status.keyframes.flatMap((keyframe, index) => {
|
|
38
|
+
const movedFrame = moveMap.get(keyframe.frame);
|
|
39
|
+
if (movedFrame !== undefined) {
|
|
40
|
+
return [{ ...keyframe, frame: movedFrame }];
|
|
41
|
+
}
|
|
42
|
+
if (movedToFrames.has(keyframe.frame) &&
|
|
43
|
+
!movedFromFrames.has(keyframe.frame)) {
|
|
44
|
+
removedKeyframeIndexes.push(index);
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return [keyframe];
|
|
48
|
+
});
|
|
35
49
|
const nextFrames = new Set();
|
|
36
|
-
for (const keyframe of
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
for (const keyframe of nextKeyframes) {
|
|
51
|
+
if (nextFrames.has(keyframe.frame)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
nextFrames.add(keyframe.frame);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
keyframes: nextKeyframes.sort((a, b) => a.frame - b.frame),
|
|
58
|
+
removedKeyframeIndexes,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const removeEasingForRemovedKeyframes = ({ easing, removedKeyframeIndexes, }) => {
|
|
62
|
+
const nextEasing = [...easing];
|
|
63
|
+
for (const removedKeyframeIndex of [...removedKeyframeIndexes].sort((a, b) => b - a)) {
|
|
64
|
+
if (nextEasing.length === 0) {
|
|
65
|
+
break;
|
|
40
66
|
}
|
|
41
|
-
|
|
67
|
+
const easingIndexToRemove = removedKeyframeIndex === 0 ? 0 : removedKeyframeIndex - 1;
|
|
68
|
+
nextEasing.splice(easingIndexToRemove, 1);
|
|
42
69
|
}
|
|
43
|
-
return
|
|
70
|
+
return nextEasing;
|
|
71
|
+
};
|
|
72
|
+
const canMoveKeyframesWithoutCollisions = ({ status, moves, }) => {
|
|
73
|
+
return getMovedKeyframes({ status, moves }) !== null;
|
|
44
74
|
};
|
|
45
75
|
exports.canMoveKeyframesWithoutCollisions = canMoveKeyframesWithoutCollisions;
|
|
46
76
|
const moveKeyframesInPropStatus = ({ status, moves, }) => {
|
|
47
77
|
if (status.status !== 'keyframed') {
|
|
48
78
|
return status;
|
|
49
79
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (moveMap === null) {
|
|
55
|
-
return status;
|
|
56
|
-
}
|
|
57
|
-
if (moveMap.size === 0) {
|
|
80
|
+
const moved = getMovedKeyframes({ status, moves });
|
|
81
|
+
if (moved === null ||
|
|
82
|
+
(moved.removedKeyframeIndexes.length === 0 &&
|
|
83
|
+
moved.keyframes === status.keyframes)) {
|
|
58
84
|
return status;
|
|
59
85
|
}
|
|
86
|
+
const easing = removeEasingForRemovedKeyframes({
|
|
87
|
+
easing: status.easing,
|
|
88
|
+
removedKeyframeIndexes: moved.removedKeyframeIndexes,
|
|
89
|
+
});
|
|
60
90
|
return {
|
|
61
91
|
...status,
|
|
62
|
-
keyframes:
|
|
63
|
-
|
|
64
|
-
var _a;
|
|
65
|
-
return ({
|
|
66
|
-
...keyframe,
|
|
67
|
-
frame: (_a = moveMap.get(keyframe.frame)) !== null && _a !== void 0 ? _a : keyframe.frame,
|
|
68
|
-
});
|
|
69
|
-
})
|
|
70
|
-
.sort((a, b) => a.frame - b.frame),
|
|
92
|
+
keyframes: moved.keyframes,
|
|
93
|
+
easing,
|
|
71
94
|
};
|
|
72
95
|
};
|
|
96
|
+
exports.moveKeyframesInPropStatus = moveKeyframesInPropStatus;
|
|
73
97
|
const optimisticMoveSequenceKeyframes = ({ previous, keyframes, }) => {
|
|
74
98
|
var _a;
|
|
75
99
|
if (!previous.canUpdate) {
|
|
@@ -87,7 +111,7 @@ const optimisticMoveSequenceKeyframes = ({ previous, keyframes, }) => {
|
|
|
87
111
|
if (!status) {
|
|
88
112
|
continue;
|
|
89
113
|
}
|
|
90
|
-
props[fieldKey] = moveKeyframesInPropStatus({ status, moves });
|
|
114
|
+
props[fieldKey] = (0, exports.moveKeyframesInPropStatus)({ status, moves });
|
|
91
115
|
}
|
|
92
116
|
return {
|
|
93
117
|
...previous,
|
|
@@ -127,7 +151,7 @@ const optimisticMoveEffectKeyframes = ({ previous, keyframes, }) => {
|
|
|
127
151
|
if (!status) {
|
|
128
152
|
continue;
|
|
129
153
|
}
|
|
130
|
-
props[fieldKey] = moveKeyframesInPropStatus({ status, moves });
|
|
154
|
+
props[fieldKey] = (0, exports.moveKeyframesInPropStatus)({ status, moves });
|
|
131
155
|
}
|
|
132
156
|
return {
|
|
133
157
|
...effect,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const SHAPE_DRAG_MIME_TYPE = "application/vnd.remotion.shape+json";
|
|
2
|
+
export declare const shapeNames: readonly ["Arrow", "Circle", "Ellipse", "Heart", "Pie", "Polygon", "Rect", "Star", "Triangle"];
|
|
3
|
+
export type ShapeName = (typeof shapeNames)[number];
|
|
4
|
+
export type ShapeAttribute = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string | number | boolean;
|
|
7
|
+
};
|
|
8
|
+
export type ShapeDragData = {
|
|
9
|
+
type: 'remotion-shape';
|
|
10
|
+
version: 1;
|
|
11
|
+
shape: ShapeName;
|
|
12
|
+
attributes: ShapeAttribute[];
|
|
13
|
+
};
|
|
14
|
+
export declare const isShapeName: (value: unknown) => value is "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
|
|
15
|
+
export declare const isShapeAttributeName: (value: unknown) => value is string;
|
|
16
|
+
export declare const isShapeAttribute: (value: unknown) => value is ShapeAttribute;
|
|
17
|
+
export declare const areShapeAttributes: (value: unknown) => value is ShapeAttribute[];
|
|
18
|
+
export declare const makeShapeDragData: ({ attributes, shape, }: {
|
|
19
|
+
attributes: ShapeAttribute[];
|
|
20
|
+
shape: "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
|
|
21
|
+
}) => ShapeDragData;
|
|
22
|
+
export declare const parseShapeDragData: (value: string) => ShapeDragData | null;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseShapeDragData = exports.makeShapeDragData = exports.areShapeAttributes = exports.isShapeAttribute = exports.isShapeAttributeName = exports.isShapeName = exports.shapeNames = exports.SHAPE_DRAG_MIME_TYPE = void 0;
|
|
4
|
+
exports.SHAPE_DRAG_MIME_TYPE = 'application/vnd.remotion.shape+json';
|
|
5
|
+
exports.shapeNames = [
|
|
6
|
+
'Arrow',
|
|
7
|
+
'Circle',
|
|
8
|
+
'Ellipse',
|
|
9
|
+
'Heart',
|
|
10
|
+
'Pie',
|
|
11
|
+
'Polygon',
|
|
12
|
+
'Rect',
|
|
13
|
+
'Star',
|
|
14
|
+
'Triangle',
|
|
15
|
+
];
|
|
16
|
+
const isRecord = (value) => {
|
|
17
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
};
|
|
19
|
+
const isShapeName = (value) => {
|
|
20
|
+
return typeof value === 'string' && exports.shapeNames.includes(value);
|
|
21
|
+
};
|
|
22
|
+
exports.isShapeName = isShapeName;
|
|
23
|
+
const isShapeAttributeName = (value) => {
|
|
24
|
+
return (typeof value === 'string' &&
|
|
25
|
+
value !== 'style' &&
|
|
26
|
+
/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value));
|
|
27
|
+
};
|
|
28
|
+
exports.isShapeAttributeName = isShapeAttributeName;
|
|
29
|
+
const isShapeAttribute = (value) => {
|
|
30
|
+
if (!isRecord(value)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (!(0, exports.isShapeAttributeName)(value.name)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return (typeof value.value === 'string' ||
|
|
37
|
+
typeof value.value === 'boolean' ||
|
|
38
|
+
(typeof value.value === 'number' && Number.isFinite(value.value)));
|
|
39
|
+
};
|
|
40
|
+
exports.isShapeAttribute = isShapeAttribute;
|
|
41
|
+
const areShapeAttributes = (value) => {
|
|
42
|
+
if (!Array.isArray(value)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const seen = new Set();
|
|
46
|
+
for (const attribute of value) {
|
|
47
|
+
if (!(0, exports.isShapeAttribute)(attribute) || seen.has(attribute.name)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
seen.add(attribute.name);
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
54
|
+
exports.areShapeAttributes = areShapeAttributes;
|
|
55
|
+
const makeShapeDragData = ({ attributes, shape, }) => {
|
|
56
|
+
return {
|
|
57
|
+
type: 'remotion-shape',
|
|
58
|
+
version: 1,
|
|
59
|
+
shape,
|
|
60
|
+
attributes,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
exports.makeShapeDragData = makeShapeDragData;
|
|
64
|
+
const parseShapeDragData = (value) => {
|
|
65
|
+
try {
|
|
66
|
+
const parsed = JSON.parse(value);
|
|
67
|
+
if (!isRecord(parsed)) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
if (parsed.type !== 'remotion-shape' || parsed.version !== 1) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (!(0, exports.isShapeName)(parsed.shape)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (!(0, exports.areShapeAttributes)(parsed.attributes)) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
type: 'remotion-shape',
|
|
81
|
+
version: 1,
|
|
82
|
+
shape: parsed.shape,
|
|
83
|
+
attributes: parsed.attributes,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (_a) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.parseShapeDragData = parseShapeDragData;
|
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.
|
|
6
|
+
"version": "4.0.477",
|
|
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.
|
|
23
|
+
"remotion": "4.0.477"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.477",
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.477",
|
|
28
28
|
"eslint": "9.19.0",
|
|
29
29
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
30
30
|
},
|