@remotion/studio 4.0.487 → 4.0.488
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/Canvas.js +156 -4
- package/dist/components/InspectorPanel/DefaultInspector.js +2 -1
- package/dist/components/SelectedOutlineOverlay.js +2 -1
- package/dist/components/Timeline/Timeline.js +8 -6
- package/dist/components/Timeline/TimelineDragHandler.js +2 -1
- package/dist/components/Timeline/TimelineSelection.js +3 -1
- package/dist/components/Timeline/TimelineSequence.js +15 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +63 -51
- package/dist/esm/{chunk-y2t24cx0.js → chunk-nn36hyt1.js} +230 -42
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/internals.mjs +230 -42
- package/dist/esm/previewEntry.mjs +455 -267
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -0
- package/dist/visual-controls/VisualControls.js +4 -0
- package/package.json +12 -12
|
@@ -6089,6 +6089,10 @@ import {
|
|
|
6089
6089
|
Internals as Internals19
|
|
6090
6090
|
} from "remotion";
|
|
6091
6091
|
|
|
6092
|
+
// src/helpers/interactivity-enabled.ts
|
|
6093
|
+
var interactivityEnabled = process.env.INTERACTIVITY_ENABLED;
|
|
6094
|
+
var studioInteractivityEnabled = interactivityEnabled === undefined || interactivityEnabled === null ? true : interactivityEnabled !== false && interactivityEnabled !== "false";
|
|
6095
|
+
|
|
6092
6096
|
// src/components/ExpandedTracksProvider.tsx
|
|
6093
6097
|
import { createContext as createContext13, useCallback as useCallback24, useMemo as useMemo24, useState as useState20 } from "react";
|
|
6094
6098
|
|
|
@@ -9486,7 +9490,7 @@ var TimelineSelectionProvider = ({ children }) => {
|
|
|
9486
9490
|
const { canvasContent } = useContext18(Internals19.CompositionManager);
|
|
9487
9491
|
const timelineSelectionScope = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
9488
9492
|
const { expandParentTracks } = useContext18(ExpandedTracksSetterContext);
|
|
9489
|
-
const canSelect = previewServerState.type === "connected" && !window.remotion_isReadOnlyStudio;
|
|
9493
|
+
const canSelect = studioInteractivityEnabled && previewServerState.type === "connected" && !window.remotion_isReadOnlyStudio;
|
|
9490
9494
|
const [selectedItems, setSelectedItems] = useState21([]);
|
|
9491
9495
|
const selectionAnchor = useRef16(null);
|
|
9492
9496
|
const selectionScope = useRef16(null);
|
|
@@ -13898,12 +13902,12 @@ var ErrorLoader = ({
|
|
|
13898
13902
|
// src/components/Canvas.tsx
|
|
13899
13903
|
import {
|
|
13900
13904
|
ASSET_DRAG_MIME_TYPE as ASSET_DRAG_MIME_TYPE2,
|
|
13901
|
-
COMPOSITION_DRAG_MIME_TYPE as COMPOSITION_DRAG_MIME_TYPE4,
|
|
13902
13905
|
COMPONENT_DRAG_MIME_TYPE as COMPONENT_DRAG_MIME_TYPE2,
|
|
13906
|
+
COMPOSITION_DRAG_MIME_TYPE as COMPOSITION_DRAG_MIME_TYPE4,
|
|
13903
13907
|
ELEMENT_DRAG_MIME_TYPE as ELEMENT_DRAG_MIME_TYPE3,
|
|
13904
13908
|
parseAssetDragData,
|
|
13905
|
-
parseCompositionDragData as parseCompositionDragData3,
|
|
13906
13909
|
parseComponentDragData,
|
|
13910
|
+
parseCompositionDragData as parseCompositionDragData3,
|
|
13907
13911
|
parseSfxDragData,
|
|
13908
13912
|
SFX_DRAG_MIME_TYPE as SFX_DRAG_MIME_TYPE2
|
|
13909
13913
|
} from "@remotion/studio-shared";
|
|
@@ -23383,7 +23387,7 @@ var SelectedOutlineOverlay = ({
|
|
|
23383
23387
|
selectItem(item, interaction, undefined, { reveal: true });
|
|
23384
23388
|
}, [selectItem]);
|
|
23385
23389
|
const outlineTargets = useMemo56(() => {
|
|
23386
|
-
if (!editorShowOutlines) {
|
|
23390
|
+
if (!studioInteractivityEnabled || !editorShowOutlines) {
|
|
23387
23391
|
return [];
|
|
23388
23392
|
}
|
|
23389
23393
|
const selectedSequenceKeys = getSelectedSequenceKeys(selectedItems);
|
|
@@ -24193,6 +24197,31 @@ var ResetZoomButton = ({ onClick }) => {
|
|
|
24193
24197
|
|
|
24194
24198
|
// src/components/Canvas.tsx
|
|
24195
24199
|
import { jsx as jsx94, jsxs as jsxs43, Fragment as Fragment19 } from "react/jsx-runtime";
|
|
24200
|
+
var elementInstallCompositionIdStyle = {
|
|
24201
|
+
fontFamily: "monospace",
|
|
24202
|
+
fontSize: 13
|
|
24203
|
+
};
|
|
24204
|
+
var elementInstallCodeDetailsStyle = {
|
|
24205
|
+
marginTop: 12,
|
|
24206
|
+
fontSize: 13
|
|
24207
|
+
};
|
|
24208
|
+
var elementInstallCodeSummaryStyle = {
|
|
24209
|
+
cursor: "pointer",
|
|
24210
|
+
fontSize: 13,
|
|
24211
|
+
fontWeight: 500
|
|
24212
|
+
};
|
|
24213
|
+
var elementInstallCodeBlockStyle = {
|
|
24214
|
+
marginTop: 8,
|
|
24215
|
+
marginBottom: 0,
|
|
24216
|
+
maxHeight: 240,
|
|
24217
|
+
overflow: "auto",
|
|
24218
|
+
padding: 12,
|
|
24219
|
+
borderRadius: 6,
|
|
24220
|
+
backgroundColor: "rgba(255, 255, 255, 0.06)",
|
|
24221
|
+
fontSize: 12,
|
|
24222
|
+
lineHeight: 1.5,
|
|
24223
|
+
whiteSpace: "pre"
|
|
24224
|
+
};
|
|
24196
24225
|
var getContainerStyle = (editorZoomGestures) => ({
|
|
24197
24226
|
flex: 1,
|
|
24198
24227
|
display: "flex",
|
|
@@ -24327,12 +24356,18 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
24327
24356
|
const suppressWheelFromWebKitPinchRef = useRef32(false);
|
|
24328
24357
|
const touchPinchRef = useRef32(null);
|
|
24329
24358
|
const keybindings = useKeybinding();
|
|
24359
|
+
const confirm = useConfirmationDialog();
|
|
24330
24360
|
const config = Internals40.useUnsafeVideoConfig();
|
|
24331
24361
|
const areRulersVisible = useIsRulerVisible();
|
|
24332
24362
|
const { editorShowGuides } = useContext38(EditorShowGuidesContext);
|
|
24333
24363
|
const { compositions } = useContext38(Internals40.CompositionManager);
|
|
24334
|
-
const { previewServerState } = useContext38(StudioServerConnectionCtx);
|
|
24364
|
+
const { previewServerState, subscribeToEvent } = useContext38(StudioServerConnectionCtx);
|
|
24365
|
+
const previewServerClientId = previewServerState.type === "connected" ? previewServerState.clientId : null;
|
|
24335
24366
|
const [isAddingAsset, setIsAddingAsset] = useState42(false);
|
|
24367
|
+
const [installingElementName, setInstallingElementName] = useState42(null);
|
|
24368
|
+
const [pendingElementInstallRequests, setPendingElementInstallRequests] = useState42([]);
|
|
24369
|
+
const [activeElementInstallRequest, setActiveElementInstallRequest] = useState42(null);
|
|
24370
|
+
const lastFocusedAtRef = useRef32(typeof document === "undefined" || document.hasFocus() ? Date.now() : null);
|
|
24336
24371
|
const [assetResolution, setAssetResolution] = useState42(null);
|
|
24337
24372
|
const currentCompositionId = canvasContent.type === "composition" ? canvasContent.compositionId : null;
|
|
24338
24373
|
const currentComposition = useMemo58(() => {
|
|
@@ -24347,7 +24382,8 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
24347
24382
|
compositionFile,
|
|
24348
24383
|
compositionId: currentCompositionId
|
|
24349
24384
|
});
|
|
24350
|
-
const
|
|
24385
|
+
const canInstallElements = previewServerClientId !== null && !window.remotion_isReadOnlyStudio && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null;
|
|
24386
|
+
const canDropAssets = canInstallElements && !isAddingAsset;
|
|
24351
24387
|
const contentDimensions = useMemo58(() => {
|
|
24352
24388
|
if ((canvasContent.type === "asset" || canvasContent.type === "output" || canvasContent.type === "output-blob") && assetResolution && assetResolution.type === "found") {
|
|
24353
24389
|
return assetResolution.dimensions;
|
|
@@ -24703,6 +24739,145 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
24703
24739
|
useEffect42(() => {
|
|
24704
24740
|
fetchMetadata();
|
|
24705
24741
|
}, [fetchMetadata]);
|
|
24742
|
+
const updateElementInstallTarget = useCallback51(() => {
|
|
24743
|
+
if (previewServerClientId === null) {
|
|
24744
|
+
return;
|
|
24745
|
+
}
|
|
24746
|
+
callApi("/api/update-element-install-target", {
|
|
24747
|
+
clientId: previewServerClientId,
|
|
24748
|
+
compositionFile: canInstallElements ? compositionFile : null,
|
|
24749
|
+
compositionId: canInstallElements ? currentCompositionId : null,
|
|
24750
|
+
canInstall: canInstallElements,
|
|
24751
|
+
lastFocusedAt: lastFocusedAtRef.current,
|
|
24752
|
+
readOnly: window.remotion_isReadOnlyStudio
|
|
24753
|
+
}).catch(() => {
|
|
24754
|
+
return;
|
|
24755
|
+
});
|
|
24756
|
+
}, [
|
|
24757
|
+
canInstallElements,
|
|
24758
|
+
compositionFile,
|
|
24759
|
+
currentCompositionId,
|
|
24760
|
+
previewServerClientId
|
|
24761
|
+
]);
|
|
24762
|
+
useEffect42(() => {
|
|
24763
|
+
updateElementInstallTarget();
|
|
24764
|
+
const interval = window.setInterval(updateElementInstallTarget, 2000);
|
|
24765
|
+
return () => {
|
|
24766
|
+
window.clearInterval(interval);
|
|
24767
|
+
};
|
|
24768
|
+
}, [updateElementInstallTarget]);
|
|
24769
|
+
useEffect42(() => {
|
|
24770
|
+
const markFocused = () => {
|
|
24771
|
+
lastFocusedAtRef.current = Date.now();
|
|
24772
|
+
updateElementInstallTarget();
|
|
24773
|
+
};
|
|
24774
|
+
window.addEventListener("focus", markFocused);
|
|
24775
|
+
document.addEventListener("pointerdown", markFocused, { capture: true });
|
|
24776
|
+
return () => {
|
|
24777
|
+
window.removeEventListener("focus", markFocused);
|
|
24778
|
+
document.removeEventListener("pointerdown", markFocused, { capture: true });
|
|
24779
|
+
};
|
|
24780
|
+
}, [updateElementInstallTarget]);
|
|
24781
|
+
useEffect42(() => {
|
|
24782
|
+
if (installingElementName === null) {
|
|
24783
|
+
return;
|
|
24784
|
+
}
|
|
24785
|
+
const previousTitle = document.title;
|
|
24786
|
+
document.title = `\uD83D\uDCE6 Install ${installingElementName} - Remotion Studio`;
|
|
24787
|
+
return () => {
|
|
24788
|
+
document.title = previousTitle;
|
|
24789
|
+
};
|
|
24790
|
+
}, [installingElementName]);
|
|
24791
|
+
useEffect42(() => {
|
|
24792
|
+
if (previewServerClientId === null) {
|
|
24793
|
+
return;
|
|
24794
|
+
}
|
|
24795
|
+
return subscribeToEvent("element-install-request", (event) => {
|
|
24796
|
+
if (event.type !== "element-install-request" || event.request.clientId !== previewServerClientId) {
|
|
24797
|
+
return;
|
|
24798
|
+
}
|
|
24799
|
+
setPendingElementInstallRequests((requests) => [
|
|
24800
|
+
...requests,
|
|
24801
|
+
event.request
|
|
24802
|
+
]);
|
|
24803
|
+
});
|
|
24804
|
+
}, [previewServerClientId, subscribeToEvent]);
|
|
24805
|
+
useEffect42(() => {
|
|
24806
|
+
if (activeElementInstallRequest !== null || pendingElementInstallRequests.length === 0) {
|
|
24807
|
+
return;
|
|
24808
|
+
}
|
|
24809
|
+
const [nextRequest, ...remainingRequests] = pendingElementInstallRequests;
|
|
24810
|
+
if (!nextRequest) {
|
|
24811
|
+
throw new Error("Expected pending Element install request");
|
|
24812
|
+
}
|
|
24813
|
+
setActiveElementInstallRequest(nextRequest);
|
|
24814
|
+
setPendingElementInstallRequests(remainingRequests);
|
|
24815
|
+
}, [activeElementInstallRequest, pendingElementInstallRequests]);
|
|
24816
|
+
useEffect42(() => {
|
|
24817
|
+
if (activeElementInstallRequest === null) {
|
|
24818
|
+
return;
|
|
24819
|
+
}
|
|
24820
|
+
let canceled = false;
|
|
24821
|
+
const handleInstallRequest = async () => {
|
|
24822
|
+
setInstallingElementName(activeElementInstallRequest.element.displayName);
|
|
24823
|
+
const accepted = await confirm({
|
|
24824
|
+
title: "Install Element",
|
|
24825
|
+
message: /* @__PURE__ */ jsxs43(Fragment19, {
|
|
24826
|
+
children: [
|
|
24827
|
+
"Install “",
|
|
24828
|
+
activeElementInstallRequest.element.displayName,
|
|
24829
|
+
"” into",
|
|
24830
|
+
" ",
|
|
24831
|
+
/* @__PURE__ */ jsx94("code", {
|
|
24832
|
+
style: elementInstallCompositionIdStyle,
|
|
24833
|
+
children: activeElementInstallRequest.compositionId
|
|
24834
|
+
}),
|
|
24835
|
+
" ",
|
|
24836
|
+
"composition? This will create an Element source file and update the composition source.",
|
|
24837
|
+
/* @__PURE__ */ jsxs43("details", {
|
|
24838
|
+
style: elementInstallCodeDetailsStyle,
|
|
24839
|
+
children: [
|
|
24840
|
+
/* @__PURE__ */ jsx94("summary", {
|
|
24841
|
+
style: elementInstallCodeSummaryStyle,
|
|
24842
|
+
children: "Preview Element source"
|
|
24843
|
+
}),
|
|
24844
|
+
/* @__PURE__ */ jsx94("pre", {
|
|
24845
|
+
style: elementInstallCodeBlockStyle,
|
|
24846
|
+
children: /* @__PURE__ */ jsx94("code", {
|
|
24847
|
+
children: activeElementInstallRequest.element.sourceCode
|
|
24848
|
+
})
|
|
24849
|
+
})
|
|
24850
|
+
]
|
|
24851
|
+
})
|
|
24852
|
+
]
|
|
24853
|
+
}),
|
|
24854
|
+
confirmLabel: "Install",
|
|
24855
|
+
cancelLabel: "Cancel"
|
|
24856
|
+
});
|
|
24857
|
+
if (accepted && !canceled) {
|
|
24858
|
+
await insertElement({
|
|
24859
|
+
element: activeElementInstallRequest.element,
|
|
24860
|
+
compositionFile: activeElementInstallRequest.compositionFile,
|
|
24861
|
+
compositionId: activeElementInstallRequest.compositionId,
|
|
24862
|
+
dropPosition: null
|
|
24863
|
+
});
|
|
24864
|
+
}
|
|
24865
|
+
};
|
|
24866
|
+
handleInstallRequest().finally(() => {
|
|
24867
|
+
if (canceled) {
|
|
24868
|
+
return;
|
|
24869
|
+
}
|
|
24870
|
+
setInstallingElementName(null);
|
|
24871
|
+
setActiveElementInstallRequest(null);
|
|
24872
|
+
}).catch((err) => {
|
|
24873
|
+
setTimeout(() => {
|
|
24874
|
+
throw err;
|
|
24875
|
+
}, 0);
|
|
24876
|
+
});
|
|
24877
|
+
return () => {
|
|
24878
|
+
canceled = true;
|
|
24879
|
+
};
|
|
24880
|
+
}, [activeElementInstallRequest, confirm]);
|
|
24706
24881
|
const onDragOver = useCallback51((event) => {
|
|
24707
24882
|
if (!canDropAssets || !isFileDragEvent(event) && !isAssetDragEvent(event) && !isCompositionDragEvent(event) && !isComponentDragEvent(event) && !isElementDragEvent(event) && !isSfxDragEvent(event) && !isRemoteAssetDragEvent(event) || !isDragEventInsideCanvas(event)) {
|
|
24708
24883
|
return;
|
|
@@ -26907,6 +27082,9 @@ var VisualControlsProvider = ({ children }) => {
|
|
|
26907
27082
|
if (!env.isStudio) {
|
|
26908
27083
|
return value;
|
|
26909
27084
|
}
|
|
27085
|
+
if (!studioInteractivityEnabled) {
|
|
27086
|
+
return value;
|
|
27087
|
+
}
|
|
26910
27088
|
if (!z) {
|
|
26911
27089
|
return value;
|
|
26912
27090
|
}
|
|
@@ -33297,7 +33475,7 @@ var DefaultInspector = ({ composition, currentDefaultProps, readOnlyStudio, setD
|
|
|
33297
33475
|
const { handles: visualControlHandles } = useContext56(VisualControlsContext);
|
|
33298
33476
|
const [defaultPropsMode, setDefaultPropsMode] = useState68("schema");
|
|
33299
33477
|
const compositionId = composition?.id ?? null;
|
|
33300
|
-
const hasVisualControls = Object.keys(visualControlHandles).length > 0;
|
|
33478
|
+
const hasVisualControls = studioInteractivityEnabled && Object.keys(visualControlHandles).length > 0;
|
|
33301
33479
|
useEffect60(() => {
|
|
33302
33480
|
setDefaultPropsMode("schema");
|
|
33303
33481
|
}, [compositionId]);
|
|
@@ -48135,7 +48313,7 @@ var TimelineDragHandler = () => {
|
|
|
48135
48313
|
ref: sliderAreaRef,
|
|
48136
48314
|
style: containerStyle9,
|
|
48137
48315
|
...{ [TIMELINE_SCRUBBER_ATTR]: true },
|
|
48138
|
-
children: video ? /* @__PURE__ */ jsx258(TimelineDragHandlerInnerMemo, {}) : null
|
|
48316
|
+
children: video && studioInteractivityEnabled ? /* @__PURE__ */ jsx258(TimelineDragHandlerInnerMemo, {}) : null
|
|
48139
48317
|
});
|
|
48140
48318
|
};
|
|
48141
48319
|
var TimelineDragHandlerInner = () => {
|
|
@@ -49202,6 +49380,7 @@ var TimelineSequenceItem = ({
|
|
|
49202
49380
|
const nodePath = nodePathInfo?.sequenceSubscriptionKey ?? null;
|
|
49203
49381
|
const { previewServerState } = useContext111(StudioServerConnectionCtx);
|
|
49204
49382
|
const previewConnected = previewServerState.type === "connected";
|
|
49383
|
+
const previewInteractive = previewConnected && studioInteractivityEnabled;
|
|
49205
49384
|
const { getIsExpanded } = useContext111(ExpandedTracksGetterContext);
|
|
49206
49385
|
const { toggleTrack } = useContext111(ExpandedTracksSetterContext);
|
|
49207
49386
|
const { setPropStatuses } = useContext111(Internals91.VisualModeSettersContext);
|
|
@@ -49238,7 +49417,7 @@ var TimelineSequenceItem = ({
|
|
|
49238
49417
|
propStatusesForOverride,
|
|
49239
49418
|
saveName
|
|
49240
49419
|
} = useRenameSequence({
|
|
49241
|
-
clientId: previewServerState.type === "connected" ? previewServerState.clientId : null,
|
|
49420
|
+
clientId: previewInteractive && previewServerState.type === "connected" ? previewServerState.clientId : null,
|
|
49242
49421
|
nodePathInfo,
|
|
49243
49422
|
sequence,
|
|
49244
49423
|
validatedLocation
|
|
@@ -49246,22 +49425,22 @@ var TimelineSequenceItem = ({
|
|
|
49246
49425
|
const canDeleteFromSource = Boolean(nodePath && validatedLocation?.source);
|
|
49247
49426
|
const nodePathKey = useMemo170(() => nodePath ? Internals91.makeSequencePropsSubscriptionKey(nodePath) : null, [nodePath]);
|
|
49248
49427
|
const parentId = sequence.parent ?? null;
|
|
49249
|
-
const canReorderSequence =
|
|
49250
|
-
const canHandleSequenceDrag =
|
|
49428
|
+
const canReorderSequence = previewInteractive && Boolean(nodePath && nodePathKey && validatedLocation?.source) && nodePathInfo?.numberOfSequencesWithThisNodePath === 1;
|
|
49429
|
+
const canHandleSequenceDrag = previewInteractive;
|
|
49251
49430
|
const confirm = useConfirmationDialog();
|
|
49252
|
-
const deleteDisabled = useMemo170(() => !
|
|
49431
|
+
const deleteDisabled = useMemo170(() => !previewInteractive || !sequence.controls || !canDeleteFromSource, [previewInteractive, sequence.controls, canDeleteFromSource]);
|
|
49253
49432
|
const duplicateDisabled = deleteDisabled;
|
|
49254
|
-
const disableInteractivityDisabled = !
|
|
49433
|
+
const disableInteractivityDisabled = !previewInteractive || !sequence.showInTimeline || !nodePath || !validatedLocation?.source;
|
|
49255
49434
|
const onDuplicateSequenceFromSource = useCallback162(() => {
|
|
49256
|
-
if (!validatedLocation?.source || !nodePathInfo) {
|
|
49435
|
+
if (duplicateDisabled || !validatedLocation?.source || !nodePathInfo) {
|
|
49257
49436
|
return;
|
|
49258
49437
|
}
|
|
49259
49438
|
duplicateSequencesFromSource([nodePathInfo], confirm).catch(() => {
|
|
49260
49439
|
return;
|
|
49261
49440
|
});
|
|
49262
|
-
}, [confirm, nodePathInfo, validatedLocation?.source]);
|
|
49441
|
+
}, [confirm, duplicateDisabled, nodePathInfo, validatedLocation?.source]);
|
|
49263
49442
|
const onDeleteSequenceFromSource = useCallback162(async () => {
|
|
49264
|
-
if (!validatedLocation?.source || !nodePath) {
|
|
49443
|
+
if (deleteDisabled || !validatedLocation?.source || !nodePath) {
|
|
49265
49444
|
return;
|
|
49266
49445
|
}
|
|
49267
49446
|
if (nodePathInfo && nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
|
|
@@ -49291,7 +49470,13 @@ var TimelineSequenceItem = ({
|
|
|
49291
49470
|
} catch (err) {
|
|
49292
49471
|
showNotification(err.message, 4000);
|
|
49293
49472
|
}
|
|
49294
|
-
}, [
|
|
49473
|
+
}, [
|
|
49474
|
+
confirm,
|
|
49475
|
+
deleteDisabled,
|
|
49476
|
+
nodePath,
|
|
49477
|
+
validatedLocation?.source,
|
|
49478
|
+
nodePathInfo
|
|
49479
|
+
]);
|
|
49295
49480
|
const onDisableSequenceInteractivity = useCallback162(() => {
|
|
49296
49481
|
if (disableInteractivityDisabled || !nodePath || !validatedLocation?.source || previewServerState.type !== "connected") {
|
|
49297
49482
|
return;
|
|
@@ -49526,8 +49711,8 @@ var TimelineSequenceItem = ({
|
|
|
49526
49711
|
...effectDropHighlight
|
|
49527
49712
|
} : inner2;
|
|
49528
49713
|
}, [effectDropHovered, inner2]);
|
|
49529
|
-
const hasExpandableContent = Boolean(sequence.controls) || sequence.effects.length > 0;
|
|
49530
|
-
const canToggleVisibility =
|
|
49714
|
+
const hasExpandableContent = studioInteractivityEnabled && (Boolean(sequence.controls) || sequence.effects.length > 0);
|
|
49715
|
+
const canToggleVisibility = previewInteractive && Boolean(sequence.controls) && nodePath !== null && validatedLocation !== null && codeHiddenStatus !== undefined && codeHiddenStatus !== null && codeHiddenStatus.status === "static";
|
|
49531
49716
|
const onSequenceDoubleClick = useCallback162((e) => {
|
|
49532
49717
|
if (isTimelineSelectionModifierEvent(e)) {
|
|
49533
49718
|
e.stopPropagation();
|
|
@@ -49580,7 +49765,7 @@ var TimelineSequenceItem = ({
|
|
|
49580
49765
|
setIsRenaming(true);
|
|
49581
49766
|
}, [canRenameThisSequence]);
|
|
49582
49767
|
const freezeFrameMenuItem = useSequenceFreezeFrameMenuItem({
|
|
49583
|
-
clientId: previewServerState.type === "connected" ? previewServerState.clientId : null,
|
|
49768
|
+
clientId: previewInteractive && previewServerState.type === "connected" ? previewServerState.clientId : null,
|
|
49584
49769
|
nodePath,
|
|
49585
49770
|
propStatusesForOverride,
|
|
49586
49771
|
sequence,
|
|
@@ -49589,7 +49774,7 @@ var TimelineSequenceItem = ({
|
|
|
49589
49774
|
timelinePosition,
|
|
49590
49775
|
validatedSource: validatedLocation?.source ?? null
|
|
49591
49776
|
});
|
|
49592
|
-
const canAddEffect = nodePathInfo?.supportsEffects === true &&
|
|
49777
|
+
const canAddEffect = nodePathInfo?.supportsEffects === true && previewInteractive && Boolean(validatedLocation?.source);
|
|
49593
49778
|
const onAddEffect = useCallback162(() => {
|
|
49594
49779
|
if (!canAddEffect || previewServerState.type !== "connected" || !nodePath || !validatedLocation?.source) {
|
|
49595
49780
|
return;
|
|
@@ -49618,7 +49803,7 @@ var TimelineSequenceItem = ({
|
|
|
49618
49803
|
disableInteractivityDisabled,
|
|
49619
49804
|
duplicateDisabled,
|
|
49620
49805
|
fileLocation,
|
|
49621
|
-
includeSourceEditItems:
|
|
49806
|
+
includeSourceEditItems: studioInteractivityEnabled,
|
|
49622
49807
|
onDeleteSequenceFromSource,
|
|
49623
49808
|
onDisableSequenceInteractivity,
|
|
49624
49809
|
onDuplicateSequenceFromSource,
|
|
@@ -49626,7 +49811,7 @@ var TimelineSequenceItem = ({
|
|
|
49626
49811
|
originalLocation,
|
|
49627
49812
|
selectAsset,
|
|
49628
49813
|
sequence,
|
|
49629
|
-
sourceActions: [
|
|
49814
|
+
sourceActions: studioInteractivityEnabled ? [
|
|
49630
49815
|
...nodePathInfo?.supportsEffects ? [
|
|
49631
49816
|
{
|
|
49632
49817
|
type: "item",
|
|
@@ -49660,7 +49845,7 @@ var TimelineSequenceItem = ({
|
|
|
49660
49845
|
value: "rename-sequence"
|
|
49661
49846
|
},
|
|
49662
49847
|
...freezeFrameMenuItem ? [freezeFrameMenuItem] : []
|
|
49663
|
-
]
|
|
49848
|
+
] : []
|
|
49664
49849
|
});
|
|
49665
49850
|
}, [
|
|
49666
49851
|
assetLinkInfo,
|
|
@@ -49684,7 +49869,7 @@ var TimelineSequenceItem = ({
|
|
|
49684
49869
|
selectAsset,
|
|
49685
49870
|
sequence
|
|
49686
49871
|
]);
|
|
49687
|
-
const canDropEffect =
|
|
49872
|
+
const canDropEffect = previewInteractive && nodePath !== null && validatedLocation !== null && sequence.controls?.supportsEffects === true;
|
|
49688
49873
|
const sequenceReorderLineStyle = useMemo170(() => {
|
|
49689
49874
|
if (!sequenceDropIndicator) {
|
|
49690
49875
|
return null;
|
|
@@ -49740,7 +49925,7 @@ var TimelineSequenceItem = ({
|
|
|
49740
49925
|
onInvoked: onToggleVisibility
|
|
49741
49926
|
}) : /* @__PURE__ */ jsx266(TimelineLayerEyeSpacer, {}),
|
|
49742
49927
|
arrow: hasExpandableContent && nodePathInfo !== null ? /* @__PURE__ */ jsx266(TimelineSequenceExpandArrow, {
|
|
49743
|
-
disabled: !
|
|
49928
|
+
disabled: !previewInteractive,
|
|
49744
49929
|
isExpanded,
|
|
49745
49930
|
nodePathInfo,
|
|
49746
49931
|
onToggleExpand,
|
|
@@ -49810,7 +49995,7 @@ var TimelineSequenceItem = ({
|
|
|
49810
49995
|
onOpen: selectable ? onSelect : null,
|
|
49811
49996
|
children: draggableTrackRow
|
|
49812
49997
|
}) : draggableTrackRow,
|
|
49813
|
-
previewConnected && isExpanded && hasExpandableContent && nodePathInfo && validatedLocation ? /* @__PURE__ */ jsx266(TimelineExpandedSection, {
|
|
49998
|
+
previewConnected && studioInteractivityEnabled && isExpanded && hasExpandableContent && nodePathInfo && validatedLocation ? /* @__PURE__ */ jsx266(TimelineExpandedSection, {
|
|
49814
49999
|
sequence,
|
|
49815
50000
|
validatedLocation,
|
|
49816
50001
|
nodePathInfo,
|
|
@@ -52559,11 +52744,12 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
52559
52744
|
const propStatusesForOverride = useMemo176(() => {
|
|
52560
52745
|
return nodePath ? Internals97.getPropStatusesCtx(propStatuses, nodePath) : undefined;
|
|
52561
52746
|
}, [propStatuses, nodePath]);
|
|
52562
|
-
const durationCanUpdate = Boolean(propStatusesForOverride?.durationInFrames?.status === "static");
|
|
52563
|
-
const fromCanUpdate = Boolean(propStatusesForOverride?.from?.status === "static");
|
|
52564
|
-
const trimBeforeCanUpdate = Boolean(propStatusesForOverride?.trimBefore?.status === "static");
|
|
52747
|
+
const durationCanUpdate = Boolean(studioInteractivityEnabled && propStatusesForOverride?.durationInFrames?.status === "static");
|
|
52748
|
+
const fromCanUpdate = Boolean(studioInteractivityEnabled && propStatusesForOverride?.from?.status === "static");
|
|
52749
|
+
const trimBeforeCanUpdate = Boolean(studioInteractivityEnabled && propStatusesForOverride?.trimBefore?.status === "static");
|
|
52565
52750
|
const { previewServerState } = useContext118(StudioServerConnectionCtx);
|
|
52566
52751
|
const previewConnected = previewServerState.type === "connected";
|
|
52752
|
+
const previewInteractive = previewConnected && studioInteractivityEnabled;
|
|
52567
52753
|
const { setPropStatuses } = useContext118(Internals97.VisualModeSettersContext);
|
|
52568
52754
|
const timelinePosition = Internals97.Timeline.useTimelinePosition();
|
|
52569
52755
|
const selectAsset = useSelectAsset();
|
|
@@ -52583,9 +52769,9 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
52583
52769
|
});
|
|
52584
52770
|
}, [canOpenInEditor, originalLocation]);
|
|
52585
52771
|
const canDeleteFromSource = Boolean(nodePath && validatedLocation?.source);
|
|
52586
|
-
const deleteDisabled = !
|
|
52772
|
+
const deleteDisabled = !previewInteractive || !s.controls || !canDeleteFromSource;
|
|
52587
52773
|
const duplicateDisabled = deleteDisabled;
|
|
52588
|
-
const disableInteractivityDisabled = !
|
|
52774
|
+
const disableInteractivityDisabled = !previewInteractive || !s.showInTimeline || !nodePath || !validatedLocation?.source;
|
|
52589
52775
|
const mediaSrc = s.type === "audio" || s.type === "video" || s.type === "image" ? s.src : null;
|
|
52590
52776
|
const assetLinkInfo = useMemo176(() => mediaSrc ? getTimelineAssetLinkInfo(mediaSrc) : null, [mediaSrc]);
|
|
52591
52777
|
const onDuplicateSequenceFromSource = useCallback165(() => {
|
|
@@ -52652,7 +52838,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
52652
52838
|
validatedLocation?.source
|
|
52653
52839
|
]);
|
|
52654
52840
|
const freezeFrameMenuItem = useSequenceFreezeFrameMenuItem({
|
|
52655
|
-
clientId: previewServerState.type === "connected" ? previewServerState.clientId : null,
|
|
52841
|
+
clientId: previewInteractive && previewServerState.type === "connected" ? previewServerState.clientId : null,
|
|
52656
52842
|
nodePath,
|
|
52657
52843
|
propStatusesForOverride,
|
|
52658
52844
|
sequence: s,
|
|
@@ -52672,7 +52858,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
52672
52858
|
disableInteractivityDisabled,
|
|
52673
52859
|
duplicateDisabled,
|
|
52674
52860
|
fileLocation,
|
|
52675
|
-
includeSourceEditItems:
|
|
52861
|
+
includeSourceEditItems: studioInteractivityEnabled,
|
|
52676
52862
|
onDeleteSequenceFromSource,
|
|
52677
52863
|
onDisableSequenceInteractivity,
|
|
52678
52864
|
onDuplicateSequenceFromSource,
|
|
@@ -52680,7 +52866,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
52680
52866
|
originalLocation,
|
|
52681
52867
|
selectAsset,
|
|
52682
52868
|
sequence: s,
|
|
52683
|
-
sourceActions: freezeFrameMenuItem ? [freezeFrameMenuItem] : []
|
|
52869
|
+
sourceActions: studioInteractivityEnabled && freezeFrameMenuItem ? [freezeFrameMenuItem] : []
|
|
52684
52870
|
});
|
|
52685
52871
|
}, [
|
|
52686
52872
|
assetLinkInfo,
|
|
@@ -52907,6 +53093,7 @@ var TimelineContextMenuArea = ({ children }) => {
|
|
|
52907
53093
|
const [isAddingAsset, setIsAddingAsset] = useState99(false);
|
|
52908
53094
|
const { previewServerState } = useContext120(StudioServerConnectionCtx);
|
|
52909
53095
|
const previewConnected = previewServerState.type === "connected";
|
|
53096
|
+
const previewInteractive = previewConnected && studioInteractivityEnabled;
|
|
52910
53097
|
const currentCompositionId = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
52911
53098
|
const currentComposition = useMemo179(() => {
|
|
52912
53099
|
if (currentCompositionId === null) {
|
|
@@ -52920,8 +53107,8 @@ var TimelineContextMenuArea = ({ children }) => {
|
|
|
52920
53107
|
compositionFile,
|
|
52921
53108
|
compositionId: currentCompositionId
|
|
52922
53109
|
});
|
|
52923
|
-
const canInsertSolid =
|
|
52924
|
-
const canInsertAsset =
|
|
53110
|
+
const canInsertSolid = previewInteractive && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && videoConfig !== null && !isAddingSolid;
|
|
53111
|
+
const canInsertAsset = previewInteractive && !window.remotion_isReadOnlyStudio && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && !isAddingAsset;
|
|
52925
53112
|
const insertSolid = useCallback166(async () => {
|
|
52926
53113
|
if (!canInsertSolid || currentCompositionId === null || compositionFile === null || videoConfig === null) {
|
|
52927
53114
|
return;
|
|
@@ -53013,6 +53200,7 @@ var TimelineInner = () => {
|
|
|
53013
53200
|
const { overrideIdToNodePathMappings } = useContext120(Internals98.OverrideIdsToNodePathsGettersContext);
|
|
53014
53201
|
const { previewServerState } = useContext120(StudioServerConnectionCtx);
|
|
53015
53202
|
const previewConnected = previewServerState.type === "connected";
|
|
53203
|
+
const previewInteractive = previewConnected && studioInteractivityEnabled;
|
|
53016
53204
|
const videoConfigIsNull = videoConfig === null;
|
|
53017
53205
|
const timeline = useMemo179(() => {
|
|
53018
53206
|
if (videoConfigIsNull) {
|
|
@@ -53034,7 +53222,7 @@ var TimelineInner = () => {
|
|
|
53034
53222
|
return /* @__PURE__ */ jsxs146(TimelineContextMenuArea, {
|
|
53035
53223
|
children: [
|
|
53036
53224
|
sequences.map((sequence) => {
|
|
53037
|
-
if (!shouldSubscribeToSequenceProps(sequence,
|
|
53225
|
+
if (!shouldSubscribeToSequenceProps(sequence, previewInteractive)) {
|
|
53038
53226
|
return null;
|
|
53039
53227
|
}
|
|
53040
53228
|
return /* @__PURE__ */ jsx282(SubscribeToNodePaths, {
|
|
@@ -53045,15 +53233,15 @@ var TimelineInner = () => {
|
|
|
53045
53233
|
effects: sequence.effects
|
|
53046
53234
|
}, sequence.id);
|
|
53047
53235
|
}),
|
|
53048
|
-
/* @__PURE__ */ jsx282(SequencePropsObserver, {}),
|
|
53236
|
+
studioInteractivityEnabled ? /* @__PURE__ */ jsx282(SequencePropsObserver, {}) : null,
|
|
53049
53237
|
/* @__PURE__ */ jsx282(TimelineKeyframeTracksProvider, {
|
|
53050
53238
|
tracks: filtered,
|
|
53051
53239
|
children: /* @__PURE__ */ jsxs146(TimelineSelectableItemsProvider, {
|
|
53052
53240
|
timeline: shown,
|
|
53053
53241
|
children: [
|
|
53054
|
-
/* @__PURE__ */ jsx282(TimelineSelectAllKeybindings, {
|
|
53242
|
+
studioInteractivityEnabled ? /* @__PURE__ */ jsx282(TimelineSelectAllKeybindings, {
|
|
53055
53243
|
timeline: shown
|
|
53056
|
-
}),
|
|
53244
|
+
}) : null,
|
|
53057
53245
|
/* @__PURE__ */ jsx282(TimelineHeightContainer, {
|
|
53058
53246
|
shown,
|
|
53059
53247
|
hasBeenCut,
|
|
@@ -53093,7 +53281,7 @@ var TimelineInner = () => {
|
|
|
53093
53281
|
/* @__PURE__ */ jsx282(TimelineInOutPointer, {}),
|
|
53094
53282
|
/* @__PURE__ */ jsx282(TimelineTimeIndicators, {}),
|
|
53095
53283
|
/* @__PURE__ */ jsx282(TimelineDragHandler, {}),
|
|
53096
|
-
/* @__PURE__ */ jsx282(TimelineInOutDragHandler, {}),
|
|
53284
|
+
studioInteractivityEnabled ? /* @__PURE__ */ jsx282(TimelineInOutDragHandler, {}) : null,
|
|
53097
53285
|
/* @__PURE__ */ jsx282(TimelineSlider, {})
|
|
53098
53286
|
]
|
|
53099
53287
|
})
|
package/dist/esm/index.mjs
CHANGED
|
@@ -584,6 +584,9 @@ import {
|
|
|
584
584
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
585
585
|
var ZodContext = createContext(null);
|
|
586
586
|
|
|
587
|
+
// src/helpers/interactivity-enabled.ts
|
|
588
|
+
var interactivityEnabled = process.env.INTERACTIVITY_ENABLED;
|
|
589
|
+
|
|
587
590
|
// src/visual-controls/VisualControls.tsx
|
|
588
591
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
589
592
|
var VisualControlsTabActivatedContext = createContext2(false);
|