@remotion/studio-shared 4.0.473 → 4.0.474
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 +8 -0
- package/dist/component-drag-data.d.ts +27 -0
- package/dist/component-drag-data.js +101 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +18 -6
- package/dist/optimistic-add-keyframe.js +0 -1
- package/dist/optimistic-update-for-effect-prop-statuses.d.ts +8 -0
- package/dist/optimistic-update-for-effect-prop-statuses.js +43 -0
- package/dist/optimistic-update-for-prop-statuses.d.ts +7 -0
- package/dist/optimistic-update-for-prop-statuses.js +30 -0
- package/dist/required-package.d.ts +1 -0
- package/dist/required-package.js +16 -1
- package/dist/schema-field-info.d.ts +6 -6
- package/dist/schema-field-info.js +5 -5
- package/dist/sfx-drag-data.d.ts +10 -0
- package/dist/sfx-drag-data.js +41 -0
- package/dist/url.d.ts +1 -0
- package/dist/url.js +13 -0
- package/package.json +4 -4
package/dist/api-requests.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat,
|
|
|
2
2
|
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
|
3
3
|
import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
4
4
|
import type { RecastCodemod, VisualControlChange } from './codemods';
|
|
5
|
+
import type { ComponentProp } from './component-drag-data';
|
|
5
6
|
import type { EffectClipboardParam, EffectClipboardPasteType, EffectClipboardSnapshot } from './effect-clipboard-data';
|
|
6
7
|
import type { PackageManager } from './package-manager';
|
|
7
8
|
import type { ProjectInfo } from './project-info';
|
|
@@ -460,10 +461,17 @@ export type InsertableCompositionElement = {
|
|
|
460
461
|
type: 'solid';
|
|
461
462
|
width: number;
|
|
462
463
|
height: number;
|
|
464
|
+
} | {
|
|
465
|
+
type: 'component';
|
|
466
|
+
componentName: string;
|
|
467
|
+
importName: string;
|
|
468
|
+
importPath: string;
|
|
469
|
+
props: ComponentProp[];
|
|
463
470
|
} | {
|
|
464
471
|
type: 'asset';
|
|
465
472
|
assetType: 'image' | 'video' | 'gif' | 'audio';
|
|
466
473
|
src: string;
|
|
474
|
+
srcType: 'static' | 'remote';
|
|
467
475
|
dimensions: {
|
|
468
476
|
width: number;
|
|
469
477
|
height: number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const COMPONENT_DRAG_MIME_TYPE = "application/vnd.remotion.component+json";
|
|
2
|
+
export type ComponentProp = {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string | number | boolean;
|
|
5
|
+
};
|
|
6
|
+
export type ComponentDragData = {
|
|
7
|
+
type: 'remotion-component';
|
|
8
|
+
version: 1;
|
|
9
|
+
component: {
|
|
10
|
+
componentName: string;
|
|
11
|
+
importName: string;
|
|
12
|
+
importPath: string;
|
|
13
|
+
props: ComponentProp[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const isComponentIdentifier: (value: unknown) => value is string;
|
|
17
|
+
export declare const isComponentImportPath: (value: unknown) => value is string;
|
|
18
|
+
export declare const isComponentPropName: (value: unknown) => value is string;
|
|
19
|
+
export declare const isComponentProp: (value: unknown) => value is ComponentProp;
|
|
20
|
+
export declare const areComponentProps: (value: unknown) => value is ComponentProp[];
|
|
21
|
+
export declare const makeComponentDragData: ({ componentName, importName, importPath, props, }: {
|
|
22
|
+
componentName: string;
|
|
23
|
+
importName: string;
|
|
24
|
+
importPath: string;
|
|
25
|
+
props: ComponentProp[];
|
|
26
|
+
}) => ComponentDragData;
|
|
27
|
+
export declare const parseComponentDragData: (value: string) => ComponentDragData | null;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseComponentDragData = exports.makeComponentDragData = exports.areComponentProps = exports.isComponentProp = exports.isComponentPropName = exports.isComponentImportPath = exports.isComponentIdentifier = exports.COMPONENT_DRAG_MIME_TYPE = void 0;
|
|
4
|
+
exports.COMPONENT_DRAG_MIME_TYPE = 'application/vnd.remotion.component+json';
|
|
5
|
+
const isRecord = (value) => {
|
|
6
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
};
|
|
8
|
+
const isComponentIdentifier = (value) => {
|
|
9
|
+
return typeof value === 'string' && /^[A-Z_$][A-Za-z0-9_$]*$/.test(value);
|
|
10
|
+
};
|
|
11
|
+
exports.isComponentIdentifier = isComponentIdentifier;
|
|
12
|
+
const isComponentImportPath = (value) => {
|
|
13
|
+
return (typeof value === 'string' &&
|
|
14
|
+
value.length > 0 &&
|
|
15
|
+
value.length < 200 &&
|
|
16
|
+
!value.includes('\\') &&
|
|
17
|
+
!value.includes('\0') &&
|
|
18
|
+
!value.startsWith('/') &&
|
|
19
|
+
/^[A-Za-z0-9@._/-]+$/.test(value));
|
|
20
|
+
};
|
|
21
|
+
exports.isComponentImportPath = isComponentImportPath;
|
|
22
|
+
const isComponentPropName = (value) => {
|
|
23
|
+
return (typeof value === 'string' &&
|
|
24
|
+
value !== 'style' &&
|
|
25
|
+
/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value));
|
|
26
|
+
};
|
|
27
|
+
exports.isComponentPropName = isComponentPropName;
|
|
28
|
+
const isComponentProp = (value) => {
|
|
29
|
+
if (!isRecord(value)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (!(0, exports.isComponentPropName)(value.name)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return (typeof value.value === 'string' ||
|
|
36
|
+
typeof value.value === 'boolean' ||
|
|
37
|
+
(typeof value.value === 'number' && Number.isFinite(value.value)));
|
|
38
|
+
};
|
|
39
|
+
exports.isComponentProp = isComponentProp;
|
|
40
|
+
const areComponentProps = (value) => {
|
|
41
|
+
if (!Array.isArray(value)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
const seen = new Set();
|
|
45
|
+
for (const prop of value) {
|
|
46
|
+
if (!(0, exports.isComponentProp)(prop) || seen.has(prop.name)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
seen.add(prop.name);
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
exports.areComponentProps = areComponentProps;
|
|
54
|
+
const makeComponentDragData = ({ componentName, importName, importPath, props, }) => {
|
|
55
|
+
return {
|
|
56
|
+
type: 'remotion-component',
|
|
57
|
+
version: 1,
|
|
58
|
+
component: {
|
|
59
|
+
componentName,
|
|
60
|
+
importName,
|
|
61
|
+
importPath,
|
|
62
|
+
props,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.makeComponentDragData = makeComponentDragData;
|
|
67
|
+
const parseComponentDragData = (value) => {
|
|
68
|
+
try {
|
|
69
|
+
const parsed = JSON.parse(value);
|
|
70
|
+
if (!isRecord(parsed)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (parsed.type !== 'remotion-component' || parsed.version !== 1) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (!isRecord(parsed.component)) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const { componentName, importName, importPath, props } = parsed.component;
|
|
80
|
+
if (!(0, exports.isComponentIdentifier)(componentName) ||
|
|
81
|
+
!(0, exports.isComponentIdentifier)(importName) ||
|
|
82
|
+
!(0, exports.isComponentImportPath)(importPath) ||
|
|
83
|
+
!(0, exports.areComponentProps)(props)) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
type: 'remotion-component',
|
|
88
|
+
version: 1,
|
|
89
|
+
component: {
|
|
90
|
+
componentName,
|
|
91
|
+
importName,
|
|
92
|
+
importPath,
|
|
93
|
+
props,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
catch (_a) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.parseComponentDragData = parseComponentDragData;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { splitAnsi, stripAnsi } from './ansi';
|
|
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,
|
|
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, 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, } 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
|
+
export { COMPONENT_DRAG_MIME_TYPE, areComponentProps, isComponentIdentifier, isComponentImportPath, makeComponentDragData, parseComponentDragData, type ComponentDragData, type ComponentProp, } from './component-drag-data';
|
|
5
6
|
export { DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS } from './default-buffer-state-delay-in-milliseconds';
|
|
6
7
|
export { detectFileType, isImageFileType, type FileDimensions, type FileType, type ImageFileType, } from './detect-file-type';
|
|
7
8
|
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';
|
|
@@ -24,14 +25,16 @@ export { AggregateRenderProgress, ArtifactProgress, BrowserDownloadState, Browse
|
|
|
24
25
|
export type { CompletedClientRender } from './render-job';
|
|
25
26
|
export { getRequiredPackageForEffectImportPath, getRequiredPackageForInsertableElement, } from './required-package';
|
|
26
27
|
export { SCHEMA_FIELD_ROW_HEIGHT, getEffectFieldsToShow, getFieldsToShow, } from './schema-field-info';
|
|
27
|
-
export type { AnySchemaFieldInfo,
|
|
28
|
+
export type { AnySchemaFieldInfo, DragOverrides, EffectSchemaFieldInfo, PropStatuses, SchemaFieldInfo, SequenceControls, SequenceSchemaFieldInfo, } from './schema-field-info';
|
|
29
|
+
export { SFX_DRAG_MIME_TYPE, parseSfxDragData, type SfxDragData, } from './sfx-drag-data';
|
|
28
30
|
export { ScriptLine, SomeStackFrame, StackFrame, SymbolicatedStackFrame, } from './stack-types';
|
|
29
31
|
export { EnumPath, stringifyDefaultProps } from './stringify-default-props';
|
|
30
32
|
export type { VisualControlChange } from './codemods';
|
|
31
33
|
export { optimisticAddEffectKeyframe, optimisticAddSequenceKeyframe, } from './optimistic-add-keyframe';
|
|
32
34
|
export { optimisticDeleteEffectKeyframe, optimisticDeleteEffectKeyframes, optimisticDeleteSequenceKeyframe, optimisticDeleteSequenceKeyframes, } from './optimistic-delete-keyframe';
|
|
33
35
|
export { canMoveKeyframesWithoutCollisions, optimisticMoveEffectKeyframes, optimisticMoveSequenceKeyframes, type OptimisticKeyframeMove, } from './optimistic-move-keyframe';
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
+
export { optimisticUpdateForEffectPropStatuses } from './optimistic-update-for-effect-prop-statuses';
|
|
37
|
+
export { optimisticUpdateForPropStatuses } from './optimistic-update-for-prop-statuses';
|
|
36
38
|
export { optimisticUpdateEffectKeyframeSettings, optimisticUpdateSequenceKeyframeSettings, } from './optimistic-update-keyframe-settings';
|
|
37
39
|
export { stringifySequenceExpandedRowKey, stringifySequenceSubscriptionKey, } from './stringify-sequence-subscription-key';
|
|
40
|
+
export { isUrl } from './url';
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,8 @@ 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.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = void 0;
|
|
17
|
+
exports.optimisticDeleteEffectKeyframes = 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.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 = 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; } });
|
|
@@ -24,6 +24,13 @@ const asset_drag_data_1 = require("./asset-drag-data");
|
|
|
24
24
|
Object.defineProperty(exports, "ASSET_DRAG_MIME_TYPE", { enumerable: true, get: function () { return asset_drag_data_1.ASSET_DRAG_MIME_TYPE; } });
|
|
25
25
|
Object.defineProperty(exports, "makeAssetDragData", { enumerable: true, get: function () { return asset_drag_data_1.makeAssetDragData; } });
|
|
26
26
|
Object.defineProperty(exports, "parseAssetDragData", { enumerable: true, get: function () { return asset_drag_data_1.parseAssetDragData; } });
|
|
27
|
+
const component_drag_data_1 = require("./component-drag-data");
|
|
28
|
+
Object.defineProperty(exports, "COMPONENT_DRAG_MIME_TYPE", { enumerable: true, get: function () { return component_drag_data_1.COMPONENT_DRAG_MIME_TYPE; } });
|
|
29
|
+
Object.defineProperty(exports, "areComponentProps", { enumerable: true, get: function () { return component_drag_data_1.areComponentProps; } });
|
|
30
|
+
Object.defineProperty(exports, "isComponentIdentifier", { enumerable: true, get: function () { return component_drag_data_1.isComponentIdentifier; } });
|
|
31
|
+
Object.defineProperty(exports, "isComponentImportPath", { enumerable: true, get: function () { return component_drag_data_1.isComponentImportPath; } });
|
|
32
|
+
Object.defineProperty(exports, "makeComponentDragData", { enumerable: true, get: function () { return component_drag_data_1.makeComponentDragData; } });
|
|
33
|
+
Object.defineProperty(exports, "parseComponentDragData", { enumerable: true, get: function () { return component_drag_data_1.parseComponentDragData; } });
|
|
27
34
|
const default_buffer_state_delay_in_milliseconds_1 = require("./default-buffer-state-delay-in-milliseconds");
|
|
28
35
|
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
36
|
const detect_file_type_1 = require("./detect-file-type");
|
|
@@ -71,6 +78,9 @@ const schema_field_info_1 = require("./schema-field-info");
|
|
|
71
78
|
Object.defineProperty(exports, "SCHEMA_FIELD_ROW_HEIGHT", { enumerable: true, get: function () { return schema_field_info_1.SCHEMA_FIELD_ROW_HEIGHT; } });
|
|
72
79
|
Object.defineProperty(exports, "getEffectFieldsToShow", { enumerable: true, get: function () { return schema_field_info_1.getEffectFieldsToShow; } });
|
|
73
80
|
Object.defineProperty(exports, "getFieldsToShow", { enumerable: true, get: function () { return schema_field_info_1.getFieldsToShow; } });
|
|
81
|
+
const sfx_drag_data_1 = require("./sfx-drag-data");
|
|
82
|
+
Object.defineProperty(exports, "SFX_DRAG_MIME_TYPE", { enumerable: true, get: function () { return sfx_drag_data_1.SFX_DRAG_MIME_TYPE; } });
|
|
83
|
+
Object.defineProperty(exports, "parseSfxDragData", { enumerable: true, get: function () { return sfx_drag_data_1.parseSfxDragData; } });
|
|
74
84
|
const stringify_default_props_1 = require("./stringify-default-props");
|
|
75
85
|
Object.defineProperty(exports, "stringifyDefaultProps", { enumerable: true, get: function () { return stringify_default_props_1.stringifyDefaultProps; } });
|
|
76
86
|
const optimistic_add_keyframe_1 = require("./optimistic-add-keyframe");
|
|
@@ -85,13 +95,15 @@ const optimistic_move_keyframe_1 = require("./optimistic-move-keyframe");
|
|
|
85
95
|
Object.defineProperty(exports, "canMoveKeyframesWithoutCollisions", { enumerable: true, get: function () { return optimistic_move_keyframe_1.canMoveKeyframesWithoutCollisions; } });
|
|
86
96
|
Object.defineProperty(exports, "optimisticMoveEffectKeyframes", { enumerable: true, get: function () { return optimistic_move_keyframe_1.optimisticMoveEffectKeyframes; } });
|
|
87
97
|
Object.defineProperty(exports, "optimisticMoveSequenceKeyframes", { enumerable: true, get: function () { return optimistic_move_keyframe_1.optimisticMoveSequenceKeyframes; } });
|
|
88
|
-
const
|
|
89
|
-
Object.defineProperty(exports, "
|
|
90
|
-
const
|
|
91
|
-
Object.defineProperty(exports, "
|
|
98
|
+
const optimistic_update_for_effect_prop_statuses_1 = require("./optimistic-update-for-effect-prop-statuses");
|
|
99
|
+
Object.defineProperty(exports, "optimisticUpdateForEffectPropStatuses", { enumerable: true, get: function () { return optimistic_update_for_effect_prop_statuses_1.optimisticUpdateForEffectPropStatuses; } });
|
|
100
|
+
const optimistic_update_for_prop_statuses_1 = require("./optimistic-update-for-prop-statuses");
|
|
101
|
+
Object.defineProperty(exports, "optimisticUpdateForPropStatuses", { enumerable: true, get: function () { return optimistic_update_for_prop_statuses_1.optimisticUpdateForPropStatuses; } });
|
|
92
102
|
const optimistic_update_keyframe_settings_1 = require("./optimistic-update-keyframe-settings");
|
|
93
103
|
Object.defineProperty(exports, "optimisticUpdateEffectKeyframeSettings", { enumerable: true, get: function () { return optimistic_update_keyframe_settings_1.optimisticUpdateEffectKeyframeSettings; } });
|
|
94
104
|
Object.defineProperty(exports, "optimisticUpdateSequenceKeyframeSettings", { enumerable: true, get: function () { return optimistic_update_keyframe_settings_1.optimisticUpdateSequenceKeyframeSettings; } });
|
|
95
105
|
const stringify_sequence_subscription_key_1 = require("./stringify-sequence-subscription-key");
|
|
96
106
|
Object.defineProperty(exports, "stringifySequenceExpandedRowKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceExpandedRowKey; } });
|
|
97
107
|
Object.defineProperty(exports, "stringifySequenceSubscriptionKey", { enumerable: true, get: function () { return stringify_sequence_subscription_key_1.stringifySequenceSubscriptionKey; } });
|
|
108
|
+
const url_1 = require("./url");
|
|
109
|
+
Object.defineProperty(exports, "isUrl", { enumerable: true, get: function () { return url_1.isUrl; } });
|
|
@@ -28,7 +28,6 @@ const addKeyframeToPropStatus = ({ status, fieldKey, frame, value, schema, }) =>
|
|
|
28
28
|
const staticValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : value;
|
|
29
29
|
return {
|
|
30
30
|
status: 'keyframed',
|
|
31
|
-
codeValue: undefined,
|
|
32
31
|
interpolationFunction: (0, keyframe_interpolation_function_1.getKeyframeInterpolationFunction)({
|
|
33
32
|
schema,
|
|
34
33
|
key: fieldKey,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CanUpdateSequencePropsResponse, type SequenceSchema } from 'remotion';
|
|
2
|
+
export declare const optimisticUpdateForEffectPropStatuses: ({ previous, effectIndex, fieldKey, value, schema, }: {
|
|
3
|
+
previous: CanUpdateSequencePropsResponse;
|
|
4
|
+
effectIndex: number;
|
|
5
|
+
fieldKey: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
schema: SequenceSchema;
|
|
8
|
+
}) => CanUpdateSequencePropsResponse;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optimisticUpdateForEffectPropStatuses = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const optimisticUpdateForEffectPropStatuses = ({ previous, effectIndex, fieldKey, value, schema, }) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (!previous.canUpdate) {
|
|
8
|
+
return previous;
|
|
9
|
+
}
|
|
10
|
+
const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
|
|
11
|
+
if (targetIndex === -1) {
|
|
12
|
+
return previous;
|
|
13
|
+
}
|
|
14
|
+
const target = previous.effects[targetIndex];
|
|
15
|
+
if (!target.canUpdate) {
|
|
16
|
+
return previous;
|
|
17
|
+
}
|
|
18
|
+
const props = {
|
|
19
|
+
...target.props,
|
|
20
|
+
[fieldKey]: { status: 'static', codeValue: value },
|
|
21
|
+
};
|
|
22
|
+
if (((_a = schema[fieldKey]) === null || _a === void 0 ? void 0 : _a.type) === 'enum') {
|
|
23
|
+
const propsToDelete = no_react_1.NoReactInternals.findPropsToDelete({
|
|
24
|
+
schema,
|
|
25
|
+
key: fieldKey,
|
|
26
|
+
value,
|
|
27
|
+
});
|
|
28
|
+
for (const propToDelete of propsToDelete) {
|
|
29
|
+
delete props[propToDelete];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const updatedEffect = {
|
|
33
|
+
...target,
|
|
34
|
+
props,
|
|
35
|
+
};
|
|
36
|
+
const effects = [...previous.effects];
|
|
37
|
+
effects[targetIndex] = updatedEffect;
|
|
38
|
+
return {
|
|
39
|
+
...previous,
|
|
40
|
+
effects,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
exports.optimisticUpdateForEffectPropStatuses = optimisticUpdateForEffectPropStatuses;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CanUpdateSequencePropsResponse, type SequenceSchema } from 'remotion';
|
|
2
|
+
export declare const optimisticUpdateForPropStatuses: ({ previous, fieldKey, value, schema, }: {
|
|
3
|
+
previous: CanUpdateSequencePropsResponse;
|
|
4
|
+
fieldKey: string;
|
|
5
|
+
value: unknown;
|
|
6
|
+
schema: SequenceSchema;
|
|
7
|
+
}) => CanUpdateSequencePropsResponse;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optimisticUpdateForPropStatuses = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const optimisticUpdateForPropStatuses = ({ previous, fieldKey, value, schema, }) => {
|
|
6
|
+
var _a;
|
|
7
|
+
if (!previous.canUpdate) {
|
|
8
|
+
return previous;
|
|
9
|
+
}
|
|
10
|
+
const props = {
|
|
11
|
+
...previous.props,
|
|
12
|
+
[fieldKey]: { status: 'static', codeValue: value },
|
|
13
|
+
};
|
|
14
|
+
if (((_a = schema[fieldKey]) === null || _a === void 0 ? void 0 : _a.type) === 'enum') {
|
|
15
|
+
const propsToDelete = no_react_1.NoReactInternals.findPropsToDelete({
|
|
16
|
+
schema,
|
|
17
|
+
key: fieldKey,
|
|
18
|
+
value,
|
|
19
|
+
});
|
|
20
|
+
for (const propToDelete of propsToDelete) {
|
|
21
|
+
delete props[propToDelete];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
canUpdate: true,
|
|
26
|
+
props,
|
|
27
|
+
effects: previous.effects,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.optimisticUpdateForPropStatuses = optimisticUpdateForPropStatuses;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { InsertableCompositionElement } from './api-requests';
|
|
2
|
+
export declare const getRequiredPackageForImportPath: (importPath: string) => string | null;
|
|
2
3
|
export declare const getRequiredPackageForInsertableElement: (element: InsertableCompositionElement) => string | null;
|
|
3
4
|
export declare const getRequiredPackageForEffectImportPath: (importPath: string) => string | null;
|
package/dist/required-package.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRequiredPackageForEffectImportPath = exports.getRequiredPackageForInsertableElement = void 0;
|
|
3
|
+
exports.getRequiredPackageForEffectImportPath = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForImportPath = void 0;
|
|
4
|
+
const getRequiredPackageForImportPath = (importPath) => {
|
|
5
|
+
if (importPath === 'remotion' || importPath.startsWith('.')) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
if (importPath.startsWith('@')) {
|
|
9
|
+
const [scope, scopedPackageName] = importPath.split('/');
|
|
10
|
+
return scope && scopedPackageName ? `${scope}/${scopedPackageName}` : null;
|
|
11
|
+
}
|
|
12
|
+
const [packageName] = importPath.split('/');
|
|
13
|
+
return packageName || null;
|
|
14
|
+
};
|
|
15
|
+
exports.getRequiredPackageForImportPath = getRequiredPackageForImportPath;
|
|
4
16
|
const getRequiredPackageForInsertableElement = (element) => {
|
|
5
17
|
if (element.type === 'solid') {
|
|
6
18
|
return null;
|
|
7
19
|
}
|
|
20
|
+
if (element.type === 'component') {
|
|
21
|
+
return (0, exports.getRequiredPackageForImportPath)(element.importPath);
|
|
22
|
+
}
|
|
8
23
|
if (element.assetType === 'video' || element.assetType === 'audio') {
|
|
9
24
|
return '@remotion/media';
|
|
10
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type {
|
|
1
|
+
import type { DragOverrides, EffectDefinition, GetDragOverrides, GetEffectDragOverrides, PropStatuses, SequenceControls, SequencePropsSubscriptionKey, SequenceSchema, VisibleFieldSchema } from 'remotion';
|
|
2
|
+
export type { DragOverrides, PropStatuses, SequenceControls };
|
|
3
3
|
export type SchemaFieldInfo = {
|
|
4
4
|
key: string;
|
|
5
5
|
description: string | undefined;
|
|
@@ -19,17 +19,17 @@ export type AnySchemaFieldInfo = SequenceSchemaFieldInfo | EffectSchemaFieldInfo
|
|
|
19
19
|
export declare const SCHEMA_FIELD_ROW_HEIGHT = 22;
|
|
20
20
|
declare const SUPPORTED_SCHEMA_TYPES: readonly ["number", "boolean", "rotation-css", "rotation-degrees", "translate", "scale", "uv-coordinate", "color", "array", "enum", "hidden"];
|
|
21
21
|
type SupportedSchemaType = (typeof SUPPORTED_SCHEMA_TYPES)[number];
|
|
22
|
-
export declare const getFieldsToShow: ({ getDragOverrides,
|
|
22
|
+
export declare const getFieldsToShow: ({ getDragOverrides, propStatuses, nodePath, schema, currentRuntimeValueDotNotation, }: {
|
|
23
23
|
schema: SequenceSchema;
|
|
24
24
|
currentRuntimeValueDotNotation: Record<string, unknown>;
|
|
25
25
|
getDragOverrides: GetDragOverrides;
|
|
26
|
-
|
|
26
|
+
propStatuses: PropStatuses;
|
|
27
27
|
nodePath: SequencePropsSubscriptionKey;
|
|
28
28
|
}) => SequenceSchemaFieldInfo[] | null;
|
|
29
|
-
export declare const getEffectFieldsToShow: ({ effect, effectIndex, nodePath,
|
|
29
|
+
export declare const getEffectFieldsToShow: ({ effect, effectIndex, nodePath, propStatuses, getEffectDragOverrides, }: {
|
|
30
30
|
effect: EffectDefinition<unknown>;
|
|
31
31
|
effectIndex: number;
|
|
32
32
|
nodePath: SequencePropsSubscriptionKey | null;
|
|
33
|
-
|
|
33
|
+
propStatuses: PropStatuses;
|
|
34
34
|
getEffectDragOverrides: GetEffectDragOverrides;
|
|
35
35
|
}) => EffectSchemaFieldInfo[];
|
|
@@ -50,12 +50,12 @@ const getEffectFieldValue = ({ key, dragOverrides, effectStatus, }) => {
|
|
|
50
50
|
}
|
|
51
51
|
return propStatus.codeValue;
|
|
52
52
|
};
|
|
53
|
-
const getFieldsToShow = ({ getDragOverrides,
|
|
53
|
+
const getFieldsToShow = ({ getDragOverrides, propStatuses, nodePath, schema, currentRuntimeValueDotNotation, }) => {
|
|
54
54
|
const { merged: valuesDotNotation } = remotion_1.Internals.computeEffectiveSchemaValuesDotNotation({
|
|
55
55
|
schema,
|
|
56
56
|
currentValue: currentRuntimeValueDotNotation,
|
|
57
57
|
overrideValues: getDragOverrides(nodePath),
|
|
58
|
-
propStatus: remotion_1.Internals.
|
|
58
|
+
propStatus: remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath),
|
|
59
59
|
frame: null,
|
|
60
60
|
});
|
|
61
61
|
const activeSchema = remotion_1.Internals.flattenActiveSchema(schema, (key) => valuesDotNotation[key]);
|
|
@@ -91,11 +91,11 @@ const getFieldsToShow = ({ getDragOverrides, codeValues, nodePath, schema, curre
|
|
|
91
91
|
.filter(no_react_1.NoReactInternals.truthy);
|
|
92
92
|
};
|
|
93
93
|
exports.getFieldsToShow = getFieldsToShow;
|
|
94
|
-
const getEffectFieldsToShow = ({ effect, effectIndex, nodePath,
|
|
94
|
+
const getEffectFieldsToShow = ({ effect, effectIndex, nodePath, propStatuses, getEffectDragOverrides, }) => {
|
|
95
95
|
const effectStatus = nodePath === null
|
|
96
96
|
? null
|
|
97
|
-
: remotion_1.Internals.
|
|
98
|
-
|
|
97
|
+
: remotion_1.Internals.getEffectPropStatusesCtx({
|
|
98
|
+
propStatuses,
|
|
99
99
|
nodePath,
|
|
100
100
|
effectIndex,
|
|
101
101
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const SFX_DRAG_MIME_TYPE = "application/vnd.remotion.sfx+json";
|
|
2
|
+
export type SfxDragData = {
|
|
3
|
+
type: 'remotion-sfx';
|
|
4
|
+
version: 1;
|
|
5
|
+
sfx: {
|
|
6
|
+
name: string;
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const parseSfxDragData: (value: string) => SfxDragData | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSfxDragData = exports.SFX_DRAG_MIME_TYPE = void 0;
|
|
4
|
+
const url_1 = require("./url");
|
|
5
|
+
exports.SFX_DRAG_MIME_TYPE = 'application/vnd.remotion.sfx+json';
|
|
6
|
+
const isRecord = (value) => {
|
|
7
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
|
+
};
|
|
9
|
+
const parseSfxDragData = (value) => {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(value);
|
|
12
|
+
if (!isRecord(parsed)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (parsed.type !== 'remotion-sfx' || parsed.version !== 1) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (!isRecord(parsed.sfx)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const { name, url } = parsed.sfx;
|
|
22
|
+
if (typeof name !== 'string' ||
|
|
23
|
+
name.length === 0 ||
|
|
24
|
+
typeof url !== 'string' ||
|
|
25
|
+
!(0, url_1.isUrl)(url)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
type: 'remotion-sfx',
|
|
30
|
+
version: 1,
|
|
31
|
+
sfx: {
|
|
32
|
+
name,
|
|
33
|
+
url,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (_a) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.parseSfxDragData = parseSfxDragData;
|
package/dist/url.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isUrl: (value: string) => boolean;
|
package/dist/url.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isUrl = void 0;
|
|
4
|
+
const isUrl = (value) => {
|
|
5
|
+
try {
|
|
6
|
+
const parsed = new URL(value);
|
|
7
|
+
return parsed.href.length > 0;
|
|
8
|
+
}
|
|
9
|
+
catch (_a) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.isUrl = isUrl;
|
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.474",
|
|
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.474"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.474",
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.474",
|
|
28
28
|
"eslint": "9.19.0",
|
|
29
29
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
30
30
|
},
|