@remotion/studio 4.0.525 → 4.0.526
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/focus-default-props-path.js +7 -1
- package/dist/api/restart-studio.d.ts +1 -1
- package/dist/api/restart-studio.js +1 -1
- package/dist/components/AgentPrompt.d.ts +6 -0
- package/dist/components/AgentPrompt.js +107 -0
- package/dist/components/AssetFileIcon.js +2 -0
- package/dist/components/AssetSelectorItem.d.ts +1 -23
- package/dist/components/AssetSelectorItem.js +10 -200
- package/dist/components/Canvas.js +21 -18
- package/dist/components/CaptionInspector.js +9 -3
- package/dist/{error-overlay/remotion-overlay → components}/CodeFrame.d.ts +2 -0
- package/dist/components/CodeFrame.js +77 -0
- package/dist/components/CompositionSelectorItem.js +6 -17
- package/dist/components/CurrentAsset.js +5 -4
- package/dist/components/ElementInstallConfirmation.js +69 -38
- package/dist/components/FilePreview.js +4 -0
- package/dist/components/FixComputedValueModal.js +64 -96
- package/dist/components/GenerateWithAgentModal.d.ts +9 -0
- package/dist/components/GenerateWithAgentModal.js +39 -0
- package/dist/components/InlineEditableTitle.js +2 -0
- package/dist/components/InspectorOpenInEditor.js +8 -4
- package/dist/components/InspectorPanel/CollapsibleInspectorSection.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSection.js +14 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +19 -8
- package/dist/components/InspectorPanel/CompositionInspector.js +30 -13
- package/dist/components/InspectorPanel/CompositionMetadata.js +3 -0
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +6 -12
- package/dist/components/InspectorPanel/ElementLibraryButton.js +1 -0
- package/dist/components/InspectorPanel/GuideInspector.js +2 -3
- package/dist/components/InspectorPanel/KeyframeSettings.js +5 -6
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -3
- package/dist/components/InspectorPanel/common.d.ts +4 -0
- package/dist/components/InspectorPanel/common.js +14 -2
- package/dist/components/InspectorPanel/styles.d.ts +0 -3
- package/dist/components/InspectorPanel/styles.js +1 -27
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +2 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +15 -0
- package/dist/components/InspectorPanel/use-inspector-section-expanded.d.ts +1 -0
- package/dist/components/InspectorPanel/use-inspector-section-expanded.js +21 -0
- package/dist/components/InspectorSequenceSection.js +44 -35
- package/dist/components/InspectorSourceLocation.js +1 -0
- package/dist/components/KeyboardShortcutsSettings.js +12 -4
- package/dist/components/LutPreview.d.ts +4 -0
- package/dist/components/LutPreview.js +192 -0
- package/dist/components/MenuCompositionName.js +4 -9
- package/dist/components/Modals.js +3 -6
- package/dist/components/ModelsSettings.js +15 -4
- package/dist/components/Notifications/NotificationCenter.d.ts +0 -1
- package/dist/components/Notifications/NotificationCenter.js +1 -22
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +4 -9
- package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.js +2 -1
- package/dist/components/RenderModal/WebRenderModal.js +10 -2
- package/dist/components/RendersTab.js +2 -0
- package/dist/components/SelectedOutlineElement.js +6 -0
- package/dist/components/SettingsButton.js +11 -2
- package/dist/components/SettingsModal.d.ts +1 -2
- package/dist/components/SettingsModal.js +24 -6
- package/dist/components/SettingsModalFooter.js +17 -3
- package/dist/components/SkillsSettings.d.ts +5 -0
- package/dist/components/SkillsSettings.js +29 -26
- package/dist/components/Timeline/Timeline.js +10 -11
- package/dist/components/Timeline/TimelineAssetField.js +81 -51
- package/dist/components/Timeline/TimelineHeightContainer.js +11 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +15 -1
- package/dist/components/Timeline/TimelineLayerChildren.d.ts +3 -3
- package/dist/components/Timeline/TimelineLayerChildren.js +11 -9
- package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +6 -3
- package/dist/components/Timeline/TimelineList.js +9 -3
- package/dist/components/Timeline/TimelineSchemaField.js +2 -6
- package/dist/components/Timeline/TimelineSelection.d.ts +14 -3
- package/dist/components/Timeline/TimelineSelection.js +91 -49
- package/dist/components/Timeline/TimelineSequence.js +2 -2
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +17 -13
- package/dist/components/Timeline/TimelineVirtualization.d.ts +3 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +130 -45
- package/dist/components/Timeline/normalize-font-weight-for-keyframe.d.ts +1 -0
- package/dist/components/Timeline/normalize-font-weight-for-keyframe.js +19 -0
- package/dist/components/Timeline/timeline-display-groups.d.ts +9 -0
- package/dist/components/Timeline/timeline-display-groups.js +66 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +21 -21
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +1 -2
- package/dist/components/UpdateStatusContext.d.ts +2 -2
- package/dist/components/UpdateStatusContext.js +6 -7
- package/dist/components/UpdatesSettings.js +6 -6
- package/dist/components/WebMcp.js +40 -41
- package/dist/components/asset-context-menu.d.ts +32 -0
- package/dist/components/asset-context-menu.js +242 -0
- package/dist/components/composition-menu-items.d.ts +4 -6
- package/dist/components/composition-menu-items.js +191 -75
- package/dist/components/get-open-in-menu-items.d.ts +6 -5
- package/dist/components/get-open-in-menu-items.js +15 -9
- package/dist/components/selected-outline-order.js +18 -12
- package/dist/components/use-open-in-menu-apps.d.ts +14 -0
- package/dist/components/use-open-in-menu-apps.js +33 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +3 -3
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +5 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +26 -19
- package/dist/esm/{LazyModels-gfmpcy4h.mjs → LazyModels-mtggyjye.mjs} +3 -3
- package/dist/esm/{LazyModels-m1rf06wh.mjs → LazyModels-nk7py0zt.mjs} +3 -3
- package/dist/esm/{TranscriptionModal-8pvrehg4.mjs → TranscriptionModal-ymnx1c7m.mjs} +6 -6
- package/dist/esm/{VideoMattingModal-fefbzgka.mjs → VideoMattingModal-05vpczks.mjs} +6 -6
- package/dist/esm/{index-s848rffx.mjs → index-0gewwxse.mjs} +5330 -4668
- package/dist/esm/{index-tzxb8808.mjs → index-4dsz9035.mjs} +8 -8
- package/dist/esm/{index-hbezgbbq.mjs → index-5bfxbpca.mjs} +1 -1
- package/dist/esm/{index-vsxrxfpj.mjs → index-5gd8k9yv.mjs} +1 -1
- package/dist/esm/{index-ggqpre9v.mjs → index-bs39wngg.mjs} +4216 -3571
- package/dist/esm/{index-0x13f28h.mjs → index-cdy8v54v.mjs} +1 -1
- package/dist/esm/{index-41kqns5c.mjs → index-eb5txqp6.mjs} +8 -7
- package/dist/esm/{index-1089795y.mjs → index-f97r9e2g.mjs} +4 -21
- package/dist/esm/{index-jrw61pkj.mjs → index-g7k2dvar.mjs} +1 -1
- package/dist/esm/{index-mww32xc8.mjs → index-x40wwfmt.mjs} +3 -3
- package/dist/esm/index.mjs +12 -6
- package/dist/esm/internals.mjs +7 -7
- package/dist/esm/previewEntry.mjs +7 -7
- package/dist/helpers/client-id.d.ts +1 -0
- package/dist/helpers/client-id.js +8 -4
- package/dist/helpers/cube-lut.d.ts +12 -0
- package/dist/helpers/cube-lut.js +160 -0
- package/dist/helpers/get-preview-file-type.d.ts +1 -1
- package/dist/helpers/get-preview-file-type.js +3 -0
- package/dist/helpers/open-in-editor.d.ts +5 -2
- package/dist/helpers/open-in-editor.js +12 -4
- package/dist/helpers/settings-tab-availability.d.ts +14 -0
- package/dist/helpers/settings-tab-availability.js +35 -0
- package/dist/helpers/use-menu-structure.js +16 -12
- package/dist/icons/lut.d.ts +4 -0
- package/dist/icons/lut.js +6 -0
- package/dist/icons/sparkles.d.ts +4 -0
- package/dist/icons/sparkles.js +6 -0
- package/dist/state/modals.d.ts +12 -2
- package/package.json +19 -19
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +0 -62
|
@@ -21,7 +21,6 @@ const InlineCaptionInspector_1 = require("./InlineCaptionInspector");
|
|
|
21
21
|
const CollapsibleInspectorSectionHeader_1 = require("./InspectorPanel/CollapsibleInspectorSectionHeader");
|
|
22
22
|
const common_1 = require("./InspectorPanel/common");
|
|
23
23
|
const inspector_section_collapse_1 = require("./InspectorPanel/inspector-section-collapse");
|
|
24
|
-
const styles_1 = require("./InspectorPanel/styles");
|
|
25
24
|
const border_radius_representation_1 = require("./Timeline/border-radius-representation");
|
|
26
25
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
27
26
|
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
@@ -51,10 +50,6 @@ const plusIcon = {
|
|
|
51
50
|
width: 15,
|
|
52
51
|
height: 15,
|
|
53
52
|
};
|
|
54
|
-
const effectsHeaderTitle = {
|
|
55
|
-
...styles_1.sectionHeaderTitle,
|
|
56
|
-
flexShrink: 1,
|
|
57
|
-
};
|
|
58
53
|
const borderRadiusToggleIcon = {
|
|
59
54
|
flexShrink: 0,
|
|
60
55
|
height: 15,
|
|
@@ -293,30 +288,57 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
293
288
|
return next;
|
|
294
289
|
});
|
|
295
290
|
}, []);
|
|
296
|
-
const
|
|
291
|
+
const isAdditionalSectionExpanded = (0, react_1.useCallback)((sectionId) => {
|
|
292
|
+
var _a;
|
|
293
|
+
const expansionKey = getInspectorSectionExpansionKey({
|
|
294
|
+
nodePathInfo,
|
|
295
|
+
sectionId,
|
|
296
|
+
});
|
|
297
|
+
return (_a = sectionExpansionOverrides[expansionKey]) !== null && _a !== void 0 ? _a : true;
|
|
298
|
+
}, [nodePathInfo, sectionExpansionOverrides]);
|
|
299
|
+
const setAdditionalSectionExpanded = (0, react_1.useCallback)((sectionId, expanded) => {
|
|
300
|
+
const expansionKey = getInspectorSectionExpansionKey({
|
|
301
|
+
nodePathInfo,
|
|
302
|
+
sectionId,
|
|
303
|
+
});
|
|
304
|
+
setSectionExpansionOverrides((previous) => {
|
|
305
|
+
if (previous[expansionKey] === expanded) {
|
|
306
|
+
return previous;
|
|
307
|
+
}
|
|
308
|
+
const next = { ...previous, [expansionKey]: expanded };
|
|
309
|
+
persistInspectorSectionExpansionOverrides(next);
|
|
310
|
+
return next;
|
|
311
|
+
});
|
|
312
|
+
}, [nodePathInfo]);
|
|
313
|
+
const toggleAdditionalSection = (0, react_1.useCallback)((sectionId) => {
|
|
314
|
+
setAdditionalSectionExpanded(sectionId, !isAdditionalSectionExpanded(sectionId));
|
|
315
|
+
}, [isAdditionalSectionExpanded, setAdditionalSectionExpanded]);
|
|
316
|
+
const effectsExpanded = isAdditionalSectionExpanded('effects');
|
|
317
|
+
const { controlRows, effectRows, hasEffects } = (0, react_1.useMemo)(() => {
|
|
297
318
|
const controlNodes = [];
|
|
298
|
-
let
|
|
319
|
+
let root = null;
|
|
299
320
|
for (const node of tree) {
|
|
300
321
|
if (isEffectsRoot(node)) {
|
|
301
|
-
|
|
322
|
+
root = node;
|
|
302
323
|
}
|
|
303
324
|
else {
|
|
304
325
|
controlNodes.push(node);
|
|
305
326
|
}
|
|
306
327
|
}
|
|
307
328
|
return {
|
|
329
|
+
hasEffects: root !== null && root.children.length > 0,
|
|
308
330
|
controlRows: (0, timeline_layout_1.flattenVisibleTreeNodes)({
|
|
309
331
|
nodes: controlNodes,
|
|
310
332
|
getIsExpanded,
|
|
311
333
|
}),
|
|
312
|
-
effectRows:
|
|
334
|
+
effectRows: root === null || !effectsExpanded
|
|
313
335
|
? []
|
|
314
336
|
: (0, timeline_layout_1.flattenVisibleTreeNodes)({
|
|
315
|
-
nodes:
|
|
337
|
+
nodes: root.children,
|
|
316
338
|
getIsExpanded,
|
|
317
339
|
}),
|
|
318
340
|
};
|
|
319
|
-
}, [getIsExpanded, tree]);
|
|
341
|
+
}, [effectsExpanded, getIsExpanded, tree]);
|
|
320
342
|
(0, react_1.useEffect)(() => {
|
|
321
343
|
if (selectedEffectKey === null ||
|
|
322
344
|
inspectorRevealToken === null ||
|
|
@@ -335,6 +357,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
335
357
|
if (targetIndex === -1) {
|
|
336
358
|
return;
|
|
337
359
|
}
|
|
360
|
+
setAdditionalSectionExpanded('effects', true);
|
|
338
361
|
const parentKeys = [];
|
|
339
362
|
let { depth } = rows[targetIndex];
|
|
340
363
|
for (let i = targetIndex - 1; i >= 0 && depth > 0; i--) {
|
|
@@ -354,7 +377,12 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
354
377
|
persistInspectorCollapsedKeys(next);
|
|
355
378
|
return next;
|
|
356
379
|
});
|
|
357
|
-
}, [
|
|
380
|
+
}, [
|
|
381
|
+
inspectorRevealToken,
|
|
382
|
+
selectedEffectKey,
|
|
383
|
+
setAdditionalSectionExpanded,
|
|
384
|
+
tree,
|
|
385
|
+
]);
|
|
358
386
|
(0, react_1.useEffect)(() => {
|
|
359
387
|
if (inspectorRevealToken === null) {
|
|
360
388
|
return;
|
|
@@ -459,26 +487,6 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
459
487
|
return next;
|
|
460
488
|
});
|
|
461
489
|
}, [isControlGroupExpanded, nodePathInfo]);
|
|
462
|
-
const isAdditionalSectionExpanded = (0, react_1.useCallback)((sectionId) => {
|
|
463
|
-
var _a;
|
|
464
|
-
const expansionKey = getInspectorSectionExpansionKey({
|
|
465
|
-
nodePathInfo,
|
|
466
|
-
sectionId,
|
|
467
|
-
});
|
|
468
|
-
return (_a = sectionExpansionOverrides[expansionKey]) !== null && _a !== void 0 ? _a : true;
|
|
469
|
-
}, [nodePathInfo, sectionExpansionOverrides]);
|
|
470
|
-
const toggleAdditionalSection = (0, react_1.useCallback)((sectionId) => {
|
|
471
|
-
const expansionKey = getInspectorSectionExpansionKey({
|
|
472
|
-
nodePathInfo,
|
|
473
|
-
sectionId,
|
|
474
|
-
});
|
|
475
|
-
const nextExpanded = !isAdditionalSectionExpanded(sectionId);
|
|
476
|
-
setSectionExpansionOverrides((previous) => {
|
|
477
|
-
const next = { ...previous, [expansionKey]: nextExpanded };
|
|
478
|
-
persistInspectorSectionExpansionOverrides(next);
|
|
479
|
-
return next;
|
|
480
|
-
});
|
|
481
|
-
}, [isAdditionalSectionExpanded, nodePathInfo]);
|
|
482
490
|
const captionsExpanded = isAdditionalSectionExpanded('captions');
|
|
483
491
|
const visibleControlRows = controlGroups.flatMap((group) => {
|
|
484
492
|
return isControlGroupExpanded(group) ? group.rows : [];
|
|
@@ -499,7 +507,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
499
507
|
? runtimeValues.captions
|
|
500
508
|
: []
|
|
501
509
|
: null;
|
|
502
|
-
const showEffectsSection = nodePathInfo.supportsEffects ||
|
|
510
|
+
const showEffectsSection = nodePathInfo.supportsEffects || hasEffects;
|
|
503
511
|
const canAddEffect = nodePathInfo.supportsEffects &&
|
|
504
512
|
previewServerState.type === 'connected' &&
|
|
505
513
|
(0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
|
|
@@ -508,6 +516,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
508
516
|
if (!canAddEffect || previewServerState.type !== 'connected') {
|
|
509
517
|
return;
|
|
510
518
|
}
|
|
519
|
+
setAdditionalSectionExpanded('effects', true);
|
|
511
520
|
setSelectedModal({
|
|
512
521
|
type: 'add-effect',
|
|
513
522
|
clientId: previewServerState.clientId,
|
|
@@ -518,6 +527,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
518
527
|
canAddEffect,
|
|
519
528
|
nodePathInfo.sequenceSubscriptionKey,
|
|
520
529
|
previewServerState,
|
|
530
|
+
setAdditionalSectionExpanded,
|
|
521
531
|
setSelectedModal,
|
|
522
532
|
validatedLocation.source,
|
|
523
533
|
]);
|
|
@@ -563,8 +573,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
563
573
|
: show3DTransformControls
|
|
564
574
|
? 'Hide 3D transform controls'
|
|
565
575
|
: 'Show 3D transform controls', hoveredColor: show3DTransformControls ? colors_1.BLUE : undefined, unhoveredColor: show3DTransformControls ? colors_1.BLUE : colors_1.LIGHT_TEXT, renderAction: (color) => (jsx_runtime_1.jsx(cube_1.CubeIcon, { color: color, style: transform3DToggleIcon })) }));
|
|
566
|
-
const effectsHeader = (jsx_runtime_1.
|
|
567
|
-
jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
|
|
576
|
+
const effectsHeader = (jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) }), expanded: effectsExpanded, label: "Effects", onToggle: hasEffects ? () => toggleAdditionalSection('effects') : null }));
|
|
568
577
|
const renderRow = ({ node, depth }) => {
|
|
569
578
|
return (jsx_runtime_1.jsx(TimelineRowLayoutContext_1.TimelineRowLayoutContext.Provider, { value: TimelineRowLayoutContext_1.INSPECTOR_TIMELINE_ROW_LAYOUT, children: jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }) }, JSON.stringify(node.nodePathInfo)));
|
|
570
579
|
};
|
|
@@ -37,7 +37,9 @@ exports.KeyboardShortcutsSettings = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
40
|
+
const client_id_1 = require("../helpers/client-id");
|
|
40
41
|
const colors_1 = require("../helpers/colors");
|
|
42
|
+
const settings_tab_availability_1 = require("../helpers/settings-tab-availability");
|
|
41
43
|
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
42
44
|
const caret_1 = require("../icons/caret");
|
|
43
45
|
const Checkbox_1 = require("./Checkbox");
|
|
@@ -158,6 +160,12 @@ const KeyboardShortcutsSettings = () => {
|
|
|
158
160
|
var _a;
|
|
159
161
|
const { error: settingsError, revision, studioRuntimeConfig } = (0, SettingsContext_1.useSettings)();
|
|
160
162
|
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
163
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
164
|
+
const canEdit = (0, settings_tab_availability_1.canEditStudioConfig)({
|
|
165
|
+
isBrowserStudio,
|
|
166
|
+
previewServerConnected: previewServerState.type === 'connected',
|
|
167
|
+
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
168
|
+
});
|
|
161
169
|
const [enabled, setEnabled] = (0, react_1.useState)(true);
|
|
162
170
|
const [configuredShortcuts, setConfiguredShortcuts] = (0, react_1.useState)({});
|
|
163
171
|
const [enabledEdited, setEnabledEdited] = (0, react_1.useState)(false);
|
|
@@ -212,7 +220,7 @@ const KeyboardShortcutsSettings = () => {
|
|
|
212
220
|
}, [configuredShortcuts, enabled, enabledEdited, shortcutsEdited]);
|
|
213
221
|
const ready = studioRuntimeConfig !== null && syncedRevision === revision;
|
|
214
222
|
(0, use_auto_save_config_1.useAutoSaveConfig)({
|
|
215
|
-
enabled: ready &&
|
|
223
|
+
enabled: ready && canEdit,
|
|
216
224
|
onError: setError,
|
|
217
225
|
ready,
|
|
218
226
|
syncRevision: syncedRevision,
|
|
@@ -221,11 +229,11 @@ const KeyboardShortcutsSettings = () => {
|
|
|
221
229
|
if (studioRuntimeConfig === null) {
|
|
222
230
|
return null;
|
|
223
231
|
}
|
|
224
|
-
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
232
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [canEdit ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
225
233
|
jsx_runtime_1.jsx("p", { style: dividerLabel, children: "General" }), jsx_runtime_1.jsxs("label", { style: layout_2.optionRow, children: [
|
|
226
234
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Keyboard shortcuts" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: enabled, name: "keyboard-shortcuts", onChange: onEnabledChange }) })
|
|
227
235
|
] })
|
|
228
|
-
] })), visibleShortcutGroups.map((group, groupIndex) => (jsx_runtime_1.jsxs("div", { children: [
|
|
236
|
+
] })) : null, visibleShortcutGroups.map((group, groupIndex) => (jsx_runtime_1.jsxs("div", { children: [
|
|
229
237
|
jsx_runtime_1.jsx("p", { style: shortcutSectionTitle, children: group.name }), jsx_runtime_1.jsx("div", { role: "list", "aria-label": group.name, children: group.shortcuts.map((shortcut, shortcutIndex) => {
|
|
230
238
|
var _a;
|
|
231
239
|
const configured = shortcut.actionId === null
|
|
@@ -306,7 +314,7 @@ const KeyboardShortcutsSettings = () => {
|
|
|
306
314
|
shortcutIndex === group.shortcuts.length - 1
|
|
307
315
|
? lastShortcutRow
|
|
308
316
|
: shortcutRow, children: [
|
|
309
|
-
jsx_runtime_1.jsx("span", { style: actionName, children: shortcut.action }), shortcut.actionId === null ||
|
|
317
|
+
jsx_runtime_1.jsx("span", { style: actionName, children: shortcut.action }), shortcut.actionId === null || !canEdit ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
310
318
|
jsx_runtime_1.jsx("span", { style: shortcutCell, children: jsx_runtime_1.jsx(ShortcutChords, { values: shortcutValues }) }), jsx_runtime_1.jsx("span", {})
|
|
311
319
|
] })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
312
320
|
jsx_runtime_1.jsx("span", { style: shortcutCell, children: jsx_runtime_1.jsx("button", { id: shortcutButtonId, type: "button", style: chordButton, "aria-label": `Change shortcut for ${shortcut.action}`, onClick: () => {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LutPreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const player_1 = require("@remotion/player");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const cube_lut_1 = require("../helpers/cube-lut");
|
|
9
|
+
const hoverable_1 = require("../helpers/hoverable");
|
|
10
|
+
const z_index_1 = require("../state/z-index");
|
|
11
|
+
const sampleImage = 'https://remotion.media/transition-bg-blue.jpg';
|
|
12
|
+
const previewWidth = 640;
|
|
13
|
+
const previewHeight = 427;
|
|
14
|
+
const container = {
|
|
15
|
+
padding: 24,
|
|
16
|
+
flex: 1,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
fontFamily: 'sans-serif',
|
|
21
|
+
fontSize: 13,
|
|
22
|
+
minHeight: 0,
|
|
23
|
+
};
|
|
24
|
+
const comparison = {
|
|
25
|
+
position: 'relative',
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
userSelect: 'none',
|
|
28
|
+
WebkitUserSelect: 'none',
|
|
29
|
+
};
|
|
30
|
+
const canvasStyle = {
|
|
31
|
+
display: 'block',
|
|
32
|
+
width: '100%',
|
|
33
|
+
height: 'auto',
|
|
34
|
+
borderRadius: 4,
|
|
35
|
+
userSelect: 'none',
|
|
36
|
+
WebkitUserSelect: 'none',
|
|
37
|
+
};
|
|
38
|
+
const sliderStyle = {
|
|
39
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
40
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
41
|
+
hoverBackground: colors_1.TRANSPARENT,
|
|
42
|
+
idleColor: colors_1.LIGHT_TEXT,
|
|
43
|
+
hoverColor: colors_1.WHITE,
|
|
44
|
+
}),
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
inset: 0,
|
|
47
|
+
borderRadius: 4,
|
|
48
|
+
cursor: 'default',
|
|
49
|
+
touchAction: 'none',
|
|
50
|
+
userSelect: 'none',
|
|
51
|
+
WebkitUserSelect: 'none',
|
|
52
|
+
};
|
|
53
|
+
const dividerStyle = {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
top: 0,
|
|
56
|
+
bottom: 0,
|
|
57
|
+
width: 2,
|
|
58
|
+
backgroundColor: colors_1.CURRENT_COLOR,
|
|
59
|
+
transform: 'translateX(-50%)',
|
|
60
|
+
pointerEvents: 'none',
|
|
61
|
+
};
|
|
62
|
+
const handleStyle = {
|
|
63
|
+
position: 'absolute',
|
|
64
|
+
top: '50%',
|
|
65
|
+
left: '50%',
|
|
66
|
+
transform: 'translate(-50%, -50%)',
|
|
67
|
+
width: 32,
|
|
68
|
+
height: 32,
|
|
69
|
+
borderRadius: '50%',
|
|
70
|
+
border: `2px solid ${colors_1.CURRENT_COLOR}`,
|
|
71
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
72
|
+
display: 'flex',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
};
|
|
76
|
+
const message = {
|
|
77
|
+
color: colors_1.LIGHT_TEXT,
|
|
78
|
+
textAlign: 'center',
|
|
79
|
+
overflowWrap: 'anywhere',
|
|
80
|
+
};
|
|
81
|
+
const LutPreview = ({ src }) => {
|
|
82
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
83
|
+
const beforeRef = (0, react_1.useRef)(null);
|
|
84
|
+
const afterRef = (0, react_1.useRef)(null);
|
|
85
|
+
const [state, setState] = (0, react_1.useState)({ type: 'loading' });
|
|
86
|
+
const [position, setPosition] = (0, react_1.useState)(50);
|
|
87
|
+
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
88
|
+
const size = player_1.PlayerInternals.useElementSize(containerRef, {
|
|
89
|
+
triggerOnWindowResize: true,
|
|
90
|
+
shouldApplyCssTransforms: true,
|
|
91
|
+
});
|
|
92
|
+
const updatePosition = (0, react_1.useCallback)((event) => {
|
|
93
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
94
|
+
setPosition(Math.max(0, Math.min(100, ((event.clientX - rect.left) / rect.width) * 100)));
|
|
95
|
+
}, []);
|
|
96
|
+
const onPointerDown = (0, react_1.useCallback)((event) => {
|
|
97
|
+
if (event.button !== 0 || !event.isPrimary) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
101
|
+
updatePosition(event);
|
|
102
|
+
}, [updatePosition]);
|
|
103
|
+
const onPointerMove = (0, react_1.useCallback)((event) => {
|
|
104
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
105
|
+
updatePosition(event);
|
|
106
|
+
}
|
|
107
|
+
}, [updatePosition]);
|
|
108
|
+
const onKeyDown = (0, react_1.useCallback)((event) => {
|
|
109
|
+
const step = event.shiftKey ? 10 : 1;
|
|
110
|
+
if (event.key === 'Home') {
|
|
111
|
+
setPosition(0);
|
|
112
|
+
}
|
|
113
|
+
else if (event.key === 'End') {
|
|
114
|
+
setPosition(100);
|
|
115
|
+
}
|
|
116
|
+
else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {
|
|
117
|
+
setPosition((value) => Math.max(0, value - step));
|
|
118
|
+
}
|
|
119
|
+
else if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {
|
|
120
|
+
setPosition((value) => Math.min(100, value + step));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
event.stopPropagation();
|
|
127
|
+
}, []);
|
|
128
|
+
(0, react_1.useEffect)(() => {
|
|
129
|
+
const controller = new AbortController();
|
|
130
|
+
const image = new Image();
|
|
131
|
+
image.crossOrigin = 'anonymous';
|
|
132
|
+
setState({ type: 'loading' });
|
|
133
|
+
const load = async () => {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
const response = await fetch(src, { signal: controller.signal });
|
|
136
|
+
if (!response.ok) {
|
|
137
|
+
throw new Error(`Could not load LUT (HTTP ${response.status}).`);
|
|
138
|
+
}
|
|
139
|
+
const lut = (0, cube_lut_1.parseCubeLut)(await response.text());
|
|
140
|
+
if (controller.signal.aborted) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
image.src = sampleImage;
|
|
144
|
+
try {
|
|
145
|
+
await image.decode();
|
|
146
|
+
}
|
|
147
|
+
catch (_c) {
|
|
148
|
+
throw new Error('Could not load the LUT sample image. Check your internet connection.');
|
|
149
|
+
}
|
|
150
|
+
if (controller.signal.aborted) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const before = (_a = beforeRef.current) === null || _a === void 0 ? void 0 : _a.getContext('2d');
|
|
154
|
+
const after = (_b = afterRef.current) === null || _b === void 0 ? void 0 : _b.getContext('2d');
|
|
155
|
+
if (!before || !after) {
|
|
156
|
+
throw new Error('Could not create the LUT preview canvas.');
|
|
157
|
+
}
|
|
158
|
+
before.drawImage(image, 0, 0, previewWidth, previewHeight);
|
|
159
|
+
const pixels = before.getImageData(0, 0, previewWidth, previewHeight);
|
|
160
|
+
(0, cube_lut_1.applyCubeLut)(pixels.data, lut);
|
|
161
|
+
after.putImageData(pixels, 0, 0);
|
|
162
|
+
setState({ type: 'loaded' });
|
|
163
|
+
};
|
|
164
|
+
load().catch((error) => {
|
|
165
|
+
if (!controller.signal.aborted) {
|
|
166
|
+
setState({
|
|
167
|
+
type: 'error',
|
|
168
|
+
error: error instanceof Error ? error.message : String(error),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
return () => {
|
|
173
|
+
controller.abort();
|
|
174
|
+
image.removeAttribute('src');
|
|
175
|
+
};
|
|
176
|
+
}, [src]);
|
|
177
|
+
return (jsx_runtime_1.jsxs("div", { ref: containerRef, style: container, children: [state.type === 'error' ? (jsx_runtime_1.jsxs("div", { style: message, role: "alert", children: ["Could not preview LUT: ", state.error] })) : state.type === 'loading' ? (jsx_runtime_1.jsx("div", { style: message, role: "status", children: "Loading LUT preview..." })) : null, jsx_runtime_1.jsxs("div", { style: {
|
|
178
|
+
...comparison,
|
|
179
|
+
width: size
|
|
180
|
+
? Math.max(0, Math.min(960, size.width - 48, ((size.height - 48) * previewWidth) / previewHeight))
|
|
181
|
+
: 0,
|
|
182
|
+
display: state.type === 'loaded' ? 'block' : 'none',
|
|
183
|
+
}, children: [
|
|
184
|
+
jsx_runtime_1.jsx("canvas", { ref: afterRef, width: previewWidth, height: previewHeight, style: canvasStyle, role: "img", "aria-label": "Sample image after LUT" }), jsx_runtime_1.jsx("div", { style: {
|
|
185
|
+
position: 'absolute',
|
|
186
|
+
inset: 0,
|
|
187
|
+
clipPath: `inset(0 ${100 - position}% 0 0)`,
|
|
188
|
+
}, children: jsx_runtime_1.jsx("canvas", { ref: beforeRef, width: previewWidth, height: previewHeight, style: canvasStyle, role: "img", "aria-label": "Sample image before LUT" }) }), jsx_runtime_1.jsx("div", { role: "slider", "aria-label": "Before and after comparison", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(position), "aria-valuetext": `${Math.round(position)}% before, ${100 - Math.round(position)}% after`, tabIndex: tabIndex, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sliderStyle, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onKeyDown: onKeyDown, children: jsx_runtime_1.jsx("div", { "aria-hidden": true, style: { ...dividerStyle, left: `${position}%` }, children: jsx_runtime_1.jsx("div", { style: handleStyle, children: jsx_runtime_1.jsx("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", children: jsx_runtime_1.jsx("path", { d: "M8 8 4 12l4 4M16 8l4 4-4 4", stroke: colors_1.CURRENT_COLOR, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }) }) }) }) })
|
|
189
|
+
] })
|
|
190
|
+
] }));
|
|
191
|
+
};
|
|
192
|
+
exports.LutPreview = LutPreview;
|
|
@@ -4,7 +4,6 @@ exports.MenuCompositionName = 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");
|
|
8
7
|
const colors_1 = require("../helpers/colors");
|
|
9
8
|
const hoverable_1 = require("../helpers/hoverable");
|
|
10
9
|
const noop_1 = require("../helpers/noop");
|
|
@@ -13,7 +12,7 @@ const composition_menu_items_1 = require("./composition-menu-items");
|
|
|
13
12
|
const ContextMenu_1 = require("./ContextMenu");
|
|
14
13
|
const InlineDropdown_1 = require("./InlineDropdown");
|
|
15
14
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
16
|
-
const
|
|
15
|
+
const use_open_in_menu_apps_1 = require("./use-open-in-menu-apps");
|
|
17
16
|
const baseStyle = {
|
|
18
17
|
cursor: 'default',
|
|
19
18
|
textDecoration: 'none',
|
|
@@ -66,18 +65,15 @@ const MenuCompositionName = () => {
|
|
|
66
65
|
}, [canvasContent, compositions]);
|
|
67
66
|
const asset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
|
|
68
67
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
69
|
-
const connectionStatus = (0,
|
|
70
|
-
.previewServerState.type;
|
|
71
|
-
const { defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(connectionStatus === 'connected');
|
|
68
|
+
const { connectionStatus, openInApps } = (0, use_open_in_menu_apps_1.useOpenInMenuApps)();
|
|
72
69
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = composition === null || composition === void 0 ? void 0 : composition.stack) !== null && _a !== void 0 ? _a : null);
|
|
73
70
|
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
74
71
|
return (0, composition_menu_items_1.getCompositionContextMenuItems)({
|
|
75
72
|
closeMenu: noop_1.noop,
|
|
76
73
|
composition,
|
|
77
74
|
connectionStatus,
|
|
78
|
-
editorId: defaultEditorId,
|
|
79
|
-
editorName: defaultEditorName,
|
|
80
75
|
includeCompositionManagementItems: true,
|
|
76
|
+
openInApps,
|
|
81
77
|
resolvedLocation,
|
|
82
78
|
setSelectedModal,
|
|
83
79
|
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
@@ -85,8 +81,7 @@ const MenuCompositionName = () => {
|
|
|
85
81
|
}, [
|
|
86
82
|
composition,
|
|
87
83
|
connectionStatus,
|
|
88
|
-
|
|
89
|
-
defaultEditorName,
|
|
84
|
+
openInApps,
|
|
90
85
|
resolvedLocation,
|
|
91
86
|
setSelectedModal,
|
|
92
87
|
]);
|
|
@@ -18,6 +18,7 @@ const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
|
18
18
|
const ElementInstallConfirmation_1 = require("./ElementInstallConfirmation");
|
|
19
19
|
const ElementLibraryModal_1 = require("./ElementLibraryModal");
|
|
20
20
|
const FixComputedValueModal_1 = require("./FixComputedValueModal");
|
|
21
|
+
const GenerateWithAgentModal_1 = require("./GenerateWithAgentModal");
|
|
21
22
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
22
23
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
23
24
|
const DuplicateComposition_1 = require("./NewComposition/DuplicateComposition");
|
|
@@ -104,12 +105,8 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
104
105
|
})();
|
|
105
106
|
});
|
|
106
107
|
}, [confirm, isBrowserStudio, previewServerState, subscribeToEvent]);
|
|
107
|
-
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, canvasCapture: modalContextType.canvasCapture })), 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 &&
|
|
108
|
-
modalContextType.type === 'settings' &&
|
|
109
|
-
(!isBrowserStudio ||
|
|
110
|
-
modalContextType.initialTab === 'packages' ||
|
|
111
|
-
modalContextType.initialTab === 'shortcuts') ? (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)) : null, modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
108
|
+
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, canvasCapture: modalContextType.canvasCapture })), 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 === 'settings' ? (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)) : null, modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
112
109
|
modalContextType.type === 'server-render' &&
|
|
113
|
-
(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 === 'transcribe' ? (jsx_runtime_1.jsx(TranscriptionModalWithOptionalWhisper_1.TranscriptionModalWithOptionalWhisper, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'video-matting' ? (jsx_runtime_1.jsx(VideoMattingModalWithOptionalPackage_1.VideoMattingModalWithOptionalPackage, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'asset-selection' ? (jsx_runtime_1.jsx(AssetSelectorModal_1.AssetSelectorModal, { readOnlyStudio: readOnlyStudio, state: modalContextType })) : null, modalContextType && modalContextType.type === 'element-library' && (jsx_runtime_1.jsx(ElementLibraryModal_1.ElementLibraryModal, { name: modalContextType.name, url: modalContextType.url })), modalContextType && modalContextType.type === 'element-install' && (jsx_runtime_1.jsx(ElementInstallConfirmation_1.ElementInstallConfirmation, { state: modalContextType })), 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, {})] }));
|
|
110
|
+
(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 === 'transcribe' ? (jsx_runtime_1.jsx(TranscriptionModalWithOptionalWhisper_1.TranscriptionModalWithOptionalWhisper, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'video-matting' ? (jsx_runtime_1.jsx(VideoMattingModalWithOptionalPackage_1.VideoMattingModalWithOptionalPackage, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), modalContextType && modalContextType.type === 'generate-with-agent' ? (jsx_runtime_1.jsx(GenerateWithAgentModal_1.GenerateWithAgentModal, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'asset-selection' ? (jsx_runtime_1.jsx(AssetSelectorModal_1.AssetSelectorModal, { readOnlyStudio: readOnlyStudio, state: modalContextType })) : null, modalContextType && modalContextType.type === 'element-library' && (jsx_runtime_1.jsx(ElementLibraryModal_1.ElementLibraryModal, { name: modalContextType.name, url: modalContextType.url })), modalContextType && modalContextType.type === 'element-install' && (jsx_runtime_1.jsx(ElementInstallConfirmation_1.ElementInstallConfirmation, { state: modalContextType })), 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, {})] }));
|
|
114
111
|
};
|
|
115
112
|
exports.Modals = Modals;
|
|
@@ -36,8 +36,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.ModelsSettings = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
40
|
+
const client_id_1 = require("../helpers/client-id");
|
|
39
41
|
const colors_1 = require("../helpers/colors");
|
|
40
42
|
const optional_package_dependencies_1 = require("../helpers/optional-package-dependencies");
|
|
43
|
+
const settings_tab_availability_1 = require("../helpers/settings-tab-availability");
|
|
41
44
|
const Button_1 = require("./Button");
|
|
42
45
|
const styles_1 = require("./InspectorPanel/styles");
|
|
43
46
|
const OptionalPackageModal_1 = require("./OptionalPackageModal");
|
|
@@ -104,7 +107,7 @@ const errorStyle = {
|
|
|
104
107
|
lineHeight: 1.4,
|
|
105
108
|
margin: '8px 0 0',
|
|
106
109
|
};
|
|
107
|
-
const OptionalModelPackage = ({ children, label, packageName, style }) => {
|
|
110
|
+
const OptionalModelPackage = ({ canInstall, children, label, packageName, style }) => {
|
|
108
111
|
const installed = (0, OptionalPackageModal_1.useOptionalPackageInstalled)(packageName);
|
|
109
112
|
const [installState, setInstallState] = (0, react_1.useState)({
|
|
110
113
|
type: 'idle',
|
|
@@ -122,12 +125,20 @@ const OptionalModelPackage = ({ children, label, packageName, style }) => {
|
|
|
122
125
|
jsx_runtime_1.jsxs("div", { style: headingRow, children: [
|
|
123
126
|
jsx_runtime_1.jsxs("div", { children: [
|
|
124
127
|
jsx_runtime_1.jsx("h3", { style: title, children: label }), jsx_runtime_1.jsx("p", { style: packageNameStyle, children: packageName })
|
|
125
|
-
] }), installed ? null : (jsx_runtime_1.jsx(Button_1.Button, { disabled: installState.type === 'installing', onClick: install, size: "compact", style: installButton, children: installState.type === 'installing' ? 'Installing…' : 'Install' }))] }), installed ? (jsx_runtime_1.jsx(react_1.Suspense, { fallback: jsx_runtime_1.jsx("p", { style: missingText, children: "Loading models\u2026" }), children: children })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
126
|
-
jsx_runtime_1.
|
|
128
|
+
] }), installed || !canInstall ? null : (jsx_runtime_1.jsx(Button_1.Button, { disabled: installState.type === 'installing', onClick: install, size: "compact", style: installButton, children: installState.type === 'installing' ? 'Installing…' : 'Install' }))] }), installed ? (jsx_runtime_1.jsx(react_1.Suspense, { fallback: jsx_runtime_1.jsx("p", { style: missingText, children: "Loading models\u2026" }), children: children })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
129
|
+
jsx_runtime_1.jsx("p", { style: missingDescription, children: canInstall
|
|
130
|
+
? `Install the package and ${optional_package_dependencies_1.TRANSFORMERS_PACKAGE} to download and manage its models.`
|
|
131
|
+
: 'Reconnect the Studio server to install this package and manage its models.' }), installState.type === 'error' ? (jsx_runtime_1.jsx("p", { style: errorStyle, children: installState.message })) : null] }))] }));
|
|
127
132
|
};
|
|
128
133
|
const ModelsSettings = () => {
|
|
134
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
135
|
+
const canInstall = (0, settings_tab_availability_1.canInstallPackagesInStudio)({
|
|
136
|
+
isBrowserStudio: (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null,
|
|
137
|
+
previewServerConnected: previewServerState.type === 'connected',
|
|
138
|
+
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
139
|
+
});
|
|
129
140
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
130
|
-
jsx_runtime_1.jsx("p", { style: overview, children: "Models are downloaded automatically when needed. You can also manage the browser cache here." }), jsx_runtime_1.jsx(OptionalModelPackage, { label: "Transcription", packageName: whisper_webgpu_capability_1.WHISPER_WEBGPU_PACKAGE, style: section, children: jsx_runtime_1.jsx(LazyWhisperModels, { description: null, indent: false, visible: true }) }), jsx_runtime_1.jsx(OptionalModelPackage, { label: "Video matting", packageName: video_matting_capability_1.VIDEO_MATTING_PACKAGE, style: lastSection, children: jsx_runtime_1.jsx(LazyVideoMattingModels, { description: null, indent: false, visible: true }) })
|
|
141
|
+
jsx_runtime_1.jsx("p", { style: overview, children: "Models are downloaded automatically when needed. You can also manage the browser cache here." }), jsx_runtime_1.jsx(OptionalModelPackage, { canInstall: canInstall, label: "Transcription", packageName: whisper_webgpu_capability_1.WHISPER_WEBGPU_PACKAGE, style: section, children: jsx_runtime_1.jsx(LazyWhisperModels, { description: null, indent: false, visible: true }) }), jsx_runtime_1.jsx(OptionalModelPackage, { canInstall: canInstall, label: "Video matting", packageName: video_matting_capability_1.VIDEO_MATTING_PACKAGE, style: lastSection, children: jsx_runtime_1.jsx(LazyVideoMattingModels, { description: null, indent: false, visible: true }) })
|
|
131
142
|
] }));
|
|
132
143
|
};
|
|
133
144
|
exports.ModelsSettings = ModelsSettings;
|
|
@@ -4,6 +4,5 @@ type CreatedNotification = {
|
|
|
4
4
|
replaceContent: (newContent: React.ReactNode, durationInMs: number | null) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const showNotification: (content: React.ReactNode, durationInMs: number | null) => CreatedNotification;
|
|
7
|
-
export declare const showCannotAddSequenceDropNotification: () => void;
|
|
8
7
|
export declare const NotificationCenter: React.FC;
|
|
9
8
|
export {};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NotificationCenter = exports.
|
|
6
|
+
exports.NotificationCenter = exports.showNotification = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
@@ -32,27 +32,6 @@ const showNotification = (content, durationInMs) => {
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
exports.showNotification = showNotification;
|
|
35
|
-
const CANNOT_ADD_SEQUENCE_DROP_NOTIFICATION = 'Cannot insert this item: This composition component cannot accept a new <Sequence>.';
|
|
36
|
-
const CANNOT_ADD_SEQUENCE_NOTIFICATION_DURATION = 3000;
|
|
37
|
-
let cannotAddSequenceNotification = null;
|
|
38
|
-
let cannotAddSequenceDismissTimeout = null;
|
|
39
|
-
const showCannotAddSequenceDropNotification = () => {
|
|
40
|
-
if (cannotAddSequenceNotification === null) {
|
|
41
|
-
cannotAddSequenceNotification = (0, exports.showNotification)(CANNOT_ADD_SEQUENCE_DROP_NOTIFICATION, null);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
cannotAddSequenceNotification.replaceContent(CANNOT_ADD_SEQUENCE_DROP_NOTIFICATION, null);
|
|
45
|
-
}
|
|
46
|
-
if (cannotAddSequenceDismissTimeout !== null) {
|
|
47
|
-
clearTimeout(cannotAddSequenceDismissTimeout);
|
|
48
|
-
}
|
|
49
|
-
cannotAddSequenceDismissTimeout = setTimeout(() => {
|
|
50
|
-
cannotAddSequenceNotification === null || cannotAddSequenceNotification === void 0 ? void 0 : cannotAddSequenceNotification.dismiss();
|
|
51
|
-
cannotAddSequenceNotification = null;
|
|
52
|
-
cannotAddSequenceDismissTimeout = null;
|
|
53
|
-
}, CANNOT_ADD_SEQUENCE_NOTIFICATION_DURATION);
|
|
54
|
-
};
|
|
55
|
-
exports.showCannotAddSequenceDropNotification = showCannotAddSequenceDropNotification;
|
|
56
35
|
const NotificationCenter = () => {
|
|
57
36
|
const [notifications, setNotifications] = (0, react_1.useState)([]);
|
|
58
37
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|