@remotion/studio 4.0.473 → 4.0.475
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/AssetSelectorItem.js +30 -6
- package/dist/components/Canvas.js +77 -0
- package/dist/components/ColorPicker/ColorPicker.js +4 -31
- package/dist/components/CompositionSelectorItem.js +4 -4
- package/dist/components/Editor.js +4 -1
- package/dist/components/Modals.js +2 -2
- package/dist/components/NewComposition/ComboBox.js +1 -0
- package/dist/components/NewComposition/InputDragger.d.ts +1 -0
- package/dist/components/NewComposition/InputDragger.js +9 -6
- package/dist/components/PreviewToolbar.js +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +61 -33
- package/dist/components/SelectedOutlineOverlay.js +813 -351
- package/dist/components/SelectedOutlineUvControls.d.ts +17 -0
- package/dist/components/SelectedOutlineUvControls.js +167 -0
- package/dist/components/StudioCanvasCapture.d.ts +5 -0
- package/dist/components/StudioCanvasCapture.js +40 -0
- package/dist/components/Timeline/EasingEditorModal.d.ts +11 -0
- package/dist/components/Timeline/EasingEditorModal.js +247 -0
- package/dist/components/Timeline/KeyframeSettingsModal.js +5 -4
- package/dist/components/Timeline/SequencePropsObserver.js +3 -3
- package/dist/components/Timeline/Timeline.js +10 -7
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -7
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +19 -16
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +71 -40
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +8 -9
- package/dist/components/Timeline/TimelineEffectPropItem.js +18 -18
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +7 -2
- package/dist/components/Timeline/TimelineExpandedSection.js +5 -5
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +1 -1
- package/dist/components/Timeline/TimelineHeightContainer.js +2 -0
- package/dist/components/Timeline/TimelineItemStack.js +3 -56
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +7 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +265 -68
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +4 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +9 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +245 -0
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +7 -0
- package/dist/components/Timeline/TimelineKeyframeTracksContext.js +17 -0
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -1
- package/dist/components/Timeline/TimelineMediaInfo.js +4 -24
- package/dist/components/Timeline/TimelineNumberField.js +15 -7
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineRotationField.js +22 -34
- package/dist/components/Timeline/TimelineScaleField.js +16 -12
- package/dist/components/Timeline/TimelineScrollable.js +19 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +82 -3
- package/dist/components/Timeline/TimelineSelection.js +312 -30
- package/dist/components/Timeline/TimelineSequence.js +23 -15
- package/dist/components/Timeline/TimelineSequenceItem.js +48 -73
- package/dist/components/Timeline/TimelineSequenceName.js +3 -17
- package/dist/components/Timeline/TimelineSequencePropItem.js +37 -37
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -5
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +46 -44
- package/dist/components/Timeline/TimelineTimeIndicators.js +4 -2
- package/dist/components/Timeline/TimelineTransformOriginField.d.ts +11 -0
- package/dist/components/Timeline/TimelineTransformOriginField.js +138 -0
- package/dist/components/Timeline/TimelineTranslateField.js +24 -19
- package/dist/components/Timeline/TimelineUvCoordinateField.js +18 -12
- package/dist/components/Timeline/{apply-effect-response-to-code-values.d.ts → apply-effect-response-to-prop-statuses.d.ts} +1 -1
- package/dist/components/Timeline/{apply-effect-response-to-code-values.js → apply-effect-response-to-prop-statuses.js} +3 -3
- package/dist/components/Timeline/call-add-keyframe.d.ts +22 -5
- package/dist/components/Timeline/call-add-keyframe.js +71 -7
- package/dist/components/Timeline/call-delete-keyframe.d.ts +7 -7
- package/dist/components/Timeline/call-delete-keyframe.js +7 -7
- package/dist/components/Timeline/call-move-keyframe.d.ts +3 -3
- package/dist/components/Timeline/call-move-keyframe.js +3 -3
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +5 -5
- package/dist/components/Timeline/call-update-keyframe-settings.js +6 -6
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +5 -5
- package/dist/components/Timeline/delete-selected-keyframe.js +5 -5
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +5 -5
- package/dist/components/Timeline/delete-selected-timeline-item.js +28 -16
- package/dist/components/Timeline/get-node-keyframes.d.ts +3 -3
- package/dist/components/Timeline/get-node-keyframes.js +4 -4
- package/dist/components/Timeline/get-timeline-easing-segments.d.ts +9 -0
- package/dist/components/Timeline/get-timeline-easing-segments.js +19 -0
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +7 -7
- package/dist/components/Timeline/reset-selected-timeline-props.js +23 -15
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
- package/dist/components/Timeline/save-effect-prop.js +5 -5
- package/dist/components/Timeline/save-prop-queue.d.ts +3 -3
- package/dist/components/Timeline/save-prop-queue.js +3 -3
- package/dist/components/Timeline/save-sequence-prop.d.ts +3 -3
- package/dist/components/Timeline/save-sequence-prop.js +4 -4
- package/dist/components/Timeline/timeline-field-utils.d.ts +10 -0
- package/dist/components/Timeline/timeline-field-utils.js +26 -5
- package/dist/components/Timeline/timeline-rotation-utils.d.ts +2 -0
- package/dist/components/Timeline/timeline-rotation-utils.js +32 -0
- package/dist/components/Timeline/timeline-translate-utils.d.ts +1 -1
- package/dist/components/Timeline/timeline-translate-utils.js +4 -5
- package/dist/components/Timeline/transform-origin-utils.d.ts +24 -0
- package/dist/components/Timeline/transform-origin-utils.js +170 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +35 -0
- package/dist/components/Timeline/update-selected-easing.js +133 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +1 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +35 -7
- package/dist/components/Timeline/use-sequence-props-subscription.js +3 -3
- package/dist/components/Timeline/use-timeline-height.js +3 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +13 -11
- package/dist/components/canvas-capture-enabled.d.ts +1 -0
- package/dist/components/canvas-capture-enabled.js +4 -0
- package/dist/components/effect-drag-and-drop.d.ts +11 -0
- package/dist/components/effect-drag-and-drop.js +73 -0
- package/dist/components/import-assets.d.ts +15 -0
- package/dist/components/import-assets.js +63 -1
- package/dist/components/selected-outline-geometry.d.ts +20 -0
- package/dist/components/selected-outline-geometry.js +18 -0
- package/dist/components/selected-outline-uv.d.ts +46 -0
- package/dist/components/selected-outline-uv.js +240 -0
- package/dist/esm/{chunk-q0jkt0zq.js → chunk-qaqqvw4q.js} +8096 -5307
- package/dist/esm/internals.mjs +8096 -5307
- package/dist/esm/previewEntry.mjs +8106 -5317
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/colors.d.ts +0 -1
- package/dist/helpers/colors.js +1 -2
- package/dist/helpers/timeline-layout.d.ts +6 -6
- package/dist/helpers/timeline-layout.js +5 -5
- package/dist/state/modals.d.ts +2 -4
- package/package.json +11 -10
- package/dist/components/NewComposition/DeleteStaticFile.d.ts +0 -4
- package/dist/components/NewComposition/DeleteStaticFile.js +0 -44
|
@@ -39,6 +39,7 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
39
39
|
const react_1 = require("react");
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
41
|
const no_react_1 = require("remotion/no-react");
|
|
42
|
+
const delete_static_file_1 = require("../api/delete-static-file");
|
|
42
43
|
const client_id_1 = require("../helpers/client-id");
|
|
43
44
|
const colors_1 = require("../helpers/colors");
|
|
44
45
|
const copy_text_1 = require("../helpers/copy-text");
|
|
@@ -51,10 +52,12 @@ const file_1 = require("../icons/file");
|
|
|
51
52
|
const folder_1 = require("../icons/folder");
|
|
52
53
|
const modals_1 = require("../state/modals");
|
|
53
54
|
const sidebar_1 = require("../state/sidebar");
|
|
55
|
+
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
54
56
|
const ContextMenu_1 = require("./ContextMenu");
|
|
55
57
|
const import_assets_1 = require("./import-assets");
|
|
56
58
|
const InlineAction_1 = require("./InlineAction");
|
|
57
59
|
const layout_1 = require("./layout");
|
|
60
|
+
const styles_1 = require("./Menu/styles");
|
|
58
61
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
59
62
|
const actions_1 = require("./RenderQueue/actions");
|
|
60
63
|
const ASSET_ITEM_HEIGHT = 32;
|
|
@@ -167,6 +170,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
167
170
|
const [isDragging, setIsDragging] = (0, react_1.useState)(false);
|
|
168
171
|
const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
169
172
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
173
|
+
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
170
174
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
171
175
|
.previewServerState.type;
|
|
172
176
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
@@ -279,6 +283,30 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
279
283
|
});
|
|
280
284
|
}, [relativePath]);
|
|
281
285
|
const serverActionDisabled = readOnlyStudio || connectionStatus !== 'connected';
|
|
286
|
+
const deleteAsset = (0, react_1.useCallback)(() => {
|
|
287
|
+
confirm({
|
|
288
|
+
title: 'Delete asset',
|
|
289
|
+
message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Do you want to delete the asset", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: relativePath }),
|
|
290
|
+
" from your public folder?"] })),
|
|
291
|
+
confirmLabel: 'Delete',
|
|
292
|
+
})
|
|
293
|
+
.then((confirmed) => {
|
|
294
|
+
if (!confirmed) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const notification = (0, NotificationCenter_1.showNotification)(`Deleting ${relativePath}...`, null);
|
|
298
|
+
(0, delete_static_file_1.deleteStaticFile)(relativePath)
|
|
299
|
+
.then(() => {
|
|
300
|
+
notification.replaceContent(`Deleted ${relativePath}`, 2000);
|
|
301
|
+
})
|
|
302
|
+
.catch((err) => {
|
|
303
|
+
notification.replaceContent(`Could not delete ${relativePath}: ${err.message}`, 3000);
|
|
304
|
+
});
|
|
305
|
+
})
|
|
306
|
+
.catch((err) => {
|
|
307
|
+
(0, NotificationCenter_1.showNotification)(`Could not delete ${relativePath}: ${err.message}`, 3000);
|
|
308
|
+
});
|
|
309
|
+
}, [confirm, relativePath]);
|
|
282
310
|
const contextMenu = (0, react_1.useMemo)(() => {
|
|
283
311
|
return [
|
|
284
312
|
{
|
|
@@ -341,12 +369,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
341
369
|
keyHint: null,
|
|
342
370
|
label: 'Delete...',
|
|
343
371
|
leftItem: null,
|
|
344
|
-
onClick:
|
|
345
|
-
setSelectedModal({
|
|
346
|
-
type: 'delete-static-file',
|
|
347
|
-
relativePath,
|
|
348
|
-
});
|
|
349
|
-
},
|
|
372
|
+
onClick: deleteAsset,
|
|
350
373
|
quickSwitcherLabel: 'Delete asset...',
|
|
351
374
|
subMenu: null,
|
|
352
375
|
type: 'item',
|
|
@@ -358,6 +381,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
358
381
|
copyFileName,
|
|
359
382
|
copyStaticFilePath,
|
|
360
383
|
openAssetInExplorer,
|
|
384
|
+
deleteAsset,
|
|
361
385
|
relativePath,
|
|
362
386
|
serverActionDisabled,
|
|
363
387
|
setSelectedModal,
|
|
@@ -22,6 +22,7 @@ const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
|
|
|
22
22
|
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
|
+
const effect_drag_and_drop_1 = require("./effect-drag-and-drop");
|
|
25
26
|
const import_assets_1 = require("./import-assets");
|
|
26
27
|
const layout_1 = require("./layout");
|
|
27
28
|
const Preview_1 = require("./Preview");
|
|
@@ -51,9 +52,21 @@ const isAssetDragEvent = (event) => {
|
|
|
51
52
|
var _b;
|
|
52
53
|
return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.ASSET_DRAG_MIME_TYPE);
|
|
53
54
|
};
|
|
55
|
+
const isComponentDragEvent = (event) => {
|
|
56
|
+
var _a;
|
|
57
|
+
var _b;
|
|
58
|
+
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
|
+
const isSfxDragEvent = (event) => {
|
|
61
|
+
var _a;
|
|
62
|
+
var _b;
|
|
63
|
+
return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.SFX_DRAG_MIME_TYPE);
|
|
64
|
+
};
|
|
54
65
|
const isRemoteAssetDragEvent = (event) => {
|
|
55
66
|
return (!isFileDragEvent(event) &&
|
|
56
67
|
!isAssetDragEvent(event) &&
|
|
68
|
+
!isComponentDragEvent(event) &&
|
|
69
|
+
!isSfxDragEvent(event) &&
|
|
57
70
|
(0, remote_asset_drag_1.hasRemoteAssetDragData)(event.dataTransfer));
|
|
58
71
|
};
|
|
59
72
|
const getAssetDragPath = (event) => {
|
|
@@ -65,6 +78,41 @@ const getAssetDragPath = (event) => {
|
|
|
65
78
|
}
|
|
66
79
|
return (_c = (_b = (0, studio_shared_1.parseAssetDragData)(value)) === null || _b === void 0 ? void 0 : _b.assetPath) !== null && _c !== void 0 ? _c : null;
|
|
67
80
|
};
|
|
81
|
+
const getComponentDragData = (event) => {
|
|
82
|
+
var _a;
|
|
83
|
+
for (const type of [
|
|
84
|
+
studio_shared_1.COMPONENT_DRAG_MIME_TYPE,
|
|
85
|
+
'application/json',
|
|
86
|
+
'text/plain',
|
|
87
|
+
]) {
|
|
88
|
+
const value = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(type);
|
|
89
|
+
if (!value) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const parsed = (0, studio_shared_1.parseComponentDragData)(value);
|
|
93
|
+
if (parsed) {
|
|
94
|
+
return parsed;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
};
|
|
99
|
+
const getSfxDragUrl = (event) => {
|
|
100
|
+
const { dataTransfer } = event;
|
|
101
|
+
if (!dataTransfer) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
for (const type of [studio_shared_1.SFX_DRAG_MIME_TYPE, 'application/json', 'text/plain']) {
|
|
105
|
+
const value = dataTransfer.getData(type);
|
|
106
|
+
if (!value) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const parsed = (0, studio_shared_1.parseSfxDragData)(value);
|
|
110
|
+
if (parsed) {
|
|
111
|
+
return parsed.sfx.url;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
68
116
|
const isDragEventInsideCanvas = (event) => {
|
|
69
117
|
const { current } = canvas_ref_1.canvasRef;
|
|
70
118
|
if (!current) {
|
|
@@ -490,6 +538,8 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
490
538
|
if (!canDropAssets ||
|
|
491
539
|
(!isFileDragEvent(event) &&
|
|
492
540
|
!isAssetDragEvent(event) &&
|
|
541
|
+
!isComponentDragEvent(event) &&
|
|
542
|
+
!isSfxDragEvent(event) &&
|
|
493
543
|
!isRemoteAssetDragEvent(event)) ||
|
|
494
544
|
!isDragEventInsideCanvas(event)) {
|
|
495
545
|
return;
|
|
@@ -507,10 +557,17 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
507
557
|
currentCompositionId === null ||
|
|
508
558
|
(!isFileDragEvent(event) &&
|
|
509
559
|
!isAssetDragEvent(event) &&
|
|
560
|
+
!isComponentDragEvent(event) &&
|
|
561
|
+
!isSfxDragEvent(event) &&
|
|
510
562
|
!isRemoteAssetDragEvent(event)) ||
|
|
511
563
|
!isDragEventInsideCanvas(event)) {
|
|
512
564
|
return;
|
|
513
565
|
}
|
|
566
|
+
if (event.dataTransfer &&
|
|
567
|
+
(0, effect_drag_and_drop_1.getEffectDragData)(event.dataTransfer) !== null) {
|
|
568
|
+
event.preventDefault();
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
514
571
|
event.preventDefault();
|
|
515
572
|
event.stopPropagation();
|
|
516
573
|
setIsAddingAsset(true);
|
|
@@ -537,7 +594,27 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
537
594
|
compositionId: currentCompositionId,
|
|
538
595
|
});
|
|
539
596
|
}
|
|
597
|
+
else if (isSfxDragEvent(event)) {
|
|
598
|
+
const url = getSfxDragUrl(event);
|
|
599
|
+
if (url === null) {
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
await (0, import_assets_1.insertRemoteAudio)({
|
|
603
|
+
url,
|
|
604
|
+
compositionFile,
|
|
605
|
+
compositionId: currentCompositionId,
|
|
606
|
+
});
|
|
607
|
+
}
|
|
540
608
|
else {
|
|
609
|
+
const componentDragData = getComponentDragData(event);
|
|
610
|
+
if (componentDragData !== null) {
|
|
611
|
+
await (0, import_assets_1.insertComponent)({
|
|
612
|
+
component: componentDragData.component,
|
|
613
|
+
compositionFile,
|
|
614
|
+
compositionId: currentCompositionId,
|
|
615
|
+
});
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
541
618
|
const url = (0, remote_asset_drag_1.getRemoteAssetUrlFromDataTransfer)(event.dataTransfer);
|
|
542
619
|
if (url === null) {
|
|
543
620
|
return;
|
|
@@ -8,7 +8,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const player_1 = require("@remotion/player");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
|
-
const colors_1 = require("../../helpers/colors");
|
|
12
11
|
const z_index_1 = require("../../state/z-index");
|
|
13
12
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
14
13
|
const portals_1 = require("../Menu/portals");
|
|
@@ -18,23 +17,13 @@ const ColorPickerPopup_1 = require("./ColorPickerPopup");
|
|
|
18
17
|
// Class name used to opt the swatch button out of the global
|
|
19
18
|
// `button:focus` inset box-shadow defined in inject-css.ts.
|
|
20
19
|
const SWATCH_CLASSNAME = '__remotion_color_swatch';
|
|
21
|
-
const getSwatchBorderColor = ({ status, isFocused, isHovered, }) => {
|
|
22
|
-
if (status === 'warning') {
|
|
23
|
-
return colors_1.WARNING_COLOR;
|
|
24
|
-
}
|
|
25
|
-
if (status === 'error') {
|
|
26
|
-
return colors_1.FAIL_COLOR;
|
|
27
|
-
}
|
|
28
|
-
return isFocused || isHovered
|
|
29
|
-
? colors_1.INPUT_BORDER_COLOR_HOVERED
|
|
30
|
-
: colors_1.INPUT_BORDER_COLOR_UNHOVERED;
|
|
31
|
-
};
|
|
32
20
|
const swatchBaseStyle = {
|
|
33
21
|
position: 'relative',
|
|
34
22
|
display: 'inline-block',
|
|
35
23
|
overflow: 'hidden',
|
|
36
24
|
padding: 0,
|
|
37
25
|
margin: 0,
|
|
26
|
+
border: 'none',
|
|
38
27
|
cursor: 'pointer',
|
|
39
28
|
backgroundColor: checker_1.CHECKER_BACKGROUND_COLOR,
|
|
40
29
|
backgroundImage: checker_1.CHECKER_BACKGROUND_IMAGE,
|
|
@@ -47,10 +36,8 @@ const fillStyle = {
|
|
|
47
36
|
inset: 0,
|
|
48
37
|
display: 'block',
|
|
49
38
|
};
|
|
50
|
-
const ColorPicker = ({ value, onChange, onChangeComplete,
|
|
39
|
+
const ColorPicker = ({ value, onChange, onChangeComplete, disabled, width = 45, height = 25, borderRadius = 3, title, name, className, style: customStyle, }) => {
|
|
51
40
|
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
52
|
-
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
53
|
-
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
54
41
|
const triggerRef = (0, react_1.useRef)(null);
|
|
55
42
|
const { tabIndex, currentZIndex } = (0, z_index_1.useZIndex)();
|
|
56
43
|
const size = player_1.PlayerInternals.useElementSize(triggerRef, {
|
|
@@ -73,25 +60,11 @@ const ColorPicker = ({ value, onChange, onChangeComplete, status, disabled, widt
|
|
|
73
60
|
width,
|
|
74
61
|
height,
|
|
75
62
|
borderRadius,
|
|
76
|
-
borderColor: getSwatchBorderColor({ status, isFocused, isHovered }),
|
|
77
63
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
78
64
|
opacity: disabled ? 0.5 : 1,
|
|
79
65
|
...(customStyle !== null && customStyle !== void 0 ? customStyle : {}),
|
|
80
66
|
};
|
|
81
|
-
}, [
|
|
82
|
-
borderRadius,
|
|
83
|
-
customStyle,
|
|
84
|
-
disabled,
|
|
85
|
-
height,
|
|
86
|
-
isFocused,
|
|
87
|
-
isHovered,
|
|
88
|
-
status,
|
|
89
|
-
width,
|
|
90
|
-
]);
|
|
91
|
-
const onMouseEnter = (0, react_1.useCallback)(() => setIsHovered(true), []);
|
|
92
|
-
const onMouseLeave = (0, react_1.useCallback)(() => setIsHovered(false), []);
|
|
93
|
-
const onFocus = (0, react_1.useCallback)(() => setIsFocused(true), []);
|
|
94
|
-
const onBlur = (0, react_1.useCallback)(() => setIsFocused(false), []);
|
|
67
|
+
}, [borderRadius, customStyle, disabled, height, width]);
|
|
95
68
|
// Toggle on pointerdown (matches Combobox) so the state flips before the
|
|
96
69
|
// HigherZIndex outside-click detection runs on pointerup. If we toggled in
|
|
97
70
|
// onClick, the popup would close in pointerup and immediately re-open in
|
|
@@ -169,7 +142,7 @@ const ColorPicker = ({ value, onChange, onChangeComplete, status, disabled, widt
|
|
|
169
142
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
170
143
|
jsx_runtime_1.jsx("button", { ref: triggerRef, type: "button", className: [is_menu_item_1.MENU_INITIATOR_CLASSNAME, SWATCH_CLASSNAME, className]
|
|
171
144
|
.filter(Boolean)
|
|
172
|
-
.join(' '), disabled: disabled, name: name, title: title !== null && title !== void 0 ? title : value, tabIndex: tabIndex, style: swatchStyle, onPointerDown: onTriggerPointerDown, onClick: onTriggerClick,
|
|
145
|
+
.join(' '), disabled: disabled, name: name, title: title !== null && title !== void 0 ? title : value, tabIndex: tabIndex, style: swatchStyle, onPointerDown: onTriggerPointerDown, onClick: onTriggerClick, children: jsx_runtime_1.jsx("span", { style: swatchFill }) }), portalStyle
|
|
173
146
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(ColorPickerPopup_1.ColorPickerPopup, { value: value, onChange: onChange, onChangeComplete: onChangeComplete }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
174
147
|
: null] }));
|
|
175
148
|
};
|
|
@@ -101,8 +101,8 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
101
101
|
toggleFolder(item.folderName, item.parentName);
|
|
102
102
|
}
|
|
103
103
|
}, [item, selectComposition, toggleFolder]);
|
|
104
|
-
const
|
|
105
|
-
if (evt.key === 'Enter') {
|
|
104
|
+
const onKeyDown = (0, react_1.useCallback)((evt) => {
|
|
105
|
+
if (evt.key === 'Enter' || evt.key === ' ') {
|
|
106
106
|
onClick(evt);
|
|
107
107
|
}
|
|
108
108
|
}, [onClick]);
|
|
@@ -132,14 +132,14 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
132
132
|
}, [connectionStatus, item, resolvedLocation, setSelectedModal]);
|
|
133
133
|
if (item.type === 'folder') {
|
|
134
134
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
135
|
-
jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("
|
|
135
|
+
jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("div", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, title: item.folderName, role: "button", children: [item.expanded ? (jsx_runtime_1.jsx(folder_1.ExpandedFolderIcon, { style: iconStyle, color: hovered || selected ? 'white' : colors_1.LIGHT_TEXT })) : (jsx_runtime_1.jsx(folder_1.CollapsedFolderIcon, { color: hovered || selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.folderName }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { values: contextMenu, visible: hovered })
|
|
136
136
|
] }) }) }), item.expanded
|
|
137
137
|
? item.items.map((childItem) => {
|
|
138
138
|
return (jsx_runtime_1.jsx(exports.CompositionSelectorItem, { currentComposition: currentComposition, selectComposition: selectComposition, item: childItem, tabIndex: tabIndex, level: level + 1, toggleFolder: toggleFolder }, childItem.key + childItem.type));
|
|
139
139
|
})
|
|
140
140
|
: null] }));
|
|
141
141
|
}
|
|
142
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick,
|
|
142
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, type: "button", title: item.composition.id, className: "__remotion-composition", "data-compname": item.composition.id, children: [(0, is_composition_still_1.isCompositionStill)(item.composition) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: hovered || selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: hovered || selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.composition.id }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { values: contextMenu, visible: hovered }), jsx_runtime_1.jsx(SidebarRenderButton_1.SidebarRenderButton, { visible: hovered, composition: item.composition })
|
|
143
143
|
] }) }) }));
|
|
144
144
|
};
|
|
145
145
|
exports.CompositionSelectorItem = CompositionSelectorItem;
|
|
@@ -44,6 +44,7 @@ const canvas_ref_1 = require("../state/canvas-ref");
|
|
|
44
44
|
const scale_lock_1 = require("../state/scale-lock");
|
|
45
45
|
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
46
46
|
const z_index_1 = require("../state/z-index");
|
|
47
|
+
const canvas_capture_enabled_1 = require("./canvas-capture-enabled");
|
|
47
48
|
const EditorContent_1 = require("./EditorContent");
|
|
48
49
|
const ForceSpecificCursor_1 = require("./ForceSpecificCursor");
|
|
49
50
|
const GlobalKeybindings_1 = require("./GlobalKeybindings");
|
|
@@ -51,6 +52,7 @@ const Modals_1 = require("./Modals");
|
|
|
51
52
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
52
53
|
const RenderErrorContext_1 = require("./RenderErrorContext");
|
|
53
54
|
const SequencePropsSubscriptionProvider_1 = require("./SequencePropsSubscriptionProvider");
|
|
55
|
+
const StudioCanvasCapture_1 = require("./StudioCanvasCapture");
|
|
54
56
|
const TopPanel_1 = require("./TopPanel");
|
|
55
57
|
const background = {
|
|
56
58
|
backgroundColor: colors_1.BACKGROUND,
|
|
@@ -99,7 +101,7 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
99
101
|
}, []);
|
|
100
102
|
const compositionRenderErrorContextValue = (0, react_1.useMemo)(() => ({ setError: setRenderError, clearError }), [clearError]);
|
|
101
103
|
const renderErrorContextValue = (0, react_1.useMemo)(() => ({ error: renderError }), [renderError]);
|
|
102
|
-
|
|
104
|
+
const editor = (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
|
|
103
105
|
jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
|
|
104
106
|
jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
|
|
105
107
|
jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsxs(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [
|
|
@@ -108,5 +110,6 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
108
110
|
] }) })
|
|
109
111
|
] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
|
|
110
112
|
] }) }) }));
|
|
113
|
+
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density: 2, children: editor })) : (editor);
|
|
111
114
|
};
|
|
112
115
|
exports.Editor = Editor;
|
|
@@ -13,7 +13,6 @@ const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
|
13
13
|
const InstallPackage_1 = require("./InstallPackage");
|
|
14
14
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
15
15
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
16
|
-
const DeleteStaticFile_1 = require("./NewComposition/DeleteStaticFile");
|
|
17
16
|
const DuplicateComposition_1 = require("./NewComposition/DuplicateComposition");
|
|
18
17
|
const RenameComposition_1 = require("./NewComposition/RenameComposition");
|
|
19
18
|
const RenameFolder_1 = require("./NewComposition/RenameFolder");
|
|
@@ -23,6 +22,7 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
23
22
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
24
23
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
25
24
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
25
|
+
const EasingEditorModal_1 = require("./Timeline/EasingEditorModal");
|
|
26
26
|
const KeyframeSettingsModal_1 = require("./Timeline/KeyframeSettingsModal");
|
|
27
27
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
28
28
|
const Modals = ({ readOnlyStudio }) => {
|
|
@@ -30,7 +30,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
30
30
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
31
31
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
32
32
|
'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 === '
|
|
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 === 'easing-editor' && (jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditorModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
34
|
modalContextType.type === 'server-render' &&
|
|
35
35
|
(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 === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), process.env.ASK_AI_ENABLED && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
36
36
|
};
|
|
@@ -9,4 +9,5 @@ export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttr
|
|
|
9
9
|
readonly formatter?: ((str: string | number) => string) | undefined;
|
|
10
10
|
readonly rightAlign: boolean;
|
|
11
11
|
readonly small?: boolean | undefined;
|
|
12
|
+
readonly snapToStep?: boolean | undefined;
|
|
12
13
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -46,7 +46,7 @@ const RemInput_1 = require("./RemInput");
|
|
|
46
46
|
const isInt = (num) => {
|
|
47
47
|
return num % 1 === 0;
|
|
48
48
|
};
|
|
49
|
-
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, ...props }, ref) => {
|
|
49
|
+
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, ...props }, ref) => {
|
|
50
50
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
51
51
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
52
52
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
@@ -142,9 +142,9 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
142
142
|
}
|
|
143
143
|
const diff = (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step, 0, 0, 0, step]);
|
|
144
144
|
const newValue = Math.min(max, Math.max(min, Number(value) + diff));
|
|
145
|
-
const
|
|
146
|
-
lastDragValue =
|
|
147
|
-
onValueChange(
|
|
145
|
+
const nextValue = snapToStep ? roundToStep(newValue, step) : newValue;
|
|
146
|
+
lastDragValue = nextValue;
|
|
147
|
+
onValueChange(nextValue);
|
|
148
148
|
};
|
|
149
149
|
window.addEventListener('mousemove', moveListener);
|
|
150
150
|
window.addEventListener('pointerup', () => {
|
|
@@ -161,7 +161,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
161
161
|
}, {
|
|
162
162
|
once: true,
|
|
163
163
|
});
|
|
164
|
-
}, [_step, _min, _max, value, onValueChange, onValueChangeEnd]);
|
|
164
|
+
}, [_step, _min, _max, value, onValueChange, onValueChangeEnd, snapToStep]);
|
|
165
165
|
(0, react_1.useEffect)(() => {
|
|
166
166
|
var _a;
|
|
167
167
|
if (inputFallback) {
|
|
@@ -169,6 +169,9 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
169
169
|
}
|
|
170
170
|
}, [inputFallback]);
|
|
171
171
|
const deriveStep = (0, react_1.useMemo)(() => {
|
|
172
|
+
if (!snapToStep) {
|
|
173
|
+
return 'any';
|
|
174
|
+
}
|
|
172
175
|
if (_step !== undefined) {
|
|
173
176
|
return _step;
|
|
174
177
|
}
|
|
@@ -176,7 +179,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
176
179
|
return 1;
|
|
177
180
|
}
|
|
178
181
|
return 0.0001;
|
|
179
|
-
}, [_min, _step]);
|
|
182
|
+
}, [_min, _step, snapToStep]);
|
|
180
183
|
if (inputFallback) {
|
|
181
184
|
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign, ...props, ...(small ? { style: { padding: '4px 6px', fontSize: 12 } } : {}) }) }));
|
|
182
185
|
}
|
|
@@ -23,7 +23,6 @@ const PlaybackRateSelector_1 = require("./PlaybackRateSelector");
|
|
|
23
23
|
const PlayPause_1 = require("./PlayPause");
|
|
24
24
|
const RenderButton_1 = require("./RenderButton");
|
|
25
25
|
const SizeSelector_1 = require("./SizeSelector");
|
|
26
|
-
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
27
26
|
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
28
27
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
29
28
|
const TOOLBAR_HEIGHT = 50;
|
|
@@ -152,7 +151,8 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
152
151
|
] }), 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: [
|
|
153
152
|
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: mediaMuted }) }), 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: mediaMuted, setMuted: setMediaMuted }) }), 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 })
|
|
154
153
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
155
|
-
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }),
|
|
154
|
+
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, {}) })
|
|
155
|
+
] })) : 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: [
|
|
156
156
|
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] })), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
157
157
|
jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
158
158
|
] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {}), jsx_runtime_1.jsx("div", { ref: rightScrollIndicatorRef, style: scrollIndicatorRight })
|
|
@@ -1,35 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, GetDragOverrides, OverrideIdToNodePaths, SequenceFieldSchema, SequencePropsSubscriptionKey, SequenceSchema, TSequence } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
|
|
4
|
+
import { type OutlinePoint } from './selected-outline-geometry';
|
|
4
5
|
import { type SaveSequencePropChange } from './Timeline/save-sequence-prop';
|
|
5
6
|
import { type TimelineSelection, type TimelineSelectionInteraction } from './Timeline/TimelineSelection';
|
|
6
|
-
type OutlinePoint = {
|
|
7
|
-
readonly x: number;
|
|
8
|
-
readonly y: number;
|
|
9
|
-
};
|
|
10
|
-
type UvCoordinate = readonly [number, number];
|
|
11
|
-
type UvCoordinateFieldSchema = Extract<SequenceFieldSchema, {
|
|
12
|
-
type: 'uv-coordinate';
|
|
13
|
-
}>;
|
|
14
|
-
type SelectedOutlineUvHandle = {
|
|
15
|
-
readonly clientId: string;
|
|
16
|
-
readonly codeValue: CanUpdateSequencePropStatusStatic;
|
|
17
|
-
readonly effectIndex: number;
|
|
18
|
-
readonly fieldDefault: UvCoordinate | undefined;
|
|
19
|
-
readonly fieldKey: string;
|
|
20
|
-
readonly fieldSchema: UvCoordinateFieldSchema;
|
|
21
|
-
readonly nodePath: SequencePropsSubscriptionKey;
|
|
22
|
-
readonly schema: SequenceSchema;
|
|
23
|
-
readonly value: UvCoordinate;
|
|
24
|
-
};
|
|
25
|
-
type UvConnectionHandle = Pick<SelectedOutlineUvHandle, 'effectIndex' | 'fieldKey' | 'fieldSchema' | 'value'>;
|
|
26
|
-
type UvHandleConnectionLine = {
|
|
27
|
-
readonly key: string;
|
|
28
|
-
readonly from: OutlinePoint;
|
|
29
|
-
readonly to: OutlinePoint;
|
|
30
|
-
};
|
|
31
7
|
type SelectedOutlineDragTarget = {
|
|
32
|
-
readonly
|
|
8
|
+
readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
33
9
|
readonly clientId: string;
|
|
34
10
|
readonly fieldDefault: string | undefined;
|
|
35
11
|
readonly keyframeDisplayOffset: number;
|
|
@@ -39,8 +15,11 @@ type SelectedOutlineDragTarget = {
|
|
|
39
15
|
type ScaleFieldSchema = Extract<SequenceFieldSchema, {
|
|
40
16
|
type: 'scale';
|
|
41
17
|
}>;
|
|
18
|
+
type RotationFieldSchema = Extract<SequenceFieldSchema, {
|
|
19
|
+
type: 'rotation-css';
|
|
20
|
+
}>;
|
|
42
21
|
type SelectedOutlineScaleDragTarget = {
|
|
43
|
-
readonly
|
|
22
|
+
readonly propStatus: CanUpdateSequencePropStatusStatic;
|
|
44
23
|
readonly clientId: string;
|
|
45
24
|
readonly fieldDefault: number | string | undefined;
|
|
46
25
|
readonly fieldSchema: ScaleFieldSchema;
|
|
@@ -48,6 +27,15 @@ type SelectedOutlineScaleDragTarget = {
|
|
|
48
27
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
49
28
|
readonly schema: SequenceSchema;
|
|
50
29
|
};
|
|
30
|
+
type SelectedOutlineRotationDragTarget = {
|
|
31
|
+
readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
32
|
+
readonly clientId: string;
|
|
33
|
+
readonly fieldDefault: string | undefined;
|
|
34
|
+
readonly fieldSchema: RotationFieldSchema;
|
|
35
|
+
readonly keyframeDisplayOffset: number;
|
|
36
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
37
|
+
readonly schema: SequenceSchema;
|
|
38
|
+
};
|
|
51
39
|
export type SelectedOutlineDragState = {
|
|
52
40
|
readonly defaultValue: string | null;
|
|
53
41
|
readonly key: string;
|
|
@@ -64,6 +52,13 @@ export type SelectedOutlineScaleDragState = {
|
|
|
64
52
|
readonly startZ: number;
|
|
65
53
|
readonly target: SelectedOutlineScaleDragTarget;
|
|
66
54
|
};
|
|
55
|
+
export type SelectedOutlineRotationDragState = {
|
|
56
|
+
readonly defaultValue: string | null;
|
|
57
|
+
readonly key: string;
|
|
58
|
+
readonly sourceFrame: number;
|
|
59
|
+
readonly startDegrees: number;
|
|
60
|
+
readonly target: SelectedOutlineRotationDragTarget;
|
|
61
|
+
};
|
|
67
62
|
type SequenceWithSelectedOutline = {
|
|
68
63
|
readonly depth: number;
|
|
69
64
|
readonly keyframeDisplayOffset: number;
|
|
@@ -71,12 +66,18 @@ type SequenceWithSelectedOutline = {
|
|
|
71
66
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
72
67
|
readonly sequence: TSequence;
|
|
73
68
|
};
|
|
74
|
-
export declare const
|
|
75
|
-
|
|
76
|
-
readonly
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export declare const
|
|
69
|
+
export declare const getSelectedOutlineRotationDeltaDegrees: ({ from, to, }: {
|
|
70
|
+
readonly from: number;
|
|
71
|
+
readonly to: number;
|
|
72
|
+
}) => number;
|
|
73
|
+
export type SelectedOutlineRotationCorner = 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
|
|
74
|
+
export declare const getSelectedOutlineRotationCornerInfo: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], corner: SelectedOutlineRotationCorner) => {
|
|
75
|
+
center: OutlinePoint;
|
|
76
|
+
cursor: string;
|
|
77
|
+
cursorDegrees: number;
|
|
78
|
+
point: OutlinePoint;
|
|
79
|
+
};
|
|
80
|
+
export declare const getSelectedSequenceKeys: (selectedItems: readonly TimelineSelection[]) => Set<string>;
|
|
80
81
|
export declare const getOutlineSelectionInteraction: ({ shiftKey, metaKey, ctrlKey, }: {
|
|
81
82
|
readonly shiftKey: boolean;
|
|
82
83
|
readonly metaKey: boolean;
|
|
@@ -96,6 +97,14 @@ export declare const getSelectedOutlineDragValues: ({ dragStates, deltaX, deltaY
|
|
|
96
97
|
readonly deltaX: number;
|
|
97
98
|
readonly deltaY: number;
|
|
98
99
|
}) => Map<string, string>;
|
|
100
|
+
export declare const applySelectedOutlineDragAxisLock: ({ deltaX, deltaY, axisLocked, }: {
|
|
101
|
+
readonly deltaX: number;
|
|
102
|
+
readonly deltaY: number;
|
|
103
|
+
readonly axisLocked: boolean;
|
|
104
|
+
}) => {
|
|
105
|
+
deltaX: number;
|
|
106
|
+
deltaY: number;
|
|
107
|
+
};
|
|
99
108
|
export type SelectedOutlineStaticDragChange = SaveSequencePropChange & {
|
|
100
109
|
readonly type: 'static';
|
|
101
110
|
};
|
|
@@ -144,6 +153,25 @@ export declare const getSelectedOutlineScaleDragChanges: ({ dragStates, lastValu
|
|
|
144
153
|
defaultValue: string | null;
|
|
145
154
|
schema: SequenceSchema;
|
|
146
155
|
}[];
|
|
156
|
+
export declare const getSelectedOutlineRotationDragStates: ({ dragTargets, getDragOverrides, timelinePosition, }: {
|
|
157
|
+
readonly dragTargets: readonly SelectedOutlineRotationDragTarget[];
|
|
158
|
+
readonly getDragOverrides: GetDragOverrides;
|
|
159
|
+
readonly timelinePosition: number;
|
|
160
|
+
}) => SelectedOutlineRotationDragState[];
|
|
161
|
+
export declare const getSelectedOutlineRotationDragValues: ({ dragStates, rotationDeltaDegrees, }: {
|
|
162
|
+
readonly dragStates: readonly SelectedOutlineRotationDragState[];
|
|
163
|
+
readonly rotationDeltaDegrees: number;
|
|
164
|
+
}) => Map<string, string>;
|
|
165
|
+
export declare const getSelectedOutlineRotationDragChanges: ({ dragStates, lastValues, }: {
|
|
166
|
+
readonly dragStates: readonly SelectedOutlineRotationDragState[];
|
|
167
|
+
readonly lastValues: ReadonlyMap<string, string>;
|
|
168
|
+
}) => SelectedOutlineDragChange[];
|
|
169
|
+
export declare const compensateTranslateForTransformOrigin: ({ startTranslate, deltaOrigin, rotate, scale, }: {
|
|
170
|
+
readonly startTranslate: readonly [number, number];
|
|
171
|
+
readonly deltaOrigin: readonly [number, number];
|
|
172
|
+
readonly rotate: number;
|
|
173
|
+
readonly scale: readonly [number, number];
|
|
174
|
+
}) => readonly [number, number];
|
|
147
175
|
export declare const SelectedOutlineOverlay: React.FC<{
|
|
148
176
|
readonly scale: number;
|
|
149
177
|
}>;
|