@remotion/studio 4.0.497 → 4.0.499
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelectorItem.js +31 -3
- package/dist/components/Canvas.js +162 -7
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CompositionSelector.js +13 -10
- package/dist/components/CompositionSelectorItem.js +21 -13
- package/dist/components/ConfigureLicenseModal.d.ts +4 -0
- package/dist/components/ConfigureLicenseModal.js +194 -0
- package/dist/components/Editor.d.ts +0 -1
- package/dist/components/Editor.js +2 -3
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorRuler/Ruler.js +5 -3
- package/dist/components/ForceSpecificCursor.js +13 -1
- package/dist/components/InspectorPanel/CompositionInspector.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -1
- package/dist/components/LicenseKeyValidation.d.ts +17 -0
- package/dist/components/LicenseKeyValidation.js +113 -0
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/InputDragger.d.ts +27 -0
- package/dist/components/NewComposition/InputDragger.js +151 -23
- package/dist/components/RenderButton.js +0 -1
- package/dist/components/RenderModal/WebRenderModal.js +14 -8
- package/dist/components/SelectedOutlineOverlay.js +1 -1
- package/dist/components/Splitter/SplitterContainer.d.ts +2 -0
- package/dist/components/Splitter/SplitterContainer.js +5 -1
- package/dist/components/Splitter/SplitterContext.d.ts +2 -0
- package/dist/components/Splitter/SplitterContext.js +2 -0
- package/dist/components/Splitter/SplitterElement.js +6 -1
- package/dist/components/Splitter/SplitterHandle.js +27 -2
- package/dist/components/Timeline/MaxTimelineTracks.d.ts +0 -1
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -3
- package/dist/components/Timeline/Timeline.js +10 -9
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineInOutDragHandler.js +25 -1
- package/dist/components/Timeline/TimelineLayerEye.js +4 -1
- package/dist/components/Timeline/TimelineSelection.js +1 -1
- package/dist/components/Timeline/TimelineSequence.js +12 -7
- package/dist/components/Timeline/TimelineSequenceItem.js +5 -5
- package/dist/components/Timeline/TimelineSequenceName.js +1 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +13 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +68 -12
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +17 -0
- package/dist/components/Timeline/call-update-keyframe-settings.js +43 -1
- package/dist/components/Timeline/update-selected-easing.js +26 -23
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +5 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +16 -9
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -1
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +6 -4
- package/dist/components/TopPanel.js +2 -1
- package/dist/components/composition-drop-preview.d.ts +33 -0
- package/dist/components/composition-drop-preview.js +67 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +27 -60
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +7 -55
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +5 -17
- package/dist/components/handle-drop.js +0 -1
- package/dist/components/import-assets.d.ts +7 -8
- package/dist/components/import-assets.js +2 -9
- package/dist/esm/{chunk-5wj95bdd.js → chunk-pk1zwsn1.js} +5972 -4763
- package/dist/esm/index.mjs +0 -19
- package/dist/esm/internals.mjs +5972 -4763
- package/dist/esm/previewEntry.mjs +10765 -9556
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/get-effective-translation.d.ts +13 -1
- package/dist/helpers/get-effective-translation.js +12 -6
- package/dist/helpers/interactivity-enabled.d.ts +1 -1
- package/dist/helpers/interactivity-enabled.js +2 -2
- package/dist/helpers/retry-payload.js +0 -1
- package/dist/helpers/ruler-canvas-size.d.ts +7 -0
- package/dist/helpers/ruler-canvas-size.js +14 -1
- package/dist/helpers/use-image-metadata.d.ts +1 -0
- package/dist/helpers/use-image-metadata.js +8 -5
- package/dist/helpers/use-media-metadata.d.ts +1 -0
- package/dist/helpers/use-media-metadata.js +8 -5
- package/dist/helpers/use-menu-structure.js +9 -3
- package/dist/state/modals.d.ts +3 -1
- package/dist/visual-controls/VisualControls.js +1 -1
- package/package.json +13 -12
- package/dist/components/RenderModal/WebRenderModalLicense.d.ts +0 -9
- package/dist/components/RenderModal/WebRenderModalLicense.js +0 -189
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.d.ts +0 -13
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.js +0 -60
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputDragger = exports.deriveInputDraggerValueDiff = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.inputDraggerContainerStyle = void 0;
|
|
36
|
+
exports.InputDragger = exports.deriveInputDraggerValueDiff = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.deriveInputDraggerArrowValue = exports.validateInputDraggerValue = exports.isInputDraggerValueAlignedToStep = exports.parseInputDraggerNumber = exports.inputDraggerContainerStyle = 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");
|
|
@@ -60,6 +60,93 @@ const roundToDecimalPlaces = (val, decimalPlaces) => {
|
|
|
60
60
|
const rounded = Math.round(val * factor) / factor;
|
|
61
61
|
return Object.is(rounded, -0) ? 0 : rounded;
|
|
62
62
|
};
|
|
63
|
+
const validNumberPattern = /^[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e[+-]?\d+)?$/i;
|
|
64
|
+
const parseInputDraggerNumber = (value) => {
|
|
65
|
+
const trimmedValue = value.trim();
|
|
66
|
+
if (!validNumberPattern.test(trimmedValue)) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const parsed = Number(trimmedValue);
|
|
70
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
71
|
+
};
|
|
72
|
+
exports.parseInputDraggerNumber = parseInputDraggerNumber;
|
|
73
|
+
const getFiniteAttribute = (value) => {
|
|
74
|
+
const parsed = Number(value);
|
|
75
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
76
|
+
};
|
|
77
|
+
const getPositiveStep = (step) => {
|
|
78
|
+
if (step === 'any') {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const parsed = Number(step);
|
|
82
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : 1;
|
|
83
|
+
};
|
|
84
|
+
const isInputDraggerValueAlignedToStep = ({ min, step, value, }) => {
|
|
85
|
+
var _a;
|
|
86
|
+
const numericStep = getPositiveStep(step);
|
|
87
|
+
if (numericStep === null) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
const stepBase = (_a = getFiniteAttribute(min)) !== null && _a !== void 0 ? _a : 0;
|
|
91
|
+
const stepsFromBase = (value - stepBase) / numericStep;
|
|
92
|
+
const tolerance = Number.EPSILON *
|
|
93
|
+
10 *
|
|
94
|
+
Math.max(1, Math.abs(value / numericStep), Math.abs(stepBase / numericStep));
|
|
95
|
+
return Math.abs(stepsFromBase - Math.round(stepsFromBase)) <= tolerance;
|
|
96
|
+
};
|
|
97
|
+
exports.isInputDraggerValueAlignedToStep = isInputDraggerValueAlignedToStep;
|
|
98
|
+
const validateInputDraggerValue = ({ max, min, step, value, }) => {
|
|
99
|
+
const parsed = (0, exports.parseInputDraggerNumber)(value);
|
|
100
|
+
if (parsed === null) {
|
|
101
|
+
return {
|
|
102
|
+
valid: false,
|
|
103
|
+
message: 'Enter a valid number.',
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const numericMin = getFiniteAttribute(min);
|
|
107
|
+
if (numericMin !== null && parsed < numericMin) {
|
|
108
|
+
return {
|
|
109
|
+
valid: false,
|
|
110
|
+
message: `Value must be greater than or equal to ${numericMin}.`,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const numericMax = getFiniteAttribute(max);
|
|
114
|
+
if (numericMax !== null && parsed > numericMax) {
|
|
115
|
+
return {
|
|
116
|
+
valid: false,
|
|
117
|
+
message: `Value must be less than or equal to ${numericMax}.`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (!(0, exports.isInputDraggerValueAlignedToStep)({ min, step, value: parsed })) {
|
|
121
|
+
return {
|
|
122
|
+
valid: false,
|
|
123
|
+
message: `Value must align to a step of ${step}.`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return { valid: true, value: parsed };
|
|
127
|
+
};
|
|
128
|
+
exports.validateInputDraggerValue = validateInputDraggerValue;
|
|
129
|
+
const getDecimalPlaces = (value) => {
|
|
130
|
+
var _a;
|
|
131
|
+
var _b;
|
|
132
|
+
const [mantissa, exponentString] = String(value).toLowerCase().split('e');
|
|
133
|
+
const exponent = Number(exponentString !== null && exponentString !== void 0 ? exponentString : 0);
|
|
134
|
+
const fractionLength = (_b = (_a = mantissa.split('.')[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
135
|
+
return Math.max(0, fractionLength - exponent);
|
|
136
|
+
};
|
|
137
|
+
const deriveInputDraggerArrowValue = ({ direction, max, min, step, value, }) => {
|
|
138
|
+
var _a, _b, _c;
|
|
139
|
+
const numericStep = (_a = getPositiveStep(step)) !== null && _a !== void 0 ? _a : 1;
|
|
140
|
+
const decimalPlaces = Math.max(getDecimalPlaces(value), getDecimalPlaces(numericStep));
|
|
141
|
+
const unroundedValue = value + direction * numericStep;
|
|
142
|
+
const steppedValue = decimalPlaces <= 15
|
|
143
|
+
? roundToDecimalPlaces(unroundedValue, decimalPlaces)
|
|
144
|
+
: Number(unroundedValue.toPrecision(15));
|
|
145
|
+
const numericMin = (_b = getFiniteAttribute(min)) !== null && _b !== void 0 ? _b : -Infinity;
|
|
146
|
+
const numericMax = (_c = getFiniteAttribute(max)) !== null && _c !== void 0 ? _c : Infinity;
|
|
147
|
+
return Math.min(numericMax, Math.max(numericMin, steppedValue));
|
|
148
|
+
};
|
|
149
|
+
exports.deriveInputDraggerArrowValue = deriveInputDraggerArrowValue;
|
|
63
150
|
const deriveInputDraggerStep = ({ min, snapToStep, step, }) => {
|
|
64
151
|
if (!snapToStep) {
|
|
65
152
|
return 'any';
|
|
@@ -96,11 +183,18 @@ const deriveInputDraggerValueDiff = ({ dragSensitivity, step, xDistance, }) => {
|
|
|
96
183
|
return (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step * dragSensitivity, 0, 0, 0, step * dragSensitivity]);
|
|
97
184
|
};
|
|
98
185
|
exports.deriveInputDraggerValueDiff = deriveInputDraggerValueDiff;
|
|
99
|
-
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, dragSensitivity = 1, ...props }, ref) => {
|
|
186
|
+
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, dragSensitivity = 1, type: _type, ...props }, ref) => {
|
|
100
187
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
101
188
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
102
189
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
103
190
|
const pointerDownRef = (0, react_1.useRef)(false);
|
|
191
|
+
const deriveStep = (0, react_1.useMemo)(() => {
|
|
192
|
+
return (0, exports.deriveInputDraggerStep)({
|
|
193
|
+
min: _min,
|
|
194
|
+
snapToStep,
|
|
195
|
+
step: _step,
|
|
196
|
+
});
|
|
197
|
+
}, [_min, _step, snapToStep]);
|
|
104
198
|
const span = (0, react_1.useMemo)(() => ({
|
|
105
199
|
color: dragging ? 'var(--remotion-cli-internals-blue-hovered)' : colors_1.BLUE,
|
|
106
200
|
cursor: 'ew-resize',
|
|
@@ -136,9 +230,9 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
136
230
|
setInputFallback(false);
|
|
137
231
|
}, []);
|
|
138
232
|
const onInputChange = (0, react_1.useCallback)((e) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
233
|
+
e.target.setCustomValidity('');
|
|
234
|
+
const parsed = (0, exports.parseInputDraggerNumber)(e.target.value);
|
|
235
|
+
if (parsed !== null &&
|
|
142
236
|
(0, exports.isInputDraggerValueInRange)({
|
|
143
237
|
max: _max,
|
|
144
238
|
min: _min,
|
|
@@ -156,20 +250,48 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
156
250
|
onEscape();
|
|
157
251
|
return;
|
|
158
252
|
}
|
|
159
|
-
|
|
160
|
-
|
|
253
|
+
const validation = (0, exports.validateInputDraggerValue)({
|
|
254
|
+
max: _max,
|
|
255
|
+
min: _min,
|
|
256
|
+
step: deriveStep,
|
|
257
|
+
value: newValue,
|
|
258
|
+
});
|
|
259
|
+
if (validation.valid) {
|
|
260
|
+
fallbackRef.current.setCustomValidity('');
|
|
261
|
+
onValueChangeEnd === null || onValueChangeEnd === void 0 ? void 0 : onValueChangeEnd(validation.value);
|
|
161
262
|
setInputFallback(false);
|
|
162
263
|
}
|
|
163
264
|
else {
|
|
265
|
+
fallbackRef.current.setCustomValidity(validation.message);
|
|
164
266
|
fallbackRef.current.reportValidity();
|
|
165
267
|
}
|
|
166
|
-
}, [onEscape, onValueChangeEnd]);
|
|
167
|
-
const
|
|
268
|
+
}, [_max, _min, deriveStep, onEscape, onValueChangeEnd]);
|
|
269
|
+
const onInputKeyDown = (0, react_1.useCallback)((e) => {
|
|
168
270
|
var _a;
|
|
169
271
|
if (e.key === 'Enter') {
|
|
170
272
|
(_a = fallbackRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
273
|
+
return;
|
|
171
274
|
}
|
|
172
|
-
|
|
275
|
+
if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown') {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
e.preventDefault();
|
|
279
|
+
const parsedInputValue = (0, exports.parseInputDraggerNumber)(e.currentTarget.value);
|
|
280
|
+
const currentValue = parsedInputValue !== null && parsedInputValue !== void 0 ? parsedInputValue : (0, exports.deriveInputDraggerDragStartValue)({
|
|
281
|
+
min: _min,
|
|
282
|
+
value,
|
|
283
|
+
});
|
|
284
|
+
const nextValue = (0, exports.deriveInputDraggerArrowValue)({
|
|
285
|
+
direction: e.key === 'ArrowUp' ? 1 : -1,
|
|
286
|
+
max: _max,
|
|
287
|
+
min: _min,
|
|
288
|
+
step: deriveStep,
|
|
289
|
+
value: currentValue,
|
|
290
|
+
});
|
|
291
|
+
e.currentTarget.value = String(nextValue);
|
|
292
|
+
e.currentTarget.setCustomValidity('');
|
|
293
|
+
onValueChange(nextValue);
|
|
294
|
+
}, [_max, _min, deriveStep, onValueChange, value]);
|
|
173
295
|
const roundToStep = (val, stepSize) => {
|
|
174
296
|
const factor = 1 / stepSize;
|
|
175
297
|
return Math.ceil(val * factor) / factor;
|
|
@@ -214,20 +336,33 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
214
336
|
onValueChange(nextValue);
|
|
215
337
|
};
|
|
216
338
|
window.addEventListener('mousemove', moveListener);
|
|
217
|
-
|
|
339
|
+
const endDrag = (commit) => {
|
|
218
340
|
window.removeEventListener('mousemove', moveListener);
|
|
341
|
+
window.removeEventListener('pointerup', onPointerUp);
|
|
342
|
+
window.removeEventListener('pointercancel', onPointerCancel);
|
|
343
|
+
window.removeEventListener('blur', onWindowBlur);
|
|
219
344
|
pointerDownRef.current = false;
|
|
220
345
|
setDragging(false);
|
|
221
346
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
222
|
-
if (lastDragValue !== null && onValueChangeEnd) {
|
|
347
|
+
if (commit && lastDragValue !== null && onValueChangeEnd) {
|
|
223
348
|
onValueChangeEnd(lastDragValue);
|
|
224
349
|
}
|
|
225
350
|
setTimeout(() => {
|
|
226
351
|
(0, input_dragger_click_lock_1.setClickLock)(false);
|
|
227
352
|
}, 2);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
353
|
+
};
|
|
354
|
+
const onPointerUp = () => {
|
|
355
|
+
endDrag(true);
|
|
356
|
+
};
|
|
357
|
+
const onPointerCancel = () => {
|
|
358
|
+
endDrag(false);
|
|
359
|
+
};
|
|
360
|
+
const onWindowBlur = () => {
|
|
361
|
+
endDrag(false);
|
|
362
|
+
};
|
|
363
|
+
window.addEventListener('pointerup', onPointerUp);
|
|
364
|
+
window.addEventListener('pointercancel', onPointerCancel);
|
|
365
|
+
window.addEventListener('blur', onWindowBlur);
|
|
231
366
|
}, [
|
|
232
367
|
_step,
|
|
233
368
|
_min,
|
|
@@ -245,15 +380,8 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
245
380
|
(_a = fallbackRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
246
381
|
}
|
|
247
382
|
}, [inputFallback]);
|
|
248
|
-
const deriveStep = (0, react_1.useMemo)(() => {
|
|
249
|
-
return (0, exports.deriveInputDraggerStep)({
|
|
250
|
-
min: _min,
|
|
251
|
-
snapToStep,
|
|
252
|
-
step: _step,
|
|
253
|
-
});
|
|
254
|
-
}, [_min, _step, snapToStep]);
|
|
255
383
|
if (inputFallback) {
|
|
256
|
-
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,
|
|
384
|
+
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, onKeyDown: onInputKeyDown, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, rightAlign: rightAlign, small: small, ...props, type: "text" }) }));
|
|
257
385
|
}
|
|
258
386
|
return (jsx_runtime_1.jsx("button", { ref: ref, type: "button", className: '__remotion_input_dragger', style: exports.inputDraggerContainerStyle, onClick: onClick, onFocus: onFocus, onKeyDown: onKeyDown, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }) }));
|
|
259
387
|
};
|
|
@@ -281,7 +281,6 @@ const RenderButton = ({ readOnlyStudio, size: controlSize = 'default' }) => {
|
|
|
281
281
|
inFrameMark: inFrame,
|
|
282
282
|
outFrameMark: outFrame,
|
|
283
283
|
initialLogLevel: defaults.logLevel,
|
|
284
|
-
initialLicenseKey: defaults.publicLicenseKey,
|
|
285
284
|
initialStillImageFormat: defaults.stillImageFormat,
|
|
286
285
|
initialScale: defaults.scale,
|
|
287
286
|
initialDelayRenderTimeout: defaults.delayRenderTimeout,
|
|
@@ -32,7 +32,6 @@ const use_encodable_video_codecs_1 = require("./use-encodable-video-codecs");
|
|
|
32
32
|
const WebRenderModalAdvanced_1 = require("./WebRenderModalAdvanced");
|
|
33
33
|
const WebRenderModalAudio_1 = require("./WebRenderModalAudio");
|
|
34
34
|
const WebRenderModalBasic_1 = require("./WebRenderModalBasic");
|
|
35
|
-
const WebRenderModalLicense_1 = require("./WebRenderModalLicense");
|
|
36
35
|
const WebRenderModalPicture_1 = require("./WebRenderModalPicture");
|
|
37
36
|
const invalidCharacters = ['?', '*', '+', ':', '%'];
|
|
38
37
|
const isValidStillExtension = (extension, stillImageFormat) => {
|
|
@@ -80,7 +79,7 @@ const validateOutnameForStill = ({ outName, stillImageFormat, }) => {
|
|
|
80
79
|
// TODO: Shortcut: Shift + R
|
|
81
80
|
// TODO: Apply defaultCodec
|
|
82
81
|
// TODO: Apply defaultOutName
|
|
83
|
-
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel,
|
|
82
|
+
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, initialStillImageFormat, initialDefaultOutName, initialScale, initialDelayRenderTimeout, initialMediaCacheSizeInBytes, initialContainer, initialVideoCodec, initialAudioCodec, initialAudioBitrate, initialVideoBitrate, initialHardwareAcceleration, initialKeyframeIntervalInSeconds, initialTransparent, initialMuted, initialPageResponsiveness, }) => {
|
|
84
83
|
var _a;
|
|
85
84
|
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
86
85
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -89,6 +88,11 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
89
88
|
if (!context) {
|
|
90
89
|
throw new Error('Should not be able to render without resolving comp first');
|
|
91
90
|
}
|
|
91
|
+
const renderDefaults = window.remotion_renderDefaults;
|
|
92
|
+
if (!renderDefaults) {
|
|
93
|
+
throw new Error('Render defaults are not available');
|
|
94
|
+
}
|
|
95
|
+
const { publicLicenseKey } = renderDefaults;
|
|
92
96
|
const { resolved: { result: resolvedComposition }, unresolved: unresolvedComposition, } = context;
|
|
93
97
|
const [isVideo] = (0, react_1.useState)(() => {
|
|
94
98
|
return typeof resolvedComposition.durationInFrames === 'undefined'
|
|
@@ -123,7 +127,6 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
123
127
|
const [transparent, setTransparent] = (0, react_1.useState)(initialTransparent !== null && initialTransparent !== void 0 ? initialTransparent : false);
|
|
124
128
|
const [muted, setMuted] = (0, react_1.useState)(initialMuted !== null && initialMuted !== void 0 ? initialMuted : false);
|
|
125
129
|
const [scale, setScale] = (0, react_1.useState)(initialScale !== null && initialScale !== void 0 ? initialScale : 1);
|
|
126
|
-
const [licenseKey, setLicenseKey] = (0, react_1.useState)(initialLicenseKey);
|
|
127
130
|
const [pageResponsiveness, setPageResponsiveness] = (0, react_1.useState)(initialPageResponsiveness !== null && initialPageResponsiveness !== void 0 ? initialPageResponsiveness : 'medium');
|
|
128
131
|
const encodableAudioCodecs = (0, use_encodable_audio_codecs_1.useEncodableAudioCodecs)(container);
|
|
129
132
|
const encodableVideoCodecs = (0, use_encodable_video_codecs_1.useEncodableVideoCodecs)(container);
|
|
@@ -335,7 +338,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
335
338
|
delayRenderTimeout,
|
|
336
339
|
mediaCacheSizeInBytes,
|
|
337
340
|
logLevel,
|
|
338
|
-
licenseKey,
|
|
341
|
+
licenseKey: publicLicenseKey,
|
|
339
342
|
scale,
|
|
340
343
|
}, compositionRef);
|
|
341
344
|
}
|
|
@@ -361,7 +364,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
361
364
|
delayRenderTimeout,
|
|
362
365
|
mediaCacheSizeInBytes,
|
|
363
366
|
logLevel,
|
|
364
|
-
licenseKey,
|
|
367
|
+
licenseKey: publicLicenseKey,
|
|
365
368
|
scale,
|
|
366
369
|
pageResponsiveness,
|
|
367
370
|
}, compositionRef);
|
|
@@ -388,7 +391,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
388
391
|
delayRenderTimeout,
|
|
389
392
|
mediaCacheSizeInBytes,
|
|
390
393
|
logLevel,
|
|
391
|
-
|
|
394
|
+
publicLicenseKey,
|
|
392
395
|
container,
|
|
393
396
|
effectiveVideoCodec,
|
|
394
397
|
effectiveAudioCodec,
|
|
@@ -422,14 +425,17 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
422
425
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { style: render_modals_1.icon }) }),
|
|
423
426
|
"Audio"] })) : null, jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [
|
|
424
427
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { style: render_modals_1.icon }) }),
|
|
425
|
-
"Other"] }), jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected:
|
|
428
|
+
"Other"] }), jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
429
|
+
type: 'configure-license',
|
|
430
|
+
initialPublicLicenseKey: publicLicenseKey,
|
|
431
|
+
}), children: [
|
|
426
432
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { style: render_modals_1.icon }) }),
|
|
427
433
|
"License"] })
|
|
428
434
|
] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
429
435
|
canUpdate: false,
|
|
430
436
|
reason: 'render dialogue',
|
|
431
437
|
determined: false,
|
|
432
|
-
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) :
|
|
438
|
+
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) : null })
|
|
433
439
|
] })
|
|
434
440
|
] }));
|
|
435
441
|
};
|
|
@@ -398,7 +398,7 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
398
398
|
selectItem(item, interaction, undefined, { reveal: true });
|
|
399
399
|
}, [selectItem]);
|
|
400
400
|
const outlineTargets = (0, react_1.useMemo)(() => {
|
|
401
|
-
if (!interactivity_enabled_1.
|
|
401
|
+
if (!(0, interactivity_enabled_1.isStudioInteractivityEnabled)() || !editorShowOutlines) {
|
|
402
402
|
return [];
|
|
403
403
|
}
|
|
404
404
|
const selectedSequenceKeys = (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems);
|
|
@@ -5,6 +5,8 @@ export declare const SplitterContainer: React.FC<{
|
|
|
5
5
|
readonly orientation: SplitterOrientation;
|
|
6
6
|
readonly maxFlex: number;
|
|
7
7
|
readonly minFlex: number;
|
|
8
|
+
readonly maxFlexerSize: number | null;
|
|
9
|
+
readonly maxAntiFlexerSize: number | null;
|
|
8
10
|
readonly id: string;
|
|
9
11
|
readonly defaultFlex: number;
|
|
10
12
|
readonly children: React.ReactNode;
|
|
@@ -19,7 +19,7 @@ exports.containerColumn = {
|
|
|
19
19
|
flex: 1,
|
|
20
20
|
height: 0,
|
|
21
21
|
};
|
|
22
|
-
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, id }) => {
|
|
22
|
+
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, maxAntiFlexerSize, id, }) => {
|
|
23
23
|
const [initialTimelineFlex, persistFlex] = (0, timeline_1.useTimelineFlex)(id);
|
|
24
24
|
const [flexValue, setFlexValue] = (0, react_1.useState)(initialTimelineFlex !== null && initialTimelineFlex !== void 0 ? initialTimelineFlex : defaultFlex);
|
|
25
25
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -34,6 +34,8 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
34
34
|
id,
|
|
35
35
|
maxFlex,
|
|
36
36
|
minFlex,
|
|
37
|
+
maxFlexerSize,
|
|
38
|
+
maxAntiFlexerSize,
|
|
37
39
|
defaultFlex,
|
|
38
40
|
persistFlex,
|
|
39
41
|
};
|
|
@@ -42,6 +44,8 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
42
44
|
flexValue,
|
|
43
45
|
id,
|
|
44
46
|
maxFlex,
|
|
47
|
+
maxFlexerSize,
|
|
48
|
+
maxAntiFlexerSize,
|
|
45
49
|
minFlex,
|
|
46
50
|
orientation,
|
|
47
51
|
persistFlex,
|
|
@@ -11,6 +11,8 @@ export type TSplitterContext = {
|
|
|
11
11
|
ref: React.RefObject<HTMLDivElement | null>;
|
|
12
12
|
maxFlex: number;
|
|
13
13
|
minFlex: number;
|
|
14
|
+
maxFlexerSize: number | null;
|
|
15
|
+
maxAntiFlexerSize: number | null;
|
|
14
16
|
defaultFlex: number;
|
|
15
17
|
id: string;
|
|
16
18
|
persistFlex: (value: number) => void;
|
|
@@ -8,6 +8,7 @@ const colors_1 = require("../../helpers/colors");
|
|
|
8
8
|
const SplitterContext_1 = require("./SplitterContext");
|
|
9
9
|
const SplitterElement = ({ children, type, sticky }) => {
|
|
10
10
|
const context = (0, react_1.useContext)(SplitterContext_1.SplitterContext);
|
|
11
|
+
const maxSize = type === 'flexer' ? context.maxFlexerSize : context.maxAntiFlexerSize;
|
|
11
12
|
const style = (0, react_1.useMemo)(() => {
|
|
12
13
|
return {
|
|
13
14
|
flex:
|
|
@@ -17,8 +18,12 @@ const SplitterElement = ({ children, type, sticky }) => {
|
|
|
17
18
|
position: 'relative',
|
|
18
19
|
overflow: 'hidden',
|
|
19
20
|
flexDirection: 'column',
|
|
21
|
+
maxWidth: context.orientation === 'vertical' ? (maxSize !== null && maxSize !== void 0 ? maxSize : undefined) : undefined,
|
|
22
|
+
maxHeight: context.orientation === 'horizontal'
|
|
23
|
+
? (maxSize !== null && maxSize !== void 0 ? maxSize : undefined)
|
|
24
|
+
: undefined,
|
|
20
25
|
};
|
|
21
|
-
}, [context.flexValue, type]);
|
|
26
|
+
}, [context.flexValue, context.orientation, maxSize, type]);
|
|
22
27
|
const stickStyle = (0, react_1.useMemo)(() => {
|
|
23
28
|
return {
|
|
24
29
|
position: 'absolute',
|
|
@@ -31,6 +31,8 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
31
31
|
// Cleanup for the listeners that only exist for the duration of a drag.
|
|
32
32
|
let endDrag = null;
|
|
33
33
|
const onPointerDown = (e) => {
|
|
34
|
+
var _a;
|
|
35
|
+
var _b;
|
|
34
36
|
if (e.button !== 0) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
@@ -40,7 +42,20 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
40
42
|
// value updates on every pointermove, so it must not be re-read live.
|
|
41
43
|
const dragContext = latest.current.context;
|
|
42
44
|
const start = { x: e.clientX, y: e.clientY };
|
|
43
|
-
const
|
|
45
|
+
const { width: containerWidth, height: containerHeight } = (_b = (_a = dragContext.ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : {
|
|
46
|
+
width: 0,
|
|
47
|
+
height: 0,
|
|
48
|
+
};
|
|
49
|
+
const availableSize = (dragContext.orientation === 'vertical'
|
|
50
|
+
? containerWidth
|
|
51
|
+
: containerHeight) - exports.SPLITTER_HANDLE_SIZE;
|
|
52
|
+
const minFlex = dragContext.maxAntiFlexerSize === null || availableSize <= 0
|
|
53
|
+
? dragContext.minFlex
|
|
54
|
+
: Math.max(dragContext.minFlex, 1 - dragContext.maxAntiFlexerSize / availableSize);
|
|
55
|
+
const maxFlex = dragContext.maxFlexerSize === null || availableSize <= 0
|
|
56
|
+
? dragContext.maxFlex
|
|
57
|
+
: Math.min(dragContext.maxFlex, dragContext.maxFlexerSize / availableSize);
|
|
58
|
+
const startFlex = Math.min(maxFlex, Math.max(minFlex, dragContext.flexValue));
|
|
44
59
|
dragContext.isDragging.current = start;
|
|
45
60
|
(0, ForceSpecificCursor_1.forceSpecificCursor)(dragContext.orientation === 'horizontal' ? 'row-resize' : 'col-resize');
|
|
46
61
|
current.classList.add('remotion-splitter-active');
|
|
@@ -54,7 +69,7 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
54
69
|
: (ev.clientY - start.y) / (height - exports.SPLITTER_HANDLE_SIZE);
|
|
55
70
|
const newFlex = startFlex + change;
|
|
56
71
|
if (clamp) {
|
|
57
|
-
return Math.min(
|
|
72
|
+
return Math.min(maxFlex, Math.max(minFlex, newFlex));
|
|
58
73
|
}
|
|
59
74
|
return newFlex;
|
|
60
75
|
};
|
|
@@ -64,6 +79,8 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
64
79
|
current.classList.remove('remotion-splitter-active');
|
|
65
80
|
window.removeEventListener('pointermove', onPointerMove);
|
|
66
81
|
window.removeEventListener('pointerup', onPointerUp);
|
|
82
|
+
window.removeEventListener('pointercancel', onPointerCancel);
|
|
83
|
+
window.removeEventListener('blur', onWindowBlur);
|
|
67
84
|
endDrag = null;
|
|
68
85
|
player_1.PlayerInternals.updateAllElementsSizes();
|
|
69
86
|
};
|
|
@@ -95,8 +112,16 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
95
112
|
dragContext.persistFlex(getNewValue(ev, true));
|
|
96
113
|
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
97
114
|
};
|
|
115
|
+
const onPointerCancel = () => {
|
|
116
|
+
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
117
|
+
};
|
|
118
|
+
const onWindowBlur = () => {
|
|
119
|
+
endDrag === null || endDrag === void 0 ? void 0 : endDrag();
|
|
120
|
+
};
|
|
98
121
|
window.addEventListener('pointermove', onPointerMove);
|
|
99
122
|
window.addEventListener('pointerup', onPointerUp);
|
|
123
|
+
window.addEventListener('pointercancel', onPointerCancel);
|
|
124
|
+
window.addEventListener('blur', onWindowBlur);
|
|
100
125
|
};
|
|
101
126
|
current.addEventListener('pointerdown', onPointerDown);
|
|
102
127
|
return () => {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT =
|
|
3
|
+
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../../helpers/colors");
|
|
6
6
|
const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
7
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
|
-
exports.MAX_TIMELINE_TRACKS = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
9
8
|
exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = 24;
|
|
10
9
|
const container = {
|
|
11
10
|
height: exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT,
|
|
@@ -18,6 +17,7 @@ const container = {
|
|
|
18
17
|
paddingLeft: timeline_layout_1.TIMELINE_PADDING + 5,
|
|
19
18
|
};
|
|
20
19
|
const MaxTimelineTracksReached = () => {
|
|
21
|
-
|
|
20
|
+
const maxTimelineTracks = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
21
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: ["Limited display to ", maxTimelineTracks, " tracks to sustain performance.", '', "You can change this by setting Config.setMaxTimelineTracks() in your remotion.config.ts file."] }));
|
|
22
22
|
};
|
|
23
23
|
exports.MaxTimelineTracksReached = MaxTimelineTracksReached;
|
|
@@ -43,6 +43,7 @@ const colors_1 = require("../../helpers/colors");
|
|
|
43
43
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
44
44
|
const is_current_selected_still_1 = require("../../helpers/is-current-selected-still");
|
|
45
45
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
46
|
+
const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
46
47
|
const call_api_1 = require("../call-api");
|
|
47
48
|
const ContextMenu_1 = require("../ContextMenu");
|
|
48
49
|
const import_assets_1 = require("../import-assets");
|
|
@@ -51,7 +52,6 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
51
52
|
const SplitterContainer_1 = require("../Splitter/SplitterContainer");
|
|
52
53
|
const SplitterElement_1 = require("../Splitter/SplitterElement");
|
|
53
54
|
const SplitterHandle_1 = require("../Splitter/SplitterHandle");
|
|
54
|
-
const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
|
|
55
55
|
const SequencePropsObserver_1 = require("./SequencePropsObserver");
|
|
56
56
|
const should_show_track_in_timeline_1 = require("./should-show-track-in-timeline");
|
|
57
57
|
const should_subscribe_to_sequence_props_1 = require("./should-subscribe-to-sequence-props");
|
|
@@ -92,7 +92,7 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
92
92
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
93
93
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
94
94
|
const previewConnected = previewServerState.type === 'connected';
|
|
95
|
-
const previewInteractive = previewConnected && interactivity_enabled_1.
|
|
95
|
+
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
96
96
|
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
97
97
|
const currentComposition = (0, react_1.useMemo)(() => {
|
|
98
98
|
var _a;
|
|
@@ -219,7 +219,7 @@ const TimelineInner = () => {
|
|
|
219
219
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
220
220
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
221
221
|
const previewConnected = previewServerState.type === 'connected';
|
|
222
|
-
const previewInteractive = previewConnected && interactivity_enabled_1.
|
|
222
|
+
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
223
223
|
const videoConfigIsNull = videoConfig === null;
|
|
224
224
|
const timeline = (0, react_1.useMemo)(() => {
|
|
225
225
|
if (videoConfigIsNull) {
|
|
@@ -240,21 +240,22 @@ const TimelineInner = () => {
|
|
|
240
240
|
const filtered = (0, react_1.useMemo)(() => {
|
|
241
241
|
return timeline.filter((t) => (0, should_show_track_in_timeline_1.shouldShowTrackInTimeline)(t, durationInFrames));
|
|
242
242
|
}, [durationInFrames, timeline]);
|
|
243
|
+
const maxTimelineTracks = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
243
244
|
const shown = (0, react_1.useMemo)(() => {
|
|
244
|
-
return filtered.length >
|
|
245
|
-
? filtered.slice(0,
|
|
245
|
+
return filtered.length > maxTimelineTracks
|
|
246
|
+
? filtered.slice(0, maxTimelineTracks)
|
|
246
247
|
: filtered;
|
|
247
|
-
}, [filtered]);
|
|
248
|
+
}, [filtered, maxTimelineTracks]);
|
|
248
249
|
const hasBeenCut = filtered.length > shown.length;
|
|
249
250
|
return (jsx_runtime_1.jsxs(TimelineContextMenuArea, { children: [sequences.map((sequence) => {
|
|
250
251
|
if (!(0, should_subscribe_to_sequence_props_1.shouldSubscribeToSequenceProps)(sequence, previewInteractive)) {
|
|
251
252
|
return null;
|
|
252
253
|
}
|
|
253
254
|
return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, componentIdentity: sequence.controls.componentIdentity, schema: sequence.controls.schema, getStack: sequence.getStack, effects: sequence.effects }, sequence.id));
|
|
254
|
-
}), interactivity_enabled_1.
|
|
255
|
-
jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [
|
|
255
|
+
}), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}) : null, jsx_runtime_1.jsx(TimelineKeyframeTracksContext_1.TimelineKeyframeTracksProvider, { tracks: filtered, children: jsx_runtime_1.jsxs(TimelineSelection_1.TimelineSelectableItemsProvider, { timeline: shown, children: [(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectAllKeybindings, { timeline: shown })) : null, jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: isStill ? (jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown })) : (jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
|
|
256
|
+
jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, maxAntiFlexerSize: null, children: [
|
|
256
257
|
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [
|
|
257
|
-
jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), interactivity_enabled_1.
|
|
258
|
+
jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineInOutDragHandler_1.TimelineInOutDragHandler, {})) : null, jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
|
|
258
259
|
] }) })
|
|
259
260
|
] })
|
|
260
261
|
] })) })
|
|
@@ -89,7 +89,7 @@ const TimelineDragHandler = () => {
|
|
|
89
89
|
if (!canvasContent || canvasContent.type !== 'composition') {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && interactivity_enabled_1.
|
|
92
|
+
return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineDragHandlerInnerMemo, {})) : null }));
|
|
93
93
|
};
|
|
94
94
|
exports.TimelineDragHandler = TimelineDragHandler;
|
|
95
95
|
const TimelineDragHandlerInner = () => {
|