@remotion/studio 4.0.481 → 4.0.483
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/components/Canvas.js +19 -0
- package/dist/components/Editor.js +1 -1
- package/dist/components/GlobalKeybindings.js +1 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -2
- package/dist/components/InspectorPanel/styles.js +2 -0
- package/dist/components/InspectorSequenceSection.js +45 -2
- package/dist/components/MediaVolumeProvider.js +4 -4
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +25 -3
- package/dist/components/NewComposition/InputDragger.d.ts +4 -0
- package/dist/components/NewComposition/InputDragger.js +18 -2
- package/dist/components/NewComposition/NewComposition.d.ts +2 -0
- package/dist/components/NewComposition/NewComposition.js +178 -0
- package/dist/components/PreviewToolbar.js +3 -3
- package/dist/components/SelectedOutlineOverlay.d.ts +6 -0
- package/dist/components/SelectedOutlineOverlay.js +18 -2
- package/dist/components/SelectedOutlineUvControls.js +461 -2
- package/dist/components/Timeline/EasingEditorModal.js +39 -1
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineEffectItem.js +8 -5
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +2 -2
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +6 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +13 -4
- package/dist/components/Timeline/TimelineSelection.js +100 -39
- package/dist/components/Timeline/TimelineSequence.js +20 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +17 -16
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +40 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +308 -1
- package/dist/components/Timeline/TimelineTrack.js +2 -4
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +4 -0
- package/dist/components/Timeline/should-subscribe-to-sequence-props.js +10 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +3 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +2 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +19 -13
- package/dist/components/composition-menu-items.js +17 -0
- package/dist/components/element-drag-and-drop.d.ts +3 -0
- package/dist/components/element-drag-and-drop.js +30 -0
- package/dist/components/import-assets.d.ts +11 -0
- package/dist/components/import-assets.js +23 -1
- package/dist/components/selected-outline-uv.d.ts +71 -1
- package/dist/components/selected-outline-uv.js +332 -10
- package/dist/esm/{chunk-4rq5gt8c.js → chunk-fq0j774v.js} +3438 -1648
- package/dist/esm/internals.mjs +3438 -1648
- package/dist/esm/previewEntry.mjs +3455 -1665
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +6 -2
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -0
- package/dist/helpers/get-sequence-visible-range.js +15 -1
- package/dist/helpers/timeline-layout.d.ts +3 -3
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/state/modals.d.ts +2 -0
- package/package.json +11 -11
- package/dist/components/Timeline/TimelineItemStack.d.ts +0 -5
- package/dist/components/Timeline/TimelineItemStack.js +0 -29
|
@@ -23,6 +23,7 @@ const EditorGuides_1 = __importDefault(require("./EditorGuides"));
|
|
|
23
23
|
const EditorRuler_1 = require("./EditorRuler");
|
|
24
24
|
const use_is_ruler_visible_1 = require("./EditorRuler/use-is-ruler-visible");
|
|
25
25
|
const effect_drag_and_drop_1 = require("./effect-drag-and-drop");
|
|
26
|
+
const element_drag_and_drop_1 = require("./element-drag-and-drop");
|
|
26
27
|
const import_assets_1 = require("./import-assets");
|
|
27
28
|
const layout_1 = require("./layout");
|
|
28
29
|
const Preview_1 = require("./Preview");
|
|
@@ -57,6 +58,11 @@ const isComponentDragEvent = (event) => {
|
|
|
57
58
|
var _b;
|
|
58
59
|
return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.COMPONENT_DRAG_MIME_TYPE);
|
|
59
60
|
};
|
|
61
|
+
const isElementDragEvent = (event) => {
|
|
62
|
+
var _a;
|
|
63
|
+
var _b;
|
|
64
|
+
return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.ELEMENT_DRAG_MIME_TYPE);
|
|
65
|
+
};
|
|
60
66
|
const isSfxDragEvent = (event) => {
|
|
61
67
|
var _a;
|
|
62
68
|
var _b;
|
|
@@ -66,6 +72,7 @@ const isRemoteAssetDragEvent = (event) => {
|
|
|
66
72
|
return (!isFileDragEvent(event) &&
|
|
67
73
|
!isAssetDragEvent(event) &&
|
|
68
74
|
!isComponentDragEvent(event) &&
|
|
75
|
+
!isElementDragEvent(event) &&
|
|
69
76
|
!isSfxDragEvent(event) &&
|
|
70
77
|
(0, remote_asset_drag_1.hasRemoteAssetDragData)(event.dataTransfer));
|
|
71
78
|
};
|
|
@@ -560,6 +567,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
560
567
|
(!isFileDragEvent(event) &&
|
|
561
568
|
!isAssetDragEvent(event) &&
|
|
562
569
|
!isComponentDragEvent(event) &&
|
|
570
|
+
!isElementDragEvent(event) &&
|
|
563
571
|
!isSfxDragEvent(event) &&
|
|
564
572
|
!isRemoteAssetDragEvent(event)) ||
|
|
565
573
|
!isDragEventInsideCanvas(event)) {
|
|
@@ -579,6 +587,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
579
587
|
(!isFileDragEvent(event) &&
|
|
580
588
|
!isAssetDragEvent(event) &&
|
|
581
589
|
!isComponentDragEvent(event) &&
|
|
590
|
+
!isElementDragEvent(event) &&
|
|
582
591
|
!isSfxDragEvent(event) &&
|
|
583
592
|
!isRemoteAssetDragEvent(event)) ||
|
|
584
593
|
!isDragEventInsideCanvas(event)) {
|
|
@@ -636,6 +645,16 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
636
645
|
});
|
|
637
646
|
}
|
|
638
647
|
else {
|
|
648
|
+
const elementDragData = (0, element_drag_and_drop_1.getElementDragData)(event.dataTransfer);
|
|
649
|
+
if (elementDragData !== null) {
|
|
650
|
+
await (0, import_assets_1.insertElement)({
|
|
651
|
+
element: elementDragData.element,
|
|
652
|
+
compositionFile,
|
|
653
|
+
compositionId: currentCompositionId,
|
|
654
|
+
dropPosition,
|
|
655
|
+
});
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
639
658
|
const componentDragData = getComponentDragData(event);
|
|
640
659
|
if (componentDragData !== null) {
|
|
641
660
|
await (0, import_assets_1.insertComponent)({
|
|
@@ -107,6 +107,6 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
107
107
|
] }) })
|
|
108
108
|
] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
|
|
109
109
|
] }) }) }));
|
|
110
|
-
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density:
|
|
110
|
+
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density: 1.5, children: editor })) : (editor);
|
|
111
111
|
};
|
|
112
112
|
exports.Editor = Editor;
|
|
@@ -92,7 +92,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
92
92
|
if (sequenceSelected) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
selectItems([sequenceSelection]);
|
|
95
|
+
selectItems([sequenceSelection], { reveal: true });
|
|
96
96
|
}, [selectItems, sequenceSelected, sequenceSelection]);
|
|
97
97
|
if (previewServerState.type !== 'connected') {
|
|
98
98
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Studio server disconnected" });
|
|
@@ -112,6 +112,7 @@ const SequenceSelectionInspector = ({ selection }) => {
|
|
|
112
112
|
if (!track) {
|
|
113
113
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
const stackKey = track.sequence.getStack();
|
|
116
|
+
return (jsx_runtime_1.jsx(SequenceExpandedInspector, { track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id));
|
|
116
117
|
};
|
|
117
118
|
exports.SequenceSelectionInspector = SequenceSelectionInspector;
|
|
@@ -36,6 +36,7 @@ exports.sectionHeader = {
|
|
|
36
36
|
fontSize: 12,
|
|
37
37
|
fontWeight: 'bold',
|
|
38
38
|
padding: `8px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px`,
|
|
39
|
+
userSelect: 'none',
|
|
39
40
|
};
|
|
40
41
|
exports.sequenceHeader = {
|
|
41
42
|
backgroundColor: colors_1.BACKGROUND,
|
|
@@ -96,6 +97,7 @@ exports.sectionHeaderTitle = {
|
|
|
96
97
|
minWidth: 0,
|
|
97
98
|
overflow: 'hidden',
|
|
98
99
|
textOverflow: 'ellipsis',
|
|
100
|
+
userSelect: 'none',
|
|
99
101
|
whiteSpace: 'nowrap',
|
|
100
102
|
};
|
|
101
103
|
exports.sectionHeaderStart = {
|
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.InspectorSequenceSection = exports.hasSequenceControls = exports.getInspectorSelectableItems = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const client_id_1 = require("../helpers/client-id");
|
|
7
40
|
const colors_1 = require("../helpers/colors");
|
|
8
41
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
@@ -55,6 +88,15 @@ const isEffectsRoot = (node) => {
|
|
|
55
88
|
const getInspectorExpansionKey = (nodePathInfo) => {
|
|
56
89
|
return JSON.stringify(nodePathInfo);
|
|
57
90
|
};
|
|
91
|
+
const getInspectorControlGroups = (rows) => {
|
|
92
|
+
return timeline_layout_1.SCHEMA_FIELD_GROUPS.map((group) => ({
|
|
93
|
+
...group,
|
|
94
|
+
rows: rows.filter(({ node }) => {
|
|
95
|
+
var _a;
|
|
96
|
+
return node.kind === 'field' && ((_a = node.field) === null || _a === void 0 ? void 0 : _a.group) === group.id;
|
|
97
|
+
}),
|
|
98
|
+
})).filter((group) => group.rows.length > 0);
|
|
99
|
+
};
|
|
58
100
|
const getInspectorSelectableItems = (rows) => {
|
|
59
101
|
return rows.flatMap(({ node }) => {
|
|
60
102
|
const selection = (0, TimelineSelection_1.getTimelineSelectionFromNodePathInfo)(node.nodePathInfo);
|
|
@@ -116,6 +158,7 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
116
158
|
}, [getIsExpanded, tree]);
|
|
117
159
|
const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(controlRows), [controlRows]);
|
|
118
160
|
const effectSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(effectRows), [effectRows]);
|
|
161
|
+
const controlGroups = (0, react_1.useMemo)(() => getInspectorControlGroups(controlRows), [controlRows]);
|
|
119
162
|
const { schema } = sequence.controls;
|
|
120
163
|
const showEffectsSection = nodePathInfo.supportsEffects || effectRows.length > 0;
|
|
121
164
|
const showControlsEffectsDivider = controlRows.length > 0 && showEffectsSection;
|
|
@@ -152,6 +195,6 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
152
195
|
] }));
|
|
153
196
|
}
|
|
154
197
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
155
|
-
jsx_runtime_1.jsx("div", { style: divider }), controlRows.length > 0 ?
|
|
198
|
+
jsx_runtime_1.jsx("div", { style: divider }), controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group, i) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i === 0 ? null : jsx_runtime_1.jsx("div", { style: controlsEffectsDivider }), renderSectionHeader(group.label), group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showControlsEffectsDivider ? (jsx_runtime_1.jsx("div", { style: controlsEffectsDivider })) : null, renderEffectsHeader(), effectRows.length === 0 ? (jsx_runtime_1.jsx("div", { style: emptyState, children: "None" })) : (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) }))] })) : null] }));
|
|
156
199
|
};
|
|
157
200
|
exports.InspectorSequenceSection = InspectorSequenceSection;
|
|
@@ -6,17 +6,17 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const mute_1 = require("../state/mute");
|
|
8
8
|
const MediaVolumeProvider = ({ children }) => {
|
|
9
|
-
const [
|
|
9
|
+
const [playerMuted, setPlayerMuted] = (0, react_1.useState)(() => (0, mute_1.loadMuteOption)());
|
|
10
10
|
const [mediaVolume, setMediaVolume] = (0, react_1.useState)(1);
|
|
11
11
|
const mediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
12
12
|
return {
|
|
13
|
-
|
|
13
|
+
playerMuted,
|
|
14
14
|
mediaVolume,
|
|
15
15
|
};
|
|
16
|
-
}, [
|
|
16
|
+
}, [playerMuted, mediaVolume]);
|
|
17
17
|
const setMediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
18
18
|
return {
|
|
19
|
-
|
|
19
|
+
setPlayerMuted,
|
|
20
20
|
setMediaVolume,
|
|
21
21
|
};
|
|
22
22
|
}, []);
|
|
@@ -15,6 +15,7 @@ const InstallPackage_1 = require("./InstallPackage");
|
|
|
15
15
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
16
16
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
17
17
|
const DuplicateComposition_1 = require("./NewComposition/DuplicateComposition");
|
|
18
|
+
const NewComposition_1 = require("./NewComposition/NewComposition");
|
|
18
19
|
const RenameComposition_1 = require("./NewComposition/RenameComposition");
|
|
19
20
|
const RenameFolder_1 = require("./NewComposition/RenameFolder");
|
|
20
21
|
const RenameStaticFile_1 = require("./NewComposition/RenameStaticFile");
|
|
@@ -30,7 +31,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
30
31
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
31
32
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
32
33
|
'connected';
|
|
33
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, {})), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
35
|
modalContextType.type === 'server-render' &&
|
|
35
36
|
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), process.env.ASK_AI_ENABLED && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
36
37
|
};
|
|
@@ -13,7 +13,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
13
13
|
const actions_1 = require("../RenderQueue/actions");
|
|
14
14
|
const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
|
|
15
15
|
const DiffPreview_1 = require("./DiffPreview");
|
|
16
|
-
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, }) => {
|
|
16
|
+
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, fallbackToRootFile = false, }) => {
|
|
17
17
|
var _a;
|
|
18
18
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
19
19
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -68,6 +68,22 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
68
68
|
}, [codemod, symbolicatedStack]);
|
|
69
69
|
(0, react_1.useEffect)(() => {
|
|
70
70
|
if (!stack) {
|
|
71
|
+
if (fallbackToRootFile) {
|
|
72
|
+
const rootFileAbortController = new AbortController();
|
|
73
|
+
let rootFileAborted = false;
|
|
74
|
+
getCanApplyCodemod(rootFileAbortController.signal)
|
|
75
|
+
.then(() => undefined)
|
|
76
|
+
.catch((err) => {
|
|
77
|
+
if (rootFileAborted) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
(0, NotificationCenter_1.showNotification)(`${errorNotification}: ${err.message}`, 3000);
|
|
81
|
+
});
|
|
82
|
+
return () => {
|
|
83
|
+
rootFileAborted = true;
|
|
84
|
+
rootFileAbortController.abort();
|
|
85
|
+
};
|
|
86
|
+
}
|
|
71
87
|
setCanApplyCodemod({
|
|
72
88
|
type: 'fail',
|
|
73
89
|
error: 'Could not determine where this item is defined',
|
|
@@ -98,10 +114,16 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
98
114
|
aborted = true;
|
|
99
115
|
abortController.abort();
|
|
100
116
|
};
|
|
101
|
-
}, [
|
|
117
|
+
}, [
|
|
118
|
+
errorNotification,
|
|
119
|
+
fallbackToRootFile,
|
|
120
|
+
getCanApplyCodemod,
|
|
121
|
+
stack,
|
|
122
|
+
symbolicatedStack,
|
|
123
|
+
]);
|
|
102
124
|
const disabled = !valid ||
|
|
103
125
|
submitting ||
|
|
104
|
-
symbolicatedStack === null ||
|
|
126
|
+
(symbolicatedStack === null && !fallbackToRootFile) ||
|
|
105
127
|
codemodStatus.type !== 'success';
|
|
106
128
|
const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
|
|
107
129
|
(0, react_1.useEffect)(() => {
|
|
@@ -6,6 +6,10 @@ export declare const deriveInputDraggerStep: ({ min, snapToStep, step, }: {
|
|
|
6
6
|
readonly snapToStep: boolean;
|
|
7
7
|
readonly step: string | number | undefined;
|
|
8
8
|
}) => string | number;
|
|
9
|
+
export declare const deriveInputDraggerDragStartValue: ({ min, value, }: {
|
|
10
|
+
readonly min: string | number | undefined;
|
|
11
|
+
readonly value: string | number | readonly string[] | undefined;
|
|
12
|
+
}) => number;
|
|
9
13
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
10
14
|
readonly onValueChange: (newVal: number) => void;
|
|
11
15
|
readonly onValueChangeEnd?: ((newVal: number) => void) | undefined;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputDragger = exports.deriveInputDraggerStep = void 0;
|
|
36
|
+
exports.InputDragger = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -64,6 +64,18 @@ const deriveInputDraggerStep = ({ min, snapToStep, step, }) => {
|
|
|
64
64
|
return 0.0001;
|
|
65
65
|
};
|
|
66
66
|
exports.deriveInputDraggerStep = deriveInputDraggerStep;
|
|
67
|
+
const deriveInputDraggerDragStartValue = ({ min, value, }) => {
|
|
68
|
+
const numericValue = Number(value);
|
|
69
|
+
if (Number.isFinite(numericValue)) {
|
|
70
|
+
return numericValue;
|
|
71
|
+
}
|
|
72
|
+
const numericMin = Number(min);
|
|
73
|
+
if (Number.isFinite(numericMin)) {
|
|
74
|
+
return numericMin;
|
|
75
|
+
}
|
|
76
|
+
return 0;
|
|
77
|
+
};
|
|
78
|
+
exports.deriveInputDraggerDragStartValue = deriveInputDraggerDragStartValue;
|
|
67
79
|
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, ...props }, ref) => {
|
|
68
80
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
69
81
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
@@ -152,6 +164,10 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
152
164
|
const step = Number(_step !== null && _step !== void 0 ? _step : 1);
|
|
153
165
|
const min = Number(_min !== null && _min !== void 0 ? _min : 0);
|
|
154
166
|
const max = Number(_max !== null && _max !== void 0 ? _max : Infinity);
|
|
167
|
+
const dragStartValue = (0, exports.deriveInputDraggerDragStartValue)({
|
|
168
|
+
min: _min,
|
|
169
|
+
value,
|
|
170
|
+
});
|
|
155
171
|
if (distanceFromStart > 4) {
|
|
156
172
|
(0, input_dragger_click_lock_1.setClickLock)(true);
|
|
157
173
|
setDragging(true);
|
|
@@ -159,7 +175,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
159
175
|
target.blur();
|
|
160
176
|
}
|
|
161
177
|
const diff = (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step, 0, 0, 0, step]);
|
|
162
|
-
const newValue = Math.min(max, Math.max(min,
|
|
178
|
+
const newValue = Math.min(max, Math.max(min, dragStartValue + diff));
|
|
163
179
|
const nextValue = snapToStep
|
|
164
180
|
? roundToStep(newValue, step)
|
|
165
181
|
: dragDecimalPlaces === undefined
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewComposition = 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 url_state_1 = require("../../helpers/url-state");
|
|
8
|
+
const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
|
|
9
|
+
const layout_1 = require("../layout");
|
|
10
|
+
const ModalFooter_1 = require("../ModalFooter");
|
|
11
|
+
const ModalHeader_1 = require("../ModalHeader");
|
|
12
|
+
const layout_2 = require("../RenderModal/layout");
|
|
13
|
+
const CodemodFooter_1 = require("./CodemodFooter");
|
|
14
|
+
const DismissableModal_1 = require("./DismissableModal");
|
|
15
|
+
const InputDragger_1 = require("./InputDragger");
|
|
16
|
+
const NewCompDuration_1 = require("./NewCompDuration");
|
|
17
|
+
const RemInput_1 = require("./RemInput");
|
|
18
|
+
const ValidationMessage_1 = require("./ValidationMessage");
|
|
19
|
+
const content = {
|
|
20
|
+
padding: 12,
|
|
21
|
+
paddingRight: 12,
|
|
22
|
+
flex: 1,
|
|
23
|
+
fontSize: 13,
|
|
24
|
+
minWidth: 500,
|
|
25
|
+
};
|
|
26
|
+
const toPascalCase = (value) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const words = (_a = value.match(/[a-zA-Z0-9]+/g)) !== null && _a !== void 0 ? _a : [];
|
|
29
|
+
const candidate = words
|
|
30
|
+
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
|
31
|
+
.join('');
|
|
32
|
+
if (!candidate) {
|
|
33
|
+
return 'NewComposition';
|
|
34
|
+
}
|
|
35
|
+
if (/^[0-9]/.test(candidate)) {
|
|
36
|
+
return `Composition${candidate}`;
|
|
37
|
+
}
|
|
38
|
+
return candidate;
|
|
39
|
+
};
|
|
40
|
+
const waitForComposition = (compositionId) => {
|
|
41
|
+
return new Promise((resolve) => {
|
|
42
|
+
const started = Date.now();
|
|
43
|
+
const interval = window.setInterval(() => {
|
|
44
|
+
var _a;
|
|
45
|
+
var _b;
|
|
46
|
+
const compositionNames = (_b = (_a = window.remotion_getCompositionNames) === null || _a === void 0 ? void 0 : _a.call(window)) !== null && _b !== void 0 ? _b : [];
|
|
47
|
+
if (compositionNames.includes(compositionId) ||
|
|
48
|
+
Date.now() - started > 10000) {
|
|
49
|
+
window.clearInterval(interval);
|
|
50
|
+
resolve();
|
|
51
|
+
}
|
|
52
|
+
}, 100);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getUniqueCompositionName = (compositions) => {
|
|
56
|
+
let counter = 1;
|
|
57
|
+
while (true) {
|
|
58
|
+
const name = counter === 1 ? 'NewComposition' : `NewComposition${counter}`;
|
|
59
|
+
const err = (0, validate_new_comp_data_1.validateCompositionName)(name, compositions);
|
|
60
|
+
if (!err) {
|
|
61
|
+
return name;
|
|
62
|
+
}
|
|
63
|
+
counter++;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const NewCompositionLoaded = () => {
|
|
67
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
68
|
+
const [newId, setName] = (0, react_1.useState)(() => getUniqueCompositionName(compositions));
|
|
69
|
+
const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(30);
|
|
70
|
+
const [size, setSize] = (0, react_1.useState)(() => ({
|
|
71
|
+
width: 1920,
|
|
72
|
+
height: 1080,
|
|
73
|
+
}));
|
|
74
|
+
const [durationInFrames, setDurationInFrames] = (0, react_1.useState)(150);
|
|
75
|
+
const onWidthChanged = (0, react_1.useCallback)((newValue) => {
|
|
76
|
+
setSize((s) => {
|
|
77
|
+
return {
|
|
78
|
+
height: s.height,
|
|
79
|
+
width: Number(newValue),
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}, []);
|
|
83
|
+
const onWidthDirectlyChanged = (0, react_1.useCallback)((newWidth) => {
|
|
84
|
+
setSize((s) => {
|
|
85
|
+
return {
|
|
86
|
+
height: s.height,
|
|
87
|
+
width: newWidth,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
const onHeightDirectlyChanged = (0, react_1.useCallback)((newHeight) => {
|
|
92
|
+
setSize((s) => {
|
|
93
|
+
return {
|
|
94
|
+
width: s.width,
|
|
95
|
+
height: newHeight,
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}, []);
|
|
99
|
+
const onHeightChanged = (0, react_1.useCallback)((newValue) => {
|
|
100
|
+
setSize((s) => {
|
|
101
|
+
return {
|
|
102
|
+
width: s.width,
|
|
103
|
+
height: Number(newValue),
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
}, []);
|
|
107
|
+
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
108
|
+
setName(e.target.value);
|
|
109
|
+
}, []);
|
|
110
|
+
const onTextFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
111
|
+
setFrameRate(Number(newFps));
|
|
112
|
+
}, []);
|
|
113
|
+
const onFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
114
|
+
setFrameRate(newFps);
|
|
115
|
+
}, []);
|
|
116
|
+
const compNameErrMessage = (0, validate_new_comp_data_1.validateCompositionName)(newId, compositions);
|
|
117
|
+
const compWidthErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Width', size.width);
|
|
118
|
+
const compHeightErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Height', size.height);
|
|
119
|
+
const componentName = toPascalCase(newId);
|
|
120
|
+
const valid = compNameErrMessage === null &&
|
|
121
|
+
compWidthErrMessage === null &&
|
|
122
|
+
compHeightErrMessage === null;
|
|
123
|
+
const codemod = (0, react_1.useMemo)(() => {
|
|
124
|
+
return {
|
|
125
|
+
type: 'new-composition',
|
|
126
|
+
newDurationInFrames: Number(durationInFrames),
|
|
127
|
+
newFps: Number(selectedFrameRate),
|
|
128
|
+
newHeight: Number(size.height),
|
|
129
|
+
newWidth: Number(size.width),
|
|
130
|
+
newId,
|
|
131
|
+
componentName,
|
|
132
|
+
componentImportPath: `./${componentName}`,
|
|
133
|
+
};
|
|
134
|
+
}, [
|
|
135
|
+
componentName,
|
|
136
|
+
durationInFrames,
|
|
137
|
+
newId,
|
|
138
|
+
selectedFrameRate,
|
|
139
|
+
size.height,
|
|
140
|
+
size.width,
|
|
141
|
+
]);
|
|
142
|
+
const onSuccess = (0, react_1.useCallback)(() => {
|
|
143
|
+
waitForComposition(newId).then(() => {
|
|
144
|
+
(0, url_state_1.pushUrl)(`/${newId}`);
|
|
145
|
+
});
|
|
146
|
+
}, [newId]);
|
|
147
|
+
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
}, []);
|
|
150
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
151
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New composition" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
152
|
+
jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
153
|
+
jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
154
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
|
|
155
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
156
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
|
|
157
|
+
] })) : null] }) })
|
|
158
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
159
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
|
|
160
|
+
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 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
161
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
|
|
162
|
+
] })) : null] })
|
|
163
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
164
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
|
|
165
|
+
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 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
166
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
|
|
167
|
+
] })) : null] })
|
|
168
|
+
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
169
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: 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 }) })
|
|
170
|
+
] })
|
|
171
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: "Creating composition...", errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: null, valid: valid, onSuccess: onSuccess, fallbackToRootFile: true }) })
|
|
172
|
+
] })
|
|
173
|
+
] }));
|
|
174
|
+
};
|
|
175
|
+
const NewComposition = () => {
|
|
176
|
+
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, {}) }));
|
|
177
|
+
};
|
|
178
|
+
exports.NewComposition = NewComposition;
|
|
@@ -83,8 +83,8 @@ const PreviewToolbarControl = ({ children }) => {
|
|
|
83
83
|
};
|
|
84
84
|
const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
85
85
|
const { playbackRate, setPlaybackRate } = remotion_1.Internals.usePlaybackRate();
|
|
86
|
-
const {
|
|
87
|
-
const {
|
|
86
|
+
const { playerMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
87
|
+
const { setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
88
88
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
89
89
|
const isVideoComposition = (0, is_current_selected_still_1.useIsVideoComposition)();
|
|
90
90
|
const previewToolbarRef = (0, react_1.useRef)(null);
|
|
@@ -163,7 +163,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
163
163
|
jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
164
164
|
jsx_runtime_1.jsx("div", { style: padding }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineZoomControls_1.TimelineZoomControls, {}) })
|
|
165
165
|
] }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), isVideoComposition ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
166
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted:
|
|
166
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
167
167
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
168
168
|
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) })
|
|
169
169
|
] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type SelectedOutline } from './selected-outline-geometry';
|
|
3
|
+
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
2
4
|
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineUvSnapThresholdPx, selectedOutlineTransformOriginSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineUv, snapSelectedOutlineTransformOriginUv, } from './selected-outline-drag';
|
|
3
5
|
export { getOutlineSelectionInteraction, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
4
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
5
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
8
|
+
export declare const orderOutlinesForRendering: ({ outlines, targetsByKey, }: {
|
|
9
|
+
readonly outlines: readonly SelectedOutline[];
|
|
10
|
+
readonly targetsByKey: ReadonlyMap<string, SelectedOutlineTarget>;
|
|
11
|
+
}) => readonly SelectedOutline[];
|
|
6
12
|
export declare const SelectedOutlineOverlay: React.FC<{
|
|
7
13
|
readonly scale: number;
|
|
8
14
|
}>;
|