@remotion/studio-shared 4.0.492 → 4.0.494
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 +2 -0
- package/dist/codemods.d.ts +7 -0
- package/dist/composition-drag-data.d.ts +2 -0
- package/dist/composition-drag-data.js +14 -1
- package/dist/detect-file-type.d.ts +1 -0
- package/dist/detect-file-type.js +23 -2
- package/dist/easing-clipboard-data.d.ts +2 -0
- package/dist/easing-clipboard-data.js +7 -5
- package/dist/index.d.ts +3 -2
- package/dist/index.js +9 -2
- package/dist/keyframe-clipboard-data.d.ts +46 -0
- package/dist/keyframe-clipboard-data.js +104 -0
- package/dist/keyframe-interpolation-function.d.ts +1 -0
- package/dist/keyframe-interpolation-function.js +49 -18
- package/dist/optimistic-delete-keyframe.d.ts +6 -2
- package/dist/optimistic-delete-keyframe.js +18 -6
- package/dist/schema-field-info.d.ts +21 -2
- package/dist/schema-field-info.js +24 -27
- package/package.json +4 -4
package/dist/api-requests.d.ts
CHANGED
|
@@ -353,6 +353,7 @@ export type DeleteSequenceKeyframe = {
|
|
|
353
353
|
key: string;
|
|
354
354
|
frame: number;
|
|
355
355
|
schema: InteractivitySchema;
|
|
356
|
+
valueWhenLastKeyframeDeleted?: unknown;
|
|
356
357
|
};
|
|
357
358
|
export type MoveSequenceKeyframe = {
|
|
358
359
|
fileName: string;
|
|
@@ -380,6 +381,7 @@ export type DeleteEffectKeyframe = {
|
|
|
380
381
|
key: string;
|
|
381
382
|
frame: number;
|
|
382
383
|
schema: InteractivitySchema;
|
|
384
|
+
valueWhenLastKeyframeDeleted?: unknown;
|
|
383
385
|
};
|
|
384
386
|
export type MoveEffectKeyframe = {
|
|
385
387
|
fileName: string;
|
package/dist/codemods.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export type RecastCodemod = {
|
|
|
33
33
|
type: 'rename-composition';
|
|
34
34
|
idToRename: string;
|
|
35
35
|
newId: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'update-composition-metadata';
|
|
38
|
+
idToUpdate: string;
|
|
39
|
+
newDurationInFrames: number | null;
|
|
40
|
+
newFps: number | null;
|
|
41
|
+
newHeight: number | null;
|
|
42
|
+
newWidth: number | null;
|
|
36
43
|
} | {
|
|
37
44
|
type: 'delete-composition';
|
|
38
45
|
idToDelete: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SymbolicatedStackFrame } from './stack-types';
|
|
1
2
|
export { COMPOSITION_DRAG_MIME_TYPE } from './drag-mime-types';
|
|
2
3
|
export type CompositionDragData = {
|
|
3
4
|
type: 'remotion-composition';
|
|
@@ -9,4 +10,5 @@ export declare const makeCompositionDragData: ({ compositionFile, compositionId,
|
|
|
9
10
|
compositionFile: string | null;
|
|
10
11
|
compositionId: string;
|
|
11
12
|
}) => CompositionDragData;
|
|
13
|
+
export declare const compositionDragDataToSymbolicatedStack: (dragData: CompositionDragData) => SymbolicatedStackFrame | null;
|
|
12
14
|
export declare const parseCompositionDragData: (value: string) => CompositionDragData | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseCompositionDragData = exports.makeCompositionDragData = exports.COMPOSITION_DRAG_MIME_TYPE = void 0;
|
|
3
|
+
exports.parseCompositionDragData = exports.compositionDragDataToSymbolicatedStack = exports.makeCompositionDragData = exports.COMPOSITION_DRAG_MIME_TYPE = void 0;
|
|
4
4
|
const drag_mime_types_1 = require("./drag-mime-types");
|
|
5
5
|
Object.defineProperty(exports, "COMPOSITION_DRAG_MIME_TYPE", { enumerable: true, get: function () { return drag_mime_types_1.COMPOSITION_DRAG_MIME_TYPE; } });
|
|
6
6
|
const isRecord = (value) => {
|
|
@@ -36,6 +36,19 @@ const makeCompositionDragData = ({ compositionFile, compositionId, }) => {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
exports.makeCompositionDragData = makeCompositionDragData;
|
|
39
|
+
const compositionDragDataToSymbolicatedStack = (dragData) => {
|
|
40
|
+
if (dragData.compositionFile === null) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
originalColumnNumber: null,
|
|
45
|
+
originalFileName: dragData.compositionFile,
|
|
46
|
+
originalFunctionName: null,
|
|
47
|
+
originalLineNumber: null,
|
|
48
|
+
originalScriptCode: null,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.compositionDragDataToSymbolicatedStack = compositionDragDataToSymbolicatedStack;
|
|
39
52
|
const parseCompositionDragData = (value) => {
|
|
40
53
|
try {
|
|
41
54
|
const parsed = JSON.parse(value);
|
package/dist/detect-file-type.js
CHANGED
|
@@ -225,12 +225,33 @@ const getWebPDimensions = (bytes) => {
|
|
|
225
225
|
}
|
|
226
226
|
return null;
|
|
227
227
|
};
|
|
228
|
+
const isAnimatedWebp = (data) => {
|
|
229
|
+
const animationChunk = new Uint8Array([0x41, 0x4e, 0x49, 0x4d]);
|
|
230
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
231
|
+
let offset = 12;
|
|
232
|
+
while (offset + 8 <= data.length) {
|
|
233
|
+
const chunkType = data.subarray(offset, offset + 4);
|
|
234
|
+
if ((0, exports.matchesPattern)(animationChunk)(chunkType)) {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
const chunkLength = view.getUint32(offset + 4, true);
|
|
238
|
+
const nextOffset = offset + 8 + chunkLength + (chunkLength % 2);
|
|
239
|
+
if (nextOffset <= offset) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
offset = nextOffset;
|
|
243
|
+
}
|
|
244
|
+
return false;
|
|
245
|
+
};
|
|
228
246
|
const isWebp = (data) => {
|
|
229
|
-
const
|
|
230
|
-
|
|
247
|
+
const riffPattern = new Uint8Array([0x52, 0x49, 0x46, 0x46]);
|
|
248
|
+
const webpPattern = new Uint8Array([0x57, 0x45, 0x42, 0x50]);
|
|
249
|
+
if ((0, exports.matchesPattern)(riffPattern)(data.subarray(0, 4)) &&
|
|
250
|
+
(0, exports.matchesPattern)(webpPattern)(data.subarray(8, 12))) {
|
|
231
251
|
return {
|
|
232
252
|
type: 'webp',
|
|
233
253
|
dimensions: getWebPDimensions(data),
|
|
254
|
+
animated: isAnimatedWebp(data),
|
|
234
255
|
};
|
|
235
256
|
}
|
|
236
257
|
return null;
|
|
@@ -14,5 +14,7 @@ export type EasingClipboardDataParseResult = {
|
|
|
14
14
|
} | {
|
|
15
15
|
readonly status: 'invalid';
|
|
16
16
|
};
|
|
17
|
+
export declare const isKeyframeEasing: (value: unknown) => value is import("remotion").CanUpdateSequencePropStatusEasing;
|
|
18
|
+
export declare const normalizeKeyframeEasing: (easing: import("remotion").CanUpdateSequencePropStatusEasing) => import("remotion").CanUpdateSequencePropStatusEasing;
|
|
17
19
|
export declare const parseEasingClipboardDataResult: (value: string) => EasingClipboardDataParseResult;
|
|
18
20
|
export declare const parseEasingClipboardData: (value: string) => EasingClipboardData | null;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseEasingClipboardData = exports.parseEasingClipboardDataResult = void 0;
|
|
3
|
+
exports.parseEasingClipboardData = exports.parseEasingClipboardDataResult = exports.normalizeKeyframeEasing = exports.isKeyframeEasing = void 0;
|
|
4
4
|
const isRecord = (value) => {
|
|
5
5
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
6
6
|
};
|
|
7
7
|
const isFiniteNumber = (value) => {
|
|
8
8
|
return typeof value === 'number' && Number.isFinite(value);
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const isKeyframeEasing = (value) => {
|
|
11
11
|
return (isRecord(value) &&
|
|
12
12
|
(value.type === 'linear' ||
|
|
13
13
|
(value.type === 'bezier' &&
|
|
@@ -27,7 +27,8 @@ const isEasing = (value) => {
|
|
|
27
27
|
isFiniteNumber(value.durationRestThreshold)) &&
|
|
28
28
|
typeof value.overshootClamping === 'boolean')));
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
exports.isKeyframeEasing = isKeyframeEasing;
|
|
31
|
+
const normalizeKeyframeEasing = (easing) => {
|
|
31
32
|
var _a, _b;
|
|
32
33
|
if (easing.type !== 'spring') {
|
|
33
34
|
return easing;
|
|
@@ -38,6 +39,7 @@ const normalizeEasing = (easing) => {
|
|
|
38
39
|
durationRestThreshold: (_b = easing.durationRestThreshold) !== null && _b !== void 0 ? _b : null,
|
|
39
40
|
};
|
|
40
41
|
};
|
|
42
|
+
exports.normalizeKeyframeEasing = normalizeKeyframeEasing;
|
|
41
43
|
const parseEasingClipboardDataResult = (value) => {
|
|
42
44
|
try {
|
|
43
45
|
const parsed = JSON.parse(value);
|
|
@@ -53,7 +55,7 @@ const parseEasingClipboardDataResult = (value) => {
|
|
|
53
55
|
version: parsed.version,
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
|
-
if (parsed.type !== 'easing' || !
|
|
58
|
+
if (parsed.type !== 'easing' || !(0, exports.isKeyframeEasing)(parsed.easing)) {
|
|
57
59
|
return { status: 'invalid' };
|
|
58
60
|
}
|
|
59
61
|
return {
|
|
@@ -62,7 +64,7 @@ const parseEasingClipboardDataResult = (value) => {
|
|
|
62
64
|
type: 'easing',
|
|
63
65
|
version: 1,
|
|
64
66
|
remotionClipboard: 'easing',
|
|
65
|
-
easing:
|
|
67
|
+
easing: (0, exports.normalizeKeyframeEasing)(parsed.easing),
|
|
66
68
|
},
|
|
67
69
|
};
|
|
68
70
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddEffectRequest,
|
|
|
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 ComponentDimensions, type ComponentDragData, type ComponentProp, } from './component-drag-data';
|
|
6
|
-
export { COMPOSITION_DRAG_MIME_TYPE, makeCompositionDragData, parseCompositionDragData, type CompositionDragData, } from './composition-drag-data';
|
|
6
|
+
export { COMPOSITION_DRAG_MIME_TYPE, compositionDragDataToSymbolicatedStack, makeCompositionDragData, parseCompositionDragData, type CompositionDragData, } from './composition-drag-data';
|
|
7
7
|
export { DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS } from './default-buffer-state-delay-in-milliseconds';
|
|
8
8
|
export { getDefinePluginDefinitions } from './define-plugin-definitions';
|
|
9
9
|
export { detectFileType, isImageFileType, type FileDimensions, type FileType, type ImageFileType, } from './detect-file-type';
|
|
@@ -22,7 +22,8 @@ export { getProjectName } from './get-project-name';
|
|
|
22
22
|
export type { GitSource } from './git-source';
|
|
23
23
|
export { HotMiddlewareMessage, HotMiddlewareOptions, ModuleMap, hotMiddlewareOptions, } from './hot-middleware';
|
|
24
24
|
export { CUBIC_KEYFRAME_EASING, EASE_KEYFRAME_EASING, KEYFRAME_EASING_PRESETS, LINEAR_KEYFRAME_EASING, QUAD_KEYFRAME_EASING, getBackKeyframeEasing, getOutKeyframeEasing, getPolyKeyframeEasing, type KeyframeEasing, type KeyframeEasingPreset, } from './keyframe-easing-presets';
|
|
25
|
-
export { getKeyframeInterpolationFunction, getKeyframeInterpolationFunctionForSchemaField, isInteractivitySchemaFieldKeyframable, isKeyframeInterpolationFunction, isSchemaFieldKeyframable, keyframeInterpolationFunctions, type KeyframeInterpolationFunction, } from './keyframe-interpolation-function';
|
|
25
|
+
export { canEditEasingForInterpolationFunction, getKeyframeInterpolationFunction, getKeyframeInterpolationFunctionForSchemaField, isInteractivitySchemaFieldKeyframable, isKeyframeInterpolationFunction, isSchemaFieldKeyframable, keyframeInterpolationFunctions, type KeyframeInterpolationFunction, } from './keyframe-interpolation-function';
|
|
26
|
+
export { isKeyframeClipboardFieldType, parseKeyframeClipboardData, parseKeyframeClipboardDataResult, type KeyframeClipboardData, type KeyframeClipboardDataParseResult, type KeyframeClipboardFieldType, } from './keyframe-clipboard-data';
|
|
26
27
|
export { DEFAULT_TIMELINE_TRACKS } from './max-timeline-tracks';
|
|
27
28
|
export { Pkgs, apiDocs, descriptions, extraPackages, installableMap, packages, type ExtraPackage, } from './package-info';
|
|
28
29
|
export { PackageManager } from './package-manager';
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
17
|
+
exports.CUBIC_KEYFRAME_EASING = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getDefaultOutLocation = exports.getAssetSchemaKeys = exports.getAllSchemaKeys = exports.formatBytes = exports.parseElementDragData = exports.makeElementFileNameFromSlug = exports.makeElementDragData = exports.isLowercaseElementFileName = exports.getElementComponentNameFromSourceCode = exports.ELEMENT_DRAG_MIME_TYPE = exports.parseEffectDragData = exports.EFFECT_DRAG_MIME_TYPE = exports.parseEffectPropClipboardDataResult = exports.parseEffectPropClipboardData = exports.parseEffectClipboardDataResult = exports.parseEffectClipboardData = exports.makeEffectDragDataFromCatalogItem = exports.getEffectPreviewSource = exports.getEffectPreviewAlt = exports.getEffectDocumentationPath = exports.getEffectDocumentationLink = exports.getEffectCatalogCategories = exports.EFFECT_CATALOG = exports.parseEasingClipboardDataResult = exports.parseEasingClipboardData = exports.isRemotionDragMimeType = exports.REMOTION_DRAG_MIME_TYPES = exports.isImageFileType = exports.detectFileType = exports.getDefinePluginDefinitions = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.parseCompositionDragData = exports.makeCompositionDragData = exports.compositionDragDataToSymbolicatedStack = exports.COMPOSITION_DRAG_MIME_TYPE = 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.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = exports.parseSfxDragData = exports.SFX_DRAG_MIME_TYPE = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_GROUPS = exports.isValidPackageName = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForEffectImportPath = exports.parseSpringEasingConfig = exports.DEFAULT_SPRING_EASING = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.parseKeyframeClipboardDataResult = exports.parseKeyframeClipboardData = exports.isKeyframeClipboardFieldType = exports.keyframeInterpolationFunctions = exports.isSchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = exports.isInteractivitySchemaFieldKeyframable = exports.getKeyframeInterpolationFunctionForSchemaField = exports.getKeyframeInterpolationFunction = exports.canEditEasingForInterpolationFunction = exports.getPolyKeyframeEasing = exports.getOutKeyframeEasing = exports.getBackKeyframeEasing = exports.QUAD_KEYFRAME_EASING = exports.LINEAR_KEYFRAME_EASING = exports.KEYFRAME_EASING_PRESETS = exports.EASE_KEYFRAME_EASING = void 0;
|
|
19
|
+
exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = void 0;
|
|
19
20
|
const ansi_1 = require("./ansi");
|
|
20
21
|
Object.defineProperty(exports, "splitAnsi", { enumerable: true, get: function () { return ansi_1.splitAnsi; } });
|
|
21
22
|
Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return ansi_1.stripAnsi; } });
|
|
@@ -33,6 +34,7 @@ Object.defineProperty(exports, "makeComponentDragData", { enumerable: true, get:
|
|
|
33
34
|
Object.defineProperty(exports, "parseComponentDragData", { enumerable: true, get: function () { return component_drag_data_1.parseComponentDragData; } });
|
|
34
35
|
const composition_drag_data_1 = require("./composition-drag-data");
|
|
35
36
|
Object.defineProperty(exports, "COMPOSITION_DRAG_MIME_TYPE", { enumerable: true, get: function () { return composition_drag_data_1.COMPOSITION_DRAG_MIME_TYPE; } });
|
|
37
|
+
Object.defineProperty(exports, "compositionDragDataToSymbolicatedStack", { enumerable: true, get: function () { return composition_drag_data_1.compositionDragDataToSymbolicatedStack; } });
|
|
36
38
|
Object.defineProperty(exports, "makeCompositionDragData", { enumerable: true, get: function () { return composition_drag_data_1.makeCompositionDragData; } });
|
|
37
39
|
Object.defineProperty(exports, "parseCompositionDragData", { enumerable: true, get: function () { return composition_drag_data_1.parseCompositionDragData; } });
|
|
38
40
|
const default_buffer_state_delay_in_milliseconds_1 = require("./default-buffer-state-delay-in-milliseconds");
|
|
@@ -94,12 +96,17 @@ Object.defineProperty(exports, "getBackKeyframeEasing", { enumerable: true, get:
|
|
|
94
96
|
Object.defineProperty(exports, "getOutKeyframeEasing", { enumerable: true, get: function () { return keyframe_easing_presets_1.getOutKeyframeEasing; } });
|
|
95
97
|
Object.defineProperty(exports, "getPolyKeyframeEasing", { enumerable: true, get: function () { return keyframe_easing_presets_1.getPolyKeyframeEasing; } });
|
|
96
98
|
const keyframe_interpolation_function_1 = require("./keyframe-interpolation-function");
|
|
99
|
+
Object.defineProperty(exports, "canEditEasingForInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.canEditEasingForInterpolationFunction; } });
|
|
97
100
|
Object.defineProperty(exports, "getKeyframeInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.getKeyframeInterpolationFunction; } });
|
|
98
101
|
Object.defineProperty(exports, "getKeyframeInterpolationFunctionForSchemaField", { enumerable: true, get: function () { return keyframe_interpolation_function_1.getKeyframeInterpolationFunctionForSchemaField; } });
|
|
99
102
|
Object.defineProperty(exports, "isInteractivitySchemaFieldKeyframable", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isInteractivitySchemaFieldKeyframable; } });
|
|
100
103
|
Object.defineProperty(exports, "isKeyframeInterpolationFunction", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isKeyframeInterpolationFunction; } });
|
|
101
104
|
Object.defineProperty(exports, "isSchemaFieldKeyframable", { enumerable: true, get: function () { return keyframe_interpolation_function_1.isSchemaFieldKeyframable; } });
|
|
102
105
|
Object.defineProperty(exports, "keyframeInterpolationFunctions", { enumerable: true, get: function () { return keyframe_interpolation_function_1.keyframeInterpolationFunctions; } });
|
|
106
|
+
const keyframe_clipboard_data_1 = require("./keyframe-clipboard-data");
|
|
107
|
+
Object.defineProperty(exports, "isKeyframeClipboardFieldType", { enumerable: true, get: function () { return keyframe_clipboard_data_1.isKeyframeClipboardFieldType; } });
|
|
108
|
+
Object.defineProperty(exports, "parseKeyframeClipboardData", { enumerable: true, get: function () { return keyframe_clipboard_data_1.parseKeyframeClipboardData; } });
|
|
109
|
+
Object.defineProperty(exports, "parseKeyframeClipboardDataResult", { enumerable: true, get: function () { return keyframe_clipboard_data_1.parseKeyframeClipboardDataResult; } });
|
|
103
110
|
const max_timeline_tracks_1 = require("./max-timeline-tracks");
|
|
104
111
|
Object.defineProperty(exports, "DEFAULT_TIMELINE_TRACKS", { enumerable: true, get: function () { return max_timeline_tracks_1.DEFAULT_TIMELINE_TRACKS; } });
|
|
105
112
|
const package_info_1 = require("./package-info");
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { KeyframeEasing } from './keyframe-easing-presets';
|
|
2
|
+
declare const KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT: {
|
|
3
|
+
readonly array: false;
|
|
4
|
+
readonly asset: false;
|
|
5
|
+
readonly boolean: false;
|
|
6
|
+
readonly color: true;
|
|
7
|
+
readonly enum: false;
|
|
8
|
+
readonly 'font-family': false;
|
|
9
|
+
readonly hidden: false;
|
|
10
|
+
readonly number: true;
|
|
11
|
+
readonly 'rotation-css': true;
|
|
12
|
+
readonly 'rotation-degrees': true;
|
|
13
|
+
readonly scale: true;
|
|
14
|
+
readonly 'text-content': false;
|
|
15
|
+
readonly 'transform-origin': true;
|
|
16
|
+
readonly translate: true;
|
|
17
|
+
readonly 'uv-coordinate': true;
|
|
18
|
+
};
|
|
19
|
+
type KeyframeClipboardFieldTypeSupport = typeof KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT;
|
|
20
|
+
export type KeyframeClipboardFieldType = {
|
|
21
|
+
[FieldType in keyof KeyframeClipboardFieldTypeSupport]: KeyframeClipboardFieldTypeSupport[FieldType] extends true ? FieldType : never;
|
|
22
|
+
}[keyof KeyframeClipboardFieldTypeSupport];
|
|
23
|
+
export type KeyframeClipboardData = {
|
|
24
|
+
readonly type: 'keyframe';
|
|
25
|
+
readonly version: 1;
|
|
26
|
+
readonly remotionClipboard: 'keyframe';
|
|
27
|
+
readonly fieldType: KeyframeClipboardFieldType | null;
|
|
28
|
+
readonly keyframes: readonly {
|
|
29
|
+
readonly frameOffset: number;
|
|
30
|
+
readonly value: unknown;
|
|
31
|
+
}[];
|
|
32
|
+
readonly easing: readonly KeyframeEasing[];
|
|
33
|
+
};
|
|
34
|
+
export type KeyframeClipboardDataParseResult = {
|
|
35
|
+
readonly status: 'valid';
|
|
36
|
+
readonly data: KeyframeClipboardData;
|
|
37
|
+
} | {
|
|
38
|
+
readonly status: 'unsupported-version';
|
|
39
|
+
readonly version: unknown;
|
|
40
|
+
} | {
|
|
41
|
+
readonly status: 'invalid';
|
|
42
|
+
};
|
|
43
|
+
export declare const isKeyframeClipboardFieldType: (value: unknown) => value is KeyframeClipboardFieldType;
|
|
44
|
+
export declare const parseKeyframeClipboardDataResult: (value: string) => KeyframeClipboardDataParseResult;
|
|
45
|
+
export declare const parseKeyframeClipboardData: (value: string) => KeyframeClipboardData | null;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseKeyframeClipboardData = exports.parseKeyframeClipboardDataResult = exports.isKeyframeClipboardFieldType = void 0;
|
|
4
|
+
const easing_clipboard_data_1 = require("./easing-clipboard-data");
|
|
5
|
+
// Keep this exhaustive so every new schema field requires an explicit clipboard
|
|
6
|
+
// compatibility decision.
|
|
7
|
+
const KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT = {
|
|
8
|
+
array: false,
|
|
9
|
+
asset: false,
|
|
10
|
+
boolean: false,
|
|
11
|
+
color: true,
|
|
12
|
+
enum: false,
|
|
13
|
+
'font-family': false,
|
|
14
|
+
hidden: false,
|
|
15
|
+
number: true,
|
|
16
|
+
'rotation-css': true,
|
|
17
|
+
'rotation-degrees': true,
|
|
18
|
+
scale: true,
|
|
19
|
+
'text-content': false,
|
|
20
|
+
'transform-origin': true,
|
|
21
|
+
translate: true,
|
|
22
|
+
'uv-coordinate': true,
|
|
23
|
+
};
|
|
24
|
+
const isRecord = (value) => {
|
|
25
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
26
|
+
};
|
|
27
|
+
const isKeyframeClipboardFieldType = (value) => {
|
|
28
|
+
return (typeof value === 'string' &&
|
|
29
|
+
Object.hasOwn(KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT, value) &&
|
|
30
|
+
KEYFRAME_CLIPBOARD_FIELD_TYPE_SUPPORT[value]);
|
|
31
|
+
};
|
|
32
|
+
exports.isKeyframeClipboardFieldType = isKeyframeClipboardFieldType;
|
|
33
|
+
const isKeyframeClipboardEntry = (value) => {
|
|
34
|
+
return (isRecord(value) &&
|
|
35
|
+
Number.isInteger(value.frameOffset) &&
|
|
36
|
+
Object.hasOwn(value, 'value'));
|
|
37
|
+
};
|
|
38
|
+
const areValidKeyframes = (value) => {
|
|
39
|
+
var _a;
|
|
40
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
let previousOffset = -1;
|
|
44
|
+
for (const keyframe of value) {
|
|
45
|
+
if (!isKeyframeClipboardEntry(keyframe) ||
|
|
46
|
+
keyframe.frameOffset <= previousOffset) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
previousOffset = keyframe.frameOffset;
|
|
50
|
+
}
|
|
51
|
+
return ((_a = value[0]) === null || _a === void 0 ? void 0 : _a.frameOffset) === 0;
|
|
52
|
+
};
|
|
53
|
+
const parseEasings = ({ value, keyframeCount, }) => {
|
|
54
|
+
if (Array.isArray(value) &&
|
|
55
|
+
value.length === Math.max(0, keyframeCount - 1) &&
|
|
56
|
+
value.every(easing_clipboard_data_1.isKeyframeEasing)) {
|
|
57
|
+
return value.map(easing_clipboard_data_1.normalizeKeyframeEasing);
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
};
|
|
61
|
+
const parseKeyframeClipboardDataResult = (value) => {
|
|
62
|
+
try {
|
|
63
|
+
const parsed = JSON.parse(value);
|
|
64
|
+
if (!isRecord(parsed) || parsed.remotionClipboard !== 'keyframe') {
|
|
65
|
+
return { status: 'invalid' };
|
|
66
|
+
}
|
|
67
|
+
if (parsed.version !== 1) {
|
|
68
|
+
return { status: 'unsupported-version', version: parsed.version };
|
|
69
|
+
}
|
|
70
|
+
const easing = parseEasings({
|
|
71
|
+
value: parsed.easing,
|
|
72
|
+
keyframeCount: Array.isArray(parsed.keyframes)
|
|
73
|
+
? parsed.keyframes.length
|
|
74
|
+
: 0,
|
|
75
|
+
});
|
|
76
|
+
if (parsed.type !== 'keyframe' ||
|
|
77
|
+
!areValidKeyframes(parsed.keyframes) ||
|
|
78
|
+
easing === null ||
|
|
79
|
+
(parsed.fieldType !== null &&
|
|
80
|
+
!(0, exports.isKeyframeClipboardFieldType)(parsed.fieldType))) {
|
|
81
|
+
return { status: 'invalid' };
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
status: 'valid',
|
|
85
|
+
data: {
|
|
86
|
+
type: 'keyframe',
|
|
87
|
+
version: 1,
|
|
88
|
+
remotionClipboard: 'keyframe',
|
|
89
|
+
fieldType: parsed.fieldType,
|
|
90
|
+
keyframes: parsed.keyframes,
|
|
91
|
+
easing,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (_a) {
|
|
96
|
+
return { status: 'invalid' };
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
exports.parseKeyframeClipboardDataResult = parseKeyframeClipboardDataResult;
|
|
100
|
+
const parseKeyframeClipboardData = (value) => {
|
|
101
|
+
const result = (0, exports.parseKeyframeClipboardDataResult)(value);
|
|
102
|
+
return result.status === 'valid' ? result.data : null;
|
|
103
|
+
};
|
|
104
|
+
exports.parseKeyframeClipboardData = parseKeyframeClipboardData;
|
|
@@ -2,6 +2,7 @@ import type { InteractivitySchemaField, InteractivitySchema } from 'remotion';
|
|
|
2
2
|
export declare const keyframeInterpolationFunctions: readonly ["interpolate", "interpolateColors"];
|
|
3
3
|
export type KeyframeInterpolationFunction = (typeof keyframeInterpolationFunctions)[number];
|
|
4
4
|
export declare const isKeyframeInterpolationFunction: (name: string) => name is "interpolate" | "interpolateColors";
|
|
5
|
+
export declare const canEditEasingForInterpolationFunction: (interpolationFunction: string) => boolean;
|
|
5
6
|
export declare const isInteractivitySchemaFieldKeyframable: (field: InteractivitySchemaField | undefined) => boolean;
|
|
6
7
|
export declare const isSchemaFieldKeyframable: ({ schema, key, }: {
|
|
7
8
|
schema: InteractivitySchema | null;
|
|
@@ -1,26 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getKeyframeInterpolationFunction = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldKeyframable = exports.isInteractivitySchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = exports.keyframeInterpolationFunctions = void 0;
|
|
3
|
+
exports.getKeyframeInterpolationFunction = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldKeyframable = exports.isInteractivitySchemaFieldKeyframable = exports.canEditEasingForInterpolationFunction = exports.isKeyframeInterpolationFunction = exports.keyframeInterpolationFunctions = void 0;
|
|
4
4
|
exports.keyframeInterpolationFunctions = [
|
|
5
5
|
'interpolate',
|
|
6
6
|
'interpolateColors',
|
|
7
7
|
];
|
|
8
|
+
// Keep these tables exhaustive so every schema field requires explicit
|
|
9
|
+
// keyframe and interpolation decisions.
|
|
10
|
+
const KEYFRAME_FIELD_TYPE_SUPPORT = {
|
|
11
|
+
array: false,
|
|
12
|
+
asset: false,
|
|
13
|
+
boolean: false,
|
|
14
|
+
color: true,
|
|
15
|
+
enum: false,
|
|
16
|
+
'font-family': false,
|
|
17
|
+
hidden: true,
|
|
18
|
+
number: true,
|
|
19
|
+
'rotation-css': true,
|
|
20
|
+
'rotation-degrees': true,
|
|
21
|
+
scale: true,
|
|
22
|
+
'text-content': false,
|
|
23
|
+
'transform-origin': true,
|
|
24
|
+
translate: true,
|
|
25
|
+
'uv-coordinate': true,
|
|
26
|
+
};
|
|
27
|
+
const KEYFRAME_FIELD_TYPE_INTERPOLATION = {
|
|
28
|
+
array: 'unsupported',
|
|
29
|
+
asset: 'unsupported',
|
|
30
|
+
boolean: 'unsupported',
|
|
31
|
+
color: 'interpolateColors',
|
|
32
|
+
enum: 'unsupported',
|
|
33
|
+
'font-family': 'unsupported',
|
|
34
|
+
hidden: 'infer',
|
|
35
|
+
number: 'infer',
|
|
36
|
+
'rotation-css': 'interpolate',
|
|
37
|
+
'rotation-degrees': 'infer',
|
|
38
|
+
scale: 'interpolate',
|
|
39
|
+
'text-content': 'unsupported',
|
|
40
|
+
'transform-origin': 'interpolate',
|
|
41
|
+
translate: 'interpolate',
|
|
42
|
+
'uv-coordinate': 'infer',
|
|
43
|
+
};
|
|
44
|
+
const KEYFRAME_INTERPOLATION_EASING_SUPPORT = {
|
|
45
|
+
interpolate: true,
|
|
46
|
+
interpolateColors: true,
|
|
47
|
+
};
|
|
8
48
|
const isKeyframeInterpolationFunction = (name) => {
|
|
9
49
|
return exports.keyframeInterpolationFunctions.includes(name);
|
|
10
50
|
};
|
|
11
51
|
exports.isKeyframeInterpolationFunction = isKeyframeInterpolationFunction;
|
|
52
|
+
const canEditEasingForInterpolationFunction = (interpolationFunction) => (0, exports.isKeyframeInterpolationFunction)(interpolationFunction) &&
|
|
53
|
+
KEYFRAME_INTERPOLATION_EASING_SUPPORT[interpolationFunction];
|
|
54
|
+
exports.canEditEasingForInterpolationFunction = canEditEasingForInterpolationFunction;
|
|
12
55
|
const isInteractivitySchemaFieldKeyframable = (field) => {
|
|
13
56
|
if (!field) {
|
|
14
57
|
return true;
|
|
15
58
|
}
|
|
16
|
-
|
|
17
|
-
field.type === 'boolean' ||
|
|
18
|
-
field.type === 'enum' ||
|
|
19
|
-
field.type === 'font-family' ||
|
|
20
|
-
field.type === 'asset') {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return field.keyframable !== false;
|
|
59
|
+
return KEYFRAME_FIELD_TYPE_SUPPORT[field.type] && field.keyframable !== false;
|
|
24
60
|
};
|
|
25
61
|
exports.isInteractivitySchemaFieldKeyframable = isInteractivitySchemaFieldKeyframable;
|
|
26
62
|
const findFieldInSchema = (schema, key) => {
|
|
@@ -47,16 +83,11 @@ const isSchemaFieldKeyframable = ({ schema, key, }) => {
|
|
|
47
83
|
exports.isSchemaFieldKeyframable = isSchemaFieldKeyframable;
|
|
48
84
|
const getKeyframeInterpolationFunctionForSchemaField = ({ schema, key, }) => {
|
|
49
85
|
const field = schema ? findFieldInSchema(schema, key) : undefined;
|
|
50
|
-
if (
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
if ((field === null || field === void 0 ? void 0 : field.type) === 'scale' ||
|
|
54
|
-
(field === null || field === void 0 ? void 0 : field.type) === 'translate' ||
|
|
55
|
-
(field === null || field === void 0 ? void 0 : field.type) === 'transform-origin' ||
|
|
56
|
-
(field === null || field === void 0 ? void 0 : field.type) === 'rotation-css') {
|
|
57
|
-
return 'interpolate';
|
|
86
|
+
if (!field) {
|
|
87
|
+
return null;
|
|
58
88
|
}
|
|
59
|
-
|
|
89
|
+
const strategy = KEYFRAME_FIELD_TYPE_INTERPOLATION[field.type];
|
|
90
|
+
return strategy === 'infer' || strategy === 'unsupported' ? null : strategy;
|
|
60
91
|
};
|
|
61
92
|
exports.getKeyframeInterpolationFunctionForSchemaField = getKeyframeInterpolationFunctionForSchemaField;
|
|
62
93
|
const getKeyframeInterpolationFunction = ({ schema, key, staticValue, newValue, }) => {
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { type CanUpdateSequencePropsResponse } from 'remotion';
|
|
2
|
-
export declare const optimisticDeleteSequenceKeyframe: ({ previous, fieldKey, frame, }: {
|
|
2
|
+
export declare const optimisticDeleteSequenceKeyframe: ({ previous, fieldKey, frame, valueWhenLastKeyframeDeleted, }: {
|
|
3
3
|
previous: CanUpdateSequencePropsResponse;
|
|
4
4
|
fieldKey: string;
|
|
5
5
|
frame: number;
|
|
6
|
+
valueWhenLastKeyframeDeleted?: unknown;
|
|
6
7
|
}) => CanUpdateSequencePropsResponse;
|
|
7
8
|
export declare const optimisticDeleteSequenceKeyframes: ({ previous, keyframes, }: {
|
|
8
9
|
previous: CanUpdateSequencePropsResponse;
|
|
9
10
|
keyframes: {
|
|
10
11
|
fieldKey: string;
|
|
11
12
|
frame: number;
|
|
13
|
+
valueWhenLastKeyframeDeleted?: unknown;
|
|
12
14
|
}[];
|
|
13
15
|
}) => CanUpdateSequencePropsResponse;
|
|
14
|
-
export declare const optimisticDeleteEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, }: {
|
|
16
|
+
export declare const optimisticDeleteEffectKeyframe: ({ previous, effectIndex, fieldKey, frame, valueWhenLastKeyframeDeleted, }: {
|
|
15
17
|
previous: CanUpdateSequencePropsResponse;
|
|
16
18
|
effectIndex: number;
|
|
17
19
|
fieldKey: string;
|
|
18
20
|
frame: number;
|
|
21
|
+
valueWhenLastKeyframeDeleted?: unknown;
|
|
19
22
|
}) => CanUpdateSequencePropsResponse;
|
|
20
23
|
export declare const optimisticDeleteEffectKeyframes: ({ previous, keyframes, }: {
|
|
21
24
|
previous: CanUpdateSequencePropsResponse;
|
|
@@ -23,5 +26,6 @@ export declare const optimisticDeleteEffectKeyframes: ({ previous, keyframes, }:
|
|
|
23
26
|
effectIndex: number;
|
|
24
27
|
fieldKey: string;
|
|
25
28
|
frame: number;
|
|
29
|
+
valueWhenLastKeyframeDeleted?: unknown;
|
|
26
30
|
}[];
|
|
27
31
|
}) => CanUpdateSequencePropsResponse;
|
|
@@ -10,7 +10,7 @@ const getEasingIndexToRemove = ({ removedKeyframeIndex, keyframeCountBeforeRemov
|
|
|
10
10
|
}
|
|
11
11
|
return removedKeyframeIndex;
|
|
12
12
|
};
|
|
13
|
-
const removeKeyframeFromPropStatus = ({ status, frame, }) => {
|
|
13
|
+
const removeKeyframeFromPropStatus = ({ status, frame, valueWhenLastKeyframeDeleted, }) => {
|
|
14
14
|
if (status.status !== 'keyframed') {
|
|
15
15
|
return status;
|
|
16
16
|
}
|
|
@@ -22,7 +22,9 @@ const removeKeyframeFromPropStatus = ({ status, frame, }) => {
|
|
|
22
22
|
if (keyframes.length === 0) {
|
|
23
23
|
return {
|
|
24
24
|
status: 'static',
|
|
25
|
-
codeValue:
|
|
25
|
+
codeValue: valueWhenLastKeyframeDeleted === null
|
|
26
|
+
? status.keyframes[index].value
|
|
27
|
+
: valueWhenLastKeyframeDeleted,
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
// Easing holds one segment per gap between consecutive keyframes
|
|
@@ -42,7 +44,7 @@ const removeKeyframeFromPropStatus = ({ status, frame, }) => {
|
|
|
42
44
|
easing,
|
|
43
45
|
};
|
|
44
46
|
};
|
|
45
|
-
const optimisticDeleteSequenceKeyframe = ({ previous, fieldKey, frame, }) => {
|
|
47
|
+
const optimisticDeleteSequenceKeyframe = ({ previous, fieldKey, frame, valueWhenLastKeyframeDeleted, }) => {
|
|
46
48
|
if (!previous.canUpdate) {
|
|
47
49
|
return previous;
|
|
48
50
|
}
|
|
@@ -54,7 +56,11 @@ const optimisticDeleteSequenceKeyframe = ({ previous, fieldKey, frame, }) => {
|
|
|
54
56
|
...previous,
|
|
55
57
|
props: {
|
|
56
58
|
...previous.props,
|
|
57
|
-
[fieldKey]: removeKeyframeFromPropStatus({
|
|
59
|
+
[fieldKey]: removeKeyframeFromPropStatus({
|
|
60
|
+
status,
|
|
61
|
+
frame,
|
|
62
|
+
valueWhenLastKeyframeDeleted: valueWhenLastKeyframeDeleted !== null && valueWhenLastKeyframeDeleted !== void 0 ? valueWhenLastKeyframeDeleted : null,
|
|
63
|
+
}),
|
|
58
64
|
},
|
|
59
65
|
};
|
|
60
66
|
};
|
|
@@ -64,10 +70,11 @@ const optimisticDeleteSequenceKeyframes = ({ previous, keyframes, }) => {
|
|
|
64
70
|
previous: current,
|
|
65
71
|
fieldKey: keyframe.fieldKey,
|
|
66
72
|
frame: keyframe.frame,
|
|
73
|
+
valueWhenLastKeyframeDeleted: keyframe.valueWhenLastKeyframeDeleted,
|
|
67
74
|
}), previous);
|
|
68
75
|
};
|
|
69
76
|
exports.optimisticDeleteSequenceKeyframes = optimisticDeleteSequenceKeyframes;
|
|
70
|
-
const optimisticDeleteEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, }) => {
|
|
77
|
+
const optimisticDeleteEffectKeyframe = ({ previous, effectIndex, fieldKey, frame, valueWhenLastKeyframeDeleted, }) => {
|
|
71
78
|
if (!previous.canUpdate) {
|
|
72
79
|
return previous;
|
|
73
80
|
}
|
|
@@ -87,7 +94,11 @@ const optimisticDeleteEffectKeyframe = ({ previous, effectIndex, fieldKey, frame
|
|
|
87
94
|
...target,
|
|
88
95
|
props: {
|
|
89
96
|
...target.props,
|
|
90
|
-
[fieldKey]: removeKeyframeFromPropStatus({
|
|
97
|
+
[fieldKey]: removeKeyframeFromPropStatus({
|
|
98
|
+
status,
|
|
99
|
+
frame,
|
|
100
|
+
valueWhenLastKeyframeDeleted: valueWhenLastKeyframeDeleted !== null && valueWhenLastKeyframeDeleted !== void 0 ? valueWhenLastKeyframeDeleted : null,
|
|
101
|
+
}),
|
|
91
102
|
},
|
|
92
103
|
};
|
|
93
104
|
const effects = [...previous.effects];
|
|
@@ -104,6 +115,7 @@ const optimisticDeleteEffectKeyframes = ({ previous, keyframes, }) => {
|
|
|
104
115
|
effectIndex: keyframe.effectIndex,
|
|
105
116
|
fieldKey: keyframe.fieldKey,
|
|
106
117
|
frame: keyframe.frame,
|
|
118
|
+
valueWhenLastKeyframeDeleted: keyframe.valueWhenLastKeyframeDeleted,
|
|
107
119
|
}), previous);
|
|
108
120
|
};
|
|
109
121
|
exports.optimisticDeleteEffectKeyframes = optimisticDeleteEffectKeyframes;
|
|
@@ -37,8 +37,27 @@ export declare const SCHEMA_FIELD_GROUPS: readonly [{
|
|
|
37
37
|
readonly label: "Text";
|
|
38
38
|
}];
|
|
39
39
|
export declare const getSchemaFieldGroup: (key: string) => SchemaFieldGroup;
|
|
40
|
-
declare const
|
|
41
|
-
|
|
40
|
+
declare const TIMELINE_SCHEMA_FIELD_TYPE_SUPPORT: {
|
|
41
|
+
readonly array: true;
|
|
42
|
+
readonly asset: true;
|
|
43
|
+
readonly boolean: true;
|
|
44
|
+
readonly color: true;
|
|
45
|
+
readonly enum: true;
|
|
46
|
+
readonly 'font-family': true;
|
|
47
|
+
readonly hidden: false;
|
|
48
|
+
readonly number: true;
|
|
49
|
+
readonly 'rotation-css': true;
|
|
50
|
+
readonly 'rotation-degrees': true;
|
|
51
|
+
readonly scale: true;
|
|
52
|
+
readonly 'text-content': true;
|
|
53
|
+
readonly 'transform-origin': true;
|
|
54
|
+
readonly translate: true;
|
|
55
|
+
readonly 'uv-coordinate': true;
|
|
56
|
+
};
|
|
57
|
+
type TimelineSchemaFieldTypeSupport = typeof TIMELINE_SCHEMA_FIELD_TYPE_SUPPORT;
|
|
58
|
+
type SupportedSchemaType = {
|
|
59
|
+
[FieldType in keyof TimelineSchemaFieldTypeSupport]: TimelineSchemaFieldTypeSupport[FieldType] extends true ? FieldType : never;
|
|
60
|
+
}[keyof TimelineSchemaFieldTypeSupport];
|
|
42
61
|
export declare const getFieldsToShow: ({ getDragOverrides, propStatuses, nodePath, schema, currentRuntimeValueDotNotation, includeTextContent, }: {
|
|
43
62
|
schema: InteractivitySchema;
|
|
44
63
|
currentRuntimeValueDotNotation: Record<string, unknown>;
|
|
@@ -55,23 +55,26 @@ const sortSchemaFields = (fields) => {
|
|
|
55
55
|
})
|
|
56
56
|
.map(({ field }) => field);
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
'
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
|
|
58
|
+
// Keep this exhaustive so every schema field requires an explicit timeline UI
|
|
59
|
+
// support decision.
|
|
60
|
+
const TIMELINE_SCHEMA_FIELD_TYPE_SUPPORT = {
|
|
61
|
+
array: true,
|
|
62
|
+
asset: true,
|
|
63
|
+
boolean: true,
|
|
64
|
+
color: true,
|
|
65
|
+
enum: true,
|
|
66
|
+
'font-family': true,
|
|
67
|
+
hidden: false,
|
|
68
|
+
number: true,
|
|
69
|
+
'rotation-css': true,
|
|
70
|
+
'rotation-degrees': true,
|
|
71
|
+
scale: true,
|
|
72
|
+
'text-content': true,
|
|
73
|
+
'transform-origin': true,
|
|
74
|
+
translate: true,
|
|
75
|
+
'uv-coordinate': true,
|
|
76
|
+
};
|
|
77
|
+
const isTimelineSchemaFieldSupported = (field) => TIMELINE_SCHEMA_FIELD_TYPE_SUPPORT[field.type];
|
|
75
78
|
const getArrayRowCount = ({ fieldSchema, value, }) => {
|
|
76
79
|
var _a, _b;
|
|
77
80
|
const items = Array.isArray(value)
|
|
@@ -116,13 +119,10 @@ const getFieldsToShow = ({ getDragOverrides, propStatuses, nodePath, schema, cur
|
|
|
116
119
|
const activeSchema = remotion_1.Internals.flattenActiveSchema(schema, (key) => valuesDotNotation[key]);
|
|
117
120
|
const fields = Object.entries(activeSchema)
|
|
118
121
|
.map(([key, fieldSchema]) => {
|
|
119
|
-
|
|
120
|
-
if (SUPPORTED_SCHEMA_TYPES.indexOf(typeName) === -1) {
|
|
121
|
-
throw new Error(`Unsupported field type: ${typeName}`);
|
|
122
|
-
}
|
|
123
|
-
if (typeName === 'hidden') {
|
|
122
|
+
if (!isTimelineSchemaFieldSupported(fieldSchema)) {
|
|
124
123
|
return null;
|
|
125
124
|
}
|
|
125
|
+
const typeName = fieldSchema.type;
|
|
126
126
|
if (fieldSchema.type === 'number' && fieldSchema.hiddenFromList) {
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
@@ -165,10 +165,10 @@ const getEffectFieldsToShow = ({ effect, effectIndex, nodePath, propStatuses, ge
|
|
|
165
165
|
});
|
|
166
166
|
const fields = Object.entries(activeSchema)
|
|
167
167
|
.map(([key, fieldSchema]) => {
|
|
168
|
-
|
|
169
|
-
if (typeName === 'hidden') {
|
|
168
|
+
if (!isTimelineSchemaFieldSupported(fieldSchema)) {
|
|
170
169
|
return null;
|
|
171
170
|
}
|
|
171
|
+
const typeName = fieldSchema.type;
|
|
172
172
|
if (fieldSchema.type === 'number' && fieldSchema.hiddenFromList) {
|
|
173
173
|
return null;
|
|
174
174
|
}
|
|
@@ -177,9 +177,6 @@ const getEffectFieldsToShow = ({ effect, effectIndex, nodePath, propStatuses, ge
|
|
|
177
177
|
if (key === 'disabled') {
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
|
-
if (SUPPORTED_SCHEMA_TYPES.indexOf(typeName) === -1) {
|
|
181
|
-
throw new Error(`Unsupported field type: ${typeName}`);
|
|
182
|
-
}
|
|
183
180
|
return {
|
|
184
181
|
kind: 'effect-field',
|
|
185
182
|
key,
|
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.494",
|
|
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.494"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.494",
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.494",
|
|
28
28
|
"eslint": "9.19.0",
|
|
29
29
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
30
30
|
},
|