@remotion/studio 4.0.498 → 4.0.500
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/components/AssetSelector.js +8 -6
- package/dist/components/AssetSelectorItem.d.ts +24 -0
- package/dist/components/AssetSelectorItem.js +144 -83
- package/dist/components/Canvas.js +162 -7
- package/dist/components/CompositionSelector.js +15 -42
- package/dist/components/CompositionSelectorItem.js +21 -13
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorRuler/Ruler.js +5 -3
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/ForceSpecificCursor.js +13 -1
- package/dist/components/GlobalKeybindings.js +7 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +8 -7
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -7
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorSequenceSection.js +43 -19
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +8 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +34 -0
- package/dist/components/NewComposition/InputDragger.js +262 -23
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +44 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +76 -12
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +83 -43
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +130 -8
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Splitter/SplitterContainer.d.ts +2 -0
- package/dist/components/Splitter/SplitterContainer.js +5 -1
- package/dist/components/Splitter/SplitterContext.d.ts +2 -0
- package/dist/components/Splitter/SplitterContext.js +2 -0
- package/dist/components/Splitter/SplitterElement.js +6 -1
- package/dist/components/Splitter/SplitterHandle.js +27 -2
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +52 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +25 -1
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineLayerEye.js +4 -1
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +7 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -5
- package/dist/components/Timeline/TimelineSelection.js +8 -6
- package/dist/components/Timeline/TimelineSequence.js +7 -6
- package/dist/components/Timeline/TimelineSequenceItem.js +57 -10
- package/dist/components/Timeline/TimelineSequenceName.js +1 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +27 -75
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +29 -12
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +18 -10
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +6 -4
- package/dist/components/TopPanel.js +3 -2
- package/dist/components/UndoRedoButtons.js +27 -5
- package/dist/components/composition-drop-preview.d.ts +33 -0
- package/dist/components/composition-drop-preview.js +68 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +27 -60
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +7 -55
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +5 -17
- package/dist/components/handle-drop.js +0 -1
- package/dist/components/import-assets.d.ts +7 -8
- package/dist/components/import-assets.js +2 -9
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-7a6q9hk2.js → chunk-dr1y1vm3.js} +11851 -9494
- package/dist/esm/internals.mjs +11851 -9494
- package/dist/esm/previewEntry.mjs +55150 -52795
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/get-effective-translation.d.ts +13 -1
- package/dist/helpers/get-effective-translation.js +12 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +15 -1
- package/dist/helpers/ruler-canvas-size.d.ts +7 -0
- package/dist/helpers/ruler-canvas-size.js +14 -1
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-image-metadata.d.ts +1 -0
- package/dist/helpers/use-image-metadata.js +8 -5
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-media-metadata.d.ts +1 -0
- package/dist/helpers/use-media-metadata.js +8 -5
- package/dist/helpers/use-menu-structure.js +10 -1
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/state/modals.d.ts +5 -0
- package/package.json +13 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CanUpdateSequencePropStatus, DragOverrideValue, GetDragOverrides,
|
|
1
|
+
import type { CanUpdateSequencePropStatus, DragOverrideValue, GetDragOverrides, InteractivitySchema, SequencePropsSubscriptionKey } from 'remotion';
|
|
2
2
|
import { type OutlinePoint } from './selected-outline-geometry';
|
|
3
|
-
import type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineRotationDragTarget, SelectedOutlineScaleDragState, SelectedOutlineScaleDragTarget,
|
|
3
|
+
import type { SelectedOutlineCropDragTarget, SelectedOutlineCropFieldKey, SelectedOutlineCropHandle, SelectedOutlineDragState, SelectedOutlineDragTarget, SelectedOutlineRotationDragState, SelectedOutlineRotationDragTarget, SelectedOutlineScaleDragState, SelectedOutlineScaleDragTarget, SelectedOutlineTransformOriginDragTarget } from './selected-outline-types';
|
|
4
4
|
import { type UvCoordinate } from './selected-outline-uv';
|
|
5
5
|
import type { AddSequenceKeyframeChange } from './Timeline/call-add-keyframe';
|
|
6
6
|
import type { SaveSequencePropChange } from './Timeline/save-sequence-prop';
|
|
@@ -51,6 +51,37 @@ export declare const getSelectedOutlineDragChanges: ({ dragStates, lastValues, }
|
|
|
51
51
|
readonly dragStates: readonly SelectedOutlineDragState[];
|
|
52
52
|
readonly lastValues: ReadonlyMap<string, string>;
|
|
53
53
|
}) => SelectedOutlineDragChange[];
|
|
54
|
+
export type SelectedOutlineCropValues = Record<SelectedOutlineCropFieldKey, number>;
|
|
55
|
+
export declare const getSelectedOutlineCropFollowingTransformOrigin: ({ dimensions, initialCrop, nextCrop, transformOrigin, }: {
|
|
56
|
+
readonly dimensions: {
|
|
57
|
+
readonly width: number;
|
|
58
|
+
readonly height: number;
|
|
59
|
+
} | null;
|
|
60
|
+
readonly initialCrop: SelectedOutlineCropValues;
|
|
61
|
+
readonly nextCrop: SelectedOutlineCropValues;
|
|
62
|
+
readonly transformOrigin: {
|
|
63
|
+
readonly defaultValue: string | undefined;
|
|
64
|
+
readonly propStatus: CanUpdateSequencePropStatus;
|
|
65
|
+
readonly value: string;
|
|
66
|
+
} | null;
|
|
67
|
+
}) => string | null;
|
|
68
|
+
export declare const getSelectedOutlineCropDragValues: ({ crop, dimensions, handle, uv, }: {
|
|
69
|
+
readonly crop: SelectedOutlineCropValues;
|
|
70
|
+
readonly dimensions: {
|
|
71
|
+
readonly width: number;
|
|
72
|
+
readonly height: number;
|
|
73
|
+
} | null;
|
|
74
|
+
readonly handle: SelectedOutlineCropHandle;
|
|
75
|
+
readonly uv: readonly [number, number];
|
|
76
|
+
}) => SelectedOutlineCropValues;
|
|
77
|
+
export declare const getSelectedOutlineCropDragChanges: ({ dimensions, target, values, }: {
|
|
78
|
+
readonly dimensions: {
|
|
79
|
+
readonly width: number;
|
|
80
|
+
readonly height: number;
|
|
81
|
+
} | null;
|
|
82
|
+
readonly target: SelectedOutlineCropDragTarget;
|
|
83
|
+
readonly values: SelectedOutlineCropValues;
|
|
84
|
+
}) => SelectedOutlineDragChange[];
|
|
54
85
|
export type SelectedOutlineKeyboardNudgeDirection = 'left' | 'right' | 'up' | 'down';
|
|
55
86
|
export declare const getSelectedOutlineKeyboardNudgeDelta: ({ direction, shiftKey, }: {
|
|
56
87
|
readonly direction: SelectedOutlineKeyboardNudgeDirection;
|
|
@@ -160,10 +191,16 @@ export declare const snapSelectedOutlineUv: ({ point, points, thresholdPx, uv, }
|
|
|
160
191
|
readonly uv: UvCoordinate;
|
|
161
192
|
}) => UvCoordinate;
|
|
162
193
|
export declare const selectedOutlineTransformOriginSnapThresholdPx = 10;
|
|
163
|
-
export declare const snapSelectedOutlineTransformOriginUv: ({ point, points, thresholdPx, uv, }: {
|
|
194
|
+
export declare const snapSelectedOutlineTransformOriginUv: ({ crop, point, points, thresholdPx, uv, }: {
|
|
195
|
+
readonly crop: {
|
|
196
|
+
readonly left: number;
|
|
197
|
+
readonly right: number;
|
|
198
|
+
readonly top: number;
|
|
199
|
+
readonly bottom: number;
|
|
200
|
+
} | null;
|
|
164
201
|
readonly point: OutlinePoint;
|
|
165
202
|
readonly points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
|
|
166
|
-
readonly thresholdPx
|
|
203
|
+
readonly thresholdPx: number | null;
|
|
167
204
|
readonly uv: UvCoordinate;
|
|
168
205
|
}) => UvCoordinate;
|
|
169
206
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.snapSelectedOutlineUv = exports.selectedOutlineUvSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.getSelectedOutlineTransformOriginDragChanges = exports.compensateTranslateForTransformOrigin = exports.parseCssRotationToRadians = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineRotationSnapStepDegrees = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = exports.getSelectedOutlineActiveSchema = void 0;
|
|
3
|
+
exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.snapSelectedOutlineUv = exports.selectedOutlineUvSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.getSelectedOutlineTransformOriginDragChanges = exports.compensateTranslateForTransformOrigin = exports.parseCssRotationToRadians = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineRotationSnapStepDegrees = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineCropDragChanges = exports.getSelectedOutlineCropDragValues = exports.getSelectedOutlineCropFollowingTransformOrigin = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = exports.getSelectedOutlineActiveSchema = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const no_react_1 = require("remotion/no-react");
|
|
6
6
|
const selected_outline_geometry_1 = require("./selected-outline-geometry");
|
|
@@ -11,6 +11,7 @@ const timeline_field_utils_1 = require("./Timeline/timeline-field-utils");
|
|
|
11
11
|
const timeline_rotation_utils_1 = require("./Timeline/timeline-rotation-utils");
|
|
12
12
|
const timeline_translate_utils_1 = require("./Timeline/timeline-translate-utils");
|
|
13
13
|
const TimelineScaleField_1 = require("./Timeline/TimelineScaleField");
|
|
14
|
+
const transform_origin_utils_1 = require("./Timeline/transform-origin-utils");
|
|
14
15
|
const getSelectedOutlineActiveSchema = ({ schema, currentRuntimeValueDotNotation, dragOverrides, propStatus, frame, }) => {
|
|
15
16
|
const { merged: valuesDotNotation } = remotion_1.Internals.computeEffectiveSchemaValuesDotNotation({
|
|
16
17
|
schema,
|
|
@@ -113,6 +114,141 @@ const getSelectedOutlineDragChanges = ({ dragStates, lastValues, }) => {
|
|
|
113
114
|
return changes;
|
|
114
115
|
};
|
|
115
116
|
exports.getSelectedOutlineDragChanges = getSelectedOutlineDragChanges;
|
|
117
|
+
const getSelectedOutlineCropCenter = (crop) => [
|
|
118
|
+
(crop.cropLeft + 1 - crop.cropRight) / 2,
|
|
119
|
+
(crop.cropTop + 1 - crop.cropBottom) / 2,
|
|
120
|
+
];
|
|
121
|
+
const getSelectedOutlineCropFollowingTransformOrigin = ({ dimensions, initialCrop, nextCrop, transformOrigin, }) => {
|
|
122
|
+
if (dimensions === null ||
|
|
123
|
+
transformOrigin === null ||
|
|
124
|
+
transformOrigin.propStatus.status !== 'static') {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const parsed = (0, transform_origin_utils_1.parseTransformOrigin)(transformOrigin.value);
|
|
128
|
+
if (parsed === null) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const currentOrigin = (0, transform_origin_utils_1.parsedTransformOriginToUv)({
|
|
132
|
+
parsed,
|
|
133
|
+
width: dimensions.width,
|
|
134
|
+
height: dimensions.height,
|
|
135
|
+
});
|
|
136
|
+
if (currentOrigin === null) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
const initialCenter = getSelectedOutlineCropCenter(initialCrop);
|
|
140
|
+
const originIsAbsent = transformOrigin.propStatus.codeValue === undefined;
|
|
141
|
+
const originIsAtCropCenter = Math.abs(currentOrigin[0] - initialCenter[0]) <= 0.0001 &&
|
|
142
|
+
Math.abs(currentOrigin[1] - initialCenter[1]) <= 0.0001;
|
|
143
|
+
if (!originIsAbsent && !originIsAtCropCenter) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return (0, transform_origin_utils_1.serializeTransformOrigin)({
|
|
147
|
+
uv: getSelectedOutlineCropCenter(nextCrop),
|
|
148
|
+
z: parsed.z,
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
exports.getSelectedOutlineCropFollowingTransformOrigin = getSelectedOutlineCropFollowingTransformOrigin;
|
|
152
|
+
const cropHandleIncludes = (handle, edge) => handle === edge || handle.includes(edge);
|
|
153
|
+
const getSelectedOutlineCropDragValues = ({ crop, dimensions, handle, uv, }) => {
|
|
154
|
+
const minimumVisibleX = dimensions === null ? 0.001 : 1 / dimensions.width;
|
|
155
|
+
const minimumVisibleY = dimensions === null ? 0.001 : 1 / dimensions.height;
|
|
156
|
+
const roundCrop = (value, max) => (0, selected_outline_geometry_1.clamp)((0, timeline_field_utils_1.roundToDecimalPlaces)(value, 4), 0, Math.max(0, max));
|
|
157
|
+
const next = { ...crop };
|
|
158
|
+
if (cropHandleIncludes(handle, 'left')) {
|
|
159
|
+
next.cropLeft = roundCrop(uv[0], 1 - crop.cropRight - minimumVisibleX);
|
|
160
|
+
}
|
|
161
|
+
if (cropHandleIncludes(handle, 'right')) {
|
|
162
|
+
next.cropRight = roundCrop(1 - uv[0], 1 - crop.cropLeft - minimumVisibleX);
|
|
163
|
+
}
|
|
164
|
+
if (cropHandleIncludes(handle, 'top')) {
|
|
165
|
+
next.cropTop = roundCrop(uv[1], 1 - crop.cropBottom - minimumVisibleY);
|
|
166
|
+
}
|
|
167
|
+
if (cropHandleIncludes(handle, 'bottom')) {
|
|
168
|
+
next.cropBottom = roundCrop(1 - uv[1], 1 - crop.cropTop - minimumVisibleY);
|
|
169
|
+
}
|
|
170
|
+
return next;
|
|
171
|
+
};
|
|
172
|
+
exports.getSelectedOutlineCropDragValues = getSelectedOutlineCropDragValues;
|
|
173
|
+
const getSelectedOutlineCropDragChanges = ({ dimensions, target, values, }) => {
|
|
174
|
+
const changes = [];
|
|
175
|
+
for (const fieldKey of Object.values(selected_outline_types_1.cropFieldKeys)) {
|
|
176
|
+
const field = target.fields[fieldKey];
|
|
177
|
+
const value = values[fieldKey];
|
|
178
|
+
if (value === field.value) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (field.propStatus.status === 'keyframed') {
|
|
182
|
+
changes.push({
|
|
183
|
+
type: 'keyframed',
|
|
184
|
+
fileName: target.nodePath.absolutePath,
|
|
185
|
+
nodePath: target.nodePath,
|
|
186
|
+
fieldKey,
|
|
187
|
+
sourceFrame: target.sourceFrame,
|
|
188
|
+
value,
|
|
189
|
+
schema: target.schema,
|
|
190
|
+
clientId: target.clientId,
|
|
191
|
+
});
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const defaultValue = field.defaultValue === undefined
|
|
195
|
+
? null
|
|
196
|
+
: JSON.stringify(field.defaultValue);
|
|
197
|
+
const stringifiedValue = JSON.stringify(value);
|
|
198
|
+
const shouldSave = value !== field.propStatus.codeValue &&
|
|
199
|
+
!(defaultValue === stringifiedValue &&
|
|
200
|
+
field.propStatus.codeValue === undefined);
|
|
201
|
+
if (shouldSave) {
|
|
202
|
+
changes.push({
|
|
203
|
+
type: 'static',
|
|
204
|
+
fileName: target.nodePath.absolutePath,
|
|
205
|
+
nodePath: target.nodePath,
|
|
206
|
+
fieldKey,
|
|
207
|
+
value,
|
|
208
|
+
defaultValue,
|
|
209
|
+
schema: target.schema,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (changes.length === 0 ||
|
|
214
|
+
target.transformOrigin === null ||
|
|
215
|
+
target.transformOrigin.propStatus.status !== 'static') {
|
|
216
|
+
return changes;
|
|
217
|
+
}
|
|
218
|
+
const transformOrigin = (0, exports.getSelectedOutlineCropFollowingTransformOrigin)({
|
|
219
|
+
dimensions,
|
|
220
|
+
initialCrop: {
|
|
221
|
+
cropLeft: target.fields.cropLeft.value,
|
|
222
|
+
cropRight: target.fields.cropRight.value,
|
|
223
|
+
cropTop: target.fields.cropTop.value,
|
|
224
|
+
cropBottom: target.fields.cropBottom.value,
|
|
225
|
+
},
|
|
226
|
+
nextCrop: values,
|
|
227
|
+
transformOrigin: target.transformOrigin,
|
|
228
|
+
});
|
|
229
|
+
if (transformOrigin === null) {
|
|
230
|
+
return changes;
|
|
231
|
+
}
|
|
232
|
+
const transformOriginDefaultValue = target.transformOrigin.defaultValue === undefined
|
|
233
|
+
? null
|
|
234
|
+
: JSON.stringify(target.transformOrigin.defaultValue);
|
|
235
|
+
const shouldSaveTransformOrigin = transformOrigin !== target.transformOrigin.propStatus.codeValue &&
|
|
236
|
+
!(transformOriginDefaultValue === JSON.stringify(transformOrigin) &&
|
|
237
|
+
target.transformOrigin.propStatus.codeValue === undefined);
|
|
238
|
+
if (shouldSaveTransformOrigin) {
|
|
239
|
+
changes.push({
|
|
240
|
+
type: 'static',
|
|
241
|
+
fileName: target.nodePath.absolutePath,
|
|
242
|
+
nodePath: target.nodePath,
|
|
243
|
+
fieldKey: selected_outline_types_1.transformOriginFieldKey,
|
|
244
|
+
value: transformOrigin,
|
|
245
|
+
defaultValue: transformOriginDefaultValue,
|
|
246
|
+
schema: target.schema,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
return changes;
|
|
250
|
+
};
|
|
251
|
+
exports.getSelectedOutlineCropDragChanges = getSelectedOutlineCropDragChanges;
|
|
116
252
|
const getSelectedOutlineKeyboardNudgeDelta = ({ direction, shiftKey, }) => {
|
|
117
253
|
const increment = shiftKey ? 10 : 1;
|
|
118
254
|
return direction === 'left' || direction === 'up' ? -increment : increment;
|
|
@@ -570,4 +706,45 @@ const snapSelectedOutlineUv = ({ point, points, thresholdPx = exports.selectedOu
|
|
|
570
706
|
};
|
|
571
707
|
exports.snapSelectedOutlineUv = snapSelectedOutlineUv;
|
|
572
708
|
exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx;
|
|
573
|
-
|
|
709
|
+
const getCroppedOutlineUvSnapTargets = (crop) => {
|
|
710
|
+
const { left, top } = crop;
|
|
711
|
+
const right = 1 - crop.right;
|
|
712
|
+
const bottom = 1 - crop.bottom;
|
|
713
|
+
const centerX = (left + right) / 2;
|
|
714
|
+
const centerY = (top + bottom) / 2;
|
|
715
|
+
return [
|
|
716
|
+
[left, top],
|
|
717
|
+
[centerX, top],
|
|
718
|
+
[right, top],
|
|
719
|
+
[right, centerY],
|
|
720
|
+
[right, bottom],
|
|
721
|
+
[centerX, bottom],
|
|
722
|
+
[left, bottom],
|
|
723
|
+
[left, centerY],
|
|
724
|
+
[centerX, centerY],
|
|
725
|
+
];
|
|
726
|
+
};
|
|
727
|
+
const snapSelectedOutlineTransformOriginUv = ({ crop, point, points, thresholdPx, uv, }) => {
|
|
728
|
+
var _a;
|
|
729
|
+
const threshold = thresholdPx !== null && thresholdPx !== void 0 ? thresholdPx : exports.selectedOutlineTransformOriginSnapThresholdPx;
|
|
730
|
+
if (crop === null) {
|
|
731
|
+
return (0, exports.snapSelectedOutlineUv)({ point, points, thresholdPx: threshold, uv });
|
|
732
|
+
}
|
|
733
|
+
let best = null;
|
|
734
|
+
const snapTargets = [
|
|
735
|
+
...selectedOutlineUvSnapTargets,
|
|
736
|
+
...getCroppedOutlineUvSnapTargets(crop),
|
|
737
|
+
];
|
|
738
|
+
for (const snapUv of snapTargets) {
|
|
739
|
+
const snapPoint = (0, selected_outline_uv_1.getUvHandlePosition)(points, snapUv);
|
|
740
|
+
const distance = Math.hypot(point.x - snapPoint.x, point.y - snapPoint.y);
|
|
741
|
+
if (distance > threshold) {
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
if (best === null || distance < best.distance) {
|
|
745
|
+
best = { distance, uv: snapUv };
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
return (_a = best === null || best === void 0 ? void 0 : best.uv) !== null && _a !== void 0 ? _a : uv;
|
|
749
|
+
};
|
|
750
|
+
exports.snapSelectedOutlineTransformOriginUv = snapSelectedOutlineTransformOriginUv;
|
|
@@ -41,6 +41,12 @@ export declare const getTransformedSvgViewportPoints: ({ viewport, ctm, containe
|
|
|
41
41
|
readonly ctm: SvgScreenCtm;
|
|
42
42
|
readonly containerRect: Pick<DOMRect, "left" | "top">;
|
|
43
43
|
}) => readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
|
|
44
|
+
export declare const cropOutlinePoints: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], crop: {
|
|
45
|
+
readonly left: number;
|
|
46
|
+
readonly right: number;
|
|
47
|
+
readonly top: number;
|
|
48
|
+
readonly bottom: number;
|
|
49
|
+
}) => readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
|
|
44
50
|
export declare const getSelectedSequenceKeys: (selectedItems: readonly TimelineSelection[]) => Set<string>;
|
|
45
51
|
export declare const getSequenceKeysContainingSelection: (selectedItems: readonly TimelineSelection[]) => Set<string>;
|
|
46
52
|
export declare const getOutlineSelectionInteraction: ({ shiftKey, metaKey, ctrlKey, }: {
|
|
@@ -57,6 +63,11 @@ type SelectedTransformOriginInfo = {
|
|
|
57
63
|
readonly sequenceKey: string;
|
|
58
64
|
readonly displayFrame: number | null;
|
|
59
65
|
};
|
|
66
|
+
export type SelectedCropInfo = {
|
|
67
|
+
readonly sequenceKey: string;
|
|
68
|
+
readonly displayFrame: number | null;
|
|
69
|
+
};
|
|
70
|
+
export declare const getSelectedCropInfo: (selectedItems: readonly TimelineSelection[]) => SelectedCropInfo | null;
|
|
60
71
|
export declare const getSelectedTransformOriginInfo: (selectedItems: readonly TimelineSelection[]) => SelectedTransformOriginInfo | null;
|
|
61
72
|
export declare const getSequencesWithSelectableOutlines: ({ sequences, overrideIdsToNodePaths, compositions, timelinePosition, }: {
|
|
62
73
|
readonly sequences: readonly TSequence[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
|
|
3
|
+
exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedCropInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.cropOutlinePoints = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
|
|
4
4
|
const calculate_timeline_1 = require("../helpers/calculate-timeline");
|
|
5
5
|
const colors_1 = require("../helpers/colors");
|
|
6
6
|
const get_box_quads_ponyfill_1 = require("../helpers/get-box-quads-ponyfill");
|
|
@@ -203,6 +203,24 @@ const getElementOutlinePoints = (element, containerRect) => {
|
|
|
203
203
|
}
|
|
204
204
|
return quadToPoints(quad, containerRect);
|
|
205
205
|
};
|
|
206
|
+
const cropOutlinePoints = (points, crop) => {
|
|
207
|
+
if (crop.left === 0 &&
|
|
208
|
+
crop.right === 0 &&
|
|
209
|
+
crop.top === 0 &&
|
|
210
|
+
crop.bottom === 0) {
|
|
211
|
+
return points;
|
|
212
|
+
}
|
|
213
|
+
const { left, top } = crop;
|
|
214
|
+
const right = 1 - crop.right;
|
|
215
|
+
const bottom = 1 - crop.bottom;
|
|
216
|
+
return [
|
|
217
|
+
(0, selected_outline_uv_1.getUvHandlePosition)(points, [left, top]),
|
|
218
|
+
(0, selected_outline_uv_1.getUvHandlePosition)(points, [right, top]),
|
|
219
|
+
(0, selected_outline_uv_1.getUvHandlePosition)(points, [right, bottom]),
|
|
220
|
+
(0, selected_outline_uv_1.getUvHandlePosition)(points, [left, bottom]),
|
|
221
|
+
];
|
|
222
|
+
};
|
|
223
|
+
exports.cropOutlinePoints = cropOutlinePoints;
|
|
206
224
|
const getSelectedSequenceKeys = (selectedItems) => {
|
|
207
225
|
return new Set(selectedItems
|
|
208
226
|
.filter((item) => item.type === 'sequence')
|
|
@@ -278,6 +296,34 @@ const getSelectedEffectFieldsBySequenceKey = (selectedItems) => {
|
|
|
278
296
|
return selectedEffects;
|
|
279
297
|
};
|
|
280
298
|
exports.getSelectedEffectFieldsBySequenceKey = getSelectedEffectFieldsBySequenceKey;
|
|
299
|
+
const isCropFieldKey = (key) => Object.values(selected_outline_types_1.cropFieldKeys).some((cropFieldKey) => cropFieldKey === key);
|
|
300
|
+
const getSelectedCropInfo = (selectedItems) => {
|
|
301
|
+
if (selectedItems.length !== 1) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
const [selectedItem] = selectedItems;
|
|
305
|
+
if (selectedItem.type === 'sequence-prop' &&
|
|
306
|
+
isCropFieldKey(selectedItem.key)) {
|
|
307
|
+
return {
|
|
308
|
+
sequenceKey: (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(selectedItem.nodePathInfo),
|
|
309
|
+
displayFrame: null,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
if (selectedItem.type !== 'keyframe' && selectedItem.type !== 'easing') {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
const field = getKeyframeOrEasingField(selectedItem);
|
|
316
|
+
if ((field === null || field === void 0 ? void 0 : field.type) !== 'sequence' || !isCropFieldKey(field.fieldKey)) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
sequenceKey: (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(selectedItem.nodePathInfo),
|
|
321
|
+
displayFrame: selectedItem.type === 'keyframe'
|
|
322
|
+
? selectedItem.frame
|
|
323
|
+
: selectedItem.fromFrame,
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
exports.getSelectedCropInfo = getSelectedCropInfo;
|
|
281
327
|
const getSelectedTransformOriginInfo = (selectedItems) => {
|
|
282
328
|
if (selectedItems.length !== 1) {
|
|
283
329
|
return null;
|
|
@@ -345,10 +391,11 @@ const measureOutlines = (container, targets) => {
|
|
|
345
391
|
if (element === null) {
|
|
346
392
|
continue;
|
|
347
393
|
}
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
394
|
+
const uncroppedPoints = getElementOutlinePoints(element, containerRect);
|
|
395
|
+
if (uncroppedPoints === null) {
|
|
350
396
|
continue;
|
|
351
397
|
}
|
|
398
|
+
const points = (0, exports.cropOutlinePoints)(uncroppedPoints, target.crop);
|
|
352
399
|
outlines.push({
|
|
353
400
|
key: target.key,
|
|
354
401
|
dimensions: element instanceof HTMLElement
|
|
@@ -362,6 +409,7 @@ const measureOutlines = (container, targets) => {
|
|
|
362
409
|
height: element.height.baseVal.value,
|
|
363
410
|
}
|
|
364
411
|
: null,
|
|
412
|
+
uncroppedPoints,
|
|
365
413
|
points,
|
|
366
414
|
});
|
|
367
415
|
}
|
|
@@ -381,6 +429,19 @@ const outlinesAreEqual = (a, b) => {
|
|
|
381
429
|
((_c = a[i].dimensions) === null || _c === void 0 ? void 0 : _c.height) !== ((_d = b[i].dimensions) === null || _d === void 0 ? void 0 : _d.height)) {
|
|
382
430
|
return false;
|
|
383
431
|
}
|
|
432
|
+
const aUncropped = a[i].uncroppedPoints;
|
|
433
|
+
const bUncropped = b[i].uncroppedPoints;
|
|
434
|
+
if ((aUncropped === null) !== (bUncropped === null)) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
if (aUncropped !== null && bUncropped !== null) {
|
|
438
|
+
for (let j = 0; j < aUncropped.length; j++) {
|
|
439
|
+
if (Math.abs(aUncropped[j].x - bUncropped[j].x) > 0.01 ||
|
|
440
|
+
Math.abs(aUncropped[j].y - bUncropped[j].y) > 0.01) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
384
445
|
for (let j = 0; j < a[i].points.length; j++) {
|
|
385
446
|
if (Math.abs(a[i].points[j].x - b[i].points[j].x) > 0.01 ||
|
|
386
447
|
Math.abs(a[i].points[j].y - b[i].points[j].y) > 0.01) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey, TSequence } from 'remotion';
|
|
1
|
+
import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey, TSequence } from 'remotion';
|
|
2
2
|
import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
4
4
|
import type { SelectedOutlineUvHandle } from './selected-outline-uv';
|
|
@@ -7,6 +7,7 @@ export type SelectedOutlineContextMenuOpenResult = false | void | readonly Combo
|
|
|
7
7
|
export type SelectedOutlineContextMenuOpenHandler = () => SelectedOutlineContextMenuOpenResult | Promise<SelectedOutlineContextMenuOpenResult>;
|
|
8
8
|
export type SelectedOutlineTarget = {
|
|
9
9
|
readonly key: string;
|
|
10
|
+
readonly canCrop: boolean;
|
|
10
11
|
readonly containsSelection: boolean;
|
|
11
12
|
readonly effectDrop: SelectedOutlineEffectDropTarget | null;
|
|
12
13
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
@@ -14,12 +15,53 @@ export type SelectedOutlineTarget = {
|
|
|
14
15
|
readonly selected: boolean;
|
|
15
16
|
readonly selection: TimelineSelection;
|
|
16
17
|
readonly sequence: TSequence;
|
|
18
|
+
readonly crop: {
|
|
19
|
+
readonly left: number;
|
|
20
|
+
readonly right: number;
|
|
21
|
+
readonly top: number;
|
|
22
|
+
readonly bottom: number;
|
|
23
|
+
};
|
|
24
|
+
readonly cropDrag: SelectedOutlineCropDragTarget | null;
|
|
17
25
|
readonly drag: SelectedOutlineDragTarget | null;
|
|
18
26
|
readonly scaleDrag: SelectedOutlineScaleDragTarget | null;
|
|
19
27
|
readonly rotationDrag: SelectedOutlineRotationDragTarget | null;
|
|
20
28
|
readonly transformOriginDrag: SelectedOutlineTransformOriginDragTarget | null;
|
|
21
29
|
readonly uvHandles: readonly SelectedOutlineUvHandle[];
|
|
22
30
|
};
|
|
31
|
+
export declare const cropFieldKeys: {
|
|
32
|
+
readonly left: "cropLeft";
|
|
33
|
+
readonly right: "cropRight";
|
|
34
|
+
readonly top: "cropTop";
|
|
35
|
+
readonly bottom: "cropBottom";
|
|
36
|
+
};
|
|
37
|
+
export type SelectedOutlineCropEdge = keyof typeof cropFieldKeys;
|
|
38
|
+
export type SelectedOutlineCropFieldKey = (typeof cropFieldKeys)[SelectedOutlineCropEdge];
|
|
39
|
+
export declare const canEditSelectedOutlineCrop: ({ schema, propStatuses, }: {
|
|
40
|
+
readonly schema: InteractivitySchema | null;
|
|
41
|
+
readonly propStatuses: Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
42
|
+
}) => boolean;
|
|
43
|
+
export type SelectedOutlineCropHandle = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top' | 'right' | 'bottom' | 'left';
|
|
44
|
+
type CropNumberFieldSchema = Extract<InteractivitySchemaField, {
|
|
45
|
+
type: 'number';
|
|
46
|
+
}>;
|
|
47
|
+
export type SelectedOutlineCropField = {
|
|
48
|
+
readonly defaultValue: number | null | undefined;
|
|
49
|
+
readonly fieldSchema: CropNumberFieldSchema;
|
|
50
|
+
readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
51
|
+
readonly value: number;
|
|
52
|
+
};
|
|
53
|
+
export type SelectedOutlineCropDragTarget = {
|
|
54
|
+
readonly clientId: string;
|
|
55
|
+
readonly fields: Record<SelectedOutlineCropFieldKey, SelectedOutlineCropField>;
|
|
56
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
57
|
+
readonly schema: InteractivitySchema;
|
|
58
|
+
readonly sourceFrame: number;
|
|
59
|
+
readonly transformOrigin: {
|
|
60
|
+
readonly defaultValue: string | undefined;
|
|
61
|
+
readonly propStatus: CanUpdateSequencePropStatus;
|
|
62
|
+
readonly value: string;
|
|
63
|
+
} | null;
|
|
64
|
+
};
|
|
23
65
|
export type SelectedOutlineEffectDropTarget = {
|
|
24
66
|
readonly clientId: string;
|
|
25
67
|
readonly fileName: string;
|
|
@@ -119,3 +161,4 @@ export type SelectedOutlineKeyboardNudgeSession = {
|
|
|
119
161
|
deltaY: number;
|
|
120
162
|
lastValues: ReadonlyMap<string, string>;
|
|
121
163
|
};
|
|
164
|
+
export {};
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emptyContextMenuValues = exports.outlineContainer = exports.selectedOutlineDragThresholdPx = exports.transformOriginFieldKey = exports.rotateFieldKey = exports.scaleFieldKey = exports.translateFieldKey = void 0;
|
|
3
|
+
exports.emptyContextMenuValues = exports.outlineContainer = exports.selectedOutlineDragThresholdPx = exports.transformOriginFieldKey = exports.rotateFieldKey = exports.scaleFieldKey = exports.translateFieldKey = exports.canEditSelectedOutlineCrop = exports.cropFieldKeys = void 0;
|
|
4
|
+
exports.cropFieldKeys = {
|
|
5
|
+
left: 'cropLeft',
|
|
6
|
+
right: 'cropRight',
|
|
7
|
+
top: 'cropTop',
|
|
8
|
+
bottom: 'cropBottom',
|
|
9
|
+
};
|
|
10
|
+
const canEditSelectedOutlineCrop = ({ schema, propStatuses, }) => {
|
|
11
|
+
for (const fieldKey of Object.values(exports.cropFieldKeys)) {
|
|
12
|
+
const fieldSchema = schema === null || schema === void 0 ? void 0 : schema[fieldKey];
|
|
13
|
+
const propStatus = propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses[fieldKey];
|
|
14
|
+
const canEditStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
|
|
15
|
+
((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
|
|
16
|
+
propStatus.interpolationFunction === 'interpolate');
|
|
17
|
+
if ((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) !== 'number' || !canEditStatus) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
};
|
|
23
|
+
exports.canEditSelectedOutlineCrop = canEditSelectedOutlineCrop;
|
|
4
24
|
exports.translateFieldKey = 'style.translate';
|
|
5
25
|
exports.scaleFieldKey = 'style.scale';
|
|
6
26
|
exports.rotateFieldKey = 'style.rotate';
|
|
@@ -4,7 +4,7 @@ exports.Overlay = exports.setErrorsRef = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
-
const
|
|
7
|
+
const menu_toolbar_height_1 = require("../../components/menu-toolbar-height");
|
|
8
8
|
const colors_1 = require("../../helpers/colors");
|
|
9
9
|
const keybindings_1 = require("../../state/keybindings");
|
|
10
10
|
const ErrorLoader_1 = require("./ErrorLoader");
|
|
@@ -45,8 +45,8 @@ const Overlay = () => {
|
|
|
45
45
|
backgroundColor: BACKGROUND_COLOR,
|
|
46
46
|
overflow: 'auto',
|
|
47
47
|
color: colors_1.WHITE,
|
|
48
|
-
top:
|
|
49
|
-
height: `calc(100% - ${
|
|
48
|
+
top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
|
|
49
|
+
height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
|
|
50
50
|
}, children: errors.errors.map((err, i) => {
|
|
51
51
|
var _a;
|
|
52
52
|
return (jsx_runtime_1.jsx(ErrorLoader_1.ErrorLoader
|
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ShortcutHint = exports.cmdOrCtrlCharacter = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const is_mac_1 = require("../../helpers/is-mac");
|
|
6
7
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
7
|
-
exports.cmdOrCtrlCharacter =
|
|
8
|
-
? '⌘'
|
|
9
|
-
: 'Ctrl';
|
|
8
|
+
exports.cmdOrCtrlCharacter = is_mac_1.isMac ? '⌘' : 'Ctrl';
|
|
10
9
|
const container = {
|
|
11
10
|
display: 'inline-block',
|
|
12
11
|
marginLeft: 6,
|