@remotion/studio 4.0.485 → 4.0.487
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/ResolveCompositionConfigInStudio.js +42 -0
- package/dist/components/AssetSelector.js +1 -1
- package/dist/components/AssetSelectorItem.js +9 -9
- package/dist/components/AudioWaveform.js +3 -3
- package/dist/components/Button.js +2 -2
- package/dist/components/Canvas.js +28 -0
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ColorPicker/AlphaSlider.js +4 -3
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/ColorPicker/ColorPickerPopup.js +10 -10
- package/dist/components/ColorPicker/HueSlider.js +4 -3
- package/dist/components/ColorPicker/SaturationValueArea.js +5 -4
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/ColorPicker/checker.js +3 -3
- package/dist/components/CompactExplanation.js +3 -3
- package/dist/components/CompositionSelector.js +141 -5
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +103 -11
- package/dist/components/ContextMenu.js +2 -1
- package/dist/components/CopyButton.js +3 -2
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +15 -2
- package/dist/components/CurrentComposition.js +43 -2
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EffectPickerModal.js +1 -1
- package/dist/components/FilePreview.js +2 -1
- package/dist/components/FpsCounter.js +3 -2
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +19 -12
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +12 -7
- package/dist/components/InspectorInfoHeader.js +2 -2
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +2 -2
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/common.js +2 -2
- package/dist/components/InspectorPanel/styles.js +3 -3
- package/dist/components/InspectorPanel.d.ts +1 -0
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.js +1 -1
- package/dist/components/InspectorSourceLocation.d.ts +1 -0
- package/dist/components/InspectorSourceLocation.js +18 -3
- package/dist/components/InstallablePackage.js +1 -1
- package/dist/components/KeyboardShortcutsExplainer.js +9 -5
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuSubItem.js +1 -1
- package/dist/components/Menu/styles.js +3 -3
- package/dist/components/MenuToolbar.js +2 -2
- package/dist/components/ModalButton.js +1 -1
- package/dist/components/ModalContainer.js +3 -3
- package/dist/components/ModalFooter.js +2 -1
- package/dist/components/ModalHeader.js +3 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CancelButton.js +4 -3
- package/dist/components/NewComposition/ComboBox.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +11 -3
- package/dist/components/NewComposition/MenuContent.js +1 -1
- package/dist/components/NewComposition/NewComposition.js +4 -1
- package/dist/components/NewComposition/NewFolder.d.ts +5 -0
- package/dist/components/NewComposition/NewFolder.js +86 -0
- package/dist/components/NewComposition/RemInput.js +3 -3
- package/dist/components/NewComposition/RemTextarea.js +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +20 -59
- package/dist/components/NewComposition/ValidationMessage.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.d.ts +18 -0
- package/dist/components/NewComposition/use-rename-static-file.js +90 -0
- package/dist/components/NoRegisterRoot.js +3 -2
- package/dist/components/Notifications/ColorDot.js +3 -2
- package/dist/components/Notifications/Notification.js +4 -4
- package/dist/components/Notifications/NotificationCenter.js +2 -1
- package/dist/components/Notifications/ServerDisconnected.js +5 -4
- package/dist/components/OptionsPanel.js +1 -1
- package/dist/components/OutlineToggle.js +1 -1
- package/dist/components/PlayPause.js +4 -3
- package/dist/components/Preview.js +1 -1
- package/dist/components/PreviewToolbar.js +3 -2
- package/dist/components/QuickSwitcher/AlgoliaCredit.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +2 -2
- package/dist/components/RefreshCompositionOverlay.js +2 -1
- package/dist/components/RenderButton.js +10 -9
- package/dist/components/RenderModal/CliCopyButton.js +1 -1
- package/dist/components/RenderModal/ClientRenderProgress.js +1 -1
- package/dist/components/RenderModal/DataEditor.js +1 -1
- package/dist/components/RenderModal/GuiRenderStatus.js +1 -1
- package/dist/components/RenderModal/InfoBubble.js +2 -2
- package/dist/components/RenderModal/InfoTooltip.js +3 -3
- package/dist/components/RenderModal/InlineEyeIcon.js +2 -1
- package/dist/components/RenderModal/InlineRemoveButton.js +2 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +1 -1
- package/dist/components/RenderModal/OptionExplainer.d.ts +11 -1
- package/dist/components/RenderModal/OptionExplainer.js +33 -13
- package/dist/components/RenderModal/OptionExplainerBubble.d.ts +15 -1
- package/dist/components/RenderModal/OptionExplainerBubble.js +17 -3
- package/dist/components/RenderModal/RenderModalHr.js +2 -1
- package/dist/components/RenderModal/RenderStatusModal.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +6 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +1 -2
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +2 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.js +4 -6
- package/dist/components/RenderModal/WebRenderModal.js +5 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +3 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +92 -5
- package/dist/components/RenderModal/WebRenderModalAudio.js +4 -3
- package/dist/components/RenderModal/WebRenderModalBasic.js +2 -2
- package/dist/components/RenderModal/WebRenderModalLicense.js +2 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +2 -1
- package/dist/components/RenderModal/render-modals.js +3 -3
- package/dist/components/RenderPreview.js +1 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +1 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/client-side-render-types.d.ts +2 -1
- package/dist/components/RenderQueue/index.js +1 -1
- package/dist/components/RendersTab.js +2 -2
- package/dist/components/SegmentedControl.js +3 -3
- package/dist/components/SelectedOutlineElement.d.ts +9 -0
- package/dist/components/SelectedOutlineElement.js +63 -18
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -0
- package/dist/components/SelectedOutlineOverlay.js +53 -2
- package/dist/components/SelectedOutlineUvControls.js +18 -11
- package/dist/components/SidebarCollapserControls.js +5 -4
- package/dist/components/SnappingProvider.d.ts +4 -0
- package/dist/components/SnappingProvider.js +24 -0
- package/dist/components/SnappingToggle.d.ts +2 -0
- package/dist/components/SnappingToggle.js +26 -0
- package/dist/components/Splitter/SplitterContext.d.ts +1 -1
- package/dist/components/Splitter/SplitterElement.js +2 -1
- package/dist/components/StaticFilePreview.js +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/vertical.js +3 -3
- package/dist/components/TextViewer.js +2 -1
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/EasingEditorModal.js +8 -8
- package/dist/components/Timeline/KeyframeSettingsModal.js +1 -1
- package/dist/components/Timeline/LoopedIndicator.js +2 -2
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -2
- package/dist/components/Timeline/TimelineArrayField.js +6 -5
- package/dist/components/Timeline/TimelineColorField.js +2 -1
- package/dist/components/Timeline/TimelineEffectItem.js +3 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -2
- package/dist/components/Timeline/TimelineExpandArrowButton.js +3 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +2 -1
- package/dist/components/Timeline/TimelineFontFamilyField.d.ts +11 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +545 -0
- package/dist/components/Timeline/TimelineImageInfo.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointer.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -4
- package/dist/components/Timeline/TimelineKeyframeControls.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +1 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +3 -3
- package/dist/components/Timeline/TimelineMediaInfo.js +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineRotationField.js +4 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSchemaField.d.ts +2 -0
- package/dist/components/Timeline/TimelineSchemaField.js +47 -7
- package/dist/components/Timeline/TimelineScrollable.js +3 -2
- package/dist/components/Timeline/TimelineSelection.js +11 -6
- package/dist/components/Timeline/TimelineSequence.js +17 -20
- package/dist/components/Timeline/TimelineSequenceFrame.js +3 -2
- package/dist/components/Timeline/TimelineSequenceItem.js +8 -7
- package/dist/components/Timeline/TimelineSequenceName.js +3 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +2 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +20 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -11
- package/dist/components/Timeline/TimelineSlider.js +2 -1
- package/dist/components/Timeline/TimelineSliderHandle.js +2 -1
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +2 -1
- package/dist/components/Timeline/TimelineZoomControls.js +4 -3
- package/dist/components/Timeline/call-move-keyframe.d.ts +5 -0
- package/dist/components/Timeline/call-move-keyframe.js +14 -3
- package/dist/components/Timeline/google-fonts-list.d.ts +6 -0
- package/dist/components/Timeline/google-fonts-list.js +1512 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +8 -1
- package/dist/components/Timeline/save-sequence-prop.js +63 -19
- package/dist/components/Timeline/timeline-rotation-field-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-rotation-field-utils.js +16 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +5 -2
- package/dist/components/TimelineInOutToggle.js +1 -1
- package/dist/components/UpdateCheck.js +2 -2
- package/dist/components/UpdateModal/OpenIssueButton.js +1 -1
- package/dist/components/VisualControls/ClickableFileName.js +4 -4
- package/dist/components/VisualControls/VisualControlsContent.js +9 -1
- package/dist/components/effect-drag-and-drop.js +30 -8
- package/dist/components/import-assets.d.ts +8 -2
- package/dist/components/import-assets.js +55 -1
- package/dist/components/options-sidebar-tabs.d.ts +1 -0
- package/dist/components/options-sidebar-tabs.js +6 -1
- package/dist/components/selected-outline-measurement.js +2 -1
- package/dist/components/selected-outline-snap.d.ts +36 -0
- package/dist/components/selected-outline-snap.js +158 -0
- package/dist/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +2 -2
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +7 -5
- package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +2 -2
- package/dist/error-overlay/remotion-overlay/DismissButton.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorMessage.js +4 -4
- package/dist/error-overlay/remotion-overlay/HelpLink.js +1 -1
- package/dist/error-overlay/remotion-overlay/MediaPlaybackErrorExplainer.js +4 -4
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -3
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +2 -1
- package/dist/error-overlay/remotion-overlay/carets.js +3 -2
- package/dist/esm/chunk-jefhcs5z.js +164 -0
- package/dist/esm/{chunk-103pp4n7.js → chunk-y2t24cx0.js} +10754 -6829
- package/dist/esm/internals.mjs +10755 -6796
- package/dist/esm/previewEntry.mjs +10554 -6591
- package/dist/esm/renderEntry.mjs +8 -5
- package/dist/helpers/checkerboard-background.js +4 -12
- package/dist/helpers/colors.d.ts +99 -7
- package/dist/helpers/colors.js +118 -10
- package/dist/helpers/inject-css.js +85 -83
- package/dist/helpers/retry-payload.js +1 -0
- package/dist/helpers/timeline-layout.d.ts +4 -2
- package/dist/helpers/use-menu-structure.js +74 -5
- package/dist/helpers/validate-folder-rename.js +2 -10
- package/dist/helpers/validate-new-folder-name.d.ts +5 -0
- package/dist/helpers/validate-new-folder-name.js +16 -0
- package/dist/hot-middleware-client/client.js +3 -2
- package/dist/icons/Checkmark.js +2 -1
- package/dist/icons/audio.js +2 -1
- package/dist/icons/caret.js +2 -2
- package/dist/icons/certificate.js +2 -1
- package/dist/icons/data.js +2 -1
- package/dist/icons/eyedropper.js +2 -1
- package/dist/icons/file.js +2 -1
- package/dist/icons/frame.js +2 -1
- package/dist/icons/gear.js +2 -1
- package/dist/icons/gif.js +2 -1
- package/dist/icons/jump-to-start.js +2 -1
- package/dist/icons/keys.js +4 -3
- package/dist/icons/magnet.d.ts +3 -0
- package/dist/icons/magnet.js +8 -0
- package/dist/icons/media-volume.js +1 -1
- package/dist/icons/minus.js +2 -1
- package/dist/icons/pause.js +2 -1
- package/dist/icons/play.js +2 -1
- package/dist/icons/react.d.ts +5 -0
- package/dist/icons/react.js +8 -0
- package/dist/icons/redo.js +2 -1
- package/dist/icons/step-back.js +2 -1
- package/dist/icons/step-forward.js +2 -1
- package/dist/icons/undo.js +2 -1
- package/dist/previewEntry.js +2 -1
- package/dist/renderEntry.js +4 -3
- package/dist/state/editor-guides.d.ts +2 -2
- package/dist/state/editor-snapping.d.ts +8 -0
- package/dist/state/editor-snapping.js +18 -0
- package/dist/state/modals.d.ts +6 -1
- package/package.json +12 -12
- package/dist/esm/chunk-6jf1natv.js +0 -25
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type SaveSequencePropSourceEdit } from '@remotion/studio-shared';
|
|
1
2
|
import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
|
|
3
|
+
import { type MoveEffectKeyframeChange, type MoveSequenceKeyframeChange } from './call-move-keyframe';
|
|
2
4
|
export type SetPropStatuses = (nodePath: SequencePropsSubscriptionKey, values: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse) => void;
|
|
3
5
|
export type SaveSequencePropChange = {
|
|
4
6
|
fileName: string;
|
|
@@ -7,13 +9,18 @@ export type SaveSequencePropChange = {
|
|
|
7
9
|
value: unknown;
|
|
8
10
|
defaultValue: string | null;
|
|
9
11
|
schema: InteractivitySchema;
|
|
12
|
+
sourceEdit?: SaveSequencePropSourceEdit;
|
|
10
13
|
};
|
|
11
14
|
type SaveSequencePropsOptions = {
|
|
12
15
|
changes: SaveSequencePropChange[];
|
|
16
|
+
movedKeyframes?: {
|
|
17
|
+
sequenceKeyframes: MoveSequenceKeyframeChange[];
|
|
18
|
+
effectKeyframes: MoveEffectKeyframeChange[];
|
|
19
|
+
};
|
|
13
20
|
setPropStatuses: SetPropStatuses;
|
|
14
21
|
clientId: string;
|
|
15
22
|
undoLabel: string;
|
|
16
23
|
redoLabel: string;
|
|
17
24
|
};
|
|
18
|
-
export declare const saveSequenceProps: ({ changes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveSequencePropsOptions) => Promise<void>;
|
|
25
|
+
export declare const saveSequenceProps: ({ changes, movedKeyframes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveSequencePropsOptions) => Promise<void>;
|
|
19
26
|
export {};
|
|
@@ -3,12 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.saveSequenceProps = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
|
+
const call_move_keyframe_1 = require("./call-move-keyframe");
|
|
6
7
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
8
|
+
const serializeSequencePropValue = (value) => {
|
|
9
|
+
if (value === undefined) {
|
|
10
|
+
return { type: 'undefined' };
|
|
11
|
+
}
|
|
12
|
+
return { type: 'json', serialized: JSON.stringify(value) };
|
|
13
|
+
};
|
|
14
|
+
const saveSequenceProps = ({ changes, movedKeyframes, setPropStatuses, clientId, undoLabel, redoLabel, }) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const sequenceKeyframes = (_a = movedKeyframes === null || movedKeyframes === void 0 ? void 0 : movedKeyframes.sequenceKeyframes) !== null && _a !== void 0 ? _a : [];
|
|
17
|
+
const effectKeyframes = (_b = movedKeyframes === null || movedKeyframes === void 0 ? void 0 : movedKeyframes.effectKeyframes) !== null && _b !== void 0 ? _b : [];
|
|
18
|
+
if (changes.length === 0 &&
|
|
19
|
+
sequenceKeyframes.length === 0 &&
|
|
20
|
+
effectKeyframes.length === 0) {
|
|
9
21
|
return Promise.resolve();
|
|
10
22
|
}
|
|
11
|
-
if (changes.length === 1
|
|
23
|
+
if (changes.length === 1 &&
|
|
24
|
+
sequenceKeyframes.length === 0 &&
|
|
25
|
+
effectKeyframes.length === 0) {
|
|
12
26
|
const change = changes[0];
|
|
13
27
|
if (change === undefined) {
|
|
14
28
|
throw new Error('Expected a sequence prop change');
|
|
@@ -23,24 +37,33 @@ const saveSequenceProps = ({ changes, setPropStatuses, clientId, undoLabel, redo
|
|
|
23
37
|
defaultValue: change.defaultValue,
|
|
24
38
|
schema: change.schema,
|
|
25
39
|
}),
|
|
26
|
-
apiCall: () =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
apiCall: () => {
|
|
41
|
+
var _a;
|
|
42
|
+
return (0, call_api_1.callApi)('/api/save-sequence-props', {
|
|
43
|
+
edits: [
|
|
44
|
+
{
|
|
45
|
+
fileName: change.fileName,
|
|
46
|
+
nodePath: change.nodePath,
|
|
47
|
+
key: change.fieldKey,
|
|
48
|
+
value: serializeSequencePropValue(change.value),
|
|
49
|
+
defaultValue: change.defaultValue,
|
|
50
|
+
schema: change.schema,
|
|
51
|
+
sourceEdit: (_a = change.sourceEdit) !== null && _a !== void 0 ? _a : null,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
clientId,
|
|
55
|
+
undoLabel,
|
|
56
|
+
redoLabel,
|
|
57
|
+
});
|
|
58
|
+
},
|
|
41
59
|
errorLabel: 'Could not save sequence prop',
|
|
42
60
|
});
|
|
43
61
|
}
|
|
62
|
+
(0, call_move_keyframe_1.applyOptimisticKeyframeMoves)({
|
|
63
|
+
sequenceKeyframes,
|
|
64
|
+
effectKeyframes,
|
|
65
|
+
setPropStatuses,
|
|
66
|
+
});
|
|
44
67
|
for (const change of changes) {
|
|
45
68
|
setPropStatuses(change.nodePath, (prev) => (0, studio_shared_1.optimisticUpdateForPropStatuses)({
|
|
46
69
|
previous: prev,
|
|
@@ -52,15 +75,36 @@ const saveSequenceProps = ({ changes, setPropStatuses, clientId, undoLabel, redo
|
|
|
52
75
|
}
|
|
53
76
|
return (0, call_api_1.callApi)('/api/save-sequence-props', {
|
|
54
77
|
edits: changes.map((change) => {
|
|
78
|
+
var _a;
|
|
55
79
|
return {
|
|
56
80
|
fileName: change.fileName,
|
|
57
81
|
nodePath: change.nodePath,
|
|
58
82
|
key: change.fieldKey,
|
|
59
|
-
value:
|
|
83
|
+
value: serializeSequencePropValue(change.value),
|
|
60
84
|
defaultValue: change.defaultValue,
|
|
61
85
|
schema: change.schema,
|
|
86
|
+
sourceEdit: (_a = change.sourceEdit) !== null && _a !== void 0 ? _a : null,
|
|
62
87
|
};
|
|
63
88
|
}),
|
|
89
|
+
movedKeyframes: {
|
|
90
|
+
sequenceKeyframes: sequenceKeyframes.map((keyframe) => ({
|
|
91
|
+
fileName: keyframe.fileName,
|
|
92
|
+
nodePath: keyframe.nodePath,
|
|
93
|
+
key: keyframe.fieldKey,
|
|
94
|
+
fromFrame: keyframe.fromFrame,
|
|
95
|
+
toFrame: keyframe.toFrame,
|
|
96
|
+
schema: keyframe.schema,
|
|
97
|
+
})),
|
|
98
|
+
effectKeyframes: effectKeyframes.map((keyframe) => ({
|
|
99
|
+
fileName: keyframe.fileName,
|
|
100
|
+
sequenceNodePath: keyframe.nodePath,
|
|
101
|
+
effectIndex: keyframe.effectIndex,
|
|
102
|
+
key: keyframe.fieldKey,
|
|
103
|
+
fromFrame: keyframe.fromFrame,
|
|
104
|
+
toFrame: keyframe.toFrame,
|
|
105
|
+
schema: keyframe.schema,
|
|
106
|
+
})),
|
|
107
|
+
},
|
|
64
108
|
clientId,
|
|
65
109
|
undoLabel,
|
|
66
110
|
redoLabel,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatTimelineRotationFieldValue = void 0;
|
|
4
|
+
const timeline_field_display_utils_1 = require("./timeline-field-display-utils");
|
|
5
|
+
const timeline_rotation_utils_1 = require("./timeline-rotation-utils");
|
|
6
|
+
const formatTimelineRotationFieldValue = ({ decimalPlaces, fieldSchema, value, }) => {
|
|
7
|
+
return (0, timeline_field_display_utils_1.formatTimelineFieldValueForDisplay)({
|
|
8
|
+
fieldSchema,
|
|
9
|
+
value: fieldSchema.type === 'rotation-css' &&
|
|
10
|
+
typeof value === 'number' &&
|
|
11
|
+
Number.isFinite(value)
|
|
12
|
+
? (0, timeline_rotation_utils_1.serializeCssRotation)(value, decimalPlaces)
|
|
13
|
+
: value,
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
exports.formatTimelineRotationFieldValue = formatTimelineRotationFieldValue;
|
|
@@ -172,9 +172,12 @@ const getFrameIncrement = (durationInFrames) => {
|
|
|
172
172
|
return (0, exports.getFrameIncrementFromWidth)(durationInFrames, width);
|
|
173
173
|
};
|
|
174
174
|
const getFrameIncrementFromWidth = (durationInFrames, width) => {
|
|
175
|
-
return (width
|
|
175
|
+
return getUsableTimelineWidth(width) / durationInFrames;
|
|
176
176
|
};
|
|
177
177
|
exports.getFrameIncrementFromWidth = getFrameIncrementFromWidth;
|
|
178
|
+
const getUsableTimelineWidth = (width) => {
|
|
179
|
+
return Math.max(1, width - timeline_layout_1.TIMELINE_PADDING * 2);
|
|
180
|
+
};
|
|
178
181
|
const getFrameWhileScrollingRight = ({ durationInFrames, width, }) => {
|
|
179
182
|
var _a, _b;
|
|
180
183
|
const nextFrame = calculateFrameWhileScrollingRight({
|
|
@@ -193,7 +196,7 @@ const getFrameWhileScrollingRight = ({ durationInFrames, width, }) => {
|
|
|
193
196
|
exports.getFrameWhileScrollingRight = getFrameWhileScrollingRight;
|
|
194
197
|
const getFrameFromX = ({ clientX, durationInFrames, width, extrapolate, }) => {
|
|
195
198
|
const pos = clientX - timeline_layout_1.TIMELINE_PADDING;
|
|
196
|
-
const frame = Math.min(durationInFrames - 1, Math.round((0, remotion_1.interpolate)(pos, [0, width
|
|
199
|
+
const frame = Math.min(durationInFrames - 1, Math.round((0, remotion_1.interpolate)(pos, [0, getUsableTimelineWidth(width)], [0, durationInFrames], {
|
|
197
200
|
extrapolateLeft: extrapolate,
|
|
198
201
|
extrapolateRight: extrapolate,
|
|
199
202
|
})));
|
|
@@ -239,7 +239,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
239
239
|
};
|
|
240
240
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
241
241
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
242
|
-
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ?
|
|
242
|
+
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? colors_1.WHITE : colors_1.BLUE, style: style }) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'O'), "aria-label": getTooltipText('Out', 'O'), onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? colors_1.WHITE : colors_1.BLUE, style: style }) })
|
|
243
243
|
] }));
|
|
244
244
|
};
|
|
245
245
|
exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
|
|
@@ -13,7 +13,7 @@ const buttonStyle = {
|
|
|
13
13
|
color: colors_1.BLUE,
|
|
14
14
|
border: 'none',
|
|
15
15
|
fontWeight: 'bold',
|
|
16
|
-
backgroundColor:
|
|
16
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
17
17
|
cursor: 'pointer',
|
|
18
18
|
fontSize: 14,
|
|
19
19
|
display: 'inline-flex',
|
|
@@ -90,6 +90,6 @@ const UpdateCheck = () => {
|
|
|
90
90
|
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: dynButtonStyle, onClick: openModal, type: "button", title: hasKnownBugs ? 'Bugfixes available' : 'Update available', children: hasKnownBugs ? ('Bugfixes available') : (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
|
91
91
|
height: 16,
|
|
92
92
|
width: 16,
|
|
93
|
-
}, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill:
|
|
93
|
+
}, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR_LOWERCASE, d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM135.1 217.4c-4.5 4.2-7.1 10.1-7.1 16.3c0 12.3 10 22.3 22.3 22.3H208v96c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V256h57.7c12.3 0 22.3-10 22.3-22.3c0-6.2-2.6-12.1-7.1-16.3L269.8 117.5c-3.8-3.5-8.7-5.5-13.8-5.5s-10.1 2-13.8 5.5L135.1 217.4z" }) })) }));
|
|
94
94
|
};
|
|
95
95
|
exports.UpdateCheck = UpdateCheck;
|
|
@@ -23,7 +23,7 @@ const OpenIssueButton = ({ link }) => {
|
|
|
23
23
|
window.open(link, '_blank');
|
|
24
24
|
}, [link]);
|
|
25
25
|
const svgFillColor = (0, react_1.useMemo)(() => {
|
|
26
|
-
return hovered ?
|
|
26
|
+
return hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT;
|
|
27
27
|
}, [hovered]);
|
|
28
28
|
const openInEditorSvg = (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: svgStyle, children: jsx_runtime_1.jsx("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
|
|
29
29
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
@@ -8,8 +8,8 @@ const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
|
8
8
|
const Fieldset_1 = require("../RenderModal/SchemaEditor/Fieldset");
|
|
9
9
|
const source_attribution_1 = require("../Timeline/TimelineStack/source-attribution");
|
|
10
10
|
const container = {
|
|
11
|
-
paddingLeft: Fieldset_1.
|
|
12
|
-
paddingTop: Fieldset_1.
|
|
11
|
+
paddingLeft: (0, Fieldset_1.getSchemaEditorFieldsetPadding)(),
|
|
12
|
+
paddingTop: (0, Fieldset_1.getSchemaEditorFieldsetPadding)() / 2,
|
|
13
13
|
};
|
|
14
14
|
const ClickableFileName = ({ originalFileName, }) => {
|
|
15
15
|
const [titleHovered, setTitleHovered] = (0, react_1.useState)(false);
|
|
@@ -24,8 +24,8 @@ const ClickableFileName = ({ originalFileName, }) => {
|
|
|
24
24
|
return {
|
|
25
25
|
fontSize: 12,
|
|
26
26
|
cursor: originalFileName.type === 'loaded' ? 'pointer' : undefined,
|
|
27
|
-
borderBottom: hoverEffect ?
|
|
28
|
-
color: hoverEffect ?
|
|
27
|
+
borderBottom: hoverEffect ? colors_1.BORDER_WHITE : 'none',
|
|
28
|
+
color: hoverEffect ? colors_1.WHITE_HEX : colors_1.LIGHT_COLOR,
|
|
29
29
|
};
|
|
30
30
|
}, [originalFileName, hoverEffect]);
|
|
31
31
|
const onClick = (0, react_1.useCallback)(async () => {
|
|
@@ -37,15 +37,23 @@ exports.VisualControlsContent = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const VisualControls_1 = require("../../visual-controls/VisualControls");
|
|
40
|
+
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
41
|
+
const Fieldset_1 = require("../RenderModal/SchemaEditor/Fieldset");
|
|
40
42
|
const SchemaSeparationLine_1 = require("../RenderModal/SchemaEditor/SchemaSeparationLine");
|
|
41
43
|
const VisualControlHandle_1 = require("./VisualControlHandle");
|
|
44
|
+
const rootInset = (0, Fieldset_1.getSchemaEditorRootInset)(InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING);
|
|
45
|
+
const container = {
|
|
46
|
+
boxSizing: 'border-box',
|
|
47
|
+
paddingLeft: rootInset,
|
|
48
|
+
paddingRight: rootInset,
|
|
49
|
+
};
|
|
42
50
|
const VisualControlsContent = () => {
|
|
43
51
|
const { handles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
|
|
44
52
|
const entries = Object.entries(handles);
|
|
45
53
|
if (entries.length === 0) {
|
|
46
54
|
return null;
|
|
47
55
|
}
|
|
48
|
-
return (jsx_runtime_1.jsx("div", { children: entries.map(([key, value], i) => {
|
|
56
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: entries.map(([key, value], i) => {
|
|
49
57
|
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
|
|
50
58
|
jsx_runtime_1.jsx(VisualControlHandle_1.VisualControlHandle, { keyName: key, value: value }), i === entries.length - 1 ? null : jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaSeparationLine, {})] }, key));
|
|
51
59
|
}) }));
|
|
@@ -8,7 +8,9 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
|
8
8
|
const hasEffectDragType = (dataTransfer) => {
|
|
9
9
|
const types = Array.from(dataTransfer.types);
|
|
10
10
|
const hasExplicitEffectType = types.includes(studio_shared_1.EFFECT_DRAG_MIME_TYPE);
|
|
11
|
-
if (!hasExplicitEffectType &&
|
|
11
|
+
if (!hasExplicitEffectType &&
|
|
12
|
+
(hasNonEffectRemotionDragType(dataTransfer) ||
|
|
13
|
+
hasNonRemotionImportableAssetDragType(dataTransfer))) {
|
|
12
14
|
return false;
|
|
13
15
|
}
|
|
14
16
|
return types.some((type) => type === studio_shared_1.EFFECT_DRAG_MIME_TYPE || isGenericDragType(type));
|
|
@@ -21,13 +23,33 @@ exports.hasExplicitEffectDragType = hasExplicitEffectDragType;
|
|
|
21
23
|
const isGenericDragType = (type) => {
|
|
22
24
|
return type === 'application/json' || type === 'text/plain';
|
|
23
25
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const isNonEffectRemotionDragType = (mimeType) => {
|
|
27
|
+
switch (mimeType) {
|
|
28
|
+
case studio_shared_1.EFFECT_DRAG_MIME_TYPE:
|
|
29
|
+
return false;
|
|
30
|
+
case studio_shared_1.ASSET_DRAG_MIME_TYPE:
|
|
31
|
+
case studio_shared_1.COMPOSITION_DRAG_MIME_TYPE:
|
|
32
|
+
case studio_shared_1.COMPONENT_DRAG_MIME_TYPE:
|
|
33
|
+
case studio_shared_1.ELEMENT_DRAG_MIME_TYPE:
|
|
34
|
+
case studio_shared_1.SFX_DRAG_MIME_TYPE:
|
|
35
|
+
return true;
|
|
36
|
+
default:
|
|
37
|
+
mimeType;
|
|
38
|
+
throw new Error(`Unhandled Remotion drag MIME type: ${mimeType}`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const hasNonEffectRemotionDragType = (dataTransfer) => {
|
|
42
|
+
return Array.from(dataTransfer.types).some((type) => {
|
|
43
|
+
if (!(0, studio_shared_1.isRemotionDragMimeType)(type)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return isNonEffectRemotionDragType(type);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const hasNonRemotionImportableAssetDragType = (dataTransfer) => {
|
|
50
|
+
return Array.from(dataTransfer.types).some((type) => {
|
|
51
|
+
return type === 'Files' || type === 'text/uri-list' || type === 'text/html';
|
|
52
|
+
});
|
|
31
53
|
};
|
|
32
54
|
const getEffectDragData = (dataTransfer) => {
|
|
33
55
|
for (const type of [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentProp, type FileType, type InsertableCompositionElementPosition } from '@remotion/studio-shared';
|
|
1
|
+
import { type CompositionDragData, type ComponentProp, type FileType, type InsertableCompositionElementPosition } from '@remotion/studio-shared';
|
|
2
2
|
import type { Dimensions } from '../helpers/is-current-selected-still';
|
|
3
3
|
export type InsertElementDropPosition = {
|
|
4
4
|
readonly centerX: number;
|
|
@@ -72,6 +72,12 @@ export declare const insertComponent: ({ component, compositionFile, composition
|
|
|
72
72
|
compositionId: string;
|
|
73
73
|
dropPosition: InsertElementDropPosition | null;
|
|
74
74
|
}) => Promise<void>;
|
|
75
|
+
export declare const insertComposition: ({ composition, compositionFile, compositionId, dropPosition, }: {
|
|
76
|
+
composition: CompositionDragData;
|
|
77
|
+
compositionFile: string;
|
|
78
|
+
compositionId: string;
|
|
79
|
+
dropPosition: InsertElementDropPosition | null;
|
|
80
|
+
}) => Promise<void>;
|
|
75
81
|
export declare const insertElement: ({ compositionFile, compositionId, dropPosition, element, }: {
|
|
76
82
|
compositionFile: string;
|
|
77
83
|
compositionId: string;
|
|
@@ -80,6 +86,6 @@ export declare const insertElement: ({ compositionFile, compositionId, dropPosit
|
|
|
80
86
|
slug: string;
|
|
81
87
|
displayName: string;
|
|
82
88
|
sourceCode: string;
|
|
83
|
-
dimensions: import("@remotion/studio-shared").ComponentDimensions;
|
|
89
|
+
dimensions: import("@remotion/studio-shared").ComponentDimensions | null;
|
|
84
90
|
};
|
|
85
91
|
}) => Promise<void>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertElement = exports.insertComponent = exports.insertExistingAssets = exports.insertRemoteAudio = exports.importRemoteAsset = exports.importAssets = exports.pickFilesToImport = exports.getComponentDimensions = exports.getAssetElementFromPath = exports.getAssetElement = void 0;
|
|
3
|
+
exports.insertElement = exports.insertComposition = exports.insertComponent = exports.insertExistingAssets = exports.insertRemoteAudio = exports.importRemoteAsset = exports.importAssets = exports.pickFilesToImport = exports.getComponentDimensions = exports.getAssetElementFromPath = exports.getAssetElement = void 0;
|
|
4
4
|
const media_utils_1 = require("@remotion/media-utils");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const no_react_1 = require("remotion/no-react");
|
|
7
8
|
const get_static_files_1 = require("../api/get-static-files");
|
|
8
9
|
const write_static_file_1 = require("../api/write-static-file");
|
|
9
10
|
const install_required_package_1 = require("../helpers/install-required-package");
|
|
@@ -569,6 +570,59 @@ const insertComponent = async ({ component, compositionFile, compositionId, drop
|
|
|
569
570
|
}
|
|
570
571
|
};
|
|
571
572
|
exports.insertComponent = insertComponent;
|
|
573
|
+
const serializeResolvedPropsForSourceCode = (props) => {
|
|
574
|
+
return no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
|
575
|
+
data: props,
|
|
576
|
+
indent: undefined,
|
|
577
|
+
staticBase: window.remotion_staticBase,
|
|
578
|
+
}).serializedString;
|
|
579
|
+
};
|
|
580
|
+
const insertComposition = async ({ composition, compositionFile, compositionId, dropPosition, }) => {
|
|
581
|
+
if (composition.compositionId === compositionId) {
|
|
582
|
+
(0, NotificationCenter_1.showNotification)('Cannot add a composition to itself', 3000);
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (composition.compositionFile === null) {
|
|
586
|
+
(0, NotificationCenter_1.showNotification)('Could not find composition source file', 3000);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
try {
|
|
590
|
+
const resolver = remotion_1.Internals.resolveCompositionsRef.current;
|
|
591
|
+
if (!resolver) {
|
|
592
|
+
throw new Error('No composition resolver available');
|
|
593
|
+
}
|
|
594
|
+
const calculated = await resolver.resolveComposition(composition.compositionId);
|
|
595
|
+
const dimensions = {
|
|
596
|
+
width: calculated.width,
|
|
597
|
+
height: calculated.height,
|
|
598
|
+
};
|
|
599
|
+
const inserted = await insertAssetElement({
|
|
600
|
+
compositionFile,
|
|
601
|
+
compositionId,
|
|
602
|
+
element: {
|
|
603
|
+
type: 'composition',
|
|
604
|
+
compositionId: composition.compositionId,
|
|
605
|
+
compositionFile: composition.compositionFile,
|
|
606
|
+
durationInFrames: calculated.durationInFrames,
|
|
607
|
+
width: calculated.width,
|
|
608
|
+
height: calculated.height,
|
|
609
|
+
serializedResolvedPropsWithCustomSchema: serializeResolvedPropsForSourceCode(calculated.props),
|
|
610
|
+
position: getCenteredPosition({
|
|
611
|
+
dimensions,
|
|
612
|
+
dropPosition,
|
|
613
|
+
}),
|
|
614
|
+
},
|
|
615
|
+
});
|
|
616
|
+
if (!inserted) {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
(0, NotificationCenter_1.showNotification)(`Added ${composition.compositionId} to ${compositionId}`, 2000);
|
|
620
|
+
}
|
|
621
|
+
catch (error) {
|
|
622
|
+
(0, NotificationCenter_1.showNotification)(`Could not add composition: ${error instanceof Error ? error.message : String(error)}`, 4000);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
exports.insertComposition = insertComposition;
|
|
572
626
|
const insertElement = async ({ compositionFile, compositionId, dropPosition, element, }) => {
|
|
573
627
|
try {
|
|
574
628
|
const response = await (0, call_api_1.callApi)('/api/insert-element', {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optionsSidebarTabs = void 0;
|
|
3
|
+
exports.selectOptionsSidebarInspectorPanel = exports.optionsSidebarTabs = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
exports.optionsSidebarTabs = (0, react_1.createRef)();
|
|
6
|
+
const selectOptionsSidebarInspectorPanel = () => {
|
|
7
|
+
var _a;
|
|
8
|
+
(_a = exports.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectInspectorPanel();
|
|
9
|
+
};
|
|
10
|
+
exports.selectOptionsSidebarInspectorPanel = selectOptionsSidebarInspectorPanel;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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;
|
|
4
4
|
const calculate_timeline_1 = require("../helpers/calculate-timeline");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
5
6
|
const get_box_quads_ponyfill_1 = require("../helpers/get-box-quads-ponyfill");
|
|
6
7
|
const selected_outline_geometry_1 = require("./selected-outline-geometry");
|
|
7
8
|
const selected_outline_types_1 = require("./selected-outline-types");
|
|
@@ -53,7 +54,7 @@ const getRotationCursor = (rotation) => {
|
|
|
53
54
|
? ''
|
|
54
55
|
: `<g transform="rotate(${normalizedRotation} 32 32)">`;
|
|
55
56
|
const transformEnd = normalizedRotation === 0 ? '' : '</g>';
|
|
56
|
-
const svg = `<svg width="24" height="24" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">${transform}<g transform="scale(0.876712329)" filter="url(#filter0_d_1_14)"><path d="M10.9111 17.7687C10.3413 18.3701 10.367 19.3195 10.9684 19.8893L20.7687 29.1738C21.3701 29.7436 22.3195 29.7179 22.8893 29.1165C23.459 28.5151 23.4334 27.5657 22.832 26.996L14.1206 18.7431L22.3735 10.0316C22.9432 9.43022 22.9176 8.48082 22.3162 7.91107C21.7148 7.34133 20.7654 7.36699 20.1956 7.96839L10.9111 17.7687ZM49.3923 58.3118C49.9509 58.9235 50.8996 58.9667 51.5114 58.4081L61.481 49.3055C62.0927 48.7469 62.1359 47.7981 61.5773 47.1863C61.0187 46.5745 60.0699 46.5314 59.4581 47.09L50.5963 55.1812L42.5051 46.3194C41.9465 45.7076 40.9977 45.6645 40.386 46.2231C39.7742 46.7817 39.7311 47.7304 40.2896 48.3422L49.3923 58.3118ZM12.6747 18.7431L13 19.8893C22.1283 19.6426 30.7584 21.4283 37.8564 26.6927C44.8518 31.8809 49.734 39.8538 49 56H50.5963H51.5114C52.2774 39.1461 47.6482 30.2198 39.6436 24.2831C31.7416 18.4224 22.3717 17.2467 13 17.5L12.6747 18.7431Z" fill="
|
|
57
|
+
const svg = `<svg width="24" height="24" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">${transform}<g transform="scale(0.876712329)" filter="url(#filter0_d_1_14)"><path d="M10.9111 17.7687C10.3413 18.3701 10.367 19.3195 10.9684 19.8893L20.7687 29.1738C21.3701 29.7436 22.3195 29.7179 22.8893 29.1165C23.459 28.5151 23.4334 27.5657 22.832 26.996L14.1206 18.7431L22.3735 10.0316C22.9432 9.43022 22.9176 8.48082 22.3162 7.91107C21.7148 7.34133 20.7654 7.36699 20.1956 7.96839L10.9111 17.7687ZM49.3923 58.3118C49.9509 58.9235 50.8996 58.9667 51.5114 58.4081L61.481 49.3055C62.0927 48.7469 62.1359 47.7981 61.5773 47.1863C61.0187 46.5745 60.0699 46.5314 59.4581 47.09L50.5963 55.1812L42.5051 46.3194C41.9465 45.7076 40.9977 45.6645 40.386 46.2231C39.7742 46.7817 39.7311 47.7304 40.2896 48.3422L49.3923 58.3118ZM12.6747 18.7431L13 19.8893C22.1283 19.6426 30.7584 21.4283 37.8564 26.6927C44.8518 31.8809 49.734 39.8538 49 56H50.5963H51.5114C52.2774 39.1461 47.6482 30.2198 39.6436 24.2831C31.7416 18.4224 22.3717 17.2467 13 17.5L12.6747 18.7431Z" fill="${colors_1.BLACK}"/><path d="M19.1064 6.93652C20.2459 5.73379 22.1448 5.68278 23.3477 6.82227C24.5505 7.96181 24.6022 9.86076 23.4629 11.0635L18.7373 16.0508C26.3487 16.4239 33.9128 18.1651 40.5371 23.0781C44.7339 26.1907 48.0794 30.1189 50.2568 35.4834C51.9666 39.6958 52.9327 44.7395 53.0742 50.8867L58.4463 45.9824C59.6697 44.8654 61.5673 44.9514 62.6846 46.1748C63.8018 47.3985 63.7155 49.296 62.4922 50.4131L52.5225 59.5156C51.337 60.5979 49.5196 60.5507 48.3916 59.4346L48.2842 59.3232L39.1816 49.3535C38.0648 48.1301 38.1507 46.2324 39.374 45.1152C40.5975 43.9979 42.4961 44.0841 43.6133 45.3076L47.4756 49.5381C47.1908 44.7613 46.2876 40.9448 44.9482 37.8291C43.0666 33.4521 40.2851 30.3614 36.9629 27.8975C31.8259 24.0875 25.8071 22.1663 19.2891 21.5732L23.8633 25.9072C25.0662 27.0468 25.1178 28.9457 23.9785 30.1484C22.8746 31.3135 21.0576 31.3982 19.8516 30.3662L19.7373 30.2627L9.93652 20.9785C8.73384 19.839 8.6828 17.9401 9.82227 16.7373L19.1064 6.93652Z" stroke="${colors_1.WHITE}" stroke-width="3"/></g>${transformEnd}<defs><filter id="filter0_d_1_14" x="0" y="0" width="72.4696" height="72.3004" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="3.75"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_14"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_14" result="shape"/></filter></defs></svg>`;
|
|
57
58
|
return `url("data:image/svg+xml,${encodeURIComponent(svg)}") 12 12, alias`;
|
|
58
59
|
};
|
|
59
60
|
exports.getRotationCursor = getRotationCursor;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Guide } from '../state/editor-guides';
|
|
2
|
+
import type { SelectedOutline } from './selected-outline-geometry';
|
|
3
|
+
export declare const selectedOutlineSnapThresholdPx = 10;
|
|
4
|
+
export declare const selectedOutlineSnapIndicatorColor = "#ff00ff";
|
|
5
|
+
export type SelectedOutlineSnapAxis = 'x' | 'y';
|
|
6
|
+
export type SelectedOutlineSnapTargetType = 'canvas-left' | 'canvas-right' | 'canvas-top' | 'canvas-bottom' | 'canvas-horizontal-center' | 'canvas-vertical-center' | 'guide-vertical' | 'guide-horizontal';
|
|
7
|
+
export type SelectedOutlineSnapTarget = {
|
|
8
|
+
readonly axis: SelectedOutlineSnapAxis;
|
|
9
|
+
readonly position: number;
|
|
10
|
+
readonly type: SelectedOutlineSnapTargetType;
|
|
11
|
+
};
|
|
12
|
+
export type SelectedOutlineSnapEdge = 'left' | 'right' | 'center-x' | 'top' | 'bottom' | 'center-y';
|
|
13
|
+
export type SelectedOutlineSnapPoint = {
|
|
14
|
+
readonly distance: number;
|
|
15
|
+
readonly edge: SelectedOutlineSnapEdge;
|
|
16
|
+
readonly target: SelectedOutlineSnapTarget;
|
|
17
|
+
};
|
|
18
|
+
export type SelectedOutlineSnapResult = {
|
|
19
|
+
readonly activeSnapPoints: readonly SelectedOutlineSnapPoint[];
|
|
20
|
+
readonly snapOffsetX: number | null;
|
|
21
|
+
readonly snapOffsetY: number | null;
|
|
22
|
+
};
|
|
23
|
+
export declare const getSelectedOutlineSnapTargets: ({ compositionHeight, compositionWidth, guides, }: {
|
|
24
|
+
readonly compositionHeight: number;
|
|
25
|
+
readonly compositionWidth: number;
|
|
26
|
+
readonly guides: readonly Guide[];
|
|
27
|
+
}) => readonly SelectedOutlineSnapTarget[];
|
|
28
|
+
export declare const findSelectedOutlineSnap: ({ allowX, allowY, deltaX, deltaY, outlines, scale, targets, }: {
|
|
29
|
+
readonly allowX: boolean;
|
|
30
|
+
readonly allowY: boolean;
|
|
31
|
+
readonly deltaX: number;
|
|
32
|
+
readonly deltaY: number;
|
|
33
|
+
readonly outlines: readonly SelectedOutline[];
|
|
34
|
+
readonly scale: number;
|
|
35
|
+
readonly targets: readonly SelectedOutlineSnapTarget[];
|
|
36
|
+
}) => SelectedOutlineSnapResult;
|