@remotion/studio 4.0.515 → 4.0.516
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/restart-studio.js +4 -0
- package/dist/components/AssetSelector.js +3 -9
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +24 -29
- package/dist/components/Canvas.js +7 -4
- package/dist/components/CaptionInspector.d.ts +2 -0
- package/dist/components/CaptionInspector.js +3 -5
- package/dist/components/CompositionSelector.js +6 -3
- package/dist/components/CompositionSelectorItem.js +9 -10
- package/dist/components/ConfigSelect.d.ts +17 -0
- package/dist/components/ConfigSelect.js +50 -0
- package/dist/components/CurrentAsset.d.ts +10 -2
- package/dist/components/CurrentAsset.js +139 -46
- package/dist/components/FixComputedValueModal.js +54 -51
- package/dist/components/GlobalKeybindings.js +5 -5
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +12 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -0
- package/dist/components/InlineCaptionInspector.js +2 -2
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.js +3 -2
- package/dist/components/InspectorInfoHeader.js +1 -1
- package/dist/components/InspectorOpenInEditor.js +48 -72
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +14 -7
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
- package/dist/components/InspectorPanel/common.d.ts +0 -12
- package/dist/components/InspectorPanel/common.js +3 -52
- package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
- package/dist/components/InspectorPanelLayout.d.ts +1 -1
- package/dist/components/InspectorPanelLayout.js +1 -1
- package/dist/components/InspectorSequenceSection.js +40 -54
- package/dist/components/InstallPackage.d.ts +2 -1
- package/dist/components/InstallPackage.js +60 -30
- package/dist/components/InstallablePackage.js +37 -11
- package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
- package/dist/components/KeyboardShortcutsSettings.js +177 -0
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/Modals.js +6 -5
- package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
- package/dist/components/NewComposition/CodemodFooter.js +2 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +1 -1
- package/dist/components/NewComposition/InputDragger.js +27 -4
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -3
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
- package/dist/components/Notifications/NotificationCenter.js +5 -0
- package/dist/components/OptionsPanel.js +9 -12
- package/dist/components/PreviewToolbar.js +5 -2
- package/dist/components/PreviewToolbarOverflowButton.js +30 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
- package/dist/components/RenderButton.js +66 -183
- package/dist/components/RenderModal/DataEditor.js +15 -12
- package/dist/components/RenderModal/RenderStatusModal.js +0 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
- package/dist/components/RenderingSettings.js +7 -4
- package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
- package/dist/components/RulersAndGuidesToggle.js +23 -0
- package/dist/components/SegmentedButton.d.ts +29 -0
- package/dist/components/SegmentedButton.js +226 -0
- package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
- package/dist/components/SelectedOutlineEditingHandles.js +66 -0
- package/dist/components/SelectedOutlineElement.d.ts +2 -4
- package/dist/components/SelectedOutlineElement.js +15 -54
- package/dist/components/SelectedOutlineOverlay.js +32 -6
- package/dist/components/SelectedOutlinePolygon.d.ts +3 -4
- package/dist/components/SelectedOutlinePolygon.js +18 -16
- package/dist/components/SelectedOutlineRenderer.js +66 -14
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +30 -7
- package/dist/components/SettingsModalFooter.js +2 -1
- package/dist/components/SkillsSettings.d.ts +2 -0
- package/dist/components/SkillsSettings.js +129 -0
- package/dist/components/StaticFilePreview.js +7 -1
- package/dist/components/StudioSettings.js +7 -48
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Timeline.js +0 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +15 -9
- package/dist/components/Timeline/TimelineBooleanField.js +1 -4
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
- package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectItem.js +23 -10
- package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
- package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
- package/dist/components/Timeline/TimelineImageInfo.js +13 -32
- package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineRotationField.js +0 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowChrome.js +3 -4
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
- package/dist/components/Timeline/TimelineScaleField.js +2 -6
- package/dist/components/Timeline/TimelineSchemaField.js +9 -3
- package/dist/components/Timeline/TimelineSelection.js +1 -1
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +110 -19
- package/dist/components/Timeline/TimelineSequenceItem.js +5 -5
- package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
- package/dist/components/Timeline/TimelineTranslateField.js +0 -4
- package/dist/components/Timeline/TimelineVirtualization.js +3 -1
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
- package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
- package/dist/components/Timeline/timeline-field-utils.js +0 -2
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/TimelineCombobox.js +25 -160
- package/dist/components/TimelineInOutToggle.js +4 -1
- package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
- package/dist/components/duplicate-jsx-node-api.js +12 -0
- package/dist/components/effect-drag-and-drop.js +1 -4
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +3 -3
- package/dist/components/import-assets.js +9 -65
- package/dist/components/keyboard-shortcuts.d.ts +10 -0
- package/dist/components/keyboard-shortcuts.js +135 -0
- package/dist/components/selected-outline-control-layout.js +2 -6
- package/dist/components/selected-outline-measurement.d.ts +1 -1
- package/dist/components/selected-outline-measurement.js +16 -3
- package/dist/components/use-delete-asset.d.ts +1 -0
- package/dist/components/use-delete-asset.js +40 -0
- package/dist/components/use-selected-outline-control-target.d.ts +11 -0
- package/dist/components/use-selected-outline-control-target.js +79 -0
- package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
- package/dist/esm/{chunk-v5a8vpv4.js → chunk-w4244j4n.js} +17766 -17618
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/internals.mjs +17765 -17617
- package/dist/esm/previewEntry.mjs +17570 -17422
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
- package/dist/helpers/add-asset-cache-bust.js +10 -0
- package/dist/helpers/calculate-timeline.js +2 -1
- package/dist/helpers/colors.d.ts +2 -0
- package/dist/helpers/colors.js +6 -2
- package/dist/helpers/drag-aware-double-click.d.ts +6 -0
- package/dist/helpers/drag-aware-double-click.js +20 -0
- package/dist/helpers/get-asset-metadata.js +25 -16
- package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
- package/dist/helpers/get-sequence-double-click-action.js +7 -1
- package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
- package/dist/helpers/get-timeline-sequence-layout.js +15 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +2 -1
- package/dist/helpers/inject-css.js +3 -1
- package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
- package/dist/helpers/open-in-remotion-convert.js +18 -0
- package/dist/helpers/use-media-metadata.d.ts +2 -1
- package/dist/helpers/use-media-metadata.js +12 -5
- package/dist/helpers/use-menu-structure.js +32 -32
- package/dist/icons/align-center-horizontal.js +1 -1
- package/dist/icons/align-left.js +1 -1
- package/dist/icons/align-right.js +1 -1
- package/dist/icons/keyboard.d.ts +4 -0
- package/dist/icons/keyboard.js +10 -0
- package/dist/icons/license.d.ts +4 -0
- package/dist/icons/license.js +8 -0
- package/dist/icons/package.d.ts +4 -0
- package/dist/icons/package.js +8 -0
- package/dist/icons/react.js +1 -1
- package/dist/icons/remotion-convert.d.ts +4 -0
- package/dist/icons/remotion-convert.js +10 -0
- package/dist/icons/skills.d.ts +4 -0
- package/dist/icons/skills.js +10 -0
- package/dist/state/modals.d.ts +2 -5
- package/package.json +12 -12
- package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
- package/dist/components/KeyboardShortcutsExplainer.js +0 -194
|
@@ -18,9 +18,9 @@ const transform_3d_mode_1 = require("../state/transform-3d-mode");
|
|
|
18
18
|
const AssetFileIcon_1 = require("./AssetFileIcon");
|
|
19
19
|
const InlineAction_1 = require("./InlineAction");
|
|
20
20
|
const InlineCaptionInspector_1 = require("./InlineCaptionInspector");
|
|
21
|
+
const CollapsibleInspectorSectionHeader_1 = require("./InspectorPanel/CollapsibleInspectorSectionHeader");
|
|
21
22
|
const common_1 = require("./InspectorPanel/common");
|
|
22
23
|
const inspector_section_collapse_1 = require("./InspectorPanel/inspector-section-collapse");
|
|
23
|
-
const styles_1 = require("./InspectorPanel/styles");
|
|
24
24
|
const asset_search_1 = require("./QuickSwitcher/asset-search");
|
|
25
25
|
const border_radius_representation_1 = require("./Timeline/border-radius-representation");
|
|
26
26
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
@@ -47,10 +47,6 @@ const emptyState = {
|
|
|
47
47
|
lineHeight: 1.4,
|
|
48
48
|
padding: '0 12px',
|
|
49
49
|
};
|
|
50
|
-
const effectsHeaderTitle = {
|
|
51
|
-
...styles_1.sectionHeaderTitle,
|
|
52
|
-
flexShrink: 1,
|
|
53
|
-
};
|
|
54
50
|
const plusIcon = {
|
|
55
51
|
width: 15,
|
|
56
52
|
height: 15,
|
|
@@ -65,38 +61,6 @@ const transform3DToggleIcon = {
|
|
|
65
61
|
height: 14,
|
|
66
62
|
width: 14,
|
|
67
63
|
};
|
|
68
|
-
const collapsibleSectionHeaderButton = {
|
|
69
|
-
appearance: 'none',
|
|
70
|
-
backgroundColor: 'transparent',
|
|
71
|
-
border: 'none',
|
|
72
|
-
borderRadius: 3,
|
|
73
|
-
cursor: 'default',
|
|
74
|
-
display: 'block',
|
|
75
|
-
flex: 1,
|
|
76
|
-
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
77
|
-
fontSize: 12,
|
|
78
|
-
fontWeight: 'bold',
|
|
79
|
-
lineHeight: '16px',
|
|
80
|
-
margin: 0,
|
|
81
|
-
minWidth: 0,
|
|
82
|
-
overflow: 'hidden',
|
|
83
|
-
padding: '4px 0',
|
|
84
|
-
textAlign: 'left',
|
|
85
|
-
textOverflow: 'ellipsis',
|
|
86
|
-
userSelect: 'none',
|
|
87
|
-
whiteSpace: 'nowrap',
|
|
88
|
-
};
|
|
89
|
-
const CollapsibleInspectorSectionHeader = ({ action, expanded, label, onToggle }) => {
|
|
90
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
91
|
-
const style = (0, react_1.useMemo)(() => {
|
|
92
|
-
return {
|
|
93
|
-
...collapsibleSectionHeaderButton,
|
|
94
|
-
color: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
95
|
-
};
|
|
96
|
-
}, [hovered]);
|
|
97
|
-
return (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
|
|
98
|
-
jsx_runtime_1.jsx("button", { type: "button", "aria-expanded": expanded, "aria-label": `${expanded ? 'Collapse' : 'Expand'} ${label}`, className: "__remotion-inspector-section-title", onClick: onToggle, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), style: style, children: label }), action] }));
|
|
99
|
-
};
|
|
100
64
|
const assetSelectorIcon = {
|
|
101
65
|
flexShrink: 0,
|
|
102
66
|
height: 18,
|
|
@@ -209,12 +173,12 @@ const persistInspectorSectionExpansionOverrides = (overrides) => {
|
|
|
209
173
|
// Ignore quota errors or disabled storage.
|
|
210
174
|
}
|
|
211
175
|
};
|
|
212
|
-
const getInspectorSectionExpansionKey = ({ nodePathInfo,
|
|
176
|
+
const getInspectorSectionExpansionKey = ({ nodePathInfo, sectionId, }) => {
|
|
213
177
|
return JSON.stringify([
|
|
214
178
|
nodePathInfo.sequenceSubscriptionKey.absolutePath,
|
|
215
179
|
nodePathInfo.sequenceSubscriptionKey.nodePath,
|
|
216
180
|
nodePathInfo.index,
|
|
217
|
-
|
|
181
|
+
sectionId,
|
|
218
182
|
]);
|
|
219
183
|
};
|
|
220
184
|
const getInspectorControlGroups = (rows) => {
|
|
@@ -375,7 +339,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
375
339
|
}
|
|
376
340
|
const expansionKey = getInspectorSectionExpansionKey({
|
|
377
341
|
nodePathInfo,
|
|
378
|
-
|
|
342
|
+
sectionId: group.id,
|
|
379
343
|
});
|
|
380
344
|
const activity = getControlGroupActivity(group);
|
|
381
345
|
if (activity === 'active' && next[expansionKey] !== true) {
|
|
@@ -392,17 +356,17 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
392
356
|
});
|
|
393
357
|
}, [controlGroups, getControlGroupActivity, nodePathInfo]);
|
|
394
358
|
const isControlGroupExpanded = (0, react_1.useCallback)((group) => {
|
|
395
|
-
if (!(0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id)) {
|
|
396
|
-
return true;
|
|
397
|
-
}
|
|
398
359
|
const expansionKey = getInspectorSectionExpansionKey({
|
|
399
360
|
nodePathInfo,
|
|
400
|
-
|
|
361
|
+
sectionId: group.id,
|
|
401
362
|
});
|
|
402
363
|
const override = sectionExpansionOverrides[expansionKey];
|
|
403
364
|
if (override !== undefined) {
|
|
404
365
|
return override;
|
|
405
366
|
}
|
|
367
|
+
if (!(0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id)) {
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
406
370
|
const automaticExpansion = automaticSectionExpansion[expansionKey];
|
|
407
371
|
if (automaticExpansion !== undefined) {
|
|
408
372
|
return automaticExpansion;
|
|
@@ -417,7 +381,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
417
381
|
const toggleControlGroup = (0, react_1.useCallback)((group) => {
|
|
418
382
|
const expansionKey = getInspectorSectionExpansionKey({
|
|
419
383
|
nodePathInfo,
|
|
420
|
-
|
|
384
|
+
sectionId: group.id,
|
|
421
385
|
});
|
|
422
386
|
const nextExpanded = !isControlGroupExpanded(group);
|
|
423
387
|
setSectionExpansionOverrides((previous) => {
|
|
@@ -426,6 +390,28 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
426
390
|
return next;
|
|
427
391
|
});
|
|
428
392
|
}, [isControlGroupExpanded, nodePathInfo]);
|
|
393
|
+
const isAdditionalSectionExpanded = (0, react_1.useCallback)((sectionId) => {
|
|
394
|
+
var _a;
|
|
395
|
+
const expansionKey = getInspectorSectionExpansionKey({
|
|
396
|
+
nodePathInfo,
|
|
397
|
+
sectionId,
|
|
398
|
+
});
|
|
399
|
+
return (_a = sectionExpansionOverrides[expansionKey]) !== null && _a !== void 0 ? _a : true;
|
|
400
|
+
}, [nodePathInfo, sectionExpansionOverrides]);
|
|
401
|
+
const toggleAdditionalSection = (0, react_1.useCallback)((sectionId) => {
|
|
402
|
+
const expansionKey = getInspectorSectionExpansionKey({
|
|
403
|
+
nodePathInfo,
|
|
404
|
+
sectionId,
|
|
405
|
+
});
|
|
406
|
+
const nextExpanded = !isAdditionalSectionExpanded(sectionId);
|
|
407
|
+
setSectionExpansionOverrides((previous) => {
|
|
408
|
+
const next = { ...previous, [expansionKey]: nextExpanded };
|
|
409
|
+
persistInspectorSectionExpansionOverrides(next);
|
|
410
|
+
return next;
|
|
411
|
+
});
|
|
412
|
+
}, [isAdditionalSectionExpanded, nodePathInfo]);
|
|
413
|
+
const captionsExpanded = isAdditionalSectionExpanded('captions');
|
|
414
|
+
const effectsExpanded = isAdditionalSectionExpanded('effects');
|
|
429
415
|
const visibleControlRows = controlGroups.flatMap((group) => {
|
|
430
416
|
return isControlGroupExpanded(group) ? group.rows : [];
|
|
431
417
|
});
|
|
@@ -509,26 +495,26 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
509
495
|
: show3DTransformControls
|
|
510
496
|
? 'Hide 3D transform controls'
|
|
511
497
|
: '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 })) }));
|
|
512
|
-
const effectsHeader = (jsx_runtime_1.
|
|
513
|
-
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 }) })] }));
|
|
498
|
+
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: () => toggleAdditionalSection('effects') }));
|
|
514
499
|
const renderRow = ({ node, depth }) => {
|
|
515
500
|
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)));
|
|
516
501
|
};
|
|
517
502
|
const renderControlGroupHeader = (group) => {
|
|
518
|
-
const collapsible = (0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id);
|
|
519
503
|
const expanded = isControlGroupExpanded(group);
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
504
|
+
return (jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: expanded
|
|
505
|
+
? group.id === 'border-radius'
|
|
506
|
+
? borderRadiusAction
|
|
507
|
+
: group.id === 'transforms'
|
|
508
|
+
? transform3DAction
|
|
509
|
+
: null
|
|
510
|
+
: null, expanded: expanded, label: group.label, onToggle: () => toggleControlGroup(group) }));
|
|
525
511
|
};
|
|
526
512
|
if (controlRows.length === 0 &&
|
|
527
513
|
!showEffectsSection &&
|
|
528
514
|
inlineCaptions === null) {
|
|
529
515
|
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Controls", children: jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" }) }) }));
|
|
530
516
|
}
|
|
531
|
-
return (jsx_runtime_1.jsx(TimelineAssetField_1.AssetSelectionContext.Provider, { value: assetSelectionContextValue, children: jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroupsWithoutLayout.map((group) => (jsx_runtime_1.jsx(common_1.InspectorSection, { header: renderControlGroupHeader(group), children: isControlGroupExpanded(group) ? (group.id === 'transforms' ? (jsx_runtime_1.jsxs(Transform3DModeContext_1.Transform3DModeContext.Provider, { value: show3DTransformControls, children: [renderTransformControls(), group.rows.map(renderRow)] })) : (group.rows.map(renderRow))) : null }, group.id))) })) : null, inlineCaptions ? (jsx_runtime_1.jsx(InlineCaptionInspector_1.InlineCaptionInspector, { captions: inlineCaptions, controls: sequence.controls, nodePath: nodePathInfo.sequenceSubscriptionKey, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation })) : null, showEffectsSection ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: effectsHeader, children: effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null })) : null, layoutGroup ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: renderControlGroupHeader(layoutGroup), children: isControlGroupExpanded(layoutGroup)
|
|
517
|
+
return (jsx_runtime_1.jsx(TimelineAssetField_1.AssetSelectionContext.Provider, { value: assetSelectionContextValue, children: jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroupsWithoutLayout.map((group) => (jsx_runtime_1.jsx(common_1.InspectorSection, { header: renderControlGroupHeader(group), children: isControlGroupExpanded(group) ? (group.id === 'transforms' ? (jsx_runtime_1.jsxs(Transform3DModeContext_1.Transform3DModeContext.Provider, { value: show3DTransformControls, children: [renderTransformControls(), group.rows.map(renderRow)] })) : (group.rows.map(renderRow))) : null }, group.id))) })) : null, inlineCaptions ? (jsx_runtime_1.jsx(InlineCaptionInspector_1.InlineCaptionInspector, { captions: inlineCaptions, controls: sequence.controls, expanded: captionsExpanded, nodePath: nodePathInfo.sequenceSubscriptionKey, onToggle: () => toggleAdditionalSection('captions'), readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation })) : null, showEffectsSection ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: effectsHeader, children: effectsExpanded && effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null })) : null, layoutGroup ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: renderControlGroupHeader(layoutGroup), children: isControlGroupExpanded(layoutGroup)
|
|
532
518
|
? layoutGroup.rows.map(renderRow)
|
|
533
519
|
: null }) })) : null] }) }));
|
|
534
520
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PackageManager } from '@remotion/studio-shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const InstallPackageSettings: React.FC<{
|
|
4
|
+
readonly footerContainer: HTMLElement | null;
|
|
4
5
|
readonly packageManager: PackageManager | null;
|
|
5
6
|
}>;
|
|
@@ -32,11 +32,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
39
|
+
exports.InstallPackageSettings = void 0;
|
|
37
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
41
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
39
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
40
44
|
const remotion_1 = require("remotion");
|
|
41
45
|
const install_package_1 = require("../api/install-package");
|
|
42
46
|
const restart_studio_1 = require("../api/restart-studio");
|
|
@@ -51,17 +55,40 @@ const layout_1 = require("./layout");
|
|
|
51
55
|
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
52
56
|
const ModalButton_1 = require("./ModalButton");
|
|
53
57
|
const ModalFooter_1 = require("./ModalFooter");
|
|
54
|
-
const ModalHeader_1 = require("./ModalHeader");
|
|
55
|
-
const DismissableModal_1 = require("./NewComposition/DismissableModal");
|
|
56
58
|
const container = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
boxSizing: 'border-box',
|
|
60
|
+
flex: 1,
|
|
61
|
+
fontFamily: 'sans-serif',
|
|
62
|
+
minHeight: 0,
|
|
59
63
|
overflowY: 'auto',
|
|
64
|
+
padding: '16px 16px 0',
|
|
65
|
+
};
|
|
66
|
+
const settingsContainer = {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
flex: 1,
|
|
69
|
+
flexDirection: 'column',
|
|
70
|
+
minHeight: 0,
|
|
71
|
+
minWidth: 0,
|
|
60
72
|
};
|
|
61
73
|
const text = {
|
|
62
74
|
fontSize: 14,
|
|
63
75
|
};
|
|
64
|
-
const
|
|
76
|
+
const footer = {
|
|
77
|
+
flex: 'none',
|
|
78
|
+
};
|
|
79
|
+
const packageRow = {
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
borderBottom: colors_1.BORDER_WHITE_ALPHA_12,
|
|
82
|
+
display: 'flex',
|
|
83
|
+
gap: 10,
|
|
84
|
+
minHeight: 52,
|
|
85
|
+
padding: '4px 0',
|
|
86
|
+
};
|
|
87
|
+
const lastPackageRow = {
|
|
88
|
+
...packageRow,
|
|
89
|
+
borderBottom: 'none',
|
|
90
|
+
};
|
|
91
|
+
const InstallPackageSettings = ({ footerContainer, packageManager }) => {
|
|
65
92
|
const [state, setState] = react_1.default.useState({ type: 'idle' });
|
|
66
93
|
const [map, setMap] = react_1.default.useState({});
|
|
67
94
|
const { previewServerState: ctx } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -128,14 +155,14 @@ const InstallPackageModal = ({ packageManager }) => {
|
|
|
128
155
|
enter.unregister();
|
|
129
156
|
};
|
|
130
157
|
}, [disabled, onClick, registerKeybinding]);
|
|
131
|
-
|
|
132
|
-
|
|
158
|
+
const installablePackages = Object.entries(studio_shared_1.installableMap).filter(([, install]) => install);
|
|
159
|
+
const packageCount = installablePackages.length + studio_shared_1.extraPackages.length;
|
|
160
|
+
return (jsx_runtime_1.jsxs("div", { style: settingsContainer, children: [
|
|
161
|
+
jsx_runtime_1.jsx("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: state.type === 'done' ? (jsx_runtime_1.jsxs("div", { style: text, children: ["Installed package", selectedPackages.length === 1 ? '' : 's', ' ', "successfully.", packageManager === null
|
|
133
162
|
? null
|
|
134
163
|
: ' Restart the server to complete.'] })) : state.type === 'restarting' ? (jsx_runtime_1.jsx("div", { style: text, children: "Restarting the Studio server..." })) : state.type === 'installing' ? (jsx_runtime_1.jsxs("div", { style: text, children: ["Installing package", selectedPackages.length === 1 ? '' : 's', packageManager === null
|
|
135
164
|
? '.'
|
|
136
|
-
: '. Check your terminal for progress.'] })) : (jsx_runtime_1.jsxs("div", { style: text, children: [
|
|
137
|
-
.filter(([, install]) => install)
|
|
138
|
-
.map(([pkgShort]) => {
|
|
165
|
+
: '. Check your terminal for progress.'] })) : (jsx_runtime_1.jsxs("div", { style: text, role: "list", "aria-label": "Remotion packages", children: [installablePackages.map(([pkgShort], index) => {
|
|
139
166
|
var _a;
|
|
140
167
|
var _b;
|
|
141
168
|
const pkg = pkgShort === 'core' ? 'remotion' : `@remotion/${pkgShort}`;
|
|
@@ -148,35 +175,38 @@ const InstallPackageModal = ({ packageManager }) => {
|
|
|
148
175
|
if (!description) {
|
|
149
176
|
throw new Error('No description for ' + pkg);
|
|
150
177
|
}
|
|
151
|
-
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
178
|
+
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", role: "listitem", style: index === packageCount - 1 ? lastPackageRow : packageRow, children: [
|
|
152
179
|
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: map[pkg], name: pkg, onChange: () => {
|
|
153
180
|
setMap((prev) => ({ ...prev, [pkg]: !prev[pkg] }));
|
|
154
|
-
}, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(
|
|
181
|
+
}, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(InstallablePackage_1.InstallablePackageComp, { description: description, isInstalled: isInstalled, link: link, pkg: pkg })
|
|
155
182
|
] }, pkg));
|
|
156
|
-
}), studio_shared_1.extraPackages.map((extraPkg) => {
|
|
183
|
+
}), studio_shared_1.extraPackages.map((extraPkg, index) => {
|
|
157
184
|
var _a;
|
|
158
185
|
var _b;
|
|
159
186
|
const isInstalled = (_b = (_a = window.remotion_installedPackages) === null || _a === void 0 ? void 0 : _a.includes(extraPkg.name)) !== null && _b !== void 0 ? _b : false;
|
|
160
|
-
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center",
|
|
187
|
+
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", role: "listitem", style: installablePackages.length + index === packageCount - 1
|
|
188
|
+
? lastPackageRow
|
|
189
|
+
: packageRow, children: [
|
|
161
190
|
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: map[extraPkg.name], name: extraPkg.name, onChange: () => {
|
|
162
191
|
setMap((prev) => ({
|
|
163
192
|
...prev,
|
|
164
193
|
[extraPkg.name]: !prev[extraPkg.name],
|
|
165
194
|
}));
|
|
166
|
-
}, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(
|
|
195
|
+
}, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(InstallablePackage_1.InstallablePackageComp, { description: extraPkg.description, isInstalled: isInstalled, link: extraPkg.docsUrl, pkg: `${extraPkg.name}@${extraPkg.version}` })
|
|
167
196
|
] }, extraPkg.name));
|
|
168
|
-
})] })) }),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
?
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
197
|
+
})] })) }), footerContainer
|
|
198
|
+
? react_dom_1.default.createPortal(jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footer, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [state.type === 'idle' ? (jsx_runtime_1.jsxs("span", { style: { color: colors_1.LIGHT_TEXT, fontSize: 13, lineHeight: 1.2 }, children: ["This will install ", selectedPackages.length, " package", selectedPackages.length === 1 ? '' : 's', jsx_runtime_1.jsx("br", {}), packageManager === null
|
|
199
|
+
? `in this project, Remotion v${remotion_1.VERSION}`
|
|
200
|
+
: `using ${packageManager}, Remotion v${remotion_1.VERSION}`] })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { onClick: onClick, disabled: disabled, children: [state.type === 'restarting'
|
|
201
|
+
? 'Restarting...'
|
|
202
|
+
: state.type === 'installing'
|
|
203
|
+
? 'Installing...'
|
|
204
|
+
: state.type === 'done'
|
|
205
|
+
? packageManager === null
|
|
206
|
+
? 'Done'
|
|
207
|
+
: 'Restart Server'
|
|
208
|
+
: 'Install', disabled ? null : jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })
|
|
209
|
+
] }) }), footerContainer)
|
|
210
|
+
: null] }));
|
|
181
211
|
};
|
|
182
|
-
exports.
|
|
212
|
+
exports.InstallPackageSettings = InstallPackageSettings;
|
|
@@ -4,18 +4,44 @@ exports.InstallablePackageComp = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../helpers/colors");
|
|
6
6
|
const FONT_SIZE = 13;
|
|
7
|
+
const container = {
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flex: 1,
|
|
11
|
+
gap: 10,
|
|
12
|
+
minWidth: 0,
|
|
13
|
+
};
|
|
14
|
+
const packageDetails = {
|
|
15
|
+
flex: 1,
|
|
16
|
+
minWidth: 0,
|
|
17
|
+
};
|
|
18
|
+
const packageName = {
|
|
19
|
+
color: colors_1.WHITE,
|
|
20
|
+
display: 'block',
|
|
21
|
+
fontFamily: 'monospace',
|
|
22
|
+
fontSize: FONT_SIZE,
|
|
23
|
+
lineHeight: 1.4,
|
|
24
|
+
overflow: 'hidden',
|
|
25
|
+
textDecoration: 'none',
|
|
26
|
+
textOverflow: 'ellipsis',
|
|
27
|
+
whiteSpace: 'nowrap',
|
|
28
|
+
};
|
|
29
|
+
const descriptionStyle = {
|
|
30
|
+
color: colors_1.LIGHT_TEXT,
|
|
31
|
+
fontSize: FONT_SIZE,
|
|
32
|
+
lineHeight: 1.4,
|
|
33
|
+
};
|
|
34
|
+
const status = {
|
|
35
|
+
color: colors_1.LIGHT_TEXT,
|
|
36
|
+
fontSize: 12,
|
|
37
|
+
lineHeight: 1.4,
|
|
38
|
+
whiteSpace: 'nowrap',
|
|
39
|
+
};
|
|
7
40
|
const InstallablePackageComp = ({ isInstalled, pkg, link, description }) => {
|
|
8
|
-
return (jsx_runtime_1.jsxs("div", { style:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
paddingTop: 4,
|
|
13
|
-
}, children: [
|
|
14
|
-
jsx_runtime_1.jsx("a", { href: link, style: {
|
|
15
|
-
fontSize: FONT_SIZE,
|
|
16
|
-
color: colors_1.WHITE_HEX,
|
|
17
|
-
textDecoration: 'none',
|
|
18
|
-
}, target: "_blank", children: pkg }), ' ', isInstalled ? (jsx_runtime_1.jsx("span", { style: { opacity: 0.3, fontSize: 'inherit' }, children: "(installed)" })) : null, jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("span", { style: { color: colors_1.LIGHT_TEXT, fontSize: FONT_SIZE }, children: description })
|
|
41
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
42
|
+
jsx_runtime_1.jsxs("div", { style: packageDetails, children: [
|
|
43
|
+
jsx_runtime_1.jsx("a", { href: link, style: packageName, target: "_blank", children: pkg }), jsx_runtime_1.jsx("div", { style: descriptionStyle, children: description })
|
|
44
|
+
] }), jsx_runtime_1.jsx("span", { style: status, children: isInstalled ? 'Installed' : 'Not installed' })
|
|
19
45
|
] }));
|
|
20
46
|
};
|
|
21
47
|
exports.InstallablePackageComp = InstallablePackageComp;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.KeyboardShortcutsSettings = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
40
|
+
const colors_1 = require("../helpers/colors");
|
|
41
|
+
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
42
|
+
const ConfigSelect_1 = require("./ConfigSelect");
|
|
43
|
+
const styles_1 = require("./InspectorPanel/styles");
|
|
44
|
+
const keyboard_shortcuts_1 = require("./keyboard-shortcuts");
|
|
45
|
+
const layout_1 = require("./layout");
|
|
46
|
+
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
47
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
48
|
+
const use_auto_save_config_1 = require("./use-auto-save-config");
|
|
49
|
+
const container = {
|
|
50
|
+
alignSelf: 'flex-start',
|
|
51
|
+
display: 'flex',
|
|
52
|
+
flex: 1,
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
minWidth: 0,
|
|
55
|
+
};
|
|
56
|
+
const dividerLabel = {
|
|
57
|
+
...styles_1.sectionHeader,
|
|
58
|
+
margin: 0,
|
|
59
|
+
padding: '4px 16px',
|
|
60
|
+
};
|
|
61
|
+
const shortcutSectionTitle = {
|
|
62
|
+
...dividerLabel,
|
|
63
|
+
marginTop: 8,
|
|
64
|
+
};
|
|
65
|
+
const shortcutRow = {
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
borderBottom: colors_1.BORDER_WHITE_ALPHA_12,
|
|
68
|
+
display: 'flex',
|
|
69
|
+
gap: 16,
|
|
70
|
+
justifyContent: 'space-between',
|
|
71
|
+
margin: '0 16px',
|
|
72
|
+
minHeight: 38,
|
|
73
|
+
};
|
|
74
|
+
const lastShortcutRow = {
|
|
75
|
+
...shortcutRow,
|
|
76
|
+
borderBottom: 'none',
|
|
77
|
+
};
|
|
78
|
+
const actionName = {
|
|
79
|
+
color: colors_1.LIGHT_TEXT,
|
|
80
|
+
fontSize: 14,
|
|
81
|
+
lineHeight: 1.4,
|
|
82
|
+
minWidth: 0,
|
|
83
|
+
};
|
|
84
|
+
const chords = {
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
display: 'flex',
|
|
87
|
+
flexShrink: 0,
|
|
88
|
+
gap: 6,
|
|
89
|
+
};
|
|
90
|
+
const chord = {
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
display: 'flex',
|
|
93
|
+
gap: 4,
|
|
94
|
+
};
|
|
95
|
+
const key = {
|
|
96
|
+
background: colors_1.INPUT_BACKGROUND,
|
|
97
|
+
border: `1px solid ${colors_1.BLACK_ALPHA_60}`,
|
|
98
|
+
borderBottomWidth: 2,
|
|
99
|
+
borderRadius: 3,
|
|
100
|
+
color: colors_1.WHITE,
|
|
101
|
+
fontFamily: 'monospace',
|
|
102
|
+
fontSize: 12,
|
|
103
|
+
lineHeight: '18px',
|
|
104
|
+
minWidth: 18,
|
|
105
|
+
padding: '1px 5px',
|
|
106
|
+
textAlign: 'center',
|
|
107
|
+
};
|
|
108
|
+
const alternative = {
|
|
109
|
+
color: colors_1.LIGHT_TEXT,
|
|
110
|
+
fontSize: 11,
|
|
111
|
+
};
|
|
112
|
+
const KeyboardShortcutsSettings = () => {
|
|
113
|
+
var _a;
|
|
114
|
+
const { error: settingsError, revision, studioRuntimeConfig } = (0, SettingsContext_1.useSettings)();
|
|
115
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
116
|
+
const [enabled, setEnabled] = (0, react_1.useState)(null);
|
|
117
|
+
const [edited, setEdited] = (0, react_1.useState)(false);
|
|
118
|
+
const [syncedRevision, setSyncedRevision] = (0, react_1.useState)(-1);
|
|
119
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
120
|
+
const displayedShortcutGroups = (0, studio_runtime_config_1.getStudioAskAIEnabled)()
|
|
121
|
+
? [...keyboard_shortcuts_1.keyboardShortcutGroups, keyboard_shortcuts_1.askAIKeyboardShortcutGroup]
|
|
122
|
+
: keyboard_shortcuts_1.keyboardShortcutGroups;
|
|
123
|
+
(0, react_1.useEffect)(() => {
|
|
124
|
+
var _a;
|
|
125
|
+
var _b;
|
|
126
|
+
if (studioRuntimeConfig === null) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
setEnabled((_b = (_a = studioRuntimeConfig.configFileStudioSettings) === null || _a === void 0 ? void 0 : _a.keyboardShortcutsEnabled) !== null && _b !== void 0 ? _b : null);
|
|
130
|
+
setEdited(false);
|
|
131
|
+
setSyncedRevision(revision);
|
|
132
|
+
setError(null);
|
|
133
|
+
}, [revision, studioRuntimeConfig]);
|
|
134
|
+
const onEnabledChange = (0, react_1.useCallback)((value) => {
|
|
135
|
+
setEnabled(value);
|
|
136
|
+
setEdited(true);
|
|
137
|
+
}, []);
|
|
138
|
+
const updates = (0, react_1.useMemo)(() => {
|
|
139
|
+
if (!edited) {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
return enabled === null
|
|
143
|
+
? [{ setter: 'setKeyboardShortcutsEnabled', type: 'delete' }]
|
|
144
|
+
: [
|
|
145
|
+
{
|
|
146
|
+
setter: 'setKeyboardShortcutsEnabled',
|
|
147
|
+
type: 'set',
|
|
148
|
+
value: enabled,
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
}, [edited, enabled]);
|
|
152
|
+
const ready = studioRuntimeConfig !== null && syncedRevision === revision;
|
|
153
|
+
(0, use_auto_save_config_1.useAutoSaveConfig)({
|
|
154
|
+
enabled: ready && !isBrowserStudio,
|
|
155
|
+
onError: setError,
|
|
156
|
+
ready,
|
|
157
|
+
syncRevision: syncedRevision,
|
|
158
|
+
updates,
|
|
159
|
+
});
|
|
160
|
+
if (studioRuntimeConfig === null) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [isBrowserStudio ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
164
|
+
jsx_runtime_1.jsx("p", { style: dividerLabel, children: "General" }), jsx_runtime_1.jsx(ConfigSelect_1.ConfigSelect, { defaultLabel: "Enabled", name: "Keyboard shortcuts", onChange: onEnabledChange, options: ConfigSelect_1.booleanOptions, value: enabled })
|
|
165
|
+
] })), displayedShortcutGroups.map((group, groupIndex) => (jsx_runtime_1.jsxs("div", { children: [
|
|
166
|
+
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) => (jsx_runtime_1.jsxs("div", { role: "listitem", style: groupIndex === displayedShortcutGroups.length - 1 &&
|
|
167
|
+
shortcutIndex === group.shortcuts.length - 1
|
|
168
|
+
? lastShortcutRow
|
|
169
|
+
: shortcutRow, children: [
|
|
170
|
+
jsx_runtime_1.jsx("span", { style: actionName, children: shortcut.action }), jsx_runtime_1.jsx("span", { style: chords, children: shortcut.chords.map((keys, chordIndex) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [chordIndex > 0 ? (jsx_runtime_1.jsx("span", { style: alternative, children: "or" })) : null, jsx_runtime_1.jsx("span", { style: chord, children: keys.map((keyboardKey) => (jsx_runtime_1.jsx("kbd", { style: key, children: keyboardKey }, keyboardKey))) })
|
|
171
|
+
] }, keys.join('-')))) })
|
|
172
|
+
] }, shortcut.action))) })
|
|
173
|
+
] }, group.name))), (error !== null && error !== void 0 ? error : settingsError) ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
174
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx("div", { style: { paddingLeft: 16, paddingRight: 16 }, children: jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: (_a = error !== null && error !== void 0 ? error : settingsError) !== null && _a !== void 0 ? _a : '', type: "error" }) })
|
|
175
|
+
] })) : null] }));
|
|
176
|
+
};
|
|
177
|
+
exports.KeyboardShortcutsSettings = KeyboardShortcutsSettings;
|
|
@@ -48,7 +48,7 @@ const MenuBuildIndicator = ({ mobileLayout }) => {
|
|
|
48
48
|
};
|
|
49
49
|
}, []);
|
|
50
50
|
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [
|
|
51
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: mobileLayout ? 0.5 : 2 }), window.remotion_projectName, jsx_runtime_1.jsx(MenuCompositionName_1.MenuCompositionName, {}), jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: folderLocation, locationType: "folder" }), mobileLayout ? null : jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), mobileLayout ? (isBuilding ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
51
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: mobileLayout ? 0.5 : 2 }), window.remotion_projectName, jsx_runtime_1.jsx(MenuCompositionName_1.MenuCompositionName, {}), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: folderLocation, locationType: "folder" }), mobileLayout ? null : jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), mobileLayout ? (isBuilding ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
52
52
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize, color: colors_1.WHITE_ALPHA_80 }) })
|
|
53
53
|
] })) : null) : isBuilding ? (jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize, color: colors_1.WHITE_ALPHA_80 }) })) : (jsx_runtime_1.jsx("div", { style: noSpinner }))] }));
|
|
54
54
|
};
|