@remotion/studio 4.0.499 → 4.0.501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Studio.js +1 -1
- package/dist/api/delete-static-file.js +8 -3
- package/dist/api/rename-static-file.js +8 -0
- package/dist/api/watch-public-folder.js +2 -1
- package/dist/api/watch-static-file.js +2 -1
- package/dist/api/write-static-file.js +8 -3
- package/dist/components/AssetSelector.js +11 -7
- package/dist/components/AssetSelectorItem.d.ts +25 -0
- package/dist/components/AssetSelectorItem.js +116 -80
- package/dist/components/Canvas.js +6 -1
- package/dist/components/CaptionInspector.d.ts +10 -0
- package/dist/components/CaptionInspector.js +24 -0
- package/dist/components/CaptionTextEditor.d.ts +9 -0
- package/dist/components/CaptionTextEditor.js +132 -0
- package/dist/components/CompositionSelector.js +2 -32
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/CurrentAsset.js +3 -2
- package/dist/components/EditorContexts.d.ts +0 -1
- package/dist/components/EditorContexts.js +2 -2
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/FpsCounter.js +3 -3
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +9 -1
- package/dist/components/InitialCompositionLoader.d.ts +1 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -2
- package/dist/components/InlineCaptionInspector.d.ts +11 -0
- package/dist/components/InlineCaptionInspector.js +108 -0
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +12 -9
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +10 -10
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
- package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
- package/dist/components/InspectorPanel/styles.js +7 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +3 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +91 -5
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.d.ts +2 -1
- package/dist/components/InspectorSequenceSection.js +279 -25
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +15 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +7 -0
- package/dist/components/NewComposition/InputDragger.js +119 -8
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +45 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +10 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +10 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +95 -13
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +84 -47
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +147 -16
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/ShowOutlinesProvider.js +4 -1
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/Timeline.js +19 -5
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +53 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +10 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowChrome.js +4 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -7
- package/dist/components/Timeline/TimelineSelection.js +17 -12
- package/dist/components/Timeline/TimelineSequence.js +2 -9
- package/dist/components/Timeline/TimelineSequenceItem.js +61 -15
- package/dist/components/Timeline/TimelineSequencePropItem.js +36 -85
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTrack.js +4 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
- package/dist/components/Timeline/border-radius-representation.js +60 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
- package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +20 -18
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
- package/dist/components/Timeline/save-sequence-prop.js +25 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/TopPanel.js +2 -2
- package/dist/components/UndoRedoButtons.js +42 -11
- package/dist/components/composition-drop-preview.js +1 -0
- package/dist/components/handle-drop.d.ts +3 -2
- package/dist/components/handle-drop.js +2 -1
- package/dist/components/import-assets.d.ts +4 -2
- package/dist/components/import-assets.js +20 -7
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
- package/dist/components/use-element-overwrite-confirmation.js +73 -0
- package/dist/components/use-static-files.js +7 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-pk1zwsn1.js → chunk-n1kj09yv.js} +10618 -8002
- package/dist/esm/index.mjs +24 -8
- package/dist/esm/internals.mjs +10618 -8002
- package/dist/esm/previewEntry.mjs +40002 -37388
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +14 -0
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/client-id.d.ts +0 -1
- package/dist/helpers/client-id.js +15 -10
- package/dist/helpers/download-blob.d.ts +1 -0
- package/dist/helpers/download-blob.js +15 -0
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/inject-css.js +5 -3
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +39 -4
- package/dist/helpers/preview-server-events.js +46 -9
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-create-composition.js +8 -6
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-menu-structure.js +39 -1
- package/dist/hot-middleware-client/client.js +3 -3
- package/dist/icons/border-radius.d.ts +4 -0
- package/dist/icons/border-radius.js +8 -0
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/fullscreen.d.ts +4 -0
- package/dist/icons/fullscreen.js +6 -0
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/previewEntry.js +1 -1
- package/dist/state/modals.d.ts +9 -0
- package/dist/state/timeline-sequence-hover.d.ts +17 -0
- package/dist/state/timeline-sequence-hover.js +33 -0
- package/package.json +13 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SelectedOutlineOverlay = exports.orderOutlinesForRendering = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineUvSnapThresholdPx = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineTransformOriginDragChanges = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineActiveSchema = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
|
|
36
|
+
exports.SelectedOutlineOverlay = exports.orderOutlinesForRendering = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getSelectedCropInfo = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineUvSnapThresholdPx = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineTransformOriginDragChanges = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineCropFollowingTransformOrigin = exports.getSelectedOutlineCropDragValues = exports.getSelectedOutlineCropDragChanges = exports.getSelectedOutlineActiveSchema = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const player_1 = require("@remotion/player");
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
@@ -45,6 +45,7 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
45
45
|
const editor_guides_1 = require("../state/editor-guides");
|
|
46
46
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
47
47
|
const scale_lock_1 = require("../state/scale-lock");
|
|
48
|
+
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
48
49
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
49
50
|
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
50
51
|
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
@@ -63,6 +64,9 @@ Object.defineProperty(exports, "applySelectedOutlineDragAxisLock", { enumerable:
|
|
|
63
64
|
Object.defineProperty(exports, "applySelectedOutlineTransformOriginAxisLock", { enumerable: true, get: function () { return selected_outline_drag_2.applySelectedOutlineTransformOriginAxisLock; } });
|
|
64
65
|
Object.defineProperty(exports, "compensateTranslateForTransformOrigin", { enumerable: true, get: function () { return selected_outline_drag_2.compensateTranslateForTransformOrigin; } });
|
|
65
66
|
Object.defineProperty(exports, "getSelectedOutlineActiveSchema", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineActiveSchema; } });
|
|
67
|
+
Object.defineProperty(exports, "getSelectedOutlineCropDragChanges", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineCropDragChanges; } });
|
|
68
|
+
Object.defineProperty(exports, "getSelectedOutlineCropDragValues", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineCropDragValues; } });
|
|
69
|
+
Object.defineProperty(exports, "getSelectedOutlineCropFollowingTransformOrigin", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineCropFollowingTransformOrigin; } });
|
|
66
70
|
Object.defineProperty(exports, "getSelectedOutlineDragChanges", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineDragChanges; } });
|
|
67
71
|
Object.defineProperty(exports, "getSelectedOutlineDragValues", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineDragValues; } });
|
|
68
72
|
Object.defineProperty(exports, "getSelectedOutlineKeyboardNudgeDelta", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineKeyboardNudgeDelta; } });
|
|
@@ -84,6 +88,7 @@ Object.defineProperty(exports, "snapSelectedOutlineTransformOriginUv", { enumera
|
|
|
84
88
|
Object.defineProperty(exports, "snapSelectedOutlineUv", { enumerable: true, get: function () { return selected_outline_drag_2.snapSelectedOutlineUv; } });
|
|
85
89
|
const selected_outline_measurement_2 = require("./selected-outline-measurement");
|
|
86
90
|
Object.defineProperty(exports, "getOutlineSelectionInteraction", { enumerable: true, get: function () { return selected_outline_measurement_2.getOutlineSelectionInteraction; } });
|
|
91
|
+
Object.defineProperty(exports, "getSelectedCropInfo", { enumerable: true, get: function () { return selected_outline_measurement_2.getSelectedCropInfo; } });
|
|
87
92
|
Object.defineProperty(exports, "getSelectedEffectFieldsBySequenceKey", { enumerable: true, get: function () { return selected_outline_measurement_2.getSelectedEffectFieldsBySequenceKey; } });
|
|
88
93
|
Object.defineProperty(exports, "getSelectedOutlineRotationCornerInfo", { enumerable: true, get: function () { return selected_outline_measurement_2.getSelectedOutlineRotationCornerInfo; } });
|
|
89
94
|
Object.defineProperty(exports, "getSelectedOutlineRotationDeltaDegrees", { enumerable: true, get: function () { return selected_outline_measurement_2.getSelectedOutlineRotationDeltaDegrees; } });
|
|
@@ -93,6 +98,50 @@ Object.defineProperty(exports, "getSequencesWithSelectableOutlines", { enumerabl
|
|
|
93
98
|
Object.defineProperty(exports, "getTransformedSvgViewportPoints", { enumerable: true, get: function () { return selected_outline_measurement_2.getTransformedSvgViewportPoints; } });
|
|
94
99
|
const selected_outline_types_2 = require("./selected-outline-types");
|
|
95
100
|
Object.defineProperty(exports, "selectedOutlineDragThresholdPx", { enumerable: true, get: function () { return selected_outline_types_2.selectedOutlineDragThresholdPx; } });
|
|
101
|
+
const getEffectiveCropValue = ({ activeSchema, controls, dragOverrides, fieldKey, frame, propStatuses, }) => {
|
|
102
|
+
var _a;
|
|
103
|
+
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[fieldKey];
|
|
104
|
+
if ((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) !== 'number') {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
const propStatus = propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses[fieldKey];
|
|
108
|
+
const value = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' || (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed'
|
|
109
|
+
? remotion_1.Internals.getEffectiveVisualModeValue({
|
|
110
|
+
propStatus,
|
|
111
|
+
dragOverrideValue: dragOverrides[fieldKey],
|
|
112
|
+
defaultValue: fieldSchema.default,
|
|
113
|
+
frame,
|
|
114
|
+
shouldResortToDefaultValueIfUndefined: true,
|
|
115
|
+
})
|
|
116
|
+
: ((_a = controls === null || controls === void 0 ? void 0 : controls.currentRuntimeValueDotNotation[fieldKey]) !== null && _a !== void 0 ? _a : fieldSchema.default);
|
|
117
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : 0;
|
|
118
|
+
};
|
|
119
|
+
const getCropDragFields = ({ activeSchema, cropValues, propStatuses, }) => {
|
|
120
|
+
if (!(0, selected_outline_types_1.canEditSelectedOutlineCrop)({
|
|
121
|
+
schema: activeSchema,
|
|
122
|
+
propStatuses,
|
|
123
|
+
})) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
const fields = {};
|
|
127
|
+
for (const fieldKey of Object.values(selected_outline_types_1.cropFieldKeys)) {
|
|
128
|
+
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[fieldKey];
|
|
129
|
+
const propStatus = propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses[fieldKey];
|
|
130
|
+
const canEditStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
|
|
131
|
+
((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
|
|
132
|
+
propStatus.interpolationFunction === 'interpolate');
|
|
133
|
+
if ((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) !== 'number' || !canEditStatus) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
fields[fieldKey] = {
|
|
137
|
+
defaultValue: fieldSchema.default,
|
|
138
|
+
fieldSchema,
|
|
139
|
+
propStatus,
|
|
140
|
+
value: cropValues[fieldKey],
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return fields;
|
|
144
|
+
};
|
|
96
145
|
const outlineContainer = {
|
|
97
146
|
position: 'absolute',
|
|
98
147
|
inset: 0,
|
|
@@ -371,26 +420,36 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
371
420
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
372
421
|
const { getScaleLockState } = (0, react_1.useContext)(scale_lock_1.ScaleLockContext);
|
|
373
422
|
const { editorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
423
|
+
const { hoveredSequence, setHoveredSequence } = (0, react_1.useContext)(timeline_sequence_hover_1.TimelineSequenceHoverContext);
|
|
374
424
|
const { editorShowGuides, guidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
375
425
|
const { frameBack, frameForward, getCurrentFrame, seek } = player_1.PlayerInternals.usePlayer();
|
|
376
426
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
377
427
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
378
428
|
const [outlines, setOutlines] = (0, react_1.useState)([]);
|
|
379
|
-
const [hoveredOutlineKey, setHoveredOutlineKey] = (0, react_1.useState)(null);
|
|
380
429
|
const [draggingOutline, setDraggingOutline] = (0, react_1.useState)(false);
|
|
381
430
|
const [activeSnapPoints, setActiveSnapPoints] = (0, react_1.useState)([]);
|
|
382
431
|
const overlayRef = (0, react_1.useRef)(null);
|
|
383
432
|
const keyboardNudgeSessionRef = (0, react_1.useRef)(null);
|
|
384
433
|
const saveKeyboardNudgeSessionRef = (0, react_1.useRef)(() => undefined);
|
|
434
|
+
const previewInteractive = previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
435
|
+
const previewSelectionAvailable = previewServerState.type === 'connected' || window.remotion_isReadOnlyStudio;
|
|
385
436
|
const onDraggingChange = react_1.default.useCallback((dragging) => {
|
|
386
437
|
setDraggingOutline(dragging);
|
|
387
438
|
if (dragging) {
|
|
388
|
-
|
|
439
|
+
setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
|
|
389
440
|
}
|
|
390
441
|
else {
|
|
391
442
|
setActiveSnapPoints([]);
|
|
392
443
|
}
|
|
393
|
-
}, []);
|
|
444
|
+
}, [setHoveredSequence]);
|
|
445
|
+
const onHoverChange = (0, react_1.useCallback)((key) => {
|
|
446
|
+
setHoveredSequence((currentHover) => {
|
|
447
|
+
if (key !== null) {
|
|
448
|
+
return { key, source: 'canvas' };
|
|
449
|
+
}
|
|
450
|
+
return (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover;
|
|
451
|
+
});
|
|
452
|
+
}, [setHoveredSequence]);
|
|
394
453
|
const onSnapPointsChange = (0, react_1.useCallback)((snapPoints) => {
|
|
395
454
|
setActiveSnapPoints(snapPoints);
|
|
396
455
|
}, []);
|
|
@@ -398,13 +457,16 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
398
457
|
selectItem(item, interaction, undefined, { reveal: true });
|
|
399
458
|
}, [selectItem]);
|
|
400
459
|
const outlineTargets = (0, react_1.useMemo)(() => {
|
|
401
|
-
if (!(0, interactivity_enabled_1.
|
|
460
|
+
if (!(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
|
|
461
|
+
!previewSelectionAvailable ||
|
|
462
|
+
!editorShowOutlines) {
|
|
402
463
|
return [];
|
|
403
464
|
}
|
|
404
465
|
const selectedSequenceKeys = (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems);
|
|
405
466
|
const sequenceKeysContainingSelection = (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(selectedItems);
|
|
406
467
|
const selectedEffectsBySequenceKey = (0, selected_outline_measurement_1.getSelectedEffectFieldsBySequenceKey)(selectedItems);
|
|
407
468
|
const selectedTransformOriginInfo = (0, selected_outline_measurement_1.getSelectedTransformOriginInfo)(selectedItems);
|
|
469
|
+
const selectedCropInfo = (0, selected_outline_measurement_1.getSelectedCropInfo)(selectedItems);
|
|
408
470
|
const clientId = previewServerState.type === 'connected'
|
|
409
471
|
? previewServerState.clientId
|
|
410
472
|
: null;
|
|
@@ -434,6 +496,46 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
434
496
|
frame: sourceFrame,
|
|
435
497
|
})
|
|
436
498
|
: null;
|
|
499
|
+
const cropValues = {
|
|
500
|
+
cropLeft: getEffectiveCropValue({
|
|
501
|
+
activeSchema,
|
|
502
|
+
controls,
|
|
503
|
+
dragOverrides,
|
|
504
|
+
fieldKey: selected_outline_types_1.cropFieldKeys.left,
|
|
505
|
+
frame: sourceFrame,
|
|
506
|
+
propStatuses: nodePropStatuses,
|
|
507
|
+
}),
|
|
508
|
+
cropRight: getEffectiveCropValue({
|
|
509
|
+
activeSchema,
|
|
510
|
+
controls,
|
|
511
|
+
dragOverrides,
|
|
512
|
+
fieldKey: selected_outline_types_1.cropFieldKeys.right,
|
|
513
|
+
frame: sourceFrame,
|
|
514
|
+
propStatuses: nodePropStatuses,
|
|
515
|
+
}),
|
|
516
|
+
cropTop: getEffectiveCropValue({
|
|
517
|
+
activeSchema,
|
|
518
|
+
controls,
|
|
519
|
+
dragOverrides,
|
|
520
|
+
fieldKey: selected_outline_types_1.cropFieldKeys.top,
|
|
521
|
+
frame: sourceFrame,
|
|
522
|
+
propStatuses: nodePropStatuses,
|
|
523
|
+
}),
|
|
524
|
+
cropBottom: getEffectiveCropValue({
|
|
525
|
+
activeSchema,
|
|
526
|
+
controls,
|
|
527
|
+
dragOverrides,
|
|
528
|
+
fieldKey: selected_outline_types_1.cropFieldKeys.bottom,
|
|
529
|
+
frame: sourceFrame,
|
|
530
|
+
propStatuses: nodePropStatuses,
|
|
531
|
+
}),
|
|
532
|
+
};
|
|
533
|
+
const crop = remotion_1.Internals.resolveSequenceCrop(cropValues);
|
|
534
|
+
const cropFields = getCropDragFields({
|
|
535
|
+
activeSchema,
|
|
536
|
+
cropValues,
|
|
537
|
+
propStatuses: nodePropStatuses,
|
|
538
|
+
});
|
|
437
539
|
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
|
|
438
540
|
const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
439
541
|
const scaleFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.scaleFieldKey];
|
|
@@ -459,18 +561,18 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
459
561
|
const canRotationDragStatus = (rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'static' ||
|
|
460
562
|
((rotationPropStatus === null || rotationPropStatus === void 0 ? void 0 : rotationPropStatus.status) === 'keyframed' &&
|
|
461
563
|
rotationPropStatus.interpolationFunction === 'interpolate');
|
|
462
|
-
const canDrag =
|
|
564
|
+
const canDrag = previewInteractive &&
|
|
463
565
|
controls !== null &&
|
|
464
566
|
(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
|
|
465
567
|
canDragStatus;
|
|
466
568
|
const canScaleDragStatus = (scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static' ||
|
|
467
569
|
((scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'keyframed' &&
|
|
468
570
|
scalePropStatus.interpolationFunction === 'interpolate');
|
|
469
|
-
const canScaleDrag =
|
|
571
|
+
const canScaleDrag = previewInteractive &&
|
|
470
572
|
controls !== null &&
|
|
471
573
|
(scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale' &&
|
|
472
574
|
canScaleDragStatus;
|
|
473
|
-
const canRotationDrag =
|
|
575
|
+
const canRotationDrag = previewInteractive &&
|
|
474
576
|
controls !== null &&
|
|
475
577
|
(rotationFieldSchema === null || rotationFieldSchema === void 0 ? void 0 : rotationFieldSchema.type) === 'rotation-css' &&
|
|
476
578
|
canRotationDragStatus;
|
|
@@ -485,17 +587,44 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
485
587
|
const canTransformOriginTranslateStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
|
|
486
588
|
((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
|
|
487
589
|
propStatus.interpolationFunction === 'interpolate');
|
|
488
|
-
const canTransformOriginDrag =
|
|
590
|
+
const canTransformOriginDrag = previewInteractive &&
|
|
489
591
|
selectedForTransformOrigin &&
|
|
490
592
|
controls !== null &&
|
|
491
593
|
(transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
|
|
492
594
|
(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
|
|
493
595
|
canTransformOriginStatus &&
|
|
494
596
|
canTransformOriginTranslateStatus;
|
|
495
|
-
const
|
|
496
|
-
|
|
597
|
+
const selectedForCrop = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.sequenceKey) === key;
|
|
598
|
+
const cropSourceFrame = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === null ||
|
|
599
|
+
(selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.displayFrame) === undefined
|
|
600
|
+
? sourceFrame
|
|
601
|
+
: selectedCropInfo.displayFrame - keyframeDisplayOffset;
|
|
602
|
+
const canCropDrag = previewInteractive &&
|
|
603
|
+
selectedForCrop &&
|
|
604
|
+
controls !== null &&
|
|
605
|
+
cropFields !== null;
|
|
606
|
+
const canDropEffect = previewInteractive && (controls === null || controls === void 0 ? void 0 : controls.supportsEffects) === true;
|
|
497
607
|
return {
|
|
498
608
|
key,
|
|
609
|
+
canCrop: previewInteractive && controls !== null && cropFields !== null,
|
|
610
|
+
crop,
|
|
611
|
+
cropDrag: canCropDrag
|
|
612
|
+
? {
|
|
613
|
+
clientId: previewServerState.clientId,
|
|
614
|
+
fields: cropFields,
|
|
615
|
+
nodePath,
|
|
616
|
+
schema: controls.schema,
|
|
617
|
+
sourceFrame: cropSourceFrame,
|
|
618
|
+
transformOrigin: (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
|
|
619
|
+
transformOriginPropStatus !== undefined
|
|
620
|
+
? {
|
|
621
|
+
defaultValue: transformOriginFieldSchema.default,
|
|
622
|
+
propStatus: transformOriginPropStatus,
|
|
623
|
+
value: transformOriginValueForRotation,
|
|
624
|
+
}
|
|
625
|
+
: null,
|
|
626
|
+
}
|
|
627
|
+
: null,
|
|
499
628
|
containsSelection,
|
|
500
629
|
effectDrop: canDropEffect
|
|
501
630
|
? {
|
|
@@ -628,6 +757,8 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
628
757
|
getScaleLockState,
|
|
629
758
|
editorShowOutlines,
|
|
630
759
|
overrideIdToNodePathMappings,
|
|
760
|
+
previewInteractive,
|
|
761
|
+
previewSelectionAvailable,
|
|
631
762
|
previewServerState,
|
|
632
763
|
selectedItems,
|
|
633
764
|
sequences,
|
|
@@ -635,11 +766,11 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
635
766
|
timelinePosition,
|
|
636
767
|
]);
|
|
637
768
|
(0, react_1.useEffect)(() => {
|
|
638
|
-
if (
|
|
639
|
-
!outlineTargets.some((target) => target.key ===
|
|
640
|
-
|
|
769
|
+
if ((hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'canvas' &&
|
|
770
|
+
!outlineTargets.some((target) => target.key === hoveredSequence.key)) {
|
|
771
|
+
setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
|
|
641
772
|
}
|
|
642
|
-
}, [
|
|
773
|
+
}, [hoveredSequence, outlineTargets, setHoveredSequence]);
|
|
643
774
|
const targetsByKey = (0, react_1.useMemo)(() => {
|
|
644
775
|
return new Map(outlineTargets.map((target) => [target.key, target]));
|
|
645
776
|
}, [outlineTargets]);
|
|
@@ -951,6 +1082,6 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
951
1082
|
return null;
|
|
952
1083
|
}
|
|
953
1084
|
return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [
|
|
954
|
-
jsx_runtime_1.jsx(SelectedOutlineSnapIndicators, { activeSnapPoints: activeSnapPoints, compositionHeight: compositionHeight, compositionWidth: compositionWidth, scale: scale }), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered:
|
|
1085
|
+
jsx_runtime_1.jsx(SelectedOutlineSnapIndicators, { activeSnapPoints: activeSnapPoints, compositionHeight: compositionHeight, compositionWidth: compositionWidth, scale: scale }), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.key) === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: selectOutlineItem, scale: scale, snapTargets: snapTargets, target: targetsByKey.get(outline.key) }, outline.key))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineTransformOriginHandle, { outline: outline, onDraggingChange: onDraggingChange, target: targetsByKey.get(outline.key) }, `${outline.key}-transform-origin`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
|
|
955
1086
|
};
|
|
956
1087
|
exports.SelectedOutlineOverlay = SelectedOutlineOverlay;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { OverrideIdToNodePaths, TSequence } from 'remotion';
|
|
2
|
+
export declare const getReadOnlyOverrideIdToNodePathMappings: (sequences: readonly TSequence[]) => OverrideIdToNodePaths;
|
|
1
3
|
export declare const SequencePropsSubscriptionProvider: React.FC<{
|
|
2
4
|
readonly children: React.ReactNode;
|
|
3
5
|
}>;
|
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SequencePropsSubscriptionProvider = void 0;
|
|
3
|
+
exports.SequencePropsSubscriptionProvider = exports.getReadOnlyOverrideIdToNodePathMappings = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const getReadOnlyOverrideIdToNodePathMappings = (sequences) => {
|
|
8
|
+
return Object.fromEntries(sequences.flatMap((sequence) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const overrideId = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId;
|
|
11
|
+
if (!overrideId) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
return [
|
|
15
|
+
[
|
|
16
|
+
overrideId,
|
|
17
|
+
{
|
|
18
|
+
absolutePath: '',
|
|
19
|
+
effectKeys: [],
|
|
20
|
+
nodePath: ['readonly-sequence', overrideId],
|
|
21
|
+
sequenceKeys: [],
|
|
22
|
+
videoConfigValues: null,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
];
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
exports.getReadOnlyOverrideIdToNodePathMappings = getReadOnlyOverrideIdToNodePathMappings;
|
|
7
29
|
const SequencePropsSubscriptionProvider = ({ children }) => {
|
|
30
|
+
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
8
31
|
const [overrideToNodePathMap, setOverrideIdToNodePathMap] = (0, react_1.useState)({});
|
|
32
|
+
const readOnlyOverrideToNodePathMap = (0, react_1.useMemo)(() => window.remotion_isReadOnlyStudio
|
|
33
|
+
? (0, exports.getReadOnlyOverrideIdToNodePathMappings)(sequences)
|
|
34
|
+
: null, [sequences]);
|
|
9
35
|
const setOverrideIdToNodePath = (0, react_1.useCallback)((overrideId, state) => {
|
|
10
36
|
setOverrideIdToNodePathMap((prev) => {
|
|
11
37
|
const existing = prev[overrideId];
|
|
@@ -16,8 +42,10 @@ const SequencePropsSubscriptionProvider = ({ children }) => {
|
|
|
16
42
|
});
|
|
17
43
|
}, []);
|
|
18
44
|
const getters = (0, react_1.useMemo)(() => {
|
|
19
|
-
return {
|
|
20
|
-
|
|
45
|
+
return {
|
|
46
|
+
overrideIdToNodePathMappings: readOnlyOverrideToNodePathMap !== null && readOnlyOverrideToNodePathMap !== void 0 ? readOnlyOverrideToNodePathMap : overrideToNodePathMap,
|
|
47
|
+
};
|
|
48
|
+
}, [overrideToNodePathMap, readOnlyOverrideToNodePathMap]);
|
|
21
49
|
const setters = (0, react_1.useMemo)(() => {
|
|
22
50
|
return { setOverrideIdToNodePath };
|
|
23
51
|
}, [setOverrideIdToNodePath]);
|
|
@@ -4,8 +4,10 @@ exports.ShowOutlinesProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
7
|
+
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
7
8
|
const ShowOutlinesProvider = ({ children }) => {
|
|
8
9
|
const [editorShowOutlines, setEditorShowOutlinesState] = (0, react_1.useState)(() => (0, editor_outlines_1.loadEditorShowOutlinesOption)());
|
|
10
|
+
const [hoveredSequence, setHoveredSequence] = (0, react_1.useState)(null);
|
|
9
11
|
const setEditorShowOutlines = (0, react_1.useCallback)((newValue) => {
|
|
10
12
|
setEditorShowOutlinesState((prevState) => {
|
|
11
13
|
const newVal = newValue(prevState);
|
|
@@ -19,6 +21,7 @@ const ShowOutlinesProvider = ({ children }) => {
|
|
|
19
21
|
setEditorShowOutlines,
|
|
20
22
|
};
|
|
21
23
|
}, [editorShowOutlines, setEditorShowOutlines]);
|
|
22
|
-
|
|
24
|
+
const timelineSequenceHoverCtx = (0, react_1.useMemo)(() => ({ hoveredSequence, setHoveredSequence }), [hoveredSequence]);
|
|
25
|
+
return (jsx_runtime_1.jsx(editor_outlines_1.EditorShowOutlinesContext.Provider, { value: editorShowOutlinesCtx, children: jsx_runtime_1.jsx(timeline_sequence_hover_1.TimelineSequenceHoverContext.Provider, { value: timelineSequenceHoverCtx, children: children }) }));
|
|
23
26
|
};
|
|
24
27
|
exports.ShowOutlinesProvider = ShowOutlinesProvider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SidebarCollapserControl = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
@@ -18,7 +18,7 @@ const style = {
|
|
|
18
18
|
color: colors_1.CURRENT_COLOR,
|
|
19
19
|
position: 'relative',
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const SidebarCollapserControl = ({ side }) => {
|
|
22
22
|
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
23
23
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
24
24
|
const leftSidebarStatus = (0, TopPanel_1.useResponsiveSidebarStatus)();
|
|
@@ -83,15 +83,30 @@ const SidebarCollapserControls = () => {
|
|
|
83
83
|
toggleRight,
|
|
84
84
|
]);
|
|
85
85
|
(0, react_1.useEffect)(() => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
if (side === 'left') {
|
|
87
|
+
const left = keybindings.registerKeybinding({
|
|
88
|
+
event: 'keydown',
|
|
89
|
+
key: 'b',
|
|
90
|
+
commandCtrlKey: true,
|
|
91
|
+
callback: toggleLeft,
|
|
92
|
+
preventDefault: true,
|
|
93
|
+
triggerIfInputFieldFocused: false,
|
|
94
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
95
|
+
});
|
|
96
|
+
const zen = keybindings.registerKeybinding({
|
|
97
|
+
event: 'keydown',
|
|
98
|
+
key: 'g',
|
|
99
|
+
commandCtrlKey: true,
|
|
100
|
+
callback: toggleBoth,
|
|
101
|
+
preventDefault: true,
|
|
102
|
+
triggerIfInputFieldFocused: false,
|
|
103
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
104
|
+
});
|
|
105
|
+
return () => {
|
|
106
|
+
left.unregister();
|
|
107
|
+
zen.unregister();
|
|
108
|
+
};
|
|
109
|
+
}
|
|
95
110
|
const right = keybindings.registerKeybinding({
|
|
96
111
|
event: 'keydown',
|
|
97
112
|
key: 'j',
|
|
@@ -101,21 +116,10 @@ const SidebarCollapserControls = () => {
|
|
|
101
116
|
triggerIfInputFieldFocused: false,
|
|
102
117
|
keepRegisteredWhenNotHighestContext: false,
|
|
103
118
|
});
|
|
104
|
-
const zen = keybindings.registerKeybinding({
|
|
105
|
-
event: 'keydown',
|
|
106
|
-
key: 'g',
|
|
107
|
-
commandCtrlKey: true,
|
|
108
|
-
callback: toggleBoth,
|
|
109
|
-
preventDefault: true,
|
|
110
|
-
triggerIfInputFieldFocused: false,
|
|
111
|
-
keepRegisteredWhenNotHighestContext: false,
|
|
112
|
-
});
|
|
113
119
|
return () => {
|
|
114
|
-
left.unregister();
|
|
115
120
|
right.unregister();
|
|
116
|
-
zen.unregister();
|
|
117
121
|
};
|
|
118
|
-
}, [keybindings, toggleBoth, toggleLeft, toggleRight]);
|
|
122
|
+
}, [keybindings, side, toggleBoth, toggleLeft, toggleRight]);
|
|
119
123
|
const toggleLeftTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
120
124
|
? 'Toggle Left Sidebar'
|
|
121
125
|
: `Toggle Left Sidebar (${ShortcutHint_1.cmdOrCtrlCharacter}+B)`;
|
|
@@ -129,13 +133,14 @@ const SidebarCollapserControls = () => {
|
|
|
129
133
|
};
|
|
130
134
|
}, []);
|
|
131
135
|
const toggleLeftAction = (0, react_1.useCallback)((color) => {
|
|
132
|
-
return (jsx_runtime_1.jsx("div", { style: colorStyle(color), title: toggleLeftTooltip, children: jsx_runtime_1.jsx("div", { style: leftIcon(color) }) }));
|
|
136
|
+
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "left", style: colorStyle(color), title: toggleLeftTooltip, children: jsx_runtime_1.jsx("div", { style: leftIcon(color) }) }));
|
|
133
137
|
}, [colorStyle, leftIcon, toggleLeftTooltip]);
|
|
134
138
|
const toggleRightAction = (0, react_1.useCallback)((color) => {
|
|
135
|
-
return (jsx_runtime_1.jsx("div", { style: colorStyle(color), title: toggleRightTooltip, children: jsx_runtime_1.jsx("div", { style: rightIcon(color) }) }));
|
|
139
|
+
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "right", style: colorStyle(color), title: toggleRightTooltip, children: jsx_runtime_1.jsx("div", { style: rightIcon(color) }) }));
|
|
136
140
|
}, [colorStyle, rightIcon, toggleRightTooltip]);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
if (side === 'left') {
|
|
142
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: toggleLeft, renderAction: toggleLeftAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
143
|
+
}
|
|
144
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: toggleRight, renderAction: toggleRightAction, unhoveredColor: colors_1.WHITE_ALPHA_80 }));
|
|
140
145
|
};
|
|
141
|
-
exports.
|
|
146
|
+
exports.SidebarCollapserControl = SidebarCollapserControl;
|
|
@@ -9,7 +9,7 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
9
9
|
const magnet_1 = require("../icons/magnet");
|
|
10
10
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
11
11
|
const ControlButton_1 = require("./ControlButton");
|
|
12
|
-
const SnappingToggle = (
|
|
12
|
+
const SnappingToggle = () => {
|
|
13
13
|
const { editorSnapping, setEditorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
14
14
|
const onClick = (0, react_1.useCallback)(() => {
|
|
15
15
|
setEditorSnapping((current) => !current);
|
|
@@ -21,6 +21,6 @@ const SnappingToggle = ({ disabled }) => {
|
|
|
21
21
|
]
|
|
22
22
|
.filter(no_react_1.NoReactInternals.truthy)
|
|
23
23
|
.join(' ');
|
|
24
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": "Shift+M",
|
|
24
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": "Shift+M", onClick: onClick, children: jsx_runtime_1.jsx(magnet_1.MagnetIcon, { style: { width: 17, height: 17 }, fill: color, "aria-hidden": "true", focusable: "false" }) }));
|
|
25
25
|
};
|
|
26
26
|
exports.SnappingToggle = SnappingToggle;
|
|
@@ -37,6 +37,7 @@ exports.Timeline = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
40
41
|
const calculate_timeline_1 = require("../../helpers/calculate-timeline");
|
|
41
42
|
const client_id_1 = require("../../helpers/client-id");
|
|
42
43
|
const colors_1 = require("../../helpers/colors");
|
|
@@ -93,6 +94,8 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
93
94
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
94
95
|
const previewConnected = previewServerState.type === 'connected';
|
|
95
96
|
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
97
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
98
|
+
const browserStudioCanInsertSolid = browserStudioOperations !== null;
|
|
96
99
|
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
97
100
|
const currentComposition = (0, react_1.useMemo)(() => {
|
|
98
101
|
var _a;
|
|
@@ -102,12 +105,14 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
102
105
|
return ((_a = compositions.find((composition) => composition.id === currentCompositionId)) !== null && _a !== void 0 ? _a : null);
|
|
103
106
|
}, [compositions, currentCompositionId]);
|
|
104
107
|
const resolvedCompositionLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _a !== void 0 ? _a : null);
|
|
105
|
-
const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b :
|
|
108
|
+
const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b : (currentCompositionId && browserStudioOperations
|
|
109
|
+
? browserStudioOperations.getCompositionFile(currentCompositionId)
|
|
110
|
+
: null);
|
|
106
111
|
const compositionComponentInfo = (0, open_in_editor_1.useCachedCompositionComponentInfo)({
|
|
107
112
|
compositionFile,
|
|
108
113
|
compositionId: currentCompositionId,
|
|
109
114
|
});
|
|
110
|
-
const canInsertSolid = previewInteractive &&
|
|
115
|
+
const canInsertSolid = (previewInteractive || browserStudioCanInsertSolid) &&
|
|
111
116
|
(compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true &&
|
|
112
117
|
currentCompositionId !== null &&
|
|
113
118
|
compositionFile !== null &&
|
|
@@ -128,7 +133,7 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
128
133
|
}
|
|
129
134
|
setIsAddingSolid(true);
|
|
130
135
|
try {
|
|
131
|
-
const
|
|
136
|
+
const request = {
|
|
132
137
|
compositionFile,
|
|
133
138
|
compositionId: currentCompositionId,
|
|
134
139
|
from: null,
|
|
@@ -138,7 +143,10 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
138
143
|
height: videoConfig.height,
|
|
139
144
|
position: null,
|
|
140
145
|
},
|
|
141
|
-
}
|
|
146
|
+
};
|
|
147
|
+
const result = browserStudioOperations
|
|
148
|
+
? await browserStudioOperations.insertSolid(request)
|
|
149
|
+
: await (0, call_api_1.callApi)('/api/insert-jsx-element', request);
|
|
142
150
|
if (result.success) {
|
|
143
151
|
(0, NotificationCenter_1.showNotification)('Added <Solid> to source file', 2000);
|
|
144
152
|
return;
|
|
@@ -151,7 +159,13 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
151
159
|
finally {
|
|
152
160
|
setIsAddingSolid(false);
|
|
153
161
|
}
|
|
154
|
-
}, [
|
|
162
|
+
}, [
|
|
163
|
+
browserStudioOperations,
|
|
164
|
+
canInsertSolid,
|
|
165
|
+
compositionFile,
|
|
166
|
+
currentCompositionId,
|
|
167
|
+
videoConfig,
|
|
168
|
+
]);
|
|
155
169
|
const insertAsset = (0, react_1.useCallback)(async () => {
|
|
156
170
|
if (!canInsertAsset ||
|
|
157
171
|
currentCompositionId === null ||
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CanUpdateSequencePropStatusStatic } from 'remotion';
|
|
3
3
|
import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
|
|
4
|
+
import { type InspectorInlineActionProps } from '../InspectorPanel/common';
|
|
5
|
+
export type InspectorSourceAction = Omit<InspectorInlineActionProps, 'variant'>;
|
|
6
|
+
type AssetSelectionContextValue = {
|
|
7
|
+
readonly initialQuery: string;
|
|
8
|
+
readonly getSourceAction: (src: string) => InspectorSourceAction | null;
|
|
9
|
+
readonly sourceAction: InspectorSourceAction | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const AssetSelectionContext: React.Context<AssetSelectionContextValue>;
|
|
12
|
+
export declare const toFileToken: (name: string) => string;
|
|
4
13
|
type TimelineAssetFieldProps = {
|
|
5
14
|
readonly field: SchemaFieldInfo;
|
|
6
15
|
readonly propStatus: CanUpdateSequencePropStatusStatic;
|
|
@@ -9,6 +18,5 @@ type TimelineAssetFieldProps = {
|
|
|
9
18
|
readonly onDragValueChange: TimelineFieldOnDragValueChange;
|
|
10
19
|
readonly onDragEnd: () => void;
|
|
11
20
|
};
|
|
12
|
-
export declare const isStaticFileAssetValue: (value: unknown) => value is string;
|
|
13
21
|
export declare const TimelineAssetField: React.FC<TimelineAssetFieldProps>;
|
|
14
22
|
export {};
|