@remotion/studio 4.0.286 → 4.0.287
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/.turbo/turbo-make.log +2 -2
- package/dist/api/go-to-composition.d.ts +6 -0
- package/dist/api/go-to-composition.js +14 -0
- package/dist/api/pause.d.ts +1 -0
- package/dist/api/pause.js +13 -0
- package/dist/api/play.d.ts +2 -0
- package/dist/api/play.js +13 -0
- package/dist/api/seek.js +3 -3
- package/dist/api/toggle.d.ts +2 -0
- package/dist/api/toggle.js +13 -0
- package/dist/components/CompSelectorRef.d.ts +4 -0
- package/dist/components/CompSelectorRef.js +82 -0
- package/dist/components/CompositionSelector.d.ts +0 -3
- package/dist/components/CompositionSelector.js +6 -53
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -1
- package/dist/components/NewComposition/CodemodFooter.js +3 -3
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +1 -1
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -2
- package/dist/components/TimeValue.js +5 -2
- package/dist/esm/index.mjs +33 -9
- package/dist/esm/internals.mjs +2658 -2615
- package/dist/esm/previewEntry.mjs +2683 -2643
- package/dist/esm/renderEntry.mjs +2748 -2743
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/persist-open-folders.d.ts +6 -0
- package/dist/helpers/persist-open-folders.js +7 -1
- package/dist/helpers/presets-labels.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -1
- package/package.json +9 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/api/get-zod-schema-from-primitive.d.ts +0 -2
- package/dist/api/get-zod-schema-from-primitive.js +0 -13
- package/dist/api/use-visual-control.d.ts +0 -7
- package/dist/api/use-visual-control.js +0 -58
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.d.ts +0 -17
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +0 -91
- package/dist/components/VisualControls/ClickableFileName.d.ts +0 -3
- package/dist/components/VisualControls/ClickableFileName.js +0 -39
- package/dist/components/VisualControls/VisualControlHandle.d.ts +0 -8
- package/dist/components/VisualControls/VisualControlHandle.js +0 -34
- package/dist/components/VisualControls/VisualControlsContent.d.ts +0 -1
- package/dist/components/VisualControls/VisualControlsContent.js +0 -29
- package/dist/components/VisualControls/VisualControlsTabs.d.ts +0 -1
- package/dist/components/VisualControls/VisualControlsTabs.js +0 -11
- package/dist/components/VisualControls/get-original-stack-trace.d.ts +0 -2
- package/dist/components/VisualControls/get-original-stack-trace.js +0 -23
- package/dist/visual-controls/VisualControls.d.ts +0 -36
- package/dist/visual-controls/VisualControls.js +0 -118
- package/dist/visual-controls/get-current-edited-value.d.ts +0 -6
- package/dist/visual-controls/get-current-edited-value.js +0 -9
package/.turbo/turbo-make.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @remotion/studio@4.0.
|
|
3
|
+
> @remotion/studio@4.0.287 make /Users/jonathanburger/remotion/packages/studio
|
|
4
4
|
> tsc -d && bun --env-file=../.env.bundle bundle.ts
|
|
5
5
|
|
|
6
|
-
[0m[2m[[
|
|
6
|
+
[0m[2m[[1m46.52ms[0m[2m][0m Generated.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.goToComposition = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
/**
|
|
6
|
+
* Selects a composition in the Remotion Studio.
|
|
7
|
+
* @param compositionId - The ID of the composition to select.
|
|
8
|
+
* @see [Documentation](/docs/studio/go-to-composition)
|
|
9
|
+
*/
|
|
10
|
+
const goToComposition = (compositionId) => {
|
|
11
|
+
var _a;
|
|
12
|
+
(_a = remotion_1.Internals.compositionSelectorRef.current) === null || _a === void 0 ? void 0 : _a.selectComposition(compositionId);
|
|
13
|
+
};
|
|
14
|
+
exports.goToComposition = goToComposition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pause: () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pause = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
/*
|
|
6
|
+
* @description Pause the current composition.
|
|
7
|
+
* @see [Documentation](https://www.remotion.dev/docs/studio/pause)
|
|
8
|
+
*/
|
|
9
|
+
const pause = () => {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = remotion_1.Internals.timeValueRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
12
|
+
};
|
|
13
|
+
exports.pause = pause;
|
package/dist/api/play.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.play = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
/*
|
|
6
|
+
* @description Play the current composition.
|
|
7
|
+
* @see [Documentation](https://www.remotion.dev/docs/studio/play)
|
|
8
|
+
*/
|
|
9
|
+
const play = (e) => {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = remotion_1.Internals.timeValueRef.current) === null || _a === void 0 ? void 0 : _a.play(e);
|
|
12
|
+
};
|
|
13
|
+
exports.play = play;
|
package/dist/api/seek.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.seek = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
2
5
|
/*
|
|
3
6
|
* @description Jump to a different time in the timeline.
|
|
4
7
|
* @see [Documentation](https://www.remotion.dev/docs/studio/seek)
|
|
5
8
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.seek = void 0;
|
|
8
|
-
const remotion_1 = require("remotion");
|
|
9
9
|
const seek = (frame) => {
|
|
10
10
|
var _a;
|
|
11
11
|
(_a = remotion_1.Internals.timeValueRef.current) === null || _a === void 0 ? void 0 : _a.seek(Math.max(0, frame));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toggle = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
/*
|
|
6
|
+
* @description Toggle playback of the current composition.
|
|
7
|
+
* @see [Documentation](https://www.remotion.dev/docs/studio/toggle)
|
|
8
|
+
*/
|
|
9
|
+
const toggle = (e) => {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = remotion_1.Internals.timeValueRef.current) === null || _a === void 0 ? void 0 : _a.toggle(e);
|
|
12
|
+
};
|
|
13
|
+
exports.toggle = toggle;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompSelectorRef = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
8
|
+
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
9
|
+
const CompSelectorRef = ({ children }) => {
|
|
10
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
11
|
+
const [foldersExpanded, setFoldersExpanded] = (0, react_1.useState)((0, persist_open_folders_1.loadExpandedFolders)('compositions'));
|
|
12
|
+
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
13
|
+
const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
|
|
14
|
+
setFoldersExpanded((p) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const key = (0, persist_open_folders_1.openFolderKey)({ folderName, parentName });
|
|
17
|
+
const prev = (_a = p[key]) !== null && _a !== void 0 ? _a : false;
|
|
18
|
+
const foldersExpandedState = {
|
|
19
|
+
...p,
|
|
20
|
+
[key]: !prev,
|
|
21
|
+
};
|
|
22
|
+
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
|
|
23
|
+
return foldersExpandedState;
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
(0, react_1.useImperativeHandle)(remotion_1.Internals.compositionSelectorRef, () => {
|
|
27
|
+
return {
|
|
28
|
+
expandComposition: (compName) => {
|
|
29
|
+
const compositionToExpand = compositions.find((c) => c.id === compName);
|
|
30
|
+
if (!compositionToExpand) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const { folderName, parentFolderName } = compositionToExpand;
|
|
34
|
+
if (folderName === null) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setFoldersExpanded((previousState) => {
|
|
38
|
+
const foldersExpandedState = {
|
|
39
|
+
...previousState,
|
|
40
|
+
};
|
|
41
|
+
const currentFolder = folderName;
|
|
42
|
+
const currentParentName = parentFolderName;
|
|
43
|
+
const key = (0, persist_open_folders_1.openFolderKey)({
|
|
44
|
+
folderName: currentFolder,
|
|
45
|
+
parentName: currentParentName,
|
|
46
|
+
});
|
|
47
|
+
const splitted = key.split('/');
|
|
48
|
+
for (let i = 0; i < splitted.length - 1; i++) {
|
|
49
|
+
const allExceptLast = i === 0
|
|
50
|
+
? (0, persist_open_folders_1.openFolderKey)({
|
|
51
|
+
folderName: splitted.filter((s) => s !== 'no-parent')[0],
|
|
52
|
+
parentName: null,
|
|
53
|
+
})
|
|
54
|
+
: splitted.slice(0, i + 1).join('/');
|
|
55
|
+
foldersExpandedState[allExceptLast] = true;
|
|
56
|
+
}
|
|
57
|
+
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
|
|
58
|
+
return foldersExpandedState;
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
selectComposition: (compName) => {
|
|
62
|
+
const comp = compositions.find((c) => c.id === compName);
|
|
63
|
+
if (!comp) {
|
|
64
|
+
throw new Error(`Composition ${compName} not found`);
|
|
65
|
+
}
|
|
66
|
+
selectComposition(comp, true);
|
|
67
|
+
},
|
|
68
|
+
toggleFolder: (folderName, parentName) => {
|
|
69
|
+
toggleFolder(folderName, parentName);
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}, [compositions, selectComposition, toggleFolder]);
|
|
73
|
+
const contextValue = (0, react_1.useMemo)(() => {
|
|
74
|
+
return {
|
|
75
|
+
foldersExpanded,
|
|
76
|
+
setFoldersExpanded,
|
|
77
|
+
toggleFolder,
|
|
78
|
+
};
|
|
79
|
+
}, [foldersExpanded, setFoldersExpanded, toggleFolder]);
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(persist_open_folders_1.ExpandedFoldersContext.Provider, { value: contextValue, children: children }));
|
|
81
|
+
};
|
|
82
|
+
exports.CompSelectorRef = CompSelectorRef;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const getKeysToExpand: (initialFolderName: string, parentFolderName: string | null, initial?: string[]) => string[];
|
|
3
|
-
export declare const compositionSelectorRef: React.RefObject<{
|
|
4
|
-
expandComposition: (compName: string) => void;
|
|
5
|
-
} | null>;
|
|
6
3
|
export declare const CompositionSelector: React.FC;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompositionSelector = exports.
|
|
3
|
+
exports.CompositionSelector = exports.getKeysToExpand = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
@@ -30,62 +30,11 @@ const getKeysToExpand = (initialFolderName, parentFolderName, initial = []) => {
|
|
|
30
30
|
return (0, exports.getKeysToExpand)(name, parent, initial);
|
|
31
31
|
};
|
|
32
32
|
exports.getKeysToExpand = getKeysToExpand;
|
|
33
|
-
exports.compositionSelectorRef = (0, react_1.createRef)();
|
|
34
33
|
const CompositionSelector = () => {
|
|
35
34
|
const { compositions, canvasContent, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
36
|
-
const
|
|
35
|
+
const { foldersExpanded } = (0, react_1.useContext)(persist_open_folders_1.ExpandedFoldersContext);
|
|
37
36
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
38
37
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
39
|
-
const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
|
|
40
|
-
setFoldersExpanded((p) => {
|
|
41
|
-
var _a;
|
|
42
|
-
const key = (0, persist_open_folders_1.openFolderKey)({ folderName, parentName });
|
|
43
|
-
const prev = (_a = p[key]) !== null && _a !== void 0 ? _a : false;
|
|
44
|
-
const foldersExpandedState = {
|
|
45
|
-
...p,
|
|
46
|
-
[key]: !prev,
|
|
47
|
-
};
|
|
48
|
-
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
|
|
49
|
-
return foldersExpandedState;
|
|
50
|
-
});
|
|
51
|
-
}, []);
|
|
52
|
-
(0, react_1.useImperativeHandle)(exports.compositionSelectorRef, () => {
|
|
53
|
-
return {
|
|
54
|
-
expandComposition: (compName) => {
|
|
55
|
-
const compositionToExpand = compositions.find((c) => c.id === compName);
|
|
56
|
-
if (!compositionToExpand) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const { folderName, parentFolderName } = compositionToExpand;
|
|
60
|
-
if (folderName === null) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
setFoldersExpanded((previousState) => {
|
|
64
|
-
const foldersExpandedState = {
|
|
65
|
-
...previousState,
|
|
66
|
-
};
|
|
67
|
-
const currentFolder = folderName;
|
|
68
|
-
const currentParentName = parentFolderName;
|
|
69
|
-
const key = (0, persist_open_folders_1.openFolderKey)({
|
|
70
|
-
folderName: currentFolder,
|
|
71
|
-
parentName: currentParentName,
|
|
72
|
-
});
|
|
73
|
-
const splitted = key.split('/');
|
|
74
|
-
for (let i = 0; i < splitted.length - 1; i++) {
|
|
75
|
-
const allExceptLast = i === 0
|
|
76
|
-
? (0, persist_open_folders_1.openFolderKey)({
|
|
77
|
-
folderName: splitted.filter((s) => s !== 'no-parent')[0],
|
|
78
|
-
parentName: null,
|
|
79
|
-
})
|
|
80
|
-
: splitted.slice(0, i + 1).join('/');
|
|
81
|
-
foldersExpandedState[allExceptLast] = true;
|
|
82
|
-
}
|
|
83
|
-
(0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
|
|
84
|
-
return foldersExpandedState;
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
}, [compositions]);
|
|
89
38
|
const items = (0, react_1.useMemo)(() => {
|
|
90
39
|
return (0, create_folder_tree_1.createFolderTree)(compositions, folders, foldersExpanded);
|
|
91
40
|
}, [compositions, folders, foldersExpanded]);
|
|
@@ -98,6 +47,10 @@ const CompositionSelector = () => {
|
|
|
98
47
|
overflowY: 'auto',
|
|
99
48
|
};
|
|
100
49
|
}, [showCurrentComposition]);
|
|
50
|
+
const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = remotion_1.Internals.compositionSelectorRef.current) === null || _a === void 0 ? void 0 : _a.toggleFolder(folderName, parentName);
|
|
53
|
+
}, []);
|
|
101
54
|
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [showCurrentComposition ? (0, jsx_runtime_1.jsx)(CurrentComposition_1.CurrentComposition, {}) : null, (0, jsx_runtime_1.jsx)("div", { className: "__remotion-vertical-scrollbar", style: list, children: items.map((c) => {
|
|
102
55
|
return ((0, jsx_runtime_1.jsx)(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: showCurrentComposition ? canvasContent.compositionId : null, selectComposition: selectComposition, toggleFolder: toggleFolder, tabIndex: tabIndex, item: c }, c.key + c.type));
|
|
103
56
|
}) })] }));
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const AssetSelector_1 = require("./AssetSelector");
|
|
8
8
|
const CompositionSelector_1 = require("./CompositionSelector");
|
|
9
|
+
const CompSelectorRef_1 = require("./CompSelectorRef");
|
|
9
10
|
const Tabs_1 = require("./Tabs");
|
|
10
11
|
const container = {
|
|
11
12
|
height: '100%',
|
|
@@ -52,6 +53,6 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
|
|
|
52
53
|
},
|
|
53
54
|
};
|
|
54
55
|
}, []);
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'compositions', onClick: onCompositionsSelected, children: "Compositions" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'assets', onClick: onAssetsSelected, children: "Assets" })] }) }), panel === 'compositions' ? ((0, jsx_runtime_1.jsx)(CompositionSelector_1.CompositionSelector, {})) : ((0, jsx_runtime_1.jsx)(AssetSelector_1.AssetSelector, { readOnlyStudio: readOnlyStudio }))] }));
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(CompSelectorRef_1.CompSelectorRef, { children: (0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'compositions', onClick: onCompositionsSelected, children: "Compositions" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'assets', onClick: onAssetsSelected, children: "Assets" })] }) }), panel === 'compositions' ? ((0, jsx_runtime_1.jsx)(CompositionSelector_1.CompositionSelector, {})) : ((0, jsx_runtime_1.jsx)(AssetSelector_1.AssetSelector, { readOnlyStudio: readOnlyStudio }))] }) }));
|
|
56
57
|
};
|
|
57
58
|
exports.ExplorerPanel = ExplorerPanel;
|
|
@@ -4,7 +4,7 @@ export declare const CodemodFooter: React.FC<{
|
|
|
4
4
|
readonly valid: boolean;
|
|
5
5
|
readonly codemod: RecastCodemod;
|
|
6
6
|
readonly loadingNotification: React.ReactNode;
|
|
7
|
-
readonly
|
|
7
|
+
readonly successNotification: React.ReactNode;
|
|
8
8
|
readonly errorNotification: string;
|
|
9
9
|
readonly genericSubmitLabel: string;
|
|
10
10
|
readonly submitLabel: (options: {
|
|
@@ -11,7 +11,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
11
11
|
const actions_1 = require("../RenderQueue/actions");
|
|
12
12
|
const layout_1 = require("../layout");
|
|
13
13
|
const DiffPreview_1 = require("./DiffPreview");
|
|
14
|
-
const CodemodFooter = ({ codemod, valid, loadingNotification,
|
|
14
|
+
const CodemodFooter = ({ codemod, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, }) => {
|
|
15
15
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
16
16
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
17
17
|
const [codemodStatus, setCanApplyCodemod] = (0, react_1.useState)({
|
|
@@ -41,7 +41,7 @@ const CodemodFooter = ({ codemod, valid, loadingNotification, succeessNotifcatio
|
|
|
41
41
|
signal: new AbortController().signal,
|
|
42
42
|
})
|
|
43
43
|
.then(() => {
|
|
44
|
-
notification.replaceContent(
|
|
44
|
+
notification.replaceContent(successNotification, 2000);
|
|
45
45
|
})
|
|
46
46
|
.catch((err) => {
|
|
47
47
|
notification.replaceContent(`${errorNotification}: ${err.message}`, 2000);
|
|
@@ -51,7 +51,7 @@ const CodemodFooter = ({ codemod, valid, loadingNotification, succeessNotifcatio
|
|
|
51
51
|
errorNotification,
|
|
52
52
|
loadingNotification,
|
|
53
53
|
setSelectedModal,
|
|
54
|
-
|
|
54
|
+
successNotification,
|
|
55
55
|
]);
|
|
56
56
|
const getCanApplyCodemod = (0, react_1.useCallback)(async (signal) => {
|
|
57
57
|
const res = await (0, actions_1.applyCodemod)({
|
|
@@ -30,7 +30,7 @@ const DeleteCompositionLoaded = ({ compositionId }) => {
|
|
|
30
30
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
31
31
|
e.preventDefault();
|
|
32
32
|
}, []);
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: 'Delete composition' }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsxs)("div", { style: content, children: ["Do you want to delete the", ' ', (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: unresolved.durationInFrames === 1 ? `<Still>` : '<Composition>' }), ' ', "with ID ", '"', unresolved.id, '"', "?", (0, jsx_runtime_1.jsx)("br", {}), "The associated ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "component" }), " will remain in your code."] }), (0, jsx_runtime_1.jsx)(ModalFooter_1.ModalFooterContainer, { children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting',
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: 'Delete composition' }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsxs)("div", { style: content, children: ["Do you want to delete the", ' ', (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: unresolved.durationInFrames === 1 ? `<Still>` : '<Composition>' }), ' ', "with ID ", '"', unresolved.id, '"', "?", (0, jsx_runtime_1.jsx)("br", {}), "The associated ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "component" }), " will remain in your code."] }), (0, jsx_runtime_1.jsx)(ModalFooter_1.ModalFooterContainer, { children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting', successNotification: `Deleted ${unresolved.id}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, valid: true }) })] })] }));
|
|
34
34
|
};
|
|
35
35
|
const DeleteComposition = ({ compositionId }) => {
|
|
36
36
|
return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: compositionId, children: (0, jsx_runtime_1.jsx)(DeleteCompositionLoaded, { compositionId: compositionId }) }) }));
|
|
@@ -172,7 +172,7 @@ const DuplicateCompositionLoaded = ({ initialType }) => {
|
|
|
172
172
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: `Duplicate ${resolved.result.id}` }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsxs)("div", { style: content, children: [initialCompType === 'composition' ? (
|
|
173
173
|
// We allow converting from a composition to a still, but
|
|
174
174
|
// not the other way around
|
|
175
|
-
(0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] })) : null, (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ID" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })] })) : null] }) })] }), hadDimensionsDefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })] })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })] })) : null] })] })] })) : null, type === 'composition' && hadDurationDefined ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames })) : null, type === 'composition' && hadFpsDefined ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "FPS" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })] })) : null] }), (0, jsx_runtime_1.jsx)(ModalFooter_1.ModalFooterContainer, { children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition',
|
|
175
|
+
(0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] })) : null, (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ID" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })] })) : null] }) })] }), hadDimensionsDefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })] })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })] })) : null] })] })] })) : null, type === 'composition' && hadDurationDefined ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames })) : null, type === 'composition' && hadFpsDefined ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "FPS" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })] })) : null] }), (0, jsx_runtime_1.jsx)(ModalFooter_1.ModalFooterContainer, { children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition', successNotification: `Duplicated ${unresolved.id} as ${newId}`, genericSubmitLabel: 'Duplicate', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, valid: valid }) })] })] }));
|
|
176
176
|
};
|
|
177
177
|
const DuplicateComposition = ({ compositionId, compositionType }) => {
|
|
178
178
|
return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: compositionId, children: (0, jsx_runtime_1.jsx)(DuplicateCompositionLoaded, { initialType: compositionType }) }) }));
|
|
@@ -48,7 +48,7 @@ const RenameCompositionLoaded = () => {
|
|
|
48
48
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
49
49
|
e.preventDefault();
|
|
50
50
|
}, []);
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: `Rename ${resolved.result.id}` }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsx)("div", { style: content, children: (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ID" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })] })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(ModalFooter_1.ModalFooterContainer, { children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition',
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: `Rename ${resolved.result.id}` }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsx)("div", { style: content, children: (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ID" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })] })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(ModalFooter_1.ModalFooterContainer, { children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition', successNotification: `Renamed to ${newId}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, valid: valid }) })] })] }));
|
|
52
52
|
};
|
|
53
53
|
const RenameComposition = ({ compositionId }) => {
|
|
54
54
|
return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: compositionId, children: (0, jsx_runtime_1.jsx)(RenameCompositionLoaded, {}) }) }));
|
|
@@ -9,7 +9,6 @@ const is_composition_still_1 = require("../../helpers/is-composition-still");
|
|
|
9
9
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
10
10
|
const use_menu_structure_1 = require("../../helpers/use-menu-structure");
|
|
11
11
|
const modals_1 = require("../../state/modals");
|
|
12
|
-
const CompositionSelector_1 = require("../CompositionSelector");
|
|
13
12
|
const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
|
|
14
13
|
const KeyboardShortcutsExplainer_1 = require("../KeyboardShortcutsExplainer");
|
|
15
14
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
@@ -136,7 +135,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
136
135
|
selectComposition(c, true);
|
|
137
136
|
setSelectedModal(null);
|
|
138
137
|
const selector = `.__remotion-composition[data-compname="${c.id}"]`;
|
|
139
|
-
(_a =
|
|
138
|
+
(_a = remotion_1.Internals.compositionSelectorRef.current) === null || _a === void 0 ? void 0 : _a.expandComposition(c.id);
|
|
140
139
|
waitForElm(selector).then(() => {
|
|
141
140
|
var _a;
|
|
142
141
|
(_a = document
|
|
@@ -40,7 +40,7 @@ const TimeValue = () => {
|
|
|
40
40
|
const frame = (0, remotion_1.useCurrentFrame)();
|
|
41
41
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
42
42
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
43
|
-
const { seek } = player_1.PlayerInternals.usePlayer();
|
|
43
|
+
const { seek, play, pause, toggle } = player_1.PlayerInternals.usePlayer();
|
|
44
44
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
45
45
|
const ref = (0, react_1.useRef)(null);
|
|
46
46
|
const onTextChange = (0, react_1.useCallback)((newVal) => {
|
|
@@ -55,7 +55,10 @@ const TimeValue = () => {
|
|
|
55
55
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
56
56
|
},
|
|
57
57
|
seek,
|
|
58
|
-
|
|
58
|
+
play,
|
|
59
|
+
pause,
|
|
60
|
+
toggle,
|
|
61
|
+
}), [seek, play, pause, toggle]);
|
|
59
62
|
(0, react_1.useEffect)(() => {
|
|
60
63
|
const gKey = keybindings.registerKeybinding({
|
|
61
64
|
event: 'keypress',
|
package/dist/esm/index.mjs
CHANGED
|
@@ -134,13 +134,18 @@ var getStaticFiles = () => {
|
|
|
134
134
|
}
|
|
135
135
|
return window.remotion_staticFiles;
|
|
136
136
|
};
|
|
137
|
+
// src/api/go-to-composition.ts
|
|
138
|
+
import { Internals } from "remotion";
|
|
139
|
+
var goToComposition = (compositionId) => {
|
|
140
|
+
Internals.compositionSelectorRef.current?.selectComposition(compositionId);
|
|
141
|
+
};
|
|
137
142
|
// src/api/helpers/calc-new-props.ts
|
|
138
|
-
import { Internals, getRemotionEnvironment as getRemotionEnvironment2 } from "remotion";
|
|
143
|
+
import { Internals as Internals2, getRemotionEnvironment as getRemotionEnvironment2 } from "remotion";
|
|
139
144
|
var calcNewProps = (compositionId, defaultProps) => {
|
|
140
145
|
if (!getRemotionEnvironment2().isStudio) {
|
|
141
146
|
throw new Error("saveDefaultProps can only be called in the Remotion Studio.");
|
|
142
147
|
}
|
|
143
|
-
const { compositionsRef, editorPropsProviderRef } =
|
|
148
|
+
const { compositionsRef, editorPropsProviderRef } = Internals2;
|
|
144
149
|
const compositionsStore = compositionsRef.current;
|
|
145
150
|
if (!compositionsStore) {
|
|
146
151
|
throw new Error("No compositions ref found. Are you in the Remotion Studio and are the Remotion versions aligned?");
|
|
@@ -167,10 +172,20 @@ var calcNewProps = (compositionId, defaultProps) => {
|
|
|
167
172
|
};
|
|
168
173
|
};
|
|
169
174
|
|
|
175
|
+
// src/api/pause.ts
|
|
176
|
+
import { Internals as Internals3 } from "remotion";
|
|
177
|
+
var pause = () => {
|
|
178
|
+
Internals3.timeValueRef.current?.pause();
|
|
179
|
+
};
|
|
180
|
+
// src/api/play.ts
|
|
181
|
+
import { Internals as Internals4 } from "remotion";
|
|
182
|
+
var play = (e) => {
|
|
183
|
+
Internals4.timeValueRef.current?.play(e);
|
|
184
|
+
};
|
|
170
185
|
// src/api/reevaluate-composition.ts
|
|
171
|
-
import { Internals as
|
|
186
|
+
import { Internals as Internals5 } from "remotion";
|
|
172
187
|
var reevaluateComposition = () => {
|
|
173
|
-
|
|
188
|
+
Internals5.resolveCompositionsRef.current?.reloadCurrentlySelectedComposition();
|
|
174
189
|
};
|
|
175
190
|
// src/api/restart-studio.ts
|
|
176
191
|
import { getRemotionEnvironment as getRemotionEnvironment3 } from "remotion";
|
|
@@ -340,18 +355,23 @@ var saveDefaultProps = async ({
|
|
|
340
355
|
return Promise.reject(err);
|
|
341
356
|
};
|
|
342
357
|
// src/api/seek.ts
|
|
343
|
-
import { Internals as
|
|
358
|
+
import { Internals as Internals6 } from "remotion";
|
|
344
359
|
var seek = (frame) => {
|
|
345
|
-
|
|
360
|
+
Internals6.timeValueRef.current?.seek(Math.max(0, frame));
|
|
361
|
+
};
|
|
362
|
+
// src/api/toggle.ts
|
|
363
|
+
import { Internals as Internals7 } from "remotion";
|
|
364
|
+
var toggle = (e) => {
|
|
365
|
+
Internals7.timeValueRef.current?.toggle(e);
|
|
346
366
|
};
|
|
347
367
|
// src/api/update-default-props.ts
|
|
348
|
-
import { Internals as
|
|
368
|
+
import { Internals as Internals8 } from "remotion";
|
|
349
369
|
var updateDefaultProps = ({
|
|
350
370
|
compositionId,
|
|
351
371
|
defaultProps
|
|
352
372
|
}) => {
|
|
353
373
|
const { generatedDefaultProps, composition } = calcNewProps(compositionId, defaultProps);
|
|
354
|
-
const propsStore =
|
|
374
|
+
const propsStore = Internals8.editorPropsProviderRef.current;
|
|
355
375
|
if (!propsStore) {
|
|
356
376
|
throw new Error("No props store found. Are you in the Remotion Studio and are the Remotion versions aligned?");
|
|
357
377
|
}
|
|
@@ -361,7 +381,7 @@ var updateDefaultProps = ({
|
|
|
361
381
|
[composition.id]: generatedDefaultProps
|
|
362
382
|
};
|
|
363
383
|
});
|
|
364
|
-
window.dispatchEvent(new CustomEvent(
|
|
384
|
+
window.dispatchEvent(new CustomEvent(Internals8.PROPS_UPDATED_EXTERNALLY, {
|
|
365
385
|
detail: {
|
|
366
386
|
resetUnsaved: false
|
|
367
387
|
}
|
|
@@ -458,10 +478,14 @@ export {
|
|
|
458
478
|
watchStaticFile,
|
|
459
479
|
watchPublicFolder,
|
|
460
480
|
updateDefaultProps,
|
|
481
|
+
toggle,
|
|
461
482
|
seek,
|
|
462
483
|
saveDefaultProps,
|
|
463
484
|
restartStudio,
|
|
464
485
|
reevaluateComposition,
|
|
486
|
+
play,
|
|
487
|
+
pause,
|
|
488
|
+
goToComposition,
|
|
465
489
|
getStaticFiles,
|
|
466
490
|
focusDefaultPropsPath,
|
|
467
491
|
deleteStaticFile,
|