@remotion/studio 4.0.519 → 4.0.521
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/api/shut-down-studio.d.ts +6 -0
- package/dist/api/shut-down-studio.js +23 -0
- package/dist/api/visual-control.js +2 -2
- package/dist/components/AudioWaveform.js +16 -7
- package/dist/components/Canvas.js +114 -48
- package/dist/components/CaptionInspector.d.ts +1 -0
- package/dist/components/CaptionInspector.js +43 -2
- package/dist/components/CaptionTextEditor.js +1 -1
- package/dist/components/CompositionSelector.js +41 -34
- package/dist/components/CompositionSelectorItem.d.ts +7 -0
- package/dist/components/CompositionSelectorItem.js +344 -73
- package/dist/components/CurrentCompositionSideEffects.js +5 -0
- package/dist/components/ElementInstallConfirmation.d.ts +2 -23
- package/dist/components/ElementInstallConfirmation.js +89 -65
- package/dist/components/ElementLibraryModal.js +3 -1
- package/dist/components/FpsCounter.js +1 -1
- package/dist/components/FramePersistor.js +1 -1
- package/dist/components/InlineCaptionInspector.js +37 -1
- package/dist/components/InspectorPanel/ElementLibraryButton.js +3 -18
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -3
- package/dist/components/InspectorPanel/use-composition-actions.js +5 -8
- package/dist/components/InspectorSequenceSection.js +1 -4
- package/dist/components/Menu/MenuSubItem.js +1 -1
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/ModalHeader.js +5 -1
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/NewComposition.js +2 -2
- package/dist/components/PlayPause.js +2 -13
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +29 -15
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +14 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +64 -9
- package/dist/components/QuickSwitcher/asset-search.d.ts +0 -1
- package/dist/components/QuickSwitcher/asset-search.js +1 -16
- package/dist/components/QuickSwitcher/composition-search.d.ts +16 -0
- package/dist/components/QuickSwitcher/composition-search.js +136 -0
- package/dist/components/RenderButton.js +2 -2
- package/dist/components/RenderModal/RenderStatusModal.js +7 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WebRenderModal.js +1 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +1 -1
- package/dist/components/ResetZoomButton.js +17 -2
- package/dist/components/SelectedOutlineElement.js +10 -30
- package/dist/components/SettingsModal.js +8 -5
- package/dist/components/TimeValue.js +36 -7
- package/dist/components/Timeline/Timeline.d.ts +1 -1
- package/dist/components/Timeline/Timeline.js +33 -20
- package/dist/components/Timeline/TimelineAssetField.d.ts +0 -1
- package/dist/components/Timeline/TimelineAssetField.js +17 -9
- package/dist/components/Timeline/TimelineCollapseToggle.js +1 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -90
- package/dist/components/Timeline/TimelineDragHandler.js +18 -8
- package/dist/components/Timeline/TimelineFontWeightField.d.ts +11 -0
- package/dist/components/Timeline/TimelineFontWeightField.js +65 -0
- package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -3
- package/dist/components/Timeline/TimelineLayerChildren.d.ts +21 -0
- package/dist/components/Timeline/TimelineLayerChildren.js +129 -0
- package/dist/components/Timeline/TimelineNumberField.js +13 -5
- package/dist/components/Timeline/TimelinePinchZoom.js +14 -4
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +8 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineSequence.js +54 -73
- package/dist/components/Timeline/TimelineSequenceItem.js +16 -36
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +22 -10
- package/dist/components/Timeline/TimelineSlider.js +2 -2
- package/dist/components/Timeline/TimelineTickFormatProvider.d.ts +8 -0
- package/dist/components/Timeline/TimelineTickFormatProvider.js +16 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +7 -3
- package/dist/components/Timeline/TimelineVideoInfo.js +7 -3
- package/dist/components/Timeline/TimelineWidthProvider.js +15 -8
- package/dist/components/Timeline/TimelineZoomControls.js +25 -8
- package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +1 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +21 -17
- package/dist/components/Timeline/use-delete-timeline-items.d.ts +1 -0
- package/dist/components/Timeline/use-delete-timeline-items.js +118 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +8 -14
- package/dist/components/UpdateStatusContext.d.ts +5 -0
- package/dist/components/UpdateStatusContext.js +53 -2
- package/dist/components/UpdatesSettings.js +25 -4
- package/dist/components/WebMcp.js +87 -8
- package/dist/components/ZoomPersistor.js +2 -2
- package/dist/components/composition-drag-data.d.ts +36 -0
- package/dist/components/composition-drag-data.js +232 -0
- package/dist/components/composition-selector-drag-data.d.ts +27 -0
- package/dist/components/composition-selector-drag-data.js +80 -0
- package/dist/components/drop-handler-data.d.ts +2 -1
- package/dist/components/drop-handler-data.js +6 -4
- package/dist/components/effect-drag-and-drop.d.ts +2 -5
- package/dist/components/handle-drop.js +6 -2
- package/dist/components/import-assets.d.ts +7 -14
- package/dist/components/import-assets.js +11 -1
- package/dist/components/parse-caption-file.d.ts +5 -0
- package/dist/components/parse-caption-file.js +63 -0
- package/dist/error-overlay/current-error.d.ts +13 -0
- package/dist/error-overlay/current-error.js +21 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +5 -1
- package/dist/esm/chunk-emw4k5b0.js +99527 -0
- package/dist/esm/{chunk-1fkq5bfq.js → chunk-vkrvnx2h.js} +20116 -16283
- package/dist/esm/index.mjs +27 -9
- package/dist/esm/internals.mjs +17408 -13426
- package/dist/esm/previewEntry.mjs +17285 -13216
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/create-folder-tree.js +2 -5
- package/dist/helpers/document-title.d.ts +2 -0
- package/dist/helpers/document-title.js +14 -3
- package/dist/helpers/get-preview-file-type.js +22 -3
- package/dist/helpers/get-timeline-max-zoom.d.ts +34 -28
- package/dist/helpers/get-timeline-max-zoom.js +46 -29
- package/dist/helpers/inserted-element-selection.d.ts +2 -1
- package/dist/helpers/install-fiber-sequence-order-observer.d.ts +37 -0
- package/dist/helpers/install-fiber-sequence-order-observer.js +109 -0
- package/dist/helpers/open-in-editor.js +2 -1
- package/dist/helpers/use-menu-structure.js +2 -2
- package/dist/helpers/use-runtime-values.d.ts +1 -1
- package/dist/helpers/use-runtime-values.js +5 -4
- package/dist/helpers/use-sync-external-store.d.ts +3 -0
- package/dist/helpers/use-sync-external-store.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/previewEntry.js +2 -0
- package/dist/state/modals.d.ts +16 -2
- package/dist/state/timeline-sequence-hover.js +3 -2
- package/dist/state/timeline-zoom.d.ts +0 -1
- package/dist/state/timeline-zoom.js +13 -6
- package/package.json +17 -17
- package/dist/helpers/sort-by-nonce-history.d.ts +0 -1
- package/dist/helpers/sort-by-nonce-history.js +0 -6
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const react_dom_1 = require("react-dom");
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
9
9
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
10
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
10
11
|
const colors_1 = require("../helpers/colors");
|
|
11
12
|
const hoverable_1 = require("../helpers/hoverable");
|
|
12
13
|
const resolved_stack_to_symbolicated_1 = require("../helpers/resolved-stack-to-symbolicated");
|
|
@@ -38,7 +39,7 @@ const container = {
|
|
|
38
39
|
const dialogContent = {
|
|
39
40
|
...container,
|
|
40
41
|
padding: 16,
|
|
41
|
-
width: 'min(
|
|
42
|
+
width: 'min(520px, calc(100vw - 40px))',
|
|
42
43
|
maxHeight: 'min(720px, calc(100vh - 140px))',
|
|
43
44
|
overflowY: 'auto',
|
|
44
45
|
};
|
|
@@ -84,8 +85,19 @@ const metadataDescriptionStyle = {
|
|
|
84
85
|
lineHeight: 1.5,
|
|
85
86
|
overflowWrap: 'anywhere',
|
|
86
87
|
};
|
|
87
|
-
const
|
|
88
|
+
const requestSourceStyle = {
|
|
89
|
+
display: 'flex',
|
|
90
|
+
justifyContent: 'space-between',
|
|
91
|
+
gap: 16,
|
|
92
|
+
margin: 0,
|
|
93
|
+
};
|
|
94
|
+
const requestSourceDescriptionStyle = {
|
|
88
95
|
...metadataDescriptionStyle,
|
|
96
|
+
color: colors_1.LIGHT_TEXT,
|
|
97
|
+
textAlign: 'right',
|
|
98
|
+
};
|
|
99
|
+
const unverifiedRequestSourceStyle = {
|
|
100
|
+
...requestSourceDescriptionStyle,
|
|
89
101
|
color: colors_1.WARNING_COLOR,
|
|
90
102
|
};
|
|
91
103
|
const codeStyle = {
|
|
@@ -110,32 +122,13 @@ const dependencyListStyle = {
|
|
|
110
122
|
padding: 0,
|
|
111
123
|
listStyleType: 'none',
|
|
112
124
|
};
|
|
113
|
-
const dependencyRowStyle = {
|
|
114
|
-
display: 'flex',
|
|
115
|
-
alignItems: 'baseline',
|
|
116
|
-
justifyContent: 'space-between',
|
|
117
|
-
gap: 16,
|
|
118
|
-
minWidth: 0,
|
|
119
|
-
};
|
|
120
125
|
const dependencyNameStyle = {
|
|
121
126
|
minWidth: 0,
|
|
122
127
|
color: colors_1.WHITE,
|
|
123
|
-
fontFamily: 'monospace',
|
|
124
|
-
fontSize: 13,
|
|
125
|
-
lineHeight: 1.5,
|
|
126
|
-
overflowWrap: 'anywhere',
|
|
127
|
-
};
|
|
128
|
-
const dependencyInstallStatusStyle = {
|
|
129
|
-
flexShrink: 0,
|
|
130
|
-
color: colors_1.WARNING_COLOR,
|
|
131
128
|
fontFamily: 'sans-serif',
|
|
132
129
|
fontSize: 13,
|
|
133
|
-
fontWeight: 500,
|
|
134
130
|
lineHeight: 1.5,
|
|
135
|
-
|
|
136
|
-
const dependencyInstalledStatusStyle = {
|
|
137
|
-
...dependencyInstallStatusStyle,
|
|
138
|
-
color: colors_1.LIGHT_TEXT,
|
|
131
|
+
overflowWrap: 'anywhere',
|
|
139
132
|
};
|
|
140
133
|
const warningStyle = {
|
|
141
134
|
display: 'flex',
|
|
@@ -159,6 +152,10 @@ const warningDescriptionStyle = {
|
|
|
159
152
|
fontWeight: 400,
|
|
160
153
|
lineHeight: 1.5,
|
|
161
154
|
};
|
|
155
|
+
const installWarningDescriptionStyle = {
|
|
156
|
+
...warningDescriptionStyle,
|
|
157
|
+
color: colors_1.WHITE,
|
|
158
|
+
};
|
|
162
159
|
const browseElementsStyle = {
|
|
163
160
|
color: 'inherit',
|
|
164
161
|
fontFamily: 'inherit',
|
|
@@ -173,7 +170,7 @@ const sourceDetailsStyle = {
|
|
|
173
170
|
lineHeight: 1.5,
|
|
174
171
|
};
|
|
175
172
|
const sourceSummaryStyle = {
|
|
176
|
-
cursor: '
|
|
173
|
+
cursor: 'default',
|
|
177
174
|
color: colors_1.WHITE,
|
|
178
175
|
fontFamily: 'sans-serif',
|
|
179
176
|
fontSize: 13,
|
|
@@ -205,23 +202,29 @@ const destinationControlStyle = {
|
|
|
205
202
|
display: 'flex',
|
|
206
203
|
alignItems: 'center',
|
|
207
204
|
justifyContent: 'space-between',
|
|
208
|
-
|
|
205
|
+
columnGap: 16,
|
|
206
|
+
rowGap: 10,
|
|
207
|
+
flexWrap: 'wrap',
|
|
209
208
|
};
|
|
210
209
|
const destinationOptionsStyle = {
|
|
211
210
|
display: 'flex',
|
|
212
211
|
overflow: 'hidden',
|
|
212
|
+
maxWidth: '100%',
|
|
213
|
+
marginLeft: 'auto',
|
|
213
214
|
border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
214
215
|
borderRadius: 4,
|
|
215
216
|
};
|
|
216
217
|
const destinationOptionStyle = {
|
|
217
218
|
appearance: 'none',
|
|
219
|
+
minHeight: 26,
|
|
218
220
|
border: 0,
|
|
219
221
|
cursor: 'default',
|
|
220
222
|
fontFamily: 'sans-serif',
|
|
221
|
-
fontSize:
|
|
223
|
+
fontSize: 12,
|
|
222
224
|
fontWeight: 400,
|
|
223
|
-
lineHeight:
|
|
224
|
-
padding: '
|
|
225
|
+
lineHeight: '18px',
|
|
226
|
+
padding: '4px 8px',
|
|
227
|
+
whiteSpace: 'nowrap',
|
|
225
228
|
};
|
|
226
229
|
const getDestinationOptionStyle = ({ disabled, selected, }) => ({
|
|
227
230
|
...destinationOptionStyle,
|
|
@@ -239,6 +242,7 @@ const footerStyle = {
|
|
|
239
242
|
const cancelStyle = {
|
|
240
243
|
minWidth: 90,
|
|
241
244
|
};
|
|
245
|
+
const elementInstallTitleId = 'remotion-element-install-title';
|
|
242
246
|
const makeSourceControlsVisible = (sourceCode) => {
|
|
243
247
|
return sourceCode.replace(/[\u200b-\u200f\u202a-\u202e\u2066-\u2069\ufeff]/g, (character) => {
|
|
244
248
|
var _a;
|
|
@@ -262,13 +266,28 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
|
262
266
|
] }));
|
|
263
267
|
};
|
|
264
268
|
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
265
|
-
const ElementInstallConfirmation = ({
|
|
266
|
-
var _a
|
|
267
|
-
const {
|
|
269
|
+
const ElementInstallConfirmation = ({ state }) => {
|
|
270
|
+
var _a;
|
|
271
|
+
const { currentPlan, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, } = state;
|
|
272
|
+
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
273
|
+
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
274
|
+
const currentCompositionMetadata = config === null ||
|
|
275
|
+
(canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'composition' ||
|
|
276
|
+
canvasContent.compositionId !== request.compositionId
|
|
277
|
+
? null
|
|
278
|
+
: {
|
|
279
|
+
durationInFrames: config.durationInFrames,
|
|
280
|
+
fps: config.fps,
|
|
281
|
+
height: config.height,
|
|
282
|
+
width: config.width,
|
|
283
|
+
};
|
|
284
|
+
const usesBrowserDependencyResolution = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
268
285
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
269
286
|
const [mode, setMode] = (0, react_1.useState)(currentPlan === null ? 'new-composition' : 'current-composition');
|
|
270
287
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
271
288
|
const inputRef = (0, react_1.useRef)(null);
|
|
289
|
+
const currentDestinationRef = (0, react_1.useRef)(null);
|
|
290
|
+
const newDestinationRef = (0, react_1.useRef)(null);
|
|
272
291
|
const [newCompositionValues, setNewCompositionValues] = (0, react_1.useState)(() => {
|
|
273
292
|
var _a, _b, _c, _d, _e;
|
|
274
293
|
const elementComponentName = (_a = studio_protocol_1.StudioProtocolInternals.getElementComponentNameFromSourceCode(request.element.sourceCode)) !== null && _a !== void 0 ? _a : 'Element';
|
|
@@ -386,6 +405,7 @@ const ElementInstallConfirmation = ({ currentCompositionMetadata, currentPlan, d
|
|
|
386
405
|
const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
|
|
387
406
|
const folderTargetIsReady = selectedFolderStack === null ||
|
|
388
407
|
((0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack) && folderCompositionFile !== null);
|
|
408
|
+
const title = `Install ${request.element.displayName}${request.element.displayName.endsWith(' Element') ? '' : ' Element'}`;
|
|
389
409
|
const canSubmit = !submitting &&
|
|
390
410
|
(mode === 'current-composition'
|
|
391
411
|
? currentPlan !== null
|
|
@@ -454,63 +474,67 @@ const ElementInstallConfirmation = ({ currentCompositionMetadata, currentPlan, d
|
|
|
454
474
|
onClose();
|
|
455
475
|
}
|
|
456
476
|
}, [onClose, submitting]);
|
|
477
|
+
const onDestinationKeyDown = (0, react_1.useCallback)((event) => {
|
|
478
|
+
if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
event.preventDefault();
|
|
482
|
+
if (currentPlan === null) {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
const nextMode = mode === 'current-composition'
|
|
486
|
+
? 'new-composition'
|
|
487
|
+
: 'current-composition';
|
|
488
|
+
setMode(nextMode);
|
|
489
|
+
requestAnimationFrame(() => {
|
|
490
|
+
var _a, _b;
|
|
491
|
+
if (nextMode === 'current-composition') {
|
|
492
|
+
(_a = currentDestinationRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
(_b = newDestinationRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
}, [currentPlan, mode]);
|
|
457
499
|
const onSubmit = (0, react_1.useCallback)((event) => {
|
|
458
500
|
event.preventDefault();
|
|
459
501
|
submit();
|
|
460
502
|
}, [submit]);
|
|
461
|
-
return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onOutsideClick: cancel, onEscape: cancel, children: [
|
|
462
|
-
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title:
|
|
503
|
+
return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabelledBy: elementInstallTitleId, onOutsideClick: cancel, onEscape: cancel, children: [
|
|
504
|
+
jsx_runtime_1.jsx("div", { id: elementInstallTitleId, children: jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: title, onClose: cancel }) }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
463
505
|
jsx_runtime_1.jsxs("div", { style: dialogContent, children: [
|
|
464
|
-
jsx_runtime_1.jsxs("
|
|
465
|
-
jsx_runtime_1.jsx("
|
|
466
|
-
|
|
506
|
+
jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, "aria-label": "Request source", children: [
|
|
507
|
+
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "From" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
508
|
+
? unverifiedRequestSourceStyle
|
|
509
|
+
: requestSourceDescriptionStyle, children: sourceLabel })
|
|
510
|
+
] }), jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
|
|
511
|
+
jsx_runtime_1.jsx("div", { style: sectionTitleStyle, children: "Destination" }), jsx_runtime_1.jsxs("div", { "aria-label": "Installation destination", onKeyDown: onDestinationKeyDown, role: "radiogroup", style: destinationOptionsStyle, children: [
|
|
512
|
+
jsx_runtime_1.jsx("button", { ref: currentDestinationRef, "aria-checked": mode === 'current-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, disabled: currentPlan === null, onClick: () => setMode('current-composition'), role: "radio", style: getDestinationOptionStyle({
|
|
467
513
|
disabled: currentPlan === null,
|
|
468
514
|
selected: mode === 'current-composition',
|
|
469
|
-
}), type: "button", children: "Current composition" }), jsx_runtime_1.jsx("button", { "aria-
|
|
515
|
+
}), tabIndex: mode === 'current-composition' ? 0 : -1, type: "button", children: "Current composition" }), jsx_runtime_1.jsx("button", { ref: newDestinationRef, "aria-checked": mode === 'new-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: () => {
|
|
470
516
|
setMode('new-composition');
|
|
471
517
|
requestAnimationFrame(() => {
|
|
472
518
|
var _a;
|
|
473
519
|
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
474
520
|
});
|
|
475
|
-
}, style: {
|
|
521
|
+
}, role: "radio", style: {
|
|
476
522
|
...getDestinationOptionStyle({
|
|
477
523
|
disabled: false,
|
|
478
524
|
selected: mode === 'new-composition',
|
|
479
525
|
}),
|
|
480
526
|
borderLeft: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
481
|
-
}, type: "button", children: "New composition" })
|
|
527
|
+
}, tabIndex: mode === 'new-composition' ? 0 : -1, type: "button", children: "New composition" })
|
|
482
528
|
] })
|
|
483
529
|
] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
|
|
484
|
-
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style:
|
|
530
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: installWarningDescriptionStyle, children: ["Studio could not find a safe place in \u201C", request.compositionId, "\u201D to insert the Element. Install it into a new composition instead."] })
|
|
485
531
|
] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-label": "New composition settings", children: [
|
|
486
|
-
jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, jsx_runtime_1.jsxs("
|
|
487
|
-
jsx_runtime_1.
|
|
488
|
-
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Element" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: request.element.displayName })
|
|
489
|
-
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
490
|
-
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Request source" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
491
|
-
? unverifiedSourceStyle
|
|
492
|
-
: metadataDescriptionStyle, children: sourceLabel })
|
|
493
|
-
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
494
|
-
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Composition" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: mode === 'current-composition'
|
|
495
|
-
? request.compositionId
|
|
496
|
-
: newCompositionValues.id }) })
|
|
497
|
-
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
498
|
-
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: (_b = selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.filePath) !== null && _b !== void 0 ? _b : 'Reviewing destination…' }) })
|
|
499
|
-
] }), (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.expectedFileState.exists) ? (jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
500
|
-
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "File change" }), jsx_runtime_1.jsx("dd", { style: overwriteStyle, children: "Replace existing source file" })
|
|
501
|
-
] })) : null] }), dependenciesToReview.length > 0 ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-labelledby": "element-install-dependencies", children: [
|
|
502
|
-
jsx_runtime_1.jsx("h3", { id: "element-install-dependencies", style: sectionTitleStyle, children: "Dependencies" }), jsx_runtime_1.jsx("ul", { style: dependencyListStyle, role: "list", children: dependenciesToReview.map((packageName) => {
|
|
503
|
-
const willInstall = missingPackages.includes(packageName);
|
|
504
|
-
return (jsx_runtime_1.jsxs("li", { style: dependencyRowStyle, children: [
|
|
505
|
-
jsx_runtime_1.jsx("div", { style: dependencyNameStyle, children: packageName }), jsx_runtime_1.jsx("div", { style: willInstall
|
|
506
|
-
? dependencyInstallStatusStyle
|
|
507
|
-
: dependencyInstalledStatusStyle, children: willInstall ? 'Will be installed' : 'Installed' })
|
|
508
|
-
] }, packageName));
|
|
509
|
-
}) })
|
|
532
|
+
jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.expectedFileState.exists) ? (jsx_runtime_1.jsx("p", { style: overwriteStyle, role: "status", children: "This will replace the existing Element source file." })) : null, missingPackages.length > 0 ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-labelledby": "element-install-dependencies", children: [
|
|
533
|
+
jsx_runtime_1.jsx("h3", { id: "element-install-dependencies", style: sectionTitleStyle, children: "Packages to install" }), jsx_runtime_1.jsx("ul", { style: dependencyListStyle, role: "list", children: missingPackages.map((packageName) => (jsx_runtime_1.jsx("li", { style: dependencyNameStyle, children: packageName }, packageName))) })
|
|
510
534
|
] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
|
|
511
|
-
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style:
|
|
535
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: installWarningDescriptionStyle, children: ["This adds executable source code to your project, with access to your files and the network.", usesBrowserDependencyResolution || missingPackages.length === 0
|
|
512
536
|
? null
|
|
513
|
-
: ' Package lifecycle scripts may also run during installation
|
|
537
|
+
: ' Package lifecycle scripts may also run during installation.'] })
|
|
514
538
|
] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
|
|
515
539
|
jsx_runtime_1.jsx("summary", { style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("pre", { style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: makeSourceControlsVisible(request.element.sourceCode) }) })
|
|
516
540
|
] })
|
|
@@ -15,6 +15,7 @@ const panelStyle = {
|
|
|
15
15
|
};
|
|
16
16
|
const iframeStyle = {
|
|
17
17
|
border: 0,
|
|
18
|
+
colorScheme: 'dark',
|
|
18
19
|
flex: 1,
|
|
19
20
|
minHeight: 0,
|
|
20
21
|
width: '100%',
|
|
@@ -31,10 +32,11 @@ const ElementLibraryModal = ({ name, url }) => {
|
|
|
31
32
|
iframe.setAttribute('credentialless', '');
|
|
32
33
|
const iframeUrl = new URL(url);
|
|
33
34
|
iframeUrl.searchParams.set('remotion-studio', 'true');
|
|
35
|
+
iframeUrl.searchParams.set('docusaurus-theme', 'dark');
|
|
34
36
|
iframe.src = iframeUrl.toString();
|
|
35
37
|
}, [url]);
|
|
36
38
|
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
|
|
37
|
-
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: name }), jsx_runtime_1.jsx("iframe", { ref: iframeRef, allow: "local-network-access; loopback-network", style: iframeStyle, title: `${name} library` })
|
|
39
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: name }), jsx_runtime_1.jsx("iframe", { ref: iframeRef, allow: "local-network-access; loopback-network", "data-remotion-element-library": "", style: iframeStyle, title: `${name} library` })
|
|
38
40
|
] }));
|
|
39
41
|
};
|
|
40
42
|
exports.ElementLibraryModal = ElementLibraryModal;
|
|
@@ -17,7 +17,7 @@ const pushWithMaxSize = (arr, value, maxSize) => {
|
|
|
17
17
|
};
|
|
18
18
|
const FpsCounter = ({ playbackSpeed }) => {
|
|
19
19
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
20
|
-
const
|
|
20
|
+
const playing = remotion_1.Internals.usePlaying();
|
|
21
21
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
22
22
|
const [marker, rerender] = (0, react_1.useState)({});
|
|
23
23
|
const [fps, setFps] = (0, react_1.useState)(0);
|
|
@@ -4,7 +4,7 @@ exports.FramePersistor = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const FramePersistor = () => {
|
|
7
|
-
const
|
|
7
|
+
const playing = remotion_1.Internals.usePlaying();
|
|
8
8
|
const config = (0, remotion_1.useVideoConfig)();
|
|
9
9
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
10
10
|
const setFrame = remotion_1.Internals.useTimelineSetFrame();
|
|
@@ -107,6 +107,42 @@ const InlineCaptionInspector = ({ captions, controls, expanded, nodePath, onTogg
|
|
|
107
107
|
setPropStatuses,
|
|
108
108
|
validatedLocation.source,
|
|
109
109
|
]);
|
|
110
|
+
const replaceCaptions = (0, react_1.useCallback)((nextCaptions) => {
|
|
111
|
+
if (!canSave || clientId === null) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
setDraftCaptions(nextCaptions);
|
|
115
|
+
setDragOverrides(nodePath, 'captions', remotion_1.Internals.makeStaticDragOverride(nextCaptions));
|
|
116
|
+
savedCaptions.current = nextCaptions;
|
|
117
|
+
(0, save_sequence_prop_1.saveSequenceProps)({
|
|
118
|
+
changes: [
|
|
119
|
+
{
|
|
120
|
+
fileName: validatedLocation.source,
|
|
121
|
+
nodePath,
|
|
122
|
+
fieldKey: 'captions',
|
|
123
|
+
value: nextCaptions,
|
|
124
|
+
defaultValue: null,
|
|
125
|
+
schema: controls.schema,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
addedKeyframes: null,
|
|
129
|
+
movedKeyframes: null,
|
|
130
|
+
setPropStatuses,
|
|
131
|
+
clientId,
|
|
132
|
+
undoLabel: 'Import captions',
|
|
133
|
+
redoLabel: 'Import captions again',
|
|
134
|
+
});
|
|
135
|
+
clearDragOverrides(nodePath);
|
|
136
|
+
}, [
|
|
137
|
+
canSave,
|
|
138
|
+
clearDragOverrides,
|
|
139
|
+
clientId,
|
|
140
|
+
controls.schema,
|
|
141
|
+
nodePath,
|
|
142
|
+
setDragOverrides,
|
|
143
|
+
setPropStatuses,
|
|
144
|
+
validatedLocation.source,
|
|
145
|
+
]);
|
|
110
146
|
const readOnlyTitle = readOnlyStudio
|
|
111
147
|
? 'Caption editing is unavailable in read-only Studio'
|
|
112
148
|
: clientId === null
|
|
@@ -114,6 +150,6 @@ const InlineCaptionInspector = ({ captions, controls, expanded, nodePath, onTogg
|
|
|
114
150
|
: (captionStatus === null || captionStatus === void 0 ? void 0 : captionStatus.status) === 'computed'
|
|
115
151
|
? 'Captions must be a direct inline JSX array to edit them'
|
|
116
152
|
: 'Captions are not ready for editing';
|
|
117
|
-
return (jsx_runtime_1.jsx(CaptionInspector_1.CaptionInspector, { captions: draftCaptions, expanded: expanded, onTextChange: updateCaptions, onTextSave: saveCaptions, onTextCancel: cancelCaptions, onToggle: onToggle, readOnly: !canSave, readOnlyTitle: canSave ? null : readOnlyTitle }));
|
|
153
|
+
return (jsx_runtime_1.jsx(CaptionInspector_1.CaptionInspector, { captions: draftCaptions, expanded: expanded, onTextChange: updateCaptions, onTextSave: saveCaptions, onTextCancel: cancelCaptions, onToggle: onToggle, readOnly: !canSave, readOnlyTitle: canSave ? null : readOnlyTitle, onReplaceCaptions: canSave ? replaceCaptions : null }));
|
|
118
154
|
};
|
|
119
155
|
exports.InlineCaptionInspector = InlineCaptionInspector;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ElementLibraryButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
6
|
const colors_1 = require("../../helpers/colors");
|
|
8
7
|
const browse_elements_1 = require("../../icons/browse-elements");
|
|
9
8
|
const caret_1 = require("../../icons/caret");
|
|
@@ -23,13 +22,6 @@ const browseElementsIconContainerStyle = {
|
|
|
23
22
|
marginRight: -2,
|
|
24
23
|
width: 22,
|
|
25
24
|
};
|
|
26
|
-
const browseElementsArrowStyle = {
|
|
27
|
-
display: 'inline-block',
|
|
28
|
-
height: 12,
|
|
29
|
-
marginLeft: 4,
|
|
30
|
-
verticalAlign: -2,
|
|
31
|
-
width: 12,
|
|
32
|
-
};
|
|
33
25
|
const elementLibraryDropdownStyle = {
|
|
34
26
|
borderRadius: 4,
|
|
35
27
|
height: 28,
|
|
@@ -63,19 +55,14 @@ const ElementLibraryButton = () => {
|
|
|
63
55
|
var _a;
|
|
64
56
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
65
57
|
const { studioRuntimeConfig } = (0, SettingsContext_1.useSettings)();
|
|
66
|
-
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
67
58
|
const elementLibraries = (_a = studioRuntimeConfig === null || studioRuntimeConfig === void 0 ? void 0 : studioRuntimeConfig.elementLibraries) !== null && _a !== void 0 ? _a : noElementLibraries;
|
|
68
59
|
const openElementLibrary = (0, react_1.useCallback)((name, url) => {
|
|
69
|
-
if (isBrowserStudio) {
|
|
70
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
60
|
setSelectedModal({
|
|
74
61
|
type: 'element-library',
|
|
75
62
|
name,
|
|
76
63
|
url,
|
|
77
64
|
});
|
|
78
|
-
}, [
|
|
65
|
+
}, [setSelectedModal]);
|
|
79
66
|
const openElementsLibrary = (0, react_1.useCallback)(() => {
|
|
80
67
|
openElementLibrary('Remotion Elements', 'https://www.remotion.dev/elements');
|
|
81
68
|
}, [openElementLibrary]);
|
|
@@ -129,11 +116,9 @@ const ElementLibraryButton = () => {
|
|
|
129
116
|
],
|
|
130
117
|
},
|
|
131
118
|
], [elementLibraries, openElementLibrary, openElementsLibrary]);
|
|
132
|
-
if (elementLibraries.length > 0
|
|
119
|
+
if (elementLibraries.length > 0) {
|
|
133
120
|
return (jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: elementLibraryDropdownSegments, style: elementLibraryDropdownStyle, title: null }));
|
|
134
121
|
}
|
|
135
|
-
return (jsx_runtime_1.
|
|
136
|
-
? 'Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.'
|
|
137
|
-
: 'Browse the Remotion Elements library inside Studio.', children: ["Browse Elements", isBrowserStudio ? (jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: browseElementsArrowStyle, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.CURRENT_COLOR, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })) : null] }));
|
|
122
|
+
return (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Browse the Remotion Elements library inside Studio.", children: "Browse Elements" }));
|
|
138
123
|
};
|
|
139
124
|
exports.ElementLibraryButton = ElementLibraryButton;
|
|
@@ -16,10 +16,10 @@ const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
|
16
16
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
17
17
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
18
18
|
const split_video_from_audio_api_1 = require("../split-video-from-audio-api");
|
|
19
|
-
const delete_selected_timeline_item_1 = require("../Timeline/delete-selected-timeline-item");
|
|
20
19
|
const duplicate_selected_timeline_item_1 = require("../Timeline/duplicate-selected-timeline-item");
|
|
21
20
|
const split_selected_timeline_item_1 = require("../Timeline/split-selected-timeline-item");
|
|
22
21
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
22
|
+
const use_delete_timeline_items_1 = require("../Timeline/use-delete-timeline-items");
|
|
23
23
|
const use_sequence_freeze_frame_menu_item_1 = require("../Timeline/use-sequence-freeze-frame-menu-item");
|
|
24
24
|
const AlignmentControls_1 = require("./AlignmentControls");
|
|
25
25
|
const common_1 = require("./common");
|
|
@@ -74,6 +74,7 @@ const SequenceSourceQuickActions = ({ selection, track, validatedSource }) => {
|
|
|
74
74
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
75
75
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
76
76
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
77
|
+
const deleteTimelineItems = (0, use_delete_timeline_items_1.useDeleteTimelineItems)();
|
|
77
78
|
const propStatusesForOverride = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection.nodePathInfo.sequenceSubscriptionKey]);
|
|
78
79
|
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.getSequenceFreezeFrameMenuItem)({
|
|
79
80
|
clientId: previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)()
|
|
@@ -98,8 +99,8 @@ const SequenceSourceQuickActions = ({ selection, track, validatedSource }) => {
|
|
|
98
99
|
if (sourceActionsDisabled) {
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
|
-
(
|
|
102
|
-
}, [
|
|
102
|
+
deleteTimelineItems([selection]);
|
|
103
|
+
}, [deleteTimelineItems, selection, sourceActionsDisabled]);
|
|
103
104
|
const splitVideoFromAudioDisabledReason = sourceActionsDisabled
|
|
104
105
|
? 'Studio is read-only'
|
|
105
106
|
: selection.nodePathInfo.numberOfSequencesWithThisNodePath > 1
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCompositionActions = void 0;
|
|
4
|
-
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
5
4
|
const react_1 = require("react");
|
|
6
5
|
const remotion_1 = require("remotion");
|
|
7
6
|
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
@@ -173,7 +172,7 @@ const useCompositionActions = () => {
|
|
|
173
172
|
});
|
|
174
173
|
}, [canInsertAsset, onAssetSelected, onFilesSelected, setSelectedModal]);
|
|
175
174
|
const onCompositionSelected = (0, react_1.useCallback)(async (composition) => {
|
|
176
|
-
var _a, _b
|
|
175
|
+
var _a, _b;
|
|
177
176
|
if (!canInsertComposition ||
|
|
178
177
|
currentCompositionId === null ||
|
|
179
178
|
compositionFile === null) {
|
|
@@ -185,14 +184,12 @@ const useCompositionActions = () => {
|
|
|
185
184
|
? await (0, get_stack_1.getOriginalLocationFromStack)(composition.stack, 'sequence')
|
|
186
185
|
: null;
|
|
187
186
|
const selectedCompositionFile = (_b = (_a = resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source) !== null && _a !== void 0 ? _a : browserStudioOperations === null || browserStudioOperations === void 0 ? void 0 : browserStudioOperations.getCompositionFile(composition.id)) !== null && _b !== void 0 ? _b : null;
|
|
188
|
-
const compositionDragData =
|
|
189
|
-
type: 'composition',
|
|
187
|
+
const compositionDragData = {
|
|
188
|
+
type: 'remotion-composition',
|
|
189
|
+
version: 1,
|
|
190
190
|
compositionFile: selectedCompositionFile,
|
|
191
191
|
compositionId: composition.id,
|
|
192
|
-
|
|
193
|
-
height: (_d = composition.height) !== null && _d !== void 0 ? _d : null,
|
|
194
|
-
durationInFrames: (_e = composition.durationInFrames) !== null && _e !== void 0 ? _e : null,
|
|
195
|
-
}).data;
|
|
192
|
+
};
|
|
196
193
|
await (0, import_assets_1.insertComposition)({
|
|
197
194
|
composition: compositionDragData,
|
|
198
195
|
compositionFile,
|
|
@@ -22,7 +22,6 @@ const CollapsibleInspectorSectionHeader_1 = require("./InspectorPanel/Collapsibl
|
|
|
22
22
|
const common_1 = require("./InspectorPanel/common");
|
|
23
23
|
const inspector_section_collapse_1 = require("./InspectorPanel/inspector-section-collapse");
|
|
24
24
|
const styles_1 = require("./InspectorPanel/styles");
|
|
25
|
-
const asset_search_1 = require("./QuickSwitcher/asset-search");
|
|
26
25
|
const border_radius_representation_1 = require("./Timeline/border-radius-representation");
|
|
27
26
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
28
27
|
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
@@ -226,7 +225,6 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
226
225
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
227
226
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
228
227
|
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls, runtimeValues);
|
|
229
|
-
const assetSelectionInitialQuery = (0, asset_search_1.getAssetSearchQueryForComponent)(sequence.controls.componentIdentity);
|
|
230
228
|
const getSourceAction = (0, react_1.useCallback)((src) => {
|
|
231
229
|
var _a;
|
|
232
230
|
const linkInfo = (0, timeline_asset_link_1.getTimelineAssetLinkInfo)(src);
|
|
@@ -258,9 +256,8 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
258
256
|
}, [getSourceAction, mediaSrc]);
|
|
259
257
|
const assetSelectionContextValue = (0, react_1.useMemo)(() => ({
|
|
260
258
|
getSourceAction,
|
|
261
|
-
initialQuery: assetSelectionInitialQuery,
|
|
262
259
|
sourceAction,
|
|
263
|
-
}), [
|
|
260
|
+
}), [getSourceAction, sourceAction]);
|
|
264
261
|
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
265
262
|
return !collapsedKeys.has(getInspectorExpansionKey(candidate));
|
|
266
263
|
}, [collapsedKeys]);
|
|
@@ -62,7 +62,7 @@ const MenuSubItem = ({ label, leaveLeftSpace, leftItem, onActionChosen, id, sele
|
|
|
62
62
|
};
|
|
63
63
|
}, [selected, disabled]);
|
|
64
64
|
const onPointerUp = (0, react_1.useCallback)((e) => {
|
|
65
|
-
if (disabled) {
|
|
65
|
+
if (disabled || e.button !== 0) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
if (subMenu) {
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const getMaxModalWidth: (width: number) => string;
|
|
3
3
|
export declare const getMaxModalHeight: (height: number) => string;
|
|
4
4
|
export declare const ModalContainer: React.FC<{
|
|
5
|
+
readonly ariaLabelledBy?: string;
|
|
5
6
|
readonly onEscape: () => void;
|
|
6
7
|
readonly onOutsideClick: () => void;
|
|
7
8
|
readonly children: React.ReactNode;
|
|
@@ -29,11 +29,11 @@ const panel = {
|
|
|
29
29
|
color: colors_1.WHITE,
|
|
30
30
|
margin: 'auto',
|
|
31
31
|
};
|
|
32
|
-
const ModalContainer = ({ children, onEscape, onOutsideClick, noZIndex, panelStyle }) => {
|
|
32
|
+
const ModalContainer = ({ ariaLabelledBy, children, onEscape, onOutsideClick, noZIndex, panelStyle, }) => {
|
|
33
33
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
34
34
|
// Prevent deselection of currently selected items
|
|
35
35
|
e.stopPropagation();
|
|
36
36
|
}, []);
|
|
37
|
-
return (jsx_runtime_1.jsx("div", {
|
|
37
|
+
return (jsx_runtime_1.jsx("div", { "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : undefined, "aria-modal": "true", className: "css-reset", role: "dialog", style: backgroundOverlay, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape, children: jsx_runtime_1.jsx("div", { style: { ...panel, ...panelStyle }, children: children }) }) }));
|
|
38
38
|
};
|
|
39
39
|
exports.ModalContainer = ModalContainer;
|
|
@@ -16,8 +16,12 @@ const container = {
|
|
|
16
16
|
borderBottom: colors_1.BORDER_BLACK,
|
|
17
17
|
};
|
|
18
18
|
const titleStyle = {
|
|
19
|
-
fontSize: 14,
|
|
20
19
|
color: colors_1.WHITE,
|
|
20
|
+
fontSize: 14,
|
|
21
|
+
minWidth: 0,
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
textOverflow: 'ellipsis',
|
|
24
|
+
whiteSpace: 'nowrap',
|
|
21
25
|
};
|
|
22
26
|
const icon = {
|
|
23
27
|
height: 20,
|
|
@@ -107,6 +107,6 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
107
107
|
modalContextType.initialTab === 'packages' ||
|
|
108
108
|
modalContextType.initialTab === 'shortcuts') ? (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)) : null, modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
109
109
|
modalContextType.type === 'server-render' &&
|
|
110
|
-
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'element-library' && (jsx_runtime_1.jsx(ElementLibraryModal_1.ElementLibraryModal, { name: modalContextType.name, url: modalContextType.url })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
110
|
+
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'element-library' && (jsx_runtime_1.jsx(ElementLibraryModal_1.ElementLibraryModal, { name: modalContextType.name, url: modalContextType.url })), modalContextType && modalContextType.type === 'element-install' && (jsx_runtime_1.jsx(ElementInstallConfirmation_1.ElementInstallConfirmation, { state: modalContextType })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
111
111
|
};
|
|
112
112
|
exports.Modals = Modals;
|