@remotion/studio 4.0.499 → 4.0.501

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 (204) hide show
  1. package/dist/Studio.js +1 -1
  2. package/dist/api/delete-static-file.js +8 -3
  3. package/dist/api/rename-static-file.js +8 -0
  4. package/dist/api/watch-public-folder.js +2 -1
  5. package/dist/api/watch-static-file.js +2 -1
  6. package/dist/api/write-static-file.js +8 -3
  7. package/dist/components/AssetSelector.js +11 -7
  8. package/dist/components/AssetSelectorItem.d.ts +25 -0
  9. package/dist/components/AssetSelectorItem.js +116 -80
  10. package/dist/components/Canvas.js +6 -1
  11. package/dist/components/CaptionInspector.d.ts +10 -0
  12. package/dist/components/CaptionInspector.js +24 -0
  13. package/dist/components/CaptionTextEditor.d.ts +9 -0
  14. package/dist/components/CaptionTextEditor.js +132 -0
  15. package/dist/components/CompositionSelector.js +2 -32
  16. package/dist/components/ControlButton.js +1 -0
  17. package/dist/components/CurrentAsset.js +3 -2
  18. package/dist/components/EditorContexts.d.ts +0 -1
  19. package/dist/components/EditorContexts.js +2 -2
  20. package/dist/components/ExplorerPanel.js +2 -1
  21. package/dist/components/ExplorerPanelRef.d.ts +2 -0
  22. package/dist/components/FpsCounter.js +3 -3
  23. package/dist/components/FullscreenToggle.js +2 -1
  24. package/dist/components/GlobalKeybindings.js +9 -1
  25. package/dist/components/InitialCompositionLoader.d.ts +1 -1
  26. package/dist/components/InlineAction.d.ts +2 -1
  27. package/dist/components/InlineAction.js +3 -2
  28. package/dist/components/InlineCaptionInspector.d.ts +11 -0
  29. package/dist/components/InlineCaptionInspector.js +108 -0
  30. package/dist/components/InlineDropdown.d.ts +1 -1
  31. package/dist/components/InlineDropdown.js +3 -2
  32. package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
  33. package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
  34. package/dist/components/InspectorPanel/CompositionInspector.js +12 -9
  35. package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
  36. package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
  37. package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
  38. package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
  39. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
  40. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
  41. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +10 -10
  42. package/dist/components/InspectorPanel/common.d.ts +17 -4
  43. package/dist/components/InspectorPanel/common.js +60 -6
  44. package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
  45. package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
  46. package/dist/components/InspectorPanel/styles.js +7 -1
  47. package/dist/components/InspectorPanel/use-composition-actions.d.ts +3 -0
  48. package/dist/components/InspectorPanel/use-composition-actions.js +91 -5
  49. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
  50. package/dist/components/InspectorPanel.js +2 -2
  51. package/dist/components/InspectorSequenceSection.d.ts +2 -1
  52. package/dist/components/InspectorSequenceSection.js +279 -25
  53. package/dist/components/KeyboardShortcutsExplainer.js +4 -2
  54. package/dist/components/Menu/MenuItem.js +2 -1
  55. package/dist/components/MenuCompositionName.js +30 -7
  56. package/dist/components/MenuToolbar.d.ts +0 -1
  57. package/dist/components/MenuToolbar.js +15 -7
  58. package/dist/components/MobilePanel.d.ts +2 -1
  59. package/dist/components/MobilePanel.js +29 -25
  60. package/dist/components/ModalContainer.d.ts +1 -0
  61. package/dist/components/ModalContainer.js +2 -2
  62. package/dist/components/Modals.js +1 -1
  63. package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
  64. package/dist/components/NewComposition/DismissableModal.js +2 -2
  65. package/dist/components/NewComposition/InputDragger.d.ts +7 -0
  66. package/dist/components/NewComposition/InputDragger.js +119 -8
  67. package/dist/components/OutlineToggle.d.ts +1 -3
  68. package/dist/components/OutlineToggle.js +2 -2
  69. package/dist/components/PreviewToolbar.js +10 -4
  70. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
  71. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +45 -0
  72. package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
  73. package/dist/components/QuickSwitcher/NoResults.js +1 -0
  74. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +10 -0
  75. package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
  76. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +10 -0
  77. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +95 -13
  78. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
  79. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
  80. package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
  81. package/dist/components/QuickSwitcher/asset-search.js +42 -0
  82. package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
  83. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
  84. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
  85. package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
  86. package/dist/components/SelectedOutlineCropControls.js +299 -0
  87. package/dist/components/SelectedOutlineElement.js +84 -47
  88. package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
  89. package/dist/components/SelectedOutlineOverlay.js +147 -16
  90. package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
  91. package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
  92. package/dist/components/ShowOutlinesProvider.js +4 -1
  93. package/dist/components/SidebarCollapserControls.d.ts +3 -1
  94. package/dist/components/SidebarCollapserControls.js +34 -29
  95. package/dist/components/SnappingToggle.d.ts +1 -3
  96. package/dist/components/SnappingToggle.js +2 -2
  97. package/dist/components/Timeline/Timeline.js +19 -5
  98. package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
  99. package/dist/components/Timeline/TimelineAssetField.js +53 -100
  100. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
  101. package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
  102. package/dist/components/Timeline/TimelineColorField.js +20 -1
  103. package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
  104. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -1
  105. package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
  106. package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
  107. package/dist/components/Timeline/TimelineList.d.ts +2 -2
  108. package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
  109. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +10 -2
  110. package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
  111. package/dist/components/Timeline/TimelineRowChrome.js +4 -3
  112. package/dist/components/Timeline/TimelineSelection.d.ts +9 -7
  113. package/dist/components/Timeline/TimelineSelection.js +17 -12
  114. package/dist/components/Timeline/TimelineSequence.js +2 -9
  115. package/dist/components/Timeline/TimelineSequenceItem.js +61 -15
  116. package/dist/components/Timeline/TimelineSequencePropItem.js +36 -85
  117. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
  118. package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
  119. package/dist/components/Timeline/TimelineTrack.js +4 -2
  120. package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
  121. package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
  122. package/dist/components/Timeline/border-radius-representation.js +60 -0
  123. package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
  124. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  125. package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
  126. package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
  127. package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
  128. package/dist/components/Timeline/reset-selected-timeline-props.js +20 -18
  129. package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
  130. package/dist/components/Timeline/save-effect-prop.js +52 -1
  131. package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
  132. package/dist/components/Timeline/save-sequence-prop.js +25 -1
  133. package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
  134. package/dist/components/Timeline/timeline-asset-link.js +17 -1
  135. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  136. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
  137. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
  138. package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
  139. package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
  140. package/dist/components/TopPanel.js +2 -2
  141. package/dist/components/UndoRedoButtons.js +42 -11
  142. package/dist/components/composition-drop-preview.js +1 -0
  143. package/dist/components/handle-drop.d.ts +3 -2
  144. package/dist/components/handle-drop.js +2 -1
  145. package/dist/components/import-assets.d.ts +4 -2
  146. package/dist/components/import-assets.js +20 -7
  147. package/dist/components/menu-toolbar-height.d.ts +1 -0
  148. package/dist/components/menu-toolbar-height.js +4 -0
  149. package/dist/components/selected-outline-drag.d.ts +41 -4
  150. package/dist/components/selected-outline-drag.js +179 -2
  151. package/dist/components/selected-outline-geometry.d.ts +1 -0
  152. package/dist/components/selected-outline-measurement.d.ts +11 -0
  153. package/dist/components/selected-outline-measurement.js +64 -3
  154. package/dist/components/selected-outline-types.d.ts +44 -1
  155. package/dist/components/selected-outline-types.js +21 -1
  156. package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
  157. package/dist/components/use-element-overwrite-confirmation.js +73 -0
  158. package/dist/components/use-static-files.js +7 -2
  159. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
  160. package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
  161. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
  162. package/dist/esm/{chunk-pk1zwsn1.js → chunk-n1kj09yv.js} +10618 -8002
  163. package/dist/esm/index.mjs +24 -8
  164. package/dist/esm/internals.mjs +10618 -8002
  165. package/dist/esm/previewEntry.mjs +40002 -37388
  166. package/dist/esm/renderEntry.mjs +1 -1
  167. package/dist/helpers/browser-studio-operations.d.ts +3 -0
  168. package/dist/helpers/browser-studio-operations.js +14 -0
  169. package/dist/helpers/calculate-timeline.d.ts +2 -2
  170. package/dist/helpers/calculate-timeline.js +8 -28
  171. package/dist/helpers/client-id.d.ts +0 -1
  172. package/dist/helpers/client-id.js +15 -10
  173. package/dist/helpers/download-blob.d.ts +1 -0
  174. package/dist/helpers/download-blob.js +15 -0
  175. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
  176. package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
  177. package/dist/helpers/inject-css.js +5 -3
  178. package/dist/helpers/interactivity-enabled.d.ts +1 -0
  179. package/dist/helpers/interactivity-enabled.js +7 -2
  180. package/dist/helpers/is-mac.d.ts +1 -0
  181. package/dist/helpers/is-mac.js +4 -0
  182. package/dist/helpers/open-in-editor.d.ts +5 -1
  183. package/dist/helpers/open-in-editor.js +39 -4
  184. package/dist/helpers/preview-server-events.js +46 -9
  185. package/dist/helpers/sort-by-nonce-history.js +97 -19
  186. package/dist/helpers/use-create-composition.js +8 -6
  187. package/dist/helpers/use-keybinding.js +2 -3
  188. package/dist/helpers/use-menu-structure.js +39 -1
  189. package/dist/hot-middleware-client/client.js +3 -3
  190. package/dist/icons/border-radius.d.ts +4 -0
  191. package/dist/icons/border-radius.js +8 -0
  192. package/dist/icons/caret.d.ts +1 -0
  193. package/dist/icons/caret.js +2 -2
  194. package/dist/icons/fullscreen.d.ts +4 -0
  195. package/dist/icons/fullscreen.js +6 -0
  196. package/dist/icons/pen.d.ts +5 -0
  197. package/dist/icons/pen.js +8 -0
  198. package/dist/previewEntry.js +1 -1
  199. package/dist/state/modals.d.ts +9 -0
  200. package/dist/state/timeline-sequence-hover.d.ts +17 -0
  201. package/dist/state/timeline-sequence-hover.js +33 -0
  202. package/package.json +13 -12
  203. package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
  204. package/dist/helpers/get-timeline-sequence-hash.js +0 -33
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBorderRadiusConversion = exports.getBorderRadiusConversionChanges = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
5
+ Object.defineProperty(exports, "BORDER_RADIUS_LONGHAND_KEYS", { enumerable: true, get: function () { return studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS; } });
6
+ Object.defineProperty(exports, "BORDER_RADIUS_SHORTHAND_KEY", { enumerable: true, get: function () { return studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY; } });
7
+ const getBorderRadiusConversionChanges = (conversion) => {
8
+ if (conversion.type === 'individual') {
9
+ return [
10
+ { fieldKey: studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY, value: undefined },
11
+ ...studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map((fieldKey) => ({
12
+ fieldKey,
13
+ value: conversion.value,
14
+ })),
15
+ ];
16
+ }
17
+ return [
18
+ ...studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map((fieldKey) => ({
19
+ fieldKey,
20
+ value: undefined,
21
+ })),
22
+ { fieldKey: studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY, value: conversion.value },
23
+ ];
24
+ };
25
+ exports.getBorderRadiusConversionChanges = getBorderRadiusConversionChanges;
26
+ const getBorderRadiusConversion = (props, dragOverrides = {}) => {
27
+ const getStaticValue = (key) => {
28
+ const status = props === null || props === void 0 ? void 0 : props[key];
29
+ if (status !== undefined && status.status !== 'static') {
30
+ return { isStatic: false, value: undefined };
31
+ }
32
+ const dragOverride = dragOverrides[key];
33
+ if ((dragOverride === null || dragOverride === void 0 ? void 0 : dragOverride.type) === 'keyframed') {
34
+ return { isStatic: false, value: undefined };
35
+ }
36
+ return {
37
+ isStatic: true,
38
+ value: (dragOverride === null || dragOverride === void 0 ? void 0 : dragOverride.type) === 'static'
39
+ ? dragOverride.value
40
+ : status === null || status === void 0 ? void 0 : status.codeValue,
41
+ };
42
+ };
43
+ const shorthand = getStaticValue(studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY);
44
+ if (shorthand.isStatic && typeof shorthand.value === 'number') {
45
+ return { type: 'individual', value: shorthand.value };
46
+ }
47
+ const longhands = studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map(getStaticValue);
48
+ const hasNoAuthoredRadius = [shorthand, ...longhands].every((status) => status.isStatic && status.value === undefined);
49
+ if (hasNoAuthoredRadius) {
50
+ return { type: 'individual', value: 0 };
51
+ }
52
+ if (longhands.every((status) => status.isStatic && typeof status.value === 'number')) {
53
+ const values = longhands.map((status) => status.value);
54
+ if (values.every((value) => value === values[0])) {
55
+ return { type: 'shorthand', value: values[0] };
56
+ }
57
+ }
58
+ return null;
59
+ };
60
+ exports.getBorderRadiusConversion = getBorderRadiusConversion;
@@ -46,12 +46,7 @@ const deleteSequencesFromSource = async (nodePathInfos, confirm) => {
46
46
  }),
47
47
  })
48
48
  .then((result) => {
49
- if (result.success) {
50
- (0, NotificationCenter_1.showNotification)(nodePathInfos.length === 1
51
- ? 'Removed sequence from source file'
52
- : 'Removed sequences from source files', 2000);
53
- }
54
- else {
49
+ if (!result.success) {
55
50
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
56
51
  }
57
52
  return true;
@@ -4,4 +4,4 @@ export declare const findTrackForNodePathInfo: ({ sequences, overrideIdsToNodePa
4
4
  sequences: TSequence[];
5
5
  overrideIdsToNodePaths: OverrideIdToNodePaths;
6
6
  nodePathInfo: SequenceNodePathInfo;
7
- }) => import("../../helpers/get-timeline-sequence-sort-key").TrackWithHash | undefined;
7
+ }) => import("../../helpers/get-timeline-sequence-sort-key").TimelineTrackData | undefined;
@@ -145,18 +145,20 @@ const getSequenceContextMenuItems = ({ assetLinkInfo, canOpenInEditor, deleteDis
145
145
  }
146
146
  : null,
147
147
  ...sourceActions,
148
- {
149
- type: 'item',
150
- id: 'disable-interactivity',
151
- keyHint: null,
152
- label: 'Disable interactivity',
153
- leftItem: null,
154
- disabled: disableInteractivityDisabled,
155
- onClick: onDisableSequenceInteractivity,
156
- quickSwitcherLabel: null,
157
- subMenu: null,
158
- value: 'disable-interactivity',
159
- },
148
+ includeSourceEditItems
149
+ ? {
150
+ type: 'item',
151
+ id: 'disable-interactivity',
152
+ keyHint: null,
153
+ label: 'Disable interactivity',
154
+ leftItem: null,
155
+ disabled: disableInteractivityDisabled,
156
+ onClick: onDisableSequenceInteractivity,
157
+ quickSwitcherLabel: null,
158
+ subMenu: null,
159
+ value: 'disable-interactivity',
160
+ }
161
+ : null,
160
162
  includeSourceEditItems
161
163
  ? {
162
164
  type: 'item',
@@ -0,0 +1,10 @@
1
+ import type { InteractivitySchema, SequencePropsSubscriptionKey } from 'remotion';
2
+ import type { SaveSequencePropChange } from './save-sequence-prop';
3
+ export declare const getSequencePropResetChanges: ({ fileName, nodePath, fieldKey, value, defaultValue, schema, }: {
4
+ readonly fileName: string;
5
+ readonly nodePath: SequencePropsSubscriptionKey;
6
+ readonly fieldKey: string;
7
+ readonly value: unknown;
8
+ readonly defaultValue: string | null;
9
+ readonly schema: InteractivitySchema;
10
+ }) => SaveSequencePropChange[];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSequencePropResetChanges = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
5
+ const remotion_1 = require("remotion");
6
+ const isVisibleFieldSchema = (fieldSchema) => fieldSchema !== undefined && fieldSchema.type !== 'hidden';
7
+ const getDefaultValue = (fieldSchema) => fieldSchema.default !== undefined
8
+ ? JSON.stringify(fieldSchema.default)
9
+ : null;
10
+ const getSequencePropResetChanges = ({ fileName, nodePath, fieldKey, value, defaultValue, schema, }) => {
11
+ const flatSchema = remotion_1.Internals.getFlatSchemaWithAllKeys(schema);
12
+ const longhandChanges = (0, studio_shared_1.getStylePropertyLonghandKeys)(fieldKey).flatMap((longhandKey) => {
13
+ const fieldSchema = flatSchema[longhandKey];
14
+ if (!isVisibleFieldSchema(fieldSchema)) {
15
+ return [];
16
+ }
17
+ return [
18
+ {
19
+ fileName,
20
+ nodePath,
21
+ fieldKey: longhandKey,
22
+ value: fieldSchema.default,
23
+ defaultValue: getDefaultValue(fieldSchema),
24
+ schema,
25
+ },
26
+ ];
27
+ });
28
+ return [
29
+ { fileName, nodePath, fieldKey, value, defaultValue, schema },
30
+ ...longhandChanges,
31
+ ];
32
+ };
33
+ exports.getSequencePropResetChanges = getSequencePropResetChanges;
@@ -4,6 +4,7 @@ exports.resetSelectedTimelineProps = exports.getTimelinePropResetTargets = void
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const remotion_1 = require("remotion");
6
6
  const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
7
+ const get_sequence_prop_reset_changes_1 = require("./get-sequence-prop-reset-changes");
7
8
  const save_effect_prop_1 = require("./save-effect-prop");
8
9
  const save_sequence_prop_1 = require("./save-sequence-prop");
9
10
  const isPropResetSelection = (selection) => selection.type === 'sequence-prop' ||
@@ -157,14 +158,7 @@ const resetSelectedTimelineProps = ({ selections, sequences, overrideIdsToNodePa
157
158
  resetPromises.push((0, save_sequence_prop_1.saveSequenceProps)({
158
159
  addedKeyframes: null,
159
160
  movedKeyframes: null,
160
- changes: sequencePropTargets.map((target) => ({
161
- fileName: target.fileName,
162
- nodePath: target.nodePath,
163
- fieldKey: target.fieldKey,
164
- value: target.value,
165
- defaultValue: target.defaultValue,
166
- schema: target.schema,
167
- })),
161
+ changes: sequencePropTargets.flatMap((target) => (0, get_sequence_prop_reset_changes_1.getSequencePropResetChanges)(target)),
168
162
  setPropStatuses,
169
163
  clientId,
170
164
  undoLabel: sequencePropTargets.length > 1
@@ -175,18 +169,26 @@ const resetSelectedTimelineProps = ({ selections, sequences, overrideIdsToNodePa
175
169
  : 'Reapply sequence prop',
176
170
  }));
177
171
  }
178
- for (const target of effectPropTargets) {
179
- resetPromises.push((0, save_effect_prop_1.saveEffectProp)({
180
- type: 'value',
181
- fileName: target.fileName,
182
- nodePath: target.nodePath,
183
- effectIndex: target.effectIndex,
184
- fieldKey: target.fieldKey,
185
- value: target.value,
186
- defaultValue: target.defaultValue,
187
- schema: target.schema,
172
+ if (effectPropTargets.length > 0) {
173
+ resetPromises.push((0, save_effect_prop_1.saveMultipleEffectProps)({
174
+ changes: effectPropTargets.map((target) => ({
175
+ type: 'value',
176
+ fileName: target.fileName,
177
+ nodePath: target.nodePath,
178
+ effectIndex: target.effectIndex,
179
+ fieldKey: target.fieldKey,
180
+ value: target.value,
181
+ defaultValue: target.defaultValue,
182
+ schema: target.schema,
183
+ })),
188
184
  setPropStatuses,
189
185
  clientId,
186
+ undoLabel: effectPropTargets.length > 1
187
+ ? 'Reset selected effect props'
188
+ : 'Reset effect prop',
189
+ redoLabel: effectPropTargets.length > 1
190
+ ? 'Reapply selected effect props'
191
+ : 'Reapply effect prop',
190
192
  }));
191
193
  }
192
194
  return Promise.all(resetPromises).then(() => undefined);
@@ -20,5 +20,15 @@ type SaveEffectPropEffectParam = SaveEffectPropBase & {
20
20
  effectParam: EffectClipboardParam;
21
21
  };
22
22
  type SaveEffectPropInput = SaveEffectPropValue | SaveEffectPropEffectParam;
23
+ type WithoutSaveContext<T> = T extends unknown ? Omit<T, 'setPropStatuses' | 'clientId'> : never;
24
+ type SaveMultipleEffectPropChange = WithoutSaveContext<SaveEffectPropInput>;
25
+ type SaveMultipleEffectPropsOptions = {
26
+ changes: SaveMultipleEffectPropChange[];
27
+ setPropStatuses: SetPropStatuses;
28
+ clientId: string;
29
+ undoLabel: string;
30
+ redoLabel: string;
31
+ };
32
+ export declare const saveMultipleEffectProps: ({ changes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveMultipleEffectPropsOptions) => Promise<void>;
23
33
  export declare const saveEffectProp: (input: SaveEffectPropInput) => Promise<void>;
24
34
  export {};
@@ -1,10 +1,61 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveEffectProp = void 0;
3
+ exports.saveEffectProp = exports.saveMultipleEffectProps = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const call_api_1 = require("../call-api");
6
6
  const apply_effect_response_to_prop_statuses_1 = require("./apply-effect-response-to-prop-statuses");
7
7
  const save_prop_queue_1 = require("./save-prop-queue");
8
+ const saveMultipleEffectProps = ({ changes, setPropStatuses, clientId, undoLabel, redoLabel, }) => {
9
+ if (changes.length === 0) {
10
+ return Promise.resolve();
11
+ }
12
+ for (const change of changes) {
13
+ if (change.type === 'effect-param') {
14
+ continue;
15
+ }
16
+ setPropStatuses(change.nodePath, (prev) => (0, studio_shared_1.optimisticUpdateForEffectPropStatuses)({
17
+ previous: prev,
18
+ effectIndex: change.effectIndex,
19
+ fieldKey: change.fieldKey,
20
+ value: change.value,
21
+ schema: change.schema,
22
+ }));
23
+ }
24
+ return (0, call_api_1.callApi)('/api/save-multiple-effect-props', {
25
+ edits: changes.map((change) => change.type === 'effect-param'
26
+ ? {
27
+ type: 'effect-param',
28
+ fileName: change.fileName,
29
+ sequenceNodePath: change.nodePath,
30
+ effectIndex: change.effectIndex,
31
+ key: change.fieldKey,
32
+ effectParam: change.effectParam,
33
+ defaultValue: change.defaultValue,
34
+ schema: change.schema,
35
+ }
36
+ : {
37
+ type: 'value',
38
+ fileName: change.fileName,
39
+ sequenceNodePath: change.nodePath,
40
+ effectIndex: change.effectIndex,
41
+ key: change.fieldKey,
42
+ value: JSON.stringify(change.value),
43
+ defaultValue: change.defaultValue,
44
+ schema: change.schema,
45
+ }),
46
+ clientId,
47
+ undoLabel,
48
+ redoLabel,
49
+ }).then((response) => {
50
+ for (const result of response.results) {
51
+ setPropStatuses(result.sequenceNodePath, (prev) => (0, apply_effect_response_to_prop_statuses_1.applyEffectResponseToPropStatuses)({
52
+ previous: prev,
53
+ response: result.status,
54
+ }));
55
+ }
56
+ });
57
+ };
58
+ exports.saveMultipleEffectProps = saveMultipleEffectProps;
8
59
  const saveEffectProp = (input) => {
9
60
  const { fileName, nodePath, effectIndex, fieldKey, defaultValue, schema, setPropStatuses, clientId, } = input;
10
61
  return (0, save_prop_queue_1.enqueueSavePropChange)({
@@ -1,4 +1,4 @@
1
- import { type SaveSequencePropSourceEdit } from '@remotion/studio-shared';
1
+ import { type CaptionPatch, type SaveSequencePropSourceEdit } from '@remotion/studio-shared';
2
2
  import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
3
3
  import type { AddSequenceKeyframeChange } from './call-add-keyframe';
4
4
  import { type MoveEffectKeyframeChange, type MoveSequenceKeyframeChange } from './call-move-keyframe';
@@ -24,5 +24,16 @@ type SaveSequencePropsOptions = {
24
24
  undoLabel: string;
25
25
  redoLabel: string;
26
26
  };
27
+ export declare const saveInlineCaptionPatches: ({ fileName, nodePath, schema, patches, nextCaptions, setPropStatuses, clientId, undoLabel, redoLabel, }: {
28
+ fileName: string;
29
+ nodePath: SequencePropsSubscriptionKey;
30
+ schema: InteractivitySchema;
31
+ patches: CaptionPatch[];
32
+ nextCaptions: unknown;
33
+ setPropStatuses: SetPropStatuses;
34
+ clientId: string;
35
+ undoLabel: string;
36
+ redoLabel: string;
37
+ }) => Promise<void>;
27
38
  export declare const saveSequenceProps: ({ changes, addedKeyframes, movedKeyframes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveSequencePropsOptions) => Promise<void>;
28
39
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveSequenceProps = void 0;
3
+ exports.saveSequenceProps = exports.saveInlineCaptionPatches = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const call_api_1 = require("../call-api");
6
6
  const call_move_keyframe_1 = require("./call-move-keyframe");
@@ -11,6 +11,30 @@ const serializeSequencePropValue = (value) => {
11
11
  }
12
12
  return { type: 'json', serialized: JSON.stringify(value) };
13
13
  };
14
+ const saveInlineCaptionPatches = ({ fileName, nodePath, schema, patches, nextCaptions, setPropStatuses, clientId, undoLabel, redoLabel, }) => {
15
+ return (0, save_prop_queue_1.enqueueSavePropChange)({
16
+ nodePath,
17
+ setPropStatuses,
18
+ applyOptimistic: (previous) => (0, studio_shared_1.optimisticUpdateForPropStatuses)({
19
+ previous,
20
+ fieldKey: 'captions',
21
+ value: nextCaptions,
22
+ defaultValue: null,
23
+ schema,
24
+ }),
25
+ apiCall: () => (0, call_api_1.callApi)('/api/save-sequence-props', {
26
+ edits: [],
27
+ captionPatches: [{ fileName, nodePath, schema, patches }],
28
+ addedKeyframes: null,
29
+ movedKeyframes: null,
30
+ clientId,
31
+ undoLabel,
32
+ redoLabel,
33
+ }),
34
+ errorLabel: 'Could not save captions',
35
+ });
36
+ };
37
+ exports.saveInlineCaptionPatches = saveInlineCaptionPatches;
14
38
  const saveSequenceProps = ({ changes, addedKeyframes, movedKeyframes, setPropStatuses, clientId, undoLabel, redoLabel, }) => {
15
39
  const keyframesToAdd = addedKeyframes === null ? [] : addedKeyframes;
16
40
  const sequenceKeyframes = movedKeyframes === null ? [] : movedKeyframes.sequenceKeyframes;
@@ -1,2 +1,2 @@
1
- import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
2
- export declare const shouldShowTrackInTimeline: (track: TrackWithHash, durationInFrames: number) => boolean;
1
+ import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
2
+ export declare const shouldShowTrackInTimeline: (track: TimelineTrackData, durationInFrames: number) => boolean;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.openTimelineAssetLink = exports.getTimelineAssetLinkInfo = exports.getTimelineAssetSrcFromSchema = exports.splitRemoteSourceForMiddleEllipsis = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
+ const no_react_1 = require("remotion/no-react");
5
6
  const url_state_1 = require("../../helpers/url-state");
6
7
  const splitRemoteSourceForMiddleEllipsis = (src) => {
7
8
  const protocolEnd = src.indexOf('://');
@@ -29,6 +30,21 @@ const getTimelineAssetSrcFromSchema = (controls) => {
29
30
  };
30
31
  exports.getTimelineAssetSrcFromSchema = getTimelineAssetSrcFromSchema;
31
32
  const getTimelineAssetLinkInfo = (src) => {
33
+ if (src.startsWith(no_react_1.NoReactInternals.FILE_TOKEN)) {
34
+ const encodedAssetPath = src.slice(no_react_1.NoReactInternals.FILE_TOKEN.length);
35
+ let assetPath = encodedAssetPath;
36
+ try {
37
+ assetPath = encodedAssetPath.split('/').map(decodeURIComponent).join('/');
38
+ }
39
+ catch (_a) {
40
+ // Keep the encoded path if it contains an invalid escape sequence.
41
+ }
42
+ return {
43
+ kind: 'local',
44
+ assetPath,
45
+ title: assetPath,
46
+ };
47
+ }
32
48
  const staticBase = typeof window === 'undefined' ? null : window.remotion_staticBase;
33
49
  if (staticBase && src.startsWith(staticBase + '/')) {
34
50
  const assetPath = src.slice(staticBase.length + 1);
@@ -45,7 +61,7 @@ const getTimelineAssetLinkInfo = (src) => {
45
61
  const url = new URL(src.startsWith('//') ? 'https:' + src : src);
46
62
  return { kind: 'remote', href: src, title: url.hostname };
47
63
  }
48
- catch (_a) {
64
+ catch (_b) {
49
65
  return { kind: 'remote', href: src, title: src };
50
66
  }
51
67
  }
@@ -239,6 +239,7 @@ const formatTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
239
239
  case 'asset':
240
240
  case 'array':
241
241
  case 'boolean':
242
+ case 'remotion-captions':
242
243
  case 'color':
243
244
  case 'enum':
244
245
  case 'font-family':
@@ -2,6 +2,10 @@ import type { CanUpdateSequencePropStatus, SequencePropsSubscriptionKey, TSequen
2
2
  import type { ComboboxValue } from '../NewComposition/ComboBox';
3
3
  import { type SetPropStatuses } from './save-sequence-prop';
4
4
  export declare const shouldShowFreezeFrameMenuItem: (sequence: TSequence) => boolean;
5
+ export declare const isSequenceVisibleAtTimelinePosition: ({ sequence, timelinePosition, }: {
6
+ readonly sequence: TSequence;
7
+ readonly timelinePosition: number;
8
+ }) => boolean;
5
9
  export declare const calculateSequenceFreezeFrame: ({ sequence, sequenceFrameOffset, timelinePosition, }: {
6
10
  readonly sequence: TSequence;
7
11
  readonly sequenceFrameOffset: number;
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSequenceFreezeFrameMenuItem = exports.calculateSequenceFreezeFrame = exports.shouldShowFreezeFrameMenuItem = void 0;
3
+ exports.useSequenceFreezeFrameMenuItem = exports.calculateSequenceFreezeFrame = exports.isSequenceVisibleAtTimelinePosition = exports.shouldShowFreezeFrameMenuItem = void 0;
4
4
  const react_1 = require("react");
5
5
  const save_sequence_prop_1 = require("./save-sequence-prop");
6
6
  const shouldShowFreezeFrameMenuItem = (sequence) => {
7
7
  return sequence.type !== 'audio';
8
8
  };
9
9
  exports.shouldShowFreezeFrameMenuItem = shouldShowFreezeFrameMenuItem;
10
+ const isSequenceVisibleAtTimelinePosition = ({ sequence, timelinePosition, }) => {
11
+ return (timelinePosition >= sequence.from &&
12
+ timelinePosition < sequence.from + sequence.duration);
13
+ };
14
+ exports.isSequenceVisibleAtTimelinePosition = isSequenceVisibleAtTimelinePosition;
10
15
  const calculateSequenceFreezeFrame = ({ sequence, sequenceFrameOffset, timelinePosition, }) => {
11
16
  const rawFreezeFrame = Math.round(timelinePosition - sequence.from + sequenceFrameOffset);
12
17
  const minFrame = sequenceFrameOffset;
@@ -20,7 +25,8 @@ const useSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOve
20
25
  const freezeStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.freeze;
21
26
  const isFrozen = (freezeStatus === null || freezeStatus === void 0 ? void 0 : freezeStatus.status) === 'static' &&
22
27
  typeof freezeStatus.codeValue === 'number';
23
- const canToggleFreeze = clientId !== null &&
28
+ const canToggleFreeze = (0, exports.isSequenceVisibleAtTimelinePosition)({ sequence, timelinePosition }) &&
29
+ clientId !== null &&
24
30
  Boolean(sequence.controls) &&
25
31
  nodePath !== null &&
26
32
  validatedSource !== null &&
@@ -49,7 +55,7 @@ const useSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOve
49
55
  fileName: validatedSource,
50
56
  nodePath,
51
57
  fieldKey: 'freeze',
52
- value: remove ? null : freezeFrame,
58
+ value: remove ? undefined : freezeFrame,
53
59
  defaultValue: null,
54
60
  schema: sequence.controls.schema,
55
61
  },
@@ -11,6 +11,7 @@ const effect_drag_and_drop_1 = require("../effect-drag-and-drop");
11
11
  const handle_drop_1 = require("../handle-drop");
12
12
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
13
13
  const SvgImportDialog_1 = require("../SvgImportDialog");
14
+ const use_element_overwrite_confirmation_1 = require("../use-element-overwrite-confirmation");
14
15
  const timeline_refs_1 = require("./timeline-refs");
15
16
  const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
16
17
  const use_resolved_stack_1 = require("./use-resolved-stack");
@@ -30,6 +31,7 @@ const useTimelineAssetDrop = () => {
30
31
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
31
32
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
32
33
  const chooseSvgImportMode = (0, SvgImportDialog_1.useSvgImportDialog)();
34
+ const confirmElementOverwrite = (0, use_element_overwrite_confirmation_1.useElementOverwriteConfirmation)();
33
35
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
34
36
  const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
35
37
  const [assetDropFrame, setAssetDropFrame] = (0, react_1.useState)(null);
@@ -120,6 +122,7 @@ const useTimelineAssetDrop = () => {
120
122
  await (0, handle_drop_1.handleDrop)({
121
123
  chooseSvgImportMode,
122
124
  compositionFile,
125
+ confirmElementOverwrite,
123
126
  compositionId: currentCompositionId,
124
127
  destinationDimensions: {
125
128
  height: videoConfig.height,
@@ -142,6 +145,7 @@ const useTimelineAssetDrop = () => {
142
145
  chooseSvgImportMode,
143
146
  compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence,
144
147
  compositionFile,
148
+ confirmElementOverwrite,
145
149
  currentCompositionId,
146
150
  getDropFrame,
147
151
  videoConfig,
@@ -1,5 +1,5 @@
1
- import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
1
+ import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
2
2
  export declare const useTimelineHeight: ({ shown, hasBeenCut, }: {
3
- shown: TrackWithHash[];
3
+ shown: TimelineTrackData[];
4
4
  hasBeenCut: boolean;
5
5
  }) => number;
@@ -114,8 +114,8 @@ const TopPanelInner = ({ readOnlyStudio, onMounted, drawRef, bufferStateDelayInM
114
114
  return (jsx_runtime_1.jsx(ObserveDefaultPropsContext_1.ObserveDefaultProps, { compositionId: (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
115
115
  ? canvasContent.compositionId
116
116
  : null, readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsxs("div", { style: container, children: [
117
- jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, maxFlexerSize: MAX_SIDEBAR_WIDTH, maxAntiFlexerSize: null, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseLeft, children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) }))) : null, actualStateLeft === 'expanded' ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, maxFlexerSize: null, maxAntiFlexerSize: MAX_SIDEBAR_WIDTH, id: "canvas-to-right-sidebar", orientation: "vertical", children: [
118
- jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx("div", { ref: drawRef, style: canvasContainerStyle, children: jsx_runtime_1.jsx(CanvasIfSizeIsAvailable_1.CanvasIfSizeIsAvailable, {}) }) }), actualStateRight === 'expanded' ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseRight, children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) }))) : null] }) })
117
+ jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, maxFlexerSize: MAX_SIDEBAR_WIDTH, maxAntiFlexerSize: null, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseLeft, side: "left", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) }))) : null, actualStateLeft === 'expanded' && !isMobileLayout ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, maxFlexerSize: null, maxAntiFlexerSize: MAX_SIDEBAR_WIDTH, id: "canvas-to-right-sidebar", orientation: "vertical", children: [
118
+ jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx("div", { ref: drawRef, style: canvasContainerStyle, children: jsx_runtime_1.jsx(CanvasIfSizeIsAvailable_1.CanvasIfSizeIsAvailable, {}) }) }), actualStateRight === 'expanded' && !isMobileLayout ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseRight, side: "right", children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) }))) : null] }) })
119
119
  ] }) }), jsx_runtime_1.jsx(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.TitleUpdater, {})
120
120
  ] }) }));
121
121
  };
@@ -4,7 +4,9 @@ exports.UndoRedoButtons = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
7
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
7
8
  const client_id_1 = require("../helpers/client-id");
9
+ const is_mac_1 = require("../helpers/is-mac");
8
10
  const use_keybinding_1 = require("../helpers/use-keybinding");
9
11
  const redo_1 = require("../icons/redo");
10
12
  const undo_1 = require("../icons/undo");
@@ -36,7 +38,11 @@ const UndoRedoButtons = () => {
36
38
  return;
37
39
  }
38
40
  undoInFlight.current = true;
39
- (0, call_api_1.callApi)('/api/undo', {})
41
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
42
+ const promise = browserStudioOperations
43
+ ? browserStudioOperations.undo()
44
+ : (0, call_api_1.callApi)('/api/undo', {});
45
+ promise
40
46
  .catch(() => {
41
47
  // Ignore errors
42
48
  })
@@ -49,7 +55,11 @@ const UndoRedoButtons = () => {
49
55
  return;
50
56
  }
51
57
  redoInFlight.current = true;
52
- (0, call_api_1.callApi)('/api/redo', {})
58
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
59
+ const promise = browserStudioOperations
60
+ ? browserStudioOperations.redo()
61
+ : (0, call_api_1.callApi)('/api/redo', {});
62
+ promise
53
63
  .catch(() => {
54
64
  // Ignore errors
55
65
  })
@@ -74,11 +84,14 @@ const UndoRedoButtons = () => {
74
84
  triggerIfInputFieldFocused: false,
75
85
  keepRegisteredWhenNotHighestContext: false,
76
86
  });
77
- const redo = keybindings.registerKeybinding({
87
+ const redoWithShiftZ = keybindings.registerKeybinding({
78
88
  event: 'keydown',
79
- key: 'y',
89
+ key: 'z',
80
90
  commandCtrlKey: true,
81
- callback: () => {
91
+ callback: (e) => {
92
+ if (!e.shiftKey) {
93
+ return;
94
+ }
82
95
  if (redoFile) {
83
96
  onRedo();
84
97
  }
@@ -87,9 +100,25 @@ const UndoRedoButtons = () => {
87
100
  triggerIfInputFieldFocused: false,
88
101
  keepRegisteredWhenNotHighestContext: false,
89
102
  });
103
+ const redoWithY = is_mac_1.isMac
104
+ ? null
105
+ : keybindings.registerKeybinding({
106
+ event: 'keydown',
107
+ key: 'y',
108
+ commandCtrlKey: true,
109
+ callback: () => {
110
+ if (redoFile) {
111
+ onRedo();
112
+ }
113
+ },
114
+ preventDefault: true,
115
+ triggerIfInputFieldFocused: false,
116
+ keepRegisteredWhenNotHighestContext: false,
117
+ });
90
118
  return () => {
91
119
  undo.unregister();
92
- redo.unregister();
120
+ redoWithShiftZ.unregister();
121
+ redoWithY === null || redoWithY === void 0 ? void 0 : redoWithY.unregister();
93
122
  };
94
123
  }, [keybindings, onRedo, onUndo, redoFile, undoFile]);
95
124
  const undoTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
@@ -97,13 +126,15 @@ const UndoRedoButtons = () => {
97
126
  : `Undo (${ShortcutHint_1.cmdOrCtrlCharacter}+Z)`;
98
127
  const redoTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
99
128
  ? 'Redo'
100
- : `Redo (${ShortcutHint_1.cmdOrCtrlCharacter}+Y)`;
129
+ : is_mac_1.isMac
130
+ ? `Redo (${ShortcutHint_1.cmdOrCtrlCharacter}+Shift+Z)`
131
+ : `Redo (${ShortcutHint_1.cmdOrCtrlCharacter}+Y)`;
101
132
  const renderUndo = (0, react_1.useCallback)((color) => {
102
- return (jsx_runtime_1.jsx(undo_1.UndoIcon, { style: { ...iconStyle, color, opacity: undoFile ? 1 : 0.5 } }));
103
- }, [undoFile]);
133
+ return jsx_runtime_1.jsx(undo_1.UndoIcon, { style: { ...iconStyle, color } });
134
+ }, []);
104
135
  const renderRedo = (0, react_1.useCallback)((color) => {
105
- return (jsx_runtime_1.jsx(redo_1.RedoIcon, { style: { ...iconStyle, color, opacity: redoFile ? 1 : 0.5 } }));
106
- }, [redoFile]);
136
+ return jsx_runtime_1.jsx(redo_1.RedoIcon, { style: { ...iconStyle, color } });
137
+ }, []);
107
138
  const canUndo = undoFile !== null;
108
139
  const canRedo = redoFile !== null;
109
140
  if (!canUndo && !canRedo) {
@@ -13,6 +13,7 @@ const snapCompositionDropPosition = ({ compositionDimensions, destinationDimensi
13
13
  const outline = {
14
14
  key: 'composition-drop-preview',
15
15
  dimensions: compositionDimensions,
16
+ uncroppedPoints: null,
16
17
  points: [
17
18
  { x: left * scale, y: top * scale },
18
19
  { x: right * scale, y: top * scale },