@remotion/studio 4.0.524 → 4.0.525

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 (135) hide show
  1. package/dist/components/ActionTooltip.d.ts +2 -0
  2. package/dist/components/ActionTooltip.js +14 -4
  3. package/dist/components/AppLaunchButton.js +2 -0
  4. package/dist/components/AssetSelectorModal.d.ts +6 -0
  5. package/dist/components/AssetSelectorModal.js +174 -0
  6. package/dist/components/Canvas.js +15 -1
  7. package/dist/components/CheckboardToggle.js +2 -1
  8. package/dist/components/ColorPicker/AlphaSlider.js +1 -1
  9. package/dist/components/ColorPicker/HueSlider.js +1 -1
  10. package/dist/components/ColorPicker/SaturationValueArea.js +1 -1
  11. package/dist/components/CompositionSelector.js +1 -0
  12. package/dist/components/CompositionSelectorItem.js +1 -0
  13. package/dist/components/EditorGuides/Guide.js +1 -1
  14. package/dist/components/ElementInstallConfirmation.js +31 -23
  15. package/dist/components/FullscreenToggle.js +1 -1
  16. package/dist/components/GlobalKeybindings.js +14 -0
  17. package/dist/components/InspectorLocationCopy.js +1 -1
  18. package/dist/components/InspectorOpenInEditor.d.ts +1 -0
  19. package/dist/components/InspectorOpenInEditor.js +18 -15
  20. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +6 -7
  21. package/dist/components/InspectorPanel/CompositionMetadata.js +1 -0
  22. package/dist/components/InspectorPanel/ElementLibraryButton.js +1 -0
  23. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +4 -12
  24. package/dist/components/InspectorSequenceSection.js +18 -9
  25. package/dist/components/LoopToggle.js +2 -1
  26. package/dist/components/Menu/MenuItem.js +1 -2
  27. package/dist/components/MenuBuildIndicator.js +1 -1
  28. package/dist/components/Modals.js +2 -1
  29. package/dist/components/MuteToggle.js +2 -1
  30. package/dist/components/NewComposition/CodemodFooter.js +1 -0
  31. package/dist/components/NewComposition/DeleteComposition.js +42 -6
  32. package/dist/components/NewComposition/DeleteFolder.js +1 -0
  33. package/dist/components/NewComposition/DuplicateComposition.js +5 -0
  34. package/dist/components/NewComposition/InputDragger.js +2 -2
  35. package/dist/components/NewComposition/NewFolder.js +29 -2
  36. package/dist/components/NewComposition/RenameFolder.js +1 -0
  37. package/dist/components/NewComposition/duplicate-composition-api.d.ts +3 -2
  38. package/dist/components/NewComposition/duplicate-composition-api.js +9 -2
  39. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  40. package/dist/components/Notifications/NotificationCenter.js +22 -1
  41. package/dist/components/OutlineToggle.js +2 -1
  42. package/dist/components/PlayPause.js +1 -1
  43. package/dist/components/Preview.js +0 -3
  44. package/dist/components/PreviewToolbar.js +3 -6
  45. package/dist/components/PreviewToolbarOverflowButton.js +2 -1
  46. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
  47. package/dist/components/RenderButton.js +40 -4
  48. package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
  49. package/dist/components/RenderModal/render-modals.js +3 -0
  50. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +1 -1
  51. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
  52. package/dist/components/RenderQueue/actions.d.ts +2 -1
  53. package/dist/components/RenderQueue/actions.js +2 -1
  54. package/dist/components/RulersAndGuidesToggle.js +2 -1
  55. package/dist/components/SegmentedButton.d.ts +1 -0
  56. package/dist/components/SegmentedButton.js +9 -3
  57. package/dist/components/SelectedOutlineElement.js +16 -6
  58. package/dist/components/SelectedOutlinePolygon.js +4 -2
  59. package/dist/components/SettingsContext.d.ts +8 -0
  60. package/dist/components/SettingsContext.js +57 -2
  61. package/dist/components/SettingsModal.js +4 -1
  62. package/dist/components/SettingsModalFooter.js +1 -1
  63. package/dist/components/SidebarCollapserControls.js +1 -1
  64. package/dist/components/SkillsSettings.js +35 -4
  65. package/dist/components/SnappingToggle.js +2 -1
  66. package/dist/components/Splitter/SplitterHandle.js +1 -2
  67. package/dist/components/Tabs/vertical.d.ts +1 -1
  68. package/dist/components/Tabs/vertical.js +16 -2
  69. package/dist/components/Timeline/EasingEditorModal.js +2 -2
  70. package/dist/components/Timeline/TimelineAssetField.js +148 -9
  71. package/dist/components/Timeline/TimelineDragHandler.js +1 -2
  72. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  73. package/dist/components/Timeline/TimelineEffectItem.js +2 -2
  74. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
  75. package/dist/components/Timeline/TimelineEffectPropItem.js +2 -2
  76. package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
  77. package/dist/components/Timeline/TimelineInOutDragHandler.js +1 -2
  78. package/dist/components/Timeline/TimelineSchemaField.js +8 -1
  79. package/dist/components/Timeline/TimelineSelection.d.ts +3 -1
  80. package/dist/components/Timeline/TimelineSelection.js +32 -5
  81. package/dist/components/Timeline/TimelineSequence.js +6 -6
  82. package/dist/components/Timeline/TimelineSequenceItem.js +12 -10
  83. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +3 -12
  84. package/dist/components/Timeline/TimelineTranslateField.js +25 -12
  85. package/dist/components/Timeline/TimelineZoomControls.js +1 -1
  86. package/dist/components/Timeline/get-sequence-context-menu-items.js +22 -6
  87. package/dist/components/Timeline/timeline-field-display-utils.js +4 -2
  88. package/dist/components/Timeline/timeline-translate-utils.d.ts +17 -0
  89. package/dist/components/Timeline/timeline-translate-utils.js +53 -12
  90. package/dist/components/Timeline/use-open-sequence-in-apps.d.ts +2 -0
  91. package/dist/components/Timeline/use-open-sequence-in-apps.js +17 -0
  92. package/dist/components/Timeline/use-timeline-asset-drop.js +17 -3
  93. package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
  94. package/dist/components/TimelineCombobox.js +1 -0
  95. package/dist/components/UndoRedoButtons.js +11 -0
  96. package/dist/components/composition-menu-items.js +56 -2
  97. package/dist/components/folder-menu-items.js +44 -0
  98. package/dist/components/get-open-in-menu-items.js +1 -1
  99. package/dist/components/import-assets.d.ts +24 -1
  100. package/dist/components/import-assets.js +3 -1
  101. package/dist/components/keyboard-shortcuts.d.ts +4 -4
  102. package/dist/components/keyboard-shortcuts.js +5 -0
  103. package/dist/esm/{LazyModels-hc33szyn.mjs → LazyModels-gfmpcy4h.mjs} +3 -3
  104. package/dist/esm/{LazyModels-sg40rjw6.mjs → LazyModels-m1rf06wh.mjs} +3 -3
  105. package/dist/esm/{TranscriptionModal-3ctnxpt6.mjs → TranscriptionModal-8pvrehg4.mjs} +6 -6
  106. package/dist/esm/{VideoMattingModal-b0r7e60n.mjs → VideoMattingModal-fefbzgka.mjs} +6 -6
  107. package/dist/esm/{index-yfrysr5f.mjs → index-0x13f28h.mjs} +17 -3
  108. package/dist/esm/{index-q2epbw93.mjs → index-1089795y.mjs} +2 -2
  109. package/dist/esm/{index-9qtvmwtx.mjs → index-41kqns5c.mjs} +4 -2
  110. package/dist/esm/{index-c37kme2v.mjs → index-ggqpre9v.mjs} +2202 -1719
  111. package/dist/esm/{index-wbmp5srk.mjs → index-hbezgbbq.mjs} +1 -1
  112. package/dist/esm/{index-2j3d1g81.mjs → index-jrw61pkj.mjs} +1 -1
  113. package/dist/esm/{index-1b9skrrd.mjs → index-mww32xc8.mjs} +3 -3
  114. package/dist/esm/{index-er3mh6em.mjs → index-s848rffx.mjs} +7123 -6588
  115. package/dist/esm/{index-q5xv20xx.mjs → index-tzxb8808.mjs} +1 -1
  116. package/dist/esm/{index-e3zwf3e7.mjs → index-vsxrxfpj.mjs} +1 -1
  117. package/dist/esm/index.mjs +2 -2
  118. package/dist/esm/internals.mjs +7 -7
  119. package/dist/esm/previewEntry.mjs +7 -7
  120. package/dist/helpers/get-git-menu-item.d.ts +4 -0
  121. package/dist/helpers/get-git-menu-item.js +8 -1
  122. package/dist/helpers/get-sequence-double-click-action.d.ts +3 -3
  123. package/dist/helpers/get-sequence-double-click-action.js +2 -2
  124. package/dist/helpers/pointer-session.d.ts +1 -0
  125. package/dist/helpers/pointer-session.js +10 -1
  126. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  127. package/dist/helpers/use-create-composition.js +5 -0
  128. package/dist/helpers/use-keybinding.d.ts +1 -1
  129. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
  130. package/dist/helpers/use-media-metadata.js +5 -1
  131. package/dist/helpers/use-menu-structure.js +5 -1
  132. package/dist/helpers/use-rename-composition.js +6 -1
  133. package/dist/state/modals.d.ts +13 -1
  134. package/dist/state/z-index.js +1 -3
  135. package/package.json +19 -19
@@ -28,13 +28,13 @@ const dropdownSegmentStyle = {
28
28
  width: 20,
29
29
  };
30
30
  const editorButtonIconSize = 18;
31
- const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locationType }) => {
31
+ const githubButtonIconSize = 16;
32
+ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locationType, showTooltips, }) => {
32
33
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
33
34
  const configureDefaultApps = (0, use_configure_default_apps_1.useConfigureDefaultApps)();
34
35
  const { canConfigureApps, canOpenInEditor, defaultEditorId, defaultEditorName, editorInfo, } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
35
36
  const codingAgentInfo = (0, use_default_editor_info_1.useDefaultCodingAgentInfo)(canConfigureApps);
36
- const canOpenInGitHub = (0, get_git_menu_item_1.hasReadOnlyGitSource)();
37
- const defaultActionIsGitHub = !canOpenInEditor && canOpenInGitHub;
37
+ const defaultOpenInTarget = (0, get_git_menu_item_1.getDefaultOpenInTarget)({ canOpenInEditor });
38
38
  const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
39
39
  if (!location) {
40
40
  return;
@@ -57,21 +57,21 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
57
57
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
58
58
  }
59
59
  }, [contextForAgents]);
60
- const defaultAppName = defaultActionIsGitHub
60
+ const defaultAppName = defaultOpenInTarget === 'git-source'
61
61
  ? 'GitHub'
62
62
  : (defaultEditorName !== null && defaultEditorName !== void 0 ? defaultEditorName : 'default editor');
63
- const canOpenDefault = location !== null && (canOpenInEditor || canOpenInGitHub);
63
+ const canOpenDefault = location !== null && defaultOpenInTarget !== null;
64
64
  const onOpenDefault = (0, react_1.useCallback)((event) => {
65
65
  event.stopPropagation();
66
- if (defaultActionIsGitHub) {
66
+ if (defaultOpenInTarget === 'git-source') {
67
67
  (0, get_git_menu_item_1.openGitSource)({ folder: locationType === 'folder', location });
68
68
  }
69
- else if (defaultEditorId) {
69
+ else if (defaultOpenInTarget === 'editor' && defaultEditorId) {
70
70
  openWithEditor(defaultEditorId).catch(() => undefined);
71
71
  }
72
72
  }, [
73
- defaultActionIsGitHub,
74
73
  defaultEditorId,
74
+ defaultOpenInTarget,
75
75
  location,
76
76
  locationType,
77
77
  openWithEditor,
@@ -127,15 +127,15 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
127
127
  });
128
128
  },
129
129
  });
130
- return defaultActionIsGitHub
130
+ return defaultOpenInTarget === 'git-source'
131
131
  ? items.filter((item) => item.id !== 'open-in-github')
132
132
  : items;
133
133
  }, [
134
134
  codingAgentInfo,
135
135
  canOpenInEditor,
136
136
  configureDefaultApps,
137
- defaultActionIsGitHub,
138
137
  defaultEditorId,
138
+ defaultOpenInTarget,
139
139
  editorInfo,
140
140
  location,
141
141
  locationType,
@@ -152,10 +152,11 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
152
152
  idleColor: colors_1.LIGHT_TEXT,
153
153
  onClick: onOpenDefault,
154
154
  onPointerDown: null,
155
- renderContent: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [label, defaultActionIsGitHub ? (jsx_runtime_1.jsx(github_1.GitHubIcon, { size: editorButtonIconSize })) : (jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: defaultEditorId, size: editorButtonIconSize }))] })),
155
+ renderContent: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [label, defaultOpenInTarget === 'git-source' ? (jsx_runtime_1.jsx(github_1.GitHubIcon, { size: githubButtonIconSize })) : (jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: defaultEditorId, size: editorButtonIconSize }))] })),
156
156
  segmentId: 'default-editor',
157
157
  style: mainSegmentStyle,
158
- title: `Open in ${defaultAppName}`,
158
+ title: showTooltips ? '' : `Open in ${defaultAppName}`,
159
+ tooltipLabel: showTooltips ? `Open in ${defaultAppName}` : null,
159
160
  type: 'action',
160
161
  },
161
162
  ];
@@ -171,7 +172,8 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
171
172
  segmentId: 'another-app',
172
173
  selectedId: null,
173
174
  style: dropdownSegmentStyle,
174
- title: 'Open in another app',
175
+ title: showTooltips ? '' : 'Open in another app',
176
+ tooltipLabel: showTooltips ? 'Open in another app' : null,
175
177
  type: 'menu',
176
178
  values: menuItems,
177
179
  });
@@ -179,17 +181,18 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
179
181
  return result;
180
182
  }, [
181
183
  canOpenDefault,
182
- defaultActionIsGitHub,
183
184
  defaultAppName,
184
185
  defaultEditorId,
186
+ defaultOpenInTarget,
185
187
  label,
186
188
  menuItems,
187
189
  onOpenDefault,
190
+ showTooltips,
188
191
  ]);
189
192
  if ((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
190
193
  return null;
191
194
  }
192
- if (previewServerState.type !== 'connected' && !canOpenInGitHub) {
195
+ if (previewServerState.type !== 'connected' && defaultOpenInTarget === null) {
193
196
  return null;
194
197
  }
195
198
  return jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: null, title: null });
@@ -38,7 +38,7 @@ const CompositionInspectorHeader = () => {
38
38
  const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
39
39
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
40
40
  const { canOpenInEditor, defaultEditorId } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
41
- const canOpenInGitHub = (0, get_git_menu_item_1.hasReadOnlyGitSource)();
41
+ const defaultOpenInTarget = (0, get_git_menu_item_1.getDefaultOpenInTarget)({ canOpenInEditor });
42
42
  const currentComposition = (0, react_1.useMemo)(() => {
43
43
  var _a;
44
44
  if (!video) {
@@ -75,16 +75,16 @@ const CompositionInspectorHeader = () => {
75
75
  });
76
76
  }, [compositionFile, compositionId]);
77
77
  const openSourceLocation = (0, react_1.useCallback)((location) => {
78
- if (canOpenInEditor && defaultEditorId) {
78
+ if (defaultOpenInTarget === 'editor' && defaultEditorId) {
79
79
  (0, open_in_editor_1.openOriginalPositionInEditor)(location, defaultEditorId).catch((err) => {
80
80
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
81
81
  });
82
82
  return;
83
83
  }
84
- if (canOpenInGitHub) {
84
+ if (defaultOpenInTarget === 'git-source') {
85
85
  (0, get_git_menu_item_1.openGitSource)({ folder: false, location });
86
86
  }
87
- }, [canOpenInEditor, canOpenInGitHub, defaultEditorId]);
87
+ }, [defaultEditorId, defaultOpenInTarget]);
88
88
  const openFileLocation = (0, react_1.useCallback)(() => {
89
89
  if (validatedLocation) {
90
90
  openSourceLocation(validatedLocation);
@@ -102,9 +102,8 @@ const CompositionInspectorHeader = () => {
102
102
  return (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: sourceLocationIconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: sourceLocationIconStyle }));
103
103
  }, [video]);
104
104
  return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { minHeight: COMPOSITION_INSPECTOR_HEADER_HEIGHT, padding: "4px 0", children: video ? (jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, openInEditorLocation: componentLocation, children: [
105
- jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null && (canOpenInEditor || canOpenInGitHub), onOpen: openFileLocation, renderIcon: renderCompositionIcon, size: "quick-action" }), compositionComponentInfo === null &&
105
+ jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null && defaultOpenInTarget !== null, onOpen: openFileLocation, renderIcon: renderCompositionIcon, size: "quick-action" }), compositionComponentInfo === null &&
106
106
  compositionFile !== null &&
107
- compositionId !== null ? (jsx_runtime_1.jsx("div", { "aria-hidden": true, style: componentLocationPlaceholder })) : (jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null &&
108
- (canOpenInEditor || canOpenInGitHub), onOpen: openComponentLocation, renderIcon: renderReactIcon, size: "quick-action" }))] })) : null }));
107
+ compositionId !== null ? (jsx_runtime_1.jsx("div", { "aria-hidden": true, style: componentLocationPlaceholder })) : (jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null && defaultOpenInTarget !== null, onOpen: openComponentLocation, renderIcon: renderReactIcon, size: "quick-action" }))] })) : null }));
109
108
  };
110
109
  exports.CompositionInspectorHeader = CompositionInspectorHeader;
@@ -242,6 +242,7 @@ const CompositionMetadata = ({ compositionId, disabled, stack }) => {
242
242
  dryRun: false,
243
243
  signal: new AbortController().signal,
244
244
  symbolicatedStack,
245
+ undoRedoNavigation: null,
245
246
  })
246
247
  .then((result) => {
247
248
  if (!result.success) {
@@ -81,6 +81,7 @@ const ElementLibraryButton = () => {
81
81
  selectedId: null,
82
82
  style: elementLibraryDropdownSegmentStyle,
83
83
  title: 'Choose an Element library to browse inside Studio.',
84
+ tooltipLabel: null,
84
85
  type: 'menu',
85
86
  values: [
86
87
  {
@@ -5,7 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const client_id_1 = require("../../helpers/client-id");
7
7
  const colors_1 = require("../../helpers/colors");
8
- const get_git_menu_item_1 = require("../../helpers/get-git-menu-item");
9
8
  const react_2 = require("../../icons/react");
10
9
  const InlineEditableTitle_1 = require("../InlineEditableTitle");
11
10
  const InspectorInfoHeader_1 = require("../InspectorInfoHeader");
@@ -48,8 +47,7 @@ const externalTabIndicatorStyle = {
48
47
  width: 12,
49
48
  };
50
49
  const useSequenceInspectorSourceLocation = (sequence) => {
51
- const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_apps_1.useOpenSequenceInApps)(sequence);
52
- const canOpenInGitHub = (0, get_git_menu_item_1.hasReadOnlyGitSource)();
50
+ const { canOpenSource, openSource, originalLocation } = (0, use_open_sequence_in_apps_1.useOpenSequenceInApps)(sequence);
53
51
  const validatedLocation = (0, react_1.useMemo)(() => {
54
52
  var _a;
55
53
  if (!originalLocation ||
@@ -64,16 +62,10 @@ const useSequenceInspectorSourceLocation = (sequence) => {
64
62
  };
65
63
  }, [originalLocation]);
66
64
  const openFileLocation = (0, react_1.useCallback)(() => {
67
- if (canOpenInEditor) {
68
- openInEditor(null);
69
- return;
70
- }
71
- if (canOpenInGitHub && validatedLocation) {
72
- (0, get_git_menu_item_1.openGitSource)({ folder: false, location: validatedLocation });
73
- }
74
- }, [canOpenInEditor, canOpenInGitHub, openInEditor, validatedLocation]);
65
+ openSource();
66
+ }, [openSource]);
75
67
  return {
76
- canOpen: validatedLocation !== null && (canOpenInEditor || canOpenInGitHub),
68
+ canOpen: validatedLocation !== null && canOpenSource,
77
69
  openFileLocation,
78
70
  validatedLocation,
79
71
  };
@@ -207,21 +207,30 @@ const hasSequenceControls = (sequence) => {
207
207
  exports.hasSequenceControls = hasSequenceControls;
208
208
  const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
209
209
  var _a;
210
+ var _b;
210
211
  const { tree, propStatuses, runtimeValues } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
211
212
  sequence,
212
213
  nodePathInfo,
213
214
  includeTextContent: true,
214
215
  includeSourceControls: true,
215
216
  });
216
- const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
217
+ const { inspectorRevealRequest, selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
217
218
  const selectedEffect = selectedItems.length === 1 &&
218
219
  (selectedItems[0].type === 'sequence-effect' ||
219
220
  selectedItems[0].type === 'sequence-effect-prop')
220
221
  ? selectedItems[0]
221
222
  : null;
222
223
  const selectedEffectKey = selectedEffect === null ? null : (0, TimelineSelection_1.getTimelineSelectionKey)(selectedEffect);
224
+ const inspectorRevealItem = inspectorRevealRequest === null || inspectorRevealRequest === void 0 ? void 0 : inspectorRevealRequest.item;
225
+ const inspectorRevealItemKey = (inspectorRevealItem === null || inspectorRevealItem === void 0 ? void 0 : inspectorRevealItem.type) === 'sequence-effect' ||
226
+ (inspectorRevealItem === null || inspectorRevealItem === void 0 ? void 0 : inspectorRevealItem.type) === 'sequence-effect-prop'
227
+ ? (0, TimelineSelection_1.getTimelineSelectionKey)(inspectorRevealItem)
228
+ : null;
229
+ const inspectorRevealToken = inspectorRevealItemKey === selectedEffectKey
230
+ ? ((_b = inspectorRevealRequest === null || inspectorRevealRequest === void 0 ? void 0 : inspectorRevealRequest.token) !== null && _b !== void 0 ? _b : null)
231
+ : null;
223
232
  const selectedEffectRowRef = (0, react_1.useRef)(null);
224
- const scrolledEffectKey = (0, react_1.useRef)(null);
233
+ const scrolledInspectorRevealToken = (0, react_1.useRef)(null);
225
234
  const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(loadInspectorCollapsedKeys);
226
235
  const [sectionExpansionOverrides, setSectionExpansionOverrides] = (0, react_1.useState)(loadInspectorSectionExpansionOverrides);
227
236
  const [automaticSectionExpansion, setAutomaticSectionExpansion] = (0, react_1.useState)({});
@@ -310,7 +319,8 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
310
319
  }, [getIsExpanded, tree]);
311
320
  (0, react_1.useEffect)(() => {
312
321
  if (selectedEffectKey === null ||
313
- scrolledEffectKey.current === selectedEffectKey) {
322
+ inspectorRevealToken === null ||
323
+ scrolledInspectorRevealToken.current === inspectorRevealToken) {
314
324
  return;
315
325
  }
316
326
  const rows = (0, timeline_layout_1.flattenVisibleTreeNodes)({
@@ -344,19 +354,18 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
344
354
  persistInspectorCollapsedKeys(next);
345
355
  return next;
346
356
  });
347
- }, [selectedEffectKey, tree]);
357
+ }, [inspectorRevealToken, selectedEffectKey, tree]);
348
358
  (0, react_1.useEffect)(() => {
349
- if (selectedEffectKey === null) {
350
- scrolledEffectKey.current = null;
359
+ if (inspectorRevealToken === null) {
351
360
  return;
352
361
  }
353
- if (scrolledEffectKey.current === selectedEffectKey ||
362
+ if (scrolledInspectorRevealToken.current === inspectorRevealToken ||
354
363
  selectedEffectRowRef.current === null) {
355
364
  return;
356
365
  }
357
366
  selectedEffectRowRef.current.scrollIntoView({ block: 'center' });
358
- scrolledEffectKey.current = selectedEffectKey;
359
- }, [effectRows, selectedEffectKey]);
367
+ scrolledInspectorRevealToken.current = inspectorRevealToken;
368
+ }, [effectRows, inspectorRevealToken]);
360
369
  const effectSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(effectRows), [effectRows]);
361
370
  const controlGroups = (0, react_1.useMemo)(() => getInspectorControlGroups(controlRows), [controlRows]);
362
371
  const layoutGroup = controlGroups.find((group) => group.id === 'layout');
@@ -10,6 +10,7 @@ const loop_1 = require("../state/loop");
10
10
  const ActionTooltip_1 = require("./ActionTooltip");
11
11
  const ControlButton_1 = require("./ControlButton");
12
12
  const accessibilityLabel = 'Loop';
13
+ const buttonStyle = { width: 30 };
13
14
  const toggleLoop = (setLoop) => {
14
15
  setLoop((currentLoop) => {
15
16
  (0, loop_1.persistLoopOption)(!currentLoop);
@@ -24,6 +25,6 @@ const LoopToggle = ({ loop, setLoop }) => {
24
25
  const onClick = (0, react_1.useCallback)(() => {
25
26
  (0, exports.toggleLoop)(setLoop);
26
27
  }, [setLoop]);
27
- return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, "aria-pressed": loop, onClick: onClick, children: (color) => (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: jsx_runtime_1.jsx("path", { fill: loop ? colors_1.BLUE : color, d: "M384 150.3V41.6l64 53.3v2l-64 53.3zM352 23.5V80H192C86 80 0 166 0 272c0 8.8 7.2 16 16 16s16-7.2 16-16c0-88.4 71.6-160 160-160h160v56.5c0 13 10.5 23.5 23.5 23.5 5.5 0 10.8-1.9 15-5.4l78-65c7.3-6.1 11.5-15.1 11.5-24.6v-2c0-9.5-4.2-18.5-11.5-24.6l-78-65c-4.2-3.5-9.5-5.4-15-5.4-13 0-23.5 10.5-23.5 23.5zM128 415.9v54.5l-64-53.3v-2l64-53.3v54.1zM160 400v-56.5c0-13-10.5-23.5-23.5-23.5-5.5 0-10.8 1.9-15 5.4l-78 65C36.2 396.5 32 405.5 32 415v2c0 9.5 4.2 18.5 11.5 24.6l78 65c4.2 3.5 9.5 5.4 15 5.4 13 0 23.5-10.5 23.5-23.5V432h160c106 0 192-86 192-192 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 88.4-71.6 160-160 160H160z" }) })) }) }));
28
+ return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, "aria-pressed": loop, onClick: onClick, style: buttonStyle, children: (color) => (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: jsx_runtime_1.jsx("path", { fill: loop ? colors_1.BLUE : color, d: "M384 150.3V41.6l64 53.3v2l-64 53.3zM352 23.5V80H192C86 80 0 166 0 272c0 8.8 7.2 16 16 16s16-7.2 16-16c0-88.4 71.6-160 160-160h160v56.5c0 13 10.5 23.5 23.5 23.5 5.5 0 10.8-1.9 15-5.4l78-65c7.3-6.1 11.5-15.1 11.5-24.6v-2c0-9.5-4.2-18.5-11.5-24.6l-78-65c-4.2-3.5-9.5-5.4-15-5.4-13 0-23.5 10.5-23.5 23.5zM128 415.9v54.5l-64-53.3v-2l64-53.3v54.1zM160 400v-56.5c0-13-10.5-23.5-23.5-23.5-5.5 0-10.8 1.9-15 5.4l-78 65C36.2 396.5 32 405.5 32 415v2c0 9.5 4.2 18.5 11.5 24.6l78 65c4.2 3.5 9.5 5.4 15 5.4 13 0 23.5-10.5 23.5-23.5V432h160c106 0 192-86 192-192 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 88.4-71.6 160-160 160H160z" }) })) }) }));
28
29
  };
29
30
  exports.LoopToggle = LoopToggle;
@@ -86,8 +86,7 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
86
86
  event: e.nativeEvent,
87
87
  captureTarget: e.currentTarget,
88
88
  onEnd: (reason, evt) => {
89
- if ((reason === 'pointerup' || reason === 'buttons-released') &&
90
- evt) {
89
+ if ((0, pointer_session_1.isPointerSessionRelease)(reason, evt)) {
91
90
  const target = document.elementFromPoint(evt.clientX, evt.clientY);
92
91
  if (!target || !(0, is_menu_item_1.isMenuItem)(target)) {
93
92
  onItemQuit();
@@ -53,7 +53,7 @@ const MenuBuildIndicator = ({ mobileLayout }) => {
53
53
  };
54
54
  }, []);
55
55
  return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [
56
- 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("div", { style: openInEditor, children: 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: [
56
+ 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("div", { style: openInEditor, children: jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: folderLocation, locationType: "folder", showTooltips: true }) }), mobileLayout ? null : jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), mobileLayout ? (isBuilding ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
57
57
  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 }) })
58
58
  ] })) : 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 }))] }));
59
59
  };
@@ -11,6 +11,7 @@ const client_id_1 = require("../helpers/client-id");
11
11
  const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
12
12
  const modals_1 = require("../state/modals");
13
13
  const AskAiModal_1 = require("./AskAiModal");
14
+ const AssetSelectorModal_1 = require("./AssetSelectorModal");
14
15
  const call_api_1 = require("./call-api");
15
16
  const ConfirmationDialog_1 = require("./ConfirmationDialog");
16
17
  const EffectPickerModal_1 = require("./EffectPickerModal");
@@ -109,6 +110,6 @@ const Modals = ({ readOnlyStudio }) => {
109
110
  modalContextType.initialTab === 'packages' ||
110
111
  modalContextType.initialTab === 'shortcuts') ? (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)) : null, modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
111
112
  modalContextType.type === 'server-render' &&
112
- (canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'transcribe' ? (jsx_runtime_1.jsx(TranscriptionModalWithOptionalWhisper_1.TranscriptionModalWithOptionalWhisper, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'video-matting' ? (jsx_runtime_1.jsx(VideoMattingModalWithOptionalPackage_1.VideoMattingModalWithOptionalPackage, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'element-library' && (jsx_runtime_1.jsx(ElementLibraryModal_1.ElementLibraryModal, { name: modalContextType.name, url: modalContextType.url })), modalContextType && modalContextType.type === 'element-install' && (jsx_runtime_1.jsx(ElementInstallConfirmation_1.ElementInstallConfirmation, { state: modalContextType })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
113
+ (canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'transcribe' ? (jsx_runtime_1.jsx(TranscriptionModalWithOptionalWhisper_1.TranscriptionModalWithOptionalWhisper, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'video-matting' ? (jsx_runtime_1.jsx(VideoMattingModalWithOptionalPackage_1.VideoMattingModalWithOptionalPackage, { state: modalContextType })) : null, modalContextType && modalContextType.type === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'asset-selection' ? (jsx_runtime_1.jsx(AssetSelectorModal_1.AssetSelectorModal, { readOnlyStudio: readOnlyStudio, state: modalContextType })) : null, modalContextType && modalContextType.type === 'element-library' && (jsx_runtime_1.jsx(ElementLibraryModal_1.ElementLibraryModal, { name: modalContextType.name, url: modalContextType.url })), modalContextType && modalContextType.type === 'element-install' && (jsx_runtime_1.jsx(ElementInstallConfirmation_1.ElementInstallConfirmation, { state: modalContextType })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
113
114
  };
114
115
  exports.Modals = Modals;
@@ -10,6 +10,7 @@ const media_volume_1 = require("../icons/media-volume");
10
10
  const mute_1 = require("../state/mute");
11
11
  const ActionTooltip_1 = require("./ActionTooltip");
12
12
  const ControlButton_1 = require("./ControlButton");
13
+ const buttonStyle = { width: 30 };
13
14
  const toggleMute = (setMuted) => {
14
15
  setMuted((muted) => {
15
16
  (0, mute_1.persistMuteOption)(!muted);
@@ -25,6 +26,6 @@ const MuteToggle = ({ muted, setMuted }) => {
25
26
  (0, exports.toggleMute)(setMuted);
26
27
  }, [setMuted]);
27
28
  const accessibilityLabel = muted ? 'Unmute video' : 'Mute video';
28
- return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, onClick: onClick, children: (color) => muted ? (jsx_runtime_1.jsx(media_volume_1.VolumeOffIcon, { color: colors_1.BLUE })) : (jsx_runtime_1.jsx(media_volume_1.VolumeOnIcon, { color: color })) }) }));
29
+ return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Mute", shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, onClick: onClick, style: buttonStyle, children: (color) => muted ? (jsx_runtime_1.jsx(media_volume_1.VolumeOffIcon, { color: colors_1.BLUE })) : (jsx_runtime_1.jsx(media_volume_1.VolumeOnIcon, { color: color })) }) }));
29
30
  };
30
31
  exports.MuteToggle = MuteToggle;
@@ -80,6 +80,7 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, errorNotifi
80
80
  dryRun: true,
81
81
  symbolicatedStack,
82
82
  signal,
83
+ undoRedoNavigation: null,
83
84
  });
84
85
  if (res.success) {
85
86
  setCanApplyCodemod({ type: 'success', diff: res.diff });
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeleteComposition = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const url_state_1 = require("../../helpers/url-state");
8
+ const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
9
+ const load_canvas_content_from_url_1 = require("../load-canvas-content-from-url");
6
10
  const styles_1 = require("../Menu/styles");
7
11
  const ModalFooter_1 = require("../ModalFooter");
8
12
  const ModalHeader_1 = require("../ModalHeader");
@@ -24,6 +28,10 @@ const DeleteCompositionLoaded = ({ compositionId }) => {
24
28
  }
25
29
  const { unresolved } = context;
26
30
  const compositionStack = (_a = unresolved.stack) !== null && _a !== void 0 ? _a : null;
31
+ const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
32
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
33
+ const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
34
+ const navigationAfterDelete = (0, react_1.useRef)(undefined);
27
35
  const codemod = (0, react_1.useMemo)(() => {
28
36
  return {
29
37
  type: 'delete-composition',
@@ -33,18 +41,46 @@ const DeleteCompositionLoaded = ({ compositionId }) => {
33
41
  const onSubmit = (0, react_1.useCallback)((e) => {
34
42
  e.preventDefault();
35
43
  }, []);
44
+ const onSuccess = (0, react_1.useCallback)(() => {
45
+ if (navigationAfterDelete.current === undefined) {
46
+ return;
47
+ }
48
+ if (navigationAfterDelete.current === null) {
49
+ (0, url_state_1.pushUrl)('/');
50
+ setCanvasContent(null);
51
+ return;
52
+ }
53
+ selectComposition(navigationAfterDelete.current, true);
54
+ }, [selectComposition, setCanvasContent]);
36
55
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
37
56
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: 'Delete composition' }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
38
57
  jsx_runtime_1.jsxs("div", { style: content, children: ["Do you want to delete the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: unresolved.durationInFrames === 1 ? `<Still>` : '<Composition>' }), ' ', "with ID ", '"', unresolved.id, '"', "?",
39
58
  jsx_runtime_1.jsx("br", {}),
40
59
  "The associated ",
41
60
  jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "component" }),
42
- " will remain in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting', genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: true, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
43
- codemod,
44
- dryRun: false,
45
- signal,
46
- symbolicatedStack,
47
- }), applyCodemodForPreview: null }) })
61
+ " will remain in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting', genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: true, onSuccess: onSuccess, applyCodemod: ({ signal, symbolicatedStack }) => {
62
+ var _a;
63
+ const currentRoute = (0, url_state_1.getRoute)();
64
+ const currentCanvasContent = (0, load_canvas_content_from_url_1.deriveCanvasContentFromUrl)();
65
+ const isSelected = (currentCanvasContent === null || currentCanvasContent === void 0 ? void 0 : currentCanvasContent.type) === 'composition' &&
66
+ currentCanvasContent.compositionId === compositionId;
67
+ const fallback = isSelected
68
+ ? ((_a = compositions.find(({ id }) => id !== compositionId)) !== null && _a !== void 0 ? _a : null)
69
+ : undefined;
70
+ navigationAfterDelete.current = fallback;
71
+ return (0, actions_1.applyCodemod)({
72
+ codemod,
73
+ dryRun: false,
74
+ signal,
75
+ symbolicatedStack,
76
+ undoRedoNavigation: fallback === undefined
77
+ ? null
78
+ : {
79
+ undoRoute: currentRoute,
80
+ redoRoute: fallback === null ? '/' : `/${fallback.id}`,
81
+ },
82
+ });
83
+ }, applyCodemodForPreview: null }) })
48
84
  ] })
49
85
  ] }));
50
86
  };
@@ -38,6 +38,7 @@ const DeleteFolder = ({ folderName, parentName, stack }) => {
38
38
  dryRun: false,
39
39
  signal,
40
40
  symbolicatedStack,
41
+ undoRedoNavigation: null,
41
42
  }), applyCodemodForPreview: null }) })
42
43
  ] })
43
44
  ] }));
@@ -208,11 +208,16 @@ const DuplicateCompositionLoaded = ({ initialType }) => {
208
208
  dryRun: false,
209
209
  signal,
210
210
  symbolicatedStack,
211
+ undoRedoNavigation: {
212
+ undoRoute: (0, url_state_1.getRoute)(),
213
+ redoRoute: `/${newId}`,
214
+ },
211
215
  }), applyCodemodForPreview: ({ signal, symbolicatedStack }) => (0, duplicate_composition_api_1.duplicateComposition)({
212
216
  codemod,
213
217
  dryRun: true,
214
218
  signal,
215
219
  symbolicatedStack,
220
+ undoRedoNavigation: null,
216
221
  }) }) })
217
222
  ] })
218
223
  ] }));
@@ -490,11 +490,11 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
490
490
  event: e.nativeEvent,
491
491
  captureTarget: target,
492
492
  onMove: moveListener,
493
- onEnd: (reason) => {
493
+ onEnd: (reason, endEvent) => {
494
494
  pointerDownRef.current = false;
495
495
  setDragging(false);
496
496
  (0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
497
- const commit = reason === 'pointerup' || reason === 'buttons-released';
497
+ const commit = (0, pointer_session_1.isPointerSessionRelease)(reason, endEvent);
498
498
  if (commit && lastDragValue !== null && onValueChangeEnd) {
499
499
  onValueChangeEnd(lastDragValue, 'drag');
500
500
  }
@@ -4,8 +4,11 @@ exports.NewFolder = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const create_folder_tree_1 = require("../../helpers/create-folder-tree");
8
+ const persist_open_folders_1 = require("../../helpers/persist-open-folders");
7
9
  const slugify_name_1 = require("../../helpers/slugify-name");
8
10
  const validate_new_folder_name_1 = require("../../helpers/validate-new-folder-name");
11
+ const folders_1 = require("../../state/folders");
9
12
  const layout_1 = require("../layout");
10
13
  const ModalFooter_1 = require("../ModalFooter");
11
14
  const ModalHeader_1 = require("../ModalHeader");
@@ -24,6 +27,10 @@ const content = {
24
27
  fontSize: 13,
25
28
  minWidth: 500,
26
29
  };
30
+ const parentNameStyle = {
31
+ ...layout_2.rightRow,
32
+ fontSize: 13,
33
+ };
27
34
  const getUniqueFolderName = ({ folders, parentName, }) => {
28
35
  let counter = 1;
29
36
  while (true) {
@@ -37,6 +44,7 @@ const getUniqueFolderName = ({ folders, parentName, }) => {
37
44
  };
38
45
  const NewFolder = ({ parentName, stack }) => {
39
46
  const { folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
47
+ const { setCompositionFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
40
48
  const [newName, setName] = (0, react_1.useState)(() => getUniqueFolderName({ folders, parentName }));
41
49
  const inputRef = (0, react_1.useRef)(null);
42
50
  (0, react_1.useEffect)(() => {
@@ -63,21 +71,40 @@ const NewFolder = ({ parentName, stack }) => {
63
71
  const onSubmit = (0, react_1.useCallback)((e) => {
64
72
  e.preventDefault();
65
73
  }, []);
74
+ const onSuccess = (0, react_1.useCallback)(() => {
75
+ if (parentName === null) {
76
+ return;
77
+ }
78
+ const parentFolder = (0, create_folder_tree_1.splitParentIntoNameAndParent)(parentName);
79
+ const parentFolderName = parentFolder.name;
80
+ if (parentFolderName === null) {
81
+ return;
82
+ }
83
+ setCompositionFoldersExpanded((previousState) => {
84
+ const foldersExpanded = { ...previousState };
85
+ for (const key of (0, create_folder_tree_1.getKeysToExpand)(parentFolderName, parentFolder.parent)) {
86
+ foldersExpanded[key] = true;
87
+ }
88
+ (0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpanded);
89
+ return foldersExpanded;
90
+ });
91
+ }, [parentName, setCompositionFoldersExpanded]);
66
92
  return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
67
93
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New folder" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
68
94
  jsx_runtime_1.jsxs("div", { style: content, children: [parentName ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
69
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Parent" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: parentName })
95
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Parent" }), jsx_runtime_1.jsx("div", { style: parentNameStyle, children: parentName })
70
96
  ] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
71
97
  jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
72
98
  jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), jsx_runtime_1.jsx(SlugPreview_1.SlugPreview, { action: "create", currentName: null, input: newName, slug: folderName }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
73
99
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
74
100
  ] })) : null] }) })
75
101
  ] })
76
- ] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Creating folder...', errorNotification: 'Could not create folder', genericSubmitLabel: 'Add to root file', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, fallbackToRootFile: true, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
102
+ ] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Creating folder...', errorNotification: 'Could not create folder', genericSubmitLabel: 'Add to root file', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: onSuccess, fallbackToRootFile: true, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
77
103
  codemod,
78
104
  dryRun: false,
79
105
  signal,
80
106
  symbolicatedStack,
107
+ undoRedoNavigation: null,
81
108
  }), applyCodemodForPreview: null }) })
82
109
  ] })
83
110
  ] }));
@@ -72,6 +72,7 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
72
72
  dryRun: false,
73
73
  signal,
74
74
  symbolicatedStack,
75
+ undoRedoNavigation: null,
75
76
  }), applyCodemodForPreview: null }) })
76
77
  ] })
77
78
  ] }));
@@ -1,5 +1,5 @@
1
- import type { DuplicateCompositionResponse, SymbolicatedStackFrame } from '@remotion/studio-shared';
2
- export declare const duplicateComposition: ({ codemod, dryRun, signal, symbolicatedStack, }: {
1
+ import type { DuplicateCompositionResponse, SymbolicatedStackFrame, UndoRedoNavigation } from '@remotion/studio-shared';
2
+ export declare const duplicateComposition: ({ codemod, dryRun, signal, symbolicatedStack, undoRedoNavigation, }: {
3
3
  codemod: {
4
4
  type: "duplicate-composition";
5
5
  idToDuplicate: string;
@@ -13,4 +13,5 @@ export declare const duplicateComposition: ({ codemod, dryRun, signal, symbolica
13
13
  dryRun: boolean;
14
14
  signal: AbortSignal;
15
15
  symbolicatedStack: SymbolicatedStackFrame | null;
16
+ undoRedoNavigation: UndoRedoNavigation | null;
16
17
  }) => Promise<DuplicateCompositionResponse>;