@remotion/studio-shared 4.0.514 → 4.0.516
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 +5 -0
- package/dist/browser-studio-operations.d.ts +25 -3
- package/dist/config-method-lifecycles.d.ts +1 -0
- package/dist/config-method-lifecycles.js +1 -0
- package/dist/define-plugin-definitions.d.ts +3 -1
- package/dist/define-plugin-definitions.js +2 -1
- package/dist/effect-catalog.js +14 -0
- package/dist/element-drag-data.d.ts +1 -3
- package/dist/element-drag-data.js +2 -11
- package/dist/esm/index.mjs +74 -1
- package/dist/esm/studio-entry-points.mjs +2 -0
- package/dist/esm/studio-html.mjs +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -2
- package/dist/optimistic-update-for-code-values.d.ts +7 -0
- package/dist/optimistic-update-for-code-values.js +30 -0
- package/dist/optimistic-update-for-effect-code-values.d.ts +8 -0
- package/dist/optimistic-update-for-effect-code-values.js +43 -0
- package/dist/remote-asset.d.ts +13 -0
- package/dist/remote-asset.js +62 -0
- package/dist/shape-drag-data.d.ts +22 -0
- package/dist/shape-drag-data.js +90 -0
- package/dist/studio-entry-points.d.ts +2 -1
- package/dist/studio-entry-points.js +2 -1
- package/dist/studio-html.d.ts +2 -1
- package/dist/studio-html.js +2 -2
- package/package.json +5 -5
package/dist/api-requests.d.ts
CHANGED
|
@@ -817,6 +817,11 @@ export type GetRemotionSkillsInfoRequest = {};
|
|
|
817
817
|
export type GetRemotionSkillsInfoResponse = {
|
|
818
818
|
remotionUpgradeSkillAvailable: boolean;
|
|
819
819
|
remotionInteractivitySkillAvailable: boolean;
|
|
820
|
+
skills: {
|
|
821
|
+
name: string;
|
|
822
|
+
installedInProject: boolean;
|
|
823
|
+
installedGlobally: boolean;
|
|
824
|
+
}[];
|
|
820
825
|
};
|
|
821
826
|
export type ProjectInfoRequest = {};
|
|
822
827
|
export type ProjectInfoResponse = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementDragData } from '@remotion/studio-protocol';
|
|
2
|
-
import type { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddKeyframesRequest, AddKeyframesResponse, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApplyCodemodRequest, ApplyCodemodResponse, BatchUpdateKeyframeSettingsRequest, BatchUpdateKeyframeSettingsResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse, DeleteJsxNodeRequest, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteStaticFileRequest, DeleteStaticFileResponse, FindInFileRequest, FindInFileResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertElementRequest, InsertElementResponse, MoveKeyframesRequest, MoveKeyframesResponse, PrepareElementInstallRequest, PrepareElementInstallResponse, RedoResponse, RenameStaticFileRequest, RenameStaticFileResponse, ReorderSequenceRequest, ReorderSequenceResponse, SaveSequencePropsRequest, SaveSequencePropsResponse, SimpleDiff, SplitJsxSequenceRequest, SplitJsxSequenceResponse, SplitVideoFromAudioRequest, SplitVideoFromAudioResponse, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromSequencePropsRequest, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse } from './api-requests';
|
|
2
|
+
import type { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddEffectRequest, AddEffectResponse, AddKeyframesRequest, AddKeyframesResponse, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApplyCodemodRequest, ApplyCodemodResponse, BatchUpdateKeyframeSettingsRequest, BatchUpdateKeyframeSettingsResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse, DeleteJsxNodeRequest, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteEffectRequest, DeleteEffectResponse, DeleteStaticFileRequest, DeleteStaticFileResponse, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, FindInFileRequest, FindInFileResponse, DuplicateEffectRequest, DuplicateEffectResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertElementRequest, InsertElementResponse, InstallPackageRequest, MoveKeyframesRequest, MoveKeyframesResponse, PasteEffectsRequest, PasteEffectsResponse, PrepareElementInstallRequest, PrepareElementInstallResponse, RedoResponse, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequenceRequest, ReorderSequenceResponse, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveMultipleEffectPropsRequest, SaveMultipleEffectPropsResponse, SimpleDiff, SplitJsxSequenceRequest, SplitJsxSequenceResponse, SplitVideoFromAudioRequest, SplitVideoFromAudioResponse, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromSequencePropsRequest, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse } from './api-requests';
|
|
3
3
|
import type { RecastCodemod } from './codemods';
|
|
4
4
|
import type { EventSourceEvent } from './event-source-event';
|
|
5
5
|
export type WriteStaticFileRequest = {
|
|
@@ -30,6 +30,25 @@ export type BrowserStudioKeyframeOperations = {
|
|
|
30
30
|
updateEffectKeyframeSettings: (request: UpdateEffectKeyframeSettingsRequest) => Promise<UpdateEffectKeyframeSettingsResponse>;
|
|
31
31
|
updateSequenceKeyframeSettings: (request: UpdateSequenceKeyframeSettingsRequest) => Promise<UpdateSequenceKeyframeSettingsResponse>;
|
|
32
32
|
};
|
|
33
|
+
export type BrowserStudioEffectOperations = {
|
|
34
|
+
addEffect: (request: AddEffectRequest) => Promise<AddEffectResponse>;
|
|
35
|
+
deleteEffects: (request: DeleteEffectRequest) => Promise<DeleteEffectResponse>;
|
|
36
|
+
duplicateEffects: (request: DuplicateEffectRequest) => Promise<DuplicateEffectResponse>;
|
|
37
|
+
pasteEffects: (request: PasteEffectsRequest) => Promise<PasteEffectsResponse>;
|
|
38
|
+
reorderEffect: (request: ReorderEffectRequest) => Promise<ReorderEffectResponse>;
|
|
39
|
+
saveEffectProps: (request: SaveEffectPropsRequest) => Promise<SaveEffectPropsResponse>;
|
|
40
|
+
saveMultipleEffectProps: (request: SaveMultipleEffectPropsRequest) => Promise<SaveMultipleEffectPropsResponse>;
|
|
41
|
+
};
|
|
42
|
+
export type BrowserStudioInstallPackagesResponse = {
|
|
43
|
+
success: true;
|
|
44
|
+
} | {
|
|
45
|
+
success: false;
|
|
46
|
+
reason: string;
|
|
47
|
+
stack: string;
|
|
48
|
+
};
|
|
49
|
+
export type BrowserStudioPackageInstallationOperations = {
|
|
50
|
+
installPackages: (request: InstallPackageRequest) => Promise<BrowserStudioInstallPackagesResponse>;
|
|
51
|
+
};
|
|
33
52
|
export type BrowserStudioOperations = {
|
|
34
53
|
consumeInitialElement: () => {
|
|
35
54
|
element: ElementDragData['element'];
|
|
@@ -42,7 +61,10 @@ export type BrowserStudioOperations = {
|
|
|
42
61
|
data: Uint8Array;
|
|
43
62
|
fileName: string;
|
|
44
63
|
}>;
|
|
64
|
+
downloadRemoteAsset: (request: DownloadRemoteAssetRequest) => Promise<DownloadRemoteAssetResponse>;
|
|
45
65
|
duplicateComposition: (request: DuplicateCompositionRequest) => Promise<DuplicateCompositionResponse>;
|
|
66
|
+
duplicateJsxNode: (request: DuplicateJsxNodeRequest) => Promise<DuplicateJsxNodeResponse>;
|
|
67
|
+
effects: BrowserStudioEffectOperations;
|
|
46
68
|
findInFile: (request: FindInFileRequest) => Promise<FindInFileResponse>;
|
|
47
69
|
getFileSource: (fileName: string) => Promise<string | null>;
|
|
48
70
|
getCompositionFile: (compositionId: string) => string | null;
|
|
@@ -50,8 +72,8 @@ export type BrowserStudioOperations = {
|
|
|
50
72
|
insertSolid: (request: InsertJsxElementRequest) => Promise<InsertJsxElementResponse>;
|
|
51
73
|
insertElement: (request: InsertElementRequest) => Promise<InsertElementResponse>;
|
|
52
74
|
insertJsxElement: (request: InsertJsxElementRequest) => Promise<InsertJsxElementResponse>;
|
|
53
|
-
|
|
54
|
-
|
|
75
|
+
keyframes: BrowserStudioKeyframeOperations;
|
|
76
|
+
packageInstallation: BrowserStudioPackageInstallationOperations;
|
|
55
77
|
prepareElementInstall: (request: PrepareElementInstallRequest) => Promise<PrepareElementInstallResponse>;
|
|
56
78
|
redo: () => Promise<RedoResponse>;
|
|
57
79
|
renameStaticFile: (request: RenameStaticFileRequest) => Promise<RenameStaticFileResponse>;
|
|
@@ -38,6 +38,7 @@ export declare const configMethodLifecycles: {
|
|
|
38
38
|
readonly setDeleteAfter: "runtime";
|
|
39
39
|
readonly setDisallowParallelEncoding: "runtime";
|
|
40
40
|
readonly setDotEnvLocation: "restart";
|
|
41
|
+
readonly setEnableCancellation: "runtime";
|
|
41
42
|
readonly setEnableCrossSiteIsolation: "restart";
|
|
42
43
|
readonly setEnableFolderExpiry: "runtime";
|
|
43
44
|
readonly setEncodingBufferSize: "runtime";
|
|
@@ -41,6 +41,7 @@ exports.configMethodLifecycles = {
|
|
|
41
41
|
setDeleteAfter: 'runtime',
|
|
42
42
|
setDisallowParallelEncoding: 'runtime',
|
|
43
43
|
setDotEnvLocation: 'restart',
|
|
44
|
+
setEnableCancellation: 'runtime',
|
|
44
45
|
setEnableCrossSiteIsolation: 'restart',
|
|
45
46
|
setEnableFolderExpiry: 'runtime',
|
|
46
47
|
setEncodingBufferSize: 'runtime',
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
export declare const getDefinePluginDefinitions: ({ maxTimelineTracks, askAIEnabled, interactivityEnabled, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, }: {
|
|
1
|
+
export declare const getDefinePluginDefinitions: ({ maxTimelineTracks, askAIEnabled, interactivityEnabled, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, experimentalClientSideRenderingEnabled, }: {
|
|
2
2
|
maxTimelineTracks: number | null;
|
|
3
3
|
askAIEnabled: boolean;
|
|
4
4
|
interactivityEnabled: boolean;
|
|
5
5
|
keyboardShortcutsEnabled: boolean;
|
|
6
6
|
bufferStateDelayInMilliseconds: number | null;
|
|
7
|
+
experimentalClientSideRenderingEnabled: boolean;
|
|
7
8
|
}) => {
|
|
8
9
|
'process.env.MAX_TIMELINE_TRACKS': number | null;
|
|
9
10
|
'process.env.ASK_AI_ENABLED': boolean;
|
|
10
11
|
'process.env.INTERACTIVITY_ENABLED': boolean;
|
|
11
12
|
'process.env.KEYBOARD_SHORTCUTS_ENABLED': boolean;
|
|
12
13
|
'process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS': number | null;
|
|
14
|
+
'process.env.EXPERIMENTAL_CLIENT_SIDE_RENDERING_ENABLED': boolean;
|
|
13
15
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDefinePluginDefinitions = void 0;
|
|
4
|
-
const getDefinePluginDefinitions = ({ maxTimelineTracks, askAIEnabled, interactivityEnabled, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, }) => ({
|
|
4
|
+
const getDefinePluginDefinitions = ({ maxTimelineTracks, askAIEnabled, interactivityEnabled, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, experimentalClientSideRenderingEnabled, }) => ({
|
|
5
5
|
'process.env.MAX_TIMELINE_TRACKS': maxTimelineTracks,
|
|
6
6
|
'process.env.ASK_AI_ENABLED': askAIEnabled,
|
|
7
7
|
'process.env.INTERACTIVITY_ENABLED': interactivityEnabled,
|
|
8
8
|
'process.env.KEYBOARD_SHORTCUTS_ENABLED': keyboardShortcutsEnabled,
|
|
9
9
|
'process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS': bufferStateDelayInMilliseconds,
|
|
10
|
+
'process.env.EXPERIMENTAL_CLIENT_SIDE_RENDERING_ENABLED': experimentalClientSideRenderingEnabled,
|
|
10
11
|
});
|
|
11
12
|
exports.getDefinePluginDefinitions = getDefinePluginDefinitions;
|
package/dist/effect-catalog.js
CHANGED
|
@@ -327,6 +327,20 @@ exports.EFFECT_CATALOG = [
|
|
|
327
327
|
config: {},
|
|
328
328
|
},
|
|
329
329
|
},
|
|
330
|
+
{
|
|
331
|
+
id: 'effects-outline',
|
|
332
|
+
category: 'Blur & Shadow',
|
|
333
|
+
label: 'outline()',
|
|
334
|
+
description: 'Solid alpha outline effect',
|
|
335
|
+
effect: {
|
|
336
|
+
name: 'outline',
|
|
337
|
+
importPath: '@remotion/effects/outline',
|
|
338
|
+
config: {
|
|
339
|
+
width: 12,
|
|
340
|
+
color: '#00ffff',
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
},
|
|
330
344
|
{
|
|
331
345
|
id: 'effects-light-trail',
|
|
332
346
|
category: 'Blur & Shadow',
|
|
@@ -4,7 +4,6 @@ export type ElementDragData = {
|
|
|
4
4
|
type: 'remotion-element';
|
|
5
5
|
version: 1;
|
|
6
6
|
element: {
|
|
7
|
-
dependencies: string[];
|
|
8
7
|
slug: string;
|
|
9
8
|
displayName: string;
|
|
10
9
|
sourceCode: string;
|
|
@@ -14,8 +13,7 @@ export type ElementDragData = {
|
|
|
14
13
|
export declare const isLowercaseElementFileName: (value: unknown) => value is string;
|
|
15
14
|
export declare const makeElementFileNameFromSlug: (slug: string) => string | null;
|
|
16
15
|
export declare const getElementComponentNameFromSourceCode: (sourceCode: string) => string | null;
|
|
17
|
-
export declare const makeElementDragData: ({
|
|
18
|
-
dependencies: string[];
|
|
16
|
+
export declare const makeElementDragData: ({ dimensions, displayName, slug, sourceCode, }: {
|
|
19
17
|
slug: string;
|
|
20
18
|
displayName: string;
|
|
21
19
|
sourceCode: string;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseElementDragData = exports.makeElementDragData = exports.getElementComponentNameFromSourceCode = exports.makeElementFileNameFromSlug = exports.isLowercaseElementFileName = exports.ELEMENT_DRAG_MIME_TYPE = void 0;
|
|
4
4
|
const component_drag_data_1 = require("./component-drag-data");
|
|
5
|
-
const package_name_1 = require("./package-name");
|
|
6
5
|
const drag_mime_types_1 = require("./drag-mime-types");
|
|
7
6
|
Object.defineProperty(exports, "ELEMENT_DRAG_MIME_TYPE", { enumerable: true, get: function () { return drag_mime_types_1.ELEMENT_DRAG_MIME_TYPE; } });
|
|
8
7
|
const isRecord = (value) => {
|
|
@@ -49,11 +48,6 @@ const isSourceCode = (value) => {
|
|
|
49
48
|
value.trim().length > 0 &&
|
|
50
49
|
value.length < 200000);
|
|
51
50
|
};
|
|
52
|
-
const isDependencies = (value) => {
|
|
53
|
-
return (Array.isArray(value) &&
|
|
54
|
-
value.length <= 100 &&
|
|
55
|
-
value.every((dependency) => typeof dependency === 'string' && (0, package_name_1.isValidPackageName)(dependency)));
|
|
56
|
-
};
|
|
57
51
|
const isDimensions = (value) => {
|
|
58
52
|
if (!isRecord(value)) {
|
|
59
53
|
return false;
|
|
@@ -75,12 +69,11 @@ const getElementComponentNameFromSourceCode = (sourceCode) => {
|
|
|
75
69
|
return (0, component_drag_data_1.isComponentIdentifier)(componentName) ? componentName : null;
|
|
76
70
|
};
|
|
77
71
|
exports.getElementComponentNameFromSourceCode = getElementComponentNameFromSourceCode;
|
|
78
|
-
const makeElementDragData = ({
|
|
72
|
+
const makeElementDragData = ({ dimensions, displayName, slug, sourceCode, }) => {
|
|
79
73
|
return {
|
|
80
74
|
type: 'remotion-element',
|
|
81
75
|
version: 1,
|
|
82
76
|
element: {
|
|
83
|
-
dependencies: Array.from(new Set(dependencies)),
|
|
84
77
|
slug,
|
|
85
78
|
displayName,
|
|
86
79
|
sourceCode,
|
|
@@ -101,20 +94,18 @@ const parseElementDragData = (value) => {
|
|
|
101
94
|
if (!isRecord(parsed.element)) {
|
|
102
95
|
return null;
|
|
103
96
|
}
|
|
104
|
-
const {
|
|
97
|
+
const { dimensions, displayName, slug, sourceCode } = parsed.element;
|
|
105
98
|
if (!isSlug(slug) ||
|
|
106
99
|
!isDisplayName(displayName) ||
|
|
107
100
|
!isSourceCode(sourceCode) ||
|
|
108
101
|
(0, exports.getElementComponentNameFromSourceCode)(sourceCode) === null ||
|
|
109
102
|
(0, exports.makeElementFileNameFromSlug)(slug) === null ||
|
|
110
|
-
(dependencies !== undefined && !isDependencies(dependencies)) ||
|
|
111
103
|
(dimensions !== undefined &&
|
|
112
104
|
dimensions !== null &&
|
|
113
105
|
!isDimensions(dimensions))) {
|
|
114
106
|
return null;
|
|
115
107
|
}
|
|
116
108
|
return (0, exports.makeElementDragData)({
|
|
117
|
-
dependencies: dependencies !== null && dependencies !== void 0 ? dependencies : [],
|
|
118
109
|
slug,
|
|
119
110
|
displayName,
|
|
120
111
|
sourceCode,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -161,6 +161,7 @@ var configMethodLifecycles = {
|
|
|
161
161
|
setDeleteAfter: "runtime",
|
|
162
162
|
setDisallowParallelEncoding: "runtime",
|
|
163
163
|
setDotEnvLocation: "restart",
|
|
164
|
+
setEnableCancellation: "runtime",
|
|
164
165
|
setEnableCrossSiteIsolation: "restart",
|
|
165
166
|
setEnableFolderExpiry: "runtime",
|
|
166
167
|
setEncodingBufferSize: "runtime",
|
|
@@ -523,6 +524,56 @@ var detectFileType = (data) => {
|
|
|
523
524
|
}
|
|
524
525
|
return { type: "unknown" };
|
|
525
526
|
};
|
|
527
|
+
// src/remote-asset.ts
|
|
528
|
+
var maxRemoteAssetSize = 50 * 1024 * 1024;
|
|
529
|
+
var remoteAssetDownloadTimeout = 15000;
|
|
530
|
+
var remoteAssetAcceptHeader = "image/png,image/apng,image/jpeg,image/webp,image/bmp,image/gif";
|
|
531
|
+
var extensionsForFileType = {
|
|
532
|
+
png: ["png"],
|
|
533
|
+
apng: ["png", "apng"],
|
|
534
|
+
jpeg: ["jpg", "jpeg"],
|
|
535
|
+
webp: ["webp"],
|
|
536
|
+
bmp: ["bmp"],
|
|
537
|
+
gif: ["gif"]
|
|
538
|
+
};
|
|
539
|
+
var getRemoteAssetFilename = ({
|
|
540
|
+
fileType,
|
|
541
|
+
url
|
|
542
|
+
}) => {
|
|
543
|
+
const encodedBasename = url.pathname.slice(url.pathname.lastIndexOf("/") + 1);
|
|
544
|
+
let basename;
|
|
545
|
+
try {
|
|
546
|
+
basename = decodeURIComponent(encodedBasename);
|
|
547
|
+
} catch {
|
|
548
|
+
basename = encodedBasename;
|
|
549
|
+
}
|
|
550
|
+
const sanitized = Array.from(basename).map((character) => {
|
|
551
|
+
const charCode = character.charCodeAt(0);
|
|
552
|
+
return charCode <= 31 || '<>:"/\\|?*'.includes(character) ? "-" : character;
|
|
553
|
+
}).join("").trim().replace(/^[. ]+|[. ]+$/g, "");
|
|
554
|
+
const filenameWithoutFallback = sanitized === "" ? "image" : sanitized;
|
|
555
|
+
const extensions = extensionsForFileType[fileType.type];
|
|
556
|
+
const lastDot = filenameWithoutFallback.lastIndexOf(".");
|
|
557
|
+
const extension = lastDot > 0 ? filenameWithoutFallback.slice(lastDot + 1).toLowerCase() : "";
|
|
558
|
+
if (extensions.includes(extension)) {
|
|
559
|
+
return filenameWithoutFallback;
|
|
560
|
+
}
|
|
561
|
+
const withoutExtension = extension ? filenameWithoutFallback.slice(0, -(extension.length + 1)) : filenameWithoutFallback;
|
|
562
|
+
const safeName = withoutExtension === "" ? "image" : withoutExtension;
|
|
563
|
+
return `${safeName}.${extensions[0]}`;
|
|
564
|
+
};
|
|
565
|
+
var getRemoteAssetElement = ({
|
|
566
|
+
assetPath,
|
|
567
|
+
fileType
|
|
568
|
+
}) => ({
|
|
569
|
+
type: "asset",
|
|
570
|
+
assetType: fileType.type === "gif" ? "gif" : fileType.type === "apng" || fileType.type === "webp" && fileType.animated ? "animated-image" : "image",
|
|
571
|
+
src: assetPath,
|
|
572
|
+
srcType: "static",
|
|
573
|
+
dimensions: fileType.dimensions,
|
|
574
|
+
durationInFrames: null,
|
|
575
|
+
position: null
|
|
576
|
+
});
|
|
526
577
|
// src/easing-clipboard-data.ts
|
|
527
578
|
var isRecord2 = (value) => {
|
|
528
579
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -898,6 +949,20 @@ var EFFECT_CATALOG = [
|
|
|
898
949
|
config: {}
|
|
899
950
|
}
|
|
900
951
|
},
|
|
952
|
+
{
|
|
953
|
+
id: "effects-outline",
|
|
954
|
+
category: "Blur & Shadow",
|
|
955
|
+
label: "outline()",
|
|
956
|
+
description: "Solid alpha outline effect",
|
|
957
|
+
effect: {
|
|
958
|
+
name: "outline",
|
|
959
|
+
importPath: "@remotion/effects/outline",
|
|
960
|
+
config: {
|
|
961
|
+
width: 12,
|
|
962
|
+
color: "#00ffff"
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
},
|
|
901
966
|
{
|
|
902
967
|
id: "effects-light-trail",
|
|
903
968
|
category: "Blur & Shadow",
|
|
@@ -3164,6 +3229,7 @@ var stringifyDefaultProps = ({
|
|
|
3164
3229
|
// src/studio-entry-points.ts
|
|
3165
3230
|
var getStudioEntryPoints = ({
|
|
3166
3231
|
fastRefreshRuntime,
|
|
3232
|
+
reactScan,
|
|
3167
3233
|
environmentSetup,
|
|
3168
3234
|
sequenceStackTraces,
|
|
3169
3235
|
userDefinedComponent,
|
|
@@ -3171,6 +3237,7 @@ var getStudioEntryPoints = ({
|
|
|
3171
3237
|
studioRenderEntry
|
|
3172
3238
|
}) => [
|
|
3173
3239
|
fastRefreshRuntime,
|
|
3240
|
+
reactScan,
|
|
3174
3241
|
environmentSetup,
|
|
3175
3242
|
sequenceStackTraces,
|
|
3176
3243
|
userDefinedComponent,
|
|
@@ -3206,6 +3273,7 @@ var studioHtml = ({
|
|
|
3206
3273
|
logLevel,
|
|
3207
3274
|
mode,
|
|
3208
3275
|
bundleScriptUrl,
|
|
3276
|
+
bundleScriptType,
|
|
3209
3277
|
readOnlyStudio,
|
|
3210
3278
|
studioRuntimeConfig
|
|
3211
3279
|
}) => {
|
|
@@ -3273,7 +3341,7 @@ var studioHtml = ({
|
|
|
3273
3341
|
<div id="menuportal-3"></div>
|
|
3274
3342
|
<div id="menuportal-4"></div>
|
|
3275
3343
|
<div id="menuportal-5"></div>
|
|
3276
|
-
<script src="${scriptUrl}"></script>
|
|
3344
|
+
<script${bundleScriptType === "module" ? ' type="module"' : ""} src="${scriptUrl}"></script>
|
|
3277
3345
|
</body>
|
|
3278
3346
|
</html>
|
|
3279
3347
|
`.trim();
|
|
@@ -3961,6 +4029,8 @@ export {
|
|
|
3961
4029
|
stringifySequenceExpandedRowKey,
|
|
3962
4030
|
stringifyDefaultProps,
|
|
3963
4031
|
splitAnsi,
|
|
4032
|
+
remoteAssetDownloadTimeout,
|
|
4033
|
+
remoteAssetAcceptHeader,
|
|
3964
4034
|
parseSpringEasingConfig,
|
|
3965
4035
|
parseSequencePropClipboardDataResult,
|
|
3966
4036
|
parseSequencePropClipboardData,
|
|
@@ -3987,6 +4057,7 @@ export {
|
|
|
3987
4057
|
optimisticAddSequenceKeyframe,
|
|
3988
4058
|
optimisticAddEffectKeyframe,
|
|
3989
4059
|
moveKeyframesInPropStatus,
|
|
4060
|
+
maxRemoteAssetSize,
|
|
3990
4061
|
keyframeInterpolationFunctions,
|
|
3991
4062
|
isValidPackageName,
|
|
3992
4063
|
isUrl,
|
|
@@ -4004,6 +4075,8 @@ export {
|
|
|
4004
4075
|
getSchemaFieldGroup,
|
|
4005
4076
|
getRequiredPackageForInsertableElement,
|
|
4006
4077
|
getRequiredPackageForEffectImportPath,
|
|
4078
|
+
getRemoteAssetFilename,
|
|
4079
|
+
getRemoteAssetElement,
|
|
4007
4080
|
getProjectName,
|
|
4008
4081
|
getPolyKeyframeEasing,
|
|
4009
4082
|
getOutKeyframeEasing,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/studio-entry-points.ts
|
|
2
2
|
var getStudioEntryPoints = ({
|
|
3
3
|
fastRefreshRuntime,
|
|
4
|
+
reactScan,
|
|
4
5
|
environmentSetup,
|
|
5
6
|
sequenceStackTraces,
|
|
6
7
|
userDefinedComponent,
|
|
@@ -8,6 +9,7 @@ var getStudioEntryPoints = ({
|
|
|
8
9
|
studioRenderEntry
|
|
9
10
|
}) => [
|
|
10
11
|
fastRefreshRuntime,
|
|
12
|
+
reactScan,
|
|
11
13
|
environmentSetup,
|
|
12
14
|
sequenceStackTraces,
|
|
13
15
|
userDefinedComponent,
|
package/dist/esm/studio-html.mjs
CHANGED
|
@@ -27,6 +27,7 @@ var studioHtml = ({
|
|
|
27
27
|
logLevel,
|
|
28
28
|
mode,
|
|
29
29
|
bundleScriptUrl,
|
|
30
|
+
bundleScriptType,
|
|
30
31
|
readOnlyStudio,
|
|
31
32
|
studioRuntimeConfig
|
|
32
33
|
}) => {
|
|
@@ -94,7 +95,7 @@ var studioHtml = ({
|
|
|
94
95
|
<div id="menuportal-3"></div>
|
|
95
96
|
<div id="menuportal-4"></div>
|
|
96
97
|
<div id="menuportal-5"></div>
|
|
97
|
-
<script src="${scriptUrl}"></script>
|
|
98
|
+
<script${bundleScriptType === "module" ? ' type="module"' : ""} src="${scriptUrl}"></script>
|
|
98
99
|
</body>
|
|
99
100
|
</html>
|
|
100
101
|
`.trim();
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { splitAnsi, stripAnsi } from './ansi';
|
|
|
2
2
|
export type { TerminalId } from './terminal';
|
|
3
3
|
export type { GitClientId } from './git-client';
|
|
4
4
|
export { AddEffectKeyframeRequest, AddEffectKeyframeResponse, AddEffectRequest, AddEffectResponse, AddKeyframesRequest, AddKeyframesResponse, AddRenderRequest, AddSequenceKeyframeRequest, AddSequenceKeyframeResponse, ApiRoutes, ApplyCodemodRequest, ApplyCodemodResponse, ApplyVisualControlRequest, ApplyVisualControlResponse, BatchUpdateEffectKeyframeSettings, BatchUpdateKeyframeSettingsRequest, BatchUpdateKeyframeSettingsResponse, BatchUpdateSequenceKeyframeSettings, CanUpdateDefaultPropsResponse, CanUpdateSequencePropsRequest, CancelRenderRequest, CancelRenderResponse, CaptionPatch, CompositionComponentInfoRequest, CompositionComponentInfoResponse, ConvertFigmaClipboardToSvgRequest, ConvertFigmaClipboardToSvgResponse, CopyRenderOutputToAssetRequest, CopyRenderOutputToAssetResponse, CopyStillToClipboardRequest, DeleteEffectKeyframe, DeleteEffectRequest, DeleteEffectRequestItem, DeleteEffectResponse, DeleteJsxNodeRequest, DeleteJsxNodeRequestItem, DeleteJsxNodeResponse, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, DeleteStaticFileRequest, DeleteStaticFileResponse, DownloadRemoteAssetRequest, DownloadRemoteAssetResponse, DuplicateEffectRequest, DuplicateEffectRequestItem, DuplicateEffectResponse, DuplicateJsxNodeRequest, DuplicateJsxNodeResponse, EditorPickerId, ElementInstallExpectedFileState, ElementInstallRequest, ElementInstallSource, FindInFileRequest, FindInFileResponse, GetDefaultCodingAgentInfoRequest, GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoRequest, GetDefaultEditorInfoResponse, GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse, GoogleFontSourceEdit, InsertElementFileConflict, InsertElementRequest, InsertElementResponse, InsertJsxElementRequest, InsertJsxElementResponse, InsertableCompositionElement, InsertableCompositionElementPosition, InstallPackageRequest, InstallPackageResponse, LogStudioErrorRequest, LogStudioErrorResponse, MoveEffectKeyframe, MoveKeyframesRequest, MoveKeyframesResponse, MoveSequenceKeyframe, OpenInCodingAgentRequest, OpenInCodingAgentResponse, OpenInEditorRequest, OpenInEditorResponse, OpenInFileExplorerRequest, OpenInGitClientRequest, OpenInGitClientResponse, OpenInTerminalRequest, OpenInTerminalResponse, PackageInstallSpec, PasteEffectsRequest, PasteEffectsResponse, PrepareElementInstallRequest, PrepareElementInstallResponse, ProjectInfoRequest, ProjectInfoResponse, RedoRequest, RedoResponse, RemoveRenderRequest, RenameStaticFileRequest, RenameStaticFileResponse, ReorderEffectRequest, ReorderEffectResponse, ReorderSequencePosition, ReorderSequenceRequest, ReorderSequenceResponse, RestartStudioRequest, RestartStudioResponse, SaveEffectPropsRequest, SaveEffectPropsResponse, SaveInlineCaptionPatchesRequest, SaveMultipleEffectPropsEdit, SaveMultipleEffectPropsRequest, SaveMultipleEffectPropsResponse, SaveMultipleEffectPropsResult, SaveSequencePropEdit, SaveSequencePropSourceEdit, SaveSequencePropsRequest, SaveSequencePropsResponse, SaveSequencePropsResult, SimpleDiff, SplitJsxSequenceRequest, SplitJsxSequenceResponse, SplitVideoFromAudioRequest, SplitVideoFromAudioResponse, SubscribeToDefaultPropsRequest, SubscribeToDefaultPropsResponse, SubscribeToFileExistenceRequest, SubscribeToFileExistenceResponse, SubscribeToSequencePropsBatchRequest, SubscribeToSequencePropsBatchResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UndoRequest, UndoResponse, UnsubscribeFromDefaultPropsRequest, UnsubscribeFromFileExistenceRequest, UnsubscribeFromSequencePropsRequest, UpdateAvailableRequest, UpdateAvailableResponse, UpdateConfigRequest, UpdateConfigResponse, UpdateDefaultPropsRequest, UpdateDefaultPropsResponse, UpdateEffectKeyframeSettingsRequest, UpdateEffectKeyframeSettingsResponse, UpdateElementInstallTargetRequest, UpdateElementInstallTargetResponse, UpdateSequenceKeyframeSettingsRequest, UpdateSequenceKeyframeSettingsResponse, type AddEffectKeyframe, type AddSequenceKeyframe, type ConfigUpdate, type ConfigValue, type KeyframeSettings, } from './api-requests';
|
|
5
|
-
export type { BrowserStudioKeyframeOperations, BrowserStudioOperations, DuplicateCompositionRequest, DuplicateCompositionResponse, } from './browser-studio-operations';
|
|
5
|
+
export type { BrowserStudioKeyframeOperations, BrowserStudioEffectOperations, BrowserStudioInstallPackagesResponse, BrowserStudioOperations, BrowserStudioPackageInstallationOperations, DuplicateCompositionRequest, DuplicateCompositionResponse, } from './browser-studio-operations';
|
|
6
6
|
export type { CanvasCaptureData, CanvasCaptureMouseMovement, CanvasCapturePointerClick, } from './canvas-capture';
|
|
7
7
|
export { CANVAS_CAPTURE_METADATA_TAG, parseCanvasCaptureData, } from './canvas-capture';
|
|
8
8
|
export type { SequenceNodePathMutation, SequenceNodePathRemapping, } from './sequence-node-path-mutation';
|
|
@@ -14,6 +14,7 @@ export { getConfigFileChangeMessage, type ConfigFileChangeType, } from './config
|
|
|
14
14
|
export { configMethodLifecycles } from './config-method-lifecycles';
|
|
15
15
|
export { DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS } from './default-buffer-state-delay-in-milliseconds';
|
|
16
16
|
export { detectFileType, isImageFileType, type FileDimensions, type FileType, type ImageFileType, } from './detect-file-type';
|
|
17
|
+
export { getRemoteAssetElement, getRemoteAssetFilename, maxRemoteAssetSize, remoteAssetAcceptHeader, remoteAssetDownloadTimeout, } from './remote-asset';
|
|
17
18
|
export { parseEasingClipboardData, parseEasingClipboardDataResult, type EasingClipboardData, type EasingClipboardDataParseResult, } from './easing-clipboard-data';
|
|
18
19
|
export { EFFECT_CATALOG, getEffectCatalogCategories, getEffectDocumentationLink, getEffectDocumentationPath, getEffectPreviewAlt, getEffectPreviewSource, type EffectCatalogCategory, type EffectCatalogItem, } from './effect-catalog';
|
|
19
20
|
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';
|
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.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.getStylePropertyLonghandKeys = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = 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.keyframeInterpolationFunctions = exports.isSchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = void 0;
|
|
17
|
+
exports.getPolyKeyframeEasing = exports.getOutKeyframeEasing = exports.getBackKeyframeEasing = exports.QUAD_KEYFRAME_EASING = exports.LINEAR_KEYFRAME_EASING = exports.KEYFRAME_EASING_PRESETS = exports.HOLD_KEYFRAME_EASING = exports.EASE_KEYFRAME_EASING = exports.CUBIC_KEYFRAME_EASING = exports.parseKeyframeClipboardDataResult = exports.parseKeyframeClipboardData = exports.isKeyframeClipboardFieldType = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getDefaultOutLocation = exports.getAssetSchemaKeys = exports.getAllSchemaKeys = exports.formatBytes = exports.parseSequencePropClipboardDataResult = exports.parseSequencePropClipboardData = exports.parseEffectPropClipboardDataResult = exports.parseEffectPropClipboardData = exports.parseEffectClipboardDataResult = exports.parseEffectClipboardData = exports.getEffectPreviewSource = exports.getEffectPreviewAlt = exports.getEffectDocumentationPath = exports.getEffectDocumentationLink = exports.getEffectCatalogCategories = exports.EFFECT_CATALOG = exports.parseEasingClipboardDataResult = exports.parseEasingClipboardData = exports.remoteAssetDownloadTimeout = exports.remoteAssetAcceptHeader = exports.maxRemoteAssetSize = exports.getRemoteAssetFilename = exports.getRemoteAssetElement = exports.isImageFileType = exports.detectFileType = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.configMethodLifecycles = exports.getConfigFileChangeMessage = exports.hasSequenceTimingTraits = exports.REACT_REFRESH_FINISHED_EVENT = exports.compositionDragDataToSymbolicatedStack = exports.parseCanvasCaptureData = exports.CANVAS_CAPTURE_METADATA_TAG = 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.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.getStylePropertyLonghandKeys = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = 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.keyframeInterpolationFunctions = exports.isSchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = exports.isInteractivitySchemaFieldKeyframable = exports.getKeyframeInterpolationFunctionForSchemaField = exports.isSchemaFieldHoldOnly = exports.getKeyframeInterpolationFunction = exports.canEditEasingForInterpolationFunction = 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; } });
|
|
@@ -38,6 +38,12 @@ Object.defineProperty(exports, "DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS", { e
|
|
|
38
38
|
const detect_file_type_1 = require("./detect-file-type");
|
|
39
39
|
Object.defineProperty(exports, "detectFileType", { enumerable: true, get: function () { return detect_file_type_1.detectFileType; } });
|
|
40
40
|
Object.defineProperty(exports, "isImageFileType", { enumerable: true, get: function () { return detect_file_type_1.isImageFileType; } });
|
|
41
|
+
const remote_asset_1 = require("./remote-asset");
|
|
42
|
+
Object.defineProperty(exports, "getRemoteAssetElement", { enumerable: true, get: function () { return remote_asset_1.getRemoteAssetElement; } });
|
|
43
|
+
Object.defineProperty(exports, "getRemoteAssetFilename", { enumerable: true, get: function () { return remote_asset_1.getRemoteAssetFilename; } });
|
|
44
|
+
Object.defineProperty(exports, "maxRemoteAssetSize", { enumerable: true, get: function () { return remote_asset_1.maxRemoteAssetSize; } });
|
|
45
|
+
Object.defineProperty(exports, "remoteAssetAcceptHeader", { enumerable: true, get: function () { return remote_asset_1.remoteAssetAcceptHeader; } });
|
|
46
|
+
Object.defineProperty(exports, "remoteAssetDownloadTimeout", { enumerable: true, get: function () { return remote_asset_1.remoteAssetDownloadTimeout; } });
|
|
41
47
|
const easing_clipboard_data_1 = require("./easing-clipboard-data");
|
|
42
48
|
Object.defineProperty(exports, "parseEasingClipboardData", { enumerable: true, get: function () { return easing_clipboard_data_1.parseEasingClipboardData; } });
|
|
43
49
|
Object.defineProperty(exports, "parseEasingClipboardDataResult", { enumerable: true, get: function () { return easing_clipboard_data_1.parseEasingClipboardDataResult; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CanUpdateSequencePropsResponse, type SequenceSchema } from 'remotion';
|
|
2
|
+
export declare const optimisticUpdateForCodeValues: ({ 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.optimisticUpdateForCodeValues = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const optimisticUpdateForCodeValues = ({ 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.optimisticUpdateForCodeValues = optimisticUpdateForCodeValues;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CanUpdateSequencePropsResponse, type SequenceSchema } from 'remotion';
|
|
2
|
+
export declare const optimisticUpdateForEffectCodeValues: ({ 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.optimisticUpdateForEffectCodeValues = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const optimisticUpdateForEffectCodeValues = ({ 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.optimisticUpdateForEffectCodeValues = optimisticUpdateForEffectCodeValues;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InsertableCompositionElement } from './api-requests';
|
|
2
|
+
import type { ImageFileType } from './detect-file-type';
|
|
3
|
+
export declare const maxRemoteAssetSize: number;
|
|
4
|
+
export declare const remoteAssetDownloadTimeout = 15000;
|
|
5
|
+
export declare const remoteAssetAcceptHeader = "image/png,image/apng,image/jpeg,image/webp,image/bmp,image/gif";
|
|
6
|
+
export declare const getRemoteAssetFilename: ({ fileType, url, }: {
|
|
7
|
+
fileType: ImageFileType;
|
|
8
|
+
url: URL;
|
|
9
|
+
}) => string;
|
|
10
|
+
export declare const getRemoteAssetElement: ({ assetPath, fileType, }: {
|
|
11
|
+
assetPath: string;
|
|
12
|
+
fileType: ImageFileType;
|
|
13
|
+
}) => InsertableCompositionElement;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRemoteAssetElement = exports.getRemoteAssetFilename = exports.remoteAssetAcceptHeader = exports.remoteAssetDownloadTimeout = exports.maxRemoteAssetSize = void 0;
|
|
4
|
+
exports.maxRemoteAssetSize = 50 * 1024 * 1024;
|
|
5
|
+
exports.remoteAssetDownloadTimeout = 15000;
|
|
6
|
+
exports.remoteAssetAcceptHeader = 'image/png,image/apng,image/jpeg,image/webp,image/bmp,image/gif';
|
|
7
|
+
const extensionsForFileType = {
|
|
8
|
+
png: ['png'],
|
|
9
|
+
apng: ['png', 'apng'],
|
|
10
|
+
jpeg: ['jpg', 'jpeg'],
|
|
11
|
+
webp: ['webp'],
|
|
12
|
+
bmp: ['bmp'],
|
|
13
|
+
gif: ['gif'],
|
|
14
|
+
};
|
|
15
|
+
const getRemoteAssetFilename = ({ fileType, url, }) => {
|
|
16
|
+
const encodedBasename = url.pathname.slice(url.pathname.lastIndexOf('/') + 1);
|
|
17
|
+
let basename;
|
|
18
|
+
try {
|
|
19
|
+
basename = decodeURIComponent(encodedBasename);
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
basename = encodedBasename;
|
|
23
|
+
}
|
|
24
|
+
const sanitized = Array.from(basename)
|
|
25
|
+
.map((character) => {
|
|
26
|
+
const charCode = character.charCodeAt(0);
|
|
27
|
+
return charCode <= 31 || '<>:"/\\|?*'.includes(character)
|
|
28
|
+
? '-'
|
|
29
|
+
: character;
|
|
30
|
+
})
|
|
31
|
+
.join('')
|
|
32
|
+
.trim()
|
|
33
|
+
.replace(/^[. ]+|[. ]+$/g, '');
|
|
34
|
+
const filenameWithoutFallback = sanitized === '' ? 'image' : sanitized;
|
|
35
|
+
const extensions = extensionsForFileType[fileType.type];
|
|
36
|
+
const lastDot = filenameWithoutFallback.lastIndexOf('.');
|
|
37
|
+
const extension = lastDot > 0 ? filenameWithoutFallback.slice(lastDot + 1).toLowerCase() : '';
|
|
38
|
+
if (extensions.includes(extension)) {
|
|
39
|
+
return filenameWithoutFallback;
|
|
40
|
+
}
|
|
41
|
+
const withoutExtension = extension
|
|
42
|
+
? filenameWithoutFallback.slice(0, -(extension.length + 1))
|
|
43
|
+
: filenameWithoutFallback;
|
|
44
|
+
const safeName = withoutExtension === '' ? 'image' : withoutExtension;
|
|
45
|
+
return `${safeName}.${extensions[0]}`;
|
|
46
|
+
};
|
|
47
|
+
exports.getRemoteAssetFilename = getRemoteAssetFilename;
|
|
48
|
+
const getRemoteAssetElement = ({ assetPath, fileType, }) => ({
|
|
49
|
+
type: 'asset',
|
|
50
|
+
assetType: fileType.type === 'gif'
|
|
51
|
+
? 'gif'
|
|
52
|
+
: fileType.type === 'apng' ||
|
|
53
|
+
(fileType.type === 'webp' && fileType.animated)
|
|
54
|
+
? 'animated-image'
|
|
55
|
+
: 'image',
|
|
56
|
+
src: assetPath,
|
|
57
|
+
srcType: 'static',
|
|
58
|
+
dimensions: fileType.dimensions,
|
|
59
|
+
durationInFrames: null,
|
|
60
|
+
position: null,
|
|
61
|
+
});
|
|
62
|
+
exports.getRemoteAssetElement = getRemoteAssetElement;
|
|
@@ -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;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export type StudioEntryPointPaths = {
|
|
2
2
|
fastRefreshRuntime: string | null;
|
|
3
|
+
reactScan: string | null;
|
|
3
4
|
environmentSetup: string;
|
|
4
5
|
sequenceStackTraces: string | null;
|
|
5
6
|
userDefinedComponent: string;
|
|
6
7
|
reactShim: string;
|
|
7
8
|
studioRenderEntry: string;
|
|
8
9
|
};
|
|
9
|
-
export declare const getStudioEntryPoints: ({ fastRefreshRuntime, environmentSetup, sequenceStackTraces, userDefinedComponent, reactShim, studioRenderEntry, }: StudioEntryPointPaths) => [string, ...string[]];
|
|
10
|
+
export declare const getStudioEntryPoints: ({ fastRefreshRuntime, reactScan, environmentSetup, sequenceStackTraces, userDefinedComponent, reactShim, studioRenderEntry, }: StudioEntryPointPaths) => [string, ...string[]];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStudioEntryPoints = void 0;
|
|
4
|
-
const getStudioEntryPoints = ({ fastRefreshRuntime, environmentSetup, sequenceStackTraces, userDefinedComponent, reactShim, studioRenderEntry, }) => [
|
|
4
|
+
const getStudioEntryPoints = ({ fastRefreshRuntime, reactScan, environmentSetup, sequenceStackTraces, userDefinedComponent, reactShim, studioRenderEntry, }) => [
|
|
5
5
|
// Fast Refresh must come first because setup-environment imports ReactDOM.
|
|
6
6
|
// If ReactDOM is imported before Fast Refresh, Fast Refresh does not work.
|
|
7
7
|
fastRefreshRuntime,
|
|
8
|
+
reactScan,
|
|
8
9
|
environmentSetup,
|
|
9
10
|
sequenceStackTraces,
|
|
10
11
|
userDefinedComponent,
|
package/dist/studio-html.d.ts
CHANGED
|
@@ -30,7 +30,8 @@ export type StudioHtmlOptions = {
|
|
|
30
30
|
logLevel: LogLevel;
|
|
31
31
|
mode: 'dev' | 'bundle';
|
|
32
32
|
bundleScriptUrl?: string;
|
|
33
|
+
bundleScriptType?: 'classic' | 'module';
|
|
33
34
|
readOnlyStudio?: boolean;
|
|
34
35
|
studioRuntimeConfig?: StudioRuntimeConfig;
|
|
35
36
|
};
|
|
36
|
-
export declare const studioHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, experimentalKeepAudioContextAlive, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }: StudioHtmlOptions) => string;
|
|
37
|
+
export declare const studioHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, experimentalKeepAudioContextAlive, sampleRate, logLevel, mode, bundleScriptUrl, bundleScriptType, readOnlyStudio, studioRuntimeConfig, }: StudioHtmlOptions) => string;
|
package/dist/studio-html.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.studioHtml = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
|
-
const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, experimentalKeepAudioContextAlive, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }) => {
|
|
5
|
+
const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, experimentalKeepAudioContextAlive, sampleRate, logLevel, mode, bundleScriptUrl, bundleScriptType, readOnlyStudio, studioRuntimeConfig, }) => {
|
|
6
6
|
const scriptUrl = bundleScriptUrl !== null && bundleScriptUrl !== void 0 ? bundleScriptUrl : `${publicPath}bundle.js`;
|
|
7
7
|
const isRelativeBundle = mode === 'bundle' && publicPath === './';
|
|
8
8
|
const staticBaseValue = isRelativeBundle
|
|
@@ -89,7 +89,7 @@ const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHa
|
|
|
89
89
|
<div id="menuportal-3"></div>
|
|
90
90
|
<div id="menuportal-4"></div>
|
|
91
91
|
<div id="menuportal-5"></div>
|
|
92
|
-
<script src="${scriptUrl}"></script>
|
|
92
|
+
<script${bundleScriptType === 'module' ? ' type="module"' : ''} src="${scriptUrl}"></script>
|
|
93
93
|
</body>
|
|
94
94
|
</html>
|
|
95
95
|
`.trim();
|
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.516",
|
|
7
7
|
"description": "Internal package for shared objects between the Studio backend and frontend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"module": "dist/esm/index.mjs",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@remotion/studio-protocol": "4.0.
|
|
25
|
-
"remotion": "4.0.
|
|
24
|
+
"@remotion/studio-protocol": "4.0.516",
|
|
25
|
+
"remotion": "4.0.516"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@remotion/renderer": "4.0.
|
|
29
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
28
|
+
"@remotion/renderer": "4.0.516",
|
|
29
|
+
"@remotion/eslint-config-internal": "4.0.516",
|
|
30
30
|
"eslint": "9.19.0",
|
|
31
31
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
32
32
|
},
|