@remotion/studio 4.0.513 → 4.0.514
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/Studio.js +2 -1
- package/dist/components/AskAiModal.js +1 -1
- package/dist/components/AssetSelector.js +2 -0
- package/dist/components/AssetSelectorItem.js +1 -2
- package/dist/components/AudioWaveform.d.ts +3 -0
- package/dist/components/AudioWaveform.js +55 -67
- package/dist/components/Canvas.js +40 -5
- package/dist/components/CanvasOrLoading.js +5 -0
- package/dist/components/CompositionSelector.js +2 -0
- package/dist/components/ConfigureDefaultEditorModal.js +17 -11
- package/dist/components/Editor.js +16 -1
- package/dist/components/ElementInstallConfirmation.d.ts +1 -0
- package/dist/components/ElementInstallConfirmation.js +4 -2
- package/dist/components/FixComputedValueModal.d.ts +9 -0
- package/dist/components/FixComputedValueModal.js +217 -0
- package/dist/components/InitialCompositionLoader.js +19 -0
- package/dist/components/InlineDropdown.js +4 -4
- package/dist/components/InspectorInfoHeader.js +3 -3
- package/dist/components/InspectorOpenInEditor.js +3 -1
- package/dist/components/InspectorPanel/CompositionInspector.js +11 -1
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
- package/dist/components/InspectorPanel/EasingInspector.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +1 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +35 -6
- package/dist/components/InspectorPanel/common.d.ts +5 -5
- package/dist/components/InspectorPanel/common.js +8 -8
- package/dist/components/InspectorPanel/styles.d.ts +1 -1
- package/dist/components/InspectorPanel/styles.js +4 -2
- package/dist/components/InspectorSourceLocation.d.ts +1 -1
- package/dist/components/InspectorSourceLocation.js +2 -2
- package/dist/components/LicenseKeyValidation.js +2 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +10 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +7 -2
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -1
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/duplicate-composition-api.d.ts +16 -0
- package/dist/components/NewComposition/duplicate-composition-api.js +16 -0
- package/dist/components/NoRegisterRoot.js +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +4 -3
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/QuickSwitcher/fuzzy-search.js +1 -1
- package/dist/components/RefreshCompositionOverlay.js +1 -1
- package/dist/components/RenderButton.js +6 -3
- package/dist/components/RenderModal/WebRenderModal.js +6 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +2 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +9 -2
- package/dist/components/RenderModal/render-modals.js +5 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +5 -1
- package/dist/components/RenderQueue/actions.js +12 -2
- package/dist/components/RenderQueue/client-side-render-types.d.ts +1 -0
- package/dist/components/RenderingSettings.d.ts +2 -0
- package/dist/components/RenderingSettings.js +355 -0
- package/dist/components/SelectedOutlineElement.js +3 -3
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +53 -9
- package/dist/components/SettingsContext.d.ts +4 -1
- package/dist/components/SettingsContext.js +9 -2
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +10 -1
- package/dist/components/SettingsModalFooter.js +1 -1
- package/dist/components/StudioSettings.d.ts +2 -0
- package/dist/components/StudioSettings.js +185 -0
- package/dist/components/Timeline/LoopedIndicator.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +3 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +22 -14
- package/dist/components/Timeline/Timeline.js +11 -9
- package/dist/components/Timeline/TimelineAssetField.d.ts +2 -2
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +62 -76
- package/dist/components/Timeline/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +16 -11
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +0 -4
- package/dist/components/Timeline/TimelineHeightContainer.js +4 -4
- package/dist/components/Timeline/TimelineImageInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineImageInfo.js +3 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +6 -1
- package/dist/components/Timeline/TimelineList.d.ts +1 -5
- package/dist/components/Timeline/TimelineList.js +14 -9
- package/dist/components/Timeline/TimelinePinchZoom.js +5 -5
- package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -2
- package/dist/components/Timeline/TimelineRowChrome.js +12 -5
- package/dist/components/Timeline/TimelineSchemaField.d.ts +7 -3
- package/dist/components/Timeline/TimelineSchemaField.js +71 -13
- package/dist/components/Timeline/TimelineScrollable.js +3 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -2
- package/dist/components/Timeline/TimelineSelection.js +90 -103
- package/dist/components/Timeline/TimelineSequence.js +59 -25
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +15 -9
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +3 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +33 -10
- package/dist/components/Timeline/TimelineSlider.js +42 -33
- package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
- package/dist/components/Timeline/TimelineTracks.d.ts +0 -2
- package/dist/components/Timeline/TimelineTracks.js +11 -4
- package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +151 -61
- package/dist/components/Timeline/TimelineViewport.d.ts +12 -0
- package/dist/components/Timeline/TimelineViewport.js +62 -0
- package/dist/components/Timeline/TimelineVirtualization.d.ts +22 -0
- package/dist/components/Timeline/TimelineVirtualization.js +144 -0
- package/dist/components/Timeline/TimelineZoomControls.js +16 -8
- package/dist/components/Timeline/call-add-keyframe.js +31 -3
- package/dist/components/Timeline/call-delete-keyframe.js +13 -3
- package/dist/components/Timeline/call-move-keyframe.js +11 -1
- package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
- package/dist/components/Timeline/delete-selected-timeline-item.js +2 -1
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +1 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +1 -8
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +30 -0
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +61 -0
- package/dist/components/Timeline/split-selected-timeline-item.js +2 -2
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +24 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +127 -4
- package/dist/components/Timeline/use-timeline-height.d.ts +3 -5
- package/dist/components/Timeline/use-timeline-height.js +16 -18
- package/dist/components/UpdateCheck.d.ts +2 -10
- package/dist/components/UpdateCheck.js +8 -2
- package/dist/components/VisualControls/VisualControlHandle.js +8 -0
- package/dist/components/delete-jsx-node-api.d.ts +2 -0
- package/dist/components/delete-jsx-node-api.js +12 -0
- package/dist/components/element-install-api.d.ts +3 -0
- package/dist/components/element-install-api.js +19 -0
- package/dist/components/import-assets.js +20 -9
- package/dist/components/reorder-sequence-api.d.ts +2 -0
- package/dist/components/reorder-sequence-api.js +12 -0
- package/dist/components/split-jsx-sequence-api.d.ts +2 -0
- package/dist/components/split-jsx-sequence-api.js +12 -0
- package/dist/components/split-video-from-audio-api.d.ts +2 -0
- package/dist/components/split-video-from-audio-api.js +12 -0
- package/dist/error-overlay/remotion-overlay/Overlay.js +1 -1
- package/dist/esm/{chunk-tv7r0jy3.js → chunk-xn2q7eem.js} +11073 -7495
- package/dist/esm/index.mjs +7 -5
- package/dist/esm/internals.mjs +11073 -7495
- package/dist/esm/previewEntry.mjs +10905 -7327
- package/dist/esm/renderEntry.mjs +2 -3
- package/dist/helpers/browser-studio-operations.d.ts +2 -0
- package/dist/helpers/browser-studio-operations.js +10 -1
- package/dist/helpers/get-timeline-max-zoom.d.ts +26 -0
- package/dist/helpers/get-timeline-max-zoom.js +45 -0
- package/dist/helpers/inject-css.js +2 -2
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/retry-payload.js +1 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/studio-runtime-config.js +2 -3
- package/dist/helpers/timeline-layout.d.ts +3 -1
- package/dist/helpers/timeline-layout.js +6 -1
- package/dist/helpers/url-state.js +3 -2
- package/dist/helpers/use-menu-structure.js +1 -5
- package/dist/helpers/use-runtime-values.d.ts +2 -1
- package/dist/helpers/use-runtime-values.js +7 -3
- package/dist/icons/remotion-triangle.d.ts +2 -0
- package/dist/icons/remotion-triangle.js +7 -0
- package/dist/renderEntry.js +1 -1
- package/dist/state/composition-list.d.ts +13 -0
- package/dist/state/composition-list.js +21 -0
- package/dist/state/modals.d.ts +7 -1
- package/dist/state/timeline-zoom.d.ts +1 -2
- package/dist/state/timeline-zoom.js +9 -5
- package/package.json +14 -13
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RenderingSettings = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const client_1 = require("@remotion/renderer/client");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const presets_labels_1 = require("../helpers/presets-labels");
|
|
8
|
+
const prores_labels_1 = require("../helpers/prores-labels");
|
|
9
|
+
const Checkmark_1 = require("../icons/Checkmark");
|
|
10
|
+
const styles_1 = require("./InspectorPanel/styles");
|
|
11
|
+
const layout_1 = require("./layout");
|
|
12
|
+
const ComboBox_1 = require("./NewComposition/ComboBox");
|
|
13
|
+
const RemInput_1 = require("./NewComposition/RemInput");
|
|
14
|
+
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
15
|
+
const CrfSetting_1 = require("./RenderModal/CrfSetting");
|
|
16
|
+
const human_readable_codec_1 = require("./RenderModal/human-readable-codec");
|
|
17
|
+
const layout_2 = require("./RenderModal/layout");
|
|
18
|
+
const NumberSetting_1 = require("./RenderModal/NumberSetting");
|
|
19
|
+
const RenderModalHr_1 = require("./RenderModal/RenderModalHr");
|
|
20
|
+
const SegmentedControl_1 = require("./SegmentedControl");
|
|
21
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
22
|
+
const use_auto_save_config_1 = require("./use-auto-save-config");
|
|
23
|
+
const container = {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flex: 1,
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
minWidth: 0,
|
|
28
|
+
};
|
|
29
|
+
const dividerLabel = {
|
|
30
|
+
...styles_1.sectionHeader,
|
|
31
|
+
margin: 0,
|
|
32
|
+
padding: '4px 16px',
|
|
33
|
+
};
|
|
34
|
+
const fullWidth = {
|
|
35
|
+
boxSizing: 'border-box',
|
|
36
|
+
width: 180,
|
|
37
|
+
};
|
|
38
|
+
const REMOTION_DEFAULT = 'remotion-default';
|
|
39
|
+
const DEFAULT_CODEC = 'h264';
|
|
40
|
+
const DEFAULT_STILL_IMAGE_FORMAT = 'png';
|
|
41
|
+
const DEFAULT_VIDEO_IMAGE_FORMAT = 'jpeg';
|
|
42
|
+
const DEFAULT_PRO_RES_PROFILE = 'hq';
|
|
43
|
+
const DEFAULT_X264_PRESET = 'medium';
|
|
44
|
+
const RenderingSettings = () => {
|
|
45
|
+
var _a;
|
|
46
|
+
const { error: settingsError, renderDefaults, revision } = (0, SettingsContext_1.useSettings)();
|
|
47
|
+
const [codec, setCodec] = (0, react_1.useState)(null);
|
|
48
|
+
const [scale, setScale] = (0, react_1.useState)(1);
|
|
49
|
+
const [stillImageFormat, setStillImageFormat] = (0, react_1.useState)(null);
|
|
50
|
+
const [videoImageFormat, setVideoImageFormat] = (0, react_1.useState)(null);
|
|
51
|
+
const [proResProfile, setProResProfile] = (0, react_1.useState)(null);
|
|
52
|
+
const [x264Preset, setX264Preset] = (0, react_1.useState)(null);
|
|
53
|
+
const [qualityMode, setQualityMode] = (0, react_1.useState)('crf');
|
|
54
|
+
const [crf, setCrf] = (0, react_1.useState)(18);
|
|
55
|
+
const [videoBitrate, setVideoBitrate] = (0, react_1.useState)('1M');
|
|
56
|
+
const [audioCodec, setAudioCodec] = (0, react_1.useState)(null);
|
|
57
|
+
const [concurrency, setConcurrency] = (0, react_1.useState)(1);
|
|
58
|
+
const [editedSetters, setEditedSetters] = (0, react_1.useState)(() => new Set());
|
|
59
|
+
const [syncedRevision, setSyncedRevision] = (0, react_1.useState)(-1);
|
|
60
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
61
|
+
(0, react_1.useEffect)(() => {
|
|
62
|
+
var _a, _b, _c, _d, _e;
|
|
63
|
+
var _f, _g, _h, _j, _k, _l, _m, _o;
|
|
64
|
+
if (renderDefaults === null) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setCodec((_f = (_a = renderDefaults.configFileRenderDefaults) === null || _a === void 0 ? void 0 : _a.codec) !== null && _f !== void 0 ? _f : null);
|
|
68
|
+
setScale(renderDefaults.scale);
|
|
69
|
+
setStillImageFormat((_g = (_b = renderDefaults.configFileRenderDefaults) === null || _b === void 0 ? void 0 : _b.stillImageFormat) !== null && _g !== void 0 ? _g : null);
|
|
70
|
+
setVideoImageFormat((_h = (_c = renderDefaults.configFileRenderDefaults) === null || _c === void 0 ? void 0 : _c.videoImageFormat) !== null && _h !== void 0 ? _h : null);
|
|
71
|
+
setProResProfile((_j = (_d = renderDefaults.configFileRenderDefaults) === null || _d === void 0 ? void 0 : _d.proResProfile) !== null && _j !== void 0 ? _j : null);
|
|
72
|
+
setX264Preset((_k = (_e = renderDefaults.configFileRenderDefaults) === null || _e === void 0 ? void 0 : _e.x264Preset) !== null && _k !== void 0 ? _k : null);
|
|
73
|
+
setQualityMode(renderDefaults.videoBitrate === null ? 'crf' : 'bitrate');
|
|
74
|
+
setCrf((_m = (_l = renderDefaults.crf) !== null && _l !== void 0 ? _l : client_1.BrowserSafeApis.getDefaultCrfForCodec(renderDefaults.codec)) !== null && _m !== void 0 ? _m : 18);
|
|
75
|
+
setVideoBitrate((_o = renderDefaults.videoBitrate) !== null && _o !== void 0 ? _o : '1M');
|
|
76
|
+
setAudioCodec(renderDefaults.audioCodec);
|
|
77
|
+
setConcurrency(renderDefaults.concurrency);
|
|
78
|
+
setEditedSetters(new Set());
|
|
79
|
+
setSyncedRevision(revision);
|
|
80
|
+
setError(null);
|
|
81
|
+
}, [renderDefaults, revision]);
|
|
82
|
+
const markEdited = (0, react_1.useCallback)((setter) => {
|
|
83
|
+
setEditedSetters((current) => new Set(current).add(setter));
|
|
84
|
+
}, []);
|
|
85
|
+
const selectCodec = (0, react_1.useCallback)((value) => {
|
|
86
|
+
setCodec(value);
|
|
87
|
+
markEdited('setCodec');
|
|
88
|
+
}, [markEdited]);
|
|
89
|
+
const selectStillImageFormat = (0, react_1.useCallback)((value) => {
|
|
90
|
+
setStillImageFormat(value);
|
|
91
|
+
markEdited('setStillImageFormat');
|
|
92
|
+
}, [markEdited]);
|
|
93
|
+
const selectVideoImageFormat = (0, react_1.useCallback)((value) => {
|
|
94
|
+
setVideoImageFormat(value);
|
|
95
|
+
markEdited('setVideoImageFormat');
|
|
96
|
+
}, [markEdited]);
|
|
97
|
+
const selectProResProfile = (0, react_1.useCallback)((value) => {
|
|
98
|
+
setProResProfile(value);
|
|
99
|
+
markEdited('setProResProfile');
|
|
100
|
+
}, [markEdited]);
|
|
101
|
+
const selectX264Preset = (0, react_1.useCallback)((value) => {
|
|
102
|
+
setX264Preset(value);
|
|
103
|
+
markEdited('setX264Preset');
|
|
104
|
+
}, [markEdited]);
|
|
105
|
+
const selectQualityMode = (0, react_1.useCallback)((value) => {
|
|
106
|
+
setQualityMode(value);
|
|
107
|
+
markEdited('setCrf');
|
|
108
|
+
markEdited('setVideoBitrate');
|
|
109
|
+
}, [markEdited]);
|
|
110
|
+
const changeCrf = (0, react_1.useCallback)((value) => {
|
|
111
|
+
setCrf(value);
|
|
112
|
+
markEdited('setCrf');
|
|
113
|
+
markEdited('setVideoBitrate');
|
|
114
|
+
}, [markEdited]);
|
|
115
|
+
const selectAudioCodec = (0, react_1.useCallback)((value) => {
|
|
116
|
+
setAudioCodec(value);
|
|
117
|
+
markEdited('setAudioCodec');
|
|
118
|
+
}, [markEdited]);
|
|
119
|
+
const changeScale = (0, react_1.useCallback)((value) => {
|
|
120
|
+
setScale(value);
|
|
121
|
+
markEdited('setScale');
|
|
122
|
+
}, [markEdited]);
|
|
123
|
+
const changeConcurrency = (0, react_1.useCallback)((value) => {
|
|
124
|
+
setConcurrency(value);
|
|
125
|
+
markEdited('setConcurrency');
|
|
126
|
+
}, [markEdited]);
|
|
127
|
+
const makeValues = ({ options, selected, setSelected, labelValue = (value) => value, }) => options.map((value) => ({
|
|
128
|
+
id: value,
|
|
129
|
+
key: value,
|
|
130
|
+
keyHint: null,
|
|
131
|
+
label: labelValue(value),
|
|
132
|
+
leftItem: selected === value ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
133
|
+
onClick: () => setSelected(value),
|
|
134
|
+
quickSwitcherLabel: null,
|
|
135
|
+
subMenu: null,
|
|
136
|
+
type: 'item',
|
|
137
|
+
value,
|
|
138
|
+
}));
|
|
139
|
+
const makeRemotionDefaultValue = ({ labelValue, onClick, selected, }) => [
|
|
140
|
+
{
|
|
141
|
+
id: REMOTION_DEFAULT,
|
|
142
|
+
keyHint: null,
|
|
143
|
+
label: `Default (${labelValue})`,
|
|
144
|
+
leftItem: selected ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
145
|
+
onClick,
|
|
146
|
+
quickSwitcherLabel: null,
|
|
147
|
+
subMenu: null,
|
|
148
|
+
type: 'item',
|
|
149
|
+
value: REMOTION_DEFAULT,
|
|
150
|
+
},
|
|
151
|
+
{ id: `${REMOTION_DEFAULT}-divider`, type: 'divider' },
|
|
152
|
+
];
|
|
153
|
+
const codecValues = (0, react_1.useMemo)(() => [
|
|
154
|
+
...makeRemotionDefaultValue({
|
|
155
|
+
labelValue: (0, human_readable_codec_1.humanReadableCodec)(DEFAULT_CODEC),
|
|
156
|
+
onClick: () => selectCodec(null),
|
|
157
|
+
selected: codec === null,
|
|
158
|
+
}),
|
|
159
|
+
...makeValues({
|
|
160
|
+
options: client_1.BrowserSafeApis.validCodecs.filter((value) => value !== 'mp3' && value !== 'wav' && value !== 'aac'),
|
|
161
|
+
selected: codec,
|
|
162
|
+
setSelected: selectCodec,
|
|
163
|
+
labelValue: human_readable_codec_1.humanReadableCodec,
|
|
164
|
+
}),
|
|
165
|
+
], [codec, selectCodec]);
|
|
166
|
+
const stillFormatValues = (0, react_1.useMemo)(() => [
|
|
167
|
+
...makeRemotionDefaultValue({
|
|
168
|
+
labelValue: DEFAULT_STILL_IMAGE_FORMAT.toUpperCase(),
|
|
169
|
+
onClick: () => selectStillImageFormat(null),
|
|
170
|
+
selected: stillImageFormat === null,
|
|
171
|
+
}),
|
|
172
|
+
...makeValues({
|
|
173
|
+
options: client_1.BrowserSafeApis.validStillImageFormats,
|
|
174
|
+
selected: stillImageFormat,
|
|
175
|
+
setSelected: selectStillImageFormat,
|
|
176
|
+
labelValue: (value) => value.toUpperCase(),
|
|
177
|
+
}),
|
|
178
|
+
], [selectStillImageFormat, stillImageFormat]);
|
|
179
|
+
const videoFormatValues = (0, react_1.useMemo)(() => [
|
|
180
|
+
...makeRemotionDefaultValue({
|
|
181
|
+
labelValue: DEFAULT_VIDEO_IMAGE_FORMAT.toUpperCase(),
|
|
182
|
+
onClick: () => selectVideoImageFormat(null),
|
|
183
|
+
selected: videoImageFormat === null,
|
|
184
|
+
}),
|
|
185
|
+
...makeValues({
|
|
186
|
+
options: client_1.BrowserSafeApis.validVideoImageFormats,
|
|
187
|
+
selected: videoImageFormat,
|
|
188
|
+
setSelected: selectVideoImageFormat,
|
|
189
|
+
labelValue: (value) => value.toUpperCase(),
|
|
190
|
+
}),
|
|
191
|
+
], [selectVideoImageFormat, videoImageFormat]);
|
|
192
|
+
const profileValues = (0, react_1.useMemo)(() => [
|
|
193
|
+
...makeRemotionDefaultValue({
|
|
194
|
+
labelValue: (0, prores_labels_1.labelProResProfile)(DEFAULT_PRO_RES_PROFILE),
|
|
195
|
+
onClick: () => selectProResProfile(null),
|
|
196
|
+
selected: proResProfile === null,
|
|
197
|
+
}),
|
|
198
|
+
...makeValues({
|
|
199
|
+
options: client_1.BrowserSafeApis.proResProfileOptions,
|
|
200
|
+
selected: proResProfile,
|
|
201
|
+
setSelected: selectProResProfile,
|
|
202
|
+
labelValue: prores_labels_1.labelProResProfile,
|
|
203
|
+
}),
|
|
204
|
+
], [proResProfile, selectProResProfile]);
|
|
205
|
+
const presetValues = (0, react_1.useMemo)(() => [
|
|
206
|
+
...makeRemotionDefaultValue({
|
|
207
|
+
labelValue: (0, presets_labels_1.labelx264Preset)(DEFAULT_X264_PRESET),
|
|
208
|
+
onClick: () => selectX264Preset(null),
|
|
209
|
+
selected: x264Preset === null,
|
|
210
|
+
}),
|
|
211
|
+
...makeValues({
|
|
212
|
+
options: client_1.BrowserSafeApis.x264PresetOptions,
|
|
213
|
+
selected: x264Preset,
|
|
214
|
+
setSelected: selectX264Preset,
|
|
215
|
+
labelValue: presets_labels_1.labelx264Preset,
|
|
216
|
+
}),
|
|
217
|
+
], [selectX264Preset, x264Preset]);
|
|
218
|
+
const audioCodecValues = (0, react_1.useMemo)(() => {
|
|
219
|
+
return [
|
|
220
|
+
...makeRemotionDefaultValue({
|
|
221
|
+
labelValue: 'Automatic',
|
|
222
|
+
onClick: () => selectAudioCodec(null),
|
|
223
|
+
selected: audioCodec === null,
|
|
224
|
+
}),
|
|
225
|
+
...makeValues({
|
|
226
|
+
options: client_1.BrowserSafeApis.validAudioCodecs,
|
|
227
|
+
selected: audioCodec,
|
|
228
|
+
setSelected: selectAudioCodec,
|
|
229
|
+
labelValue: (value) => value.toUpperCase(),
|
|
230
|
+
}),
|
|
231
|
+
];
|
|
232
|
+
}, [audioCodec, selectAudioCodec]);
|
|
233
|
+
const qualityModeValues = (0, react_1.useMemo)(() => {
|
|
234
|
+
return ['crf', 'bitrate'].map((value) => ({
|
|
235
|
+
key: value,
|
|
236
|
+
label: value === 'crf' ? 'CRF' : 'Bitrate',
|
|
237
|
+
onClick: () => selectQualityMode(value),
|
|
238
|
+
selected: qualityMode === value,
|
|
239
|
+
}));
|
|
240
|
+
}, [qualityMode, selectQualityMode]);
|
|
241
|
+
const resolvedCodec = codec !== null && codec !== void 0 ? codec : DEFAULT_CODEC;
|
|
242
|
+
const updates = (0, react_1.useMemo)(() => {
|
|
243
|
+
const allUpdates = [
|
|
244
|
+
codec === null
|
|
245
|
+
? { setter: 'setCodec', type: 'delete' }
|
|
246
|
+
: { setter: 'setCodec', type: 'set', value: codec },
|
|
247
|
+
{ setter: 'setScale', type: 'set', value: scale },
|
|
248
|
+
stillImageFormat === null
|
|
249
|
+
? { setter: 'setStillImageFormat', type: 'delete' }
|
|
250
|
+
: {
|
|
251
|
+
setter: 'setStillImageFormat',
|
|
252
|
+
type: 'set',
|
|
253
|
+
value: stillImageFormat,
|
|
254
|
+
},
|
|
255
|
+
videoImageFormat === null
|
|
256
|
+
? { setter: 'setVideoImageFormat', type: 'delete' }
|
|
257
|
+
: {
|
|
258
|
+
setter: 'setVideoImageFormat',
|
|
259
|
+
type: 'set',
|
|
260
|
+
value: videoImageFormat,
|
|
261
|
+
},
|
|
262
|
+
qualityMode === 'crf'
|
|
263
|
+
? { setter: 'setCrf', type: 'set', value: crf }
|
|
264
|
+
: { setter: 'setCrf', type: 'delete' },
|
|
265
|
+
qualityMode === 'bitrate'
|
|
266
|
+
? { setter: 'setVideoBitrate', type: 'set', value: videoBitrate.trim() }
|
|
267
|
+
: { setter: 'setVideoBitrate', type: 'delete' },
|
|
268
|
+
...(resolvedCodec === 'prores'
|
|
269
|
+
? [
|
|
270
|
+
proResProfile === null
|
|
271
|
+
? { setter: 'setProResProfile', type: 'delete' }
|
|
272
|
+
: {
|
|
273
|
+
setter: 'setProResProfile',
|
|
274
|
+
type: 'set',
|
|
275
|
+
value: proResProfile,
|
|
276
|
+
},
|
|
277
|
+
]
|
|
278
|
+
: []),
|
|
279
|
+
...(resolvedCodec === 'h264'
|
|
280
|
+
? [
|
|
281
|
+
x264Preset === null
|
|
282
|
+
? { setter: 'setX264Preset', type: 'delete' }
|
|
283
|
+
: {
|
|
284
|
+
setter: 'setX264Preset',
|
|
285
|
+
type: 'set',
|
|
286
|
+
value: x264Preset,
|
|
287
|
+
},
|
|
288
|
+
]
|
|
289
|
+
: []),
|
|
290
|
+
audioCodec === null
|
|
291
|
+
? { setter: 'setAudioCodec', type: 'delete' }
|
|
292
|
+
: { setter: 'setAudioCodec', type: 'set', value: audioCodec },
|
|
293
|
+
{ setter: 'setConcurrency', type: 'set', value: concurrency },
|
|
294
|
+
];
|
|
295
|
+
return allUpdates.filter((update) => editedSetters.has(update.setter));
|
|
296
|
+
}, [
|
|
297
|
+
audioCodec,
|
|
298
|
+
codec,
|
|
299
|
+
concurrency,
|
|
300
|
+
crf,
|
|
301
|
+
editedSetters,
|
|
302
|
+
proResProfile,
|
|
303
|
+
qualityMode,
|
|
304
|
+
resolvedCodec,
|
|
305
|
+
scale,
|
|
306
|
+
stillImageFormat,
|
|
307
|
+
videoImageFormat,
|
|
308
|
+
videoBitrate,
|
|
309
|
+
x264Preset,
|
|
310
|
+
]);
|
|
311
|
+
const ready = renderDefaults !== null && syncedRevision === revision;
|
|
312
|
+
(0, use_auto_save_config_1.useAutoSaveConfig)({
|
|
313
|
+
enabled: ready,
|
|
314
|
+
onError: setError,
|
|
315
|
+
ready,
|
|
316
|
+
syncRevision: syncedRevision,
|
|
317
|
+
updates,
|
|
318
|
+
});
|
|
319
|
+
const onVideoBitrateChange = (event) => {
|
|
320
|
+
setVideoBitrate(event.target.value);
|
|
321
|
+
};
|
|
322
|
+
const onVideoBitrateBlur = () => {
|
|
323
|
+
markEdited('setCrf');
|
|
324
|
+
markEdited('setVideoBitrate');
|
|
325
|
+
};
|
|
326
|
+
if (renderDefaults === null) {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
330
|
+
jsx_runtime_1.jsx("p", { style: dividerLabel, children: "Output" }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
331
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Default codec" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: codecValues, selectedId: codec !== null && codec !== void 0 ? codec : REMOTION_DEFAULT, title: "Codec" }) })
|
|
332
|
+
] }), jsx_runtime_1.jsx(NumberSetting_1.NumberSetting, { name: "Scale", value: scale, onValueChanged: changeScale, min: 0.1, step: 0.1 }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
333
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Still image format" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: stillFormatValues, selectedId: stillImageFormat !== null && stillImageFormat !== void 0 ? stillImageFormat : REMOTION_DEFAULT, title: "Still image format" }) })
|
|
334
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
335
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Video frame format" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: videoFormatValues, selectedId: videoImageFormat !== null && videoImageFormat !== void 0 ? videoImageFormat : REMOTION_DEFAULT, title: "Video frame format" }) })
|
|
336
|
+
] }), jsx_runtime_1.jsx(RenderModalHr_1.RenderModalHr, {}), jsx_runtime_1.jsx("p", { style: dividerLabel, children: "Encoding" }), client_1.BrowserSafeApis.codecSupportsCrf(resolvedCodec) &&
|
|
337
|
+
client_1.BrowserSafeApis.codecSupportsVideoBitrate(resolvedCodec) ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
338
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Quality control" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: qualityModeValues, needsWrapping: true }) })
|
|
339
|
+
] })) : null, qualityMode === 'crf' &&
|
|
340
|
+
client_1.BrowserSafeApis.codecSupportsCrf(resolvedCodec) &&
|
|
341
|
+
client_1.BrowserSafeApis.getValidCrfRanges(resolvedCodec) ? (jsx_runtime_1.jsx(CrfSetting_1.CrfSetting, { crf: crf, setCrf: changeCrf, min: client_1.BrowserSafeApis.getValidCrfRanges(resolvedCodec)[0], max: client_1.BrowserSafeApis.getValidCrfRanges(resolvedCodec)[1], option: "crfOption" })) : null, qualityMode === 'bitrate' &&
|
|
342
|
+
client_1.BrowserSafeApis.codecSupportsVideoBitrate(resolvedCodec) ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
343
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Video bitrate" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { style: { ...layout_2.input, ...fullWidth }, value: videoBitrate, onChange: onVideoBitrateChange, onBlur: onVideoBitrateBlur, status: "ok", rightAlign: true }) })
|
|
344
|
+
] })) : null, resolvedCodec === 'prores' ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
345
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ProRes profile" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: profileValues, selectedId: proResProfile !== null && proResProfile !== void 0 ? proResProfile : REMOTION_DEFAULT, title: "ProRes profile" }) })
|
|
346
|
+
] })) : null, resolvedCodec === 'h264' ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
347
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "x264 preset" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: presetValues, selectedId: x264Preset !== null && x264Preset !== void 0 ? x264Preset : REMOTION_DEFAULT, title: "x264 preset" }) })
|
|
348
|
+
] })) : null, jsx_runtime_1.jsx(RenderModalHr_1.RenderModalHr, {}), jsx_runtime_1.jsx("p", { style: dividerLabel, children: "Audio" }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
349
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Audio codec" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: audioCodecValues, selectedId: audioCodec !== null && audioCodec !== void 0 ? audioCodec : REMOTION_DEFAULT, title: "Audio codec" }) })
|
|
350
|
+
] }), jsx_runtime_1.jsx(RenderModalHr_1.RenderModalHr, {}), jsx_runtime_1.jsx("p", { style: dividerLabel, children: "Performance" }), jsx_runtime_1.jsx(NumberSetting_1.NumberSetting, { name: "Concurrency", value: concurrency, onValueChanged: changeConcurrency, min: renderDefaults.minConcurrency, max: renderDefaults.maxConcurrency, step: 1 }), (error !== null && error !== void 0 ? error : settingsError) ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
351
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx("div", { style: { paddingLeft: 16, paddingRight: 16 }, children: jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: (_a = error !== null && error !== void 0 ? error : settingsError) !== null && _a !== void 0 ? _a : '', align: "flex-start", type: "error" }) })
|
|
352
|
+
] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
|
|
353
|
+
] }));
|
|
354
|
+
};
|
|
355
|
+
exports.RenderingSettings = RenderingSettings;
|
|
@@ -46,8 +46,8 @@ const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
|
46
46
|
const modals_1 = require("../state/modals");
|
|
47
47
|
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
48
48
|
const transform_3d_mode_1 = require("../state/transform-3d-mode");
|
|
49
|
-
const call_api_1 = require("./call-api");
|
|
50
49
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
50
|
+
const delete_jsx_node_api_1 = require("./delete-jsx-node-api");
|
|
51
51
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
52
52
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
53
53
|
const selected_outline_control_layout_1 = require("./selected-outline-control-layout");
|
|
@@ -234,7 +234,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
try {
|
|
237
|
-
const result = await (0,
|
|
237
|
+
const result = await (0, delete_jsx_node_api_1.deleteJsxNode)({
|
|
238
238
|
nodes: [
|
|
239
239
|
{
|
|
240
240
|
fileName: nodePath.absolutePath,
|
|
@@ -393,7 +393,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
393
393
|
setPropStatuses,
|
|
394
394
|
]);
|
|
395
395
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
396
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline })) : null, jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
396
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, directlySelected: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selected) === true, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline })) : null, jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
397
397
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
398
398
|
? controlLayout.scaleEdges.map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine_1.SelectedOutlineScaleEdgeLine, { getAllScaleDragTargets: getAllScaleDragTargets, dragging: dragging, edge: edge, hitWidth: edge === 'top' || edge === 'bottom'
|
|
399
399
|
? controlLayout.scaleHitWidth.horizontal
|
|
@@ -6,6 +6,7 @@ import type { TimelineSelection, TimelineSelectionInteraction } from './Timeline
|
|
|
6
6
|
export declare const SelectedOutlinePolygon: React.NamedExoticComponent<{
|
|
7
7
|
readonly compositionHeight: number;
|
|
8
8
|
readonly compositionWidth: number;
|
|
9
|
+
readonly directlySelected: boolean;
|
|
9
10
|
readonly dragging: boolean;
|
|
10
11
|
readonly getAllDragOutlines: () => readonly SelectedOutline[];
|
|
11
12
|
readonly getAllDragTargets: () => readonly SelectedOutlineDragTarget[];
|
|
@@ -56,7 +56,7 @@ const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
|
56
56
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
57
57
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
58
58
|
const should_clear_selection_on_pointer_down_1 = require("./Timeline/should-clear-selection-on-pointer-down");
|
|
59
|
-
const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth, dragging, getAllDragOutlines, getAllDragTargets, getLayoutTarget, getTarget, hasTarget, hovered, onContextMenuOpen, onContextMenuOpenChange, outline, onDraggingChange, onHoverChange, onSnapPointsChange, onSelect, onDoubleClickTarget, scale, showSelectedOutline, }) => {
|
|
59
|
+
const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth, directlySelected, dragging, getAllDragOutlines, getAllDragTargets, getLayoutTarget, getTarget, hasTarget, hovered, onContextMenuOpen, onContextMenuOpenChange, outline, onDraggingChange, onHoverChange, onSnapPointsChange, onSelect, onDoubleClickTarget, scale, showSelectedOutline, }) => {
|
|
60
60
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
61
61
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
62
62
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -85,6 +85,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
85
85
|
};
|
|
86
86
|
}, [getLayoutTarget, previewServerState]);
|
|
87
87
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
88
|
+
var _a;
|
|
88
89
|
const target = getTarget();
|
|
89
90
|
if (event.button !== 0 || target === undefined) {
|
|
90
91
|
return;
|
|
@@ -94,23 +95,63 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
94
95
|
event.stopPropagation();
|
|
95
96
|
const interaction = (0, selected_outline_measurement_1.getOutlineSelectionInteraction)(event);
|
|
96
97
|
const shouldUpdateSelection = !selected || interaction.shiftKey || interaction.toggleKey;
|
|
97
|
-
|
|
98
|
+
const ownerSvg = (_a = polygonRef.current) === null || _a === void 0 ? void 0 : _a.ownerSVGElement;
|
|
99
|
+
let pointerInsideSelectedOutline = false;
|
|
100
|
+
if (ownerSvg) {
|
|
101
|
+
const screenPoint = ownerSvg.createSVGPoint();
|
|
102
|
+
screenPoint.x = event.clientX;
|
|
103
|
+
screenPoint.y = event.clientY;
|
|
104
|
+
pointerInsideSelectedOutline = Array.from(ownerSvg.querySelectorAll('polygon[data-remotion-directly-selected-outline="true"]')).some((selectedPolygon) => {
|
|
105
|
+
const screenTransform = selectedPolygon.getScreenCTM();
|
|
106
|
+
if (screenTransform === null) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const polygonPoint = screenPoint.matrixTransform(screenTransform.inverse());
|
|
110
|
+
return (selectedPolygon.isPointInFill(polygonPoint) ||
|
|
111
|
+
selectedPolygon.isPointInStroke(polygonPoint));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const deferSelection = !selected &&
|
|
115
|
+
!interaction.shiftKey &&
|
|
116
|
+
!interaction.toggleKey &&
|
|
117
|
+
pointerInsideSelectedOutline;
|
|
118
|
+
if (!deferSelection && shouldUpdateSelection) {
|
|
98
119
|
onSelect(target.selection, interaction);
|
|
99
120
|
}
|
|
100
|
-
if (
|
|
121
|
+
if (interaction.shiftKey ||
|
|
122
|
+
interaction.toggleKey ||
|
|
123
|
+
(drag === null && !deferSelection)) {
|
|
101
124
|
return;
|
|
102
125
|
}
|
|
103
126
|
if ((0, focus_inspector_field_1.commitPendingInspectorFields)()) {
|
|
127
|
+
if (deferSelection) {
|
|
128
|
+
onSelect(target.selection, interaction);
|
|
129
|
+
}
|
|
104
130
|
return;
|
|
105
131
|
}
|
|
106
132
|
const startPointerX = event.clientX;
|
|
107
133
|
const startPointerY = event.clientY;
|
|
134
|
+
const dragExistingSelection = selected || deferSelection;
|
|
135
|
+
const dragTargets = dragExistingSelection
|
|
136
|
+
? getAllDragTargets()
|
|
137
|
+
: drag === null
|
|
138
|
+
? []
|
|
139
|
+
: [drag];
|
|
140
|
+
if (dragTargets.length === 0) {
|
|
141
|
+
if (deferSelection) {
|
|
142
|
+
onSelect(target.selection, interaction);
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
108
146
|
const dragStates = (0, selected_outline_drag_1.getSelectedOutlineDragStates)({
|
|
109
|
-
dragTargets
|
|
147
|
+
dragTargets,
|
|
110
148
|
getDragOverrides,
|
|
111
149
|
timelinePosition: (0, imperative_state_1.getCurrentFrame)(),
|
|
112
150
|
});
|
|
113
|
-
const dragOutlines =
|
|
151
|
+
const dragOutlines = dragExistingSelection
|
|
152
|
+
? getAllDragOutlines()
|
|
153
|
+
: [outline];
|
|
154
|
+
const [{ clientId }] = dragTargets;
|
|
114
155
|
let lastValues = new Map();
|
|
115
156
|
let currentPointerX = startPointerX;
|
|
116
157
|
let currentPointerY = startPointerY;
|
|
@@ -212,7 +253,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
212
253
|
axisLocked = nextAxisLocked;
|
|
213
254
|
updateDragOverrides();
|
|
214
255
|
};
|
|
215
|
-
const onPointerUp = () => {
|
|
256
|
+
const onPointerUp = (reason) => {
|
|
216
257
|
window.removeEventListener('keydown', onKeyChange);
|
|
217
258
|
window.removeEventListener('keyup', onKeyChange);
|
|
218
259
|
if (dragStarted) {
|
|
@@ -226,6 +267,9 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
226
267
|
});
|
|
227
268
|
if (changes.length === 0) {
|
|
228
269
|
(0, selected_outline_drag_1.clearSelectedOutlineDragOverrides)({ clearDragOverrides, dragStates });
|
|
270
|
+
if (deferSelection && !dragStarted && reason === 'pointerup') {
|
|
271
|
+
onSelect(target.selection, interaction);
|
|
272
|
+
}
|
|
229
273
|
return;
|
|
230
274
|
}
|
|
231
275
|
const staticChanges = changes.filter((change) => change.type === 'static');
|
|
@@ -237,7 +281,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
237
281
|
addedKeyframes: null,
|
|
238
282
|
movedKeyframes: null,
|
|
239
283
|
setPropStatuses,
|
|
240
|
-
clientId
|
|
284
|
+
clientId,
|
|
241
285
|
undoLabel: changes.length > 1
|
|
242
286
|
? 'Move selected sequences'
|
|
243
287
|
: 'Move sequence',
|
|
@@ -250,7 +294,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
250
294
|
sequenceKeyframes: keyframedChanges,
|
|
251
295
|
effectKeyframes: [],
|
|
252
296
|
setPropStatuses,
|
|
253
|
-
clientId
|
|
297
|
+
clientId,
|
|
254
298
|
}),
|
|
255
299
|
])
|
|
256
300
|
.catch((err) => {
|
|
@@ -347,7 +391,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
347
391
|
});
|
|
348
392
|
}, [getEffectDropTarget]);
|
|
349
393
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
350
|
-
jsx_runtime_1.jsx("polygon", { ref: polygonRef, [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', points: points, fill: effectDropHovered ? colors_1.TIMELINE_DROP_BLUE_ALPHA_12 : colors_1.TRANSPARENT, stroke: colors_1.BLUE, strokeOpacity: visible || effectDropHovered ? 1 : 0, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: hasTarget ? 'all' : undefined, onPointerEnter: () => {
|
|
394
|
+
jsx_runtime_1.jsx("polygon", { ref: polygonRef, [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', "data-remotion-directly-selected-outline": directlySelected ? 'true' : undefined, points: points, fill: effectDropHovered ? colors_1.TIMELINE_DROP_BLUE_ALPHA_12 : colors_1.TRANSPARENT, stroke: colors_1.BLUE, strokeOpacity: visible || effectDropHovered ? 1 : 0, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: hasTarget ? 'all' : undefined, onPointerEnter: () => {
|
|
351
395
|
if (!dragging) {
|
|
352
396
|
onHoverChange(outline.key);
|
|
353
397
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
|
|
1
|
+
import type { GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoResponse, GetRemotionSkillsInfoResponse, RenderDefaults, StudioRuntimeConfig } from '@remotion/studio-shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
type SettingsContextValue = {
|
|
4
4
|
readonly codingAgentInfo: GetDefaultCodingAgentInfoResponse | null;
|
|
5
5
|
readonly editorInfo: GetDefaultEditorInfoResponse | null;
|
|
6
6
|
readonly error: string | null;
|
|
7
7
|
readonly publicLicenseKey: string | null;
|
|
8
|
+
readonly remotionSkillsInfo: GetRemotionSkillsInfoResponse | null;
|
|
9
|
+
readonly renderDefaults: RenderDefaults | null;
|
|
10
|
+
readonly studioRuntimeConfig: StudioRuntimeConfig | null;
|
|
8
11
|
readonly revision: number;
|
|
9
12
|
readonly setPublicLicenseKey: (publicLicenseKey: string | null) => void;
|
|
10
13
|
};
|
|
@@ -9,13 +9,16 @@ const call_api_1 = require("./call-api");
|
|
|
9
9
|
const SettingsContext = (0, react_1.createContext)(null);
|
|
10
10
|
const SettingsProvider = ({ children }) => {
|
|
11
11
|
var _a;
|
|
12
|
-
var _b;
|
|
12
|
+
var _b, _c, _d;
|
|
13
13
|
const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
14
14
|
const [settings, setSettings] = (0, react_1.useState)({
|
|
15
15
|
codingAgentInfo: null,
|
|
16
16
|
editorInfo: null,
|
|
17
17
|
error: null,
|
|
18
18
|
publicLicenseKey: (_b = (_a = window.remotion_studioConfig) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
|
|
19
|
+
remotionSkillsInfo: null,
|
|
20
|
+
renderDefaults: (_c = window.remotion_renderDefaults) !== null && _c !== void 0 ? _c : null,
|
|
21
|
+
studioRuntimeConfig: (_d = window.remotion_studioConfig) !== null && _d !== void 0 ? _d : null,
|
|
19
22
|
revision: 0,
|
|
20
23
|
});
|
|
21
24
|
(0, react_1.useEffect)(() => {
|
|
@@ -31,8 +34,9 @@ const SettingsProvider = ({ children }) => {
|
|
|
31
34
|
Promise.all([
|
|
32
35
|
(0, call_api_1.callApi)('/api/default-editor-info', {}, controller.signal),
|
|
33
36
|
(0, call_api_1.callApi)('/api/default-coding-agent-info', {}, controller.signal),
|
|
37
|
+
(0, call_api_1.callApi)('/api/remotion-skills-info', {}, controller.signal),
|
|
34
38
|
])
|
|
35
|
-
.then(([editorInfo, codingAgentInfo]) => {
|
|
39
|
+
.then(([editorInfo, codingAgentInfo, remotionSkillsInfo]) => {
|
|
36
40
|
const runtimeConfig = window.remotion_studioConfig;
|
|
37
41
|
setSettings((currentSettings) => ({
|
|
38
42
|
...currentSettings,
|
|
@@ -48,6 +52,7 @@ const SettingsProvider = ({ children }) => {
|
|
|
48
52
|
? runtimeConfig.defaultEditor
|
|
49
53
|
: editorInfo.defaultEditor,
|
|
50
54
|
},
|
|
55
|
+
remotionSkillsInfo,
|
|
51
56
|
error: null,
|
|
52
57
|
revision: currentSettings.revision + 1,
|
|
53
58
|
}));
|
|
@@ -84,6 +89,8 @@ const SettingsProvider = ({ children }) => {
|
|
|
84
89
|
: null,
|
|
85
90
|
error: null,
|
|
86
91
|
publicLicenseKey: event.studioRuntimeConfig.publicLicenseKey,
|
|
92
|
+
renderDefaults: event.renderDefaults,
|
|
93
|
+
studioRuntimeConfig: event.studioRuntimeConfig,
|
|
87
94
|
revision: currentSettings.revision + 1,
|
|
88
95
|
}));
|
|
89
96
|
});
|
|
@@ -5,19 +5,28 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const apps_1 = require("../icons/apps");
|
|
7
7
|
const certificate_1 = require("../icons/certificate");
|
|
8
|
+
const remotion_triangle_1 = require("../icons/remotion-triangle");
|
|
9
|
+
const video_1 = require("../icons/video");
|
|
8
10
|
const modals_1 = require("../state/modals");
|
|
9
11
|
const ConfigureDefaultEditorModal_1 = require("./ConfigureDefaultEditorModal");
|
|
10
12
|
const ConfigureLicenseModal_1 = require("./ConfigureLicenseModal");
|
|
11
13
|
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
12
14
|
const ModalHeader_1 = require("./ModalHeader");
|
|
13
15
|
const DismissableModal_1 = require("./NewComposition/DismissableModal");
|
|
16
|
+
const RenderingSettings_1 = require("./RenderingSettings");
|
|
14
17
|
const render_modals_1 = require("./RenderModal/render-modals");
|
|
15
18
|
const SettingsContext_1 = require("./SettingsContext");
|
|
16
19
|
const SettingsModalFooter_1 = require("./SettingsModalFooter");
|
|
20
|
+
const StudioSettings_1 = require("./StudioSettings");
|
|
17
21
|
const vertical_1 = require("./Tabs/vertical");
|
|
18
22
|
const hiddenPanel = {
|
|
19
23
|
display: 'none',
|
|
20
24
|
};
|
|
25
|
+
const settingsOptionsPanel = {
|
|
26
|
+
...render_modals_1.optionsPanel,
|
|
27
|
+
boxSizing: 'border-box',
|
|
28
|
+
paddingBottom: 16,
|
|
29
|
+
};
|
|
21
30
|
const appsIcon = {
|
|
22
31
|
...render_modals_1.icon,
|
|
23
32
|
height: 20,
|
|
@@ -50,7 +59,7 @@ const SettingsModal = ({ initialPublicLicenseKey, initialTab }) => {
|
|
|
50
59
|
}, [initialPublicLicenseKey, setPublicLicenseKey]);
|
|
51
60
|
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { panelStyle: render_modals_1.outerModalStyle, children: jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
52
61
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Settings", onClose: dismiss }), jsx_runtime_1.jsxs("div", { style: render_modals_1.horizontalLayout, children: [
|
|
53
|
-
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'apps', onClick: () => selectTab('apps'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: appsIconContainer, children: jsx_runtime_1.jsx(apps_1.AppsIcon, { color: color, style: appsIcon }) })), children: "Apps" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'license', onClick: () => selectTab('license'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })] }), openedTabs.includes('apps') ? (jsx_runtime_1.jsx("div", { style: tab === 'apps' ?
|
|
62
|
+
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'rendering', onClick: () => selectTab('rendering'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: render_modals_1.icon }) })), children: "Defaults" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'studio', onClick: () => selectTab('studio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(remotion_triangle_1.RemotionTriangleIcon, { color: color, style: render_modals_1.icon }) })), children: "Studio" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'apps', onClick: () => selectTab('apps'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: appsIconContainer, children: jsx_runtime_1.jsx(apps_1.AppsIcon, { color: color, style: appsIcon }) })), children: "Apps" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'license', onClick: () => selectTab('license'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })] }), openedTabs.includes('apps') ? (jsx_runtime_1.jsx("div", { style: tab === 'apps' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureDefaultEditorModal_1.DefaultEditorSettings, {}) })) : null, openedTabs.includes('license') ? (jsx_runtime_1.jsx("div", { style: tab === 'license' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureLicenseModal_1.LicenseSettings, {}) })) : null, openedTabs.includes('rendering') ? (jsx_runtime_1.jsx("div", { style: tab === 'rendering' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(RenderingSettings_1.RenderingSettings, {}) })) : null, openedTabs.includes('studio') ? (jsx_runtime_1.jsx("div", { style: tab === 'studio' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(StudioSettings_1.StudioSettings, {}) })) : null] }), jsx_runtime_1.jsx(SettingsModalFooter_1.SettingsModalFooter, {})
|
|
54
63
|
] }) }));
|
|
55
64
|
};
|
|
56
65
|
exports.SettingsModal = SettingsModal;
|