@remotion/studio 4.0.471 → 4.0.473
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/rename-static-file.d.ts +6 -0
- package/dist/api/rename-static-file.js +18 -0
- package/dist/components/AssetSelector.js +55 -5
- package/dist/components/AssetSelectorItem.js +153 -27
- package/dist/components/Canvas.js +147 -0
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +12 -4
- package/dist/components/ConfirmationDialog-types.d.ts +8 -0
- package/dist/components/ConfirmationDialog-types.js +2 -0
- package/dist/components/ConfirmationDialog.d.ts +7 -0
- package/dist/components/ConfirmationDialog.js +103 -0
- package/dist/components/ContextMenu.d.ts +9 -1
- package/dist/components/ContextMenu.js +99 -47
- package/dist/components/CurrentAsset.d.ts +1 -0
- package/dist/components/CurrentAsset.js +13 -2
- package/dist/components/Editor.js +14 -6
- package/dist/components/EditorContent.js +15 -2
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EditorRuler/Ruler.js +2 -0
- package/dist/components/ExplorerPanel.d.ts +0 -4
- package/dist/components/ExplorerPanel.js +8 -4
- package/dist/components/ExplorerPanelRef.d.ts +4 -0
- package/dist/components/ExplorerPanelRef.js +5 -0
- package/dist/components/FilePreview.d.ts +1 -1
- package/dist/components/InitialCompositionLoader.d.ts +0 -1
- package/dist/components/InitialCompositionLoader.js +5 -27
- package/dist/components/Menu/MenuItem.js +7 -1
- package/dist/components/Menu/SubMenu.js +5 -1
- package/dist/components/Menu/portals.js +17 -8
- package/dist/components/MenuToolbar.js +5 -1
- package/dist/components/ModalContainer.js +6 -1
- package/dist/components/Modals.js +8 -2
- package/dist/components/NewComposition/CodemodFooter.js +2 -2
- package/dist/components/NewComposition/ComboBox.js +8 -2
- package/dist/components/NewComposition/DeleteFolder.d.ts +6 -0
- package/dist/components/NewComposition/DeleteFolder.js +39 -0
- package/dist/components/NewComposition/DeleteStaticFile.d.ts +4 -0
- package/dist/components/NewComposition/DeleteStaticFile.js +44 -0
- package/dist/components/NewComposition/RenameFolder.d.ts +6 -0
- package/dist/components/NewComposition/RenameFolder.js +60 -0
- package/dist/components/NewComposition/RenameStaticFile.d.ts +4 -0
- package/dist/components/NewComposition/RenameStaticFile.js +118 -0
- package/dist/components/OptionsPanel.js +5 -1
- package/dist/components/OutlineToggle.d.ts +2 -0
- package/dist/components/OutlineToggle.js +20 -0
- package/dist/components/Preview.d.ts +0 -2
- package/dist/components/Preview.js +23 -33
- package/dist/components/PreviewToolbar.js +19 -6
- package/dist/components/RenderButton.js +8 -2
- package/dist/components/RenderPreview.js +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +105 -4
- package/dist/components/SelectedOutlineOverlay.js +578 -59
- package/dist/components/ShowOutlinesProvider.d.ts +4 -0
- package/dist/components/ShowOutlinesProvider.js +24 -0
- package/dist/components/SizeSelector.js +3 -3
- package/dist/components/Splitter/SplitterContainer.js +9 -0
- package/dist/components/Splitter/SplitterHandle.js +65 -70
- package/dist/components/StaticFilePreview.js +2 -2
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +15 -0
- package/dist/components/Timeline/KeyframeSettingsModal.js +150 -0
- package/dist/components/Timeline/Timeline.js +50 -15
- package/dist/components/Timeline/TimelineArrayField.d.ts +9 -0
- package/dist/components/Timeline/TimelineArrayField.js +210 -0
- package/dist/components/Timeline/TimelineBooleanField.d.ts +2 -2
- package/dist/components/Timeline/TimelineBooleanField.js +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +43 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +479 -0
- package/dist/components/Timeline/TimelineColorField.d.ts +2 -2
- package/dist/components/Timeline/TimelineColorField.js +2 -8
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +12 -2
- package/dist/components/Timeline/TimelineEffectItem.js +3 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +146 -26
- package/dist/components/Timeline/TimelineEnumField.d.ts +2 -2
- package/dist/components/Timeline/TimelineEnumField.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +4 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +41 -37
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +24 -21
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.d.ts +6 -0
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +14 -0
- package/dist/components/Timeline/TimelineKeyframeDragState.d.ts +17 -0
- package/dist/components/Timeline/TimelineKeyframeDragState.js +39 -0
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +7 -2
- package/dist/components/Timeline/TimelineKeyframedValue.js +22 -8
- package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -0
- package/dist/components/Timeline/TimelineLayerEye.js +8 -3
- package/dist/components/Timeline/TimelineList.js +2 -2
- package/dist/components/Timeline/TimelineMediaInfo.d.ts +0 -13
- package/dist/components/Timeline/TimelineMediaInfo.js +8 -73
- package/dist/components/Timeline/TimelineNumberField.d.ts +2 -2
- package/dist/components/Timeline/TimelineNumberField.js +7 -11
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +17 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +53 -0
- package/dist/components/Timeline/TimelineRotationField.d.ts +2 -2
- package/dist/components/Timeline/TimelineRotationField.js +41 -24
- package/dist/components/Timeline/TimelineRowChrome.js +8 -7
- package/dist/components/Timeline/TimelineScaleField.d.ts +20 -0
- package/dist/components/Timeline/TimelineScaleField.js +314 -0
- package/dist/components/Timeline/TimelineSchemaField.d.ts +3 -2
- package/dist/components/Timeline/TimelineSchemaField.js +8 -42
- package/dist/components/Timeline/TimelineSelection.js +3 -2
- package/dist/components/Timeline/TimelineSequence.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequence.js +51 -10
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +282 -28
- package/dist/components/Timeline/TimelineSequencePropItem.js +161 -35
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +58 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +525 -0
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTranslateField.d.ts +2 -2
- package/dist/components/Timeline/TimelineTranslateField.js +21 -25
- package/dist/components/Timeline/TimelineUvCoordinateField.d.ts +2 -2
- package/dist/components/Timeline/TimelineUvCoordinateField.js +20 -26
- package/dist/components/Timeline/apply-effect-response-to-code-values.d.ts +5 -0
- package/dist/components/Timeline/apply-effect-response-to-code-values.js +19 -0
- package/dist/components/Timeline/call-add-keyframe.js +4 -0
- package/dist/components/Timeline/call-move-keyframe.d.ts +19 -0
- package/dist/components/Timeline/call-move-keyframe.js +71 -0
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +22 -0
- package/dist/components/Timeline/call-update-keyframe-settings.js +52 -0
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +7 -4
- package/dist/components/Timeline/delete-selected-timeline-item.js +33 -21
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +4 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +39 -34
- package/dist/components/Timeline/get-bounded-keyframe-drag-delta.d.ts +8 -0
- package/dist/components/Timeline/get-bounded-keyframe-drag-delta.js +12 -0
- package/dist/components/Timeline/get-keyframe-navigation.d.ts +2 -2
- package/dist/components/Timeline/get-keyframe-navigation.js +14 -6
- package/dist/components/Timeline/get-node-keyframes.d.ts +5 -2
- package/dist/components/Timeline/get-node-keyframes.js +38 -5
- package/dist/components/Timeline/get-timeline-keyframes.js +4 -4
- package/dist/components/Timeline/reset-selected-timeline-props.js +22 -8
- package/dist/components/Timeline/save-effect-prop.d.ts +14 -3
- package/dist/components/Timeline/save-effect-prop.js +36 -18
- package/dist/components/Timeline/save-prop-queue.d.ts +2 -1
- package/dist/components/Timeline/save-prop-queue.js +5 -2
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -7
- package/dist/components/Timeline/save-sequence-prop.js +33 -30
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +3 -0
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +7 -0
- package/dist/components/Timeline/timeline-asset-link.d.ts +13 -0
- package/dist/components/Timeline/timeline-asset-link.js +37 -0
- package/dist/components/Timeline/timeline-field-utils.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-utils.js +5 -1
- package/dist/components/Timeline/timeline-translate-utils.js +9 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +7 -0
- package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +10 -0
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +378 -0
- package/dist/components/TopPanel.d.ts +1 -1
- package/dist/components/folder-menu-items.d.ts +12 -0
- package/dist/components/folder-menu-items.js +147 -0
- package/dist/components/import-assets.d.ts +22 -0
- package/dist/components/import-assets.js +294 -0
- package/dist/components/load-canvas-content-from-url.d.ts +1 -0
- package/dist/components/load-canvas-content-from-url.js +9 -3
- package/dist/components/use-select-asset.d.ts +1 -0
- package/dist/components/use-select-asset.js +30 -0
- package/dist/error-overlay/error-origin.d.ts +3 -0
- package/dist/error-overlay/error-origin.js +42 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +6 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +38 -0
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +1 -1
- package/dist/error-overlay/remotion-overlay/log-studio-error.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +27 -0
- package/dist/esm/{chunk-z0z9d4r0.js → chunk-q0jkt0zq.js} +23062 -17350
- package/dist/esm/internals.mjs +23062 -17350
- package/dist/esm/previewEntry.mjs +22351 -16615
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +7 -3
- package/dist/helpers/create-folder-tree.js +1 -0
- package/dist/helpers/get-asset-metadata.js +2 -2
- package/dist/helpers/get-folder-id.d.ts +4 -0
- package/dist/helpers/get-folder-id.js +7 -0
- package/dist/helpers/get-preview-file-type.d.ts +2 -0
- package/dist/helpers/get-preview-file-type.js +33 -0
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -0
- package/dist/helpers/install-required-package.d.ts +1 -0
- package/dist/helpers/install-required-package.js +39 -0
- package/dist/helpers/remote-asset-drag.d.ts +4 -0
- package/dist/helpers/remote-asset-drag.js +73 -0
- package/dist/helpers/timeline-layout.js +5 -1
- package/dist/helpers/use-asset-drag-events.d.ts +5 -2
- package/dist/helpers/use-asset-drag-events.js +13 -2
- package/dist/helpers/validate-folder-rename.d.ts +6 -0
- package/dist/helpers/validate-folder-rename.js +19 -0
- package/dist/hot-middleware-client/client.js +6 -0
- package/dist/state/editor-outlines.d.ts +8 -0
- package/dist/state/editor-outlines.js +18 -0
- package/dist/state/modals.d.ts +29 -2
- package/dist/state/scale-lock.d.ts +18 -0
- package/dist/state/scale-lock.js +59 -0
- package/package.json +10 -10
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -209,7 +209,7 @@ var renderContent = (Root) => {
|
|
|
209
209
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
210
210
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
211
211
|
}));
|
|
212
|
-
import("./chunk-
|
|
212
|
+
import("./chunk-q0jkt0zq.js").then(({ StudioInternals }) => {
|
|
213
213
|
window.remotion_isStudio = true;
|
|
214
214
|
window.remotion_isReadOnlyStudio = true;
|
|
215
215
|
window.remotion_inputProps = "{}";
|
|
@@ -21,8 +21,8 @@ const getInheritedLoopDisplay = (sequence, sequences) => {
|
|
|
21
21
|
return getInheritedLoopDisplay(parent, sequences);
|
|
22
22
|
};
|
|
23
23
|
const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
24
|
-
var _a;
|
|
25
|
-
var
|
|
24
|
+
var _a, _b;
|
|
25
|
+
var _c;
|
|
26
26
|
const sortedSequences = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences);
|
|
27
27
|
const tracks = [];
|
|
28
28
|
if (sortedSequences.length === 0) {
|
|
@@ -44,7 +44,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
44
44
|
const cascadedStart = (0, get_sequence_visible_range_1.getCascadedStart)(sequence, sortedSequences);
|
|
45
45
|
const visibleStart = (0, get_sequence_visible_range_1.getTimelineVisibleStart)(sequence, sortedSequences);
|
|
46
46
|
const visibleDuration = (0, get_sequence_visible_range_1.getTimelineVisibleDuration)(sequence, sortedSequences);
|
|
47
|
-
const overrideId = (
|
|
47
|
+
const overrideId = (_c = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId) !== null && _c !== void 0 ? _c : null;
|
|
48
48
|
const nodePath = overrideId ? overrideIdsToNodePaths[overrideId] : null;
|
|
49
49
|
const hasKeyframeRows = sequence.controls !== null || sequence.effects.length > 0;
|
|
50
50
|
tracks.push({
|
|
@@ -63,12 +63,14 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
63
63
|
keyframeDisplayOffset: hasKeyframeRows
|
|
64
64
|
? cascadedStart - sequence.from
|
|
65
65
|
: 0,
|
|
66
|
+
sequenceFrameOffset: visibleStart - cascadedStart,
|
|
66
67
|
nodePathInfo: nodePath
|
|
67
68
|
? {
|
|
68
69
|
sequenceSubscriptionKey: nodePath,
|
|
69
70
|
auxiliaryKeys: [],
|
|
70
71
|
index: 0,
|
|
71
72
|
numberOfSequencesWithThisNodePath: 0,
|
|
73
|
+
supportsEffects: ((_b = sequence.controls) === null || _b === void 0 ? void 0 : _b.supportsEffects) === true,
|
|
72
74
|
}
|
|
73
75
|
: null,
|
|
74
76
|
});
|
|
@@ -106,6 +108,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
106
108
|
auxiliaryKeys: track.nodePathInfo.auxiliaryKeys,
|
|
107
109
|
index,
|
|
108
110
|
numberOfSequencesWithThisNodePath: 0,
|
|
111
|
+
supportsEffects: track.nodePathInfo.supportsEffects,
|
|
109
112
|
},
|
|
110
113
|
};
|
|
111
114
|
})
|
|
@@ -122,6 +125,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
122
125
|
auxiliaryKeys: track.nodePathInfo.auxiliaryKeys,
|
|
123
126
|
index: track.nodePathInfo.index,
|
|
124
127
|
numberOfSequencesWithThisNodePath: (_a = nodePathIndexCounters.get(key)) !== null && _a !== void 0 ? _a : 0,
|
|
128
|
+
supportsEffects: track.nodePathInfo.supportsEffects,
|
|
125
129
|
},
|
|
126
130
|
};
|
|
127
131
|
});
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAssetMetadata = exports.remotion_outputsBase = void 0;
|
|
4
4
|
const media_utils_1 = require("@remotion/media-utils");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
-
const
|
|
6
|
+
const get_preview_file_type_1 = require("./get-preview-file-type");
|
|
7
7
|
exports.remotion_outputsBase = window.remotion_staticBase.replace('static', 'outputs');
|
|
8
8
|
const getSrcFromCanvasContent = (canvasContent) => {
|
|
9
9
|
if (canvasContent.type === 'asset') {
|
|
@@ -40,7 +40,7 @@ const getAssetMetadata = async (canvasContent, addTime) => {
|
|
|
40
40
|
}
|
|
41
41
|
const fetchedAt = Date.now();
|
|
42
42
|
const srcWithTime = addTime ? `${src}?date=${fetchedAt}` : src;
|
|
43
|
-
const fileType = (0,
|
|
43
|
+
const fileType = (0, get_preview_file_type_1.getPreviewFileType)(src);
|
|
44
44
|
if (fileType === 'video') {
|
|
45
45
|
const resolution = await (0, media_utils_1.getVideoMetadata)(srcWithTime);
|
|
46
46
|
return {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFolderId = void 0;
|
|
4
|
+
const getFolderId = ({ folderName, parentName, }) => {
|
|
5
|
+
return [parentName, folderName].filter(Boolean).join('/');
|
|
6
|
+
};
|
|
7
|
+
exports.getFolderId = getFolderId;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPreviewFileType = void 0;
|
|
4
|
+
const getPreviewFileType = (fileName) => {
|
|
5
|
+
var _a;
|
|
6
|
+
if (!fileName) {
|
|
7
|
+
return 'other';
|
|
8
|
+
}
|
|
9
|
+
const audioExtensions = ['mp3', 'wav', 'ogg', 'aac'];
|
|
10
|
+
const videoExtensions = ['mp4', 'avi', 'mkv', 'mov', 'webm'];
|
|
11
|
+
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
|
|
12
|
+
const fileExtension = (_a = fileName.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
13
|
+
if (fileExtension === undefined) {
|
|
14
|
+
throw new Error('File extension is undefined');
|
|
15
|
+
}
|
|
16
|
+
if (audioExtensions.includes(fileExtension)) {
|
|
17
|
+
return 'audio';
|
|
18
|
+
}
|
|
19
|
+
if (videoExtensions.includes(fileExtension)) {
|
|
20
|
+
return 'video';
|
|
21
|
+
}
|
|
22
|
+
if (imageExtensions.includes(fileExtension)) {
|
|
23
|
+
return 'image';
|
|
24
|
+
}
|
|
25
|
+
if (fileExtension === 'json') {
|
|
26
|
+
return 'json';
|
|
27
|
+
}
|
|
28
|
+
if (fileExtension === 'txt') {
|
|
29
|
+
return 'txt';
|
|
30
|
+
}
|
|
31
|
+
return 'other';
|
|
32
|
+
};
|
|
33
|
+
exports.getPreviewFileType = getPreviewFileType;
|
|
@@ -4,12 +4,14 @@ export type SequenceNodePathInfo = {
|
|
|
4
4
|
auxiliaryKeys: string[];
|
|
5
5
|
index: number;
|
|
6
6
|
numberOfSequencesWithThisNodePath: number;
|
|
7
|
+
supportsEffects: boolean;
|
|
7
8
|
};
|
|
8
9
|
type Track = {
|
|
9
10
|
sequence: TSequence;
|
|
10
11
|
depth: number;
|
|
11
12
|
nodePathInfo: SequenceNodePathInfo | null;
|
|
12
13
|
keyframeDisplayOffset: number;
|
|
14
|
+
sequenceFrameOffset: number;
|
|
13
15
|
};
|
|
14
16
|
export type TrackWithHash = Track & {
|
|
15
17
|
hash: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const installRequiredPackages: (packageNames: string[]) => Promise<void>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installRequiredPackages = void 0;
|
|
4
|
+
const install_package_1 = require("../api/install-package");
|
|
5
|
+
const NotificationCenter_1 = require("../components/Notifications/NotificationCenter");
|
|
6
|
+
let installQueue = Promise.resolve();
|
|
7
|
+
const getMissingPackages = (packageNames) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const uniquePackageNames = Array.from(new Set(packageNames));
|
|
10
|
+
const installedPackages = (_a = window.remotion_installedPackages) !== null && _a !== void 0 ? _a : [];
|
|
11
|
+
return uniquePackageNames.filter((packageName) => !installedPackages.includes(packageName));
|
|
12
|
+
};
|
|
13
|
+
const addInstalledPackages = (packageNames) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const installedPackages = (_a = window.remotion_installedPackages) !== null && _a !== void 0 ? _a : [];
|
|
16
|
+
window.remotion_installedPackages = Array.from(new Set([...installedPackages, ...packageNames]));
|
|
17
|
+
};
|
|
18
|
+
const formatPackageList = (packageNames) => {
|
|
19
|
+
if (packageNames.length === 1) {
|
|
20
|
+
return packageNames[0];
|
|
21
|
+
}
|
|
22
|
+
return `${packageNames.length} packages`;
|
|
23
|
+
};
|
|
24
|
+
const installRequiredPackages = async (packageNames) => {
|
|
25
|
+
const runInstall = async () => {
|
|
26
|
+
const missingPackages = getMissingPackages(packageNames);
|
|
27
|
+
if (missingPackages.length === 0) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
(0, NotificationCenter_1.showNotification)(`Installing ${formatPackageList(missingPackages)}...`, 3000);
|
|
31
|
+
await (0, install_package_1.installPackages)(missingPackages);
|
|
32
|
+
addInstalledPackages(missingPackages);
|
|
33
|
+
(0, NotificationCenter_1.showNotification)(`Installed ${formatPackageList(missingPackages)}`, 3000);
|
|
34
|
+
};
|
|
35
|
+
const queuedInstall = installQueue.then(runInstall, runInstall);
|
|
36
|
+
installQueue = queuedInstall.catch(() => undefined);
|
|
37
|
+
await queuedInstall;
|
|
38
|
+
};
|
|
39
|
+
exports.installRequiredPackages = installRequiredPackages;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const hasRemoteAssetDragData: (dataTransfer: DataTransfer | null) => boolean;
|
|
2
|
+
export declare const getRemoteAssetUrlFromUriList: (uriList: string) => string | null;
|
|
3
|
+
export declare const getRemoteAssetUrlFromHtml: (html: string) => string | null;
|
|
4
|
+
export declare const getRemoteAssetUrlFromDataTransfer: (dataTransfer: DataTransfer | null) => string | null;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRemoteAssetUrlFromDataTransfer = exports.getRemoteAssetUrlFromHtml = exports.getRemoteAssetUrlFromUriList = exports.hasRemoteAssetDragData = void 0;
|
|
4
|
+
const remoteAssetDragTypes = ['text/uri-list', 'text/html', 'text/plain'];
|
|
5
|
+
const isHttpUrl = (value) => {
|
|
6
|
+
try {
|
|
7
|
+
const url = new URL(value);
|
|
8
|
+
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
9
|
+
}
|
|
10
|
+
catch (_a) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const decodeHtmlAttribute = (value) => {
|
|
15
|
+
return value
|
|
16
|
+
.replace(/&/g, '&')
|
|
17
|
+
.replace(/"/g, '"')
|
|
18
|
+
.replace(/'/g, "'")
|
|
19
|
+
.replace(/</g, '<')
|
|
20
|
+
.replace(/>/g, '>');
|
|
21
|
+
};
|
|
22
|
+
const hasRemoteAssetDragData = (dataTransfer) => {
|
|
23
|
+
return remoteAssetDragTypes.some((type) => {
|
|
24
|
+
var _a;
|
|
25
|
+
return Array.from((_a = dataTransfer === null || dataTransfer === void 0 ? void 0 : dataTransfer.types) !== null && _a !== void 0 ? _a : []).includes(type);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
exports.hasRemoteAssetDragData = hasRemoteAssetDragData;
|
|
29
|
+
const getRemoteAssetUrlFromUriList = (uriList) => {
|
|
30
|
+
const lines = uriList.split(/\r?\n/g);
|
|
31
|
+
for (const line of lines) {
|
|
32
|
+
const trimmed = line.trim();
|
|
33
|
+
if (trimmed === '' || trimmed.startsWith('#')) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (isHttpUrl(trimmed)) {
|
|
37
|
+
return trimmed;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
exports.getRemoteAssetUrlFromUriList = getRemoteAssetUrlFromUriList;
|
|
43
|
+
const getRemoteAssetUrlFromHtml = (html) => {
|
|
44
|
+
var _a;
|
|
45
|
+
var _b, _c, _d, _e;
|
|
46
|
+
const imgSrc = html.match(/<img\b[^>]*\bsrc\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+))/i);
|
|
47
|
+
const match = (_d = (_c = (_b = imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc[1]) !== null && _b !== void 0 ? _b : imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc[2]) !== null && _c !== void 0 ? _c : imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc[3]) !== null && _d !== void 0 ? _d : null;
|
|
48
|
+
if (match) {
|
|
49
|
+
const decoded = decodeHtmlAttribute(match.trim());
|
|
50
|
+
if (isHttpUrl(decoded)) {
|
|
51
|
+
return decoded;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const fallback = (_e = (_a = html.match(/https?:\/\/[^\s"'<>]+/i)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _e !== void 0 ? _e : null;
|
|
55
|
+
return fallback && isHttpUrl(fallback) ? decodeHtmlAttribute(fallback) : null;
|
|
56
|
+
};
|
|
57
|
+
exports.getRemoteAssetUrlFromHtml = getRemoteAssetUrlFromHtml;
|
|
58
|
+
const getRemoteAssetUrlFromDataTransfer = (dataTransfer) => {
|
|
59
|
+
if (!dataTransfer) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const uriListUrl = (0, exports.getRemoteAssetUrlFromUriList)(dataTransfer.getData('text/uri-list'));
|
|
63
|
+
if (uriListUrl) {
|
|
64
|
+
return uriListUrl;
|
|
65
|
+
}
|
|
66
|
+
const htmlUrl = (0, exports.getRemoteAssetUrlFromHtml)(dataTransfer.getData('text/html'));
|
|
67
|
+
if (htmlUrl) {
|
|
68
|
+
return htmlUrl;
|
|
69
|
+
}
|
|
70
|
+
const plainText = dataTransfer.getData('text/plain').trim();
|
|
71
|
+
return isHttpUrl(plainText) ? plainText : null;
|
|
72
|
+
};
|
|
73
|
+
exports.getRemoteAssetUrlFromDataTransfer = getRemoteAssetUrlFromDataTransfer;
|
|
@@ -15,7 +15,7 @@ exports.EXPANDED_SECTION_PADDING_RIGHT = 10;
|
|
|
15
15
|
const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, codeValues, }) => {
|
|
16
16
|
var _a;
|
|
17
17
|
const roots = [];
|
|
18
|
-
const { sequenceSubscriptionKey, index, auxiliaryKeys } = nodePathInfo;
|
|
18
|
+
const { sequenceSubscriptionKey, index, auxiliaryKeys, supportsEffects } = nodePathInfo;
|
|
19
19
|
const controlFields = (0, studio_shared_1.getFieldsToShow)({
|
|
20
20
|
schema: sequence.controls.schema,
|
|
21
21
|
currentRuntimeValueDotNotation: sequence.controls.currentRuntimeValueDotNotation,
|
|
@@ -32,6 +32,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
32
32
|
auxiliaryKeys: [...auxiliaryKeys, 'controls', f.key],
|
|
33
33
|
index,
|
|
34
34
|
numberOfSequencesWithThisNodePath: 0,
|
|
35
|
+
supportsEffects,
|
|
35
36
|
},
|
|
36
37
|
label: (_a = f.description) !== null && _a !== void 0 ? _a : f.key,
|
|
37
38
|
field: f,
|
|
@@ -46,6 +47,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
46
47
|
auxiliaryKeys: [...auxiliaryKeys, 'effects'],
|
|
47
48
|
index,
|
|
48
49
|
numberOfSequencesWithThisNodePath: 0,
|
|
50
|
+
supportsEffects,
|
|
49
51
|
},
|
|
50
52
|
label: 'Effects',
|
|
51
53
|
effectInfo: null,
|
|
@@ -65,6 +67,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
65
67
|
auxiliaryKeys: [...auxiliaryKeys, 'effects', i.toString()],
|
|
66
68
|
index,
|
|
67
69
|
numberOfSequencesWithThisNodePath: 0,
|
|
70
|
+
supportsEffects,
|
|
68
71
|
},
|
|
69
72
|
label: effect.label,
|
|
70
73
|
effectInfo: {
|
|
@@ -86,6 +89,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
86
89
|
],
|
|
87
90
|
index,
|
|
88
91
|
numberOfSequencesWithThisNodePath: 0,
|
|
92
|
+
supportsEffects,
|
|
89
93
|
},
|
|
90
94
|
label: (_a = f.description) !== null && _a !== void 0 ? _a : f.key,
|
|
91
95
|
field: f,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const isFileDragEvent: (event: {
|
|
2
|
+
readonly dataTransfer: DataTransfer;
|
|
3
|
+
}) => boolean;
|
|
1
4
|
declare function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation }: {
|
|
2
5
|
name: string | null;
|
|
3
6
|
parentFolder: string | null;
|
|
@@ -5,7 +8,7 @@ declare function useAssetDragEvents({ name, parentFolder, dropLocation, setDropL
|
|
|
5
8
|
setDropLocation: React.Dispatch<React.SetStateAction<string | null>>;
|
|
6
9
|
}): {
|
|
7
10
|
isDropDiv: boolean;
|
|
8
|
-
onDragEnter: ()
|
|
9
|
-
onDragLeave: ()
|
|
11
|
+
onDragEnter: import("react").DragEventHandler<Element>;
|
|
12
|
+
onDragLeave: import("react").DragEventHandler<Element>;
|
|
10
13
|
};
|
|
11
14
|
export default useAssetDragEvents;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFileDragEvent = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const no_react_1 = require("remotion/no-react");
|
|
6
|
+
const isFileDragEvent = (event) => {
|
|
7
|
+
return Array.from(event.dataTransfer.types).includes('Files');
|
|
8
|
+
};
|
|
9
|
+
exports.isFileDragEvent = isFileDragEvent;
|
|
5
10
|
function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation, }) {
|
|
6
11
|
const dragDepthRef = (0, react_1.useRef)(0);
|
|
7
12
|
const combinedParents = (0, react_1.useMemo)(() => {
|
|
@@ -10,7 +15,10 @@ function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation,
|
|
|
10
15
|
const isDropDiv = (0, react_1.useMemo)(() => {
|
|
11
16
|
return dropLocation === combinedParents;
|
|
12
17
|
}, [combinedParents, dropLocation]);
|
|
13
|
-
const onDragEnter = (0, react_1.useCallback)(() => {
|
|
18
|
+
const onDragEnter = (0, react_1.useCallback)((event) => {
|
|
19
|
+
if (!(0, exports.isFileDragEvent)(event)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
14
22
|
if (dragDepthRef.current === 0) {
|
|
15
23
|
setDropLocation((currentDropLocation) => (currentDropLocation === null || currentDropLocation === void 0 ? void 0 : currentDropLocation.includes(combinedParents))
|
|
16
24
|
? currentDropLocation
|
|
@@ -18,7 +26,10 @@ function useAssetDragEvents({ name, parentFolder, dropLocation, setDropLocation,
|
|
|
18
26
|
}
|
|
19
27
|
dragDepthRef.current++;
|
|
20
28
|
}, [combinedParents, dragDepthRef, setDropLocation]);
|
|
21
|
-
const onDragLeave = (0, react_1.useCallback)(() => {
|
|
29
|
+
const onDragLeave = (0, react_1.useCallback)((event) => {
|
|
30
|
+
if (!(0, exports.isFileDragEvent)(event)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
22
33
|
dragDepthRef.current--;
|
|
23
34
|
if (dragDepthRef.current === 0) {
|
|
24
35
|
setDropLocation((currentPath) => currentPath === combinedParents ? parentFolder : currentPath);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFolderRename = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const validateFolderRename = ({ folders, newName, originalName, parentName, }) => {
|
|
6
|
+
if (!remotion_1.Internals.isFolderNameValid(newName)) {
|
|
7
|
+
return remotion_1.Internals.invalidFolderNameErrorMessage;
|
|
8
|
+
}
|
|
9
|
+
if (newName === originalName) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (folders.find((folder) => {
|
|
13
|
+
return folder.name === newName && folder.parent === parentName;
|
|
14
|
+
})) {
|
|
15
|
+
return `A folder with that name already exists.`;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
exports.validateFolderRename = validateFolderRename;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.enableHotMiddleware = void 0;
|
|
6
6
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
+
const error_origin_1 = require("../error-overlay/error-origin");
|
|
7
8
|
const preview_server_events_1 = require("../helpers/preview-server-events");
|
|
8
9
|
const process_update_1 = require("./process-update");
|
|
9
10
|
function createReporter() {
|
|
@@ -63,6 +64,11 @@ function processMessage(obj) {
|
|
|
63
64
|
case 'built': {
|
|
64
65
|
let applyUpdate = true;
|
|
65
66
|
if (obj.errors.length > 0) {
|
|
67
|
+
obj.errors.forEach((error) => {
|
|
68
|
+
if (typeof error === 'string') {
|
|
69
|
+
(0, error_origin_1.markErrorMessageAsLoggedByServer)((0, studio_shared_1.stripAnsi)(error));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
if (reporter)
|
|
67
73
|
reporter.problems('errors', obj);
|
|
68
74
|
applyUpdate = false;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type State = {
|
|
2
|
+
editorShowOutlines: boolean;
|
|
3
|
+
setEditorShowOutlines: (cb: (prevState: boolean) => boolean) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const persistEditorShowOutlinesOption: (option: boolean) => void;
|
|
6
|
+
export declare const loadEditorShowOutlinesOption: () => boolean;
|
|
7
|
+
export declare const EditorShowOutlinesContext: import("react").Context<State>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditorShowOutlinesContext = exports.loadEditorShowOutlinesOption = exports.persistEditorShowOutlinesOption = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const key = 'remotion.editorShowOutlines';
|
|
6
|
+
const persistEditorShowOutlinesOption = (option) => {
|
|
7
|
+
localStorage.setItem(key, String(option));
|
|
8
|
+
};
|
|
9
|
+
exports.persistEditorShowOutlinesOption = persistEditorShowOutlinesOption;
|
|
10
|
+
const loadEditorShowOutlinesOption = () => {
|
|
11
|
+
const item = localStorage.getItem(key);
|
|
12
|
+
return item !== 'false';
|
|
13
|
+
};
|
|
14
|
+
exports.loadEditorShowOutlinesOption = loadEditorShowOutlinesOption;
|
|
15
|
+
exports.EditorShowOutlinesContext = (0, react_1.createContext)({
|
|
16
|
+
editorShowOutlines: true,
|
|
17
|
+
setEditorShowOutlines: () => undefined,
|
|
18
|
+
});
|
package/dist/state/modals.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { _InternalTypes } from 'remotion';
|
|
|
7
7
|
import type { CompType } from '../components/NewComposition/DuplicateComposition';
|
|
8
8
|
import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
|
|
9
9
|
import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
|
|
10
|
+
import type { KeyframeSettingsModalState } from '../components/Timeline/KeyframeSettingsModal';
|
|
10
11
|
import type { Bug, UpdateInfo } from '../components/UpdateCheck';
|
|
11
12
|
export type WebRenderModalState = {
|
|
12
13
|
type: 'web-render';
|
|
@@ -86,6 +87,16 @@ export type RenderModalState = {
|
|
|
86
87
|
defaulMetadata: Record<string, string> | null;
|
|
87
88
|
renderDefaults: RenderDefaults;
|
|
88
89
|
};
|
|
90
|
+
export type ConfirmationDialogState = {
|
|
91
|
+
type: 'confirmation-dialog';
|
|
92
|
+
id: string;
|
|
93
|
+
title: string;
|
|
94
|
+
message: React.ReactNode;
|
|
95
|
+
confirmLabel: string;
|
|
96
|
+
cancelLabel: string;
|
|
97
|
+
onConfirm: () => void;
|
|
98
|
+
onCancel: () => void;
|
|
99
|
+
};
|
|
89
100
|
export type ModalState = {
|
|
90
101
|
type: 'duplicate-comp';
|
|
91
102
|
compositionId: string;
|
|
@@ -96,9 +107,25 @@ export type ModalState = {
|
|
|
96
107
|
} | {
|
|
97
108
|
type: 'rename-comp';
|
|
98
109
|
compositionId: string;
|
|
110
|
+
} | {
|
|
111
|
+
type: 'delete-folder';
|
|
112
|
+
folderName: string;
|
|
113
|
+
parentName: string | null;
|
|
114
|
+
stack: string | null;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'rename-folder';
|
|
117
|
+
folderName: string;
|
|
118
|
+
parentName: string | null;
|
|
119
|
+
stack: string | null;
|
|
120
|
+
} | {
|
|
121
|
+
type: 'delete-static-file';
|
|
122
|
+
relativePath: string;
|
|
123
|
+
} | {
|
|
124
|
+
type: 'rename-static-file';
|
|
125
|
+
relativePath: string;
|
|
99
126
|
} | {
|
|
100
127
|
type: 'input-props-override';
|
|
101
|
-
} | RenderModalState | WebRenderModalState | {
|
|
128
|
+
} | KeyframeSettingsModalState | RenderModalState | WebRenderModalState | {
|
|
102
129
|
type: 'render-progress';
|
|
103
130
|
jobId: string;
|
|
104
131
|
} | {
|
|
@@ -112,7 +139,7 @@ export type ModalState = {
|
|
|
112
139
|
type: 'quick-switcher';
|
|
113
140
|
mode: QuickSwitcherMode;
|
|
114
141
|
invocationTimestamp: number;
|
|
115
|
-
};
|
|
142
|
+
} | ConfirmationDialogState;
|
|
116
143
|
export type ModalContextType = {
|
|
117
144
|
selectedModal: ModalState | null;
|
|
118
145
|
setSelectedModal: React.Dispatch<React.SetStateAction<ModalState | null>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
3
|
+
export type ScaleLockContextValue = {
|
|
4
|
+
readonly getScaleLockState: ({ defaultValue, fieldKey, nodePath }: {
|
|
5
|
+
readonly defaultValue: boolean;
|
|
6
|
+
readonly fieldKey: string;
|
|
7
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
readonly setScaleLockState: ({ fieldKey, linked, nodePath }: {
|
|
10
|
+
readonly fieldKey: string;
|
|
11
|
+
readonly linked: boolean;
|
|
12
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
13
|
+
}) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const ScaleLockContext: React.Context<ScaleLockContextValue>;
|
|
16
|
+
export declare const ScaleLockProvider: React.FC<{
|
|
17
|
+
readonly children: React.ReactNode;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ScaleLockProvider = exports.ScaleLockContext = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const remotion_1 = require("remotion");
|
|
40
|
+
const makeScaleLockKey = ({ fieldKey, nodePath, }) => `${remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath)}.${fieldKey}`;
|
|
41
|
+
exports.ScaleLockContext = react_1.default.createContext({
|
|
42
|
+
getScaleLockState: ({ defaultValue }) => defaultValue,
|
|
43
|
+
setScaleLockState: () => undefined,
|
|
44
|
+
});
|
|
45
|
+
const ScaleLockProvider = ({ children }) => {
|
|
46
|
+
const [states, setStates] = (0, react_1.useState)({});
|
|
47
|
+
const getScaleLockState = (0, react_1.useCallback)(({ defaultValue, fieldKey, nodePath }) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const key = makeScaleLockKey({ fieldKey, nodePath });
|
|
50
|
+
return (_a = states[key]) !== null && _a !== void 0 ? _a : defaultValue;
|
|
51
|
+
}, [states]);
|
|
52
|
+
const setScaleLockState = (0, react_1.useCallback)(({ fieldKey, linked, nodePath }) => {
|
|
53
|
+
const key = makeScaleLockKey({ fieldKey, nodePath });
|
|
54
|
+
setStates((current) => ({ ...current, [key]: linked }));
|
|
55
|
+
}, []);
|
|
56
|
+
const value = (0, react_1.useMemo)(() => ({ getScaleLockState, setScaleLockState }), [getScaleLockState, setScaleLockState]);
|
|
57
|
+
return (jsx_runtime_1.jsx(exports.ScaleLockContext.Provider, { value: value, children: children }));
|
|
58
|
+
};
|
|
59
|
+
exports.ScaleLockProvider = ScaleLockProvider;
|
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.473",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"semver": "7.5.3",
|
|
28
|
-
"remotion": "4.0.
|
|
29
|
-
"@remotion/player": "4.0.
|
|
30
|
-
"@remotion/media-utils": "4.0.
|
|
31
|
-
"@remotion/renderer": "4.0.
|
|
32
|
-
"@remotion/web-renderer": "4.0.
|
|
33
|
-
"@remotion/studio-shared": "4.0.
|
|
34
|
-
"@remotion/timeline-utils": "4.0.
|
|
35
|
-
"@remotion/zod-types": "4.0.
|
|
28
|
+
"remotion": "4.0.473",
|
|
29
|
+
"@remotion/player": "4.0.473",
|
|
30
|
+
"@remotion/media-utils": "4.0.473",
|
|
31
|
+
"@remotion/renderer": "4.0.473",
|
|
32
|
+
"@remotion/web-renderer": "4.0.473",
|
|
33
|
+
"@remotion/studio-shared": "4.0.473",
|
|
34
|
+
"@remotion/timeline-utils": "4.0.473",
|
|
35
|
+
"@remotion/zod-types": "4.0.473",
|
|
36
36
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
37
37
|
"mediabunny": "1.45.0",
|
|
38
38
|
"memfs": "3.4.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
45
|
"@types/semver": "7.5.3",
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.473",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
49
49
|
},
|