@remotion/studio 4.0.522 → 4.0.523
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/install-package.js +4 -2
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +5 -6
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +8 -6
- package/dist/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CompositionContextButton.js +4 -1
- package/dist/components/CompositionSelectorItem.js +2 -2
- package/dist/components/ConfigureLicenseModal.js +1 -1
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +287 -135
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +9 -8
- package/dist/components/GlobalKeybindings.js +50 -49
- package/dist/components/HighlightedElementSource.d.ts +5 -0
- package/dist/components/HighlightedElementSource.js +78 -0
- package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
- package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
- package/dist/components/InspectorPanel.js +4 -0
- package/dist/components/InspectorSequenceSection.js +64 -1
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/MenuToolbar.js +7 -5
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +3 -1
- package/dist/components/ModelManager.d.ts +16 -0
- package/dist/components/ModelManager.js +200 -0
- package/dist/components/ModelsSettings.d.ts +2 -0
- package/dist/components/ModelsSettings.js +133 -0
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +2 -2
- package/dist/components/NewComposition/InputDragger.js +6 -6
- package/dist/components/NewComposition/NewFolder.js +11 -8
- package/dist/components/NewComposition/RenameFolder.js +17 -10
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/PlayPause.js +4 -8
- package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +11 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
- package/dist/components/RadioButton.d.ts +1 -0
- package/dist/components/RadioButton.js +2 -2
- package/dist/components/RenderButton.js +5 -1
- package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
- package/dist/components/RenderModal/NumberSetting.js +2 -2
- package/dist/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
- package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/CaptionQueueItem.js +129 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
- package/dist/components/RenderQueue/caption-job-types.js +7 -0
- package/dist/components/RenderQueue/context.d.ts +16 -0
- package/dist/components/RenderQueue/context.js +224 -11
- package/dist/components/RenderQueue/index.js +34 -10
- package/dist/components/RenderQueue/item-style.d.ts +1 -0
- package/dist/components/RenderQueue/item-style.js +2 -1
- package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
- package/dist/components/RenderQueue/load-model-for-job.js +14 -0
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
- package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
- package/dist/components/RendersTab.js +4 -4
- package/dist/components/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl.js +38 -13
- package/dist/components/SelectedOutlinePolygon.js +8 -2
- package/dist/components/SettingsButton.d.ts +4 -0
- package/dist/components/SettingsButton.js +49 -0
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +3 -1
- package/dist/components/ShowOutlinesProvider.js +12 -0
- package/dist/components/SidebarCollapserControls.js +10 -11
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +5 -2
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +2 -2
- package/dist/components/TimeValue.js +2 -3
- package/dist/components/Timeline/SequencePropsObserver.js +4 -0
- package/dist/components/Timeline/Timeline.js +2 -42
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +11 -3
- package/dist/components/Timeline/TimelineSchemaField.js +8 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
- package/dist/components/Timeline/TimelineSelection.js +55 -2
- package/dist/components/Timeline/TimelineSequence.js +75 -17
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineInOutToggle.js +20 -17
- package/dist/components/Transcription/LazyModels.d.ts +1 -0
- package/dist/components/Transcription/LazyModels.js +5 -0
- package/dist/components/Transcription/Models.d.ts +6 -0
- package/dist/components/Transcription/Models.js +18 -0
- package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
- package/dist/components/Transcription/TranscriptionModal.js +428 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
- package/dist/components/Transcription/caption-output-name.d.ts +2 -0
- package/dist/components/Transcription/caption-output-name.js +10 -0
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
- package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
- package/dist/components/Transcription/whisper-languages.d.ts +2 -0
- package/dist/components/Transcription/whisper-languages.js +104 -0
- package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
- package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
- package/dist/components/UndoRedoButtons.js +13 -38
- package/dist/components/UpdatesSettings.js +8 -12
- package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
- package/dist/components/VideoMatting/LazyModels.js +5 -0
- package/dist/components/VideoMatting/Models.d.ts +6 -0
- package/dist/components/VideoMatting/Models.js +18 -0
- package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
- package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
- package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
- package/dist/components/VideoMatting/video-matting-capability.js +7 -0
- package/dist/components/WebMcp.js +439 -22
- package/dist/components/import-assets.d.ts +3 -2
- package/dist/components/import-assets.js +5 -9
- package/dist/components/keyboard-shortcuts.d.ts +17 -1
- package/dist/components/keyboard-shortcuts.js +177 -89
- package/dist/components/public-output-name.d.ts +5 -0
- package/dist/components/public-output-name.js +60 -0
- package/dist/components/use-model-cache-status.d.ts +7 -0
- package/dist/components/use-model-cache-status.js +35 -0
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
- package/dist/esm/LazyModels-2trdm224.mjs +11 -0
- package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
- package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
- package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1x7bsdh6.mjs +261 -0
- package/dist/esm/index-3hgr6gjx.mjs +41 -0
- package/dist/esm/index-5qddp5h7.mjs +36 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-6cvm9a65.mjs +45923 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-czwvnn9g.mjs +35 -0
- package/dist/esm/index-hy4xcgty.mjs +1366 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-sgtmgc4h.mjs +423 -0
- package/dist/esm/index-te66vvrp.mjs +142 -0
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-x7t2y7ws.mjs +54194 -0
- package/dist/esm/index-xhe2m2qr.mjs +1146 -0
- package/dist/esm/index.mjs +45 -933
- package/dist/esm/internals.mjs +13 -114393
- package/dist/esm/previewEntry.mjs +387 -115050
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- package/dist/helpers/drag-aware-double-click.d.ts +2 -1
- package/dist/helpers/drag-aware-double-click.js +12 -1
- package/dist/helpers/get-asset-metadata.d.ts +1 -0
- package/dist/helpers/get-asset-metadata.js +4 -0
- package/dist/helpers/hoverable.js +8 -0
- package/dist/helpers/inject-css.js +2 -0
- package/dist/helpers/optional-package-dependencies.d.ts +3 -0
- package/dist/helpers/optional-package-dependencies.js +24 -0
- package/dist/helpers/pointer-session.d.ts +6 -0
- package/dist/helpers/pointer-session.js +36 -14
- package/dist/helpers/prism-tomorrow.d.ts +1 -0
- package/dist/helpers/prism-tomorrow.js +151 -0
- package/dist/helpers/sequence-node-path-mutations.js +11 -0
- package/dist/helpers/slugify-name.d.ts +1 -0
- package/dist/helpers/slugify-name.js +14 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -0
- package/dist/helpers/studio-runtime-config.js +6 -1
- package/dist/helpers/use-keybinding.d.ts +9 -3
- package/dist/helpers/use-keybinding.js +8 -9
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
- package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
- package/dist/helpers/use-menu-structure.js +58 -13
- package/dist/icons/input-props.d.ts +1 -1
- package/dist/icons/input-props.js +2 -2
- package/dist/icons/models.d.ts +4 -0
- package/dist/icons/models.js +7 -0
- package/dist/icons/separation.d.ts +4 -0
- package/dist/icons/separation.js +7 -0
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/state/modals.d.ts +14 -2
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TimelineSequenceRightEdgeDragHandle = exports.useTimelineSequenceFromDrag = exports.TimelineSequenceLeftEdgeDragHandle = exports.getTimelineSequenceFromDragTargets = exports.getTimelineSequenceLeftEdgeDragTargets = exports.getTimelineSequenceDurationDragTargets = exports.getTimelineSequenceFromDragKeyframeMoves = exports.getTimelineSequenceFromDragChanges = exports.getTimelineSequenceFromDragDelta = exports.getTimelineSequenceFromDragValue = exports.getTimelineSequenceDurationDragChanges = exports.getTimelineSequenceLeftEdgeDragChanges = exports.getTimelineSequenceLeftEdgeDragValues = exports.getTimelineSequenceLeftEdgeDragDelta = exports.getTimelineSequenceDurationDragValue = exports.isTimelineSequenceLeftEdgeDraggable = exports.canResizeTimelineSequenceDuration = exports.isTimelineSequenceDurationDraggable = exports.isCascadingSequence = exports.isTransitionSeriesSequence = exports.timelineSequenceFromDragSnapThresholdPx = void 0;
|
|
36
|
+
exports.TimelineSequenceRightEdgeDragHandle = exports.useTimelineSequenceFromDrag = exports.TimelineSequenceLeftEdgeDragHandle = exports.getTimelineSequenceFromDragTargets = exports.getTimelineSequenceLeftEdgeDragTargets = exports.getTimelineSequenceDurationDragTargets = exports.getTimelineSequenceFromDragKeyframeMoves = exports.getTimelineSequenceFromDragChanges = exports.getTimelineSequenceFromDragDelta = exports.getTimelineSequenceFromDragValue = exports.getTimelineSequenceDurationDragChanges = exports.getTimelineSequenceLeftEdgeDragChanges = exports.getTimelineSequenceLeftEdgeDragValues = exports.getTimelineSequenceLeftEdgeDragDelta = exports.getTimelineSequenceDurationDragValue = exports.isTimelineSequenceLeftEdgeDraggable = exports.canResizeTimelineSequenceDuration = exports.isTimelineSequenceDurationDraggable = exports.isCascadingSequence = exports.isTransitionSeriesSequence = exports.getTimelineSequenceMediaDurationDragLimits = exports.TimelineSequenceMediaDurationDragLimitsProvider = exports.TimelineSequenceMediaDurationDragLimitsContext = exports.timelineSequenceFromDragSnapThresholdPx = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const canvas_1 = require("@remotion/canvas");
|
|
39
39
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
@@ -53,6 +53,32 @@ const HANDLE_INSET = 6;
|
|
|
53
53
|
const HANDLE_OUTSET = 8;
|
|
54
54
|
const timelineSequenceEdgeDragThresholdPx = 4;
|
|
55
55
|
exports.timelineSequenceFromDragSnapThresholdPx = 10;
|
|
56
|
+
exports.TimelineSequenceMediaDurationDragLimitsContext = react_1.default.createContext(null);
|
|
57
|
+
const TimelineSequenceMediaDurationDragLimitsProvider = ({ children }) => {
|
|
58
|
+
const limits = (0, react_1.useRef)(new Map());
|
|
59
|
+
return (jsx_runtime_1.jsx(exports.TimelineSequenceMediaDurationDragLimitsContext.Provider, { value: limits, children: children }));
|
|
60
|
+
};
|
|
61
|
+
exports.TimelineSequenceMediaDurationDragLimitsProvider = TimelineSequenceMediaDurationDragLimitsProvider;
|
|
62
|
+
const getTimelineSequenceMediaDurationDragLimits = ({ cascadedStart, displayDurationInFrames, displayStart, effectiveMaxMediaDuration, explicitDurationInFrames, hasImplicitDuration, naturalMediaDuration, timelineDurationInFrames, }) => {
|
|
63
|
+
if (naturalMediaDuration === null ||
|
|
64
|
+
!Number.isFinite(naturalMediaDuration) ||
|
|
65
|
+
naturalMediaDuration <= 0) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const initialDuration = explicitDurationInFrames !== null && explicitDurationInFrames !== void 0 ? explicitDurationInFrames : Math.ceil(displayStart +
|
|
69
|
+
Math.max(0, Math.min(displayDurationInFrames, timelineDurationInFrames - displayStart, effectiveMaxMediaDuration !== null && effectiveMaxMediaDuration !== void 0 ? effectiveMaxMediaDuration : Infinity)) -
|
|
70
|
+
cascadedStart);
|
|
71
|
+
const maximumDuration =
|
|
72
|
+
// Keeping duration omitted represents the media's natural end. An
|
|
73
|
+
// explicit duration is only useful once its edge is before that end.
|
|
74
|
+
Math.ceil(displayStart + naturalMediaDuration - cascadedStart) -
|
|
75
|
+
(hasImplicitDuration ? 1 : 0);
|
|
76
|
+
if (hasImplicitDuration && initialDuration > maximumDuration) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return { initialDuration, maximumDuration };
|
|
80
|
+
};
|
|
81
|
+
exports.getTimelineSequenceMediaDurationDragLimits = getTimelineSequenceMediaDurationDragLimits;
|
|
56
82
|
const getTimelineSequenceEdgeSelectionInteraction = ({ button, selected, shiftKey, metaKey, ctrlKey, }) => {
|
|
57
83
|
if (button !== 0 ||
|
|
58
84
|
!(0, TimelineSelection_1.shouldSelectTimelineRowOnPointerDown)({
|
|
@@ -205,14 +231,8 @@ const isTimelineSequenceDurationDraggable = (sequence) => {
|
|
|
205
231
|
Boolean(sequence.controls));
|
|
206
232
|
};
|
|
207
233
|
exports.isTimelineSequenceDurationDraggable = isTimelineSequenceDurationDraggable;
|
|
208
|
-
const canResizeTimelineSequenceDuration = ({
|
|
209
|
-
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
if (sequence.type === 'audio' || sequence.type === 'video') {
|
|
213
|
-
return status.codeValue !== undefined;
|
|
214
|
-
}
|
|
215
|
-
return true;
|
|
234
|
+
const canResizeTimelineSequenceDuration = ({ status, }) => {
|
|
235
|
+
return (status === null || status === void 0 ? void 0 : status.status) === 'static';
|
|
216
236
|
};
|
|
217
237
|
exports.canResizeTimelineSequenceDuration = canResizeTimelineSequenceDuration;
|
|
218
238
|
const isTimelineSequenceLeftEdgeDraggable = (sequence) => {
|
|
@@ -265,7 +285,10 @@ const getTimelineSequenceLeftEdgeDragValues = ({ initialDuration, initialFrom, i
|
|
|
265
285
|
return {
|
|
266
286
|
durationInFrames: initialDuration - clampedDeltaFrames,
|
|
267
287
|
from: initialFrom + clampedDeltaFrames,
|
|
268
|
-
|
|
288
|
+
// Division and multiplication by playbackRate may not cancel exactly.
|
|
289
|
+
trimBefore: clampedDeltaFrames === -initialTrimBefore / playbackRate
|
|
290
|
+
? 0
|
|
291
|
+
: initialTrimBefore + clampedDeltaFrames * playbackRate,
|
|
269
292
|
};
|
|
270
293
|
};
|
|
271
294
|
exports.getTimelineSequenceLeftEdgeDragValues = getTimelineSequenceLeftEdgeDragValues;
|
|
@@ -430,8 +453,9 @@ const findSequenceTrack = ({ tracks, nodePathInfo, }) => {
|
|
|
430
453
|
return ((0, studio_shared_1.stringifySequenceExpandedRowKey)(candidate.nodePathInfo.sequenceSubscriptionKey) === key && candidate.nodePathInfo.index === nodePathInfo.index);
|
|
431
454
|
});
|
|
432
455
|
};
|
|
433
|
-
const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, timelineDurationInFrames, }) => {
|
|
456
|
+
const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, draggedSequenceMediaDurationDragLimits, selectedSequenceMediaDurationDragLimits, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, timelineDurationInFrames, }) => {
|
|
434
457
|
var _a;
|
|
458
|
+
var _b, _c, _d;
|
|
435
459
|
const draggedSelectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(draggedNodePathInfo);
|
|
436
460
|
const selectedSequenceItems = selectedItems.filter((item) => item.type === 'sequence');
|
|
437
461
|
const draggedItemIsSelected = selectedSequenceItems.some((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo) ===
|
|
@@ -459,7 +483,6 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
|
|
|
459
483
|
const nodePath = track.nodePathInfo.sequenceSubscriptionKey;
|
|
460
484
|
const durationStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a.durationInFrames;
|
|
461
485
|
if (!(0, exports.canResizeTimelineSequenceDuration)({
|
|
462
|
-
sequence: originalSequence,
|
|
463
486
|
status: durationStatus,
|
|
464
487
|
})) {
|
|
465
488
|
return null;
|
|
@@ -470,11 +493,27 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
|
|
|
470
493
|
}
|
|
471
494
|
const key = (0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath);
|
|
472
495
|
if (!targets.has(key)) {
|
|
496
|
+
const selectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(nodePathInfo);
|
|
497
|
+
const isMedia = originalSequence.type === 'audio' || originalSequence.type === 'video';
|
|
498
|
+
const isDraggedSequence = selectionKey === draggedSelectionKey;
|
|
499
|
+
const mediaDurationDragLimits = isMedia
|
|
500
|
+
? isDraggedSequence
|
|
501
|
+
? draggedSequenceMediaDurationDragLimits
|
|
502
|
+
: ((_b = selectedSequenceMediaDurationDragLimits === null || selectedSequenceMediaDurationDragLimits === void 0 ? void 0 : selectedSequenceMediaDurationDragLimits.get(selectionKey)) !== null && _b !== void 0 ? _b : null)
|
|
503
|
+
: null;
|
|
504
|
+
if (isMedia && mediaDurationDragLimits === null) {
|
|
505
|
+
return null;
|
|
506
|
+
}
|
|
473
507
|
const minimumDuration = Math.max(1 - originalSequence.from, getMinimumSequenceDuration({ sequence: originalSequence, sequences }));
|
|
508
|
+
const initialDuration = (_c = mediaDurationDragLimits === null || mediaDurationDragLimits === void 0 ? void 0 : mediaDurationDragLimits.initialDuration) !== null && _c !== void 0 ? _c : originalSequence.duration;
|
|
509
|
+
const constrainedMaximumDuration = Math.min((_d = mediaDurationDragLimits === null || mediaDurationDragLimits === void 0 ? void 0 : mediaDurationDragLimits.maximumDuration) !== null && _d !== void 0 ? _d : Infinity, timelineDurationInFrames - track.cascadedStart);
|
|
510
|
+
const maximumDuration = isMedia
|
|
511
|
+
? Math.max(minimumDuration, initialDuration, constrainedMaximumDuration)
|
|
512
|
+
: Math.max(minimumDuration, constrainedMaximumDuration);
|
|
474
513
|
targets.set(key, {
|
|
475
514
|
fileName: nodePath.absolutePath,
|
|
476
|
-
initialDuration
|
|
477
|
-
maximumDuration
|
|
515
|
+
initialDuration,
|
|
516
|
+
maximumDuration,
|
|
478
517
|
// A negative start needs enough duration to retain one visible frame.
|
|
479
518
|
minimumDuration,
|
|
480
519
|
nodePath,
|
|
@@ -1029,12 +1068,10 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1029
1068
|
document.body.style.webkitUserSelect = 'none';
|
|
1030
1069
|
// Register before React commits so no pointer move can arrive before
|
|
1031
1070
|
// the global session listeners exist.
|
|
1032
|
-
stopPointerSessionRef.current = (0, pointer_session_1.
|
|
1071
|
+
stopPointerSessionRef.current = (0, pointer_session_1.startDeferredCapturedPointerSession)({
|
|
1033
1072
|
event: e.nativeEvent,
|
|
1034
|
-
// The bar is removed when it leaves the visible timeline. Capture on
|
|
1035
|
-
// a stable element so the move continues until the pointer is released.
|
|
1036
1073
|
captureTarget: e.currentTarget.ownerDocument.body,
|
|
1037
|
-
onMove: (moveEvent) => {
|
|
1074
|
+
onMove: (moveEvent, capturePointer) => {
|
|
1038
1075
|
const dragState = dragStateRef.current;
|
|
1039
1076
|
if (!dragState) {
|
|
1040
1077
|
return;
|
|
@@ -1049,6 +1086,10 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1049
1086
|
});
|
|
1050
1087
|
dragState.latestDeltaFrames = deltaFrames;
|
|
1051
1088
|
if (deltaFrames !== 0) {
|
|
1089
|
+
// The bar can be removed when it leaves the visible timeline.
|
|
1090
|
+
// Capture only after a real drag starts so clicks and double-clicks
|
|
1091
|
+
// remain targeted at the bar.
|
|
1092
|
+
capturePointer();
|
|
1052
1093
|
dragState.didMove = true;
|
|
1053
1094
|
}
|
|
1054
1095
|
for (const target of dragState.targets) {
|
|
@@ -1107,18 +1148,20 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
1107
1148
|
};
|
|
1108
1149
|
};
|
|
1109
1150
|
exports.useTimelineSequenceFromDrag = useTimelineSequenceFromDrag;
|
|
1110
|
-
const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, timelineDurationInFrames, onDragEnd, onSelect, selected, }) => {
|
|
1151
|
+
const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, mediaDurationDragLimits, windowWidth, timelineDurationInFrames, onDragEnd, onSelect, selected, }) => {
|
|
1111
1152
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
1112
1153
|
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
1113
1154
|
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
1114
1155
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
1115
1156
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
1116
1157
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
1158
|
+
const mediaDurationDragLimitsRegistry = (0, react_1.useContext)(exports.TimelineSequenceMediaDurationDragLimitsContext);
|
|
1117
1159
|
const stopPointerSessionRef = (0, react_1.useRef)(null);
|
|
1118
1160
|
const dragStateRef = (0, react_1.useRef)(null);
|
|
1119
1161
|
// Keep latest props/setters available to window listeners installed once at pointerdown.
|
|
1120
1162
|
const latestRef = (0, react_1.useRef)({
|
|
1121
1163
|
nodePathInfo,
|
|
1164
|
+
mediaDurationDragLimits,
|
|
1122
1165
|
setPropStatuses,
|
|
1123
1166
|
setDragOverrides,
|
|
1124
1167
|
clearDragOverrides,
|
|
@@ -1129,6 +1172,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1129
1172
|
});
|
|
1130
1173
|
latestRef.current = {
|
|
1131
1174
|
nodePathInfo,
|
|
1175
|
+
mediaDurationDragLimits,
|
|
1132
1176
|
setPropStatuses,
|
|
1133
1177
|
setDragOverrides,
|
|
1134
1178
|
clearDragOverrides,
|
|
@@ -1190,7 +1234,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1190
1234
|
}, []);
|
|
1191
1235
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
1192
1236
|
var _a;
|
|
1193
|
-
var _b;
|
|
1237
|
+
var _b, _c;
|
|
1194
1238
|
if (e.button !== 0) {
|
|
1195
1239
|
return;
|
|
1196
1240
|
}
|
|
@@ -1207,17 +1251,19 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1207
1251
|
? (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2) / timelineDurationInFrames
|
|
1208
1252
|
: 0;
|
|
1209
1253
|
const canCalculateDelta = Number.isFinite(pxPerFrame) && pxPerFrame > 0;
|
|
1210
|
-
const { nodePathInfo: latestNodePathInfo, overrideIdToNodePathMappings: latestOverrideIdsToNodePaths, } = latestRef.current;
|
|
1254
|
+
const { nodePathInfo: latestNodePathInfo, mediaDurationDragLimits: latestMediaDurationDragLimits, overrideIdToNodePathMappings: latestOverrideIdsToNodePaths, } = latestRef.current;
|
|
1211
1255
|
const { selectedItems: latestSelectedItems } = currentSelection.current;
|
|
1212
1256
|
const targets = canCalculateDelta
|
|
1213
|
-
? ((
|
|
1257
|
+
? ((_c = (0, exports.getTimelineSequenceDurationDragTargets)({
|
|
1214
1258
|
draggedNodePathInfo: latestNodePathInfo,
|
|
1259
|
+
draggedSequenceMediaDurationDragLimits: latestMediaDurationDragLimits,
|
|
1260
|
+
selectedSequenceMediaDurationDragLimits: (_b = mediaDurationDragLimitsRegistry === null || mediaDurationDragLimitsRegistry === void 0 ? void 0 : mediaDurationDragLimitsRegistry.current) !== null && _b !== void 0 ? _b : null,
|
|
1215
1261
|
selectedItems: latestSelectedItems,
|
|
1216
1262
|
sequences: sequencesRef.current,
|
|
1217
1263
|
overrideIdsToNodePaths: latestOverrideIdsToNodePaths,
|
|
1218
1264
|
propStatuses: propStatusesRef.current,
|
|
1219
1265
|
timelineDurationInFrames,
|
|
1220
|
-
})) !== null &&
|
|
1266
|
+
})) !== null && _c !== void 0 ? _c : [])
|
|
1221
1267
|
: [];
|
|
1222
1268
|
(_a = stopPointerSessionRef.current) === null || _a === void 0 ? void 0 : _a.call(stopPointerSessionRef);
|
|
1223
1269
|
dragStateRef.current = {
|
|
@@ -1248,12 +1294,13 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1248
1294
|
dragState.didMove = true;
|
|
1249
1295
|
}
|
|
1250
1296
|
for (const target of dragState.targets) {
|
|
1251
|
-
|
|
1297
|
+
const previewValue = (0, exports.getTimelineSequenceDurationDragValue)({
|
|
1252
1298
|
initialDuration: target.initialDuration,
|
|
1253
1299
|
deltaFrames,
|
|
1254
1300
|
maximumDuration: target.maximumDuration,
|
|
1255
1301
|
minimumDuration: target.minimumDuration,
|
|
1256
|
-
})
|
|
1302
|
+
});
|
|
1303
|
+
latestRef.current.setDragOverrides(target.nodePath, 'durationInFrames', remotion_1.Internals.makeStaticDragOverride(previewValue));
|
|
1257
1304
|
}
|
|
1258
1305
|
};
|
|
1259
1306
|
const onUp = (pointerEvent) => {
|
|
@@ -1295,6 +1342,7 @@ const TimelineSequenceRightEdgeDragHandleInner = ({ nodePathInfo, windowWidth, t
|
|
|
1295
1342
|
}, [
|
|
1296
1343
|
currentSelection,
|
|
1297
1344
|
finishDrag,
|
|
1345
|
+
mediaDurationDragLimitsRegistry,
|
|
1298
1346
|
propStatusesRef,
|
|
1299
1347
|
selected,
|
|
1300
1348
|
sequencesRef,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAssetTimelineContextMenu = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const get_file_manager_name_1 = require("../../helpers/get-file-manager-name");
|
|
9
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
10
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
11
|
+
const get_copy_context_for_agents_menu_item_1 = require("./get-copy-context-for-agents-menu-item");
|
|
12
|
+
const useAssetTimelineContextMenu = () => {
|
|
13
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
14
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
15
|
+
return (0, react_1.useMemo)(() => {
|
|
16
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'asset') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const copyContextItem = (0, get_copy_context_for_agents_menu_item_1.getCopyContextForAgentsMenuItem)({
|
|
20
|
+
contextForAgents: window.remotion_publicFolderExists
|
|
21
|
+
? `Asset: ${window.remotion_publicFolderExists}/${canvasContent.asset}`
|
|
22
|
+
: `Asset: staticFile(${JSON.stringify(canvasContent.asset)})`,
|
|
23
|
+
});
|
|
24
|
+
if ((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
|
|
25
|
+
return [copyContextItem];
|
|
26
|
+
}
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
type: 'item',
|
|
30
|
+
id: 'open-asset-in-explorer',
|
|
31
|
+
label: `Show in ${(0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform)}`,
|
|
32
|
+
keyHint: null,
|
|
33
|
+
leftItem: null,
|
|
34
|
+
quickSwitcherLabel: null,
|
|
35
|
+
subMenu: null,
|
|
36
|
+
value: 'open-asset-in-explorer',
|
|
37
|
+
disabled: Boolean(window.remotion_isReadOnlyStudio) ||
|
|
38
|
+
!window.remotion_publicFolderExists ||
|
|
39
|
+
previewServerState.type !== 'connected',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
(0, actions_1.openInFileExplorer)({
|
|
42
|
+
directory: window.remotion_publicFolderExists + '/' + canvasContent.asset,
|
|
43
|
+
}).catch((err) => {
|
|
44
|
+
(0, NotificationCenter_1.showNotification)(`Could not open file: ${err.message}`, 2000);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
copyContextItem,
|
|
49
|
+
];
|
|
50
|
+
}, [canvasContent, previewServerState.type]);
|
|
51
|
+
};
|
|
52
|
+
exports.useAssetTimelineContextMenu = useAssetTimelineContextMenu;
|
|
@@ -6,18 +6,23 @@ const player_1 = require("@remotion/player");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const no_react_1 = require("remotion/no-react");
|
|
9
|
+
const client_id_1 = require("../helpers/client-id");
|
|
9
10
|
const colors_1 = require("../helpers/colors");
|
|
10
11
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
11
12
|
const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
|
|
12
13
|
const in_out_1 = require("../state/in-out");
|
|
13
14
|
const ControlButton_1 = require("./ControlButton");
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
(0,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const keyboard_shortcuts_1 = require("./keyboard-shortcuts");
|
|
16
|
+
const getTooltipText = (pointType, action) => {
|
|
17
|
+
const shortcut = (0, keyboard_shortcuts_1.getKeyboardShortcutLabel)(action);
|
|
18
|
+
return [
|
|
19
|
+
`Mark ${pointType}`,
|
|
20
|
+
(0, use_keybinding_1.areKeyboardShortcutsDisabled)() || shortcut === '' ? null : `(${shortcut})`,
|
|
21
|
+
'- right click to clear',
|
|
22
|
+
]
|
|
23
|
+
.filter(no_react_1.NoReactInternals.truthy)
|
|
24
|
+
.join(' ');
|
|
25
|
+
};
|
|
21
26
|
const style = {
|
|
22
27
|
width: 17,
|
|
23
28
|
height: 17,
|
|
@@ -29,6 +34,7 @@ exports.inOutHandles = (0, react_1.createRef)();
|
|
|
29
34
|
exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
30
35
|
const TimelineInOutPointToggle = () => {
|
|
31
36
|
var _a;
|
|
37
|
+
(0, client_id_1.useStudioConfigRevision)();
|
|
32
38
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
33
39
|
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
34
40
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -195,34 +201,31 @@ const TimelineInOutPointToggle = () => {
|
|
|
195
201
|
return;
|
|
196
202
|
}
|
|
197
203
|
const iKey = keybindings.registerKeybinding({
|
|
198
|
-
event: '
|
|
199
|
-
|
|
204
|
+
event: 'keydown',
|
|
205
|
+
action: 'setInPoint',
|
|
200
206
|
callback: (e) => {
|
|
201
207
|
onInMark(e);
|
|
202
208
|
},
|
|
203
|
-
commandCtrlKey: false,
|
|
204
209
|
preventDefault: true,
|
|
205
210
|
triggerIfInputFieldFocused: false,
|
|
206
211
|
keepRegisteredWhenNotHighestContext: false,
|
|
207
212
|
});
|
|
208
213
|
const oKey = keybindings.registerKeybinding({
|
|
209
|
-
event: '
|
|
210
|
-
|
|
214
|
+
event: 'keydown',
|
|
215
|
+
action: 'setOutPoint',
|
|
211
216
|
callback: (e) => {
|
|
212
217
|
onOutMark(e);
|
|
213
218
|
},
|
|
214
|
-
commandCtrlKey: false,
|
|
215
219
|
preventDefault: true,
|
|
216
220
|
triggerIfInputFieldFocused: false,
|
|
217
221
|
keepRegisteredWhenNotHighestContext: false,
|
|
218
222
|
});
|
|
219
223
|
const xKey = keybindings.registerKeybinding({
|
|
220
|
-
event: '
|
|
221
|
-
|
|
224
|
+
event: 'keydown',
|
|
225
|
+
action: 'clearInOutPoints',
|
|
222
226
|
callback: () => {
|
|
223
227
|
onInOutClear(confId);
|
|
224
228
|
},
|
|
225
|
-
commandCtrlKey: false,
|
|
226
229
|
preventDefault: true,
|
|
227
230
|
triggerIfInputFieldFocused: false,
|
|
228
231
|
keepRegisteredWhenNotHighestContext: false,
|
|
@@ -246,7 +249,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
246
249
|
};
|
|
247
250
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
248
251
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
249
|
-
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', '
|
|
252
|
+
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'setInPoint'), "aria-label": getTooltipText('In', 'setInPoint'), style: buttonStyle, onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? color : colors_1.BLUE, style: style })) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'setOutPoint'), "aria-label": getTooltipText('Out', 'setOutPoint'), style: buttonStyle, onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? color : colors_1.BLUE, style: style })) })
|
|
250
253
|
] }));
|
|
251
254
|
};
|
|
252
255
|
exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Models as default } from './Models';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Models = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const whisper_webgpu_1 = require("@remotion/whisper-webgpu");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const ModelManager_1 = require("../ModelManager");
|
|
8
|
+
const AVAILABLE_MODELS = (0, whisper_webgpu_1.getAvailableModels)();
|
|
9
|
+
const Models = ({ description, indent, visible }) => {
|
|
10
|
+
const isModelCached = (0, react_1.useCallback)((model) => (0, whisper_webgpu_1.isWhisperModelCached)({ model }), []);
|
|
11
|
+
const loadModel = (0, react_1.useCallback)((model, onProgress) => (0, whisper_webgpu_1.loadWhisperModel)({
|
|
12
|
+
model,
|
|
13
|
+
onProgress: (progress) => onProgress(progress.progress),
|
|
14
|
+
}), []);
|
|
15
|
+
const removeModel = (0, react_1.useCallback)((model) => (0, whisper_webgpu_1.removeWhisperModel)({ model }), []);
|
|
16
|
+
return (jsx_runtime_1.jsx(ModelManager_1.ModelManager, { ariaLabel: "Whisper models", availableModels: AVAILABLE_MODELS, description: description, indent: indent, isModelCached: isModelCached, loadModel: loadModel, prepare: whisper_webgpu_1.clearStaleModels, removeModel: removeModel, visible: visible }));
|
|
17
|
+
};
|
|
18
|
+
exports.Models = Models;
|