@remotion/studio 4.0.527 → 4.0.528
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgentPrompt.js +1 -2
- package/dist/components/AudioWaveform.d.ts +1 -0
- package/dist/components/AudioWaveform.js +10 -14
- package/dist/components/CodeFrame.js +1 -1
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/CurrentAsset.js +3 -2
- package/dist/components/EditorRuler/Ruler.js +6 -3
- package/dist/components/EffectPickerModal.js +69 -43
- package/dist/components/ElementInstallConfirmation.js +3 -3
- package/dist/components/ElementLibrariesSettings.d.ts +2 -0
- package/dist/components/ElementLibrariesSettings.js +200 -0
- package/dist/components/InitialCompositionLoader.js +3 -1
- package/dist/components/InspectorOpenInEditor.js +13 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +28 -9
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +1 -1
- package/dist/components/InspectorPanel/EasingInspector.js +6 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.js +1 -1
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +28 -24
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +30 -2
- package/dist/components/InspectorPanel/SequenceWrapAction.d.ts +8 -0
- package/dist/components/InspectorPanel/SequenceWrapAction.js +151 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +2 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.js +4 -3
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +2 -1
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +2 -2
- package/dist/components/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +7 -5
- package/dist/components/KeyboardShortcutsSettings.js +1 -1
- package/dist/components/Menu/styles.d.ts +2 -2
- package/dist/components/Modals.js +7 -6
- package/dist/components/ModelManager.js +10 -9
- package/dist/components/NewComposition/CancelButton.js +10 -4
- package/dist/components/NewComposition/InputDragger.d.ts +3 -1
- package/dist/components/NewComposition/InputDragger.js +28 -9
- package/dist/components/NewComposition/NewComposition.js +7 -6
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/NewComposition/menu-typeahead.js +1 -1
- package/dist/components/Preview.js +3 -2
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +1 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +1 -2
- package/dist/components/RenderQueue/CaptionQueueItem.js +14 -5
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +30 -7
- package/dist/components/RenderQueue/QueueJobError.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobError.js +24 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.d.ts +8 -0
- package/dist/components/RenderQueue/QueueJobErrorModal.js +63 -0
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +11 -4
- package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +3 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +20 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +24 -27
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +68 -28
- package/dist/components/RenderQueue/caption-job-types.d.ts +3 -1
- package/dist/components/RenderQueue/context.d.ts +4 -0
- package/dist/components/RenderQueue/context.js +58 -8
- package/dist/components/RenderQueue/index.js +2 -3
- package/dist/components/RenderQueue/load-model-for-job.d.ts +2 -1
- package/dist/components/RenderQueue/load-model-for-job.js +5 -1
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +13 -6
- package/dist/components/SelectedOutlineCropControls.js +2 -1
- package/dist/components/SelectedOutlineEditingHandles.js +9 -2
- package/dist/components/SelectedOutlineElement.js +9 -3
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -4
- package/dist/components/SelectedOutlineKeyboardControls.js +4 -22
- package/dist/components/SelectedOutlineOverlay.js +152 -106
- package/dist/components/SelectedOutlinePathPoints.d.ts +8 -0
- package/dist/components/SelectedOutlinePathPoints.js +433 -0
- package/dist/components/SelectedOutlinePolygon.js +21 -46
- package/dist/components/SelectedOutlineRenderer.d.ts +3 -5
- package/dist/components/SelectedOutlineRenderer.js +32 -136
- package/dist/components/SelectedOutlineTransformOriginHandle.js +3 -2
- package/dist/components/SelectedOutlineUvControls.js +12 -7
- package/dist/components/SettingsModal.js +30 -3
- package/dist/components/SettingsModalFooter.d.ts +1 -0
- package/dist/components/SettingsModalFooter.js +7 -3
- package/dist/components/ShowOutlinesProvider.js +1 -1
- package/dist/components/SkillsSettings.d.ts +0 -1
- package/dist/components/SkillsSettings.js +13 -14
- package/dist/components/Splitter/SplitterElement.js +1 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +1 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +7 -6
- package/dist/components/Timeline/TimelineArrayField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +0 -1
- package/dist/components/Timeline/TimelineColorField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +12 -5
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +3 -1
- package/dist/components/Timeline/TimelineFontFamilyField.js +12 -12
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +39 -28
- package/dist/components/Timeline/TimelineLayerChildren.js +1 -1
- package/dist/components/Timeline/TimelineList.js +1 -1
- package/dist/components/Timeline/TimelineNumberField.js +2 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -9
- package/dist/components/Timeline/TimelineSelection.js +16 -9
- package/dist/components/Timeline/TimelineSequence.d.ts +3 -1
- package/dist/components/Timeline/TimelineSequence.js +39 -21
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +18 -8
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +262 -25
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +11 -13
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +98 -77
- package/dist/components/Timeline/TimelineTextContentField.js +27 -4
- package/dist/components/Timeline/TimelineTimeIndicators.js +10 -5
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTrimTooltip.d.ts +11 -0
- package/dist/components/Timeline/TimelineTrimTooltip.js +41 -0
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +13 -10
- package/dist/components/Timeline/delete-selected-keyframe.js +22 -8
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +1 -5
- package/dist/components/Timeline/delete-selected-timeline-item.js +7 -93
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +2 -1
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +7 -5
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.d.ts +23 -0
- package/dist/components/Timeline/get-keyframed-sequence-drag-targets.js +57 -0
- package/dist/components/Timeline/get-node-keyframes.d.ts +2 -1
- package/dist/components/Timeline/get-node-keyframes.js +6 -4
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.d.ts +21 -0
- package/dist/components/Timeline/get-playback-rate-keyframe-changes.js +142 -0
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +15 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +44 -6
- package/dist/components/Timeline/keyframe-clipboard.js +17 -3
- package/dist/components/Timeline/split-selected-timeline-item.js +4 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +1 -0
- package/dist/components/Timeline/use-delete-timeline-items.js +17 -11
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +2 -1
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +3 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +28 -19
- package/dist/components/Transcription/Models.js +1 -1
- package/dist/components/Transcription/TranscriptionModal.js +3 -1
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +2 -1
- package/dist/components/Transcription/resample-media-to-16-khz.js +20 -2
- package/dist/components/UpdatesSettings.js +2 -0
- package/dist/components/VideoMatting/Models.js +1 -1
- package/dist/components/VideoMatting/VideoMattingModal.js +30 -47
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +1 -1
- package/dist/components/WebMcp.js +22 -40
- package/dist/components/composition-drop-preview.js +1 -0
- package/dist/components/effect-drag-and-drop.d.ts +13 -5
- package/dist/components/effect-drag-and-drop.js +19 -4
- package/dist/components/get-open-in-menu-items.d.ts +2 -1
- package/dist/components/get-open-in-menu-items.js +17 -1
- package/dist/components/selected-outline-drag.d.ts +1 -6
- package/dist/components/selected-outline-drag.js +22 -6
- package/dist/components/selected-outline-geometry.d.ts +2 -18
- package/dist/components/selected-outline-measurement.d.ts +23 -41
- package/dist/components/selected-outline-measurement.js +14 -252
- package/dist/components/selected-outline-order.d.ts +4 -11
- package/dist/components/selected-outline-order.js +2 -254
- package/dist/components/selected-outline-snap.d.ts +1 -1
- package/dist/components/selected-outline-snap.js +2 -1
- package/dist/components/selected-outline-types.d.ts +18 -28
- package/dist/components/selected-outline-uv.d.ts +4 -4
- package/dist/components/selected-outline-uv.js +6 -111
- package/dist/components/sequence-props-api.js +0 -10
- package/dist/components/use-selected-outline-control-target.js +12 -21
- package/dist/components/wrap-jsx-node-api.d.ts +2 -0
- package/dist/components/wrap-jsx-node-api.js +13 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +45 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +32 -3
- package/dist/esm/{CaptionQueueProcessor-npa6szn1.mjs → CaptionQueueProcessor-nr7hjcga.mjs} +63 -17
- package/dist/esm/LazyModels-ajkn7fs3.mjs +12 -0
- package/dist/esm/LazyModels-g1g7cf4e.mjs +12 -0
- package/dist/esm/{TranscriptionModal-79m5wgcj.mjs → TranscriptionModal-e18bzbkb.mjs} +15 -15
- package/dist/esm/{VideoMattingModal-31pew0xj.mjs → VideoMattingModal-5bz2s4rs.mjs} +47 -65
- package/dist/esm/{VideoMattingQueueProcessor-t1hgm2rm.mjs → VideoMattingQueueProcessor-4tkj0f4k.mjs} +69 -26
- package/dist/esm/{index-v4tr1bft.mjs → index-09txs1bj.mjs} +5 -0
- package/dist/esm/{index-n5gmcvhz.mjs → index-5ycb9e9q.mjs} +2 -4
- package/dist/esm/{index-5t2dwxsk.mjs → index-890dd9b3.mjs} +259 -21
- package/dist/esm/{index-ac5550e7.mjs → index-8nt6a0mw.mjs} +3 -3
- package/dist/esm/{index-614tdz2q.mjs → index-9q9w8v9p.mjs} +3 -3
- package/dist/esm/{index-s7qa3xbw.mjs → index-c2wabcdt.mjs} +6 -6
- package/dist/esm/{index-r1gr3j3a.mjs → index-dfy1t576.mjs} +50 -1
- package/dist/esm/{index-21hxsfaa.mjs → index-dh3zk2hv.mjs} +6 -25
- package/dist/esm/{index-4zen9prq.mjs → index-dpyss74p.mjs} +6563 -5485
- package/dist/esm/{index-9x6e1dq0.mjs → index-hqxc6tzp.mjs} +40 -6
- package/dist/esm/{index-9xxg6218.mjs → index-qve7mdfp.mjs} +19 -1
- package/dist/esm/{index-e855w59j.mjs → index-s6qya2gg.mjs} +3 -5
- package/dist/esm/index-t7tbt980.mjs +103 -0
- package/dist/esm/{index-r0ejh5sy.mjs → index-t7xnxdf8.mjs} +44 -26
- package/dist/esm/index-wqc43mw0.mjs +158 -0
- package/dist/esm/{index-ppspzgn9.mjs → index-x6r9bn12.mjs} +4026 -4761
- package/dist/esm/{index-vxwg66ar.mjs → index-xac20sv4.mjs} +44 -57
- package/dist/esm/index.mjs +4 -5
- package/dist/esm/internals.mjs +13 -13
- package/dist/esm/previewEntry.mjs +18 -15
- package/dist/esm/renderEntry.mjs +5 -1
- package/dist/helpers/calculate-timeline.d.ts +5 -1
- package/dist/helpers/calculate-timeline.js +1 -1
- package/dist/helpers/checkerboard-background.d.ts +2 -2
- package/dist/helpers/colors.d.ts +132 -112
- package/dist/helpers/colors.js +117 -95
- package/dist/helpers/create-folder-tree.js +2 -1
- package/dist/helpers/editor-guide-selection.d.ts +1 -1
- package/dist/helpers/editor-ruler.js +23 -12
- package/dist/helpers/get-connected-compositions.d.ts +6 -1
- package/dist/helpers/get-connected-compositions.js +1 -1
- package/dist/helpers/get-sequence-double-click-action.js +1 -1
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -1
- package/dist/helpers/get-sequence-visible-range.js +2 -5
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -1
- package/dist/helpers/get-timeline-nestedness.js +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
- package/dist/helpers/get-timeline-sequence-sort-key.js +1 -1
- package/dist/helpers/hoverable.js +4 -4
- package/dist/helpers/inject-css.js +5 -7
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -1
- package/dist/helpers/prism-vsc-dark-plus.js +52 -51
- package/dist/helpers/resolve-studio-color.d.ts +1 -0
- package/dist/helpers/resolve-studio-color.js +11 -0
- package/dist/helpers/studio-css-variables.d.ts +1 -0
- package/dist/helpers/studio-css-variables.js +105 -0
- package/dist/helpers/studio-pixel-ratio.d.ts +1 -0
- package/dist/helpers/studio-pixel-ratio.js +7 -0
- package/dist/helpers/timeline-node-path-key.d.ts +1 -1
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-runtime-values.js +2 -28
- package/dist/hot-middleware-client/client.js +5 -3
- package/dist/icons/align-center-horizontal.js +2 -1
- package/dist/icons/align-left.js +2 -1
- package/dist/icons/align-right.js +2 -1
- package/dist/icons/{separation.d.ts → background-removal.d.ts} +1 -1
- package/dist/icons/background-removal.js +9 -0
- package/dist/icons/wrap.d.ts +4 -0
- package/dist/icons/wrap.js +10 -0
- package/dist/previewEntry.js +2 -0
- package/dist/renderEntry.js +2 -0
- package/dist/state/modals.d.ts +15 -1
- package/dist/state/timeline-sequence-hover.d.ts +6 -16
- package/dist/state/timeline-sequence-hover.js +6 -67
- package/package.json +20 -19
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +0 -15
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +0 -31
- package/dist/esm/LazyModels-nh3c8h9p.mjs +0 -12
- package/dist/esm/LazyModels-rr5v8h5y.mjs +0 -12
- package/dist/esm/index-cw0pnpg5.mjs +0 -50
- package/dist/esm/index-k426ye99.mjs +0 -139
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
- package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
- package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
- package/dist/helpers/get-box-quads-ponyfill.js +0 -23
- package/dist/icons/separation.js +0 -7
- /package/dist/esm/{resolve-composition-component-location-qrp05g62.mjs → resolve-composition-component-location-2hgf6g0a.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Guide } from '../state/editor-guides';
|
|
2
2
|
import type { SelectedOutline } from './selected-outline-geometry';
|
|
3
3
|
export declare const selectedOutlineSnapThresholdPx = 10;
|
|
4
|
-
export declare const selectedOutlineSnapIndicatorColor = "
|
|
4
|
+
export declare const selectedOutlineSnapIndicatorColor = "var(--remotion-studio-selected-outline-snap-color)";
|
|
5
5
|
export type SelectedOutlineSnapAxis = 'x' | 'y';
|
|
6
6
|
export type SelectedOutlineSnapTargetType = 'canvas-left' | 'canvas-right' | 'canvas-top' | 'canvas-bottom' | 'canvas-horizontal-center' | 'canvas-vertical-center' | 'guide-vertical' | 'guide-horizontal';
|
|
7
7
|
export type SelectedOutlineSnapTarget = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findSelectedOutlineSnap = exports.getSelectedOutlineSnapTargets = exports.selectedOutlineSnapIndicatorColor = exports.selectedOutlineSnapThresholdPx = void 0;
|
|
4
|
+
const colors_1 = require("../helpers/colors");
|
|
4
5
|
exports.selectedOutlineSnapThresholdPx = 10;
|
|
5
|
-
exports.selectedOutlineSnapIndicatorColor =
|
|
6
|
+
exports.selectedOutlineSnapIndicatorColor = colors_1.SELECTED_OUTLINE_SNAP_COLOR;
|
|
6
7
|
const EPSILON = 0.000001;
|
|
7
8
|
const getSelectedOutlineSnapTargets = ({ compositionHeight, compositionWidth, guides, }) => {
|
|
8
9
|
return [
|
|
@@ -1,39 +1,31 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { CanvasOutlineCrop, CanvasOutlineLayoutTarget, CanvasSelectableOutline } from '@remotion/canvas';
|
|
2
|
+
import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey } from 'remotion';
|
|
3
3
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
4
|
-
import type {
|
|
4
|
+
import type { KeyframeSourceFrame } from './Timeline/get-timeline-keyframes';
|
|
5
5
|
export type SelectedOutlineContextMenuOpenResult = false | readonly ComboboxValue[];
|
|
6
6
|
export type SelectedOutlineContextMenuOpenHandler = () => SelectedOutlineContextMenuOpenResult | Promise<SelectedOutlineContextMenuOpenResult>;
|
|
7
|
-
export type SelectedOutlineLayoutTarget = {
|
|
8
|
-
readonly key: string;
|
|
9
|
-
readonly containsSelection: boolean;
|
|
10
|
-
readonly keyframeDisplayOffset: number;
|
|
11
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
12
|
-
readonly ref: React.RefObject<Element | null>;
|
|
13
|
-
readonly selected: boolean;
|
|
7
|
+
export type SelectedOutlineLayoutTarget = CanvasOutlineLayoutTarget & {
|
|
14
8
|
readonly selectedForCrop: boolean;
|
|
15
9
|
readonly selectedForRotation: boolean;
|
|
16
10
|
readonly selectedForTransformOrigin: boolean;
|
|
17
11
|
readonly selectedForUvHandles: boolean;
|
|
18
|
-
readonly showSelectedOutline: boolean;
|
|
19
12
|
readonly transformOriginValue: string;
|
|
20
|
-
readonly
|
|
21
|
-
readonly sequence: TSequence;
|
|
22
|
-
readonly crop: {
|
|
23
|
-
readonly left: number;
|
|
24
|
-
readonly right: number;
|
|
25
|
-
readonly top: number;
|
|
26
|
-
readonly bottom: number;
|
|
27
|
-
};
|
|
13
|
+
readonly crop: CanvasOutlineCrop;
|
|
28
14
|
};
|
|
29
15
|
export type SelectedOutlineTarget = SelectedOutlineLayoutTarget & {
|
|
30
16
|
readonly canCrop: boolean;
|
|
17
|
+
readonly pathDrag: SelectedOutlinePathDragTarget | null;
|
|
31
18
|
readonly cropDrag: SelectedOutlineCropDragTarget | null;
|
|
32
19
|
readonly drag: SelectedOutlineDragTarget | null;
|
|
33
20
|
readonly scaleDrag: SelectedOutlineScaleDragTarget | null;
|
|
34
21
|
readonly rotationDrag: SelectedOutlineRotationDragTarget | null;
|
|
35
22
|
readonly transformOriginDrag: SelectedOutlineTransformOriginDragTarget | null;
|
|
36
23
|
};
|
|
24
|
+
export type SelectedOutlinePathDragTarget = {
|
|
25
|
+
readonly clientId: string;
|
|
26
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
27
|
+
readonly schema: InteractivitySchema;
|
|
28
|
+
};
|
|
37
29
|
export declare const cropFieldKeys: {
|
|
38
30
|
readonly left: "cropLeft";
|
|
39
31
|
readonly right: "cropRight";
|
|
@@ -61,7 +53,7 @@ export type SelectedOutlineCropDragTarget = {
|
|
|
61
53
|
readonly fields: Record<SelectedOutlineCropFieldKey, SelectedOutlineCropField>;
|
|
62
54
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
63
55
|
readonly schema: InteractivitySchema;
|
|
64
|
-
readonly sourceFrame:
|
|
56
|
+
readonly sourceFrame: KeyframeSourceFrame;
|
|
65
57
|
readonly transformOrigin: {
|
|
66
58
|
readonly defaultValue: string | undefined;
|
|
67
59
|
readonly propStatus: CanUpdateSequencePropStatus;
|
|
@@ -73,12 +65,14 @@ export type SelectedOutlineDragTarget = {
|
|
|
73
65
|
readonly clientId: string;
|
|
74
66
|
readonly fieldDefault: string | undefined;
|
|
75
67
|
readonly keyframeDisplayOffset: number;
|
|
68
|
+
readonly keyframePlaybackRate: number;
|
|
76
69
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
77
70
|
readonly schema: InteractivitySchema;
|
|
78
71
|
};
|
|
79
72
|
export type SelectedOutlineTransformOriginDragTarget = {
|
|
80
73
|
readonly clientId: string;
|
|
81
74
|
readonly keyframeDisplayOffset: number;
|
|
75
|
+
readonly keyframePlaybackRate: number;
|
|
82
76
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
83
77
|
readonly originDefault: string | undefined;
|
|
84
78
|
readonly originPropStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
@@ -86,7 +80,7 @@ export type SelectedOutlineTransformOriginDragTarget = {
|
|
|
86
80
|
readonly rotateValue: string;
|
|
87
81
|
readonly scaleValue: number | string;
|
|
88
82
|
readonly schema: InteractivitySchema;
|
|
89
|
-
readonly sourceFrame:
|
|
83
|
+
readonly sourceFrame: KeyframeSourceFrame;
|
|
90
84
|
readonly translateDefault: string | undefined;
|
|
91
85
|
readonly translatePropStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
92
86
|
readonly translateValue: string;
|
|
@@ -103,6 +97,7 @@ export type SelectedOutlineScaleDragTarget = {
|
|
|
103
97
|
readonly fieldDefault: number | string | undefined;
|
|
104
98
|
readonly fieldSchema: ScaleFieldSchema;
|
|
105
99
|
readonly keyframeDisplayOffset: number;
|
|
100
|
+
readonly keyframePlaybackRate: number;
|
|
106
101
|
readonly linked: boolean;
|
|
107
102
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
108
103
|
readonly schema: InteractivitySchema;
|
|
@@ -113,6 +108,7 @@ export type SelectedOutlineRotationDragTarget = {
|
|
|
113
108
|
readonly fieldDefault: string | undefined;
|
|
114
109
|
readonly fieldSchema: RotationFieldSchema;
|
|
115
110
|
readonly keyframeDisplayOffset: number;
|
|
111
|
+
readonly keyframePlaybackRate: number;
|
|
116
112
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
117
113
|
readonly schema: InteractivitySchema;
|
|
118
114
|
readonly transform3DMode: boolean;
|
|
@@ -145,13 +141,7 @@ export type SelectedOutlineRotationDragState = {
|
|
|
145
141
|
readonly startValue: string;
|
|
146
142
|
readonly target: SelectedOutlineRotationDragTarget;
|
|
147
143
|
};
|
|
148
|
-
export type SequenceWithSelectedOutline =
|
|
149
|
-
readonly depth: number;
|
|
150
|
-
readonly keyframeDisplayOffset: number;
|
|
151
|
-
readonly key: string;
|
|
152
|
-
readonly nodePathInfo: SequenceNodePathInfo;
|
|
153
|
-
readonly sequence: TSequence;
|
|
154
|
-
};
|
|
144
|
+
export type SequenceWithSelectedOutline = CanvasSelectableOutline;
|
|
155
145
|
export declare const translateFieldKey = "style.translate";
|
|
156
146
|
export declare const scaleFieldKey = "style.scale";
|
|
157
147
|
export declare const rotateFieldKey = "style.rotate";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, GetEffectDragOverrides, PropStatuses, InteractivitySchemaField, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
|
|
2
2
|
import { type OutlinePoint } from './selected-outline-geometry';
|
|
3
|
+
import { type KeyframeSourceFrame } from './Timeline/get-timeline-keyframes';
|
|
4
|
+
export declare const getUvHandlePosition: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], uv: import("@remotion/canvas").CanvasOutlineUv) => OutlinePoint, getUvCoordinateForPoint: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], point: OutlinePoint) => import("@remotion/canvas").CanvasOutlineUv;
|
|
3
5
|
export type UvCoordinate = readonly [number, number];
|
|
4
6
|
type UvEllipseDimensions = {
|
|
5
7
|
readonly width: number;
|
|
@@ -36,7 +38,7 @@ export type SelectedOutlineUvHandle = {
|
|
|
36
38
|
readonly isSelected: boolean;
|
|
37
39
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
38
40
|
readonly schema: InteractivitySchema;
|
|
39
|
-
readonly sourceFrame:
|
|
41
|
+
readonly sourceFrame: KeyframeSourceFrame;
|
|
40
42
|
readonly value: UvCoordinate;
|
|
41
43
|
};
|
|
42
44
|
type UvConnectionHandle = Pick<SelectedOutlineUvHandle, 'effectIndex' | 'fieldKey' | 'fieldSchema' | 'value'> & {
|
|
@@ -87,7 +89,6 @@ type SelectedEffectFields = {
|
|
|
87
89
|
readonly fieldKeys: ReadonlySet<string>;
|
|
88
90
|
};
|
|
89
91
|
export declare const tuplesEqual: (left: unknown, right: UvCoordinate) => boolean;
|
|
90
|
-
export declare const getUvHandlePosition: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], uv: UvCoordinate) => OutlinePoint;
|
|
91
92
|
export declare const getUvHandleConnectionLines: ({ handles, points, }: {
|
|
92
93
|
readonly handles: readonly UvConnectionHandle[];
|
|
93
94
|
readonly points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
|
|
@@ -102,7 +103,6 @@ export declare const getUvEllipseInteractiveControls: ({ handles, dimensions, po
|
|
|
102
103
|
readonly dimensions?: UvEllipseDimensions | null | undefined;
|
|
103
104
|
readonly points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
|
|
104
105
|
}) => UvEllipseInteractiveControls[];
|
|
105
|
-
export declare const getUvCoordinateForPoint: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], point: OutlinePoint) => UvCoordinate;
|
|
106
106
|
export declare function constrainUv(value: UvCoordinate, schema: UvCoordinateFieldSchema): UvCoordinate;
|
|
107
107
|
export declare function roundUvCoordinate(value: UvCoordinate, schema: UvCoordinateFieldSchema): UvCoordinate;
|
|
108
108
|
export declare const roundNumericUvEllipseValue: (value: number, schema: NumericUvEllipseFieldSchema) => number;
|
|
@@ -113,6 +113,6 @@ export declare const getSelectedUvHandles: ({ propStatuses, clientId, getEffectD
|
|
|
113
113
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
114
114
|
readonly selectedEffects: Map<number, SelectedEffectFields> | undefined;
|
|
115
115
|
readonly sequence: TSequence;
|
|
116
|
-
readonly sourceFrame:
|
|
116
|
+
readonly sourceFrame: KeyframeSourceFrame;
|
|
117
117
|
}) => SelectedOutlineUvHandle[];
|
|
118
118
|
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSelectedUvHandles = exports.roundNumericUvEllipseValue = exports.
|
|
3
|
+
exports.getSelectedUvHandles = exports.roundNumericUvEllipseValue = exports.getUvEllipseInteractiveControls = exports.getUvHandleConnectionEllipses = exports.getUvHandleConnectionLines = exports.tuplesEqual = exports.getUvCoordinateForPoint = exports.getUvHandlePosition = void 0;
|
|
4
4
|
exports.constrainUv = constrainUv;
|
|
5
5
|
exports.roundUvCoordinate = roundUvCoordinate;
|
|
6
|
+
const canvas_1 = require("@remotion/canvas");
|
|
6
7
|
const remotion_1 = require("remotion");
|
|
7
8
|
const selected_outline_geometry_1 = require("./selected-outline-geometry");
|
|
9
|
+
const get_timeline_keyframes_1 = require("./Timeline/get-timeline-keyframes");
|
|
8
10
|
const timeline_field_utils_1 = require("./Timeline/timeline-field-utils");
|
|
11
|
+
({ getCanvasOutlinePoint: exports.getUvHandlePosition, getCanvasOutlineUv: exports.getUvCoordinateForPoint } = canvas_1.CanvasInternals);
|
|
9
12
|
const parseUvCoordinate = (value) => {
|
|
10
13
|
if (Array.isArray(value) &&
|
|
11
14
|
value.length === 2 &&
|
|
@@ -91,56 +94,6 @@ const tuplesEqual = (left, right) => {
|
|
|
91
94
|
return left[0] === right[0] && left[1] === right[1];
|
|
92
95
|
};
|
|
93
96
|
exports.tuplesEqual = tuplesEqual;
|
|
94
|
-
const getBilinearUvHandlePosition = (points, uv) => {
|
|
95
|
-
const [tl, tr, br, bl] = points;
|
|
96
|
-
const top = (0, selected_outline_geometry_1.mixPoint)(tl, tr, uv[0]);
|
|
97
|
-
const bottom = (0, selected_outline_geometry_1.mixPoint)(bl, br, uv[0]);
|
|
98
|
-
return (0, selected_outline_geometry_1.mixPoint)(top, bottom, uv[1]);
|
|
99
|
-
};
|
|
100
|
-
const projectiveEpsilon = 0.000001;
|
|
101
|
-
const getProjectiveTransform = (points) => {
|
|
102
|
-
const [tl, tr, br, bl] = points;
|
|
103
|
-
const dx1 = tr.x - br.x;
|
|
104
|
-
const dx2 = bl.x - br.x;
|
|
105
|
-
const dx3 = tl.x - tr.x + br.x - bl.x;
|
|
106
|
-
const dy1 = tr.y - br.y;
|
|
107
|
-
const dy2 = bl.y - br.y;
|
|
108
|
-
const dy3 = tl.y - tr.y + br.y - bl.y;
|
|
109
|
-
let g = 0;
|
|
110
|
-
let h = 0;
|
|
111
|
-
if (Math.abs(dx3) > projectiveEpsilon || Math.abs(dy3) > projectiveEpsilon) {
|
|
112
|
-
const determinant = dx1 * dy2 - dx2 * dy1;
|
|
113
|
-
if (Math.abs(determinant) < projectiveEpsilon) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
g = (dx3 * dy2 - dx2 * dy3) / determinant;
|
|
117
|
-
h = (dx1 * dy3 - dx3 * dy1) / determinant;
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
a: tr.x - tl.x + g * tr.x,
|
|
121
|
-
b: bl.x - tl.x + h * bl.x,
|
|
122
|
-
c: tl.x,
|
|
123
|
-
d: tr.y - tl.y + g * tr.y,
|
|
124
|
-
e: bl.y - tl.y + h * bl.y,
|
|
125
|
-
f: tl.y,
|
|
126
|
-
g,
|
|
127
|
-
h,
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
const applyProjectiveTransform = (transform, uv) => {
|
|
131
|
-
const denominator = transform.g * uv[0] + transform.h * uv[1] + 1;
|
|
132
|
-
return {
|
|
133
|
-
x: (transform.a * uv[0] + transform.b * uv[1] + transform.c) / denominator,
|
|
134
|
-
y: (transform.d * uv[0] + transform.e * uv[1] + transform.f) / denominator,
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
const getUvHandlePosition = (points, uv) => {
|
|
138
|
-
const transform = getProjectiveTransform(points);
|
|
139
|
-
return transform === null
|
|
140
|
-
? getBilinearUvHandlePosition(points, uv)
|
|
141
|
-
: applyProjectiveTransform(transform, uv);
|
|
142
|
-
};
|
|
143
|
-
exports.getUvHandlePosition = getUvHandlePosition;
|
|
144
97
|
const getUvHandleConnectionLines = ({ handles, points, }) => {
|
|
145
98
|
const handlesByField = new Map(handles.map((handle) => [
|
|
146
99
|
`${handle.effectIndex}\u0000${handle.fieldKey}`,
|
|
@@ -337,64 +290,6 @@ const getUvEllipseInteractiveControls = ({ handles, dimensions, points, }) => {
|
|
|
337
290
|
return controls;
|
|
338
291
|
};
|
|
339
292
|
exports.getUvEllipseInteractiveControls = getUvEllipseInteractiveControls;
|
|
340
|
-
const vectorBetween = (from, to) => {
|
|
341
|
-
return { x: to.x - from.x, y: to.y - from.y };
|
|
342
|
-
};
|
|
343
|
-
const getBilinearUvCoordinateForPoint = (points, point) => {
|
|
344
|
-
const [tl, tr, br, bl] = points;
|
|
345
|
-
let u = 0.5;
|
|
346
|
-
let v = 0.5;
|
|
347
|
-
for (let i = 0; i < 8; i++) {
|
|
348
|
-
const current = getBilinearUvHandlePosition(points, [u, v]);
|
|
349
|
-
const errorX = current.x - point.x;
|
|
350
|
-
const errorY = current.y - point.y;
|
|
351
|
-
if (Math.abs(errorX) + Math.abs(errorY) < 0.001) {
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
const du = {
|
|
355
|
-
x: (0, selected_outline_geometry_1.mix)(tr.x - tl.x, br.x - bl.x, v),
|
|
356
|
-
y: (0, selected_outline_geometry_1.mix)(tr.y - tl.y, br.y - bl.y, v),
|
|
357
|
-
};
|
|
358
|
-
const dv = vectorBetween((0, selected_outline_geometry_1.mixPoint)(tl, tr, u), (0, selected_outline_geometry_1.mixPoint)(bl, br, u));
|
|
359
|
-
const determinant = du.x * dv.y - du.y * dv.x;
|
|
360
|
-
if (Math.abs(determinant) < 0.000001) {
|
|
361
|
-
break;
|
|
362
|
-
}
|
|
363
|
-
u -= (errorX * dv.y - errorY * dv.x) / determinant;
|
|
364
|
-
v -= (du.x * errorY - du.y * errorX) / determinant;
|
|
365
|
-
}
|
|
366
|
-
return [u, v];
|
|
367
|
-
};
|
|
368
|
-
const getUvCoordinateForPoint = (points, point) => {
|
|
369
|
-
const transform = getProjectiveTransform(points);
|
|
370
|
-
if (transform === null) {
|
|
371
|
-
return getBilinearUvCoordinateForPoint(points, point);
|
|
372
|
-
}
|
|
373
|
-
const determinant = transform.a * (transform.e - transform.f * transform.h) -
|
|
374
|
-
transform.b * (transform.d - transform.f * transform.g) +
|
|
375
|
-
transform.c * (transform.d * transform.h - transform.e * transform.g);
|
|
376
|
-
if (Math.abs(determinant) < projectiveEpsilon) {
|
|
377
|
-
return getBilinearUvCoordinateForPoint(points, point);
|
|
378
|
-
}
|
|
379
|
-
const inverseA = transform.e - transform.f * transform.h;
|
|
380
|
-
const inverseB = transform.c * transform.h - transform.b;
|
|
381
|
-
const inverseC = transform.b * transform.f - transform.c * transform.e;
|
|
382
|
-
const inverseD = transform.f * transform.g - transform.d;
|
|
383
|
-
const inverseE = transform.a - transform.c * transform.g;
|
|
384
|
-
const inverseF = transform.c * transform.d - transform.a * transform.f;
|
|
385
|
-
const inverseG = transform.d * transform.h - transform.e * transform.g;
|
|
386
|
-
const inverseH = transform.b * transform.g - transform.a * transform.h;
|
|
387
|
-
const inverseI = transform.a * transform.e - transform.b * transform.d;
|
|
388
|
-
const denominator = inverseG * point.x + inverseH * point.y + inverseI;
|
|
389
|
-
if (Math.abs(denominator) < projectiveEpsilon) {
|
|
390
|
-
return getBilinearUvCoordinateForPoint(points, point);
|
|
391
|
-
}
|
|
392
|
-
return [
|
|
393
|
-
(inverseA * point.x + inverseB * point.y + inverseC) / denominator,
|
|
394
|
-
(inverseD * point.x + inverseE * point.y + inverseF) / denominator,
|
|
395
|
-
];
|
|
396
|
-
};
|
|
397
|
-
exports.getUvCoordinateForPoint = getUvCoordinateForPoint;
|
|
398
293
|
function constrainUv(value, schema) {
|
|
399
294
|
var _a, _b;
|
|
400
295
|
const min = (_a = schema.min) !== null && _a !== void 0 ? _a : -Infinity;
|
|
@@ -515,7 +410,7 @@ const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides,
|
|
|
515
410
|
propStatus,
|
|
516
411
|
dragOverrideValue: dragOverrides[key],
|
|
517
412
|
defaultValue: undefined,
|
|
518
|
-
frame: sourceFrame,
|
|
413
|
+
frame: (0, get_timeline_keyframes_1.resolveKeyframeSourceFrame)(sourceFrame, propStatus),
|
|
519
414
|
shouldResortToDefaultValueIfUndefined: false,
|
|
520
415
|
});
|
|
521
416
|
});
|
|
@@ -533,7 +428,7 @@ const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides,
|
|
|
533
428
|
propStatus,
|
|
534
429
|
dragOverrideValue: dragOverrides[fieldKey],
|
|
535
430
|
defaultValue: fieldSchema.default,
|
|
536
|
-
frame: sourceFrame,
|
|
431
|
+
frame: (0, get_timeline_keyframes_1.resolveKeyframeSourceFrame)(sourceFrame, propStatus),
|
|
537
432
|
shouldResortToDefaultValueIfUndefined: true,
|
|
538
433
|
});
|
|
539
434
|
}
|
|
@@ -9,19 +9,9 @@ const flushSequencePropsSubscriptions = () => {
|
|
|
9
9
|
sequencePropsSubscriptionTimer = null;
|
|
10
10
|
const pending = pendingSequencePropsSubscriptions;
|
|
11
11
|
pendingSequencePropsSubscriptions = [];
|
|
12
|
-
const firstRequest = pending[0].request;
|
|
13
12
|
(0, call_api_1.callApi)('/api/subscribe-to-sequence-props', {
|
|
14
|
-
...firstRequest,
|
|
15
13
|
requests: pending.map(({ request }) => request),
|
|
16
14
|
}).then((response) => {
|
|
17
|
-
if (!Array.isArray(response.results)) {
|
|
18
|
-
pending[0].resolve(response);
|
|
19
|
-
const error = new Error('Legacy single subscription response received for a batched request');
|
|
20
|
-
for (const item of pending.slice(1)) {
|
|
21
|
-
item.reject(error);
|
|
22
|
-
}
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
15
|
if (response.results.length !== pending.length) {
|
|
26
16
|
const error = new Error(`Expected ${pending.length} sequence prop subscription results, got ${response.results.length}`);
|
|
27
17
|
for (const item of pending) {
|
|
@@ -34,11 +34,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.useSelectedOutlineControlTarget = void 0;
|
|
37
|
+
const canvas_1 = require("@remotion/canvas");
|
|
37
38
|
const react_1 = __importStar(require("react"));
|
|
38
|
-
const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
39
39
|
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
40
40
|
const useSelectedOutlineControlTarget = ({ getLatestTargetByKey, layoutTarget, }) => {
|
|
41
|
-
|
|
41
|
+
var _a;
|
|
42
|
+
const hoverController = (0, react_1.useContext)(timeline_sequence_hover_1.TimelineSequenceHoverContext);
|
|
42
43
|
const targetRef = (0, react_1.useRef)(layoutTarget);
|
|
43
44
|
(0, react_1.useLayoutEffect)(() => {
|
|
44
45
|
targetRef.current = layoutTarget;
|
|
@@ -51,29 +52,19 @@ const useSelectedOutlineControlTarget = ({ getLatestTargetByKey, layoutTarget, }
|
|
|
51
52
|
return getLatestTargetByKey(currentTarget.key);
|
|
52
53
|
}, [getLatestTargetByKey]);
|
|
53
54
|
const getLayoutTarget = react_1.default.useCallback(() => targetRef.current, []);
|
|
54
|
-
const
|
|
55
|
-
? null
|
|
56
|
-
: (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(layoutTarget.nodePathInfo.sequenceSubscriptionKey), [layoutTarget]);
|
|
57
|
-
const hovered = (0, timeline_sequence_hover_1.useIsTimelineSequenceHovered)(hoveredNodePathKey);
|
|
55
|
+
const { hovered, onPointerEnter, onPointerLeave } = (0, canvas_1.useCanvasSequenceHover)(hoverController, (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.nodePathInfo) !== null && _a !== void 0 ? _a : null, 'canvas');
|
|
58
56
|
const controlTarget = layoutTarget !== undefined && (layoutTarget.containsSelection || hovered)
|
|
59
57
|
? getLatestTargetByKey(layoutTarget.key)
|
|
60
58
|
: undefined;
|
|
61
59
|
const onHoverChange = react_1.default.useCallback((key) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
nodePathKey: (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(hoverTarget.nodePathInfo.sequenceSubscriptionKey),
|
|
71
|
-
source: 'canvas',
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover;
|
|
75
|
-
});
|
|
76
|
-
}, [setHoveredSequence]);
|
|
60
|
+
var _a;
|
|
61
|
+
if (key === null) {
|
|
62
|
+
onPointerLeave();
|
|
63
|
+
}
|
|
64
|
+
else if (((_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.key) === key) {
|
|
65
|
+
onPointerEnter();
|
|
66
|
+
}
|
|
67
|
+
}, [onPointerEnter, onPointerLeave]);
|
|
77
68
|
return { controlTarget, getLayoutTarget, getTarget, hovered, onHoverChange };
|
|
78
69
|
};
|
|
79
70
|
exports.useSelectedOutlineControlTarget = useSelectedOutlineControlTarget;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapJsxNode = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const wrapJsxNode = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
if (browserStudioOperations) {
|
|
9
|
+
return browserStudioOperations.wrapJsxNode(request);
|
|
10
|
+
}
|
|
11
|
+
return (0, call_api_1.callApi)('/api/wrap-jsx-node', request);
|
|
12
|
+
};
|
|
13
|
+
exports.wrapJsxNode = wrapJsxNode;
|
|
@@ -7,9 +7,13 @@ const AppLaunchButton_1 = require("../../components/AppLaunchButton");
|
|
|
7
7
|
const NotificationCenter_1 = require("../../components/Notifications/NotificationCenter");
|
|
8
8
|
const SettingsContext_1 = require("../../components/SettingsContext");
|
|
9
9
|
const use_configure_default_apps_1 = require("../../components/use-configure-default-apps");
|
|
10
|
+
const colors_1 = require("../../helpers/colors");
|
|
11
|
+
const copy_text_1 = require("../../helpers/copy-text");
|
|
10
12
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
11
13
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
14
|
+
const clipboard_1 = require("../../icons/clipboard");
|
|
12
15
|
const editor_1 = require("../../icons/editor");
|
|
16
|
+
const format_location_1 = require("./format-location");
|
|
13
17
|
const ShortcutHint_1 = require("./ShortcutHint");
|
|
14
18
|
const menuLabel = {
|
|
15
19
|
color: 'inherit',
|
|
@@ -17,10 +21,14 @@ const menuLabel = {
|
|
|
17
21
|
fontSize: 13,
|
|
18
22
|
lineHeight: '16px',
|
|
19
23
|
};
|
|
24
|
+
const copyIcon = { height: 16, width: 16 };
|
|
20
25
|
const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName, size }) => {
|
|
21
26
|
const { editorInfo } = (0, SettingsContext_1.useSettings)();
|
|
22
27
|
const configureDefaultApps = (0, use_configure_default_apps_1.useConfigureDefaultApps)();
|
|
23
28
|
const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
|
|
29
|
+
const sourcePath = stack.originalFileName
|
|
30
|
+
? (0, format_location_1.formatLocation)(stack.originalFileName)
|
|
31
|
+
: null;
|
|
24
32
|
const openWithEditor = (0, react_1.useCallback)(async (selectedEditorId, selectedEditorName) => {
|
|
25
33
|
try {
|
|
26
34
|
const response = await (0, open_in_editor_1.openInEditor)(stack, selectedEditorId);
|
|
@@ -35,6 +43,16 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName, s
|
|
|
35
43
|
const openPreferredEditor = (0, react_1.useCallback)(() => {
|
|
36
44
|
openWithEditor(editorId, editorName).catch(() => undefined);
|
|
37
45
|
}, [editorId, editorName, openWithEditor]);
|
|
46
|
+
const copyPath = (0, react_1.useCallback)(() => {
|
|
47
|
+
if (sourcePath === null) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
(0, copy_text_1.copyText)(sourcePath)
|
|
51
|
+
.then(() => (0, NotificationCenter_1.showNotification)('Copied path', 1500))
|
|
52
|
+
.catch((err) => {
|
|
53
|
+
(0, NotificationCenter_1.showNotification)(`Could not copy path: ${err.message}`, 2000);
|
|
54
|
+
});
|
|
55
|
+
}, [sourcePath]);
|
|
38
56
|
(0, react_1.useEffect)(() => {
|
|
39
57
|
if (!canHaveKeyboardShortcuts) {
|
|
40
58
|
return;
|
|
@@ -66,8 +84,33 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName, s
|
|
|
66
84
|
type: 'item',
|
|
67
85
|
value: editor.id,
|
|
68
86
|
}));
|
|
69
|
-
|
|
70
|
-
|
|
87
|
+
if (sourcePath === null) {
|
|
88
|
+
return editorItems;
|
|
89
|
+
}
|
|
90
|
+
return [
|
|
91
|
+
...editorItems,
|
|
92
|
+
...(editorItems.length > 0
|
|
93
|
+
? [{ type: 'divider', id: 'copy-path-divider' }]
|
|
94
|
+
: []),
|
|
95
|
+
{
|
|
96
|
+
id: 'copy-path',
|
|
97
|
+
keyHint: null,
|
|
98
|
+
label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Copy path" }),
|
|
99
|
+
leftItem: jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { color: colors_1.LIGHT_TEXT, style: copyIcon }),
|
|
100
|
+
onClick: copyPath,
|
|
101
|
+
quickSwitcherLabel: null,
|
|
102
|
+
subMenu: null,
|
|
103
|
+
type: 'item',
|
|
104
|
+
value: 'copy-path',
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
}, [
|
|
108
|
+
copyPath,
|
|
109
|
+
editorId,
|
|
110
|
+
editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors,
|
|
111
|
+
openWithEditor,
|
|
112
|
+
sourcePath,
|
|
113
|
+
]);
|
|
71
114
|
return (jsx_runtime_1.jsxs(AppLaunchButton_1.AppLaunchButton, { actionButtonId: "error-overlay-open-in-editor", ariaLabel: `Open in ${editorName}`, disabled: false, menuAriaLabel: "Open in another app", menuButtonId: "error-overlay-open-in-another-app", menuItems: menuItems, onConfigureApps: configureDefaultApps, onClick: openPreferredEditor, size: size, style: null, title: `Open in ${editorName}`, children: [
|
|
72
115
|
jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editorId, size: size === 'default' ? 14 : 18 }),
|
|
73
116
|
"Open in ", editorName, canHaveKeyboardShortcuts ? (jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "o", cmdOrCtrl: true })) : null] }));
|
|
@@ -13,7 +13,15 @@ const format_location_1 = require("./format-location");
|
|
|
13
13
|
const location = {
|
|
14
14
|
color: colors_1.LIGHT_TEXT,
|
|
15
15
|
fontFamily: 'monospace',
|
|
16
|
-
|
|
16
|
+
textAlign: 'left',
|
|
17
|
+
whiteSpace: 'nowrap',
|
|
18
|
+
};
|
|
19
|
+
const locationMask = 'linear-gradient(to right, black calc(100% - 20px), transparent)';
|
|
20
|
+
const locationContainer = {
|
|
21
|
+
...location,
|
|
22
|
+
maskImage: locationMask,
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
WebkitMaskImage: locationMask,
|
|
17
25
|
};
|
|
18
26
|
const header = {
|
|
19
27
|
paddingTop: 10,
|
|
@@ -39,6 +47,27 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editor
|
|
|
39
47
|
!((_b = s.originalFileName) === null || _b === void 0 ? void 0 : _b.startsWith('webpack/'))) ||
|
|
40
48
|
isFirst;
|
|
41
49
|
});
|
|
50
|
+
const locationRef = (0, react_1.useRef)(null);
|
|
51
|
+
const [locationOverflows, setLocationOverflows] = (0, react_1.useState)(false);
|
|
52
|
+
const fileLocation = s.originalFileName
|
|
53
|
+
? `${(0, format_location_1.formatLocation)(s.originalFileName)}:${s.originalLineNumber}`
|
|
54
|
+
: null;
|
|
55
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
56
|
+
const element = locationRef.current;
|
|
57
|
+
if (!element) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const update = () => {
|
|
61
|
+
setLocationOverflows(element.scrollWidth > element.clientWidth);
|
|
62
|
+
};
|
|
63
|
+
update();
|
|
64
|
+
const observer = new ResizeObserver(update);
|
|
65
|
+
observer.observe(element);
|
|
66
|
+
if (element.firstElementChild) {
|
|
67
|
+
observer.observe(element.firstElementChild);
|
|
68
|
+
}
|
|
69
|
+
return () => observer.disconnect();
|
|
70
|
+
}, [fileLocation, fontSize]);
|
|
42
71
|
const canOpenFileLocation = Boolean(editorId && s.originalFileName);
|
|
43
72
|
const onOpenFileLocation = (0, react_1.useCallback)(() => {
|
|
44
73
|
if (!canOpenFileLocation) {
|
|
@@ -64,7 +93,7 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editor
|
|
|
64
93
|
paddingLeft: horizontalSpacing,
|
|
65
94
|
paddingRight: horizontalSpacing,
|
|
66
95
|
}, children: [
|
|
67
|
-
jsx_runtime_1.jsxs("div", { style: left, children: [functionName === null ? null : (jsx_runtime_1.jsx("div", { style: { ...fnName, fontSize }, children: functionName })),
|
|
96
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [functionName === null ? null : (jsx_runtime_1.jsx("div", { style: { ...fnName, fontSize }, children: functionName })), fileLocation ? (jsx_runtime_1.jsx("div", { ref: locationRef, style: { ...locationContainer, fontSize }, title: locationOverflows ? fileLocation : undefined, children: canOpenFileLocation ? (jsx_runtime_1.jsx("button", { type: "button", className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: onOpenFileLocation, style: {
|
|
68
97
|
...location,
|
|
69
98
|
...(0, hoverable_1.hoverableStyle)({
|
|
70
99
|
idleBackground: colors_1.TRANSPARENT,
|
|
@@ -78,7 +107,7 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editor
|
|
|
78
107
|
cursor: 'default',
|
|
79
108
|
fontSize,
|
|
80
109
|
padding: 0,
|
|
81
|
-
}, children:
|
|
110
|
+
}, children: fileLocation })) : (fileLocation) })) : null] }), headerAction, collapsible &&
|
|
82
111
|
s.originalScriptCode &&
|
|
83
112
|
s.originalScriptCode.length > 0 ? (jsx_runtime_1.jsx(Button_1.Button, { onClick: toggleCodeFrame, children: jsx_runtime_1.jsx("div", { style: {
|
|
84
113
|
display: 'flex',
|