@remotion/studio 4.0.507 → 4.0.509
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/Studio.d.ts +5 -0
- package/dist/Studio.js +2 -2
- package/dist/components/Canvas.js +35 -5
- package/dist/components/CodingAgentIcon.d.ts +3 -1
- package/dist/components/CodingAgentIcon.js +4 -9
- package/dist/components/ColorPicker/AlphaSlider.js +2 -2
- package/dist/components/ColorPicker/HueSlider.js +2 -2
- package/dist/components/ColorPicker/SaturationValueArea.js +2 -2
- package/dist/components/ConfigureDefaultEditorModal.js +1 -1
- package/dist/components/ContextMenu.d.ts +1 -0
- package/dist/components/ContextMenu.js +32 -5
- package/dist/components/EditorContent.js +4 -3
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EditorRuler/index.js +2 -2
- package/dist/components/ExplorerPanel.js +19 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -3
- package/dist/components/InspectorLocationCopy.js +1 -1
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +52 -8
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -3
- package/dist/components/InspectorPanel/styles.js +1 -1
- package/dist/components/InspectorSequenceSection.js +36 -4
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/ModalContainer.js +1 -1
- package/dist/components/Modals.js +2 -9
- package/dist/components/NewComposition/InputDragger.js +2 -2
- package/dist/components/NewComposition/NewComposition.d.ts +2 -0
- package/dist/components/NewComposition/NewComposition.js +38 -6
- package/dist/components/NewComposition/get-new-composition-defaults.d.ts +1 -1
- package/dist/components/NewComposition/get-new-composition-defaults.js +9 -1
- package/dist/components/PlayPause.d.ts +1 -1
- package/dist/components/PlayPause.js +61 -12
- 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.js +1 -1
- 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 +6 -1
- 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 +1 -1
- 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/SelectedOutlineCanvasRotation.d.ts +9 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +239 -0
- package/dist/components/SelectedOutlineCropControls.js +2 -2
- package/dist/components/SelectedOutlineElement.d.ts +2 -1
- package/dist/components/SelectedOutlineElement.js +40 -5
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +55 -26
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +6 -5
- package/dist/components/SelectedOutlineRenderer.d.ts +1 -0
- package/dist/components/SelectedOutlineRenderer.js +24 -7
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +6 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +9 -7
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +2 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +11 -7
- package/dist/components/SelectedOutlineTransformOriginHandle.js +50 -24
- package/dist/components/SelectedOutlineUvControls.js +8 -8
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -0
- package/dist/components/SettingsModalFooter.js +1 -1
- package/dist/components/Splitter/SplitterHandle.js +2 -2
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Timeline/EasingEditorModal.js +2 -2
- package/dist/components/Timeline/SequencePropsObserver.js +97 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +4 -2
- package/dist/components/Timeline/Timeline.js +55 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +99 -35
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +1 -4
- package/dist/components/Timeline/TimelineEffectPropItem.js +7 -0
- package/dist/components/Timeline/TimelineFieldRowContent.js +10 -3
- package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineLayerEye.js +2 -2
- 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 +47 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +43 -25
- package/dist/components/Timeline/TimelineSequencePropItem.js +12 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -6
- 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.js +14 -6
- package/dist/components/Timeline/keyframe-clipboard.d.ts +5 -1
- package/dist/components/Timeline/keyframe-clipboard.js +3 -2
- package/dist/components/Timeline/save-sequence-prop.js +16 -7
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +31 -0
- package/dist/components/Timeline/sequence-prop-clipboard.js +142 -0
- 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/update-selected-easing.js +8 -0
- package/dist/components/Timeline/use-open-sequence-in-apps.js +3 -1
- 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 +67 -10
- 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-keyframe-drag.js +4 -4
- 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/folder-menu-items.js +1 -0
- package/dist/components/get-open-in-menu-items.d.ts +8 -1
- package/dist/components/get-open-in-menu-items.js +93 -8
- package/dist/components/import-assets.js +7 -0
- package/dist/components/root-composition-menu-items.js +1 -0
- package/dist/components/selected-outline-control-layout.d.ts +14 -0
- package/dist/components/selected-outline-control-layout.js +94 -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 +5 -0
- package/dist/components/selected-outline-measurement.js +28 -1
- package/dist/components/selected-outline-types.d.ts +6 -0
- package/dist/components/use-default-editor-info.js +28 -3
- package/dist/esm/{chunk-ptnd65a9.js → chunk-jdn6nkbk.js} +10087 -7919
- package/dist/esm/{chunk-fgedsvhb.js → chunk-r46yxrjr.js} +1 -2
- package/dist/esm/index.mjs +357 -2
- package/dist/esm/internals.mjs +10086 -7918
- package/dist/esm/previewEntry.mjs +9926 -7758
- package/dist/esm/renderEntry.mjs +4 -2
- package/dist/helpers/get-box-quads-polyfill-internals.js +10 -2
- package/dist/helpers/get-canvas-capture-import.d.ts +7 -0
- package/dist/helpers/get-canvas-capture-import.js +43 -0
- package/dist/helpers/get-git-menu-item.d.ts +1 -1
- package/dist/helpers/get-git-menu-item.js +33 -3
- package/dist/helpers/inserted-element-selection.d.ts +12 -0
- package/dist/helpers/inserted-element-selection.js +29 -0
- package/dist/helpers/open-in-editor.d.ts +3 -1
- package/dist/helpers/open-in-editor.js +5 -1
- package/dist/helpers/pointer-session.d.ts +6 -2
- package/dist/helpers/pointer-session.js +29 -12
- 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/use-create-composition.d.ts +15 -2
- package/dist/helpers/use-create-composition.js +11 -17
- package/dist/helpers/use-menu-structure.js +1 -0
- 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/github.d.ts +4 -0
- package/dist/icons/github.js +11 -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/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +9 -1
- package/dist/state/transform-3d-mode.d.ts +10 -0
- package/dist/state/transform-3d-mode.js +27 -0
- package/dist/state/z-index.d.ts +0 -1
- package/dist/state/z-index.js +28 -37
- package/package.json +12 -12
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SelectedOutlineCanvasRotation = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const remotion_1 = require("remotion");
|
|
40
|
+
const colors_1 = require("../helpers/colors");
|
|
41
|
+
const pointer_session_1 = require("../helpers/pointer-session");
|
|
42
|
+
const editor_snapping_1 = require("../state/editor-snapping");
|
|
43
|
+
const canvas_rotation_cursor_1 = require("./canvas-rotation-cursor");
|
|
44
|
+
const ForceSpecificCursor_1 = require("./ForceSpecificCursor");
|
|
45
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
46
|
+
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
47
|
+
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
48
|
+
const selected_outline_types_1 = require("./selected-outline-types");
|
|
49
|
+
const svg_point_to_client_point_1 = require("./svg-point-to-client-point");
|
|
50
|
+
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
51
|
+
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
52
|
+
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
53
|
+
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
54
|
+
const rotationDegreesPerPixel = 0.5;
|
|
55
|
+
const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onDraggingChange, outline }) => {
|
|
56
|
+
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
57
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
58
|
+
const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
59
|
+
const onPointerDown = react_1.default.useCallback((event) => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
if (event.button !== 0) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const target = getLatestTargetByKey(layoutTarget.key);
|
|
65
|
+
const rotationDrag = (_a = target === null || target === void 0 ? void 0 : target.rotationDrag) !== null && _a !== void 0 ? _a : null;
|
|
66
|
+
if (rotationDrag === null || !(target === null || target === void 0 ? void 0 : target.selectedForRotation)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
event.stopPropagation();
|
|
71
|
+
if ((0, focus_inspector_field_1.commitPendingInspectorFields)()) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const svg = event.currentTarget.ownerSVGElement;
|
|
75
|
+
if (svg === null) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const previousSvgCursor = svg.style.cursor;
|
|
79
|
+
svg.style.cursor = canvas_rotation_cursor_1.canvasRotationCursor;
|
|
80
|
+
const startPointer = { x: event.clientX, y: event.clientY };
|
|
81
|
+
const center = (0, svg_point_to_client_point_1.svgPointToClientPoint)((0, selected_outline_measurement_1.getSelectedOutlineRotationPivot)({
|
|
82
|
+
dimensions: outline.dimensions,
|
|
83
|
+
points: (_b = outline.uncroppedPoints) !== null && _b !== void 0 ? _b : outline.points,
|
|
84
|
+
transformOriginValue: rotationDrag.transformOriginValue,
|
|
85
|
+
}), svg.getBoundingClientRect());
|
|
86
|
+
const dragStates = (0, selected_outline_drag_1.getSelectedOutlineRotationDragStates)({
|
|
87
|
+
dragTargets: [rotationDrag],
|
|
88
|
+
getDragOverrides,
|
|
89
|
+
timelinePosition: (0, imperative_state_1.getCurrentFrame)(),
|
|
90
|
+
});
|
|
91
|
+
let previousAngle = (0, selected_outline_measurement_1.getAngleDegrees)(center, startPointer);
|
|
92
|
+
let accumulatedDelta = 0;
|
|
93
|
+
let lastValues = new Map();
|
|
94
|
+
let dragStarted = false;
|
|
95
|
+
const onPointerMove = (moveEvent) => {
|
|
96
|
+
var _a;
|
|
97
|
+
var _b;
|
|
98
|
+
moveEvent.preventDefault();
|
|
99
|
+
const screenDeltaX = moveEvent.clientX - startPointer.x;
|
|
100
|
+
const screenDeltaY = moveEvent.clientY - startPointer.y;
|
|
101
|
+
if (!dragStarted) {
|
|
102
|
+
if (!(0, selected_outline_drag_1.isSelectedOutlineDragPastThreshold)({
|
|
103
|
+
deltaX: screenDeltaX,
|
|
104
|
+
deltaY: screenDeltaY,
|
|
105
|
+
})) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
dragStarted = true;
|
|
109
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)(canvas_rotation_cursor_1.canvasRotationCursor);
|
|
110
|
+
onDraggingChange(true);
|
|
111
|
+
}
|
|
112
|
+
if (rotationDrag.transform3DMode) {
|
|
113
|
+
const startRotation = (_b = (_a = dragStates[0]) === null || _a === void 0 ? void 0 : _a.startRotation) !== null && _b !== void 0 ? _b : [0, 0, 0];
|
|
114
|
+
let rotationXDeltaDegrees = -screenDeltaY * rotationDegreesPerPixel;
|
|
115
|
+
let rotationYDeltaDegrees = screenDeltaX * rotationDegreesPerPixel;
|
|
116
|
+
if (moveEvent.shiftKey && editorSnapping) {
|
|
117
|
+
rotationXDeltaDegrees =
|
|
118
|
+
Math.round((startRotation[0] + rotationXDeltaDegrees) / 15) * 15 -
|
|
119
|
+
startRotation[0];
|
|
120
|
+
rotationYDeltaDegrees =
|
|
121
|
+
Math.round((startRotation[1] + rotationYDeltaDegrees) / 15) * 15 -
|
|
122
|
+
startRotation[1];
|
|
123
|
+
}
|
|
124
|
+
lastValues = (0, selected_outline_drag_1.getSelectedOutline3DRotationDragValues)({
|
|
125
|
+
dragStates,
|
|
126
|
+
rotationXDeltaDegrees,
|
|
127
|
+
rotationYDeltaDegrees,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
const nextAngle = (0, selected_outline_measurement_1.getAngleDegrees)(center, {
|
|
132
|
+
x: moveEvent.clientX,
|
|
133
|
+
y: moveEvent.clientY,
|
|
134
|
+
});
|
|
135
|
+
accumulatedDelta += (0, selected_outline_measurement_1.getSelectedOutlineRotationDeltaDegrees)({
|
|
136
|
+
from: previousAngle,
|
|
137
|
+
to: nextAngle,
|
|
138
|
+
});
|
|
139
|
+
previousAngle = nextAngle;
|
|
140
|
+
const rotationDeltaDegrees = moveEvent.shiftKey && editorSnapping
|
|
141
|
+
? (0, selected_outline_drag_1.snapSelectedOutlineRotationDeltaDegrees)({
|
|
142
|
+
dragStates,
|
|
143
|
+
rotationDeltaDegrees: accumulatedDelta,
|
|
144
|
+
})
|
|
145
|
+
: accumulatedDelta;
|
|
146
|
+
lastValues = (0, selected_outline_drag_1.getSelectedOutlineRotationDragValues)({
|
|
147
|
+
dragStates,
|
|
148
|
+
rotationDeltaDegrees,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
for (const dragState of dragStates) {
|
|
152
|
+
const value = lastValues.get(dragState.key);
|
|
153
|
+
if (value === undefined) {
|
|
154
|
+
throw new Error('Expected rotation drag value to be available');
|
|
155
|
+
}
|
|
156
|
+
if (dragState.target.propStatus.status === 'keyframed') {
|
|
157
|
+
setDragOverrides(dragState.target.nodePath, selected_outline_types_1.rotateFieldKey, remotion_1.Internals.makeKeyframedDragOverride({
|
|
158
|
+
status: dragState.target.propStatus,
|
|
159
|
+
frame: dragState.sourceFrame,
|
|
160
|
+
value,
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
setDragOverrides(dragState.target.nodePath, selected_outline_types_1.rotateFieldKey, remotion_1.Internals.makeStaticDragOverride(value));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const onPointerUp = () => {
|
|
169
|
+
svg.style.cursor = previousSvgCursor;
|
|
170
|
+
if (dragStarted) {
|
|
171
|
+
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
172
|
+
onDraggingChange(false);
|
|
173
|
+
}
|
|
174
|
+
const changes = (0, selected_outline_drag_1.getSelectedOutlineRotationDragChanges)({
|
|
175
|
+
dragStates,
|
|
176
|
+
lastValues,
|
|
177
|
+
});
|
|
178
|
+
if (changes.length === 0) {
|
|
179
|
+
(0, selected_outline_drag_1.clearSelectedOutlineRotationDragOverrides)({
|
|
180
|
+
clearDragOverrides,
|
|
181
|
+
dragStates,
|
|
182
|
+
});
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const staticChanges = changes.filter((change) => change.type === 'static');
|
|
186
|
+
const keyframedChanges = changes.filter((change) => change.type === 'keyframed');
|
|
187
|
+
Promise.all([
|
|
188
|
+
staticChanges.length > 0
|
|
189
|
+
? (0, save_sequence_prop_1.saveSequenceProps)({
|
|
190
|
+
changes: staticChanges,
|
|
191
|
+
addedKeyframes: null,
|
|
192
|
+
movedKeyframes: null,
|
|
193
|
+
setPropStatuses,
|
|
194
|
+
clientId: rotationDrag.clientId,
|
|
195
|
+
undoLabel: 'Rotate sequence',
|
|
196
|
+
redoLabel: 'Rotate sequence back',
|
|
197
|
+
})
|
|
198
|
+
: Promise.resolve(),
|
|
199
|
+
(0, call_add_keyframe_1.callAddKeyframes)({
|
|
200
|
+
sequenceKeyframes: keyframedChanges,
|
|
201
|
+
effectKeyframes: [],
|
|
202
|
+
setPropStatuses,
|
|
203
|
+
clientId: rotationDrag.clientId,
|
|
204
|
+
}),
|
|
205
|
+
])
|
|
206
|
+
.catch((error) => {
|
|
207
|
+
(0, NotificationCenter_1.showNotification)(`Could not save sequence props: ${error instanceof Error ? error.message : String(error)}`, 4000);
|
|
208
|
+
})
|
|
209
|
+
.finally(() => {
|
|
210
|
+
(0, selected_outline_drag_1.clearSelectedOutlineRotationDragOverrides)({
|
|
211
|
+
clearDragOverrides,
|
|
212
|
+
dragStates,
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
// The polygon gates pointer-down, while the stable overlay keeps the
|
|
217
|
+
// session alive after the pointer leaves the selected item.
|
|
218
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
219
|
+
event,
|
|
220
|
+
captureTarget: svg,
|
|
221
|
+
onMove: onPointerMove,
|
|
222
|
+
onEnd: onPointerUp,
|
|
223
|
+
});
|
|
224
|
+
}, [
|
|
225
|
+
clearDragOverrides,
|
|
226
|
+
editorSnapping,
|
|
227
|
+
getDragOverrides,
|
|
228
|
+
getLatestTargetByKey,
|
|
229
|
+
layoutTarget.key,
|
|
230
|
+
onDraggingChange,
|
|
231
|
+
outline.dimensions,
|
|
232
|
+
outline.points,
|
|
233
|
+
outline.uncroppedPoints,
|
|
234
|
+
setDragOverrides,
|
|
235
|
+
setPropStatuses,
|
|
236
|
+
]);
|
|
237
|
+
return (jsx_runtime_1.jsx("polygon", { points: outline.points.map((point) => `${point.x},${point.y}`).join(' '), fill: colors_1.TRANSPARENT, pointerEvents: "all", cursor: canvas_rotation_cursor_1.canvasRotationCursor, onPointerDown: onPointerDown, "data-remotion-studio-canvas-rotation": true }));
|
|
238
|
+
};
|
|
239
|
+
exports.SelectedOutlineCanvasRotation = SelectedOutlineCanvasRotation;
|
|
@@ -268,9 +268,9 @@ const CropHandle = ({ handle, outline, onDraggingChange, target }) => {
|
|
|
268
268
|
clearDragOverrides(cropDrag.nodePath);
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
-
(0, pointer_session_1.
|
|
271
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
272
272
|
event,
|
|
273
|
-
|
|
273
|
+
captureTarget: event.currentTarget,
|
|
274
274
|
onMove: onPointerMove,
|
|
275
275
|
onEnd: onPointerUp,
|
|
276
276
|
});
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { SelectedOutline } from './selected-outline-geometry';
|
|
3
3
|
import { type SelectedOutlineSnapPoint } from './selected-outline-snap';
|
|
4
4
|
import { type SelectedOutlineDragTarget, type SelectedOutlineLayoutTarget, type SelectedOutlineRotationDragTarget, type SelectedOutlineScaleDragTarget, type SelectedOutlineTarget } from './selected-outline-types';
|
|
5
|
-
import type
|
|
5
|
+
import { type TimelineSelection, type TimelineSelectionInteraction } from './Timeline/TimelineSelection';
|
|
6
6
|
type SelectedOutlineElementProps = {
|
|
7
7
|
readonly compositionHeight: number;
|
|
8
8
|
readonly compositionWidth: number;
|
|
@@ -15,6 +15,7 @@ type SelectedOutlineElementProps = {
|
|
|
15
15
|
readonly layoutTarget: SelectedOutlineLayoutTarget | undefined;
|
|
16
16
|
readonly outline: SelectedOutline;
|
|
17
17
|
readonly onDraggingChange: (dragging: boolean) => void;
|
|
18
|
+
readonly onContextMenuOpenChange: (open: boolean) => void;
|
|
18
19
|
readonly onSnapPointsChange: (snapPoints: readonly SelectedOutlineSnapPoint[]) => void;
|
|
19
20
|
readonly onSelect: (item: TimelineSelection, interaction: TimelineSelectionInteraction) => void;
|
|
20
21
|
readonly scale: number;
|
|
@@ -45,11 +45,14 @@ const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
|
45
45
|
const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
46
46
|
const modals_1 = require("../state/modals");
|
|
47
47
|
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
48
|
+
const transform_3d_mode_1 = require("../state/transform-3d-mode");
|
|
48
49
|
const call_api_1 = require("./call-api");
|
|
49
50
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
50
51
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
51
52
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
53
|
+
const selected_outline_control_layout_1 = require("./selected-outline-control-layout");
|
|
52
54
|
const selected_outline_types_1 = require("./selected-outline-types");
|
|
55
|
+
const SelectedOutlineCanvasRotation_1 = require("./SelectedOutlineCanvasRotation");
|
|
53
56
|
const SelectedOutlineCropControls_1 = require("./SelectedOutlineCropControls");
|
|
54
57
|
const SelectedOutlinePolygon_1 = require("./SelectedOutlinePolygon");
|
|
55
58
|
const SelectedOutlineRotationCornerHandle_1 = require("./SelectedOutlineRotationCornerHandle");
|
|
@@ -58,10 +61,11 @@ const disable_sequence_interactivity_1 = require("./Timeline/disable-sequence-in
|
|
|
58
61
|
const duplicate_selected_timeline_item_1 = require("./Timeline/duplicate-selected-timeline-item");
|
|
59
62
|
const get_sequence_context_menu_items_1 = require("./Timeline/get-sequence-context-menu-items");
|
|
60
63
|
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
64
|
+
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
61
65
|
const get_stack_1 = require("./Timeline/TimelineStack/get-stack");
|
|
62
66
|
const use_default_editor_info_1 = require("./use-default-editor-info");
|
|
63
67
|
const use_select_asset_1 = require("./use-select-asset");
|
|
64
|
-
const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth, dragging, getAllDragOutlines, getAllDragTargets, getAllRotationDragTargets, getAllScaleDragTargets, getLatestTargetByKey, layoutTarget, outline, onDraggingChange, onSnapPointsChange, onSelect, scale, }) => {
|
|
68
|
+
const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth, dragging, getAllDragOutlines, getAllDragTargets, getAllRotationDragTargets, getAllScaleDragTargets, getLatestTargetByKey, layoutTarget, outline, onDraggingChange, onContextMenuOpenChange, onSnapPointsChange, onSelect, scale, }) => {
|
|
65
69
|
var _a;
|
|
66
70
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
67
71
|
const canConfigureApps = (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected');
|
|
@@ -74,8 +78,10 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
74
78
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
75
79
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
76
80
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
81
|
+
const { setManuallyEnabled } = (0, react_1.useContext)(transform_3d_mode_1.Transform3DModeStateContext);
|
|
77
82
|
const setHoveredSequence = (0, timeline_sequence_hover_1.useSetTimelineSequenceHover)();
|
|
78
83
|
const targetRef = (0, react_1.useRef)(layoutTarget);
|
|
84
|
+
const controlLayout = (0, react_1.useMemo)(() => (0, selected_outline_control_layout_1.getSelectedOutlineControlLayout)(outline.points), [outline.points]);
|
|
79
85
|
(0, react_1.useLayoutEffect)(() => {
|
|
80
86
|
targetRef.current = layoutTarget;
|
|
81
87
|
}, [layoutTarget]);
|
|
@@ -190,6 +196,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
190
196
|
!sourceEditDisabled &&
|
|
191
197
|
previewServerState.type === 'connected';
|
|
192
198
|
const canCrop = contextMenuTarget.canCrop && !sourceEditDisabled;
|
|
199
|
+
const canRotate = !sourceEditDisabled;
|
|
193
200
|
return (0, get_sequence_context_menu_items_1.getSequenceContextMenuItems)({
|
|
194
201
|
assetLinkInfo,
|
|
195
202
|
canOpenInEditor,
|
|
@@ -337,9 +344,34 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
337
344
|
subMenu: null,
|
|
338
345
|
value: 'crop',
|
|
339
346
|
},
|
|
347
|
+
{
|
|
348
|
+
type: 'item',
|
|
349
|
+
id: 'rotate',
|
|
350
|
+
keyHint: null,
|
|
351
|
+
label: isProgrammaticallyDuplicated ? 'Rotate all' : 'Rotate',
|
|
352
|
+
leftItem: null,
|
|
353
|
+
disabled: !canRotate,
|
|
354
|
+
onClick: () => {
|
|
355
|
+
if (!canRotate) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
setManuallyEnabled((0, TimelineSelection_1.getTimelineSequenceSelectionKey)(contextMenuTarget.nodePathInfo), true);
|
|
359
|
+
onSelect({
|
|
360
|
+
type: 'sequence-prop',
|
|
361
|
+
nodePathInfo: {
|
|
362
|
+
...contextMenuTarget.nodePathInfo,
|
|
363
|
+
auxiliaryKeys: ['controls', selected_outline_types_1.rotateFieldKey],
|
|
364
|
+
},
|
|
365
|
+
key: selected_outline_types_1.rotateFieldKey,
|
|
366
|
+
}, { shiftKey: false, toggleKey: false });
|
|
367
|
+
},
|
|
368
|
+
quickSwitcherLabel: null,
|
|
369
|
+
subMenu: null,
|
|
370
|
+
value: 'rotate',
|
|
371
|
+
},
|
|
340
372
|
{
|
|
341
373
|
type: 'divider',
|
|
342
|
-
id: '
|
|
374
|
+
id: 'rotate-divider',
|
|
343
375
|
},
|
|
344
376
|
]
|
|
345
377
|
: [],
|
|
@@ -353,17 +385,20 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
353
385
|
onSelect,
|
|
354
386
|
previewServerState,
|
|
355
387
|
resolveOriginalLocation,
|
|
388
|
+
setManuallyEnabled,
|
|
356
389
|
selectAsset,
|
|
357
390
|
setSelectedModal,
|
|
358
391
|
setPropStatuses,
|
|
359
392
|
]);
|
|
360
393
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
361
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
394
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline })) : null, jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
362
395
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
363
|
-
?
|
|
396
|
+
? controlLayout.scaleEdges.map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine_1.SelectedOutlineScaleEdgeLine, { getAllScaleDragTargets: getAllScaleDragTargets, dragging: dragging, edge: edge, hitWidth: edge === 'top' || edge === 'bottom'
|
|
397
|
+
? controlLayout.scaleHitWidth.horizontal
|
|
398
|
+
: controlLayout.scaleHitWidth.vertical, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: controlTarget }, edge)))
|
|
364
399
|
: null, (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
365
400
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
366
|
-
?
|
|
401
|
+
? controlLayout.rotationCorners.map(({ corner, point }) => (jsx_runtime_1.jsx(SelectedOutlineRotationCornerHandle_1.SelectedOutlineRotationCornerHandle, { getAllRotationDragTargets: getAllRotationDragTargets, corner: corner, dragging: dragging, handlePoint: point, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, radius: controlLayout.rotationHandleRadius, target: controlTarget }, corner)))
|
|
367
402
|
: null] }));
|
|
368
403
|
};
|
|
369
404
|
exports.SelectedOutlineElement = react_1.default.memo(SelectedOutlineElementUnmemoized);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { orderOutlinesForRendering } from './selected-outline-order';
|
|
3
3
|
export { orderOutlinesForRendering };
|
|
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';
|
|
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';
|
|
@@ -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.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 = exports.orderOutlinesForRendering = void 0;
|
|
36
|
+
exports.SelectedOutlineOverlay = 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.getSelectedOutline3DRotationDragValues = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = exports.orderOutlinesForRendering = 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"));
|
|
@@ -47,6 +47,7 @@ const use_runtime_values_1 = require("../helpers/use-runtime-values");
|
|
|
47
47
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
48
48
|
const scale_lock_1 = require("../state/scale-lock");
|
|
49
49
|
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
50
|
+
const transform_3d_mode_1 = require("../state/transform-3d-mode");
|
|
50
51
|
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
51
52
|
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
52
53
|
const selected_outline_order_1 = require("./selected-outline-order");
|
|
@@ -55,10 +56,12 @@ const selected_outline_types_1 = require("./selected-outline-types");
|
|
|
55
56
|
const SelectedOutlineKeyboardControls_1 = require("./SelectedOutlineKeyboardControls");
|
|
56
57
|
const SelectedOutlineRenderer_1 = require("./SelectedOutlineRenderer");
|
|
57
58
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
59
|
+
const transform_3d_mode_2 = require("./Timeline/transform-3d-mode");
|
|
58
60
|
const selected_outline_drag_2 = require("./selected-outline-drag");
|
|
59
61
|
Object.defineProperty(exports, "applySelectedOutlineDragAxisLock", { enumerable: true, get: function () { return selected_outline_drag_2.applySelectedOutlineDragAxisLock; } });
|
|
60
62
|
Object.defineProperty(exports, "applySelectedOutlineTransformOriginAxisLock", { enumerable: true, get: function () { return selected_outline_drag_2.applySelectedOutlineTransformOriginAxisLock; } });
|
|
61
63
|
Object.defineProperty(exports, "compensateTranslateForTransformOrigin", { enumerable: true, get: function () { return selected_outline_drag_2.compensateTranslateForTransformOrigin; } });
|
|
64
|
+
Object.defineProperty(exports, "getSelectedOutline3DRotationDragValues", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutline3DRotationDragValues; } });
|
|
62
65
|
Object.defineProperty(exports, "getSelectedOutlineActiveSchema", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineActiveSchema; } });
|
|
63
66
|
Object.defineProperty(exports, "getSelectedOutlineCropDragChanges", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineCropDragChanges; } });
|
|
64
67
|
Object.defineProperty(exports, "getSelectedOutlineCropDragValues", { enumerable: true, get: function () { return selected_outline_drag_2.getSelectedOutlineCropDragValues; } });
|
|
@@ -138,7 +141,7 @@ const getCropDragFields = ({ activeSchema, cropValues, propStatuses, }) => {
|
|
|
138
141
|
}
|
|
139
142
|
return fields;
|
|
140
143
|
};
|
|
141
|
-
const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDragOverrides, getScaleLockState, isFullscreen, mode, previewSelectionAvailable, propStatuses, runtimeValuesByStore, selectableOutlines, selectedCropInfo, selectedEffectsBySequenceKey, selectedSequenceKeys, selectedTransformOriginInfo, sequenceKeysContainingSelection, studioInteractivityEnabled, targetKey, targetTimelinePosition, }) => {
|
|
144
|
+
const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDragOverrides, getScaleLockState, isFullscreen, manuallyEnabled3DTransformSequenceKeys, mode, previewSelectionAvailable, propStatuses, runtimeValuesByStore, selectableOutlines, selectedCropInfo, selectedEffectsBySequenceKey, selectedRotationInfo, selectedSequenceKeys, selectedTransformOriginInfo, sequenceKeysContainingSelection, studioInteractivityEnabled, targetKey, targetTimelinePosition, }) => {
|
|
142
145
|
if (isFullscreen ||
|
|
143
146
|
!(0, interactivity_enabled_1.isStudioSelectionEnabled)() ||
|
|
144
147
|
!previewSelectionAvailable ||
|
|
@@ -229,7 +232,27 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
229
232
|
const crop = remotion_1.Internals.resolveSequenceCrop(cropValues);
|
|
230
233
|
const selectedForTransformOrigin = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.sequenceKey) === key;
|
|
231
234
|
const selectedForCrop = (selectedCropInfo === null || selectedCropInfo === void 0 ? void 0 : selectedCropInfo.sequenceKey) === key;
|
|
235
|
+
const selectedForRotation = (selectedRotationInfo === null || selectedRotationInfo === void 0 ? void 0 : selectedRotationInfo.sequenceKey) === key;
|
|
232
236
|
const selectedForUvHandles = selectedEffectsBySequenceKey.has(key);
|
|
237
|
+
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
|
|
238
|
+
const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
239
|
+
const scaleFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.scaleFieldKey];
|
|
240
|
+
const scalePropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.scaleFieldKey];
|
|
241
|
+
const rotationFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.rotateFieldKey];
|
|
242
|
+
const rotationPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.rotateFieldKey];
|
|
243
|
+
const transformOriginFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.transformOriginFieldKey];
|
|
244
|
+
const transformOriginPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.transformOriginFieldKey];
|
|
245
|
+
const transformOriginValueForRotation = (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
|
|
246
|
+
((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
|
|
247
|
+
(transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed')
|
|
248
|
+
? String((_c = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
249
|
+
propStatus: transformOriginPropStatus,
|
|
250
|
+
dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
|
|
251
|
+
defaultValue: transformOriginFieldSchema.default,
|
|
252
|
+
frame: sourceFrame,
|
|
253
|
+
shouldResortToDefaultValueIfUndefined: true,
|
|
254
|
+
})) !== null && _c !== void 0 ? _c : transformOriginFieldSchema.default)
|
|
255
|
+
: '50% 50%';
|
|
233
256
|
const layoutTarget = {
|
|
234
257
|
key,
|
|
235
258
|
containsSelection,
|
|
@@ -239,9 +262,11 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
239
262
|
ref: sequence.refForOutline,
|
|
240
263
|
selected,
|
|
241
264
|
selectedForCrop,
|
|
265
|
+
selectedForRotation,
|
|
242
266
|
selectedForTransformOrigin,
|
|
243
267
|
selectedForUvHandles,
|
|
244
268
|
showSelectedOutline,
|
|
269
|
+
transformOriginValue: transformOriginValueForRotation,
|
|
245
270
|
selection: {
|
|
246
271
|
type: 'sequence',
|
|
247
272
|
nodePathInfo: selectionNodePathInfo,
|
|
@@ -256,25 +281,6 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
256
281
|
cropValues,
|
|
257
282
|
propStatuses: nodePropStatuses,
|
|
258
283
|
});
|
|
259
|
-
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
|
|
260
|
-
const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
261
|
-
const scaleFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.scaleFieldKey];
|
|
262
|
-
const scalePropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.scaleFieldKey];
|
|
263
|
-
const rotationFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.rotateFieldKey];
|
|
264
|
-
const rotationPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.rotateFieldKey];
|
|
265
|
-
const transformOriginFieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.transformOriginFieldKey];
|
|
266
|
-
const transformOriginPropStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.transformOriginFieldKey];
|
|
267
|
-
const transformOriginValueForRotation = (transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
|
|
268
|
-
((transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'static' ||
|
|
269
|
-
(transformOriginPropStatus === null || transformOriginPropStatus === void 0 ? void 0 : transformOriginPropStatus.status) === 'keyframed')
|
|
270
|
-
? String((_c = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
271
|
-
propStatus: transformOriginPropStatus,
|
|
272
|
-
dragOverrideValue: dragOverrides[selected_outline_types_1.transformOriginFieldKey],
|
|
273
|
-
defaultValue: transformOriginFieldSchema.default,
|
|
274
|
-
frame: sourceFrame,
|
|
275
|
-
shouldResortToDefaultValueIfUndefined: true,
|
|
276
|
-
})) !== null && _c !== void 0 ? _c : transformOriginFieldSchema.default)
|
|
277
|
-
: '50% 50%';
|
|
278
284
|
const canDragStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
|
|
279
285
|
((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
|
|
280
286
|
propStatus.interpolationFunction === 'interpolate');
|
|
@@ -296,6 +302,17 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
296
302
|
controls !== null &&
|
|
297
303
|
(rotationFieldSchema === null || rotationFieldSchema === void 0 ? void 0 : rotationFieldSchema.type) === 'rotation-css' &&
|
|
298
304
|
canRotationDragStatus;
|
|
305
|
+
const transform3DMode = manuallyEnabled3DTransformSequenceKeys.has(key) ||
|
|
306
|
+
[
|
|
307
|
+
'style.translate',
|
|
308
|
+
'style.scale',
|
|
309
|
+
'style.rotate',
|
|
310
|
+
'style.transformOrigin',
|
|
311
|
+
].some((fieldKey) => (0, transform_3d_mode_2.propStatusHas3DTransformValue)({
|
|
312
|
+
fieldKey,
|
|
313
|
+
propStatus: nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[fieldKey],
|
|
314
|
+
runtimeValue: runtimeValues[fieldKey],
|
|
315
|
+
}));
|
|
299
316
|
const transformOriginSourceFrame = (selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === null ||
|
|
300
317
|
(selectedTransformOriginInfo === null || selectedTransformOriginInfo === void 0 ? void 0 : selectedTransformOriginInfo.displayFrame) === undefined
|
|
301
318
|
? sourceFrame
|
|
@@ -307,7 +324,7 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
307
324
|
((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
|
|
308
325
|
propStatus.interpolationFunction === 'interpolate');
|
|
309
326
|
const canTransformOriginDrag = previewInteractive &&
|
|
310
|
-
selectedForTransformOrigin &&
|
|
327
|
+
(selectedForTransformOrigin || selectedForRotation) &&
|
|
311
328
|
controls !== null &&
|
|
312
329
|
(transformOriginFieldSchema === null || transformOriginFieldSchema === void 0 ? void 0 : transformOriginFieldSchema.type) === 'transform-origin' &&
|
|
313
330
|
(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
|
|
@@ -387,6 +404,7 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
387
404
|
keyframeDisplayOffset,
|
|
388
405
|
nodePath,
|
|
389
406
|
schema: controls.schema,
|
|
407
|
+
transform3DMode,
|
|
390
408
|
transformOriginValue: transformOriginValueForRotation,
|
|
391
409
|
}
|
|
392
410
|
: null,
|
|
@@ -445,7 +463,7 @@ const calculateOutlineTargets = ({ connectedClientId, editorShowOutlines, getDra
|
|
|
445
463
|
];
|
|
446
464
|
});
|
|
447
465
|
};
|
|
448
|
-
const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurrentState, compositionHeight, compositionWidth, draggingOutline, getLatestOutlineTargetByKey, getSelectableOutlines, onDraggingChange, onSelect, scale, selectedSequenceKeys, sequenceKeysContainingSelection, sequences, translationX, translationY, }) => {
|
|
466
|
+
const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurrentState, compositionHeight, compositionWidth, draggingOutline, getLatestOutlineTargetByKey, getSelectableOutlines, onDraggingChange, onContextMenuOpenChange, onSelect, scale, selectedSequenceKeys, sequenceKeysContainingSelection, sequences, translationX, translationY, }) => {
|
|
449
467
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
450
468
|
const updateOutlinesRef = (0, react_1.useRef)(() => undefined);
|
|
451
469
|
const selectableOutlines = (0, react_1.useMemo)(() => {
|
|
@@ -487,7 +505,7 @@ const ActiveSelectedOutlineOverlayUnmemoized = ({ calculateOutlineTargetsForCurr
|
|
|
487
505
|
outlineTargetsRef.current = outlineTargets;
|
|
488
506
|
updateOutlinesRef.current();
|
|
489
507
|
}, [outlineTargets, scale, translationX, translationY]);
|
|
490
|
-
return (jsx_runtime_1.jsx(SelectedOutlineRenderer_1.SelectedOutlineRenderer, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: draggingOutline, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getOutlineTargets: getOutlineTargets, onDraggingChange: onDraggingChange, onSelect: onSelect, scale: scale, sequences: sequences, updateOutlinesRef: updateOutlinesRef }));
|
|
508
|
+
return (jsx_runtime_1.jsx(SelectedOutlineRenderer_1.SelectedOutlineRenderer, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: draggingOutline, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getOutlineTargets: getOutlineTargets, onDraggingChange: onDraggingChange, onContextMenuOpenChange: onContextMenuOpenChange, onSelect: onSelect, scale: scale, sequences: sequences, updateOutlinesRef: updateOutlinesRef }));
|
|
491
509
|
};
|
|
492
510
|
const ActiveSelectedOutlineOverlay = react_1.default.memo(ActiveSelectedOutlineOverlayUnmemoized);
|
|
493
511
|
const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, compositionWidth, scale, translationX, translationY, }) => {
|
|
@@ -499,17 +517,20 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
499
517
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
500
518
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
501
519
|
const { getScaleLockState } = (0, react_1.useContext)(scale_lock_1.ScaleLockContext);
|
|
520
|
+
const { manuallyEnabledSequenceKeys } = (0, react_1.useContext)(transform_3d_mode_1.Transform3DModeStateContext);
|
|
502
521
|
const { editorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
503
522
|
const setHoveredSequence = (0, timeline_sequence_hover_1.useSetTimelineSequenceHover)();
|
|
504
523
|
const hoveredSequence = (0, timeline_sequence_hover_1.useTimelineSequenceHoverState)();
|
|
505
524
|
const isFullscreen = (0, use_is_fullscreen_1.useIsFullscreen)();
|
|
506
525
|
const { getCurrentFrame } = player_1.PlayerInternals.usePlayerMethods();
|
|
507
526
|
const [draggingOutline, setDraggingOutline] = (0, react_1.useState)(false);
|
|
527
|
+
const [canvasContextMenuOpen, setCanvasContextMenuOpen] = (0, react_1.useState)(false);
|
|
508
528
|
const previewSelectionAvailable = previewServerState.type === 'connected' || window.remotion_isReadOnlyStudio;
|
|
509
529
|
const selectedSequenceKeys = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems), [selectedItems]);
|
|
510
530
|
const sequenceKeysContainingSelection = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSequenceKeysContainingSelection)(selectedItems), [selectedItems]);
|
|
511
531
|
const selectedEffectsBySequenceKey = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedEffectFieldsBySequenceKey)(selectedItems), [selectedItems]);
|
|
512
532
|
const selectedTransformOriginInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedTransformOriginInfo)(selectedItems), [selectedItems]);
|
|
533
|
+
const selectedRotationInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedRotationInfo)(selectedItems), [selectedItems]);
|
|
513
534
|
const selectedCropInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedCropInfo)(selectedItems), [selectedItems]);
|
|
514
535
|
const getSelectableOutlines = (0, react_1.useCallback)((timelinePosition) => {
|
|
515
536
|
if (isFullscreen ||
|
|
@@ -541,10 +562,12 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
541
562
|
getDragOverrides,
|
|
542
563
|
getScaleLockState,
|
|
543
564
|
isFullscreen,
|
|
565
|
+
manuallyEnabled3DTransformSequenceKeys: manuallyEnabledSequenceKeys,
|
|
544
566
|
previewSelectionAvailable,
|
|
545
567
|
propStatuses,
|
|
546
568
|
selectedCropInfo,
|
|
547
569
|
selectedEffectsBySequenceKey,
|
|
570
|
+
selectedRotationInfo,
|
|
548
571
|
selectedSequenceKeys,
|
|
549
572
|
selectedTransformOriginInfo,
|
|
550
573
|
sequenceKeysContainingSelection,
|
|
@@ -554,11 +577,13 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
554
577
|
getDragOverrides,
|
|
555
578
|
getScaleLockState,
|
|
556
579
|
isFullscreen,
|
|
580
|
+
manuallyEnabledSequenceKeys,
|
|
557
581
|
previewSelectionAvailable,
|
|
558
582
|
previewServerState,
|
|
559
583
|
propStatuses,
|
|
560
584
|
selectedCropInfo,
|
|
561
585
|
selectedEffectsBySequenceKey,
|
|
586
|
+
selectedRotationInfo,
|
|
562
587
|
selectedSequenceKeys,
|
|
563
588
|
selectedTransformOriginInfo,
|
|
564
589
|
sequenceKeysContainingSelection,
|
|
@@ -606,7 +631,11 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
606
631
|
const selectOutlineItem = (0, react_1.useCallback)((item, interaction) => {
|
|
607
632
|
selectItem(item, interaction, undefined, { reveal: true });
|
|
608
633
|
}, [selectItem]);
|
|
609
|
-
const measurementActive = canvasHovered ||
|
|
634
|
+
const measurementActive = canvasHovered ||
|
|
635
|
+
draggingOutline ||
|
|
636
|
+
canvasContextMenuOpen ||
|
|
637
|
+
sequenceKeysContainingSelection.size > 0 ||
|
|
638
|
+
(hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'timeline';
|
|
610
639
|
(0, react_1.useLayoutEffect)(() => {
|
|
611
640
|
if (measurementActive) {
|
|
612
641
|
return;
|
|
@@ -614,6 +643,6 @@ const SelectedOutlineOverlayUnmemoized = ({ canvasHovered, compositionHeight, co
|
|
|
614
643
|
setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
|
|
615
644
|
}, [measurementActive, setHoveredSequence]);
|
|
616
645
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
617
|
-
jsx_runtime_1.jsx(SelectedOutlineKeyboardControls_1.SelectedOutlineKeyboardControls, { getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getSelectableOutlines: getCurrentSelectableOutlines }), measurementActive ? (jsx_runtime_1.jsx(ActiveSelectedOutlineOverlay, { calculateOutlineTargetsForCurrentState: calculateOutlineTargetsForCurrentState, compositionHeight: compositionHeight, compositionWidth: compositionWidth, draggingOutline: draggingOutline, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getSelectableOutlines: getSelectableOutlines, onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, scale: scale, selectedSequenceKeys: selectedSequenceKeys, sequenceKeysContainingSelection: sequenceKeysContainingSelection, sequences: sequences, translationX: translationX, translationY: translationY })) : null] }));
|
|
646
|
+
jsx_runtime_1.jsx(SelectedOutlineKeyboardControls_1.SelectedOutlineKeyboardControls, { getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getSelectableOutlines: getCurrentSelectableOutlines }), measurementActive ? (jsx_runtime_1.jsx(ActiveSelectedOutlineOverlay, { calculateOutlineTargetsForCurrentState: calculateOutlineTargetsForCurrentState, compositionHeight: compositionHeight, compositionWidth: compositionWidth, draggingOutline: draggingOutline, getLatestOutlineTargetByKey: getLatestOutlineTargetByKey, getSelectableOutlines: getSelectableOutlines, onDraggingChange: onDraggingChange, onContextMenuOpenChange: setCanvasContextMenuOpen, onSelect: selectOutlineItem, scale: scale, selectedSequenceKeys: selectedSequenceKeys, sequenceKeysContainingSelection: sequenceKeysContainingSelection, sequences: sequences, translationX: translationX, translationY: translationY })) : null] }));
|
|
618
647
|
};
|
|
619
648
|
exports.SelectedOutlineOverlay = react_1.default.memo(SelectedOutlineOverlayUnmemoized);
|