@remotion/studio 4.0.517 → 4.0.519
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/AppLaunchButton.d.ts +16 -0
- package/dist/components/AppLaunchButton.js +90 -0
- package/dist/components/AssetSelector.js +64 -22
- package/dist/components/AssetSelectorItem.d.ts +14 -1
- package/dist/components/AssetSelectorItem.js +219 -70
- package/dist/components/Button.js +20 -7
- package/dist/components/Canvas.js +109 -78
- package/dist/components/CanvasOrLoading.js +7 -7
- package/dist/components/CaptionTextEditor.js +32 -8
- package/dist/components/CodingAgentButton.d.ts +7 -0
- package/dist/components/CodingAgentButton.js +59 -0
- package/dist/components/CompositionContextButton.d.ts +1 -0
- package/dist/components/CompositionContextButton.js +7 -3
- package/dist/components/CompositionSelector.js +16 -11
- package/dist/components/CompositionSelectorItem.js +16 -23
- package/dist/components/ConfigureLicenseModal.js +4 -48
- package/dist/components/CurrentAsset.js +1 -1
- package/dist/components/EditorContent.js +6 -3
- package/dist/components/ElementInstallConfirmation.d.ts +25 -7
- package/dist/components/ElementInstallConfirmation.js +347 -30
- package/dist/components/ElementLibraryModal.js +3 -1
- package/dist/components/FixComputedValueModal.js +5 -131
- package/dist/components/InitialCompositionLoader.js +3 -2
- package/dist/components/InlineCaptionInspector.js +13 -2
- package/dist/components/InspectorOpenInEditor.js +48 -33
- package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/styles.js +1 -0
- package/dist/components/InspectorSequenceSection.js +8 -3
- package/dist/components/InspectorSourceLocation.js +5 -1
- package/dist/components/KnownBugs.d.ts +1 -1
- package/dist/components/KnownBugs.js +1 -1
- package/dist/components/LicenseExplanation.d.ts +2 -0
- package/dist/components/LicenseExplanation.js +63 -0
- package/dist/components/MenuToolbar.js +7 -1
- package/dist/components/Modals.js +50 -2
- package/dist/components/NewComposition/InputDragger.js +29 -2
- package/dist/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/components/NewComposition/NewComposition.d.ts +23 -0
- package/dist/components/NewComposition/NewComposition.js +217 -80
- package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
- package/dist/components/PlaybackRateSelector.js +2 -5
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -7
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +21 -13
- package/dist/components/RenderQueue/actions.d.ts +1 -0
- package/dist/components/RenderQueue/actions.js +5 -1
- package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
- package/dist/components/SelectedOutlineElement.js +2 -1
- package/dist/components/SelectedOutlineOverlay.js +9 -10
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +12 -4
- package/dist/components/SelectedOutlineRenderer.d.ts +1 -1
- package/dist/components/SelectedOutlineRenderer.js +33 -35
- package/dist/components/SettingsContext.js +2 -1
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +19 -3
- package/dist/components/SidebarRenderButton.d.ts +1 -0
- package/dist/components/SidebarRenderButton.js +15 -5
- package/dist/components/Timeline/SequencePropsObserver.js +29 -14
- package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
- package/dist/components/Timeline/TimelineRowChrome.js +4 -2
- package/dist/components/Timeline/TimelineSequence.js +40 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +34 -1
- package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
- package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
- package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/UpdateCheck.d.ts +0 -8
- package/dist/components/UpdateCheck.js +7 -54
- package/dist/components/UpdateStatusContext.d.ts +18 -0
- package/dist/components/UpdateStatusContext.js +74 -0
- package/dist/components/UpdatesSettings.d.ts +2 -0
- package/dist/components/UpdatesSettings.js +251 -0
- package/dist/components/WebMcp.d.ts +2 -0
- package/dist/components/WebMcp.js +945 -0
- package/dist/components/composition-menu-items.js +26 -0
- package/dist/components/get-open-in-menu-items.d.ts +4 -0
- package/dist/components/get-open-in-menu-items.js +28 -24
- package/dist/components/root-composition-menu-items.d.ts +4 -1
- package/dist/components/root-composition-menu-items.js +38 -1
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +13 -5
- package/dist/components/use-configure-default-apps.d.ts +1 -0
- package/dist/components/use-configure-default-apps.js +24 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
- package/dist/esm/{chunk-gzqm3g2m.js → chunk-1fkq5bfq.js} +24093 -21093
- package/dist/esm/chunk-6jf1natv.js +25 -0
- package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
- package/dist/esm/chunk-m0jqdbkr.js +14571 -0
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/internals.mjs +43231 -25675
- package/dist/esm/previewEntry.mjs +46334 -28776
- package/dist/esm/renderEntry.mjs +6 -3
- package/dist/helpers/can-show-updates.d.ts +5 -0
- package/dist/helpers/can-show-updates.js +7 -0
- package/dist/helpers/colors.d.ts +0 -3
- package/dist/helpers/colors.js +2 -5
- package/dist/helpers/create-folder-tree.d.ts +5 -0
- package/dist/helpers/create-folder-tree.js +40 -2
- package/dist/helpers/format-file-location.d.ts +8 -0
- package/dist/helpers/format-file-location.js +14 -3
- package/dist/helpers/get-asset-metadata.js +1 -1
- package/dist/helpers/get-git-menu-item.d.ts +5 -0
- package/dist/helpers/get-git-menu-item.js +15 -1
- package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
- package/dist/helpers/get-timeline-max-zoom.js +17 -6
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +14 -6
- package/dist/helpers/open-in-editor.js +51 -1
- package/dist/helpers/preview-server-events.js +3 -0
- package/dist/helpers/timeline-layout.d.ts +0 -1
- package/dist/helpers/timeline-layout.js +1 -5
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +12 -5
- package/dist/icons/enter.d.ts +4 -0
- package/dist/icons/enter.js +10 -0
- package/dist/renderEntry.js +2 -0
- package/dist/state/folders.d.ts +3 -0
- package/dist/state/folders.js +40 -1
- package/dist/state/modals.d.ts +1 -6
- package/dist/state/playbackrate.d.ts +1 -0
- package/dist/state/playbackrate.js +4 -1
- package/package.json +17 -14
- package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
- package/dist/components/UpdateModal/UpdateModal.js +0 -104
- /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
|
@@ -5,10 +5,14 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../helpers/client-id");
|
|
8
|
+
const hoverable_1 = require("../helpers/hoverable");
|
|
8
9
|
const render_1 = require("../icons/render");
|
|
9
10
|
const modals_1 = require("../state/modals");
|
|
10
11
|
const InlineAction_1 = require("./InlineAction");
|
|
11
|
-
const
|
|
12
|
+
const revealStyle = {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
};
|
|
15
|
+
const SidebarRenderButton = ({ composition, visible, readOnlyStudio }) => {
|
|
12
16
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
13
17
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
14
18
|
return {
|
|
@@ -78,15 +82,21 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
78
82
|
initialMediaCacheSizeInBytes: defaults.mediaCacheSizeInBytes,
|
|
79
83
|
renderDefaults: defaults,
|
|
80
84
|
initialDarkMode: defaults.darkMode,
|
|
81
|
-
readOnlyStudio
|
|
85
|
+
readOnlyStudio,
|
|
82
86
|
});
|
|
83
|
-
}, [
|
|
87
|
+
}, [
|
|
88
|
+
composition.defaultProps,
|
|
89
|
+
composition.id,
|
|
90
|
+
props,
|
|
91
|
+
readOnlyStudio,
|
|
92
|
+
setSelectedModal,
|
|
93
|
+
]);
|
|
84
94
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
85
95
|
return jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: color, svgProps: iconStyle });
|
|
86
96
|
}, [iconStyle]);
|
|
87
|
-
if (!visible || connectionStatus !== 'connected') {
|
|
97
|
+
if (!visible || (connectionStatus !== 'connected' && !readOnlyStudio)) {
|
|
88
98
|
return null;
|
|
89
99
|
}
|
|
90
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
100
|
+
return (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVER_GROUP_REVEAL_CLASS_NAME, style: revealStyle, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null, style: hoverable_1.NO_HOVER_BACKGROUND_STYLE, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME }) }));
|
|
91
101
|
};
|
|
92
102
|
exports.SidebarRenderButton = SidebarRenderButton;
|
|
@@ -7,6 +7,7 @@ const fast_refresh_context_1 = require("../../fast-refresh-context");
|
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const sequence_node_path_mutations_1 = require("../../helpers/sequence-node-path-mutations");
|
|
9
9
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
10
|
+
const sequence_props_subscription_store_1 = require("./sequence-props-subscription-store");
|
|
10
11
|
const SequencePropsObserver = () => {
|
|
11
12
|
const { subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
12
13
|
const { remapPropStatuses, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -37,11 +38,13 @@ const SequencePropsObserver = () => {
|
|
|
37
38
|
}
|
|
38
39
|
const statusRemappings = [];
|
|
39
40
|
const overrideUpdates = [];
|
|
41
|
+
const overrideIdsToRefresh = new Set();
|
|
40
42
|
for (const [overrideId, previousNodePath] of Object.entries(overrideIdToNodePathMappingsRef.current)) {
|
|
41
43
|
let { nodePath } = previousNodePath;
|
|
42
44
|
let wasRemapped = false;
|
|
43
45
|
let wasDeleted = false;
|
|
44
46
|
let runtimeNodePathExists = true;
|
|
47
|
+
let runtimeNodePathNeedsRefresh = false;
|
|
45
48
|
const previousNodePathString = JSON.stringify(previousNodePath.nodePath);
|
|
46
49
|
for (const mutation of mutations) {
|
|
47
50
|
for (const file of mutation.files) {
|
|
@@ -49,29 +52,35 @@ const SequencePropsObserver = () => {
|
|
|
49
52
|
continue;
|
|
50
53
|
}
|
|
51
54
|
// Prop statuses follow source nodes to their new paths. Override IDs,
|
|
52
|
-
// however, follow React's runtime instances.
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
const runtimeNodePathIsSource = file.remappings.some((item) =>
|
|
55
|
+
// however, follow React's runtime instances. Structural edits may reuse
|
|
56
|
+
// the instance already at a path, so only remove mappings from paths
|
|
57
|
+
// which are sources without also being destinations.
|
|
58
|
+
const runtimeNodePathIsSource = file.remappings.some((item) => item.oldNodePath !== null &&
|
|
59
|
+
JSON.stringify(item.oldNodePath) === previousNodePathString);
|
|
56
60
|
const runtimeNodePathIsDestination = file.remappings.some((item) => item.newNodePath !== null &&
|
|
57
61
|
JSON.stringify(item.newNodePath) === previousNodePathString);
|
|
58
|
-
const
|
|
62
|
+
const runtimeNodePathWasInserted = file.remappings.some((item) => item.oldNodePath === null &&
|
|
63
|
+
item.newNodePath !== null &&
|
|
64
|
+
JSON.stringify(item.newNodePath) === previousNodePathString);
|
|
65
|
+
const runtimeNodePathWasUpdated = file.remappings.some((item) => item.oldNodePath !== null &&
|
|
66
|
+
item.newNodePath !== null &&
|
|
67
|
+
JSON.stringify(item.oldNodePath) === previousNodePathString &&
|
|
68
|
+
JSON.stringify(item.newNodePath) === previousNodePathString);
|
|
59
69
|
if (runtimeNodePathIsSource) {
|
|
60
|
-
runtimeNodePathExists =
|
|
61
|
-
|
|
70
|
+
runtimeNodePathExists = runtimeNodePathIsDestination;
|
|
71
|
+
runtimeNodePathNeedsRefresh =
|
|
72
|
+
runtimeNodePathWasInserted || runtimeNodePathWasUpdated;
|
|
62
73
|
}
|
|
63
|
-
else if (runtimeNodePathIsDestination
|
|
64
|
-
runtimeNodePathWasRestored) {
|
|
74
|
+
else if (runtimeNodePathIsDestination) {
|
|
65
75
|
runtimeNodePathExists = true;
|
|
76
|
+
runtimeNodePathNeedsRefresh =
|
|
77
|
+
runtimeNodePathWasInserted || runtimeNodePathWasUpdated;
|
|
66
78
|
}
|
|
67
79
|
if (wasDeleted) {
|
|
68
|
-
const wasRestored = file.restoredNodePaths.some((restoredNodePath) => JSON.stringify(restoredNodePath) === JSON.stringify(nodePath));
|
|
69
|
-
if (wasRestored) {
|
|
70
|
-
wasDeleted = false;
|
|
71
|
-
}
|
|
72
80
|
continue;
|
|
73
81
|
}
|
|
74
|
-
const remapping = file.remappings.find((item) =>
|
|
82
|
+
const remapping = file.remappings.find((item) => item.oldNodePath !== null &&
|
|
83
|
+
JSON.stringify(item.oldNodePath) === JSON.stringify(nodePath));
|
|
75
84
|
if (!remapping) {
|
|
76
85
|
continue;
|
|
77
86
|
}
|
|
@@ -97,11 +106,17 @@ const SequencePropsObserver = () => {
|
|
|
97
106
|
overrideId,
|
|
98
107
|
nodePath: runtimeNodePathExists ? previousNodePath : null,
|
|
99
108
|
});
|
|
109
|
+
if (runtimeNodePathExists && runtimeNodePathNeedsRefresh) {
|
|
110
|
+
overrideIdsToRefresh.add(overrideId);
|
|
111
|
+
}
|
|
100
112
|
}
|
|
101
113
|
remapPropStatuses(statusRemappings);
|
|
102
114
|
for (const event of overrideUpdates) {
|
|
103
115
|
setOverrideIdToNodePath(event.overrideId, event.nodePath);
|
|
104
116
|
}
|
|
117
|
+
for (const overrideId of overrideIdsToRefresh) {
|
|
118
|
+
(0, sequence_props_subscription_store_1.refreshSequencePropsSubscription)(overrideId);
|
|
119
|
+
}
|
|
105
120
|
for (const event of statusRemappings) {
|
|
106
121
|
if (event.nodePath === null) {
|
|
107
122
|
continue;
|
|
@@ -206,6 +206,7 @@ const hasTargetKeyframeAtCurrentFrame = (target) => {
|
|
|
206
206
|
return (0, get_keyframe_navigation_1.hasKeyframeAtSourceFrame)(target.propStatus.keyframes, target.sourceFrame);
|
|
207
207
|
};
|
|
208
208
|
const getAddChange = (target) => {
|
|
209
|
+
var _a;
|
|
209
210
|
if (target.propStatus.status === 'computed' ||
|
|
210
211
|
!(0, studio_shared_1.isSchemaFieldKeyframable)({ schema: target.schema, key: target.fieldKey }) ||
|
|
211
212
|
hasTargetKeyframeAtCurrentFrame(target)) {
|
|
@@ -213,7 +214,8 @@ const getAddChange = (target) => {
|
|
|
213
214
|
}
|
|
214
215
|
const value = getCurrentKeyframeValue({
|
|
215
216
|
propStatus: target.propStatus,
|
|
216
|
-
jsxFrame: target.sourceFrame
|
|
217
|
+
jsxFrame: target.sourceFrame +
|
|
218
|
+
((_a = target.propStatus.keyframeDisplayOffsetAdjustment) !== null && _a !== void 0 ? _a : 0),
|
|
217
219
|
defaultValue: target.defaultValue,
|
|
218
220
|
dragOverrideValue: target.dragOverrideValue,
|
|
219
221
|
});
|
|
@@ -91,8 +91,10 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
|
|
|
91
91
|
}, [onSelect]);
|
|
92
92
|
const onContextMenu = (0, react_1.useCallback)((e) => {
|
|
93
93
|
e.stopPropagation();
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
if (!selected) {
|
|
95
|
+
onSelect();
|
|
96
|
+
}
|
|
97
|
+
}, [onSelect, selected]);
|
|
96
98
|
const onDoubleClickIfNotInteractive = (0, react_1.useCallback)((e) => {
|
|
97
99
|
const { target } = e;
|
|
98
100
|
if (target instanceof Element &&
|
|
@@ -54,6 +54,7 @@ const delete_jsx_node_api_1 = require("../delete-jsx-node-api");
|
|
|
54
54
|
const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
|
|
55
55
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
56
56
|
const use_select_asset_1 = require("../use-select-asset");
|
|
57
|
+
const delete_selected_timeline_item_1 = require("./delete-selected-timeline-item");
|
|
57
58
|
const disable_sequence_interactivity_1 = require("./disable-sequence-interactivity");
|
|
58
59
|
const duplicate_selected_timeline_item_1 = require("./duplicate-selected-timeline-item");
|
|
59
60
|
const get_sequence_context_menu_items_1 = require("./get-sequence-context-menu-items");
|
|
@@ -117,7 +118,7 @@ const TimelineSequenceNegativeStartInner = ({ left, width, leftEdgeVisible, clip
|
|
|
117
118
|
};
|
|
118
119
|
const TimelineSequenceNegativeStart = react_1.default.memo(TimelineSequenceNegativeStartInner);
|
|
119
120
|
const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, postmount, negativeStart, leftEdgeVisible, negativeStartClipped, style, children, nodePathInfo, sequenceFrameOffset, fromCanUpdate, frozenFrame, onMoveDragPointerDown, onPointerDownCapture, onDoubleClick, }) => {
|
|
120
|
-
var _a, _b, _c
|
|
121
|
+
var _a, _b, _c;
|
|
121
122
|
const ref = (0, react_1.useRef)(null);
|
|
122
123
|
const { onSelect, selectable, selected, selectionItem } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
123
124
|
const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
|
|
@@ -195,8 +196,8 @@ const TimelineSequenceCurrentFrame = ({ s, displayDurationInFrames, premount, po
|
|
|
195
196
|
s.type !== 'video' &&
|
|
196
197
|
s.type !== 'image' &&
|
|
197
198
|
s.loopDisplay === undefined &&
|
|
198
|
-
(isInRange || isPremounting || isPostmounting) ? (jsx_runtime_1.jsx("div", { style: {
|
|
199
|
-
paddingLeft: 5 +
|
|
199
|
+
(frozenFrame !== null || isInRange || isPremounting || isPostmounting) ? (jsx_runtime_1.jsx("div", { style: {
|
|
200
|
+
paddingLeft: 5 + negativeStartEnd + ((_c = premount === null || premount === void 0 ? void 0 : premount.width) !== null && _c !== void 0 ? _c : 0),
|
|
200
201
|
height: '100%',
|
|
201
202
|
display: 'flex',
|
|
202
203
|
alignItems: 'center',
|
|
@@ -279,7 +280,16 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
279
280
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
280
281
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
281
282
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
282
|
-
const { onSelect, selectable } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
283
|
+
const { onSelect, selectable, selected } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
284
|
+
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
285
|
+
const selectedSequenceNodePathInfos = (0, react_1.useMemo)(() => {
|
|
286
|
+
if (!selected ||
|
|
287
|
+
selectedItems.length < 2 ||
|
|
288
|
+
selectedItems.some((item) => item.type !== 'sequence')) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
return selectedItems.flatMap((item) => item.type === 'sequence' ? [item.nodePathInfo] : []);
|
|
292
|
+
}, [selected, selectedItems]);
|
|
283
293
|
const onSequenceDoubleClick = (0, react_1.useCallback)((e) => {
|
|
284
294
|
if ((0, TimelineSelection_1.isTimelineSelectionModifierEvent)(e)) {
|
|
285
295
|
e.stopPropagation();
|
|
@@ -332,6 +342,12 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
332
342
|
}
|
|
333
343
|
(0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)([nodePathInfo], confirm).catch(() => undefined);
|
|
334
344
|
}, [confirm, duplicateDisabled, nodePathInfo, validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source]);
|
|
345
|
+
const onDuplicateSelectedSequences = (0, react_1.useCallback)(() => {
|
|
346
|
+
if (!previewInteractive || selectedSequenceNodePathInfos === null) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
(0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)(selectedSequenceNodePathInfos, confirm).catch(() => undefined);
|
|
350
|
+
}, [confirm, previewInteractive, selectedSequenceNodePathInfos]);
|
|
335
351
|
const onDeleteSequenceFromSource = (0, react_1.useCallback)(async () => {
|
|
336
352
|
if (!(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) || !nodePath || deleteDisabled) {
|
|
337
353
|
return;
|
|
@@ -371,6 +387,12 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
371
387
|
nodePathInfo,
|
|
372
388
|
validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source,
|
|
373
389
|
]);
|
|
390
|
+
const onDeleteSelectedSequences = (0, react_1.useCallback)(() => {
|
|
391
|
+
if (!previewInteractive || selectedSequenceNodePathInfos === null) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
(0, delete_selected_timeline_item_1.deleteSequencesFromSource)(selectedSequenceNodePathInfos, confirm).catch(() => undefined);
|
|
395
|
+
}, [confirm, previewInteractive, selectedSequenceNodePathInfos]);
|
|
374
396
|
const onDisableSequenceInteractivity = (0, react_1.useCallback)(() => {
|
|
375
397
|
if (disableInteractivityDisabled ||
|
|
376
398
|
!nodePath ||
|
|
@@ -393,9 +415,17 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
393
415
|
]);
|
|
394
416
|
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
395
417
|
var _a;
|
|
396
|
-
if (selectable) {
|
|
418
|
+
if (selectable && !selected) {
|
|
397
419
|
onSelect({ shiftKey: false, toggleKey: false });
|
|
398
420
|
}
|
|
421
|
+
if (selectedSequenceNodePathInfos !== null) {
|
|
422
|
+
return (0, get_sequence_context_menu_items_1.getMultiSequenceContextMenuItems)({
|
|
423
|
+
deleteDisabled: !previewInteractive,
|
|
424
|
+
duplicateDisabled: !previewInteractive,
|
|
425
|
+
onDeleteSelectedSequences,
|
|
426
|
+
onDuplicateSelectedSequences,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
399
429
|
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.getSequenceFreezeFrameMenuItem)({
|
|
400
430
|
clientId: previewInteractive && previewServerState.type === 'connected'
|
|
401
431
|
? previewServerState.clientId
|
|
@@ -454,8 +484,10 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
454
484
|
nodePath,
|
|
455
485
|
onSelect,
|
|
456
486
|
onDeleteSequenceFromSource,
|
|
487
|
+
onDeleteSelectedSequences,
|
|
457
488
|
onDisableSequenceInteractivity,
|
|
458
489
|
onDuplicateSequenceFromSource,
|
|
490
|
+
onDuplicateSelectedSequences,
|
|
459
491
|
openInCodingAgent,
|
|
460
492
|
openInEditor,
|
|
461
493
|
originalLocation,
|
|
@@ -465,6 +497,8 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
465
497
|
s,
|
|
466
498
|
selectAsset,
|
|
467
499
|
selectable,
|
|
500
|
+
selected,
|
|
501
|
+
selectedSequenceNodePathInfos,
|
|
468
502
|
sequenceFrameOffset,
|
|
469
503
|
setPropStatuses,
|
|
470
504
|
setSelectedModal,
|
|
@@ -543,9 +577,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
543
577
|
? colors_1.TIMELINE_AUDIO_GRADIENT
|
|
544
578
|
: s.type === 'video'
|
|
545
579
|
? colors_1.TIMELINE_VIDEO_GRADIENT
|
|
546
|
-
:
|
|
547
|
-
? colors_1.TIMELINE_IMAGE_GRADIENT
|
|
548
|
-
: colors_1.BLUE,
|
|
580
|
+
: colors_1.BLUE,
|
|
549
581
|
border: `${get_timeline_sequence_layout_1.SEQUENCE_BORDER_WIDTH}px solid ${colors_1.WHITE_ALPHA_20}`,
|
|
550
582
|
borderLeftColor: (visibleLayout === null || visibleLayout === void 0 ? void 0 : visibleLayout.leftEdgeVisible) && !negativeStartClipped
|
|
551
583
|
? colors_1.WHITE_ALPHA_20
|
|
@@ -62,6 +62,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
62
62
|
const reorder_sequence_api_1 = require("../reorder-sequence-api");
|
|
63
63
|
const selected_outline_types_1 = require("../selected-outline-types");
|
|
64
64
|
const use_select_asset_1 = require("../use-select-asset");
|
|
65
|
+
const delete_selected_timeline_item_1 = require("./delete-selected-timeline-item");
|
|
65
66
|
const disable_sequence_interactivity_1 = require("./disable-sequence-interactivity");
|
|
66
67
|
const duplicate_selected_timeline_item_1 = require("./duplicate-selected-timeline-item");
|
|
67
68
|
const get_sequence_context_menu_items_1 = require("./get-sequence-context-menu-items");
|
|
@@ -195,6 +196,14 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
195
196
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
196
197
|
const { onSelect, selectable, selected } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
197
198
|
const { selectItem, selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
199
|
+
const selectedSequenceNodePathInfos = (0, react_1.useMemo)(() => {
|
|
200
|
+
if (!selected ||
|
|
201
|
+
selectedItems.length < 2 ||
|
|
202
|
+
selectedItems.some((item) => item.type !== 'sequence')) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
return selectedItems.flatMap((item) => item.type === 'sequence' ? [item.nodePathInfo] : []);
|
|
206
|
+
}, [selected, selectedItems]);
|
|
198
207
|
const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
|
|
199
208
|
const [effectDropHovered, setEffectDropHovered] = (0, react_1.useState)(false);
|
|
200
209
|
const [isRenaming, setIsRenaming] = (0, react_1.useState)(false);
|
|
@@ -246,6 +255,12 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
246
255
|
}
|
|
247
256
|
(0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)([nodePathInfo], confirm).catch(() => undefined);
|
|
248
257
|
}, [confirm, duplicateDisabled, nodePathInfo, validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source]);
|
|
258
|
+
const onDuplicateSelectedSequences = (0, react_1.useCallback)(() => {
|
|
259
|
+
if (!previewInteractive || selectedSequenceNodePathInfos === null) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
(0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)(selectedSequenceNodePathInfos, confirm).catch(() => undefined);
|
|
263
|
+
}, [confirm, previewInteractive, selectedSequenceNodePathInfos]);
|
|
249
264
|
const onDeleteSequenceFromSource = (0, react_1.useCallback)(async () => {
|
|
250
265
|
if (deleteDisabled || !(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) || !nodePath) {
|
|
251
266
|
return;
|
|
@@ -285,6 +300,12 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
285
300
|
validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source,
|
|
286
301
|
nodePathInfo,
|
|
287
302
|
]);
|
|
303
|
+
const onDeleteSelectedSequences = (0, react_1.useCallback)(() => {
|
|
304
|
+
if (!previewInteractive || selectedSequenceNodePathInfos === null) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
(0, delete_selected_timeline_item_1.deleteSequencesFromSource)(selectedSequenceNodePathInfos, confirm).catch(() => undefined);
|
|
308
|
+
}, [confirm, previewInteractive, selectedSequenceNodePathInfos]);
|
|
288
309
|
const onDisableSequenceInteractivity = (0, react_1.useCallback)(() => {
|
|
289
310
|
if (disableInteractivityDisabled ||
|
|
290
311
|
!nodePath ||
|
|
@@ -693,9 +714,17 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
693
714
|
}, [canRotate, nodePathInfo, selectItem, setManuallyEnabled]);
|
|
694
715
|
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
695
716
|
var _a;
|
|
696
|
-
if (selectable) {
|
|
717
|
+
if (selectable && !selected) {
|
|
697
718
|
onSelect({ shiftKey: false, toggleKey: false });
|
|
698
719
|
}
|
|
720
|
+
if (selectedSequenceNodePathInfos !== null) {
|
|
721
|
+
return (0, get_sequence_context_menu_items_1.getMultiSequenceContextMenuItems)({
|
|
722
|
+
deleteDisabled: !previewInteractive,
|
|
723
|
+
duplicateDisabled: !previewInteractive,
|
|
724
|
+
onDeleteSelectedSequences,
|
|
725
|
+
onDuplicateSelectedSequences,
|
|
726
|
+
});
|
|
727
|
+
}
|
|
699
728
|
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.getSequenceFreezeFrameMenuItem)({
|
|
700
729
|
clientId: previewInteractive && previewServerState.type === 'connected'
|
|
701
730
|
? previewServerState.clientId
|
|
@@ -835,8 +864,10 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
835
864
|
onCrop,
|
|
836
865
|
onRotate,
|
|
837
866
|
onDeleteSequenceFromSource,
|
|
867
|
+
onDeleteSelectedSequences,
|
|
838
868
|
onDisableSequenceInteractivity,
|
|
839
869
|
onDuplicateSequenceFromSource,
|
|
870
|
+
onDuplicateSelectedSequences,
|
|
840
871
|
onRenameSequence,
|
|
841
872
|
onSelect,
|
|
842
873
|
openInCodingAgent,
|
|
@@ -847,6 +878,8 @@ const TimelineSequenceItemInner = ({ afterDropLineOffset, connectedCompositions,
|
|
|
847
878
|
propStatusesForOverride,
|
|
848
879
|
selectAsset,
|
|
849
880
|
selectable,
|
|
881
|
+
selected,
|
|
882
|
+
selectedSequenceNodePathInfos,
|
|
850
883
|
sequence,
|
|
851
884
|
sequenceFrameOffset,
|
|
852
885
|
setSelectedModal,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
export declare const getSourceMapFilesForSource: (source: string) => Record<string, string> | null;
|
|
1
2
|
export declare const getOriginalLocationFromStack: (stack: string, type: "sequence" | "visual-control") => Promise<import("../../../error-overlay/react-overlay/utils/get-source-map").OriginalPosition | null>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOriginalLocationFromStack = void 0;
|
|
3
|
+
exports.getOriginalLocationFromStack = exports.getSourceMapFilesForSource = void 0;
|
|
4
4
|
const trace_mapping_1 = require("@jridgewell/trace-mapping");
|
|
5
5
|
const get_source_map_1 = require("../../../error-overlay/react-overlay/utils/get-source-map");
|
|
6
6
|
const get_location_of_sequence_1 = require("../../../helpers/get-location-of-sequence");
|
|
7
7
|
const traceMapCache = {};
|
|
8
8
|
const traceMapPromises = {};
|
|
9
|
+
const traceMapsByOriginalSource = new Map();
|
|
10
|
+
const sourceMapFilesCache = new WeakMap();
|
|
9
11
|
const browserStudioOriginalSourcePrefix = 'browser-studio-original://';
|
|
10
12
|
const studioOriginalSourcePrefix = 'studio-original://';
|
|
11
|
-
const getSourceMapCache =
|
|
13
|
+
const getSourceMapCache = (fileName) => {
|
|
12
14
|
if (traceMapCache[fileName]) {
|
|
13
|
-
return traceMapCache[fileName];
|
|
15
|
+
return Promise.resolve(traceMapCache[fileName]);
|
|
14
16
|
}
|
|
15
17
|
if (traceMapPromises[fileName]) {
|
|
16
18
|
return traceMapPromises[fileName];
|
|
@@ -18,8 +20,16 @@ const getSourceMapCache = async (fileName) => {
|
|
|
18
20
|
traceMapPromises[fileName] = fetch(`${fileName}.map`)
|
|
19
21
|
.then((res) => res.json())
|
|
20
22
|
.then((json) => {
|
|
23
|
+
var _a;
|
|
21
24
|
const map = new trace_mapping_1.TraceMap(json);
|
|
22
25
|
traceMapCache[fileName] = map;
|
|
26
|
+
for (let index = 0; index < map.sources.length; index++) {
|
|
27
|
+
const source = map.sources[index];
|
|
28
|
+
const content = (_a = map.sourcesContent) === null || _a === void 0 ? void 0 : _a[index];
|
|
29
|
+
if (source !== null && typeof content === 'string') {
|
|
30
|
+
traceMapsByOriginalSource.set(source, map);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
23
33
|
return map;
|
|
24
34
|
})
|
|
25
35
|
.finally(() => {
|
|
@@ -27,6 +37,28 @@ const getSourceMapCache = async (fileName) => {
|
|
|
27
37
|
});
|
|
28
38
|
return traceMapPromises[fileName];
|
|
29
39
|
};
|
|
40
|
+
const getSourceMapFilesForSource = (source) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const map = traceMapsByOriginalSource.get(source);
|
|
43
|
+
if (!map) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const cached = sourceMapFilesCache.get(map);
|
|
47
|
+
if (cached) {
|
|
48
|
+
return cached;
|
|
49
|
+
}
|
|
50
|
+
const files = {};
|
|
51
|
+
for (let index = 0; index < map.sources.length; index++) {
|
|
52
|
+
const fileName = map.sources[index];
|
|
53
|
+
const content = (_a = map.sourcesContent) === null || _a === void 0 ? void 0 : _a[index];
|
|
54
|
+
if (fileName !== null && typeof content === 'string') {
|
|
55
|
+
files[fileName] = content;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
sourceMapFilesCache.set(map, files);
|
|
59
|
+
return files;
|
|
60
|
+
};
|
|
61
|
+
exports.getSourceMapFilesForSource = getSourceMapFilesForSource;
|
|
30
62
|
const getOriginalLocationFromStack = async (stack, type) => {
|
|
31
63
|
const location = type === 'sequence'
|
|
32
64
|
? (0, get_location_of_sequence_1.getLocationOfSequence)(stack)
|
|
@@ -26,35 +26,33 @@ const confirmDuplicatingProgrammaticallyDuplicatedSequences = (nodePathInfos, co
|
|
|
26
26
|
confirmLabel: 'Duplicate',
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
const
|
|
30
|
-
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
31
|
-
return (0, duplicate_jsx_node_api_1.duplicateJsxNode)({
|
|
32
|
-
fileName: nodePath.absolutePath,
|
|
33
|
-
nodePath: nodePath.nodePath,
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const duplicateSequencesFromSource = (nodePathInfos, confirm) => {
|
|
29
|
+
const duplicateSequencesFromSource = async (nodePathInfos, confirm) => {
|
|
37
30
|
const programmaticallyDuplicated = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath > 1);
|
|
38
31
|
const regular = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath <= 1);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
const shouldDuplicateProgrammaticSequences = await confirmDuplicatingProgrammaticallyDuplicatedSequences(programmaticallyDuplicated, confirm);
|
|
33
|
+
const toDuplicate = [...regular];
|
|
34
|
+
if (shouldDuplicateProgrammaticSequences) {
|
|
35
|
+
toDuplicate.push(...programmaticallyDuplicated);
|
|
36
|
+
}
|
|
37
|
+
const nodes = toDuplicate.map((nodePathInfo) => {
|
|
38
|
+
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
39
|
+
return {
|
|
40
|
+
fileName: nodePath.absolutePath,
|
|
41
|
+
nodePath: nodePath.nodePath,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
try {
|
|
45
|
+
if (nodes.length === 0) {
|
|
46
|
+
return;
|
|
43
47
|
}
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
const result = await (0, duplicate_jsx_node_api_1.duplicateJsxNode)({ nodes });
|
|
49
|
+
if (!result.success) {
|
|
50
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
(0, NotificationCenter_1.showNotification)(failedResult.reason, 4000);
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
.catch((err) => {
|
|
55
|
-
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
55
|
+
}
|
|
58
56
|
};
|
|
59
57
|
exports.duplicateSequencesFromSource = duplicateSequencesFromSource;
|
|
60
58
|
const isDuplicatableSequenceRowSelection = (selection) => selection.type === 'sequence';
|
|
@@ -2,6 +2,12 @@ import type { EditorPickerId, GetDefaultCodingAgentInfoResponse, GetDefaultEdito
|
|
|
2
2
|
import type { ResolvedStackLocation, TSequence } from 'remotion';
|
|
3
3
|
import type { ComboboxValue } from '../NewComposition/ComboBox';
|
|
4
4
|
import type { TimelineAssetLinkInfo } from './timeline-asset-link';
|
|
5
|
+
export declare const getMultiSequenceContextMenuItems: ({ deleteDisabled, duplicateDisabled, onDeleteSelectedSequences, onDuplicateSelectedSequences, }: {
|
|
6
|
+
readonly deleteDisabled: boolean;
|
|
7
|
+
readonly duplicateDisabled: boolean;
|
|
8
|
+
readonly onDeleteSelectedSequences: () => void;
|
|
9
|
+
readonly onDuplicateSelectedSequences: () => void;
|
|
10
|
+
}) => ComboboxValue[];
|
|
5
11
|
export declare const getSequenceContextMenuItems: ({ assetLinkInfo, canOpenInEditor, deleteDisabled, disableInteractivityDisabled, duplicateDisabled, isProgrammaticallyDuplicated, includeSourceEditItems, codingAgentInfo, editorInfo, onConfigureApps, onDeleteSequenceFromSource, onDisableSequenceInteractivity, onDuplicateSequenceFromSource, openInCodingAgent, openInEditor, originalLocation, selectAsset, sequence, sourceActions, }: {
|
|
6
12
|
readonly assetLinkInfo: TimelineAssetLinkInfo | null;
|
|
7
13
|
readonly canOpenInEditor: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSequenceContextMenuItems = void 0;
|
|
3
|
+
exports.getSequenceContextMenuItems = exports.getMultiSequenceContextMenuItems = void 0;
|
|
4
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
5
|
const format_file_location_1 = require("../../helpers/format-file-location");
|
|
6
6
|
const get_open_in_menu_items_1 = require("../get-open-in-menu-items");
|
|
@@ -27,6 +27,39 @@ const normalizeMenuDividers = (items) => {
|
|
|
27
27
|
return normalized;
|
|
28
28
|
};
|
|
29
29
|
const interactiveSvgComponentIdentity = 'dev.remotion.remotion.Interactive.Svg';
|
|
30
|
+
const getMultiSequenceContextMenuItems = ({ deleteDisabled, duplicateDisabled, onDeleteSelectedSequences, onDuplicateSelectedSequences, }) => {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
type: 'item',
|
|
34
|
+
id: 'duplicate-selected-sequences',
|
|
35
|
+
keyHint: null,
|
|
36
|
+
label: 'Duplicate selected',
|
|
37
|
+
leftItem: null,
|
|
38
|
+
disabled: duplicateDisabled,
|
|
39
|
+
onClick: onDuplicateSelectedSequences,
|
|
40
|
+
quickSwitcherLabel: null,
|
|
41
|
+
subMenu: null,
|
|
42
|
+
value: 'duplicate-selected-sequences',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'divider',
|
|
46
|
+
id: 'duplicate-delete-selected-sequences-divider',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'item',
|
|
50
|
+
id: 'delete-selected-sequences',
|
|
51
|
+
keyHint: null,
|
|
52
|
+
label: 'Delete selected',
|
|
53
|
+
leftItem: null,
|
|
54
|
+
disabled: deleteDisabled,
|
|
55
|
+
onClick: onDeleteSelectedSequences,
|
|
56
|
+
quickSwitcherLabel: null,
|
|
57
|
+
subMenu: null,
|
|
58
|
+
value: 'delete-selected-sequences',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
};
|
|
62
|
+
exports.getMultiSequenceContextMenuItems = getMultiSequenceContextMenuItems;
|
|
30
63
|
const getSequenceContextMenuItems = ({ assetLinkInfo, canOpenInEditor, deleteDisabled, disableInteractivityDisabled, duplicateDisabled, isProgrammaticallyDuplicated, includeSourceEditItems, codingAgentInfo, editorInfo, onConfigureApps, onDeleteSequenceFromSource, onDisableSequenceInteractivity, onDuplicateSequenceFromSource, openInCodingAgent, openInEditor, originalLocation, selectAsset, sequence, sourceActions = [], }) => {
|
|
31
64
|
var _a, _b, _c;
|
|
32
65
|
var _d, _e, _f;
|
|
@@ -2,6 +2,8 @@ import type { SequenceNodePath, InteractivitySchema, VideoConfigValues } from 'r
|
|
|
2
2
|
import { subscribeToSequenceProps } from '../sequence-props-api';
|
|
3
3
|
type SubscribeResult = Awaited<ReturnType<typeof subscribeToSequenceProps>>;
|
|
4
4
|
type ApplyResult = (result: SubscribeResult) => void;
|
|
5
|
+
export declare const subscribeToSequencePropsRefresh: (overrideId: string, listener: () => void) => () => void;
|
|
6
|
+
export declare const refreshSequencePropsSubscription: (overrideId: string) => void;
|
|
5
7
|
export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, stack, }: {
|
|
6
8
|
fileName: string;
|
|
7
9
|
line: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.acquireSequencePropsSubscription = void 0;
|
|
3
|
+
exports.acquireSequencePropsSubscription = exports.refreshSequencePropsSubscription = exports.subscribeToSequencePropsRefresh = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const sequence_props_api_1 = require("../sequence-props-api");
|
|
@@ -8,6 +8,27 @@ const sequence_props_api_1 = require("../sequence-props-api");
|
|
|
8
8
|
// resolve both the old and new JSX nodes to the same line and column.
|
|
9
9
|
const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, assetKeys, effectKeys, videoConfigValues, stack, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${assetKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}\0${JSON.stringify(videoConfigValues)}\0${stack !== null && stack !== void 0 ? stack : ''}`;
|
|
10
10
|
const entries = new Map();
|
|
11
|
+
const refreshListeners = new Map();
|
|
12
|
+
const subscribeToSequencePropsRefresh = (overrideId, listener) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const listeners = (_a = refreshListeners.get(overrideId)) !== null && _a !== void 0 ? _a : new Set();
|
|
15
|
+
listeners.add(listener);
|
|
16
|
+
refreshListeners.set(overrideId, listeners);
|
|
17
|
+
return () => {
|
|
18
|
+
listeners.delete(listener);
|
|
19
|
+
if (listeners.size === 0) {
|
|
20
|
+
refreshListeners.delete(overrideId);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.subscribeToSequencePropsRefresh = subscribeToSequencePropsRefresh;
|
|
25
|
+
const refreshSequencePropsSubscription = (overrideId) => {
|
|
26
|
+
var _a;
|
|
27
|
+
for (const listener of (_a = refreshListeners.get(overrideId)) !== null && _a !== void 0 ? _a : []) {
|
|
28
|
+
listener();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.refreshSequencePropsSubscription = refreshSequencePropsSubscription;
|
|
11
32
|
const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, stack, }) => {
|
|
12
33
|
const sequenceKeys = (0, studio_shared_1.getAllSchemaKeys)(schema);
|
|
13
34
|
const assetKeys = (0, studio_shared_1.getAssetSchemaKeys)(schema);
|