@remotion/studio 4.0.506 → 4.0.508
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/FastRefreshProvider.js +13 -9
- package/dist/api/copy-render-output-to-asset.d.ts +4 -0
- package/dist/api/copy-render-output-to-asset.js +11 -0
- package/dist/components/AssetSelector.js +19 -4
- package/dist/components/AssetSelectorItem.js +2 -2
- package/dist/components/CodingAgentIcon.d.ts +6 -0
- package/dist/components/CodingAgentIcon.js +12 -0
- package/dist/components/ConfigureDefaultEditorModal.d.ts +1 -3
- package/dist/components/ConfigureDefaultEditorModal.js +67 -77
- package/dist/components/ConfigureLicenseModal.d.ts +1 -4
- package/dist/components/ConfigureLicenseModal.js +89 -81
- package/dist/components/ContextMenu.d.ts +1 -0
- package/dist/components/ContextMenu.js +42 -13
- package/dist/components/EditorContent.js +4 -3
- package/dist/components/EditorContexts.js +6 -5
- package/dist/components/ExpandedTracksProvider.js +10 -53
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -3
- package/dist/components/InspectorLocationCopy.js +8 -8
- package/dist/components/InspectorOpenInEditor.d.ts +2 -0
- package/dist/components/InspectorOpenInEditor.js +81 -50
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +22 -4
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/styles.js +1 -1
- package/dist/components/InspectorSequenceSection.js +36 -4
- package/dist/components/Menu/MenuSectionHeader.d.ts +4 -0
- package/dist/components/Menu/MenuSectionHeader.js +20 -0
- package/dist/components/Menu/SubMenu.js +13 -2
- package/dist/components/Menu/menu-tree-context.d.ts +3 -0
- package/dist/components/Menu/menu-tree-context.js +13 -0
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/NewComposition/ComboBox.d.ts +6 -1
- package/dist/components/NewComposition/MenuContent.js +27 -19
- package/dist/components/NewComposition/menu-typeahead.js +2 -2
- package/dist/components/PlayPause.d.ts +1 -1
- package/dist/components/PlayPause.js +61 -12
- package/dist/components/Preview.js +29 -4
- package/dist/components/RenderButton.js +16 -12
- package/dist/components/RenderModal/GuiRenderStatus.js +23 -6
- package/dist/components/RenderModal/InfoBubble.d.ts +1 -0
- package/dist/components/RenderModal/InfoBubble.js +6 -4
- package/dist/components/RenderModal/InfoTooltip.d.ts +1 -0
- package/dist/components/RenderModal/InfoTooltip.js +12 -12
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +16 -3
- package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -0
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +3 -2
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +8 -3
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/zod-schema-type.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/zod-schema-type.js +12 -1
- package/dist/components/RenderModal/ServerRenderModal.js +4 -0
- package/dist/components/RenderQueue/RenderQueueItem.js +8 -2
- package/dist/components/RenderQueue/actions.d.ts +4 -2
- package/dist/components/RenderQueue/actions.js +4 -2
- package/dist/components/RenderQueue/index.js +3 -4
- package/dist/components/RenderQueue/use-render-output-file-drag.d.ts +8 -0
- package/dist/components/RenderQueue/use-render-output-file-drag.js +121 -0
- package/dist/components/SegmentedControl.js +0 -1
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +9 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +237 -0
- package/dist/components/SelectedOutlineElement.d.ts +16 -18
- package/dist/components/SelectedOutlineElement.js +144 -931
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +7 -0
- package/dist/components/SelectedOutlineKeyboardControls.js +261 -0
- package/dist/components/SelectedOutlineOverlay.d.ts +7 -14
- package/dist/components/SelectedOutlineOverlay.js +378 -864
- package/dist/components/SelectedOutlinePolygon.d.ts +26 -0
- package/dist/components/SelectedOutlinePolygon.js +360 -0
- package/dist/components/SelectedOutlineRenderer.d.ts +19 -0
- package/dist/components/SelectedOutlineRenderer.js +225 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +17 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +271 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +17 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +215 -0
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +9 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +29 -0
- package/dist/components/SelectedOutlineTransformOriginHandle.d.ts +9 -0
- package/dist/components/SelectedOutlineTransformOriginHandle.js +312 -0
- package/dist/components/SelectedOutlineUvControls.d.ts +3 -9
- package/dist/components/SelectedOutlineUvControls.js +57 -12
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -0
- package/dist/components/SettingsContext.d.ts +15 -0
- package/dist/components/SettingsContext.js +116 -0
- package/dist/components/SettingsModal.js +10 -4
- package/dist/components/SettingsModalFooter.d.ts +1 -3
- package/dist/components/SettingsModalFooter.js +4 -6
- package/dist/components/ShowOutlinesProvider.js +2 -3
- package/dist/components/Timeline/EasingEditorModal.js +66 -22
- package/dist/components/Timeline/SequencePropsObserver.js +97 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +4 -2
- package/dist/components/Timeline/Timeline.js +22 -5
- package/dist/components/Timeline/TimelineDuplicateCount.d.ts +4 -0
- package/dist/components/Timeline/TimelineDuplicateCount.js +28 -0
- package/dist/components/Timeline/TimelineEffectItem.js +1 -4
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +3 -23
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +11 -1
- package/dist/components/Timeline/TimelineFieldRowContent.js +10 -3
- package/dist/components/Timeline/TimelineRotationField.js +84 -12
- package/dist/components/Timeline/TimelineScaleField.js +58 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
- package/dist/components/Timeline/TimelineSelection.js +45 -2
- package/dist/components/Timeline/TimelineSequence.js +28 -25
- package/dist/components/Timeline/TimelineSequenceItem.js +91 -28
- package/dist/components/Timeline/TimelineSequencePropItem.js +5 -2
- package/dist/components/Timeline/TimelineTrack.js +2 -1
- package/dist/components/Timeline/TimelineTransformOriginField.js +78 -4
- package/dist/components/Timeline/TimelineTranslateField.js +55 -15
- package/dist/components/Timeline/Transform3DModeContext.d.ts +1 -0
- package/dist/components/Timeline/Transform3DModeContext.js +5 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +0 -6
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +69 -57
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
- package/dist/components/Timeline/sequence-props-subscription-store.js +5 -2
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -2
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +6 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +16 -1
- package/dist/components/Timeline/timeline-rotation-utils.d.ts +16 -0
- package/dist/components/Timeline/timeline-rotation-utils.js +145 -4
- package/dist/components/Timeline/timeline-translate-utils.d.ts +3 -2
- package/dist/components/Timeline/timeline-translate-utils.js +8 -4
- package/dist/components/Timeline/transform-3d-mode.d.ts +6 -0
- package/dist/components/Timeline/transform-3d-mode.js +36 -0
- package/dist/components/Timeline/transform-origin-utils.d.ts +4 -0
- package/dist/components/Timeline/transform-origin-utils.js +12 -6
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +36 -4
- package/dist/components/Timeline/{use-open-sequence-in-editor.d.ts → use-open-sequence-in-apps.d.ts} +4 -1
- package/dist/components/Timeline/{use-open-sequence-in-editor.js → use-open-sequence-in-apps.js} +21 -5
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +5 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +45 -9
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -2
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +4 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +45 -1
- package/dist/components/call-api.js +2 -0
- package/dist/components/canvas-rotation-cursor.d.ts +1 -0
- package/dist/components/canvas-rotation-cursor.js +14 -0
- package/dist/components/get-open-in-menu-items.d.ts +17 -0
- package/dist/components/get-open-in-menu-items.js +144 -0
- package/dist/components/selected-outline-drag.d.ts +11 -5
- package/dist/components/selected-outline-drag.js +80 -42
- package/dist/components/selected-outline-measurement.d.ts +7 -2
- package/dist/components/selected-outline-measurement.js +28 -1
- package/dist/components/selected-outline-order.d.ts +12 -0
- package/dist/components/selected-outline-order.js +251 -0
- package/dist/components/selected-outline-types.d.ts +15 -10
- package/dist/components/svg-point-to-client-point.d.ts +2 -0
- package/dist/components/svg-point-to-client-point.js +10 -0
- package/dist/components/use-auto-save-config.d.ts +8 -0
- package/dist/components/use-auto-save-config.js +74 -0
- package/dist/components/use-default-editor-info.d.ts +1 -0
- package/dist/components/use-default-editor-info.js +10 -30
- package/dist/esm/{chunk-jefhcs5z.js → chunk-fgedsvhb.js} +1 -2
- package/dist/esm/{chunk-b49ec3nz.js → chunk-zpn4m49r.js} +12924 -10139
- package/dist/esm/index.mjs +357 -2
- package/dist/esm/internals.mjs +12923 -10138
- package/dist/esm/previewEntry.mjs +12771 -9986
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/are-sequence-node-path-infos-equal.d.ts +2 -0
- package/dist/helpers/are-sequence-node-path-infos-equal.js +27 -0
- package/dist/helpers/calculate-timeline.js +3 -3
- package/dist/helpers/client-id.js +8 -1
- package/dist/helpers/format-file-location.d.ts +1 -1
- package/dist/helpers/format-file-location.js +3 -3
- package/dist/helpers/get-box-quads-polyfill-internals.js +10 -2
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
- package/dist/helpers/open-in-editor.d.ts +4 -1
- package/dist/helpers/open-in-editor.js +9 -1
- package/dist/helpers/preview-server-events.js +4 -0
- package/dist/helpers/sequence-node-path-mutations.d.ts +4 -0
- package/dist/helpers/sequence-node-path-mutations.js +31 -0
- package/dist/helpers/studio-runtime-config.js +3 -0
- package/dist/helpers/timeline-node-path-key.d.ts +2 -0
- package/dist/helpers/timeline-node-path-key.js +3 -1
- package/dist/helpers/use-asset-drag-events.d.ts +2 -1
- package/dist/helpers/use-asset-drag-events.js +14 -6
- package/dist/helpers/use-menu-structure.js +2 -2
- package/dist/helpers/use-runtime-values.d.ts +1 -3
- package/dist/icons/cube.d.ts +4 -0
- package/dist/icons/cube.js +6 -0
- package/dist/icons/finder.d.ts +4 -0
- package/dist/icons/finder.js +8 -0
- package/dist/icons/terminal.d.ts +6 -0
- package/dist/icons/terminal.js +46 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8 -0
- package/dist/state/timeline-sequence-hover.d.ts +9 -3
- package/dist/state/timeline-sequence-hover.js +63 -12
- package/dist/state/transform-3d-mode.d.ts +10 -0
- package/dist/state/transform-3d-mode.js +27 -0
- package/dist/state/z-index.js +5 -8
- package/package.json +12 -12
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { getSequencesWithSelectableOutlines } from './selected-outline-measurement';
|
|
3
|
+
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
4
|
+
export declare const SelectedOutlineKeyboardControls: React.FC<{
|
|
5
|
+
readonly getLatestOutlineTargetByKey: (key: string) => SelectedOutlineTarget | undefined;
|
|
6
|
+
readonly getSelectableOutlines: () => ReturnType<typeof getSequencesWithSelectableOutlines>;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelectedOutlineKeyboardControls = void 0;
|
|
4
|
+
const player_1 = require("@remotion/player");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
9
|
+
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
10
|
+
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
11
|
+
const selected_outline_types_1 = require("./selected-outline-types");
|
|
12
|
+
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
13
|
+
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
14
|
+
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
15
|
+
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
16
|
+
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
17
|
+
const SelectedOutlineKeyboardControls = ({ getLatestOutlineTargetByKey, getSelectableOutlines }) => {
|
|
18
|
+
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
19
|
+
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
20
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
21
|
+
const { frameBack, frameForward, getCurrentFrame, seek } = player_1.PlayerInternals.usePlayerMethods();
|
|
22
|
+
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
23
|
+
const keyboardNudgeSessionRef = (0, react_1.useRef)(null);
|
|
24
|
+
const saveKeyboardNudgeSessionRef = (0, react_1.useRef)(() => undefined);
|
|
25
|
+
const saveKeyboardNudgeSession = (0, react_1.useCallback)(() => {
|
|
26
|
+
const session = keyboardNudgeSessionRef.current;
|
|
27
|
+
if (session === null) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
keyboardNudgeSessionRef.current = null;
|
|
31
|
+
const changes = (0, selected_outline_drag_1.getSelectedOutlineDragChanges)({
|
|
32
|
+
dragStates: session.dragStates,
|
|
33
|
+
lastValues: session.lastValues,
|
|
34
|
+
});
|
|
35
|
+
if (changes.length === 0) {
|
|
36
|
+
(0, selected_outline_drag_1.clearSelectedOutlineDragOverrides)({
|
|
37
|
+
clearDragOverrides,
|
|
38
|
+
dragStates: session.dragStates,
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const staticChanges = changes.filter((change) => change.type === 'static');
|
|
43
|
+
const keyframedChanges = changes.filter((change) => change.type === 'keyframed');
|
|
44
|
+
Promise.all([
|
|
45
|
+
staticChanges.length > 0
|
|
46
|
+
? (0, save_sequence_prop_1.saveSequenceProps)({
|
|
47
|
+
changes: staticChanges,
|
|
48
|
+
addedKeyframes: null,
|
|
49
|
+
movedKeyframes: null,
|
|
50
|
+
setPropStatuses,
|
|
51
|
+
clientId: session.clientId,
|
|
52
|
+
undoLabel: changes.length > 1 ? 'Move selected sequences' : 'Move sequence',
|
|
53
|
+
redoLabel: changes.length > 1
|
|
54
|
+
? 'Move selected sequences back'
|
|
55
|
+
: 'Move sequence back',
|
|
56
|
+
})
|
|
57
|
+
: Promise.resolve(),
|
|
58
|
+
(0, call_add_keyframe_1.callAddKeyframes)({
|
|
59
|
+
sequenceKeyframes: keyframedChanges,
|
|
60
|
+
effectKeyframes: [],
|
|
61
|
+
setPropStatuses,
|
|
62
|
+
clientId: session.clientId,
|
|
63
|
+
}),
|
|
64
|
+
])
|
|
65
|
+
.catch((err) => {
|
|
66
|
+
(0, NotificationCenter_1.showNotification)(`Could not save sequence props: ${err instanceof Error ? err.message : String(err)}`, 4000);
|
|
67
|
+
})
|
|
68
|
+
.finally(() => {
|
|
69
|
+
(0, selected_outline_drag_1.clearSelectedOutlineDragOverrides)({
|
|
70
|
+
clearDragOverrides,
|
|
71
|
+
dragStates: session.dragStates,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}, [clearDragOverrides, setPropStatuses]);
|
|
75
|
+
(0, react_1.useEffect)(() => {
|
|
76
|
+
saveKeyboardNudgeSessionRef.current = saveKeyboardNudgeSession;
|
|
77
|
+
}, [saveKeyboardNudgeSession]);
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
return () => {
|
|
80
|
+
saveKeyboardNudgeSessionRef.current();
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
const seekWithArrowKey = (0, react_1.useCallback)((event, direction) => {
|
|
84
|
+
if (direction === 'up' || direction === 'down') {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
if (direction === 'left') {
|
|
89
|
+
if (event.altKey) {
|
|
90
|
+
seek(0);
|
|
91
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
92
|
+
direction: 'fit-left',
|
|
93
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
94
|
+
frame: 0,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else if (event.shiftKey) {
|
|
98
|
+
frameBack((0, imperative_state_1.getCurrentFps)());
|
|
99
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
100
|
+
direction: 'fit-left',
|
|
101
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
102
|
+
frame: Math.max(0, getCurrentFrame() - (0, imperative_state_1.getCurrentFps)()),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
frameBack(1);
|
|
107
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
108
|
+
direction: 'fit-left',
|
|
109
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
110
|
+
frame: Math.max(0, getCurrentFrame() - 1),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (event.altKey) {
|
|
116
|
+
seek((0, imperative_state_1.getCurrentDuration)() - 1);
|
|
117
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
118
|
+
direction: 'fit-right',
|
|
119
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)() - 1,
|
|
120
|
+
frame: (0, imperative_state_1.getCurrentDuration)() - 1,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
else if (event.shiftKey) {
|
|
124
|
+
frameForward((0, imperative_state_1.getCurrentFps)());
|
|
125
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
126
|
+
direction: 'fit-right',
|
|
127
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
128
|
+
frame: Math.min((0, imperative_state_1.getCurrentDuration)() - 1, getCurrentFrame() + (0, imperative_state_1.getCurrentFps)()),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
frameForward(1);
|
|
133
|
+
(0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
|
|
134
|
+
direction: 'fit-right',
|
|
135
|
+
durationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
136
|
+
frame: Math.min((0, imperative_state_1.getCurrentDuration)() - 1, getCurrentFrame() + 1),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}, [frameBack, frameForward, getCurrentFrame, seek]);
|
|
140
|
+
const onArrowKeyDown = (0, react_1.useCallback)((event) => {
|
|
141
|
+
var _a;
|
|
142
|
+
const direction = (0, selected_outline_drag_1.getSelectedOutlineKeyboardNudgeDirection)(event.key);
|
|
143
|
+
if (direction === null) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const { selectedItems } = currentSelection.current;
|
|
147
|
+
const selectedSequenceKeys = (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems);
|
|
148
|
+
const sequenceKeysContainingSelection = (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(selectedItems);
|
|
149
|
+
const selectableOutlines = getSelectableOutlines();
|
|
150
|
+
const allDragTargets = selectableOutlines.flatMap(({ key }) => {
|
|
151
|
+
var _a;
|
|
152
|
+
var _b;
|
|
153
|
+
if (!selectedSequenceKeys.has(key) &&
|
|
154
|
+
!sequenceKeysContainingSelection.has(key)) {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
const drag = (_b = (_a = getLatestOutlineTargetByKey(key)) === null || _a === void 0 ? void 0 : _a.drag) !== null && _b !== void 0 ? _b : null;
|
|
158
|
+
return drag === null ? [] : [drag];
|
|
159
|
+
});
|
|
160
|
+
if (selectedItems.length === 0 || allDragTargets.length === 0) {
|
|
161
|
+
seekWithArrowKey(event, direction);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (event.altKey) {
|
|
165
|
+
seekWithArrowKey(event, direction);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
const activeSession = (_a = keyboardNudgeSessionRef.current) !== null && _a !== void 0 ? _a : (() => {
|
|
170
|
+
const [firstDragTarget] = allDragTargets;
|
|
171
|
+
if (firstDragTarget === undefined) {
|
|
172
|
+
throw new Error('Expected a drag target');
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
clientId: firstDragTarget.clientId,
|
|
176
|
+
deltaX: 0,
|
|
177
|
+
deltaY: 0,
|
|
178
|
+
dragStates: (0, selected_outline_drag_1.getSelectedOutlineDragStates)({
|
|
179
|
+
dragTargets: allDragTargets,
|
|
180
|
+
getDragOverrides,
|
|
181
|
+
timelinePosition: getCurrentFrame(),
|
|
182
|
+
}),
|
|
183
|
+
lastValues: new Map(),
|
|
184
|
+
};
|
|
185
|
+
})();
|
|
186
|
+
keyboardNudgeSessionRef.current = activeSession;
|
|
187
|
+
const nextDeltas = (0, selected_outline_drag_1.getSelectedOutlineKeyboardNudgeDeltas)({
|
|
188
|
+
deltaX: activeSession.deltaX,
|
|
189
|
+
deltaY: activeSession.deltaY,
|
|
190
|
+
direction,
|
|
191
|
+
shiftKey: event.shiftKey,
|
|
192
|
+
});
|
|
193
|
+
activeSession.deltaX = nextDeltas.deltaX;
|
|
194
|
+
activeSession.deltaY = nextDeltas.deltaY;
|
|
195
|
+
const lastValues = (0, selected_outline_drag_1.getSelectedOutlineDragValues)({
|
|
196
|
+
dragStates: activeSession.dragStates,
|
|
197
|
+
deltaX: activeSession.deltaX,
|
|
198
|
+
deltaY: activeSession.deltaY,
|
|
199
|
+
});
|
|
200
|
+
activeSession.lastValues = lastValues;
|
|
201
|
+
for (const dragState of activeSession.dragStates) {
|
|
202
|
+
const value = lastValues.get(dragState.key);
|
|
203
|
+
if (value === undefined) {
|
|
204
|
+
throw new Error('Expected drag value to be available');
|
|
205
|
+
}
|
|
206
|
+
if (dragState.target.propStatus.status === 'keyframed') {
|
|
207
|
+
setDragOverrides(dragState.target.nodePath, selected_outline_types_1.translateFieldKey, remotion_1.Internals.makeKeyframedDragOverride({
|
|
208
|
+
status: dragState.target.propStatus,
|
|
209
|
+
frame: dragState.sourceFrame,
|
|
210
|
+
value,
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
setDragOverrides(dragState.target.nodePath, selected_outline_types_1.translateFieldKey, remotion_1.Internals.makeStaticDragOverride(value));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}, [
|
|
218
|
+
currentSelection,
|
|
219
|
+
getCurrentFrame,
|
|
220
|
+
getDragOverrides,
|
|
221
|
+
getLatestOutlineTargetByKey,
|
|
222
|
+
getSelectableOutlines,
|
|
223
|
+
seekWithArrowKey,
|
|
224
|
+
setDragOverrides,
|
|
225
|
+
]);
|
|
226
|
+
const onArrowKeyUp = (0, react_1.useCallback)((event) => {
|
|
227
|
+
const direction = (0, selected_outline_drag_1.getSelectedOutlineKeyboardNudgeDirection)(event.key);
|
|
228
|
+
if (direction === null || keyboardNudgeSessionRef.current === null) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
saveKeyboardNudgeSession();
|
|
233
|
+
}, [saveKeyboardNudgeSession]);
|
|
234
|
+
(0, react_1.useEffect)(() => {
|
|
235
|
+
const keyDownBindings = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].map((key) => keybindings.registerKeybinding({
|
|
236
|
+
event: 'keydown',
|
|
237
|
+
key,
|
|
238
|
+
callback: onArrowKeyDown,
|
|
239
|
+
commandCtrlKey: false,
|
|
240
|
+
preventDefault: false,
|
|
241
|
+
triggerIfInputFieldFocused: false,
|
|
242
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
243
|
+
}));
|
|
244
|
+
const keyUpBindings = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].map((key) => keybindings.registerKeybinding({
|
|
245
|
+
event: 'keyup',
|
|
246
|
+
key,
|
|
247
|
+
callback: onArrowKeyUp,
|
|
248
|
+
commandCtrlKey: false,
|
|
249
|
+
preventDefault: false,
|
|
250
|
+
triggerIfInputFieldFocused: false,
|
|
251
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
252
|
+
}));
|
|
253
|
+
return () => {
|
|
254
|
+
for (const binding of [...keyDownBindings, ...keyUpBindings]) {
|
|
255
|
+
binding.unregister();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}, [keybindings, onArrowKeyDown, onArrowKeyUp]);
|
|
259
|
+
return null;
|
|
260
|
+
};
|
|
261
|
+
exports.SelectedOutlineKeyboardControls = SelectedOutlineKeyboardControls;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineCropDragChanges, getSelectedOutlineCropDragValues, getSelectedOutlineCropFollowingTransformOrigin, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginDragChanges, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineTransformOriginSnapThresholdPx, selectedOutlineUvSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineTransformOriginUv, snapSelectedOutlineUv, } from './selected-outline-drag';
|
|
2
|
+
import { orderOutlinesForRendering } from './selected-outline-order';
|
|
3
|
+
export { orderOutlinesForRendering };
|
|
4
|
+
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutline3DRotationDragValues, getSelectedOutlineActiveSchema, getSelectedOutlineCropDragChanges, getSelectedOutlineCropDragValues, getSelectedOutlineCropFollowingTransformOrigin, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginDragChanges, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineTransformOriginSnapThresholdPx, selectedOutlineUvSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineTransformOriginUv, snapSelectedOutlineUv, } from './selected-outline-drag';
|
|
5
5
|
export { getOutlineSelectionInteraction, getSelectedCropInfo, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
6
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
7
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
8
|
-
type
|
|
9
|
-
readonly
|
|
10
|
-
readonly parent: string | null;
|
|
11
|
-
};
|
|
12
|
-
export declare const orderOutlinesForRendering: ({ outlines, sequences, targetsByKey, }: {
|
|
13
|
-
readonly outlines: readonly SelectedOutline[];
|
|
14
|
-
readonly sequences: readonly OutlineSequenceParent[];
|
|
15
|
-
readonly targetsByKey: ReadonlyMap<string, SelectedOutlineTarget>;
|
|
16
|
-
}) => readonly SelectedOutline[];
|
|
17
|
-
export declare const SelectedOutlineOverlay: React.FC<{
|
|
8
|
+
type SelectedOutlineOverlayProps = {
|
|
9
|
+
readonly canvasHovered: boolean;
|
|
18
10
|
readonly compositionHeight: number;
|
|
19
11
|
readonly compositionWidth: number;
|
|
20
12
|
readonly scale: number;
|
|
21
13
|
readonly translationX: number;
|
|
22
14
|
readonly translationY: number;
|
|
23
|
-
}
|
|
15
|
+
};
|
|
16
|
+
export declare const SelectedOutlineOverlay: React.NamedExoticComponent<SelectedOutlineOverlayProps>;
|