@remotion/studio 4.0.499 → 4.0.501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Studio.js +1 -1
- package/dist/api/delete-static-file.js +8 -3
- package/dist/api/rename-static-file.js +8 -0
- package/dist/api/watch-public-folder.js +2 -1
- package/dist/api/watch-static-file.js +2 -1
- package/dist/api/write-static-file.js +8 -3
- package/dist/components/AssetSelector.js +11 -7
- package/dist/components/AssetSelectorItem.d.ts +25 -0
- package/dist/components/AssetSelectorItem.js +116 -80
- package/dist/components/Canvas.js +6 -1
- package/dist/components/CaptionInspector.d.ts +10 -0
- package/dist/components/CaptionInspector.js +24 -0
- package/dist/components/CaptionTextEditor.d.ts +9 -0
- package/dist/components/CaptionTextEditor.js +132 -0
- package/dist/components/CompositionSelector.js +2 -32
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/CurrentAsset.js +3 -2
- package/dist/components/EditorContexts.d.ts +0 -1
- package/dist/components/EditorContexts.js +2 -2
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/FpsCounter.js +3 -3
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +9 -1
- package/dist/components/InitialCompositionLoader.d.ts +1 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -2
- package/dist/components/InlineCaptionInspector.d.ts +11 -0
- package/dist/components/InlineCaptionInspector.js +108 -0
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +12 -9
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +10 -10
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
- package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
- package/dist/components/InspectorPanel/styles.js +7 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +3 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +91 -5
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.d.ts +2 -1
- package/dist/components/InspectorSequenceSection.js +279 -25
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +15 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +7 -0
- package/dist/components/NewComposition/InputDragger.js +119 -8
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +45 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +10 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +10 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +95 -13
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +84 -47
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +147 -16
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/ShowOutlinesProvider.js +4 -1
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/Timeline.js +19 -5
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +53 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +10 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowChrome.js +4 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -7
- package/dist/components/Timeline/TimelineSelection.js +17 -12
- package/dist/components/Timeline/TimelineSequence.js +2 -9
- package/dist/components/Timeline/TimelineSequenceItem.js +61 -15
- package/dist/components/Timeline/TimelineSequencePropItem.js +36 -85
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTrack.js +4 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
- package/dist/components/Timeline/border-radius-representation.js +60 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
- package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +20 -18
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
- package/dist/components/Timeline/save-sequence-prop.js +25 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/TopPanel.js +2 -2
- package/dist/components/UndoRedoButtons.js +42 -11
- package/dist/components/composition-drop-preview.js +1 -0
- package/dist/components/handle-drop.d.ts +3 -2
- package/dist/components/handle-drop.js +2 -1
- package/dist/components/import-assets.d.ts +4 -2
- package/dist/components/import-assets.js +20 -7
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
- package/dist/components/use-element-overwrite-confirmation.js +73 -0
- package/dist/components/use-static-files.js +7 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-pk1zwsn1.js → chunk-n1kj09yv.js} +10618 -8002
- package/dist/esm/index.mjs +24 -8
- package/dist/esm/internals.mjs +10618 -8002
- package/dist/esm/previewEntry.mjs +40002 -37388
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +14 -0
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/client-id.d.ts +0 -1
- package/dist/helpers/client-id.js +15 -10
- package/dist/helpers/download-blob.d.ts +1 -0
- package/dist/helpers/download-blob.js +15 -0
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/inject-css.js +5 -3
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +39 -4
- package/dist/helpers/preview-server-events.js +46 -9
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-create-composition.js +8 -6
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-menu-structure.js +39 -1
- package/dist/hot-middleware-client/client.js +3 -3
- package/dist/icons/border-radius.d.ts +4 -0
- package/dist/icons/border-radius.js +8 -0
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/fullscreen.d.ts +4 -0
- package/dist/icons/fullscreen.js +6 -0
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/previewEntry.js +1 -1
- package/dist/state/modals.d.ts +9 -0
- package/dist/state/timeline-sequence-hover.d.ts +17 -0
- package/dist/state/timeline-sequence-hover.js +33 -0
- package/package.json +13 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -0,0 +1,299 @@
|
|
|
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.SelectedOutlineCropControls = 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 ForceSpecificCursor_1 = require("./ForceSpecificCursor");
|
|
42
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
43
|
+
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
44
|
+
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
45
|
+
const selected_outline_types_1 = require("./selected-outline-types");
|
|
46
|
+
const selected_outline_uv_1 = require("./selected-outline-uv");
|
|
47
|
+
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
48
|
+
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
49
|
+
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
50
|
+
const CROP_HANDLE_THICKNESS = 5;
|
|
51
|
+
const CROP_HANDLE_LENGTH = 20;
|
|
52
|
+
const CROP_HANDLE_HIT_WIDTH = 14;
|
|
53
|
+
const CROPPED_AWAY_OPACITY = 0.35;
|
|
54
|
+
const cropHandles = [
|
|
55
|
+
'top-left',
|
|
56
|
+
'top-right',
|
|
57
|
+
'bottom-left',
|
|
58
|
+
'bottom-right',
|
|
59
|
+
'top',
|
|
60
|
+
'right',
|
|
61
|
+
'bottom',
|
|
62
|
+
'left',
|
|
63
|
+
];
|
|
64
|
+
const cursorForHandle = (handle) => {
|
|
65
|
+
if (handle === 'top' || handle === 'bottom') {
|
|
66
|
+
return 'ns-resize';
|
|
67
|
+
}
|
|
68
|
+
if (handle === 'left' || handle === 'right') {
|
|
69
|
+
return 'ew-resize';
|
|
70
|
+
}
|
|
71
|
+
return handle === 'top-left' || handle === 'bottom-right'
|
|
72
|
+
? 'nwse-resize'
|
|
73
|
+
: 'nesw-resize';
|
|
74
|
+
};
|
|
75
|
+
const moveTowards = (from, to, distance) => {
|
|
76
|
+
const vector = (0, selected_outline_measurement_1.vectorBetween)(from, to);
|
|
77
|
+
const length = (0, selected_outline_measurement_1.vectorLength)(vector);
|
|
78
|
+
if (length === 0) {
|
|
79
|
+
return from;
|
|
80
|
+
}
|
|
81
|
+
const progress = Math.min(1, distance / length);
|
|
82
|
+
return {
|
|
83
|
+
x: from.x + vector.x * progress,
|
|
84
|
+
y: from.y + vector.y * progress,
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const pointString = (point) => `${point.x} ${point.y}`;
|
|
88
|
+
const getCropHandlePath = ({ handle, points, }) => {
|
|
89
|
+
const [topLeft, topRight, bottomRight, bottomLeft] = points;
|
|
90
|
+
const cornerInfo = {
|
|
91
|
+
'top-left': { corner: topLeft, first: topRight, second: bottomLeft },
|
|
92
|
+
'top-right': { corner: topRight, first: topLeft, second: bottomRight },
|
|
93
|
+
'bottom-left': { corner: bottomLeft, first: topLeft, second: bottomRight },
|
|
94
|
+
'bottom-right': { corner: bottomRight, first: topRight, second: bottomLeft },
|
|
95
|
+
};
|
|
96
|
+
if (handle in cornerInfo) {
|
|
97
|
+
const info = cornerInfo[handle];
|
|
98
|
+
const length = Math.min(CROP_HANDLE_LENGTH, (0, selected_outline_measurement_1.vectorLength)((0, selected_outline_measurement_1.vectorBetween)(info.corner, info.first)) / 4, (0, selected_outline_measurement_1.vectorLength)((0, selected_outline_measurement_1.vectorBetween)(info.corner, info.second)) / 4);
|
|
99
|
+
const first = moveTowards(info.corner, info.first, length);
|
|
100
|
+
const second = moveTowards(info.corner, info.second, length);
|
|
101
|
+
return `M ${pointString(first)} L ${pointString(info.corner)} L ${pointString(second)}`;
|
|
102
|
+
}
|
|
103
|
+
const edgeInfo = {
|
|
104
|
+
top: [topLeft, topRight],
|
|
105
|
+
right: [topRight, bottomRight],
|
|
106
|
+
bottom: [bottomLeft, bottomRight],
|
|
107
|
+
left: [topLeft, bottomLeft],
|
|
108
|
+
};
|
|
109
|
+
const [start, end] = edgeInfo[handle];
|
|
110
|
+
const center = (0, selected_outline_measurement_1.midpoint)(start, end);
|
|
111
|
+
const halfLength = Math.min(CROP_HANDLE_LENGTH / 2, (0, selected_outline_measurement_1.vectorLength)((0, selected_outline_measurement_1.vectorBetween)(start, end)) / 8);
|
|
112
|
+
const pathStart = moveTowards(center, start, halfLength);
|
|
113
|
+
const pathEnd = moveTowards(center, end, halfLength);
|
|
114
|
+
return `M ${pointString(pathStart)} L ${pointString(pathEnd)}`;
|
|
115
|
+
};
|
|
116
|
+
const getCropValues = (target) => ({
|
|
117
|
+
cropLeft: target.fields.cropLeft.value,
|
|
118
|
+
cropRight: target.fields.cropRight.value,
|
|
119
|
+
cropTop: target.fields.cropTop.value,
|
|
120
|
+
cropBottom: target.fields.cropBottom.value,
|
|
121
|
+
});
|
|
122
|
+
const makeCropPreviewMask = (crop) => {
|
|
123
|
+
const x = crop.left * 100;
|
|
124
|
+
const y = crop.top * 100;
|
|
125
|
+
const width = Math.max(0, 1 - crop.left - crop.right) * 100;
|
|
126
|
+
const height = Math.max(0, 1 - crop.top - crop.bottom) * 100;
|
|
127
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1" viewBox="0 0 100 100" preserveAspectRatio="none"><rect width="100" height="100" fill="white" fill-opacity="${CROPPED_AWAY_OPACITY}"/><rect x="${x}" y="${y}" width="${width}" height="${height}" fill="white"/></svg>`;
|
|
128
|
+
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
129
|
+
};
|
|
130
|
+
const cropPreviewAttribute = 'data-remotion-studio-crop-preview';
|
|
131
|
+
let cropPreviewId = 0;
|
|
132
|
+
const useCropPreview = (target) => {
|
|
133
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
134
|
+
var _a;
|
|
135
|
+
if (target === undefined || target.cropDrag === null) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const element = target.ref.current;
|
|
139
|
+
if (!(element instanceof HTMLElement || element instanceof SVGElement)) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const mask = makeCropPreviewMask(target.crop);
|
|
143
|
+
const previewId = String(++cropPreviewId);
|
|
144
|
+
const styleElement = element.ownerDocument.createElement('style');
|
|
145
|
+
styleElement.textContent = `
|
|
146
|
+
[${cropPreviewAttribute}="${previewId}"] {
|
|
147
|
+
clip-path: none !important;
|
|
148
|
+
mask-image: ${mask} !important;
|
|
149
|
+
-webkit-mask-image: ${mask} !important;
|
|
150
|
+
mask-position: 0 0 !important;
|
|
151
|
+
-webkit-mask-position: 0 0 !important;
|
|
152
|
+
mask-repeat: no-repeat !important;
|
|
153
|
+
-webkit-mask-repeat: no-repeat !important;
|
|
154
|
+
mask-size: 100% 100% !important;
|
|
155
|
+
-webkit-mask-size: 100% 100% !important;
|
|
156
|
+
}`;
|
|
157
|
+
// Do not mutate the inline crop style: React would still consider its
|
|
158
|
+
// clipPath prop applied and may not restore it when crop mode is closed.
|
|
159
|
+
element.setAttribute(cropPreviewAttribute, previewId);
|
|
160
|
+
((_a = element.ownerDocument.head) !== null && _a !== void 0 ? _a : element.ownerDocument.documentElement).append(styleElement);
|
|
161
|
+
return () => {
|
|
162
|
+
if (element.getAttribute(cropPreviewAttribute) === previewId) {
|
|
163
|
+
element.removeAttribute(cropPreviewAttribute);
|
|
164
|
+
}
|
|
165
|
+
styleElement.remove();
|
|
166
|
+
};
|
|
167
|
+
}, [target]);
|
|
168
|
+
};
|
|
169
|
+
const CropHandle = ({ handle, outline, onDraggingChange, target }) => {
|
|
170
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
171
|
+
const { cropDrag } = target;
|
|
172
|
+
const cursor = cursorForHandle(handle);
|
|
173
|
+
const path = (0, react_1.useMemo)(() => getCropHandlePath({ handle, points: outline.points }), [handle, outline.points]);
|
|
174
|
+
const onPointerDown = react_1.default.useCallback((event) => {
|
|
175
|
+
var _a;
|
|
176
|
+
if (event.button !== 0 || cropDrag === null) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
event.stopPropagation();
|
|
181
|
+
if ((0, focus_inspector_field_1.commitPendingInspectorFields)()) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const svg = event.currentTarget.ownerSVGElement;
|
|
185
|
+
if (svg === null) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const svgRect = svg.getBoundingClientRect();
|
|
189
|
+
const uncroppedPoints = (_a = outline.uncroppedPoints) !== null && _a !== void 0 ? _a : outline.points;
|
|
190
|
+
const initialValues = getCropValues(cropDrag);
|
|
191
|
+
let lastValues = initialValues;
|
|
192
|
+
let dragStarted = false;
|
|
193
|
+
const onPointerMove = (moveEvent) => {
|
|
194
|
+
moveEvent.preventDefault();
|
|
195
|
+
if (!dragStarted) {
|
|
196
|
+
dragStarted = true;
|
|
197
|
+
onDraggingChange(true);
|
|
198
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)(cursor !== null && cursor !== void 0 ? cursor : 'default');
|
|
199
|
+
}
|
|
200
|
+
const uv = (0, selected_outline_uv_1.getUvCoordinateForPoint)(uncroppedPoints, {
|
|
201
|
+
x: moveEvent.clientX - svgRect.left,
|
|
202
|
+
y: moveEvent.clientY - svgRect.top,
|
|
203
|
+
});
|
|
204
|
+
lastValues = (0, selected_outline_drag_1.getSelectedOutlineCropDragValues)({
|
|
205
|
+
crop: initialValues,
|
|
206
|
+
dimensions: outline.dimensions,
|
|
207
|
+
handle,
|
|
208
|
+
uv,
|
|
209
|
+
});
|
|
210
|
+
const transformOrigin = (0, selected_outline_drag_1.getSelectedOutlineCropFollowingTransformOrigin)({
|
|
211
|
+
dimensions: outline.dimensions,
|
|
212
|
+
initialCrop: initialValues,
|
|
213
|
+
nextCrop: lastValues,
|
|
214
|
+
transformOrigin: cropDrag.transformOrigin,
|
|
215
|
+
});
|
|
216
|
+
for (const fieldKey of Object.values(selected_outline_types_1.cropFieldKeys)) {
|
|
217
|
+
const field = cropDrag.fields[fieldKey];
|
|
218
|
+
const value = lastValues[fieldKey];
|
|
219
|
+
if (value === field.value) {
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
setDragOverrides(cropDrag.nodePath, fieldKey, field.propStatus.status === 'keyframed'
|
|
223
|
+
? remotion_1.Internals.makeKeyframedDragOverride({
|
|
224
|
+
status: field.propStatus,
|
|
225
|
+
frame: cropDrag.sourceFrame,
|
|
226
|
+
value,
|
|
227
|
+
})
|
|
228
|
+
: remotion_1.Internals.makeStaticDragOverride(value));
|
|
229
|
+
}
|
|
230
|
+
if (transformOrigin !== null) {
|
|
231
|
+
setDragOverrides(cropDrag.nodePath, selected_outline_types_1.transformOriginFieldKey, remotion_1.Internals.makeStaticDragOverride(transformOrigin));
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const onPointerUp = () => {
|
|
235
|
+
window.removeEventListener('pointermove', onPointerMove);
|
|
236
|
+
window.removeEventListener('pointerup', onPointerUp);
|
|
237
|
+
window.removeEventListener('pointercancel', onPointerUp);
|
|
238
|
+
if (dragStarted) {
|
|
239
|
+
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
240
|
+
onDraggingChange(false);
|
|
241
|
+
}
|
|
242
|
+
const changes = (0, selected_outline_drag_1.getSelectedOutlineCropDragChanges)({
|
|
243
|
+
dimensions: outline.dimensions,
|
|
244
|
+
target: cropDrag,
|
|
245
|
+
values: lastValues,
|
|
246
|
+
});
|
|
247
|
+
const staticChanges = changes.filter((change) => change.type === 'static');
|
|
248
|
+
const keyframedChanges = changes.filter((change) => change.type === 'keyframed');
|
|
249
|
+
const promise = staticChanges.length === 0
|
|
250
|
+
? (0, call_add_keyframe_1.callAddKeyframes)({
|
|
251
|
+
sequenceKeyframes: keyframedChanges,
|
|
252
|
+
effectKeyframes: [],
|
|
253
|
+
setPropStatuses,
|
|
254
|
+
clientId: cropDrag.clientId,
|
|
255
|
+
})
|
|
256
|
+
: (0, save_sequence_prop_1.saveSequenceProps)({
|
|
257
|
+
changes: staticChanges,
|
|
258
|
+
addedKeyframes: keyframedChanges,
|
|
259
|
+
movedKeyframes: null,
|
|
260
|
+
setPropStatuses,
|
|
261
|
+
clientId: cropDrag.clientId,
|
|
262
|
+
undoLabel: 'Crop sequence',
|
|
263
|
+
redoLabel: 'Crop sequence back',
|
|
264
|
+
});
|
|
265
|
+
promise
|
|
266
|
+
.catch((err) => {
|
|
267
|
+
(0, NotificationCenter_1.showNotification)(`Could not save crop: ${err instanceof Error ? err.message : String(err)}`, 4000);
|
|
268
|
+
})
|
|
269
|
+
.finally(() => {
|
|
270
|
+
clearDragOverrides(cropDrag.nodePath);
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
window.addEventListener('pointermove', onPointerMove);
|
|
274
|
+
window.addEventListener('pointerup', onPointerUp);
|
|
275
|
+
window.addEventListener('pointercancel', onPointerUp);
|
|
276
|
+
}, [
|
|
277
|
+
clearDragOverrides,
|
|
278
|
+
cropDrag,
|
|
279
|
+
cursor,
|
|
280
|
+
handle,
|
|
281
|
+
onDraggingChange,
|
|
282
|
+
outline.dimensions,
|
|
283
|
+
outline.points,
|
|
284
|
+
outline.uncroppedPoints,
|
|
285
|
+
setDragOverrides,
|
|
286
|
+
setPropStatuses,
|
|
287
|
+
]);
|
|
288
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
289
|
+
jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: colors_1.TRANSPARENT, strokeWidth: CROP_HANDLE_HIT_WIDTH, strokeLinejoin: "miter", vectorEffect: "non-scaling-stroke", pointerEvents: "stroke", cursor: cursor, onPointerDown: onPointerDown }), jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: colors_1.BLUE, strokeWidth: CROP_HANDLE_THICKNESS, strokeLinejoin: "miter", strokeLinecap: "butt", vectorEffect: "non-scaling-stroke", pointerEvents: "none", style: { filter: colors_1.SELECTED_OUTLINE_DROP_SHADOW } })
|
|
290
|
+
] }));
|
|
291
|
+
};
|
|
292
|
+
const SelectedOutlineCropControls = ({ outline, onDraggingChange, target }) => {
|
|
293
|
+
useCropPreview(target);
|
|
294
|
+
if ((target === null || target === void 0 ? void 0 : target.cropDrag) === null || (target === null || target === void 0 ? void 0 : target.cropDrag) === undefined) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
return (jsx_runtime_1.jsx("g", { "aria-hidden": "true", children: cropHandles.map((handle) => (jsx_runtime_1.jsx(CropHandle, { handle: handle, outline: outline, onDraggingChange: onDraggingChange, target: target }, handle))) }));
|
|
298
|
+
};
|
|
299
|
+
exports.SelectedOutlineCropControls = SelectedOutlineCropControls;
|
|
@@ -43,6 +43,7 @@ const colors_1 = require("../helpers/colors");
|
|
|
43
43
|
const format_file_location_1 = require("../helpers/format-file-location");
|
|
44
44
|
const get_connected_compositions_1 = require("../helpers/get-connected-compositions");
|
|
45
45
|
const get_sequence_double_click_action_1 = require("../helpers/get-sequence-double-click-action");
|
|
46
|
+
const interactivity_enabled_1 = require("../helpers/interactivity-enabled");
|
|
46
47
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
47
48
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
48
49
|
const modals_1 = require("../state/modals");
|
|
@@ -58,6 +59,7 @@ const selected_outline_measurement_1 = require("./selected-outline-measurement")
|
|
|
58
59
|
const selected_outline_snap_1 = require("./selected-outline-snap");
|
|
59
60
|
const selected_outline_types_1 = require("./selected-outline-types");
|
|
60
61
|
const selected_outline_uv_1 = require("./selected-outline-uv");
|
|
62
|
+
const SelectedOutlineCropControls_1 = require("./SelectedOutlineCropControls");
|
|
61
63
|
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
62
64
|
const disable_sequence_interactivity_1 = require("./Timeline/disable-sequence-interactivity");
|
|
63
65
|
const duplicate_selected_timeline_item_1 = require("./Timeline/duplicate-selected-timeline-item");
|
|
@@ -71,10 +73,12 @@ const transform_origin_utils_1 = require("./Timeline/transform-origin-utils");
|
|
|
71
73
|
const use_select_asset_1 = require("./use-select-asset");
|
|
72
74
|
const emptyContextMenuValues = [];
|
|
73
75
|
const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, target }) => {
|
|
74
|
-
var _a;
|
|
76
|
+
var _a, _b;
|
|
75
77
|
const { setDragOverrides, clearDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
76
78
|
const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
77
79
|
const transformOriginDrag = (_a = target === null || target === void 0 ? void 0 : target.transformOriginDrag) !== null && _a !== void 0 ? _a : null;
|
|
80
|
+
const crop = target === null || target === void 0 ? void 0 : target.crop;
|
|
81
|
+
const transformOriginPoints = (_b = outline.uncroppedPoints) !== null && _b !== void 0 ? _b : outline.points;
|
|
78
82
|
const parsed = (0, react_1.useMemo)(() => transformOriginDrag === null
|
|
79
83
|
? null
|
|
80
84
|
: (0, transform_origin_utils_1.parseTransformOrigin)(transformOriginDrag.originValue), [transformOriginDrag]);
|
|
@@ -88,7 +92,7 @@ const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, targe
|
|
|
88
92
|
height: outline.dimensions.height,
|
|
89
93
|
});
|
|
90
94
|
}, [outline.dimensions, parsed]);
|
|
91
|
-
const position = (0, react_1.useMemo)(() => (uv === null ? null : (0, selected_outline_uv_1.getUvHandlePosition)(
|
|
95
|
+
const position = (0, react_1.useMemo)(() => (uv === null ? null : (0, selected_outline_uv_1.getUvHandlePosition)(transformOriginPoints, uv)), [transformOriginPoints, uv]);
|
|
92
96
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
93
97
|
if (event.button !== 0 ||
|
|
94
98
|
transformOriginDrag === null ||
|
|
@@ -125,7 +129,7 @@ const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, targe
|
|
|
125
129
|
x: currentPointerX - svgRect.left,
|
|
126
130
|
y: currentPointerY - svgRect.top,
|
|
127
131
|
};
|
|
128
|
-
const rawUv = (0, selected_outline_uv_1.getUvCoordinateForPoint)(
|
|
132
|
+
const rawUv = (0, selected_outline_uv_1.getUvCoordinateForPoint)(transformOriginPoints, point);
|
|
129
133
|
const lockedAxis = (0, selected_outline_drag_1.getSelectedOutlineTransformOriginLockedAxis)({
|
|
130
134
|
axisLocked,
|
|
131
135
|
dimensions,
|
|
@@ -139,11 +143,13 @@ const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, targe
|
|
|
139
143
|
});
|
|
140
144
|
const snapPoint = lockedAxis === null
|
|
141
145
|
? point
|
|
142
|
-
: (0, selected_outline_uv_1.getUvHandlePosition)(
|
|
146
|
+
: (0, selected_outline_uv_1.getUvHandlePosition)(transformOriginPoints, axisLockedUv);
|
|
143
147
|
const snappedUv = editorSnapping
|
|
144
148
|
? (0, selected_outline_drag_1.snapSelectedOutlineTransformOriginUv)({
|
|
149
|
+
crop: crop !== null && crop !== void 0 ? crop : null,
|
|
145
150
|
point: snapPoint,
|
|
146
|
-
points:
|
|
151
|
+
points: transformOriginPoints,
|
|
152
|
+
thresholdPx: null,
|
|
147
153
|
uv: axisLockedUv,
|
|
148
154
|
})
|
|
149
155
|
: axisLockedUv;
|
|
@@ -273,6 +279,7 @@ const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, targe
|
|
|
273
279
|
window.addEventListener('keyup', onKeyChange);
|
|
274
280
|
}, [
|
|
275
281
|
clearDragOverrides,
|
|
282
|
+
crop,
|
|
276
283
|
editorSnapping,
|
|
277
284
|
onDraggingChange,
|
|
278
285
|
outline,
|
|
@@ -280,6 +287,7 @@ const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, targe
|
|
|
280
287
|
setDragOverrides,
|
|
281
288
|
setPropStatuses,
|
|
282
289
|
transformOriginDrag,
|
|
290
|
+
transformOriginPoints,
|
|
283
291
|
uv,
|
|
284
292
|
]);
|
|
285
293
|
if (transformOriginDrag === null ||
|
|
@@ -743,6 +751,7 @@ const SelectedOutlineRotationCornerHandle = ({ allRotationDragTargets, contextMe
|
|
|
743
751
|
const circleRef = (0, react_1.useRef)(null);
|
|
744
752
|
const cornerInfo = (0, react_1.useMemo)(() => (0, selected_outline_measurement_1.getSelectedOutlineRotationCornerInfo)(outline.points, corner), [corner, outline.points]);
|
|
745
753
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
754
|
+
var _a;
|
|
746
755
|
if (event.button !== 0 || rotationDrag === null) {
|
|
747
756
|
return;
|
|
748
757
|
}
|
|
@@ -770,7 +779,7 @@ const SelectedOutlineRotationCornerHandle = ({ allRotationDragTargets, contextMe
|
|
|
770
779
|
const svgRect = svg.getBoundingClientRect();
|
|
771
780
|
const center = svgPointToClientPoint((0, selected_outline_measurement_1.getSelectedOutlineRotationPivot)({
|
|
772
781
|
dimensions: outline.dimensions,
|
|
773
|
-
points: outline.points,
|
|
782
|
+
points: (_a = outline.uncroppedPoints) !== null && _a !== void 0 ? _a : outline.points,
|
|
774
783
|
transformOriginValue: rotationDrag.transformOriginValue,
|
|
775
784
|
}), svgRect);
|
|
776
785
|
const dragStates = (0, selected_outline_drag_1.getSelectedOutlineRotationDragStates)({
|
|
@@ -924,6 +933,7 @@ const SelectedOutlineRotationCornerHandle = ({ allRotationDragTargets, contextMe
|
|
|
924
933
|
onDraggingChange,
|
|
925
934
|
outline.dimensions,
|
|
926
935
|
outline.points,
|
|
936
|
+
outline.uncroppedPoints,
|
|
927
937
|
onSelect,
|
|
928
938
|
rotationDrag,
|
|
929
939
|
selected,
|
|
@@ -1006,7 +1016,7 @@ const SelectedOutlineElement = ({ allDragTargets, allDragOutlines, allRotationDr
|
|
|
1006
1016
|
selectComposition,
|
|
1007
1017
|
]);
|
|
1008
1018
|
const onContextMenuOpen = react_1.default.useCallback(async () => {
|
|
1009
|
-
if (target === undefined
|
|
1019
|
+
if (target === undefined) {
|
|
1010
1020
|
return false;
|
|
1011
1021
|
}
|
|
1012
1022
|
if (!target.selected) {
|
|
@@ -1025,11 +1035,15 @@ const SelectedOutlineElement = ({ allDragTargets, allDragOutlines, allRotationDr
|
|
|
1025
1035
|
: null;
|
|
1026
1036
|
const assetLinkInfo = mediaSrc ? (0, timeline_asset_link_1.getTimelineAssetLinkInfo)(mediaSrc) : null;
|
|
1027
1037
|
const canOpenInEditor = Boolean(window.remotion_editorName && originalLocation);
|
|
1028
|
-
const
|
|
1029
|
-
const
|
|
1038
|
+
const sourceEditingEnabled = (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
1039
|
+
const disableInteractivityDisabled = !sourceEditingEnabled || !target.sequence.showInTimeline;
|
|
1040
|
+
const sourceEditDisabled = !sourceEditingEnabled ||
|
|
1041
|
+
!target.sequence.controls ||
|
|
1042
|
+
!nodePath.absolutePath;
|
|
1030
1043
|
const canAddEffect = target.nodePathInfo.supportsEffects &&
|
|
1031
1044
|
!sourceEditDisabled &&
|
|
1032
1045
|
previewServerState.type === 'connected';
|
|
1046
|
+
const canCrop = target.canCrop && !sourceEditDisabled;
|
|
1033
1047
|
return (0, get_sequence_context_menu_items_1.getSequenceContextMenuItems)({
|
|
1034
1048
|
assetLinkInfo,
|
|
1035
1049
|
canOpenInEditor,
|
|
@@ -1037,7 +1051,7 @@ const SelectedOutlineElement = ({ allDragTargets, allDragOutlines, allRotationDr
|
|
|
1037
1051
|
disableInteractivityDisabled,
|
|
1038
1052
|
duplicateDisabled: sourceEditDisabled,
|
|
1039
1053
|
fileLocation,
|
|
1040
|
-
includeSourceEditItems:
|
|
1054
|
+
includeSourceEditItems: sourceEditingEnabled,
|
|
1041
1055
|
onDeleteSequenceFromSource: async () => {
|
|
1042
1056
|
if (sourceEditDisabled || previewServerState.type !== 'connected') {
|
|
1043
1057
|
return;
|
|
@@ -1063,10 +1077,7 @@ const SelectedOutlineElement = ({ allDragTargets, allDragOutlines, allRotationDr
|
|
|
1063
1077
|
},
|
|
1064
1078
|
],
|
|
1065
1079
|
});
|
|
1066
|
-
if (result.success) {
|
|
1067
|
-
(0, NotificationCenter_1.showNotification)('Removed sequence from source file', 2000);
|
|
1068
|
-
}
|
|
1069
|
-
else {
|
|
1080
|
+
if (!result.success) {
|
|
1070
1081
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
1071
1082
|
}
|
|
1072
1083
|
}
|
|
@@ -1103,39 +1114,65 @@ const SelectedOutlineElement = ({ allDragTargets, allDragOutlines, allRotationDr
|
|
|
1103
1114
|
originalLocation,
|
|
1104
1115
|
selectAsset,
|
|
1105
1116
|
sequence: target.sequence,
|
|
1106
|
-
sourceActions:
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1117
|
+
sourceActions: sourceEditingEnabled
|
|
1118
|
+
? [
|
|
1119
|
+
...(target.nodePathInfo.supportsEffects
|
|
1120
|
+
? [
|
|
1121
|
+
{
|
|
1122
|
+
type: 'item',
|
|
1123
|
+
id: 'add-effect',
|
|
1124
|
+
keyHint: null,
|
|
1125
|
+
label: 'Add effect...',
|
|
1126
|
+
leftItem: null,
|
|
1127
|
+
disabled: !canAddEffect,
|
|
1128
|
+
onClick: () => {
|
|
1129
|
+
if (!canAddEffect ||
|
|
1130
|
+
previewServerState.type !== 'connected') {
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
setSelectedModal({
|
|
1134
|
+
type: 'add-effect',
|
|
1135
|
+
clientId: previewServerState.clientId,
|
|
1136
|
+
fileName: nodePath.absolutePath,
|
|
1137
|
+
nodePath,
|
|
1138
|
+
});
|
|
1139
|
+
},
|
|
1140
|
+
quickSwitcherLabel: null,
|
|
1141
|
+
subMenu: null,
|
|
1142
|
+
value: 'add-effect',
|
|
1127
1143
|
},
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1144
|
+
]
|
|
1145
|
+
: []),
|
|
1146
|
+
{
|
|
1147
|
+
type: 'item',
|
|
1148
|
+
id: 'crop',
|
|
1149
|
+
keyHint: null,
|
|
1150
|
+
label: 'Crop',
|
|
1151
|
+
leftItem: null,
|
|
1152
|
+
disabled: !canCrop,
|
|
1153
|
+
onClick: () => {
|
|
1154
|
+
if (!canCrop) {
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
onSelect({
|
|
1158
|
+
type: 'sequence-prop',
|
|
1159
|
+
nodePathInfo: {
|
|
1160
|
+
...target.nodePathInfo,
|
|
1161
|
+
auxiliaryKeys: ['controls', selected_outline_types_1.cropFieldKeys.left],
|
|
1162
|
+
},
|
|
1163
|
+
key: selected_outline_types_1.cropFieldKeys.left,
|
|
1164
|
+
}, { shiftKey: false, toggleKey: false });
|
|
1135
1165
|
},
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1166
|
+
quickSwitcherLabel: null,
|
|
1167
|
+
subMenu: null,
|
|
1168
|
+
value: 'crop',
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
type: 'divider',
|
|
1172
|
+
id: 'crop-divider',
|
|
1173
|
+
},
|
|
1174
|
+
]
|
|
1175
|
+
: [],
|
|
1139
1176
|
});
|
|
1140
1177
|
}, [
|
|
1141
1178
|
confirm,
|
|
@@ -1148,9 +1185,9 @@ const SelectedOutlineElement = ({ allDragTargets, allDragOutlines, allRotationDr
|
|
|
1148
1185
|
target,
|
|
1149
1186
|
]);
|
|
1150
1187
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
1151
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, snapTargets: snapTargets, target: target }), (target === null || target === void 0 ? void 0 : target.
|
|
1188
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, snapTargets: snapTargets, target: target }), jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: target }), (target === null || target === void 0 ? void 0 : target.cropDrag) === null && (target.containsSelection || hovered)
|
|
1152
1189
|
? ['top', 'right', 'bottom', 'left'].map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine, { allScaleDragTargets: allScaleDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, edge: edge, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: target }, edge)))
|
|
1153
|
-
: null, (target === null || target === void 0 ? void 0 : target.
|
|
1190
|
+
: null, (target === null || target === void 0 ? void 0 : target.cropDrag) === null && (target.containsSelection || hovered)
|
|
1154
1191
|
? ['top-left', 'top-right', 'bottom-right', 'bottom-left'].map((corner) => (jsx_runtime_1.jsx(SelectedOutlineRotationCornerHandle, { allRotationDragTargets: allRotationDragTargets, contextMenuValues: emptyContextMenuValues, corner: corner, dragging: dragging, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: target }, corner)))
|
|
1155
1192
|
: null] }));
|
|
1156
1193
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type SelectedOutline } from './selected-outline-geometry';
|
|
3
3
|
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
4
|
-
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginDragChanges, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineTransformOriginSnapThresholdPx, selectedOutlineUvSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineTransformOriginUv, snapSelectedOutlineUv, } from './selected-outline-drag';
|
|
5
|
-
export { getOutlineSelectionInteraction, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
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';
|
|
5
|
+
export { getOutlineSelectionInteraction, getSelectedCropInfo, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
6
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
7
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
8
8
|
type OutlineSequenceParent = {
|