@remotion/studio 4.0.474 → 4.0.476
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 +6 -0
- package/dist/components/ColorPicker/ColorPicker.js +4 -31
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +6 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +11 -6
- package/dist/components/CompositionSelectorItem.js +4 -4
- package/dist/components/Editor.js +4 -1
- package/dist/components/GlobalKeybindings.js +12 -0
- package/dist/components/KeyboardShortcutsExplainer.js +24 -0
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/ComboBox.js +1 -0
- package/dist/components/NewComposition/InputDragger.d.ts +6 -0
- package/dist/components/NewComposition/InputDragger.js +40 -14
- package/dist/components/NewComposition/RenameComposition.js +8 -1
- package/dist/components/NewComposition/RenameFolder.js +8 -1
- package/dist/components/NewComposition/RenameStaticFile.js +11 -1
- package/dist/components/Notifications/Notification.js +5 -4
- package/dist/components/Notifications/NotificationCenter.js +1 -1
- package/dist/components/ObserveDefaultPropsContext.js +6 -2
- package/dist/components/PlayPause.js +22 -66
- package/dist/components/PreviewToolbar.js +17 -3
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +2 -1
- package/dist/components/SelectedOutlineOverlay.d.ts +104 -42
- package/dist/components/SelectedOutlineOverlay.js +1278 -336
- 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 +1 -0
- package/dist/components/Timeline/Timeline.js +10 -7
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +64 -35
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +1 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +1 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +2 -2
- 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 +259 -62
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +4 -2
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +128 -3
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +7 -0
- package/dist/components/Timeline/TimelineKeyframeTracksContext.js +17 -0
- package/dist/components/Timeline/TimelineMediaInfo.js +4 -24
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineRotationField.js +21 -39
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineScrollable.js +19 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +67 -3
- package/dist/components/Timeline/TimelineSelection.js +289 -32
- package/dist/components/Timeline/TimelineSequence.js +17 -9
- package/dist/components/Timeline/TimelineSequenceItem.js +328 -168
- package/dist/components/Timeline/TimelineSequenceName.d.ts +4 -2
- package/dist/components/Timeline/TimelineSequenceName.js +70 -19
- package/dist/components/Timeline/TimelineSequencePropItem.js +1 -1
- 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 +1 -1
- package/dist/components/Timeline/TimelineUvCoordinateField.js +1 -1
- package/dist/components/Timeline/call-add-keyframe.d.ts +17 -0
- package/dist/components/Timeline/call-add-keyframe.js +65 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +23 -13
- package/dist/components/Timeline/disable-sequence-interactivity.d.ts +8 -0
- package/dist/components/Timeline/disable-sequence-interactivity.js +24 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +15 -7
- package/dist/components/Timeline/timeline-rotation-utils.d.ts +2 -0
- package/dist/components/Timeline/timeline-rotation-utils.js +34 -0
- 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 +28 -0
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +8 -13
- 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/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-xjvc8qen.js → chunk-0atarw3p.js} +8779 -5352
- package/dist/esm/internals.mjs +8779 -5352
- package/dist/esm/previewEntry.mjs +8789 -5362
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/colors.d.ts +0 -1
- package/dist/helpers/colors.js +1 -2
- package/dist/state/modals.d.ts +2 -1
- package/package.json +11 -10
|
@@ -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");
|
|
@@ -562,6 +563,11 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
562
563
|
!isDragEventInsideCanvas(event)) {
|
|
563
564
|
return;
|
|
564
565
|
}
|
|
566
|
+
if (event.dataTransfer &&
|
|
567
|
+
(0, effect_drag_and_drop_1.getEffectDragData)(event.dataTransfer) !== null) {
|
|
568
|
+
event.preventDefault();
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
565
571
|
event.preventDefault();
|
|
566
572
|
event.stopPropagation();
|
|
567
573
|
setIsAddingAsset(true);
|
|
@@ -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
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const POPUP_WIDTH = 240;
|
|
3
|
+
export declare const parseEyeDropperColor: (pickedColor: string) => {
|
|
4
|
+
r: number;
|
|
5
|
+
g: number;
|
|
6
|
+
b: number;
|
|
7
|
+
a: number;
|
|
8
|
+
};
|
|
3
9
|
export type ChannelKey = 'r' | 'g' | 'b' | 'a-percent';
|
|
4
10
|
export declare const ColorPickerPopup: React.FC<{
|
|
5
11
|
readonly value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ColorPickerPopup = exports.POPUP_WIDTH = void 0;
|
|
3
|
+
exports.ColorPickerPopup = exports.parseEyeDropperColor = exports.POPUP_WIDTH = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const color_conversion_1 = require("../../helpers/color-conversion");
|
|
@@ -100,6 +100,14 @@ const eyedropperButtonStyle = {
|
|
|
100
100
|
flex: '0 0 auto',
|
|
101
101
|
};
|
|
102
102
|
const hasEyeDropper = () => typeof window !== 'undefined' && 'EyeDropper' in window;
|
|
103
|
+
const parseEyeDropperColor = (pickedColor) => {
|
|
104
|
+
const parsed = (0, color_conversion_1.parseAnyColor)(pickedColor);
|
|
105
|
+
return {
|
|
106
|
+
...parsed,
|
|
107
|
+
a: 255,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
exports.parseEyeDropperColor = parseEyeDropperColor;
|
|
103
111
|
const ChannelInput = ({ label, channel, value, min, max, onCommit, }) => {
|
|
104
112
|
const [draft, setDraft] = (0, react_1.useState)(String(Math.round(value)));
|
|
105
113
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -243,10 +251,7 @@ const ColorPickerPopup = ({ value, onChange, onChangeComplete }) => {
|
|
|
243
251
|
dropper
|
|
244
252
|
.open()
|
|
245
253
|
.then((result) => {
|
|
246
|
-
const parsed = (0,
|
|
247
|
-
// `EyeDropper` always returns full opacity; preserve the user's
|
|
248
|
-
// previously chosen alpha so opening it doesn't drop transparency.
|
|
249
|
-
parsed.a = rgba.a;
|
|
254
|
+
const parsed = (0, exports.parseEyeDropperColor)(result.sRGBHex);
|
|
250
255
|
const newHsva = (0, color_conversion_1.rgbaToHsva)(parsed);
|
|
251
256
|
if (newHsva.s === 0) {
|
|
252
257
|
newHsva.h = hsva.h;
|
|
@@ -256,7 +261,7 @@ const ColorPickerPopup = ({ value, onChange, onChangeComplete }) => {
|
|
|
256
261
|
.catch(() => {
|
|
257
262
|
// Aborted; ignore.
|
|
258
263
|
});
|
|
259
|
-
}, [emit, hsva.h
|
|
264
|
+
}, [emit, hsva.h]);
|
|
260
265
|
const previewFill = (0, react_1.useMemo)(() => {
|
|
261
266
|
return {
|
|
262
267
|
...previewSwatchFillBase,
|
|
@@ -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;
|
|
@@ -40,6 +40,17 @@ const GlobalKeybindings = () => {
|
|
|
40
40
|
commandCtrlKey: true,
|
|
41
41
|
preventDefault: true,
|
|
42
42
|
});
|
|
43
|
+
const cmdSKey = keybindings.registerKeybinding({
|
|
44
|
+
event: 'keydown',
|
|
45
|
+
key: 's',
|
|
46
|
+
callback: () => {
|
|
47
|
+
(0, NotificationCenter_1.showNotification)('Remotion saves automatically', 2000);
|
|
48
|
+
},
|
|
49
|
+
triggerIfInputFieldFocused: true,
|
|
50
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
51
|
+
commandCtrlKey: true,
|
|
52
|
+
preventDefault: true,
|
|
53
|
+
});
|
|
43
54
|
const cmdIKey = process.env.ASK_AI_ENABLED
|
|
44
55
|
? keybindings.registerKeybinding({
|
|
45
56
|
event: 'keydown',
|
|
@@ -103,6 +114,7 @@ const GlobalKeybindings = () => {
|
|
|
103
114
|
cKey.unregister();
|
|
104
115
|
questionMark.unregister();
|
|
105
116
|
cmdKKey.unregister();
|
|
117
|
+
cmdSKey.unregister();
|
|
106
118
|
cmdIKey === null || cmdIKey === void 0 ? void 0 : cmdIKey.unregister();
|
|
107
119
|
pageDown.unregister();
|
|
108
120
|
pageUp.unregister();
|
|
@@ -138,6 +138,30 @@ const KeyboardShortcutsExplainer = () => {
|
|
|
138
138
|
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
139
139
|
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "Y" })
|
|
140
140
|
] }), jsx_runtime_1.jsx("div", { style: right, children: "Redo" })
|
|
141
|
+
] }), jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("div", { style: title, children: "Interactivity" }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
142
|
+
jsx_runtime_1.jsx("div", { style: left, children: jsx_runtime_1.jsx("kbd", { style: key, children: "Shift" }) }), jsx_runtime_1.jsx("div", { style: right, children: "Select range / axis lock drag" })
|
|
143
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
144
|
+
jsx_runtime_1.jsx("div", { style: left, children: jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }) }), jsx_runtime_1.jsx("div", { style: right, children: "Toggle selection" })
|
|
145
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
146
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
147
|
+
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "A" })
|
|
148
|
+
] }), jsx_runtime_1.jsx("div", { style: right, children: "Select sequence rows" })
|
|
149
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
150
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
151
|
+
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "D" })
|
|
152
|
+
] }), jsx_runtime_1.jsx("div", { style: right, children: "Duplicate sequences" })
|
|
153
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
154
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
155
|
+
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "C" })
|
|
156
|
+
] }), jsx_runtime_1.jsx("div", { style: right, children: "Copy effects / values" })
|
|
157
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
158
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
159
|
+
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "V" })
|
|
160
|
+
] }), jsx_runtime_1.jsx("div", { style: right, children: "Paste effects / values" })
|
|
161
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
162
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
163
|
+
jsx_runtime_1.jsx("kbd", { style: key, children: "Del" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "\u232B" })
|
|
164
|
+
] }), jsx_runtime_1.jsx("div", { style: right, children: "Delete / reset selection" })
|
|
141
165
|
] }), process.env.ASK_AI_ENABLED && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
142
166
|
jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("div", { style: title, children: "AI" }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
143
167
|
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
@@ -22,6 +22,7 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
22
22
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
23
23
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
24
24
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
25
|
+
const EasingEditorModal_1 = require("./Timeline/EasingEditorModal");
|
|
25
26
|
const KeyframeSettingsModal_1 = require("./Timeline/KeyframeSettingsModal");
|
|
26
27
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
27
28
|
const Modals = ({ readOnlyStudio }) => {
|
|
@@ -29,7 +30,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
29
30
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
30
31
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
31
32
|
'connected';
|
|
32
|
-
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 &&
|
|
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 &&
|
|
33
34
|
modalContextType.type === 'server-render' &&
|
|
34
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, {})] }));
|
|
35
36
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { InputHTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { RemInputStatus } from './RemInput';
|
|
4
|
+
export declare const deriveInputDraggerStep: ({ min, snapToStep, step, }: {
|
|
5
|
+
readonly min: string | number | undefined;
|
|
6
|
+
readonly snapToStep: boolean;
|
|
7
|
+
readonly step: string | number | undefined;
|
|
8
|
+
}) => string | number;
|
|
4
9
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
5
10
|
readonly onValueChange: (newVal: number) => void;
|
|
6
11
|
readonly onValueChangeEnd?: ((newVal: number) => void) | undefined;
|
|
@@ -10,4 +15,5 @@ export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttr
|
|
|
10
15
|
readonly rightAlign: boolean;
|
|
11
16
|
readonly small?: boolean | undefined;
|
|
12
17
|
readonly snapToStep?: boolean | undefined;
|
|
18
|
+
readonly dragDecimalPlaces?: number | undefined;
|
|
13
19
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -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 = void 0;
|
|
36
|
+
exports.InputDragger = 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");
|
|
@@ -46,7 +46,25 @@ const RemInput_1 = require("./RemInput");
|
|
|
46
46
|
const isInt = (num) => {
|
|
47
47
|
return num % 1 === 0;
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
const roundToDecimalPlaces = (val, decimalPlaces) => {
|
|
50
|
+
const factor = 10 ** decimalPlaces;
|
|
51
|
+
const rounded = Math.round(val * factor) / factor;
|
|
52
|
+
return Object.is(rounded, -0) ? 0 : rounded;
|
|
53
|
+
};
|
|
54
|
+
const deriveInputDraggerStep = ({ min, snapToStep, step, }) => {
|
|
55
|
+
if (!snapToStep) {
|
|
56
|
+
return 'any';
|
|
57
|
+
}
|
|
58
|
+
if (step !== undefined) {
|
|
59
|
+
return step;
|
|
60
|
+
}
|
|
61
|
+
if (typeof min === 'number' && isInt(min)) {
|
|
62
|
+
return 1;
|
|
63
|
+
}
|
|
64
|
+
return 0.0001;
|
|
65
|
+
};
|
|
66
|
+
exports.deriveInputDraggerStep = deriveInputDraggerStep;
|
|
67
|
+
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, ...props }, ref) => {
|
|
50
68
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
51
69
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
52
70
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
@@ -142,7 +160,11 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
142
160
|
}
|
|
143
161
|
const diff = (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step, 0, 0, 0, step]);
|
|
144
162
|
const newValue = Math.min(max, Math.max(min, Number(value) + diff));
|
|
145
|
-
const nextValue = snapToStep
|
|
163
|
+
const nextValue = snapToStep
|
|
164
|
+
? roundToStep(newValue, step)
|
|
165
|
+
: dragDecimalPlaces === undefined
|
|
166
|
+
? newValue
|
|
167
|
+
: roundToDecimalPlaces(newValue, dragDecimalPlaces);
|
|
146
168
|
lastDragValue = nextValue;
|
|
147
169
|
onValueChange(nextValue);
|
|
148
170
|
};
|
|
@@ -161,7 +183,16 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
161
183
|
}, {
|
|
162
184
|
once: true,
|
|
163
185
|
});
|
|
164
|
-
}, [
|
|
186
|
+
}, [
|
|
187
|
+
_step,
|
|
188
|
+
_min,
|
|
189
|
+
_max,
|
|
190
|
+
value,
|
|
191
|
+
onValueChange,
|
|
192
|
+
onValueChangeEnd,
|
|
193
|
+
snapToStep,
|
|
194
|
+
dragDecimalPlaces,
|
|
195
|
+
]);
|
|
165
196
|
(0, react_1.useEffect)(() => {
|
|
166
197
|
var _a;
|
|
167
198
|
if (inputFallback) {
|
|
@@ -169,16 +200,11 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
169
200
|
}
|
|
170
201
|
}, [inputFallback]);
|
|
171
202
|
const deriveStep = (0, react_1.useMemo)(() => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
if (typeof _min === 'number' && isInt(_min)) {
|
|
179
|
-
return 1;
|
|
180
|
-
}
|
|
181
|
-
return 0.0001;
|
|
203
|
+
return (0, exports.deriveInputDraggerStep)({
|
|
204
|
+
min: _min,
|
|
205
|
+
snapToStep,
|
|
206
|
+
step: _step,
|
|
207
|
+
});
|
|
182
208
|
}, [_min, _step, snapToStep]);
|
|
183
209
|
if (inputFallback) {
|
|
184
210
|
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 } } : {}) }) }));
|
|
@@ -33,6 +33,13 @@ const RenameCompositionLoaded = () => {
|
|
|
33
33
|
const [newId, setName] = (0, react_1.useState)(() => {
|
|
34
34
|
return resolved.result.id;
|
|
35
35
|
});
|
|
36
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
const input = inputRef.current;
|
|
39
|
+
if (!input)
|
|
40
|
+
return;
|
|
41
|
+
input.select();
|
|
42
|
+
}, []);
|
|
36
43
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
37
44
|
setName(e.target.value);
|
|
38
45
|
}, []);
|
|
@@ -54,7 +61,7 @@ const RenameCompositionLoaded = () => {
|
|
|
54
61
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${resolved.result.id}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
55
62
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
56
63
|
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: [
|
|
57
|
-
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: [
|
|
64
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, 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: [
|
|
58
65
|
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" })
|
|
59
66
|
] })) : null] }) })
|
|
60
67
|
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition', successNotification: `Renamed to ${newId}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: null }) })
|
|
@@ -24,6 +24,13 @@ const content = {
|
|
|
24
24
|
const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
25
25
|
const { folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
26
26
|
const [newName, setName] = (0, react_1.useState)(folderName);
|
|
27
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
29
|
+
const input = inputRef.current;
|
|
30
|
+
if (!input)
|
|
31
|
+
return;
|
|
32
|
+
input.select();
|
|
33
|
+
}, []);
|
|
27
34
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
28
35
|
setName(e.target.value);
|
|
29
36
|
}, []);
|
|
@@ -50,7 +57,7 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
|
50
57
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${folderId}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
51
58
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
52
59
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
|
|
53
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
60
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
54
61
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
|
|
55
62
|
] })) : null] }) })
|
|
56
63
|
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', successNotification: `Renamed folder to ${newName}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null }) })
|
|
@@ -39,6 +39,16 @@ const RenameStaticFileModal = ({ relativePath }) => {
|
|
|
39
39
|
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
40
40
|
const [newName, setNewName] = (0, react_1.useState)(() => getBaseName(relativePath));
|
|
41
41
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
42
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
43
|
+
(0, react_1.useEffect)(() => {
|
|
44
|
+
const input = inputRef.current;
|
|
45
|
+
if (!input)
|
|
46
|
+
return;
|
|
47
|
+
const dotIndex = newName.lastIndexOf('.');
|
|
48
|
+
const stemEnd = dotIndex === -1 ? newName.length : dotIndex;
|
|
49
|
+
input.setSelectionRange(0, stemEnd);
|
|
50
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
|
+
}, []);
|
|
42
52
|
const parent = (0, react_1.useMemo)(() => getParent(relativePath), [relativePath]);
|
|
43
53
|
const newRelativePath = (0, react_1.useMemo)(() => {
|
|
44
54
|
return [parent, newName].filter(Boolean).join('/');
|
|
@@ -106,7 +116,7 @@ const RenameStaticFileModal = ({ relativePath }) => {
|
|
|
106
116
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${relativePath}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
107
117
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
108
118
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
|
|
109
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newName, onChange: onNameChange, type: "text", autoFocus: true, autoComplete: "off", "data-1p-ignore": true, placeholder: "Asset name", status: validationMessage ? 'error' : 'ok', rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
119
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, autoComplete: "off", "data-1p-ignore": true, placeholder: "Asset name", status: validationMessage ? 'error' : 'ok', rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
110
120
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: validationMessage, type: "error" })
|
|
111
121
|
] })) : null] }) })
|
|
112
122
|
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", justify: "flex-end", children: [
|
|
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Notification = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
7
|
const notification = {
|
|
7
8
|
backgroundColor: '#111111',
|
|
8
|
-
color:
|
|
9
|
+
color: colors_1.TEXT_COLOR,
|
|
9
10
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
10
11
|
display: 'inline-flex',
|
|
11
|
-
padding: '
|
|
12
|
-
borderRadius:
|
|
13
|
-
fontSize:
|
|
12
|
+
padding: '6px 14px',
|
|
13
|
+
borderRadius: 6,
|
|
14
|
+
fontSize: 13,
|
|
14
15
|
border: '0.25px solid rgba(255, 255, 255, 0.1)',
|
|
15
16
|
boxShadow: '0 2px 3px rgba(0, 0, 0, 1)',
|
|
16
17
|
marginTop: 3,
|
|
@@ -37,6 +37,7 @@ exports.ObserveDefaultProps = exports.ObserveDefaultPropsContext = 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");
|
|
40
|
+
const no_react_1 = require("remotion/no-react");
|
|
40
41
|
const client_id_1 = require("../helpers/client-id");
|
|
41
42
|
const call_api_1 = require("./call-api");
|
|
42
43
|
exports.ObserveDefaultPropsContext = react_1.default.createContext(null);
|
|
@@ -60,10 +61,13 @@ const ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
|
|
|
60
61
|
...prevState,
|
|
61
62
|
[compId]: { canUpdate: true },
|
|
62
63
|
}));
|
|
64
|
+
// Resolve `remotion-file:` and `remotion-date:` tokens that the
|
|
65
|
+
// server emits for staticFile() and new Date() values
|
|
66
|
+
const deserialized = no_react_1.NoReactInternals.deserializeJSONWithSpecialTypes(JSON.stringify(result.currentDefaultProps));
|
|
63
67
|
updateProps({
|
|
64
68
|
id: compId,
|
|
65
|
-
defaultProps:
|
|
66
|
-
newProps:
|
|
69
|
+
defaultProps: deserialized,
|
|
70
|
+
newProps: deserialized,
|
|
67
71
|
});
|
|
68
72
|
}
|
|
69
73
|
else {
|