@remotion/studio 4.0.506 → 4.0.507
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/api/copy-render-output-to-asset.d.ts +4 -0
- package/dist/api/copy-render-output-to-asset.js +11 -0
- package/dist/components/AssetSelector.js +19 -4
- package/dist/components/AssetSelectorItem.js +2 -2
- package/dist/components/CodingAgentIcon.d.ts +4 -0
- package/dist/components/CodingAgentIcon.js +17 -0
- package/dist/components/ConfigureDefaultEditorModal.d.ts +1 -3
- package/dist/components/ConfigureDefaultEditorModal.js +67 -77
- package/dist/components/ConfigureLicenseModal.d.ts +1 -4
- package/dist/components/ConfigureLicenseModal.js +89 -81
- package/dist/components/ContextMenu.js +10 -8
- package/dist/components/EditorContexts.js +6 -5
- package/dist/components/ExpandedTracksProvider.js +10 -53
- package/dist/components/InspectorLocationCopy.js +8 -8
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +39 -49
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +22 -4
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/Menu/MenuSectionHeader.d.ts +4 -0
- package/dist/components/Menu/MenuSectionHeader.js +20 -0
- package/dist/components/Menu/SubMenu.js +13 -2
- package/dist/components/Menu/menu-tree-context.d.ts +3 -0
- package/dist/components/Menu/menu-tree-context.js +13 -0
- package/dist/components/NewComposition/ComboBox.d.ts +6 -1
- package/dist/components/NewComposition/MenuContent.js +27 -19
- package/dist/components/NewComposition/menu-typeahead.js +2 -2
- package/dist/components/Preview.js +29 -4
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +4 -0
- package/dist/components/RenderQueue/RenderQueueItem.js +8 -2
- package/dist/components/RenderQueue/actions.d.ts +4 -2
- package/dist/components/RenderQueue/actions.js +4 -2
- package/dist/components/RenderQueue/index.js +3 -4
- package/dist/components/RenderQueue/use-render-output-file-drag.d.ts +8 -0
- package/dist/components/RenderQueue/use-render-output-file-drag.js +121 -0
- package/dist/components/SegmentedControl.js +0 -1
- package/dist/components/SelectedOutlineElement.d.ts +14 -17
- package/dist/components/SelectedOutlineElement.js +112 -930
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +7 -0
- package/dist/components/SelectedOutlineKeyboardControls.js +261 -0
- package/dist/components/SelectedOutlineOverlay.d.ts +6 -13
- package/dist/components/SelectedOutlineOverlay.js +349 -864
- package/dist/components/SelectedOutlinePolygon.d.ts +25 -0
- package/dist/components/SelectedOutlinePolygon.js +359 -0
- package/dist/components/SelectedOutlineRenderer.d.ts +18 -0
- package/dist/components/SelectedOutlineRenderer.js +208 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +16 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +269 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +16 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +211 -0
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +9 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +29 -0
- package/dist/components/SelectedOutlineTransformOriginHandle.d.ts +9 -0
- package/dist/components/SelectedOutlineTransformOriginHandle.js +286 -0
- package/dist/components/SelectedOutlineUvControls.d.ts +3 -9
- package/dist/components/SelectedOutlineUvControls.js +57 -12
- package/dist/components/SettingsContext.d.ts +15 -0
- package/dist/components/SettingsContext.js +116 -0
- package/dist/components/SettingsModal.js +10 -4
- package/dist/components/SettingsModalFooter.d.ts +1 -3
- package/dist/components/SettingsModalFooter.js +4 -6
- package/dist/components/ShowOutlinesProvider.js +2 -3
- package/dist/components/Timeline/EasingEditorModal.js +66 -22
- package/dist/components/Timeline/Timeline.js +22 -5
- package/dist/components/Timeline/TimelineDuplicateCount.d.ts +4 -0
- package/dist/components/Timeline/TimelineDuplicateCount.js +28 -0
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +3 -23
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +11 -1
- package/dist/components/Timeline/TimelineSequence.js +28 -25
- package/dist/components/Timeline/TimelineSequenceItem.js +49 -27
- package/dist/components/Timeline/TimelineTrack.js +2 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +58 -53
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +36 -4
- package/dist/components/Timeline/{use-open-sequence-in-editor.d.ts → use-open-sequence-in-apps.d.ts} +4 -1
- package/dist/components/Timeline/{use-open-sequence-in-editor.js → use-open-sequence-in-apps.js} +20 -4
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +4 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +45 -1
- package/dist/components/get-open-in-menu-items.d.ts +12 -0
- package/dist/components/get-open-in-menu-items.js +83 -0
- package/dist/components/selected-outline-measurement.d.ts +2 -2
- package/dist/components/selected-outline-order.d.ts +12 -0
- package/dist/components/selected-outline-order.js +251 -0
- package/dist/components/selected-outline-types.d.ts +9 -10
- package/dist/components/svg-point-to-client-point.d.ts +2 -0
- package/dist/components/svg-point-to-client-point.js +10 -0
- package/dist/components/use-auto-save-config.d.ts +8 -0
- package/dist/components/use-auto-save-config.js +74 -0
- package/dist/components/use-default-editor-info.d.ts +1 -0
- package/dist/components/use-default-editor-info.js +10 -30
- package/dist/esm/{chunk-jefhcs5z.js → chunk-fgedsvhb.js} +1 -2
- package/dist/esm/{chunk-b49ec3nz.js → chunk-ptnd65a9.js} +10602 -9364
- package/dist/esm/internals.mjs +10601 -9363
- package/dist/esm/previewEntry.mjs +10462 -9224
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/are-sequence-node-path-infos-equal.d.ts +2 -0
- package/dist/helpers/are-sequence-node-path-infos-equal.js +27 -0
- package/dist/helpers/calculate-timeline.js +3 -3
- package/dist/helpers/client-id.js +8 -1
- package/dist/helpers/format-file-location.d.ts +1 -1
- package/dist/helpers/format-file-location.js +3 -3
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
- package/dist/helpers/open-in-editor.d.ts +1 -0
- package/dist/helpers/open-in-editor.js +5 -1
- package/dist/helpers/studio-runtime-config.js +3 -0
- package/dist/helpers/timeline-node-path-key.d.ts +2 -0
- package/dist/helpers/timeline-node-path-key.js +3 -1
- package/dist/helpers/use-asset-drag-events.d.ts +2 -1
- package/dist/helpers/use-asset-drag-events.js +14 -6
- package/dist/helpers/use-menu-structure.js +2 -2
- package/dist/helpers/use-runtime-values.d.ts +1 -3
- package/dist/state/timeline-sequence-hover.d.ts +9 -3
- package/dist/state/timeline-sequence-hover.js +63 -12
- package/package.json +12 -12
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
WHITE,
|
|
5
5
|
__require,
|
|
6
6
|
__toESM
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-fgedsvhb.js";
|
|
8
8
|
|
|
9
9
|
// src/renderEntry.tsx
|
|
10
10
|
import { useContext, useEffect, useRef, useState } from "react";
|
|
@@ -212,7 +212,7 @@ var renderContent = (Root) => {
|
|
|
212
212
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
213
213
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
214
214
|
}));
|
|
215
|
-
import("./chunk-
|
|
215
|
+
import("./chunk-ptnd65a9.js").then(({ StudioInternals }) => {
|
|
216
216
|
window.remotion_isStudio = true;
|
|
217
217
|
window.remotion_isReadOnlyStudio = true;
|
|
218
218
|
window.remotion_inputProps = "{}";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.areSequenceNodePathInfosEqual = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const areSequenceNodePathInfosEqual = (first, second) => {
|
|
6
|
+
if (first.index !== second.index ||
|
|
7
|
+
first.numberOfSequencesWithThisNodePath !==
|
|
8
|
+
second.numberOfSequencesWithThisNodePath ||
|
|
9
|
+
first.supportsEffects !== second.supportsEffects ||
|
|
10
|
+
(0, studio_shared_1.stringifySequenceSubscriptionKey)(first.sequenceSubscriptionKey) !==
|
|
11
|
+
(0, studio_shared_1.stringifySequenceSubscriptionKey)(second.sequenceSubscriptionKey) ||
|
|
12
|
+
first.auxiliaryKeys.length !== second.auxiliaryKeys.length ||
|
|
13
|
+
!first.auxiliaryKeys.every((key, index) => key === second.auxiliaryKeys[index])) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const firstVideoConfig = first.sequenceSubscriptionKey.videoConfigValues;
|
|
17
|
+
const secondVideoConfig = second.sequenceSubscriptionKey.videoConfigValues;
|
|
18
|
+
return (firstVideoConfig === secondVideoConfig ||
|
|
19
|
+
(firstVideoConfig !== null &&
|
|
20
|
+
secondVideoConfig !== null &&
|
|
21
|
+
firstVideoConfig.durationInFrames ===
|
|
22
|
+
secondVideoConfig.durationInFrames &&
|
|
23
|
+
firstVideoConfig.fps === secondVideoConfig.fps &&
|
|
24
|
+
firstVideoConfig.height === secondVideoConfig.height &&
|
|
25
|
+
firstVideoConfig.width === secondVideoConfig.width));
|
|
26
|
+
};
|
|
27
|
+
exports.areSequenceNodePathInfosEqual = areSequenceNodePathInfosEqual;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateTimeline = void 0;
|
|
4
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
4
|
const get_connected_compositions_1 = require("./get-connected-compositions");
|
|
6
5
|
const get_sequence_visible_range_1 = require("./get-sequence-visible-range");
|
|
7
6
|
const get_timeline_nestedness_1 = require("./get-timeline-nestedness");
|
|
8
7
|
const get_timeline_sequence_sort_key_1 = require("./get-timeline-sequence-sort-key");
|
|
9
8
|
const sort_by_nonce_history_1 = require("./sort-by-nonce-history");
|
|
9
|
+
const timeline_node_path_key_1 = require("./timeline-node-path-key");
|
|
10
10
|
const getInheritedLoopDisplay = (sequence, sequences) => {
|
|
11
11
|
if (sequence.loopDisplay) {
|
|
12
12
|
return sequence.loopDisplay;
|
|
@@ -113,7 +113,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
113
113
|
if (track.nodePathInfo === null) {
|
|
114
114
|
return track;
|
|
115
115
|
}
|
|
116
|
-
const key = (0,
|
|
116
|
+
const key = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey);
|
|
117
117
|
const index = (_a = nodePathIndexCounters.get(key)) !== null && _a !== void 0 ? _a : 0;
|
|
118
118
|
nodePathIndexCounters.set(key, index + 1);
|
|
119
119
|
return {
|
|
@@ -132,7 +132,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
132
132
|
if (track.nodePathInfo === null) {
|
|
133
133
|
return track;
|
|
134
134
|
}
|
|
135
|
-
const key = (0,
|
|
135
|
+
const key = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey);
|
|
136
136
|
return {
|
|
137
137
|
...track,
|
|
138
138
|
nodePathInfo: {
|
|
@@ -71,6 +71,7 @@ const PreviewServerConnection = ({ children }) => {
|
|
|
71
71
|
type: 'init',
|
|
72
72
|
});
|
|
73
73
|
const [configFileChangeRevision, setConfigFileChangeRevision] = react_1.default.useState(0);
|
|
74
|
+
const clientId = (0, react_1.useRef)(null);
|
|
74
75
|
(0, react_1.useEffect)(() => {
|
|
75
76
|
const handleEvent = (newEvent) => {
|
|
76
77
|
var _a, _b;
|
|
@@ -83,12 +84,18 @@ const PreviewServerConnection = ({ children }) => {
|
|
|
83
84
|
window.remotion_studioConfig = newEvent.studioRuntimeConfig;
|
|
84
85
|
window.remotion_editorName = newEvent.editorName;
|
|
85
86
|
setConfigFileChangeRevision((revision) => revision + 1);
|
|
86
|
-
|
|
87
|
+
const isOwnRuntimeConfigChange = newEvent.changeType === 'runtime' &&
|
|
88
|
+
newEvent.originatorClientId !== null &&
|
|
89
|
+
newEvent.originatorClientId === clientId.current;
|
|
90
|
+
if (!isOwnRuntimeConfigChange) {
|
|
91
|
+
(0, NotificationCenter_1.showNotification)((0, studio_shared_1.getConfigFileChangeMessage)(newEvent.changeType), 4000);
|
|
92
|
+
}
|
|
87
93
|
}
|
|
88
94
|
if (newEvent.type === 'config-file-reload-failed') {
|
|
89
95
|
(0, NotificationCenter_1.showNotification)(newEvent.errorMessage, 4000);
|
|
90
96
|
}
|
|
91
97
|
if (newEvent.type === 'init') {
|
|
98
|
+
clientId.current = newEvent.clientId;
|
|
92
99
|
latestUndoRedoEvent.current = {
|
|
93
100
|
type: 'undo-redo-stack-changed',
|
|
94
101
|
undoFile: newEvent.undoFile,
|
|
@@ -6,7 +6,7 @@ export declare const formatFileLocation: ({ location, root, }: {
|
|
|
6
6
|
readonly location: FileLocation | null;
|
|
7
7
|
readonly root: string;
|
|
8
8
|
}) => string | null;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const formatContextForAgents: ({ name, location, root, }: {
|
|
10
10
|
readonly name: string | null;
|
|
11
11
|
readonly location: FileLocation | null;
|
|
12
12
|
readonly root: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.formatContextForAgents = exports.formatFileLocation = void 0;
|
|
4
4
|
const normalizeSlashes = (path) => path.replace(/\\/g, '/');
|
|
5
5
|
const stripTrailingSlashes = (path) => path.replace(/\/+$/, '');
|
|
6
6
|
const stripLeadingDotSlash = (path) => path.replace(/^\.\/+/, '');
|
|
@@ -25,11 +25,11 @@ const formatFileLocation = ({ location, root, }) => {
|
|
|
25
25
|
return `${stripLeadingDotSlash(relativeSource)}:${location.line}`;
|
|
26
26
|
};
|
|
27
27
|
exports.formatFileLocation = formatFileLocation;
|
|
28
|
-
const
|
|
28
|
+
const formatContextForAgents = ({ name, location, root, }) => {
|
|
29
29
|
const fileLocation = (0, exports.formatFileLocation)({ location, root });
|
|
30
30
|
if (!name || !fileLocation) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
return `${name} in ${fileLocation}`;
|
|
34
34
|
};
|
|
35
|
-
exports.
|
|
35
|
+
exports.formatContextForAgents = formatContextForAgents;
|
|
@@ -11,12 +11,12 @@ const migrateExpandedTracksForSubscriptionKey = (prev, oldKey, newKey) => {
|
|
|
11
11
|
let changed = false;
|
|
12
12
|
const next = { ...prev };
|
|
13
13
|
for (const [key, value] of Object.entries(prev)) {
|
|
14
|
-
if (value
|
|
14
|
+
if (!value || !key.startsWith(oldPrefix + '.')) {
|
|
15
15
|
continue;
|
|
16
16
|
}
|
|
17
17
|
const migratedKey = newPrefix + key.slice(oldPrefix.length);
|
|
18
|
-
if (next[migratedKey]
|
|
19
|
-
next[migratedKey] =
|
|
18
|
+
if (!next[migratedKey]) {
|
|
19
|
+
next[migratedKey] = true;
|
|
20
20
|
}
|
|
21
21
|
delete next[key];
|
|
22
22
|
changed = true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CompositionComponentInfoResponse, EditorPickerId, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
2
|
import type { CodePosition, OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
3
3
|
export declare const openInEditor: (stack: SymbolicatedStackFrame, editorId: EditorPickerId | null) => Promise<import("@remotion/studio-shared").OpenInEditorResponse>;
|
|
4
|
+
export declare const openInCodingAgent: (codingAgentId: "claude-code" | "codex" | "copilot" | "cursor", prompt: string | null) => Promise<import("@remotion/studio-shared").OpenInCodingAgentResponse>;
|
|
4
5
|
export declare const openOriginalPositionInEditor: (originalPosition: OriginalPosition, editorId: EditorPickerId | null) => Promise<void>;
|
|
5
6
|
export declare const openOriginalPositionInEditorAtProperty: ({ originalPosition, property, }: {
|
|
6
7
|
originalPosition: CodePosition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditorAtProperty = exports.openOriginalPositionInEditor = exports.openInEditor = void 0;
|
|
3
|
+
exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditorAtProperty = exports.openOriginalPositionInEditor = exports.openInCodingAgent = exports.openInEditor = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const call_api_1 = require("../components/call-api");
|
|
6
6
|
const browser_studio_operations_1 = require("./browser-studio-operations");
|
|
@@ -18,6 +18,10 @@ const openInEditor = (stack, editorId) => {
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
exports.openInEditor = openInEditor;
|
|
21
|
+
const openInCodingAgent = (codingAgentId, prompt) => {
|
|
22
|
+
return (0, call_api_1.callApi)('/api/open-in-coding-agent', { codingAgentId, prompt });
|
|
23
|
+
};
|
|
24
|
+
exports.openInCodingAgent = openInCodingAgent;
|
|
21
25
|
const openOriginalPositionInEditor = async (originalPosition, editorId) => {
|
|
22
26
|
const response = await (0, exports.openInEditor)({
|
|
23
27
|
originalColumnNumber: originalPosition.column,
|
|
@@ -6,9 +6,12 @@ exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = 300;
|
|
|
6
6
|
const defaultStudioRuntimeConfig = {
|
|
7
7
|
askAIEnabled: false,
|
|
8
8
|
bufferStateDelayInMilliseconds: null,
|
|
9
|
+
defaultCodingAgent: null,
|
|
10
|
+
defaultEditor: null,
|
|
9
11
|
interactivityEnabled: true,
|
|
10
12
|
keyboardShortcutsEnabled: true,
|
|
11
13
|
maxTimelineTracks: null,
|
|
14
|
+
publicLicenseKey: null,
|
|
12
15
|
};
|
|
13
16
|
const getStudioRuntimeConfig = () => {
|
|
14
17
|
var _a;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
1
2
|
import type { SequenceNodePathInfo } from './get-timeline-sequence-sort-key';
|
|
3
|
+
export declare const timelineSequenceNodePathToKey: (key: SequencePropsSubscriptionKey) => string;
|
|
2
4
|
export declare const timelineNodePathInfoToKey: (info: SequenceNodePathInfo) => string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.timelineNodePathInfoToKey = void 0;
|
|
3
|
+
exports.timelineNodePathInfoToKey = exports.timelineSequenceNodePathToKey = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const timelineSequenceNodePathToKey = (key) => `${key.absolutePath}:${JSON.stringify(key.nodePath)}`;
|
|
6
|
+
exports.timelineSequenceNodePathToKey = timelineSequenceNodePathToKey;
|
|
5
7
|
const timelineNodePathInfoToKey = (info) => [
|
|
6
8
|
(0, studio_shared_1.stringifySequenceExpandedRowKey)(info.sequenceSubscriptionKey),
|
|
7
9
|
info.auxiliaryKeys.join('.'),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const isAssetUploadDragEvent: (event: {
|
|
2
2
|
readonly dataTransfer: DataTransfer;
|
|
3
3
|
}) => boolean;
|
|
4
|
+
export declare const getRenderOutputDragData: (dataTransfer: DataTransfer) => import("@remotion/studio-protocol").RenderOutputDragData | null;
|
|
4
5
|
declare function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation }: {
|
|
5
6
|
name: string | null;
|
|
6
7
|
parentFolder: string | null;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRenderOutputDragData = exports.isAssetUploadDragEvent = void 0;
|
|
4
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const no_react_1 = require("remotion/no-react");
|
|
6
|
-
const
|
|
7
|
-
|
|
7
|
+
const isAssetUploadDragEvent = (event) => {
|
|
8
|
+
var _a;
|
|
9
|
+
return (Array.from(event.dataTransfer.types).includes('Files') ||
|
|
10
|
+
((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) === 'render-output');
|
|
8
11
|
};
|
|
9
|
-
exports.
|
|
12
|
+
exports.isAssetUploadDragEvent = isAssetUploadDragEvent;
|
|
13
|
+
const getRenderOutputDragData = (dataTransfer) => {
|
|
14
|
+
const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(dataTransfer);
|
|
15
|
+
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'render-output' ? parsed.data : null;
|
|
16
|
+
};
|
|
17
|
+
exports.getRenderOutputDragData = getRenderOutputDragData;
|
|
10
18
|
function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation, }) {
|
|
11
19
|
const dragDepthRef = (0, react_1.useRef)(0);
|
|
12
20
|
const combinedParents = (0, react_1.useMemo)(() => {
|
|
@@ -16,7 +24,7 @@ function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation,
|
|
|
16
24
|
return dropLocation === combinedParents;
|
|
17
25
|
}, [combinedParents, dropLocation]);
|
|
18
26
|
const onDragEnter = (0, react_1.useCallback)((event) => {
|
|
19
|
-
if (!(0, exports.
|
|
27
|
+
if (!(0, exports.isAssetUploadDragEvent)(event)) {
|
|
20
28
|
return;
|
|
21
29
|
}
|
|
22
30
|
if (dragDepthRef.current === 0) {
|
|
@@ -27,7 +35,7 @@ function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation,
|
|
|
27
35
|
dragDepthRef.current++;
|
|
28
36
|
}, [combinedParents, dragDepthRef, setDropLocation]);
|
|
29
37
|
const onDragLeave = (0, react_1.useCallback)((event) => {
|
|
30
|
-
if (!(0, exports.
|
|
38
|
+
if (!(0, exports.isAssetUploadDragEvent)(event)) {
|
|
31
39
|
return;
|
|
32
40
|
}
|
|
33
41
|
dragDepthRef.current--;
|
|
@@ -1045,7 +1045,7 @@ const itemToSearchResult = (item, setSelectedModal, prefixes) => {
|
|
|
1045
1045
|
if (item.subMenu) {
|
|
1046
1046
|
return item.subMenu.items
|
|
1047
1047
|
.map((subItem) => {
|
|
1048
|
-
if (subItem.type
|
|
1048
|
+
if (subItem.type !== 'item') {
|
|
1049
1049
|
return null;
|
|
1050
1050
|
}
|
|
1051
1051
|
return itemToSearchResult(subItem, setSelectedModal, [
|
|
@@ -1072,7 +1072,7 @@ const makeSearchResults = (actions, setSelectedModal) => {
|
|
|
1072
1072
|
const items = actions
|
|
1073
1073
|
.map((menu) => {
|
|
1074
1074
|
return menu.items.map((item) => {
|
|
1075
|
-
if (item.type
|
|
1075
|
+
if (item.type !== 'item') {
|
|
1076
1076
|
return null;
|
|
1077
1077
|
}
|
|
1078
1078
|
return itemToSearchResult(item, setSelectedModal, []);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { SequenceRegistrationControls } from 'remotion';
|
|
2
|
-
type RuntimeValueSelectorResult = string | number | boolean | bigint | symbol | null | undefined;
|
|
3
2
|
export declare const useRuntimeValues: (controls: SequenceRegistrationControls | null) => Readonly<Record<string, unknown>>;
|
|
4
3
|
export declare const useRuntimeValue: (controls: SequenceRegistrationControls | null, key: string) => unknown;
|
|
5
|
-
export declare const useRuntimeValueSelector: <T
|
|
4
|
+
export declare const useRuntimeValueSelector: <T>({ controls, selector, isEqual, }: {
|
|
6
5
|
controls: SequenceRegistrationControls | null;
|
|
7
6
|
selector: (values: Readonly<Record<string, unknown>>) => T;
|
|
8
7
|
isEqual?: ((first: T, second: T) => boolean) | undefined;
|
|
9
8
|
}) => T;
|
|
10
9
|
export declare const useRuntimeValueSnapshots: (controls: readonly SequenceRegistrationControls[]) => readonly Readonly<Record<string, unknown>>[];
|
|
11
|
-
export {};
|
|
@@ -2,13 +2,19 @@ import type { Dispatch, SetStateAction } from 'react';
|
|
|
2
2
|
import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
export type TimelineSequenceHover = {
|
|
4
4
|
readonly key: string;
|
|
5
|
+
readonly nodePathKey: string;
|
|
5
6
|
readonly source: 'canvas' | 'timeline';
|
|
6
7
|
};
|
|
7
|
-
type
|
|
8
|
-
readonly
|
|
8
|
+
type TimelineSequenceHoverStore = {
|
|
9
|
+
readonly getSnapshot: () => TimelineSequenceHover | null;
|
|
10
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
9
11
|
readonly setHoveredSequence: Dispatch<SetStateAction<TimelineSequenceHover | null>>;
|
|
10
12
|
};
|
|
11
|
-
export declare const
|
|
13
|
+
export declare const createTimelineSequenceHoverStore: () => TimelineSequenceHoverStore;
|
|
14
|
+
export declare const TimelineSequenceHoverContext: import("react").Context<TimelineSequenceHoverStore>;
|
|
15
|
+
export declare const useTimelineSequenceHoverState: () => TimelineSequenceHover | null;
|
|
16
|
+
export declare const useSetTimelineSequenceHover: () => Dispatch<SetStateAction<TimelineSequenceHover | null>>;
|
|
17
|
+
export declare const useIsTimelineSequenceHovered: (nodePathKey: string | null) => boolean;
|
|
12
18
|
export declare const useTimelineSequenceHover: (nodePathInfo: SequenceNodePathInfo | null) => {
|
|
13
19
|
hovered: boolean;
|
|
14
20
|
onPointerEnter: () => void;
|
|
@@ -1,33 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTimelineSequenceHover = exports.TimelineSequenceHoverContext = void 0;
|
|
3
|
+
exports.useTimelineSequenceHover = exports.useIsTimelineSequenceHovered = exports.useSetTimelineSequenceHover = exports.useTimelineSequenceHoverState = exports.TimelineSequenceHoverContext = exports.createTimelineSequenceHoverStore = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
6
|
-
|
|
7
|
-
hoveredSequence
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const createTimelineSequenceHoverStore = () => {
|
|
7
|
+
let hoveredSequence = null;
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
return {
|
|
10
|
+
getSnapshot: () => hoveredSequence,
|
|
11
|
+
subscribe: (listener) => {
|
|
12
|
+
listeners.add(listener);
|
|
13
|
+
return () => listeners.delete(listener);
|
|
14
|
+
},
|
|
15
|
+
setHoveredSequence: (action) => {
|
|
16
|
+
const nextHoveredSequence = typeof action === 'function' ? action(hoveredSequence) : action;
|
|
17
|
+
if (nextHoveredSequence === hoveredSequence) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
hoveredSequence = nextHoveredSequence;
|
|
21
|
+
for (const listener of listeners) {
|
|
22
|
+
listener();
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.createTimelineSequenceHoverStore = createTimelineSequenceHoverStore;
|
|
28
|
+
exports.TimelineSequenceHoverContext = (0, react_1.createContext)((0, exports.createTimelineSequenceHoverStore)());
|
|
29
|
+
const useTimelineSequenceHoverState = () => {
|
|
30
|
+
const store = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
|
|
31
|
+
return (0, react_1.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
32
|
+
};
|
|
33
|
+
exports.useTimelineSequenceHoverState = useTimelineSequenceHoverState;
|
|
34
|
+
const useSetTimelineSequenceHover = () => {
|
|
35
|
+
return (0, react_1.useContext)(exports.TimelineSequenceHoverContext).setHoveredSequence;
|
|
36
|
+
};
|
|
37
|
+
exports.useSetTimelineSequenceHover = useSetTimelineSequenceHover;
|
|
38
|
+
const useIsTimelineSequenceHovered = (nodePathKey) => {
|
|
39
|
+
const store = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
|
|
40
|
+
const getSnapshot = (0, react_1.useCallback)(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
return nodePathKey !== null && ((_a = store.getSnapshot()) === null || _a === void 0 ? void 0 : _a.nodePathKey) === nodePathKey;
|
|
43
|
+
}, [nodePathKey, store]);
|
|
44
|
+
return (0, react_1.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
|
|
45
|
+
};
|
|
46
|
+
exports.useIsTimelineSequenceHovered = useIsTimelineSequenceHovered;
|
|
10
47
|
const useTimelineSequenceHover = (nodePathInfo) => {
|
|
11
|
-
const
|
|
48
|
+
const store = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
|
|
12
49
|
const sequenceKey = (0, react_1.useMemo)(() => nodePathInfo === null
|
|
13
50
|
? null
|
|
14
51
|
: (0, timeline_node_path_key_1.timelineNodePathInfoToKey)({ ...nodePathInfo, auxiliaryKeys: [] }), [nodePathInfo]);
|
|
52
|
+
const nodePathKey = (0, react_1.useMemo)(() => nodePathInfo === null
|
|
53
|
+
? null
|
|
54
|
+
: (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePathInfo.sequenceSubscriptionKey), [nodePathInfo]);
|
|
55
|
+
const hovered = (0, exports.useIsTimelineSequenceHovered)(nodePathKey);
|
|
15
56
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
16
|
-
if (sequenceKey === null) {
|
|
57
|
+
if (sequenceKey === null || nodePathKey === null) {
|
|
17
58
|
return;
|
|
18
59
|
}
|
|
19
|
-
setHoveredSequence(
|
|
20
|
-
|
|
60
|
+
store.setHoveredSequence((currentHover) => {
|
|
61
|
+
if ((currentHover === null || currentHover === void 0 ? void 0 : currentHover.key) === sequenceKey &&
|
|
62
|
+
currentHover.nodePathKey === nodePathKey &&
|
|
63
|
+
currentHover.source === 'timeline') {
|
|
64
|
+
return currentHover;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
key: sequenceKey,
|
|
68
|
+
nodePathKey,
|
|
69
|
+
source: 'timeline',
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}, [nodePathKey, sequenceKey, store]);
|
|
21
73
|
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
22
|
-
setHoveredSequence((currentHover) => {
|
|
74
|
+
store.setHoveredSequence((currentHover) => {
|
|
23
75
|
if ((currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) !== 'timeline' ||
|
|
24
76
|
currentHover.key !== sequenceKey) {
|
|
25
77
|
return currentHover;
|
|
26
78
|
}
|
|
27
79
|
return null;
|
|
28
80
|
});
|
|
29
|
-
}, [sequenceKey,
|
|
30
|
-
const hovered = sequenceKey !== null && (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.key) === sequenceKey;
|
|
81
|
+
}, [sequenceKey, store]);
|
|
31
82
|
return (0, react_1.useMemo)(() => ({ hovered, onPointerEnter, onPointerLeave }), [hovered, onPointerEnter, onPointerLeave]);
|
|
32
83
|
};
|
|
33
84
|
exports.useTimelineSequenceHover = useTimelineSequenceHover;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.507",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"react-dom": ">=16.8.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@remotion/studio-protocol": "4.0.
|
|
27
|
+
"@remotion/studio-protocol": "4.0.507",
|
|
28
28
|
"semver": "7.5.3",
|
|
29
|
-
"remotion": "4.0.
|
|
30
|
-
"@remotion/captions": "4.0.
|
|
31
|
-
"@remotion/player": "4.0.
|
|
32
|
-
"@remotion/media-utils": "4.0.
|
|
33
|
-
"@remotion/renderer": "4.0.
|
|
34
|
-
"@remotion/web-renderer": "4.0.
|
|
35
|
-
"@remotion/studio-shared": "4.0.
|
|
36
|
-
"@remotion/timeline-utils": "4.0.
|
|
37
|
-
"@remotion/zod-types": "4.0.
|
|
29
|
+
"remotion": "4.0.507",
|
|
30
|
+
"@remotion/captions": "4.0.507",
|
|
31
|
+
"@remotion/player": "4.0.507",
|
|
32
|
+
"@remotion/media-utils": "4.0.507",
|
|
33
|
+
"@remotion/renderer": "4.0.507",
|
|
34
|
+
"@remotion/web-renderer": "4.0.507",
|
|
35
|
+
"@remotion/studio-shared": "4.0.507",
|
|
36
|
+
"@remotion/timeline-utils": "4.0.507",
|
|
37
|
+
"@remotion/zod-types": "4.0.507",
|
|
38
38
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
39
39
|
"mediabunny": "1.50.8",
|
|
40
40
|
"memfs": "3.4.3",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react": "19.2.3",
|
|
46
46
|
"react-dom": "19.2.3",
|
|
47
47
|
"@types/semver": "7.5.3",
|
|
48
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.507",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
51
51
|
},
|