@remotion/studio-shared 4.0.476 → 4.0.477
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-requests.d.ts +9 -1
- package/dist/index.d.ts +1 -1
- package/dist/shape-drag-data.d.ts +22 -0
- package/dist/shape-drag-data.js +90 -0
- package/package.json +4 -4
package/dist/api-requests.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
2
|
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
|
3
|
-
import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
3
|
+
import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, JsxComponentIdentity, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
4
4
|
import type { RecastCodemod, VisualControlChange } from './codemods';
|
|
5
5
|
import type { ComponentProp } from './component-drag-data';
|
|
6
6
|
import type { EffectClipboardParam, EffectClipboardPasteType, EffectClipboardSnapshot } from './effect-clipboard-data';
|
|
@@ -201,6 +201,7 @@ export type SubscribeToSequencePropsRequest = {
|
|
|
201
201
|
line: number;
|
|
202
202
|
column: number;
|
|
203
203
|
nodePath: SequenceNodePath | null;
|
|
204
|
+
componentIdentity: JsxComponentIdentity | null;
|
|
204
205
|
keys: string[];
|
|
205
206
|
effects: string[][];
|
|
206
207
|
clientId: string;
|
|
@@ -479,12 +480,14 @@ export type InsertableCompositionElement = {
|
|
|
479
480
|
type: 'solid';
|
|
480
481
|
width: number;
|
|
481
482
|
height: number;
|
|
483
|
+
position: InsertableCompositionElementPosition | null;
|
|
482
484
|
} | {
|
|
483
485
|
type: 'component';
|
|
484
486
|
componentName: string;
|
|
485
487
|
importName: string;
|
|
486
488
|
importPath: string;
|
|
487
489
|
props: ComponentProp[];
|
|
490
|
+
position: InsertableCompositionElementPosition | null;
|
|
488
491
|
} | {
|
|
489
492
|
type: 'asset';
|
|
490
493
|
assetType: 'image' | 'video' | 'gif' | 'audio';
|
|
@@ -494,6 +497,11 @@ export type InsertableCompositionElement = {
|
|
|
494
497
|
width: number;
|
|
495
498
|
height: number;
|
|
496
499
|
} | null;
|
|
500
|
+
position: InsertableCompositionElementPosition | null;
|
|
501
|
+
};
|
|
502
|
+
export type InsertableCompositionElementPosition = {
|
|
503
|
+
x: number;
|
|
504
|
+
y: number;
|
|
497
505
|
};
|
|
498
506
|
export type InsertJsxElementRequest = {
|
|
499
507
|
compositionFile: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { splitAnsi, stripAnsi } from './ansi';
|
|
2
|
-
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddKeyframesRequest, AddKeyframesResponse, AddEffectRequest, AddEffectResponse, AddRenderRequest, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, CancelRenderResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse, CopyStillToClipboardRequest, DeleteEffectKeyframe, DeleteEffectRequest, DeleteEffectRequestItem, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeRequestItem, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, DeleteStaticFileRequest, DeleteStaticFileResponse, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertableCompositionElement, InstallPackageRequest, InstallPackageResponse, LogStudioErrorRequest, LogStudioErrorResponse, MoveEffectKeyframe, MoveKeyframesRequest, MoveKeyframesResponse, MoveSequenceKeyframe, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, PasteEffectsRequest, PasteEffectsResponse, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveSequencePropEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse, type KeyframeSettings, type AddEffectKeyframe, type AddSequenceKeyframe, } from './api-requests';
|
|
2
|
+
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddKeyframesRequest, AddKeyframesResponse, AddEffectRequest, AddEffectResponse, AddRenderRequest, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, CancelRenderResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse, CopyStillToClipboardRequest, DeleteEffectKeyframe, DeleteEffectRequest, DeleteEffectRequestItem, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeRequestItem, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, DeleteStaticFileRequest, DeleteStaticFileResponse, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertableCompositionElement, InsertableCompositionElementPosition, InstallPackageRequest, InstallPackageResponse, LogStudioErrorRequest, LogStudioErrorResponse, MoveEffectKeyframe, MoveKeyframesRequest, MoveKeyframesResponse, MoveSequenceKeyframe, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, PasteEffectsRequest, PasteEffectsResponse, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveSequencePropEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse, type KeyframeSettings, type AddEffectKeyframe, type AddSequenceKeyframe, } from './api-requests';
|
|
3
3
|
export { ASSET_DRAG_MIME_TYPE, makeAssetDragData, parseAssetDragData, type AssetDragData, } from './asset-drag-data';
|
|
4
4
|
export type { ApplyVisualControlCodemod, RecastCodemod } from './codemods';
|
|
5
5
|
export { COMPONENT_DRAG_MIME_TYPE, areComponentProps, isComponentIdentifier, isComponentImportPath, makeComponentDragData, parseComponentDragData, type ComponentDragData, type ComponentProp, } from './component-drag-data';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const SHAPE_DRAG_MIME_TYPE = "application/vnd.remotion.shape+json";
|
|
2
|
+
export declare const shapeNames: readonly ["Arrow", "Circle", "Ellipse", "Heart", "Pie", "Polygon", "Rect", "Star", "Triangle"];
|
|
3
|
+
export type ShapeName = (typeof shapeNames)[number];
|
|
4
|
+
export type ShapeAttribute = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string | number | boolean;
|
|
7
|
+
};
|
|
8
|
+
export type ShapeDragData = {
|
|
9
|
+
type: 'remotion-shape';
|
|
10
|
+
version: 1;
|
|
11
|
+
shape: ShapeName;
|
|
12
|
+
attributes: ShapeAttribute[];
|
|
13
|
+
};
|
|
14
|
+
export declare const isShapeName: (value: unknown) => value is "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
|
|
15
|
+
export declare const isShapeAttributeName: (value: unknown) => value is string;
|
|
16
|
+
export declare const isShapeAttribute: (value: unknown) => value is ShapeAttribute;
|
|
17
|
+
export declare const areShapeAttributes: (value: unknown) => value is ShapeAttribute[];
|
|
18
|
+
export declare const makeShapeDragData: ({ attributes, shape, }: {
|
|
19
|
+
attributes: ShapeAttribute[];
|
|
20
|
+
shape: "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
|
|
21
|
+
}) => ShapeDragData;
|
|
22
|
+
export declare const parseShapeDragData: (value: string) => ShapeDragData | null;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseShapeDragData = exports.makeShapeDragData = exports.areShapeAttributes = exports.isShapeAttribute = exports.isShapeAttributeName = exports.isShapeName = exports.shapeNames = exports.SHAPE_DRAG_MIME_TYPE = void 0;
|
|
4
|
+
exports.SHAPE_DRAG_MIME_TYPE = 'application/vnd.remotion.shape+json';
|
|
5
|
+
exports.shapeNames = [
|
|
6
|
+
'Arrow',
|
|
7
|
+
'Circle',
|
|
8
|
+
'Ellipse',
|
|
9
|
+
'Heart',
|
|
10
|
+
'Pie',
|
|
11
|
+
'Polygon',
|
|
12
|
+
'Rect',
|
|
13
|
+
'Star',
|
|
14
|
+
'Triangle',
|
|
15
|
+
];
|
|
16
|
+
const isRecord = (value) => {
|
|
17
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
};
|
|
19
|
+
const isShapeName = (value) => {
|
|
20
|
+
return typeof value === 'string' && exports.shapeNames.includes(value);
|
|
21
|
+
};
|
|
22
|
+
exports.isShapeName = isShapeName;
|
|
23
|
+
const isShapeAttributeName = (value) => {
|
|
24
|
+
return (typeof value === 'string' &&
|
|
25
|
+
value !== 'style' &&
|
|
26
|
+
/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value));
|
|
27
|
+
};
|
|
28
|
+
exports.isShapeAttributeName = isShapeAttributeName;
|
|
29
|
+
const isShapeAttribute = (value) => {
|
|
30
|
+
if (!isRecord(value)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (!(0, exports.isShapeAttributeName)(value.name)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return (typeof value.value === 'string' ||
|
|
37
|
+
typeof value.value === 'boolean' ||
|
|
38
|
+
(typeof value.value === 'number' && Number.isFinite(value.value)));
|
|
39
|
+
};
|
|
40
|
+
exports.isShapeAttribute = isShapeAttribute;
|
|
41
|
+
const areShapeAttributes = (value) => {
|
|
42
|
+
if (!Array.isArray(value)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const seen = new Set();
|
|
46
|
+
for (const attribute of value) {
|
|
47
|
+
if (!(0, exports.isShapeAttribute)(attribute) || seen.has(attribute.name)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
seen.add(attribute.name);
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
54
|
+
exports.areShapeAttributes = areShapeAttributes;
|
|
55
|
+
const makeShapeDragData = ({ attributes, shape, }) => {
|
|
56
|
+
return {
|
|
57
|
+
type: 'remotion-shape',
|
|
58
|
+
version: 1,
|
|
59
|
+
shape,
|
|
60
|
+
attributes,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
exports.makeShapeDragData = makeShapeDragData;
|
|
64
|
+
const parseShapeDragData = (value) => {
|
|
65
|
+
try {
|
|
66
|
+
const parsed = JSON.parse(value);
|
|
67
|
+
if (!isRecord(parsed)) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
if (parsed.type !== 'remotion-shape' || parsed.version !== 1) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (!(0, exports.isShapeName)(parsed.shape)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (!(0, exports.areShapeAttributes)(parsed.attributes)) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
type: 'remotion-shape',
|
|
81
|
+
version: 1,
|
|
82
|
+
shape: parsed.shape,
|
|
83
|
+
attributes: parsed.attributes,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (_a) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.parseShapeDragData = parseShapeDragData;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-shared"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio-shared",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.477",
|
|
7
7
|
"description": "Internal package for shared objects between the Studio backend and frontend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"remotion": "4.0.
|
|
23
|
+
"remotion": "4.0.477"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@remotion/renderer": "4.0.
|
|
27
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
26
|
+
"@remotion/renderer": "4.0.477",
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.477",
|
|
28
28
|
"eslint": "9.19.0",
|
|
29
29
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
30
30
|
},
|