@remotion/studio 4.0.496 → 4.0.498
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/AudioWaveform.js +1 -11
- package/dist/components/Canvas.js +22 -203
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CompositionSelectorItem.js +2 -10
- package/dist/components/ConfigureLicenseModal.d.ts +4 -0
- package/dist/components/ConfigureLicenseModal.js +194 -0
- package/dist/components/Editor.d.ts +0 -1
- package/dist/components/Editor.js +2 -3
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +2 -1
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +27 -2
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +65 -8
- package/dist/components/InspectorPanel/use-composition-actions.js +7 -3
- package/dist/components/LicenseKeyValidation.d.ts +17 -0
- package/dist/components/LicenseKeyValidation.js +113 -0
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -1
- package/dist/components/NewComposition/CodemodFooter.js +23 -4
- package/dist/components/NewComposition/InputDragger.d.ts +6 -0
- package/dist/components/NewComposition/InputDragger.js +12 -3
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/RenderButton.js +0 -1
- package/dist/components/RenderModal/WebRenderModal.js +14 -8
- package/dist/components/SelectedOutlineElement.js +56 -88
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +10 -11
- package/dist/components/Timeline/MaxTimelineTracks.d.ts +0 -1
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -3
- package/dist/components/Timeline/Timeline.js +19 -11
- package/dist/components/Timeline/TimelineAssetDropIndicator.d.ts +2 -0
- package/dist/components/Timeline/TimelineAssetDropIndicator.js +37 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +1 -7
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineScrollable.js +3 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
- package/dist/components/Timeline/TimelineSelection.js +41 -6
- package/dist/components/Timeline/TimelineSequence.js +26 -14
- package/dist/components/Timeline/TimelineSequenceFrame.js +2 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +7 -5
- package/dist/components/Timeline/TimelineSequencePropItem.js +4 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +135 -19
- package/dist/components/Timeline/TimelineTimeIndicators.d.ts +16 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +154 -35
- package/dist/components/Timeline/TimelineTranslateField.js +2 -1
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +4 -1
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +17 -0
- package/dist/components/Timeline/call-update-keyframe-settings.js +43 -1
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +5 -4
- package/dist/components/Timeline/disable-sequence-interactivity.js +2 -0
- package/dist/components/Timeline/get-timeline-media-visualization-layout.d.ts +8 -0
- package/dist/components/Timeline/get-timeline-media-visualization-layout.js +10 -0
- package/dist/components/Timeline/get-timeline-video-info-widths.js +11 -3
- package/dist/components/Timeline/keyframe-clipboard.js +21 -5
- package/dist/components/Timeline/reset-selected-timeline-props.js +2 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +5 -3
- package/dist/components/Timeline/save-sequence-prop.js +43 -18
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +2 -0
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +1 -1
- package/dist/components/Timeline/timeline-asset-drop-context.d.ts +1 -0
- package/dist/components/Timeline/timeline-asset-drop-context.js +5 -0
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +10 -1
- package/dist/components/Timeline/update-selected-easing.js +26 -23
- package/dist/components/Timeline/use-rename-sequence.js +2 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +5 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +18 -9
- package/dist/components/Timeline/use-timeline-asset-drop.d.ts +1 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +168 -0
- package/dist/components/composition-menu-items.d.ts +15 -1
- package/dist/components/composition-menu-items.js +137 -107
- package/dist/components/drop-handler-data.d.ts +13 -0
- package/dist/components/drop-handler-data.js +117 -0
- package/dist/components/handle-drop.d.ts +13 -0
- package/dist/components/handle-drop.js +115 -0
- package/dist/components/import-assets.d.ts +26 -8
- package/dist/components/import-assets.js +161 -49
- package/dist/components/selected-outline-drag.d.ts +11 -1
- package/dist/components/selected-outline-drag.js +74 -1
- package/dist/esm/{chunk-0v4n7nkh.js → chunk-7a6q9hk2.js} +5271 -4259
- package/dist/esm/index.mjs +0 -19
- package/dist/esm/internals.mjs +5271 -4259
- package/dist/esm/previewEntry.mjs +5475 -4463
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/interactivity-enabled.d.ts +1 -1
- package/dist/helpers/interactivity-enabled.js +2 -2
- package/dist/helpers/is-video-with-last-frame-hold.d.ts +2 -0
- package/dist/helpers/is-video-with-last-frame-hold.js +9 -0
- package/dist/helpers/retry-payload.js +0 -1
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +5 -1
- package/dist/helpers/use-max-media-duration.js +5 -3
- package/dist/helpers/use-menu-structure.js +11 -3
- package/dist/icons/duplicate.d.ts +5 -0
- package/dist/icons/duplicate.js +10 -0
- package/dist/icons/snowflake.d.ts +5 -0
- package/dist/icons/snowflake.js +10 -0
- package/dist/icons/trash.d.ts +5 -0
- package/dist/icons/trash.js +8 -0
- package/dist/state/modals.d.ts +3 -1
- package/dist/visual-controls/VisualControls.js +1 -1
- package/package.json +11 -11
- package/dist/components/RenderModal/WebRenderModalLicense.d.ts +0 -9
- package/dist/components/RenderModal/WebRenderModalLicense.js +0 -189
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.d.ts +0 -13
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.js +0 -60
|
@@ -4,9 +4,15 @@ exports.ConnectedCompositionsSection = exports.useConnectedCompositions = void 0
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
7
8
|
const get_connected_compositions_1 = require("../../helpers/get-connected-compositions");
|
|
9
|
+
const noop_1 = require("../../helpers/noop");
|
|
10
|
+
const modals_1 = require("../../state/modals");
|
|
11
|
+
const composition_menu_items_1 = require("../composition-menu-items");
|
|
8
12
|
const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
|
|
13
|
+
const ContextMenu_1 = require("../ContextMenu");
|
|
9
14
|
const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
|
|
15
|
+
const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
|
|
10
16
|
const common_1 = require("./common");
|
|
11
17
|
const compositionIconStyle = {
|
|
12
18
|
height: 18,
|
|
@@ -17,6 +23,9 @@ const compositionListStyle = {
|
|
|
17
23
|
flexDirection: 'column',
|
|
18
24
|
padding: '6px 0',
|
|
19
25
|
};
|
|
26
|
+
const compositionContextMenuStyle = {
|
|
27
|
+
width: '100%',
|
|
28
|
+
};
|
|
20
29
|
const useConnectedCompositions = ({ track, }) => {
|
|
21
30
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
22
31
|
return (0, react_1.useMemo)(() => (0, get_connected_compositions_1.getConnectedCompositions)({
|
|
@@ -26,7 +35,23 @@ const useConnectedCompositions = ({ track, }) => {
|
|
|
26
35
|
};
|
|
27
36
|
exports.useConnectedCompositions = useConnectedCompositions;
|
|
28
37
|
const ConnectedCompositionsSection = ({ connectedCompositions }) => {
|
|
29
|
-
|
|
30
|
-
return (jsx_runtime_1.jsx("div", { style: compositionListStyle, children: connectedCompositions.map((composition) => (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }, composition.id))) }));
|
|
38
|
+
return (jsx_runtime_1.jsx("div", { style: compositionListStyle, children: connectedCompositions.map((composition) => (jsx_runtime_1.jsx(ConnectedCompositionRow, { composition: composition }, composition.id))) }));
|
|
31
39
|
};
|
|
32
40
|
exports.ConnectedCompositionsSection = ConnectedCompositionsSection;
|
|
41
|
+
const ConnectedCompositionRow = ({ composition }) => {
|
|
42
|
+
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
43
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
44
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
45
|
+
.previewServerState.type;
|
|
46
|
+
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(composition.stack);
|
|
47
|
+
const contextMenuItems = (0, react_1.useMemo)(() => (0, composition_menu_items_1.getCompositionContextMenuItems)({
|
|
48
|
+
closeMenu: noop_1.noop,
|
|
49
|
+
composition,
|
|
50
|
+
connectionStatus,
|
|
51
|
+
includeCompositionManagementItems: false,
|
|
52
|
+
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
53
|
+
resolvedLocation,
|
|
54
|
+
setSelectedModal,
|
|
55
|
+
}), [composition, connectionStatus, resolvedLocation, setSelectedModal]);
|
|
56
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuItems, onOpen: null, style: compositionContextMenuStyle, children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }) }));
|
|
57
|
+
};
|
|
@@ -5,21 +5,35 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
9
|
+
const duplicate_1 = require("../../icons/duplicate");
|
|
8
10
|
const scissors_1 = require("../../icons/scissors");
|
|
11
|
+
const snowflake_1 = require("../../icons/snowflake");
|
|
12
|
+
const trash_1 = require("../../icons/trash");
|
|
13
|
+
const ConfirmationDialog_1 = require("../ConfirmationDialog");
|
|
9
14
|
const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
10
15
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
16
|
+
const delete_selected_timeline_item_1 = require("../Timeline/delete-selected-timeline-item");
|
|
17
|
+
const duplicate_selected_timeline_item_1 = require("../Timeline/duplicate-selected-timeline-item");
|
|
11
18
|
const split_selected_timeline_item_1 = require("../Timeline/split-selected-timeline-item");
|
|
12
19
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
20
|
+
const use_sequence_freeze_frame_menu_item_1 = require("../Timeline/use-sequence-freeze-frame-menu-item");
|
|
13
21
|
const AlignmentControls_1 = require("./AlignmentControls");
|
|
14
22
|
const common_1 = require("./common");
|
|
15
23
|
const ConnectedCompositionsSection_1 = require("./ConnectedCompositionsSection");
|
|
16
24
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
17
25
|
const styles_1 = require("./styles");
|
|
18
26
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
19
|
-
const
|
|
27
|
+
const actionIconStyle = {
|
|
28
|
+
display: 'block',
|
|
20
29
|
height: 16,
|
|
21
30
|
width: 16,
|
|
22
31
|
};
|
|
32
|
+
const largeActionIconStyle = {
|
|
33
|
+
...actionIconStyle,
|
|
34
|
+
height: 20,
|
|
35
|
+
width: 20,
|
|
36
|
+
};
|
|
23
37
|
const SplitSequenceAction = ({ selection, track }) => {
|
|
24
38
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
25
39
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
@@ -30,19 +44,60 @@ const SplitSequenceAction = ({ selection, track }) => {
|
|
|
30
44
|
splitFrame: timelinePosition,
|
|
31
45
|
propStatuses: sequencePropStatuses,
|
|
32
46
|
}), [selection, sequencePropStatuses, timelinePosition, track.sequence]);
|
|
47
|
+
const canSplit = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
|
|
48
|
+
sequencePropStatuses !== undefined &&
|
|
49
|
+
eligibility.canSplit;
|
|
33
50
|
const onSplit = (0, react_1.useCallback)(() => {
|
|
34
|
-
if (!eligibility.canSplit) {
|
|
51
|
+
if (!canSplit || !eligibility.canSplit) {
|
|
35
52
|
return;
|
|
36
53
|
}
|
|
37
54
|
(0, split_selected_timeline_item_1.splitTimelineSequenceFromSource)({
|
|
38
55
|
nodePathInfo: eligibility.nodePathInfo,
|
|
39
56
|
splitFrame: timelinePosition,
|
|
40
57
|
}).catch(() => undefined);
|
|
41
|
-
}, [eligibility, timelinePosition]);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
}, [canSplit, eligibility, timelinePosition]);
|
|
59
|
+
const disabledReason = !(0, interactivity_enabled_1.isStudioInteractivityEnabled)()
|
|
60
|
+
? 'Studio is read-only'
|
|
61
|
+
: sequencePropStatuses === undefined
|
|
62
|
+
? 'Waiting for sequence prop status'
|
|
63
|
+
: eligibility.canSplit
|
|
64
|
+
? undefined
|
|
65
|
+
: eligibility.reason;
|
|
66
|
+
return (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canSplit, onClick: onSplit, title: disabledReason, renderIcon: (color) => (jsx_runtime_1.jsx(scissors_1.ScissorsIcon, { style: actionIconStyle, color: color })), children: "Split clip" }));
|
|
67
|
+
};
|
|
68
|
+
const SequenceSourceActions = ({ selection, track, validatedSource }) => {
|
|
69
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
70
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
71
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
72
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
73
|
+
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
74
|
+
const propStatusesForOverride = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection.nodePathInfo.sequenceSubscriptionKey]);
|
|
75
|
+
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.useSequenceFreezeFrameMenuItem)({
|
|
76
|
+
clientId: previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)()
|
|
77
|
+
? previewServerState.clientId
|
|
78
|
+
: null,
|
|
79
|
+
nodePath: selection.nodePathInfo.sequenceSubscriptionKey,
|
|
80
|
+
propStatusesForOverride,
|
|
81
|
+
sequence: track.sequence,
|
|
82
|
+
sequenceFrameOffset: track.sequenceFrameOffset,
|
|
83
|
+
setPropStatuses,
|
|
84
|
+
timelinePosition,
|
|
85
|
+
validatedSource,
|
|
86
|
+
});
|
|
87
|
+
const sourceActionsDisabled = previewServerState.type !== 'connected' || !(0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
88
|
+
const onDuplicate = (0, react_1.useCallback)(() => {
|
|
89
|
+
if (sourceActionsDisabled) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
(0, duplicate_selected_timeline_item_1.duplicateSequencesFromSource)([selection.nodePathInfo], confirm).catch(() => undefined);
|
|
93
|
+
}, [confirm, selection.nodePathInfo, sourceActionsDisabled]);
|
|
94
|
+
const onDelete = (0, react_1.useCallback)(() => {
|
|
95
|
+
if (sourceActionsDisabled) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
(0, delete_selected_timeline_item_1.deleteSequencesFromSource)([selection.nodePathInfo], confirm).catch(() => undefined);
|
|
99
|
+
}, [confirm, selection.nodePathInfo, sourceActionsDisabled]);
|
|
100
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [(freezeFrameMenuItem === null || freezeFrameMenuItem === void 0 ? void 0 : freezeFrameMenuItem.type) === 'item' ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: Boolean(freezeFrameMenuItem.disabled), onClick: () => freezeFrameMenuItem.onClick(freezeFrameMenuItem.id, null), renderIcon: (color) => (jsx_runtime_1.jsx(snowflake_1.SnowflakeIcon, { style: largeActionIconStyle, color: color })), children: freezeFrameMenuItem.label })) : null, jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: sourceActionsDisabled, onClick: onDuplicate, renderIcon: (color) => (jsx_runtime_1.jsx(duplicate_1.DuplicateIcon, { style: largeActionIconStyle, color: color })), children: "Duplicate" }), jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: sourceActionsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { style: actionIconStyle, color: color })), children: "Delete" })] }));
|
|
46
101
|
};
|
|
47
102
|
const SequenceExpandedInspector = ({ track }) => {
|
|
48
103
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -88,7 +143,9 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
88
143
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
89
144
|
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
90
145
|
jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
|
|
91
|
-
] })) : null, jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.
|
|
146
|
+
] })) : null, jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [
|
|
147
|
+
jsx_runtime_1.jsx(SplitSequenceAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
|
|
148
|
+
] })
|
|
92
149
|
] }));
|
|
93
150
|
};
|
|
94
151
|
const SequenceSelectionInspector = ({ selection }) => {
|
|
@@ -18,7 +18,7 @@ const useCompositionActions = () => {
|
|
|
18
18
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
19
19
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
20
20
|
const previewConnected = previewServerState.type === 'connected';
|
|
21
|
-
const previewInteractive = previewConnected && interactivity_enabled_1.
|
|
21
|
+
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
22
22
|
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
23
23
|
const currentComposition = (0, react_1.useMemo)(() => {
|
|
24
24
|
var _a;
|
|
@@ -57,6 +57,7 @@ const useCompositionActions = () => {
|
|
|
57
57
|
const result = await (0, call_api_1.callApi)('/api/insert-jsx-element', {
|
|
58
58
|
compositionFile,
|
|
59
59
|
compositionId: currentCompositionId,
|
|
60
|
+
from: null,
|
|
60
61
|
element: {
|
|
61
62
|
type: 'solid',
|
|
62
63
|
width: videoConfig.width,
|
|
@@ -80,7 +81,8 @@ const useCompositionActions = () => {
|
|
|
80
81
|
const insertAsset = (0, react_1.useCallback)(async () => {
|
|
81
82
|
if (!canInsertAsset ||
|
|
82
83
|
currentCompositionId === null ||
|
|
83
|
-
compositionFile === null
|
|
84
|
+
compositionFile === null ||
|
|
85
|
+
videoConfig === null) {
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
88
|
const files = await (0, import_assets_1.pickFilesToImport)();
|
|
@@ -91,17 +93,19 @@ const useCompositionActions = () => {
|
|
|
91
93
|
try {
|
|
92
94
|
await (0, import_assets_1.importAssets)({
|
|
93
95
|
files,
|
|
96
|
+
fps: videoConfig.fps,
|
|
94
97
|
compositionFile,
|
|
95
98
|
compositionId: currentCompositionId,
|
|
96
99
|
destinationDimensions: null,
|
|
97
100
|
dropPosition: null,
|
|
101
|
+
from: null,
|
|
98
102
|
svgImportMode: 'image',
|
|
99
103
|
});
|
|
100
104
|
}
|
|
101
105
|
finally {
|
|
102
106
|
setIsAddingAsset(false);
|
|
103
107
|
}
|
|
104
|
-
}, [canInsertAsset, compositionFile, currentCompositionId]);
|
|
108
|
+
}, [canInsertAsset, compositionFile, currentCompositionId, videoConfig]);
|
|
105
109
|
return {
|
|
106
110
|
canInsertAsset,
|
|
107
111
|
canInsertSolid,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type LicenseKeyDetails = {
|
|
3
|
+
readonly isValid: boolean;
|
|
4
|
+
readonly hasActiveSubscription: boolean | null;
|
|
5
|
+
readonly projectName: string;
|
|
6
|
+
readonly projectSlug: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const hasActiveCompanyLicense: (details: LicenseKeyDetails) => boolean;
|
|
9
|
+
export type LicenseKeyValidationResult = {
|
|
10
|
+
readonly valid: boolean;
|
|
11
|
+
readonly message: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const validateLicenseKey: (key: string) => LicenseKeyValidationResult;
|
|
14
|
+
export declare const fetchLicenseKeyDetails: (licenseKey: string) => Promise<LicenseKeyDetails>;
|
|
15
|
+
export declare const LicenseKeyDetailsDisplay: React.FC<{
|
|
16
|
+
readonly details: LicenseKeyDetails;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LicenseKeyDetailsDisplay = exports.fetchLicenseKeyDetails = exports.validateLicenseKey = exports.hasActiveCompanyLicense = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const check_circle_filled_1 = require("../icons/check-circle-filled");
|
|
7
|
+
const common_1 = require("./InspectorPanel/common");
|
|
8
|
+
const LICENSE_KEY_LENGTH = 55;
|
|
9
|
+
const LICENSE_KEY_PREFIX = 'rm_pub_';
|
|
10
|
+
const PRO_HOST = 'https://www.remotion.pro';
|
|
11
|
+
const hasActiveCompanyLicense = (details) => {
|
|
12
|
+
return details.hasActiveSubscription === true;
|
|
13
|
+
};
|
|
14
|
+
exports.hasActiveCompanyLicense = hasActiveCompanyLicense;
|
|
15
|
+
const validateLicenseKey = (key) => {
|
|
16
|
+
if (key.length === 0) {
|
|
17
|
+
return { valid: false, message: null };
|
|
18
|
+
}
|
|
19
|
+
if (!key.startsWith(LICENSE_KEY_PREFIX)) {
|
|
20
|
+
return {
|
|
21
|
+
valid: false,
|
|
22
|
+
message: `License key must start with "${LICENSE_KEY_PREFIX}"`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const afterPrefix = key.slice(LICENSE_KEY_PREFIX.length);
|
|
26
|
+
if (!/^[a-zA-Z0-9]*$/.test(afterPrefix)) {
|
|
27
|
+
return {
|
|
28
|
+
valid: false,
|
|
29
|
+
message: 'License key must contain only alphanumeric characters after the prefix',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (key.length !== LICENSE_KEY_LENGTH) {
|
|
33
|
+
return {
|
|
34
|
+
valid: false,
|
|
35
|
+
message: `License key must be ${LICENSE_KEY_LENGTH} characters long`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return { valid: true, message: null };
|
|
39
|
+
};
|
|
40
|
+
exports.validateLicenseKey = validateLicenseKey;
|
|
41
|
+
const fetchLicenseKeyDetails = async (licenseKey) => {
|
|
42
|
+
const response = await fetch(`${PRO_HOST}/api/validate-license-key`, {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
body: JSON.stringify({
|
|
45
|
+
licenseKey,
|
|
46
|
+
}),
|
|
47
|
+
headers: {
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
return response.json();
|
|
52
|
+
};
|
|
53
|
+
exports.fetchLicenseKeyDetails = fetchLicenseKeyDetails;
|
|
54
|
+
const actionStyle = {
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
marginLeft: 0,
|
|
57
|
+
marginRight: 0,
|
|
58
|
+
width: '100%',
|
|
59
|
+
};
|
|
60
|
+
const actionContent = {
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
color: 'inherit',
|
|
63
|
+
display: 'flex',
|
|
64
|
+
fontFamily: 'sans-serif',
|
|
65
|
+
fontSize: 13,
|
|
66
|
+
gap: 8,
|
|
67
|
+
lineHeight: '18px',
|
|
68
|
+
minWidth: 0,
|
|
69
|
+
width: '100%',
|
|
70
|
+
};
|
|
71
|
+
const actionText = {
|
|
72
|
+
color: 'inherit',
|
|
73
|
+
flex: 1,
|
|
74
|
+
fontFamily: 'sans-serif',
|
|
75
|
+
fontSize: 13,
|
|
76
|
+
lineHeight: '18px',
|
|
77
|
+
minWidth: 0,
|
|
78
|
+
overflow: 'hidden',
|
|
79
|
+
textOverflow: 'ellipsis',
|
|
80
|
+
whiteSpace: 'nowrap',
|
|
81
|
+
};
|
|
82
|
+
const actionLabel = {
|
|
83
|
+
color: 'inherit',
|
|
84
|
+
flexShrink: 0,
|
|
85
|
+
fontFamily: 'sans-serif',
|
|
86
|
+
fontSize: 13,
|
|
87
|
+
lineHeight: '18px',
|
|
88
|
+
};
|
|
89
|
+
const inactiveLicenseText = {
|
|
90
|
+
...actionText,
|
|
91
|
+
color: colors_1.FAIL_COLOR,
|
|
92
|
+
};
|
|
93
|
+
const iconStyle = {
|
|
94
|
+
width: 14,
|
|
95
|
+
height: 14,
|
|
96
|
+
flexShrink: 0,
|
|
97
|
+
};
|
|
98
|
+
const ErrorIcon = () => {
|
|
99
|
+
return (jsx_runtime_1.jsx("svg", { style: iconStyle, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.FAIL_COLOR, d: "M0 160V352L160 512H352L512 352V160L352 0H160L0 160zm353.9 32l-17 17-47 47 47 47 17 17L320 353.9l-17-17-47-47-47 47-17 17L158.1 320l17-17 47-47-47-47-17-17L192 158.1l17 17 47 47 47-47 17-17L353.9 192z" }) }));
|
|
100
|
+
};
|
|
101
|
+
const LicenseKeyDetailsDisplay = ({ details }) => {
|
|
102
|
+
const projectUrl = `${PRO_HOST}/projects/${details.projectSlug}`;
|
|
103
|
+
const usageUrl = `${projectUrl}/usage#client-renders-usage`;
|
|
104
|
+
const hasActiveLicense = (0, exports.hasActiveCompanyLicense)(details);
|
|
105
|
+
return (jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => window.open(usageUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })), style: actionStyle, title: "View license usage", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
|
|
106
|
+
jsx_runtime_1.jsxs("span", { style: actionText, children: ["Belongs to ", details.projectName] }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "View usage" })
|
|
107
|
+
] }) }), jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => window.open(projectUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => hasActiveLicense ? (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })) : (jsx_runtime_1.jsx(ErrorIcon, {})), style: actionStyle, title: "Manage Company License", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
|
|
108
|
+
jsx_runtime_1.jsx("span", { style: hasActiveLicense ? actionText : inactiveLicenseText, children: hasActiveLicense
|
|
109
|
+
? 'Active Company License'
|
|
110
|
+
: 'No active Company License' }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "Manage" })
|
|
111
|
+
] }) })] }));
|
|
112
|
+
};
|
|
113
|
+
exports.LicenseKeyDetailsDisplay = LicenseKeyDetailsDisplay;
|
|
@@ -10,6 +10,7 @@ const client_id_1 = require("../helpers/client-id");
|
|
|
10
10
|
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
11
11
|
const modals_1 = require("../state/modals");
|
|
12
12
|
const AskAiModal_1 = require("./AskAiModal");
|
|
13
|
+
const ConfigureLicenseModal_1 = require("./ConfigureLicenseModal");
|
|
13
14
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
14
15
|
const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
15
16
|
const InstallPackage_1 = require("./InstallPackage");
|
|
@@ -33,7 +34,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
33
34
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
34
35
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
35
36
|
'connected';
|
|
36
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
37
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'configure-license' && (jsx_runtime_1.jsx(ConfigureLicenseModal_1.ConfigureLicenseModal, { initialPublicLicenseKey: modalContextType.initialPublicLicenseKey })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
37
38
|
modalContextType.type === 'server-render' &&
|
|
38
39
|
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
39
40
|
};
|
|
@@ -8,7 +8,7 @@ export declare const CodemodFooter: React.FC<{
|
|
|
8
8
|
readonly valid: boolean;
|
|
9
9
|
readonly codemod: RecastCodemod;
|
|
10
10
|
readonly stack: string | null;
|
|
11
|
-
readonly loadingNotification: React.ReactNode;
|
|
11
|
+
readonly loadingNotification: React.ReactNode | null;
|
|
12
12
|
readonly successNotification: React.ReactNode;
|
|
13
13
|
readonly errorNotification: string;
|
|
14
14
|
readonly genericSubmitLabel: string;
|
|
@@ -34,21 +34,40 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
34
34
|
const trigger = (0, react_1.useCallback)(() => {
|
|
35
35
|
setSubmitting(true);
|
|
36
36
|
setSelectedModal(null);
|
|
37
|
-
const notification =
|
|
37
|
+
const notification = loadingNotification === null
|
|
38
|
+
? null
|
|
39
|
+
: (0, NotificationCenter_1.showNotification)(loadingNotification, null);
|
|
38
40
|
applyCodemod({
|
|
39
41
|
symbolicatedStack,
|
|
40
42
|
signal: new AbortController().signal,
|
|
41
43
|
})
|
|
42
44
|
.then((result) => {
|
|
43
45
|
if (!result.success) {
|
|
44
|
-
|
|
46
|
+
const message = `${errorNotification}: ${result.reason}`;
|
|
47
|
+
if (notification) {
|
|
48
|
+
notification.replaceContent(message, 2000);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
(0, NotificationCenter_1.showNotification)(message, 2000);
|
|
52
|
+
}
|
|
45
53
|
return;
|
|
46
54
|
}
|
|
47
|
-
notification
|
|
55
|
+
if (notification) {
|
|
56
|
+
notification.replaceContent(successNotification, 2000);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
(0, NotificationCenter_1.showNotification)(successNotification, 2000);
|
|
60
|
+
}
|
|
48
61
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
49
62
|
})
|
|
50
63
|
.catch((err) => {
|
|
51
|
-
|
|
64
|
+
const message = `${errorNotification}: ${err.message}`;
|
|
65
|
+
if (notification) {
|
|
66
|
+
notification.replaceContent(message, 2000);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
(0, NotificationCenter_1.showNotification)(message, 2000);
|
|
70
|
+
}
|
|
52
71
|
});
|
|
53
72
|
}, [
|
|
54
73
|
applyCodemod,
|
|
@@ -16,6 +16,11 @@ export declare const isInputDraggerValueInRange: ({ max, min, value, }: {
|
|
|
16
16
|
readonly min: string | number | undefined;
|
|
17
17
|
readonly value: number;
|
|
18
18
|
}) => boolean;
|
|
19
|
+
export declare const deriveInputDraggerValueDiff: ({ dragSensitivity, step, xDistance, }: {
|
|
20
|
+
readonly dragSensitivity: number;
|
|
21
|
+
readonly step: number;
|
|
22
|
+
readonly xDistance: number;
|
|
23
|
+
}) => number;
|
|
19
24
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
20
25
|
readonly onValueChange: (newVal: number) => void;
|
|
21
26
|
readonly onValueChangeEnd?: ((newVal: number) => void) | undefined;
|
|
@@ -26,4 +31,5 @@ export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttr
|
|
|
26
31
|
readonly small?: boolean | undefined;
|
|
27
32
|
readonly snapToStep?: boolean | undefined;
|
|
28
33
|
readonly dragDecimalPlaces?: number | undefined;
|
|
34
|
+
readonly dragSensitivity?: number | undefined;
|
|
29
35
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputDragger = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.inputDraggerContainerStyle = void 0;
|
|
36
|
+
exports.InputDragger = exports.deriveInputDraggerValueDiff = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.inputDraggerContainerStyle = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -92,7 +92,11 @@ const isInputDraggerValueInRange = ({ max, min, value, }) => {
|
|
|
92
92
|
(!Number.isFinite(numericMax) || value <= numericMax));
|
|
93
93
|
};
|
|
94
94
|
exports.isInputDraggerValueInRange = isInputDraggerValueInRange;
|
|
95
|
-
const
|
|
95
|
+
const deriveInputDraggerValueDiff = ({ dragSensitivity, step, xDistance, }) => {
|
|
96
|
+
return (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step * dragSensitivity, 0, 0, 0, step * dragSensitivity]);
|
|
97
|
+
};
|
|
98
|
+
exports.deriveInputDraggerValueDiff = deriveInputDraggerValueDiff;
|
|
99
|
+
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, dragSensitivity = 1, ...props }, ref) => {
|
|
96
100
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
97
101
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
98
102
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
@@ -195,7 +199,11 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
195
199
|
(0, ForceSpecificCursor_1.forceSpecificCursor)('ew-resize');
|
|
196
200
|
target.blur();
|
|
197
201
|
}
|
|
198
|
-
const diff = (0,
|
|
202
|
+
const diff = (0, exports.deriveInputDraggerValueDiff)({
|
|
203
|
+
dragSensitivity,
|
|
204
|
+
step,
|
|
205
|
+
xDistance,
|
|
206
|
+
});
|
|
199
207
|
const newValue = Math.min(max, Math.max(min, dragStartValue + diff));
|
|
200
208
|
const nextValue = snapToStep
|
|
201
209
|
? roundToStep(newValue, step)
|
|
@@ -229,6 +237,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
229
237
|
onValueChangeEnd,
|
|
230
238
|
snapToStep,
|
|
231
239
|
dragDecimalPlaces,
|
|
240
|
+
dragSensitivity,
|
|
232
241
|
]);
|
|
233
242
|
(0, react_1.useEffect)(() => {
|
|
234
243
|
var _a;
|
|
@@ -125,7 +125,7 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
125
125
|
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
126
126
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
|
|
127
127
|
] })
|
|
128
|
-
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification:
|
|
128
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createComposition({
|
|
129
129
|
signal,
|
|
130
130
|
symbolicatedStack,
|
|
131
131
|
}), fallbackToRootFile: true }) })
|
|
@@ -76,7 +76,7 @@ const useRenameStaticFile = ({ relativePath, staticFiles, }) => {
|
|
|
76
76
|
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' &&
|
|
77
77
|
canvasContent.asset === relativePath) {
|
|
78
78
|
setCanvasContent({ type: 'asset', asset: newRelativePath });
|
|
79
|
-
(0, url_state_1.
|
|
79
|
+
(0, url_state_1.replaceUrl)(`/assets/${newRelativePath}`);
|
|
80
80
|
}
|
|
81
81
|
notification.replaceContent(`Renamed to ${newRelativePath}`, 2000);
|
|
82
82
|
return true;
|
|
@@ -281,7 +281,6 @@ const RenderButton = ({ readOnlyStudio, size: controlSize = 'default' }) => {
|
|
|
281
281
|
inFrameMark: inFrame,
|
|
282
282
|
outFrameMark: outFrame,
|
|
283
283
|
initialLogLevel: defaults.logLevel,
|
|
284
|
-
initialLicenseKey: defaults.publicLicenseKey,
|
|
285
284
|
initialStillImageFormat: defaults.stillImageFormat,
|
|
286
285
|
initialScale: defaults.scale,
|
|
287
286
|
initialDelayRenderTimeout: defaults.delayRenderTimeout,
|
|
@@ -32,7 +32,6 @@ const use_encodable_video_codecs_1 = require("./use-encodable-video-codecs");
|
|
|
32
32
|
const WebRenderModalAdvanced_1 = require("./WebRenderModalAdvanced");
|
|
33
33
|
const WebRenderModalAudio_1 = require("./WebRenderModalAudio");
|
|
34
34
|
const WebRenderModalBasic_1 = require("./WebRenderModalBasic");
|
|
35
|
-
const WebRenderModalLicense_1 = require("./WebRenderModalLicense");
|
|
36
35
|
const WebRenderModalPicture_1 = require("./WebRenderModalPicture");
|
|
37
36
|
const invalidCharacters = ['?', '*', '+', ':', '%'];
|
|
38
37
|
const isValidStillExtension = (extension, stillImageFormat) => {
|
|
@@ -80,7 +79,7 @@ const validateOutnameForStill = ({ outName, stillImageFormat, }) => {
|
|
|
80
79
|
// TODO: Shortcut: Shift + R
|
|
81
80
|
// TODO: Apply defaultCodec
|
|
82
81
|
// TODO: Apply defaultOutName
|
|
83
|
-
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel,
|
|
82
|
+
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, initialStillImageFormat, initialDefaultOutName, initialScale, initialDelayRenderTimeout, initialMediaCacheSizeInBytes, initialContainer, initialVideoCodec, initialAudioCodec, initialAudioBitrate, initialVideoBitrate, initialHardwareAcceleration, initialKeyframeIntervalInSeconds, initialTransparent, initialMuted, initialPageResponsiveness, }) => {
|
|
84
83
|
var _a;
|
|
85
84
|
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
86
85
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -89,6 +88,11 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
89
88
|
if (!context) {
|
|
90
89
|
throw new Error('Should not be able to render without resolving comp first');
|
|
91
90
|
}
|
|
91
|
+
const renderDefaults = window.remotion_renderDefaults;
|
|
92
|
+
if (!renderDefaults) {
|
|
93
|
+
throw new Error('Render defaults are not available');
|
|
94
|
+
}
|
|
95
|
+
const { publicLicenseKey } = renderDefaults;
|
|
92
96
|
const { resolved: { result: resolvedComposition }, unresolved: unresolvedComposition, } = context;
|
|
93
97
|
const [isVideo] = (0, react_1.useState)(() => {
|
|
94
98
|
return typeof resolvedComposition.durationInFrames === 'undefined'
|
|
@@ -123,7 +127,6 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
123
127
|
const [transparent, setTransparent] = (0, react_1.useState)(initialTransparent !== null && initialTransparent !== void 0 ? initialTransparent : false);
|
|
124
128
|
const [muted, setMuted] = (0, react_1.useState)(initialMuted !== null && initialMuted !== void 0 ? initialMuted : false);
|
|
125
129
|
const [scale, setScale] = (0, react_1.useState)(initialScale !== null && initialScale !== void 0 ? initialScale : 1);
|
|
126
|
-
const [licenseKey, setLicenseKey] = (0, react_1.useState)(initialLicenseKey);
|
|
127
130
|
const [pageResponsiveness, setPageResponsiveness] = (0, react_1.useState)(initialPageResponsiveness !== null && initialPageResponsiveness !== void 0 ? initialPageResponsiveness : 'medium');
|
|
128
131
|
const encodableAudioCodecs = (0, use_encodable_audio_codecs_1.useEncodableAudioCodecs)(container);
|
|
129
132
|
const encodableVideoCodecs = (0, use_encodable_video_codecs_1.useEncodableVideoCodecs)(container);
|
|
@@ -335,7 +338,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
335
338
|
delayRenderTimeout,
|
|
336
339
|
mediaCacheSizeInBytes,
|
|
337
340
|
logLevel,
|
|
338
|
-
licenseKey,
|
|
341
|
+
licenseKey: publicLicenseKey,
|
|
339
342
|
scale,
|
|
340
343
|
}, compositionRef);
|
|
341
344
|
}
|
|
@@ -361,7 +364,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
361
364
|
delayRenderTimeout,
|
|
362
365
|
mediaCacheSizeInBytes,
|
|
363
366
|
logLevel,
|
|
364
|
-
licenseKey,
|
|
367
|
+
licenseKey: publicLicenseKey,
|
|
365
368
|
scale,
|
|
366
369
|
pageResponsiveness,
|
|
367
370
|
}, compositionRef);
|
|
@@ -388,7 +391,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
388
391
|
delayRenderTimeout,
|
|
389
392
|
mediaCacheSizeInBytes,
|
|
390
393
|
logLevel,
|
|
391
|
-
|
|
394
|
+
publicLicenseKey,
|
|
392
395
|
container,
|
|
393
396
|
effectiveVideoCodec,
|
|
394
397
|
effectiveAudioCodec,
|
|
@@ -422,14 +425,17 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
422
425
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { style: render_modals_1.icon }) }),
|
|
423
426
|
"Audio"] })) : null, jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [
|
|
424
427
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { style: render_modals_1.icon }) }),
|
|
425
|
-
"Other"] }), jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected:
|
|
428
|
+
"Other"] }), jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
429
|
+
type: 'configure-license',
|
|
430
|
+
initialPublicLicenseKey: publicLicenseKey,
|
|
431
|
+
}), children: [
|
|
426
432
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { style: render_modals_1.icon }) }),
|
|
427
433
|
"License"] })
|
|
428
434
|
] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
429
435
|
canUpdate: false,
|
|
430
436
|
reason: 'render dialogue',
|
|
431
437
|
determined: false,
|
|
432
|
-
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) :
|
|
438
|
+
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) : null })
|
|
433
439
|
] })
|
|
434
440
|
] }));
|
|
435
441
|
};
|