@remotion/studio-shared 4.0.471 → 4.0.473
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 +131 -5
- package/dist/asset-drag-data.d.ts +8 -0
- package/dist/asset-drag-data.js +38 -0
- package/dist/codemods.d.ts +9 -0
- package/dist/detect-file-type.d.ts +71 -0
- package/dist/detect-file-type.js +295 -0
- package/dist/effect-clipboard-data.d.ts +70 -0
- package/dist/effect-clipboard-data.js +172 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +46 -1
- package/dist/keyframe-interpolation-function.d.ts +19 -0
- package/dist/keyframe-interpolation-function.js +69 -0
- package/dist/optimistic-add-keyframe.d.ts +5 -3
- package/dist/optimistic-add-keyframe.js +55 -36
- package/dist/optimistic-delete-keyframe.js +2 -5
- package/dist/optimistic-move-keyframe.d.ts +23 -0
- package/dist/optimistic-move-keyframe.js +142 -0
- package/dist/optimistic-update-for-code-values.js +1 -1
- package/dist/optimistic-update-for-effect-code-values.js +1 -1
- package/dist/optimistic-update-keyframe-settings.d.ts +13 -0
- package/dist/optimistic-update-keyframe-settings.js +60 -0
- package/dist/required-package.d.ts +3 -0
- package/dist/required-package.js +27 -0
- package/dist/schema-field-info.d.ts +1 -1
- package/dist/schema-field-info.js +52 -15
- package/package.json +4 -4
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type KeyframeInterpolationFunction } from './keyframe-interpolation-function';
|
|
2
|
+
export type EffectClipboardPasteType = 'effects-additive' | 'effects-replacing';
|
|
3
|
+
export type EffectClipboardStaticParam = {
|
|
4
|
+
readonly type: 'static';
|
|
5
|
+
readonly value: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type EffectClipboardInterpolationFunction = KeyframeInterpolationFunction;
|
|
8
|
+
export type EffectClipboardKeyframe = {
|
|
9
|
+
readonly frame: number;
|
|
10
|
+
readonly value: unknown;
|
|
11
|
+
};
|
|
12
|
+
export type EffectClipboardEasing = 'linear' | [number, number, number, number];
|
|
13
|
+
export type EffectClipboardExtrapolateType = 'extend' | 'identity' | 'clamp' | 'wrap';
|
|
14
|
+
export type EffectClipboardClamping = {
|
|
15
|
+
readonly left: EffectClipboardExtrapolateType;
|
|
16
|
+
readonly right: EffectClipboardExtrapolateType;
|
|
17
|
+
};
|
|
18
|
+
export type EffectClipboardKeyframedParam = {
|
|
19
|
+
readonly type: 'keyframed';
|
|
20
|
+
readonly interpolationFunction: EffectClipboardInterpolationFunction;
|
|
21
|
+
readonly keyframes: EffectClipboardKeyframe[];
|
|
22
|
+
readonly easing: EffectClipboardEasing[];
|
|
23
|
+
readonly clamping: EffectClipboardClamping;
|
|
24
|
+
readonly posterize?: number;
|
|
25
|
+
};
|
|
26
|
+
export type EffectClipboardParam = EffectClipboardStaticParam | EffectClipboardKeyframedParam;
|
|
27
|
+
export type EffectClipboardSnapshot = {
|
|
28
|
+
readonly callee: string;
|
|
29
|
+
readonly importPath: string;
|
|
30
|
+
readonly params: Record<string, EffectClipboardParam>;
|
|
31
|
+
};
|
|
32
|
+
export type EffectClipboardData = {
|
|
33
|
+
readonly type: EffectClipboardPasteType;
|
|
34
|
+
readonly version: 3;
|
|
35
|
+
readonly remotionClipboard: 'effects';
|
|
36
|
+
readonly effects: EffectClipboardSnapshot[];
|
|
37
|
+
};
|
|
38
|
+
export type EffectPropClipboardData = {
|
|
39
|
+
readonly type: 'effect-prop';
|
|
40
|
+
readonly version: 1;
|
|
41
|
+
readonly remotionClipboard: 'effect-prop';
|
|
42
|
+
readonly effect: {
|
|
43
|
+
readonly callee: string;
|
|
44
|
+
readonly importPath: string;
|
|
45
|
+
};
|
|
46
|
+
readonly key: string;
|
|
47
|
+
readonly param: EffectClipboardParam;
|
|
48
|
+
};
|
|
49
|
+
export type EffectClipboardDataParseResult = {
|
|
50
|
+
readonly status: 'valid';
|
|
51
|
+
readonly data: EffectClipboardData;
|
|
52
|
+
} | {
|
|
53
|
+
readonly status: 'unsupported-version';
|
|
54
|
+
readonly version: unknown;
|
|
55
|
+
} | {
|
|
56
|
+
readonly status: 'invalid';
|
|
57
|
+
};
|
|
58
|
+
export type EffectPropClipboardDataParseResult = {
|
|
59
|
+
readonly status: 'valid';
|
|
60
|
+
readonly data: EffectPropClipboardData;
|
|
61
|
+
} | {
|
|
62
|
+
readonly status: 'unsupported-version';
|
|
63
|
+
readonly version: unknown;
|
|
64
|
+
} | {
|
|
65
|
+
readonly status: 'invalid';
|
|
66
|
+
};
|
|
67
|
+
export declare const parseEffectClipboardDataResult: (value: string) => EffectClipboardDataParseResult;
|
|
68
|
+
export declare const parseEffectClipboardData: (value: string) => EffectClipboardData | null;
|
|
69
|
+
export declare const parseEffectPropClipboardDataResult: (value: string) => EffectPropClipboardDataParseResult;
|
|
70
|
+
export declare const parseEffectPropClipboardData: (value: string) => EffectPropClipboardData | null;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseEffectPropClipboardData = exports.parseEffectPropClipboardDataResult = exports.parseEffectClipboardData = exports.parseEffectClipboardDataResult = void 0;
|
|
4
|
+
const keyframe_interpolation_function_1 = require("./keyframe-interpolation-function");
|
|
5
|
+
const isRecord = (value) => {
|
|
6
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
};
|
|
8
|
+
const extrapolateTypes = new Set(['extend', 'identity', 'clamp', 'wrap']);
|
|
9
|
+
const isFiniteNumber = (value) => {
|
|
10
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
11
|
+
};
|
|
12
|
+
const isEasing = (value) => {
|
|
13
|
+
return (value === 'linear' ||
|
|
14
|
+
(Array.isArray(value) &&
|
|
15
|
+
value.length === 4 &&
|
|
16
|
+
value.every((item) => isFiniteNumber(item))));
|
|
17
|
+
};
|
|
18
|
+
const isKeyframe = (value) => {
|
|
19
|
+
return isRecord(value) && isFiniteNumber(value.frame) && 'value' in value;
|
|
20
|
+
};
|
|
21
|
+
const isClamping = (value) => {
|
|
22
|
+
return (isRecord(value) &&
|
|
23
|
+
typeof value.left === 'string' &&
|
|
24
|
+
extrapolateTypes.has(value.left) &&
|
|
25
|
+
typeof value.right === 'string' &&
|
|
26
|
+
extrapolateTypes.has(value.right));
|
|
27
|
+
};
|
|
28
|
+
const isEffectClipboardParam = (value) => {
|
|
29
|
+
if (!isRecord(value)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (value.type === 'static') {
|
|
33
|
+
return 'value' in value;
|
|
34
|
+
}
|
|
35
|
+
if (value.type !== 'keyframed') {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const { posterize } = value;
|
|
39
|
+
const easingLength = Array.isArray(value.keyframes) && value.keyframes.length > 0
|
|
40
|
+
? value.keyframes.length - 1
|
|
41
|
+
: null;
|
|
42
|
+
return (typeof value.interpolationFunction === 'string' &&
|
|
43
|
+
(0, keyframe_interpolation_function_1.isKeyframeInterpolationFunction)(value.interpolationFunction) &&
|
|
44
|
+
Array.isArray(value.keyframes) &&
|
|
45
|
+
value.keyframes.length > 0 &&
|
|
46
|
+
value.keyframes.every(isKeyframe) &&
|
|
47
|
+
Array.isArray(value.easing) &&
|
|
48
|
+
value.easing.length === easingLength &&
|
|
49
|
+
value.easing.every(isEasing) &&
|
|
50
|
+
isClamping(value.clamping) &&
|
|
51
|
+
(posterize === undefined || (isFiniteNumber(posterize) && posterize > 0)));
|
|
52
|
+
};
|
|
53
|
+
const isEffectClipboardSnapshotV3 = (value) => {
|
|
54
|
+
if (!isRecord(value)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return (typeof value.callee === 'string' &&
|
|
58
|
+
typeof value.importPath === 'string' &&
|
|
59
|
+
isRecord(value.params) &&
|
|
60
|
+
Object.values(value.params).every(isEffectClipboardParam));
|
|
61
|
+
};
|
|
62
|
+
const parseEffectClipboardDataResult = (value) => {
|
|
63
|
+
try {
|
|
64
|
+
const parsed = JSON.parse(value);
|
|
65
|
+
if (!isRecord(parsed)) {
|
|
66
|
+
return { status: 'invalid' };
|
|
67
|
+
}
|
|
68
|
+
if (parsed.remotionClipboard !== 'effects') {
|
|
69
|
+
return { status: 'invalid' };
|
|
70
|
+
}
|
|
71
|
+
if (parsed.version !== 3) {
|
|
72
|
+
return {
|
|
73
|
+
status: 'unsupported-version',
|
|
74
|
+
version: parsed.version,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (parsed.type !== 'effects-additive' &&
|
|
78
|
+
parsed.type !== 'effects-replacing') {
|
|
79
|
+
return { status: 'invalid' };
|
|
80
|
+
}
|
|
81
|
+
if (!Array.isArray(parsed.effects)) {
|
|
82
|
+
return { status: 'invalid' };
|
|
83
|
+
}
|
|
84
|
+
const effects = [];
|
|
85
|
+
for (const effect of parsed.effects) {
|
|
86
|
+
if (!isEffectClipboardSnapshotV3(effect)) {
|
|
87
|
+
return { status: 'invalid' };
|
|
88
|
+
}
|
|
89
|
+
effects.push(effect);
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
status: 'valid',
|
|
93
|
+
data: {
|
|
94
|
+
type: parsed.type,
|
|
95
|
+
version: 3,
|
|
96
|
+
remotionClipboard: 'effects',
|
|
97
|
+
effects,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch (_a) {
|
|
102
|
+
return { status: 'invalid' };
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
exports.parseEffectClipboardDataResult = parseEffectClipboardDataResult;
|
|
106
|
+
const parseEffectClipboardData = (value) => {
|
|
107
|
+
const result = (0, exports.parseEffectClipboardDataResult)(value);
|
|
108
|
+
if (result.status !== 'valid') {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return result.data;
|
|
112
|
+
};
|
|
113
|
+
exports.parseEffectClipboardData = parseEffectClipboardData;
|
|
114
|
+
const parseEffectPropClipboardDataResult = (value) => {
|
|
115
|
+
try {
|
|
116
|
+
const parsed = JSON.parse(value);
|
|
117
|
+
if (!isRecord(parsed)) {
|
|
118
|
+
return { status: 'invalid' };
|
|
119
|
+
}
|
|
120
|
+
if (parsed.remotionClipboard !== 'effect-prop') {
|
|
121
|
+
return { status: 'invalid' };
|
|
122
|
+
}
|
|
123
|
+
if (parsed.version !== 1) {
|
|
124
|
+
return {
|
|
125
|
+
status: 'unsupported-version',
|
|
126
|
+
version: parsed.version,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (parsed.type !== 'effect-prop') {
|
|
130
|
+
return { status: 'invalid' };
|
|
131
|
+
}
|
|
132
|
+
if (!isRecord(parsed.effect)) {
|
|
133
|
+
return { status: 'invalid' };
|
|
134
|
+
}
|
|
135
|
+
if (typeof parsed.effect.callee !== 'string' ||
|
|
136
|
+
typeof parsed.effect.importPath !== 'string') {
|
|
137
|
+
return { status: 'invalid' };
|
|
138
|
+
}
|
|
139
|
+
if (typeof parsed.key !== 'string') {
|
|
140
|
+
return { status: 'invalid' };
|
|
141
|
+
}
|
|
142
|
+
if (!isEffectClipboardParam(parsed.param)) {
|
|
143
|
+
return { status: 'invalid' };
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
status: 'valid',
|
|
147
|
+
data: {
|
|
148
|
+
type: 'effect-prop',
|
|
149
|
+
version: 1,
|
|
150
|
+
remotionClipboard: 'effect-prop',
|
|
151
|
+
effect: {
|
|
152
|
+
callee: parsed.effect.callee,
|
|
153
|
+
importPath: parsed.effect.importPath,
|
|
154
|
+
},
|
|
155
|
+
key: parsed.key,
|
|
156
|
+
param: parsed.param,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
catch (_a) {
|
|
161
|
+
return { status: 'invalid' };
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
exports.parseEffectPropClipboardDataResult = parseEffectPropClipboardDataResult;
|
|
165
|
+
const parseEffectPropClipboardData = (value) => {
|
|
166
|
+
const result = (0, exports.parseEffectPropClipboardDataResult)(value);
|
|
167
|
+
if (result.status !== 'valid') {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
return result.data;
|
|
171
|
+
};
|
|
172
|
+
exports.parseEffectPropClipboardData = parseEffectPropClipboardData;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { splitAnsi, stripAnsi } from './ansi';
|
|
2
|
-
export {
|
|
2
|
+
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, 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, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RenameStaticFileRequest, RenameStaticFileResponse, 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, } from './api-requests';
|
|
3
|
+
export { ASSET_DRAG_MIME_TYPE, makeAssetDragData, parseAssetDragData, type AssetDragData, } from './asset-drag-data';
|
|
3
4
|
export type { ApplyVisualControlCodemod, RecastCodemod } from './codemods';
|
|
4
5
|
export { DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS } from './default-buffer-state-delay-in-milliseconds';
|
|
6
|
+
export { detectFileType, isImageFileType, type FileDimensions, type FileType, type ImageFileType, } from './detect-file-type';
|
|
7
|
+
export { parseEffectClipboardData, parseEffectClipboardDataResult, parseEffectPropClipboardData, parseEffectPropClipboardDataResult, type EffectClipboardClamping, type EffectClipboardData, type EffectClipboardDataParseResult, type EffectClipboardEasing, type EffectClipboardExtrapolateType, type EffectClipboardInterpolationFunction, type EffectClipboardKeyframe, type EffectClipboardKeyframedParam, type EffectClipboardParam, type EffectClipboardPasteType, type EffectClipboardSnapshot, type EffectClipboardStaticParam, type EffectPropClipboardData, type EffectPropClipboardDataParseResult, } from './effect-clipboard-data';
|
|
5
8
|
export { EFFECT_DRAG_MIME_TYPE, parseEffectDragData, type EffectDragData, } from './effect-drag-data';
|
|
6
9
|
export { EventSourceEvent } from './event-source-event';
|
|
7
10
|
export { formatBytes } from './format-bytes';
|
|
@@ -11,6 +14,7 @@ export { ErrorLocation, getLocationFromBuildError, } from './get-location-from-b
|
|
|
11
14
|
export { getProjectName } from './get-project-name';
|
|
12
15
|
export type { GitSource } from './git-source';
|
|
13
16
|
export { HotMiddlewareMessage, HotMiddlewareOptions, ModuleMap, hotMiddlewareOptions, } from './hot-middleware';
|
|
17
|
+
export { getKeyframeInterpolationFunction, getKeyframeInterpolationFunctionForSchemaField, isKeyframeInterpolationFunction, isSchemaFieldKeyframable, isSequenceFieldSchemaKeyframable, keyframeInterpolationFunctions, type KeyframeInterpolationFunction, } from './keyframe-interpolation-function';
|
|
14
18
|
export { DEFAULT_TIMELINE_TRACKS } from './max-timeline-tracks';
|
|
15
19
|
export { Pkgs, apiDocs, descriptions, extraPackages, installableMap, packages, type ExtraPackage, } from './package-info';
|
|
16
20
|
export { PackageManager } from './package-manager';
|
|
@@ -18,6 +22,7 @@ export { ProjectInfo } from './project-info';
|
|
|
18
22
|
export type { RenderDefaults } from './render-defaults';
|
|
19
23
|
export { AggregateRenderProgress, ArtifactProgress, BrowserDownloadState, BrowserProgressLog, BundlingState, CopyingState, DownloadProgress, JobProgressCallback, RenderJob, RenderJobWithCleanup, RenderingProgressInput, RequiredChromiumOptions, StitchingProgressInput, UiOpenGlOptions, } from './render-job';
|
|
20
24
|
export type { CompletedClientRender } from './render-job';
|
|
25
|
+
export { getRequiredPackageForEffectImportPath, getRequiredPackageForInsertableElement, } from './required-package';
|
|
21
26
|
export { SCHEMA_FIELD_ROW_HEIGHT, getEffectFieldsToShow, getFieldsToShow, } from './schema-field-info';
|
|
22
27
|
export type { AnySchemaFieldInfo, CodeValues, DragOverrides, EffectSchemaFieldInfo, SchemaFieldInfo, SequenceControls, SequenceSchemaFieldInfo, } from './schema-field-info';
|
|
23
28
|
export { ScriptLine, SomeStackFrame, StackFrame, SymbolicatedStackFrame, } from './stack-types';
|
|
@@ -25,6 +30,8 @@ export { EnumPath, stringifyDefaultProps } from './stringify-default-props';
|
|
|
25
30
|
export type { VisualControlChange } from './codemods';
|
|
26
31
|
export { optimisticAddEffectKeyframe, optimisticAddSequenceKeyframe, } from './optimistic-add-keyframe';
|
|
27
32
|
export { optimisticDeleteEffectKeyframe, optimisticDeleteEffectKeyframes, optimisticDeleteSequenceKeyframe, optimisticDeleteSequenceKeyframes, } from './optimistic-delete-keyframe';
|
|
33
|
+
export { canMoveKeyframesWithoutCollisions, optimisticMoveEffectKeyframes, optimisticMoveSequenceKeyframes, type OptimisticKeyframeMove, } from './optimistic-move-keyframe';
|
|
28
34
|
export { optimisticUpdateForCodeValues } from './optimistic-update-for-code-values';
|
|
29
35
|
export { optimisticUpdateForEffectCodeValues } from './optimistic-update-for-effect-code-values';
|
|
36
|
+
export { optimisticUpdateEffectKeyframeSettings, optimisticUpdateSequenceKeyframeSettings, } from './optimistic-update-keyframe-settings';
|
|
30
37
|
export { stringifySequenceExpandedRowKey, stringifySequenceSubscriptionKey, } from './stringify-sequence-subscription-key';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
17
|
+
exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForEffectCodeValues = exports.optimisticUpdateForCodeValues = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.stringifyDefaultProps = 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.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.parseAssetDragData = exports.makeAssetDragData = exports.ASSET_DRAG_MIME_TYPE = exports.stripAnsi = exports.splitAnsi = void 0;
|
|
18
|
+
exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = void 0;
|
|
4
19
|
const ansi_1 = require("./ansi");
|
|
5
20
|
Object.defineProperty(exports, "splitAnsi", { enumerable: true, get: function () { return ansi_1.splitAnsi; } });
|
|
6
21
|
Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return ansi_1.stripAnsi; } });
|
|
22
|
+
__exportStar(require("./api-requests"), exports);
|
|
23
|
+
const asset_drag_data_1 = require("./asset-drag-data");
|
|
24
|
+
Object.defineProperty(exports, "ASSET_DRAG_MIME_TYPE", { enumerable: true, get: function () { return asset_drag_data_1.ASSET_DRAG_MIME_TYPE; } });
|
|
25
|
+
Object.defineProperty(exports, "makeAssetDragData", { enumerable: true, get: function () { return asset_drag_data_1.makeAssetDragData; } });
|
|
26
|
+
Object.defineProperty(exports, "parseAssetDragData", { enumerable: true, get: function () { return asset_drag_data_1.parseAssetDragData; } });
|
|
7
27
|
const default_buffer_state_delay_in_milliseconds_1 = require("./default-buffer-state-delay-in-milliseconds");
|
|
8
28
|
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; } });
|
|
29
|
+
const detect_file_type_1 = require("./detect-file-type");
|
|
30
|
+
Object.defineProperty(exports, "detectFileType", { enumerable: true, get: function () { return detect_file_type_1.detectFileType; } });
|
|
31
|
+
Object.defineProperty(exports, "isImageFileType", { enumerable: true, get: function () { return detect_file_type_1.isImageFileType; } });
|
|
32
|
+
const effect_clipboard_data_1 = require("./effect-clipboard-data");
|
|
33
|
+
Object.defineProperty(exports, "parseEffectClipboardData", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectClipboardData; } });
|
|
34
|
+
Object.defineProperty(exports, "parseEffectClipboardDataResult", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectClipboardDataResult; } });
|
|
35
|
+
Object.defineProperty(exports, "parseEffectPropClipboardData", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectPropClipboardData; } });
|
|
36
|
+
Object.defineProperty(exports, "parseEffectPropClipboardDataResult", { enumerable: true, get: function () { return effect_clipboard_data_1.parseEffectPropClipboardDataResult; } });
|
|
9
37
|
const effect_drag_data_1 = require("./effect-drag-data");
|
|
10
38
|
Object.defineProperty(exports, "EFFECT_DRAG_MIME_TYPE", { enumerable: true, get: function () { return effect_drag_data_1.EFFECT_DRAG_MIME_TYPE; } });
|
|
11
39
|
Object.defineProperty(exports, "parseEffectDragData", { enumerable: true, get: function () { return effect_drag_data_1.parseEffectDragData; } });
|
|
@@ -21,6 +49,13 @@ const get_project_name_1 = require("./get-project-name");
|
|
|
21
49
|
Object.defineProperty(exports, "getProjectName", { enumerable: true, get: function () { return get_project_name_1.getProjectName; } });
|
|
22
50
|
const hot_middleware_1 = require("./hot-middleware");
|
|
23
51
|
Object.defineProperty(exports, "hotMiddlewareOptions", { enumerable: true, get: function () { return hot_middleware_1.hotMiddlewareOptions; } });
|
|
52
|
+
const keyframe_interpolation_function_1 = require("./keyframe-interpolation-function");
|
|
53
|
+
Object.defineProperty(exports, "getKeyframeInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.getKeyframeInterpolationFunction; } });
|
|
54
|
+
Object.defineProperty(exports, "getKeyframeInterpolationFunctionForSchemaField", { enumerable: true, get: function () { return keyframe_interpolation_function_1.getKeyframeInterpolationFunctionForSchemaField; } });
|
|
55
|
+
Object.defineProperty(exports, "isKeyframeInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isKeyframeInterpolationFunction; } });
|
|
56
|
+
Object.defineProperty(exports, "isSchemaFieldKeyframable", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isSchemaFieldKeyframable; } });
|
|
57
|
+
Object.defineProperty(exports, "isSequenceFieldSchemaKeyframable", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isSequenceFieldSchemaKeyframable; } });
|
|
58
|
+
Object.defineProperty(exports, "keyframeInterpolationFunctions", { enumerable: true, get: function () { return keyframe_interpolation_function_1.keyframeInterpolationFunctions; } });
|
|
24
59
|
const max_timeline_tracks_1 = require("./max-timeline-tracks");
|
|
25
60
|
Object.defineProperty(exports, "DEFAULT_TIMELINE_TRACKS", { enumerable: true, get: function () { return max_timeline_tracks_1.DEFAULT_TIMELINE_TRACKS; } });
|
|
26
61
|
const package_info_1 = require("./package-info");
|
|
@@ -29,6 +64,9 @@ Object.defineProperty(exports, "descriptions", { enumerable: true, get: function
|
|
|
29
64
|
Object.defineProperty(exports, "extraPackages", { enumerable: true, get: function () { return package_info_1.extraPackages; } });
|
|
30
65
|
Object.defineProperty(exports, "installableMap", { enumerable: true, get: function () { return package_info_1.installableMap; } });
|
|
31
66
|
Object.defineProperty(exports, "packages", { enumerable: true, get: function () { return package_info_1.packages; } });
|
|
67
|
+
const required_package_1 = require("./required-package");
|
|
68
|
+
Object.defineProperty(exports, "getRequiredPackageForEffectImportPath", { enumerable: true, get: function () { return required_package_1.getRequiredPackageForEffectImportPath; } });
|
|
69
|
+
Object.defineProperty(exports, "getRequiredPackageForInsertableElement", { enumerable: true, get: function () { return required_package_1.getRequiredPackageForInsertableElement; } });
|
|
32
70
|
const schema_field_info_1 = require("./schema-field-info");
|
|
33
71
|
Object.defineProperty(exports, "SCHEMA_FIELD_ROW_HEIGHT", { enumerable: true, get: function () { return schema_field_info_1.SCHEMA_FIELD_ROW_HEIGHT; } });
|
|
34
72
|
Object.defineProperty(exports, "getEffectFieldsToShow", { enumerable: true, get: function () { return schema_field_info_1.getEffectFieldsToShow; } });
|
|
@@ -43,10 +81,17 @@ Object.defineProperty(exports, "optimisticDeleteEffectKeyframe", { enumerable: t
|
|
|
43
81
|
Object.defineProperty(exports, "optimisticDeleteEffectKeyframes", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteEffectKeyframes; } });
|
|
44
82
|
Object.defineProperty(exports, "optimisticDeleteSequenceKeyframe", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteSequenceKeyframe; } });
|
|
45
83
|
Object.defineProperty(exports, "optimisticDeleteSequenceKeyframes", { enumerable: true, get: function () { return optimistic_delete_keyframe_1.optimisticDeleteSequenceKeyframes; } });
|
|
84
|
+
const optimistic_move_keyframe_1 = require("./optimistic-move-keyframe");
|
|
85
|
+
Object.defineProperty(exports, "canMoveKeyframesWithoutCollisions", { enumerable: true, get: function () { return optimistic_move_keyframe_1.canMoveKeyframesWithoutCollisions; } });
|
|
86
|
+
Object.defineProperty(exports, "optimisticMoveEffectKeyframes", { enumerable: true, get: function () { return optimistic_move_keyframe_1.optimisticMoveEffectKeyframes; } });
|
|
87
|
+
Object.defineProperty(exports, "optimisticMoveSequenceKeyframes", { enumerable: true, get: function () { return optimistic_move_keyframe_1.optimisticMoveSequenceKeyframes; } });
|
|
46
88
|
const optimistic_update_for_code_values_1 = require("./optimistic-update-for-code-values");
|
|
47
89
|
Object.defineProperty(exports, "optimisticUpdateForCodeValues", { enumerable: true, get: function () { return optimistic_update_for_code_values_1.optimisticUpdateForCodeValues; } });
|
|
48
90
|
const optimistic_update_for_effect_code_values_1 = require("./optimistic-update-for-effect-code-values");
|
|
49
91
|
Object.defineProperty(exports, "optimisticUpdateForEffectCodeValues", { enumerable: true, get: function () { return optimistic_update_for_effect_code_values_1.optimisticUpdateForEffectCodeValues; } });
|
|
92
|
+
const optimistic_update_keyframe_settings_1 = require("./optimistic-update-keyframe-settings");
|
|
93
|
+
Object.defineProperty(exports, "optimisticUpdateEffectKeyframeSettings", { enumerable: true, get: function () { return optimistic_update_keyframe_settings_1.optimisticUpdateEffectKeyframeSettings; } });
|
|
94
|
+
Object.defineProperty(exports, "optimisticUpdateSequenceKeyframeSettings", { enumerable: true, get: function () { return optimistic_update_keyframe_settings_1.optimisticUpdateSequenceKeyframeSettings; } });
|
|
50
95
|
const stringify_sequence_subscription_key_1 = require("./stringify-sequence-subscription-key");
|
|
51
96
|
Object.defineProperty(exports, "stringifySequenceExpandedRowKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceExpandedRowKey; } });
|
|
52
97
|
Object.defineProperty(exports, "stringifySequenceSubscriptionKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceSubscriptionKey; } });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SequenceFieldSchema, SequenceSchema } from 'remotion';
|
|
2
|
+
export declare const keyframeInterpolationFunctions: readonly ["interpolate", "interpolateColors"];
|
|
3
|
+
export type KeyframeInterpolationFunction = (typeof keyframeInterpolationFunctions)[number];
|
|
4
|
+
export declare const isKeyframeInterpolationFunction: (name: string) => name is "interpolate" | "interpolateColors";
|
|
5
|
+
export declare const isSequenceFieldSchemaKeyframable: (field: SequenceFieldSchema | undefined) => boolean;
|
|
6
|
+
export declare const isSchemaFieldKeyframable: ({ schema, key, }: {
|
|
7
|
+
schema: SequenceSchema | null;
|
|
8
|
+
key: string;
|
|
9
|
+
}) => boolean;
|
|
10
|
+
export declare const getKeyframeInterpolationFunctionForSchemaField: ({ schema, key, }: {
|
|
11
|
+
schema: SequenceSchema | null;
|
|
12
|
+
key: string;
|
|
13
|
+
}) => "interpolate" | "interpolateColors" | null;
|
|
14
|
+
export declare const getKeyframeInterpolationFunction: ({ schema, key, staticValue, newValue, }: {
|
|
15
|
+
schema: SequenceSchema | null;
|
|
16
|
+
key: string;
|
|
17
|
+
staticValue: unknown;
|
|
18
|
+
newValue: unknown;
|
|
19
|
+
}) => "interpolate" | "interpolateColors";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKeyframeInterpolationFunction = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldKeyframable = exports.isSequenceFieldSchemaKeyframable = exports.isKeyframeInterpolationFunction = exports.keyframeInterpolationFunctions = void 0;
|
|
4
|
+
exports.keyframeInterpolationFunctions = [
|
|
5
|
+
'interpolate',
|
|
6
|
+
'interpolateColors',
|
|
7
|
+
];
|
|
8
|
+
const isKeyframeInterpolationFunction = (name) => {
|
|
9
|
+
return exports.keyframeInterpolationFunctions.includes(name);
|
|
10
|
+
};
|
|
11
|
+
exports.isKeyframeInterpolationFunction = isKeyframeInterpolationFunction;
|
|
12
|
+
const isSequenceFieldSchemaKeyframable = (field) => {
|
|
13
|
+
if (!field) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
if (field.type === 'array' || field.type === 'enum') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return field.keyframable !== false;
|
|
20
|
+
};
|
|
21
|
+
exports.isSequenceFieldSchemaKeyframable = isSequenceFieldSchemaKeyframable;
|
|
22
|
+
const findFieldInSchema = (schema, key) => {
|
|
23
|
+
if (key in schema) {
|
|
24
|
+
return schema[key];
|
|
25
|
+
}
|
|
26
|
+
for (const field of Object.values(schema)) {
|
|
27
|
+
if (field.type !== 'enum') {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
for (const variant of Object.values(field.variants)) {
|
|
31
|
+
const found = findFieldInSchema(variant, key);
|
|
32
|
+
if (found) {
|
|
33
|
+
return found;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
};
|
|
39
|
+
const isSchemaFieldKeyframable = ({ schema, key, }) => {
|
|
40
|
+
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
41
|
+
return (0, exports.isSequenceFieldSchemaKeyframable)(field);
|
|
42
|
+
};
|
|
43
|
+
exports.isSchemaFieldKeyframable = isSchemaFieldKeyframable;
|
|
44
|
+
const getKeyframeInterpolationFunctionForSchemaField = ({ schema, key, }) => {
|
|
45
|
+
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
46
|
+
if ((field === null || field === void 0 ? void 0 : field.type) === 'color') {
|
|
47
|
+
return 'interpolateColors';
|
|
48
|
+
}
|
|
49
|
+
if ((field === null || field === void 0 ? void 0 : field.type) === 'scale' ||
|
|
50
|
+
(field === null || field === void 0 ? void 0 : field.type) === 'translate' ||
|
|
51
|
+
(field === null || field === void 0 ? void 0 : field.type) === 'rotation-css') {
|
|
52
|
+
return 'interpolate';
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
exports.getKeyframeInterpolationFunctionForSchemaField = getKeyframeInterpolationFunctionForSchemaField;
|
|
57
|
+
const getKeyframeInterpolationFunction = ({ schema, key, staticValue, newValue, }) => {
|
|
58
|
+
const schemaFunction = (0, exports.getKeyframeInterpolationFunctionForSchemaField)({
|
|
59
|
+
schema,
|
|
60
|
+
key,
|
|
61
|
+
});
|
|
62
|
+
if (schemaFunction) {
|
|
63
|
+
return schemaFunction;
|
|
64
|
+
}
|
|
65
|
+
return typeof staticValue === 'string' && typeof newValue === 'string'
|
|
66
|
+
? 'interpolateColors'
|
|
67
|
+
: 'interpolate';
|
|
68
|
+
};
|
|
69
|
+
exports.getKeyframeInterpolationFunction = getKeyframeInterpolationFunction;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { type CanUpdateSequencePropsResponse } from 'remotion';
|
|
2
|
-
export declare const optimisticAddSequenceKeyframe: ({ previous, fieldKey, frame, value, }: {
|
|
1
|
+
import { type CanUpdateSequencePropsResponse, type SequenceSchema } from 'remotion';
|
|
2
|
+
export declare const optimisticAddSequenceKeyframe: ({ previous, fieldKey, frame, value, schema, }: {
|
|
3
3
|
previous: CanUpdateSequencePropsResponse;
|
|
4
4
|
fieldKey: string;
|
|
5
5
|
frame: number;
|
|
6
6
|
value: unknown;
|
|
7
|
+
schema?: SequenceSchema | undefined;
|
|
7
8
|
}) => CanUpdateSequencePropsResponse;
|
|
8
|
-
export declare const optimisticAddEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, value, }: {
|
|
9
|
+
export declare const optimisticAddEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, value, schema, }: {
|
|
9
10
|
previous: CanUpdateSequencePropsResponse;
|
|
10
11
|
effectIndex: number;
|
|
11
12
|
fieldKey: string;
|
|
12
13
|
frame: number;
|
|
13
14
|
value: unknown;
|
|
15
|
+
schema?: SequenceSchema | undefined;
|
|
14
16
|
}) => CanUpdateSequencePropsResponse;
|
|
@@ -1,51 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.optimisticAddEffectKeyframe = exports.optimisticAddSequenceKeyframe = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
? 'interpolateColors'
|
|
7
|
-
: 'interpolate';
|
|
8
|
-
};
|
|
9
|
-
const addKeyframeToPropStatus = ({ status, frame, value, }) => {
|
|
4
|
+
const keyframe_interpolation_function_1 = require("./keyframe-interpolation-function");
|
|
5
|
+
const addKeyframeToPropStatus = ({ status, fieldKey, frame, value, schema, }) => {
|
|
10
6
|
var _a;
|
|
11
|
-
if (status.
|
|
7
|
+
if (status.status === 'keyframed') {
|
|
8
|
+
const existingIndex = status.keyframes.findIndex((kf) => kf.frame === frame);
|
|
9
|
+
if (existingIndex !== -1) {
|
|
10
|
+
const updatedKeyframes = status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
|
|
11
|
+
return {
|
|
12
|
+
...status,
|
|
13
|
+
keyframes: updatedKeyframes,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const keyframes = [...status.keyframes, { frame, value }].sort((first, second) => first.frame - second.frame);
|
|
17
|
+
const easing = [...status.easing];
|
|
18
|
+
while (easing.length < keyframes.length - 1) {
|
|
19
|
+
easing.push('linear');
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
...status,
|
|
23
|
+
keyframes,
|
|
24
|
+
easing,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if (status.status === 'static') {
|
|
12
28
|
const staticValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : value;
|
|
13
29
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
interpolationFunction:
|
|
30
|
+
status: 'keyframed',
|
|
31
|
+
codeValue: undefined,
|
|
32
|
+
interpolationFunction: (0, keyframe_interpolation_function_1.getKeyframeInterpolationFunction)({
|
|
33
|
+
schema,
|
|
34
|
+
key: fieldKey,
|
|
35
|
+
staticValue,
|
|
36
|
+
newValue: value,
|
|
37
|
+
}),
|
|
17
38
|
keyframes: [{ frame, value }],
|
|
18
39
|
easing: [],
|
|
19
|
-
clamping: { left: '
|
|
40
|
+
clamping: { left: 'clamp', right: 'clamp' },
|
|
20
41
|
posterize: undefined,
|
|
21
42
|
};
|
|
22
43
|
}
|
|
23
|
-
|
|
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
|
+
return status;
|
|
44
45
|
};
|
|
45
|
-
const optimisticAddSequenceKeyframe = ({ previous, fieldKey, frame, value, }) => {
|
|
46
|
+
const optimisticAddSequenceKeyframe = ({ previous, fieldKey, frame, value, schema, }) => {
|
|
46
47
|
if (!previous.canUpdate) {
|
|
47
48
|
return previous;
|
|
48
49
|
}
|
|
50
|
+
if (!(0, keyframe_interpolation_function_1.isSchemaFieldKeyframable)({ schema: schema !== null && schema !== void 0 ? schema : null, key: fieldKey })) {
|
|
51
|
+
return previous;
|
|
52
|
+
}
|
|
49
53
|
const status = previous.props[fieldKey];
|
|
50
54
|
if (!status) {
|
|
51
55
|
return previous;
|
|
@@ -54,15 +58,24 @@ const optimisticAddSequenceKeyframe = ({ previous, fieldKey, frame, value, }) =>
|
|
|
54
58
|
...previous,
|
|
55
59
|
props: {
|
|
56
60
|
...previous.props,
|
|
57
|
-
[fieldKey]: addKeyframeToPropStatus({
|
|
61
|
+
[fieldKey]: addKeyframeToPropStatus({
|
|
62
|
+
status,
|
|
63
|
+
fieldKey,
|
|
64
|
+
frame,
|
|
65
|
+
value,
|
|
66
|
+
schema: schema !== null && schema !== void 0 ? schema : null,
|
|
67
|
+
}),
|
|
58
68
|
},
|
|
59
69
|
};
|
|
60
70
|
};
|
|
61
71
|
exports.optimisticAddSequenceKeyframe = optimisticAddSequenceKeyframe;
|
|
62
|
-
const optimisticAddEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, value, }) => {
|
|
72
|
+
const optimisticAddEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, value, schema, }) => {
|
|
63
73
|
if (!previous.canUpdate) {
|
|
64
74
|
return previous;
|
|
65
75
|
}
|
|
76
|
+
if (!(0, keyframe_interpolation_function_1.isSchemaFieldKeyframable)({ schema: schema !== null && schema !== void 0 ? schema : null, key: fieldKey })) {
|
|
77
|
+
return previous;
|
|
78
|
+
}
|
|
66
79
|
const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
|
|
67
80
|
if (targetIndex === -1) {
|
|
68
81
|
return previous;
|
|
@@ -79,7 +92,13 @@ const optimisticAddEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, v
|
|
|
79
92
|
...target,
|
|
80
93
|
props: {
|
|
81
94
|
...target.props,
|
|
82
|
-
[fieldKey]: addKeyframeToPropStatus({
|
|
95
|
+
[fieldKey]: addKeyframeToPropStatus({
|
|
96
|
+
status,
|
|
97
|
+
fieldKey,
|
|
98
|
+
frame,
|
|
99
|
+
value,
|
|
100
|
+
schema: schema !== null && schema !== void 0 ? schema : null,
|
|
101
|
+
}),
|
|
83
102
|
},
|
|
84
103
|
};
|
|
85
104
|
const effects = [...previous.effects];
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = void 0;
|
|
4
4
|
const removeKeyframeFromPropStatus = ({ status, frame, }) => {
|
|
5
|
-
if (status.
|
|
6
|
-
return status;
|
|
7
|
-
}
|
|
8
|
-
if (status.reason !== 'keyframed') {
|
|
5
|
+
if (status.status !== 'keyframed') {
|
|
9
6
|
return status;
|
|
10
7
|
}
|
|
11
8
|
const index = status.keyframes.findIndex((kf) => kf.frame === frame);
|
|
@@ -15,7 +12,7 @@ const removeKeyframeFromPropStatus = ({ status, frame, }) => {
|
|
|
15
12
|
const keyframes = status.keyframes.filter((_, i) => i !== index);
|
|
16
13
|
if (keyframes.length === 0) {
|
|
17
14
|
return {
|
|
18
|
-
|
|
15
|
+
status: 'static',
|
|
19
16
|
codeValue: status.keyframes[index].value,
|
|
20
17
|
};
|
|
21
18
|
}
|