@remotion/studio 4.0.514 → 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.
Files changed (222) hide show
  1. package/dist/api/install-package.js +14 -1
  2. package/dist/api/restart-studio.js +4 -0
  3. package/dist/components/AssetSelector.js +3 -9
  4. package/dist/components/AssetSelectorItem.d.ts +3 -1
  5. package/dist/components/AssetSelectorItem.js +41 -42
  6. package/dist/components/AudioWaveform.js +17 -139
  7. package/dist/components/Canvas.js +7 -4
  8. package/dist/components/CaptionInspector.d.ts +2 -0
  9. package/dist/components/CaptionInspector.js +3 -5
  10. package/dist/components/CompositionSelector.js +6 -3
  11. package/dist/components/CompositionSelectorItem.js +9 -10
  12. package/dist/components/ConfigSelect.d.ts +17 -0
  13. package/dist/components/ConfigSelect.js +50 -0
  14. package/dist/components/CurrentAsset.d.ts +10 -2
  15. package/dist/components/CurrentAsset.js +139 -46
  16. package/dist/components/FixComputedValueModal.js +54 -51
  17. package/dist/components/GlobalKeybindings.js +5 -5
  18. package/dist/components/InlineAction.d.ts +1 -1
  19. package/dist/components/InlineAction.js +12 -2
  20. package/dist/components/InlineCaptionInspector.d.ts +2 -0
  21. package/dist/components/InlineCaptionInspector.js +2 -2
  22. package/dist/components/InlineCompositionName.js +1 -1
  23. package/dist/components/InlineEditableTitle.js +3 -2
  24. package/dist/components/InspectorInfoHeader.js +1 -1
  25. package/dist/components/InspectorOpenInEditor.js +48 -72
  26. package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
  27. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
  28. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
  29. package/dist/components/InspectorPanel/CompositionInspector.js +41 -12
  30. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
  31. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
  33. package/dist/components/InspectorPanel/common.d.ts +0 -12
  34. package/dist/components/InspectorPanel/common.js +3 -52
  35. package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
  36. package/dist/components/InspectorPanelLayout.d.ts +1 -1
  37. package/dist/components/InspectorPanelLayout.js +1 -1
  38. package/dist/components/InspectorSequenceSection.js +40 -54
  39. package/dist/components/InstallPackage.d.ts +3 -2
  40. package/dist/components/InstallPackage.js +90 -28
  41. package/dist/components/InstallablePackage.js +37 -11
  42. package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
  43. package/dist/components/KeyboardShortcutsSettings.js +177 -0
  44. package/dist/components/Menu/MenuDivider.js +1 -1
  45. package/dist/components/MenuBuildIndicator.js +1 -1
  46. package/dist/components/Modals.js +12 -4
  47. package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
  48. package/dist/components/NewComposition/CodemodFooter.js +2 -8
  49. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  50. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  51. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  52. package/dist/components/NewComposition/InputDragger.js +27 -4
  53. package/dist/components/NewComposition/NewComposition.js +1 -1
  54. package/dist/components/NewComposition/NewFolder.js +1 -3
  55. package/dist/components/NewComposition/RenameComposition.js +1 -1
  56. package/dist/components/NewComposition/RenameFolder.js +1 -1
  57. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  58. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  59. package/dist/components/Notifications/NotificationCenter.js +5 -0
  60. package/dist/components/OptionsPanel.js +9 -12
  61. package/dist/components/PreviewToolbar.js +5 -2
  62. package/dist/components/PreviewToolbarOverflowButton.js +30 -0
  63. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
  64. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
  65. package/dist/components/RenderButton.js +66 -183
  66. package/dist/components/RenderModal/DataEditor.js +15 -12
  67. package/dist/components/RenderModal/GuiRenderStatus.js +3 -1
  68. package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
  69. package/dist/components/RenderModal/RenderStatusModal.js +0 -1
  70. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
  71. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
  72. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
  73. package/dist/components/RenderModal/WebRenderModal.js +4 -2
  74. package/dist/components/RenderQueue/RenderQueueItem.js +3 -1
  75. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
  76. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -7
  77. package/dist/components/RenderingSettings.js +7 -4
  78. package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
  79. package/dist/components/RulersAndGuidesToggle.js +23 -0
  80. package/dist/components/SegmentedButton.d.ts +29 -0
  81. package/dist/components/SegmentedButton.js +226 -0
  82. package/dist/components/SelectedOutlineCanvasRotation.d.ts +1 -0
  83. package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
  84. package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
  85. package/dist/components/SelectedOutlineEditingHandles.js +66 -0
  86. package/dist/components/SelectedOutlineElement.d.ts +2 -4
  87. package/dist/components/SelectedOutlineElement.js +15 -54
  88. package/dist/components/SelectedOutlineOverlay.js +32 -6
  89. package/dist/components/SelectedOutlinePolygon.d.ts +4 -4
  90. package/dist/components/SelectedOutlinePolygon.js +20 -17
  91. package/dist/components/SelectedOutlineRenderer.js +66 -14
  92. package/dist/components/SettingsModal.d.ts +1 -1
  93. package/dist/components/SettingsModal.js +30 -7
  94. package/dist/components/SettingsModalFooter.js +2 -1
  95. package/dist/components/SkillsSettings.d.ts +2 -0
  96. package/dist/components/SkillsSettings.js +129 -0
  97. package/dist/components/StaticFilePreview.js +7 -1
  98. package/dist/components/StudioSettings.js +7 -48
  99. package/dist/components/Tabs/index.js +1 -1
  100. package/dist/components/Timeline/Timeline.js +0 -1
  101. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  102. package/dist/components/Timeline/TimelineAssetField.js +15 -9
  103. package/dist/components/Timeline/TimelineBooleanField.js +1 -4
  104. package/dist/components/Timeline/TimelineClipboardKeybindings.js +13 -12
  105. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  106. package/dist/components/Timeline/TimelineEffectItem.js +45 -15
  107. package/dist/components/Timeline/TimelineEffectPropItem.js +21 -4
  108. package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
  109. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
  110. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  111. package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
  112. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  113. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
  114. package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
  115. package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
  116. package/dist/components/Timeline/TimelineImageInfo.js +13 -32
  117. package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
  118. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  119. package/dist/components/Timeline/TimelineRotationField.js +0 -2
  120. package/dist/components/Timeline/TimelineRowChrome.d.ts +1 -1
  121. package/dist/components/Timeline/TimelineRowChrome.js +41 -6
  122. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
  123. package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
  124. package/dist/components/Timeline/TimelineScaleField.js +2 -6
  125. package/dist/components/Timeline/TimelineSchemaField.js +9 -3
  126. package/dist/components/Timeline/TimelineSelection.d.ts +8 -3
  127. package/dist/components/Timeline/TimelineSelection.js +7 -5
  128. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  129. package/dist/components/Timeline/TimelineSequence.js +110 -19
  130. package/dist/components/Timeline/TimelineSequenceItem.js +11 -8
  131. package/dist/components/Timeline/TimelineSequenceName.js +1 -1
  132. package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
  133. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
  134. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
  135. package/dist/components/Timeline/TimelineTrack.js +5 -2
  136. package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
  137. package/dist/components/Timeline/TimelineTranslateField.js +0 -4
  138. package/dist/components/Timeline/TimelineVideoInfo.js +4 -2
  139. package/dist/components/Timeline/TimelineVirtualization.js +3 -1
  140. package/dist/components/Timeline/delete-selected-timeline-item.js +6 -2
  141. package/dist/components/Timeline/duplicate-selected-timeline-item.js +7 -14
  142. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
  143. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
  144. package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
  145. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
  146. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
  147. package/dist/components/Timeline/save-effect-prop.js +3 -3
  148. package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
  149. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  150. package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
  151. package/dist/components/Timeline/timeline-field-utils.js +0 -2
  152. package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
  153. package/dist/components/TimelineCombobox.js +25 -160
  154. package/dist/components/TimelineInOutToggle.js +4 -1
  155. package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
  156. package/dist/components/duplicate-jsx-node-api.js +12 -0
  157. package/dist/components/effect-drag-and-drop.js +7 -7
  158. package/dist/components/effect-operations-api.d.ts +8 -0
  159. package/dist/components/effect-operations-api.js +52 -0
  160. package/dist/components/handle-drop.d.ts +2 -1
  161. package/dist/components/handle-drop.js +3 -3
  162. package/dist/components/import-assets.js +9 -65
  163. package/dist/components/keyboard-shortcuts.d.ts +10 -0
  164. package/dist/components/keyboard-shortcuts.js +135 -0
  165. package/dist/components/selected-outline-control-layout.js +2 -6
  166. package/dist/components/selected-outline-measurement.d.ts +1 -1
  167. package/dist/components/selected-outline-measurement.js +16 -3
  168. package/dist/components/use-delete-asset.d.ts +1 -0
  169. package/dist/components/use-delete-asset.js +40 -0
  170. package/dist/components/use-selected-outline-control-target.d.ts +11 -0
  171. package/dist/components/use-selected-outline-control-target.js +79 -0
  172. package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
  173. package/dist/esm/{chunk-r46yxrjr.js → chunk-4bxz1d3g.js} +4 -3
  174. package/dist/esm/{chunk-xn2q7eem.js → chunk-w4244j4n.js} +14747 -14549
  175. package/dist/esm/index.mjs +3 -0
  176. package/dist/esm/internals.mjs +14747 -14549
  177. package/dist/esm/previewEntry.mjs +14557 -14359
  178. package/dist/esm/renderEntry.mjs +2 -2
  179. package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
  180. package/dist/helpers/add-asset-cache-bust.js +10 -0
  181. package/dist/helpers/browser-studio-operations.d.ts +3 -0
  182. package/dist/helpers/browser-studio-operations.js +18 -1
  183. package/dist/helpers/calculate-timeline.js +2 -1
  184. package/dist/helpers/colors.d.ts +3 -1
  185. package/dist/helpers/colors.js +7 -3
  186. package/dist/helpers/drag-aware-double-click.d.ts +6 -0
  187. package/dist/helpers/drag-aware-double-click.js +20 -0
  188. package/dist/helpers/get-asset-metadata.js +25 -16
  189. package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
  190. package/dist/helpers/get-sequence-double-click-action.js +7 -1
  191. package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
  192. package/dist/helpers/get-timeline-sequence-layout.js +15 -6
  193. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
  194. package/dist/helpers/hoverable.d.ts +1 -0
  195. package/dist/helpers/hoverable.js +2 -1
  196. package/dist/helpers/inject-css.js +7 -3
  197. package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
  198. package/dist/helpers/open-in-remotion-convert.js +18 -0
  199. package/dist/helpers/use-max-media-duration.js +5 -3
  200. package/dist/helpers/use-media-metadata.d.ts +2 -1
  201. package/dist/helpers/use-media-metadata.js +49 -25
  202. package/dist/helpers/use-menu-structure.js +54 -67
  203. package/dist/icons/align-center-horizontal.js +1 -1
  204. package/dist/icons/align-left.js +1 -1
  205. package/dist/icons/align-right.js +1 -1
  206. package/dist/icons/cloud-download.d.ts +4 -0
  207. package/dist/icons/cloud-download.js +8 -0
  208. package/dist/icons/keyboard.d.ts +4 -0
  209. package/dist/icons/keyboard.js +10 -0
  210. package/dist/icons/license.d.ts +4 -0
  211. package/dist/icons/license.js +8 -0
  212. package/dist/icons/package.d.ts +4 -0
  213. package/dist/icons/package.js +8 -0
  214. package/dist/icons/react.js +1 -1
  215. package/dist/icons/remotion-convert.d.ts +4 -0
  216. package/dist/icons/remotion-convert.js +10 -0
  217. package/dist/icons/skills.d.ts +4 -0
  218. package/dist/icons/skills.js +10 -0
  219. package/dist/state/modals.d.ts +2 -5
  220. package/package.json +12 -12
  221. package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
  222. 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, groupId, }) => {
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
- groupId,
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
- groupId: group.id,
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
- groupId: group.id,
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
- groupId: group.id,
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.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
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
- if (collapsible) {
521
- return (jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader, { action: group.id === 'border-radius' && expanded ? borderRadiusAction : null, expanded: expanded, label: group.label, onToggle: () => toggleControlGroup(group) }));
522
- }
523
- return (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
524
- jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: group.label }), group.id === 'transforms' ? transform3DAction : null] }));
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 InstallPackageModal: React.FC<{
4
- readonly packageManager: PackageManager;
3
+ export declare const InstallPackageSettings: React.FC<{
4
+ readonly footerContainer: HTMLElement | null;
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.InstallPackageModal = void 0;
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");
@@ -44,42 +48,90 @@ const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint")
44
48
  const client_id_1 = require("../helpers/client-id");
45
49
  const colors_1 = require("../helpers/colors");
46
50
  const use_keybinding_1 = require("../helpers/use-keybinding");
51
+ const modals_1 = require("../state/modals");
47
52
  const Checkbox_1 = require("./Checkbox");
48
53
  const InstallablePackage_1 = require("./InstallablePackage");
49
54
  const layout_1 = require("./layout");
50
55
  const is_menu_item_1 = require("./Menu/is-menu-item");
51
56
  const ModalButton_1 = require("./ModalButton");
52
57
  const ModalFooter_1 = require("./ModalFooter");
53
- const ModalHeader_1 = require("./ModalHeader");
54
- const DismissableModal_1 = require("./NewComposition/DismissableModal");
55
58
  const container = {
56
- padding: 20,
57
- maxHeight: 400,
59
+ boxSizing: 'border-box',
60
+ flex: 1,
61
+ fontFamily: 'sans-serif',
62
+ minHeight: 0,
58
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,
59
72
  };
60
73
  const text = {
61
74
  fontSize: 14,
62
75
  };
63
- const InstallPackageModal = ({ packageManager }) => {
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 }) => {
64
92
  const [state, setState] = react_1.default.useState({ type: 'idle' });
65
93
  const [map, setMap] = react_1.default.useState({});
66
94
  const { previewServerState: ctx } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
95
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
67
96
  const selectedPackages = Object.keys(map).filter((pkg) => map[pkg]);
97
+ const selectedPackageSpecs = selectedPackages.map((name) => {
98
+ var _a;
99
+ var _b;
100
+ return ({
101
+ name,
102
+ version: (_b = (_a = studio_shared_1.extraPackages.find((pkg) => pkg.name === name)) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : null,
103
+ });
104
+ });
68
105
  const onClick = (0, react_1.useCallback)(async () => {
106
+ var _a;
69
107
  if (state.type === 'done') {
108
+ if (packageManager === null) {
109
+ setSelectedModal(null);
110
+ return;
111
+ }
70
112
  setState({ type: 'restarting' });
71
113
  (0, restart_studio_1.restartStudio)();
72
114
  return;
73
115
  }
74
116
  setState({ type: 'installing' });
75
117
  try {
76
- await (0, install_package_1.installPackages)(selectedPackages.map((name) => ({ name, version: null })));
118
+ await (0, install_package_1.installPackages)(selectedPackageSpecs);
119
+ window.remotion_installedPackages = Array.from(new Set([
120
+ ...((_a = window.remotion_installedPackages) !== null && _a !== void 0 ? _a : []),
121
+ ...selectedPackages,
122
+ ]));
77
123
  setState({ type: 'done' });
78
124
  }
79
125
  catch (err) {
80
126
  setState({ type: 'error', error: err });
81
127
  }
82
- }, [selectedPackages, state.type]);
128
+ }, [
129
+ packageManager,
130
+ selectedPackageSpecs,
131
+ selectedPackages,
132
+ setSelectedModal,
133
+ state.type,
134
+ ]);
83
135
  const canSelectPackages = state.type === 'idle' && ctx.type === 'connected';
84
136
  const disabled = !(canSelectPackages || state.type === 'done') ||
85
137
  selectedPackages.length === 0;
@@ -103,10 +155,14 @@ const InstallPackageModal = ({ packageManager }) => {
103
155
  enter.unregister();
104
156
  };
105
157
  }, [disabled, onClick, registerKeybinding]);
106
- return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
107
- jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Install packages" }), 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. 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', ". Check your terminal for progress."] })) : (jsx_runtime_1.jsxs("div", { style: text, children: [Object.entries(studio_shared_1.installableMap)
108
- .filter(([, install]) => install)
109
- .map(([pkgShort]) => {
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
162
+ ? null
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
164
+ ? '.'
165
+ : '. Check your terminal for progress.'] })) : (jsx_runtime_1.jsxs("div", { style: text, role: "list", "aria-label": "Remotion packages", children: [installablePackages.map(([pkgShort], index) => {
110
166
  var _a;
111
167
  var _b;
112
168
  const pkg = pkgShort === 'core' ? 'remotion' : `@remotion/${pkgShort}`;
@@ -119,32 +175,38 @@ const InstallPackageModal = ({ packageManager }) => {
119
175
  if (!description) {
120
176
  throw new Error('No description for ' + pkg);
121
177
  }
122
- 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: [
123
179
  jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: map[pkg], name: pkg, onChange: () => {
124
180
  setMap((prev) => ({ ...prev, [pkg]: !prev[pkg] }));
125
- }, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 }), jsx_runtime_1.jsx(InstallablePackage_1.InstallablePackageComp, { description: description, isInstalled: isInstalled, link: link, pkg: pkg })
181
+ }, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(InstallablePackage_1.InstallablePackageComp, { description: description, isInstalled: isInstalled, link: link, pkg: pkg })
126
182
  ] }, pkg));
127
- }), studio_shared_1.extraPackages.map((extraPkg) => {
183
+ }), studio_shared_1.extraPackages.map((extraPkg, index) => {
128
184
  var _a;
129
185
  var _b;
130
186
  const isInstalled = (_b = (_a = window.remotion_installedPackages) === null || _a === void 0 ? void 0 : _a.includes(extraPkg.name)) !== null && _b !== void 0 ? _b : false;
131
- return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
187
+ return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", role: "listitem", style: installablePackages.length + index === packageCount - 1
188
+ ? lastPackageRow
189
+ : packageRow, children: [
132
190
  jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: map[extraPkg.name], name: extraPkg.name, onChange: () => {
133
191
  setMap((prev) => ({
134
192
  ...prev,
135
193
  [extraPkg.name]: !prev[extraPkg.name],
136
194
  }));
137
- }, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 }), jsx_runtime_1.jsx(InstallablePackage_1.InstallablePackageComp, { description: extraPkg.description, isInstalled: isInstalled, link: extraPkg.docsUrl, pkg: `${extraPkg.name}@${extraPkg.version}` })
195
+ }, disabled: !canSelectPackages || isInstalled }), jsx_runtime_1.jsx(InstallablePackage_1.InstallablePackageComp, { description: extraPkg.description, isInstalled: isInstalled, link: extraPkg.docsUrl, pkg: `${extraPkg.name}@${extraPkg.version}` })
138
196
  ] }, extraPkg.name));
139
- })] })) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { 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", {}),
140
- "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'
141
- ? 'Restarting...'
142
- : state.type === 'installing'
143
- ? 'Installing...'
144
- : state.type === 'done'
145
- ? 'Restart Server'
146
- : 'Install', disabled ? null : jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })
147
- ] }) })
148
- ] }));
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] }));
149
211
  };
150
- exports.InstallPackageModal = InstallPackageModal;
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
- fontSize: FONT_SIZE,
10
- lineHeight: 1.2,
11
- paddingBottom: 4,
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,2 @@
1
+ import React from 'react';
2
+ export declare const KeyboardShortcutsSettings: React.FC;
@@ -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;
@@ -10,6 +10,6 @@ const menuDivider = {
10
10
  backgroundColor: colors_1.WHITE_ALPHA_05,
11
11
  };
12
12
  const MenuDivider = () => {
13
- return jsx_runtime_1.jsx("div", { style: menuDivider });
13
+ return jsx_runtime_1.jsx("div", { role: "separator", style: menuDivider });
14
14
  };
15
15
  exports.MenuDivider = MenuDivider;
@@ -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
  };