@remotion/studio 4.0.525 → 4.0.526

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/api/focus-default-props-path.js +7 -1
  2. package/dist/api/restart-studio.d.ts +1 -1
  3. package/dist/api/restart-studio.js +1 -1
  4. package/dist/components/AgentPrompt.d.ts +6 -0
  5. package/dist/components/AgentPrompt.js +107 -0
  6. package/dist/components/AssetFileIcon.js +2 -0
  7. package/dist/components/AssetSelectorItem.d.ts +1 -23
  8. package/dist/components/AssetSelectorItem.js +10 -200
  9. package/dist/components/Canvas.js +21 -18
  10. package/dist/components/CaptionInspector.js +9 -3
  11. package/dist/{error-overlay/remotion-overlay → components}/CodeFrame.d.ts +2 -0
  12. package/dist/components/CodeFrame.js +77 -0
  13. package/dist/components/CompositionSelectorItem.js +6 -17
  14. package/dist/components/CurrentAsset.js +5 -4
  15. package/dist/components/ElementInstallConfirmation.js +69 -38
  16. package/dist/components/FilePreview.js +4 -0
  17. package/dist/components/FixComputedValueModal.js +64 -96
  18. package/dist/components/GenerateWithAgentModal.d.ts +9 -0
  19. package/dist/components/GenerateWithAgentModal.js +39 -0
  20. package/dist/components/InlineEditableTitle.js +2 -0
  21. package/dist/components/InspectorOpenInEditor.js +8 -4
  22. package/dist/components/InspectorPanel/CollapsibleInspectorSection.d.ts +7 -0
  23. package/dist/components/InspectorPanel/CollapsibleInspectorSection.js +14 -0
  24. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +1 -1
  25. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +19 -8
  26. package/dist/components/InspectorPanel/CompositionInspector.js +30 -13
  27. package/dist/components/InspectorPanel/CompositionMetadata.js +3 -0
  28. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +6 -12
  29. package/dist/components/InspectorPanel/ElementLibraryButton.js +1 -0
  30. package/dist/components/InspectorPanel/GuideInspector.js +2 -3
  31. package/dist/components/InspectorPanel/KeyframeSettings.js +5 -6
  32. package/dist/components/InspectorPanel/MultiSequenceInspector.js +2 -1
  33. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -3
  34. package/dist/components/InspectorPanel/common.d.ts +4 -0
  35. package/dist/components/InspectorPanel/common.js +14 -2
  36. package/dist/components/InspectorPanel/styles.d.ts +0 -3
  37. package/dist/components/InspectorPanel/styles.js +1 -27
  38. package/dist/components/InspectorPanel/use-composition-actions.d.ts +2 -0
  39. package/dist/components/InspectorPanel/use-composition-actions.js +15 -0
  40. package/dist/components/InspectorPanel/use-inspector-section-expanded.d.ts +1 -0
  41. package/dist/components/InspectorPanel/use-inspector-section-expanded.js +21 -0
  42. package/dist/components/InspectorSequenceSection.js +44 -35
  43. package/dist/components/InspectorSourceLocation.js +1 -0
  44. package/dist/components/KeyboardShortcutsSettings.js +12 -4
  45. package/dist/components/LutPreview.d.ts +4 -0
  46. package/dist/components/LutPreview.js +192 -0
  47. package/dist/components/MenuCompositionName.js +4 -9
  48. package/dist/components/Modals.js +3 -6
  49. package/dist/components/ModelsSettings.js +15 -4
  50. package/dist/components/Notifications/NotificationCenter.d.ts +0 -1
  51. package/dist/components/Notifications/NotificationCenter.js +1 -22
  52. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +4 -9
  53. package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.d.ts +1 -0
  54. package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.js +2 -1
  55. package/dist/components/RenderModal/WebRenderModal.js +10 -2
  56. package/dist/components/RendersTab.js +2 -0
  57. package/dist/components/SelectedOutlineElement.js +6 -0
  58. package/dist/components/SettingsButton.js +11 -2
  59. package/dist/components/SettingsModal.d.ts +1 -2
  60. package/dist/components/SettingsModal.js +24 -6
  61. package/dist/components/SettingsModalFooter.js +17 -3
  62. package/dist/components/SkillsSettings.d.ts +5 -0
  63. package/dist/components/SkillsSettings.js +29 -26
  64. package/dist/components/Timeline/Timeline.js +10 -11
  65. package/dist/components/Timeline/TimelineAssetField.js +81 -51
  66. package/dist/components/Timeline/TimelineHeightContainer.js +11 -1
  67. package/dist/components/Timeline/TimelineKeyframeControls.js +15 -1
  68. package/dist/components/Timeline/TimelineLayerChildren.d.ts +3 -3
  69. package/dist/components/Timeline/TimelineLayerChildren.js +11 -9
  70. package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -1
  71. package/dist/components/Timeline/TimelineLayerEye.js +6 -3
  72. package/dist/components/Timeline/TimelineList.js +9 -3
  73. package/dist/components/Timeline/TimelineSchemaField.js +2 -6
  74. package/dist/components/Timeline/TimelineSelection.d.ts +14 -3
  75. package/dist/components/Timeline/TimelineSelection.js +91 -49
  76. package/dist/components/Timeline/TimelineSequence.js +2 -2
  77. package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -0
  78. package/dist/components/Timeline/TimelineSequenceItem.js +17 -13
  79. package/dist/components/Timeline/TimelineVirtualization.d.ts +3 -3
  80. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
  81. package/dist/components/Timeline/get-sequence-context-menu-items.js +130 -45
  82. package/dist/components/Timeline/normalize-font-weight-for-keyframe.d.ts +1 -0
  83. package/dist/components/Timeline/normalize-font-weight-for-keyframe.js +19 -0
  84. package/dist/components/Timeline/timeline-display-groups.d.ts +9 -0
  85. package/dist/components/Timeline/timeline-display-groups.js +66 -0
  86. package/dist/components/Timeline/use-timeline-asset-drop.js +21 -21
  87. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  88. package/dist/components/Timeline/use-timeline-expanded-tree.js +1 -2
  89. package/dist/components/UpdateStatusContext.d.ts +2 -2
  90. package/dist/components/UpdateStatusContext.js +6 -7
  91. package/dist/components/UpdatesSettings.js +6 -6
  92. package/dist/components/WebMcp.js +40 -41
  93. package/dist/components/asset-context-menu.d.ts +32 -0
  94. package/dist/components/asset-context-menu.js +242 -0
  95. package/dist/components/composition-menu-items.d.ts +4 -6
  96. package/dist/components/composition-menu-items.js +191 -75
  97. package/dist/components/get-open-in-menu-items.d.ts +6 -5
  98. package/dist/components/get-open-in-menu-items.js +15 -9
  99. package/dist/components/selected-outline-order.js +18 -12
  100. package/dist/components/use-open-in-menu-apps.d.ts +14 -0
  101. package/dist/components/use-open-in-menu-apps.js +33 -0
  102. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
  103. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +1 -0
  104. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +3 -3
  105. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +5 -1
  106. package/dist/error-overlay/remotion-overlay/StackFrame.js +26 -19
  107. package/dist/esm/{LazyModels-gfmpcy4h.mjs → LazyModels-mtggyjye.mjs} +3 -3
  108. package/dist/esm/{LazyModels-m1rf06wh.mjs → LazyModels-nk7py0zt.mjs} +3 -3
  109. package/dist/esm/{TranscriptionModal-8pvrehg4.mjs → TranscriptionModal-ymnx1c7m.mjs} +6 -6
  110. package/dist/esm/{VideoMattingModal-fefbzgka.mjs → VideoMattingModal-05vpczks.mjs} +6 -6
  111. package/dist/esm/{index-s848rffx.mjs → index-0gewwxse.mjs} +5330 -4668
  112. package/dist/esm/{index-tzxb8808.mjs → index-4dsz9035.mjs} +8 -8
  113. package/dist/esm/{index-hbezgbbq.mjs → index-5bfxbpca.mjs} +1 -1
  114. package/dist/esm/{index-vsxrxfpj.mjs → index-5gd8k9yv.mjs} +1 -1
  115. package/dist/esm/{index-ggqpre9v.mjs → index-bs39wngg.mjs} +4216 -3571
  116. package/dist/esm/{index-0x13f28h.mjs → index-cdy8v54v.mjs} +1 -1
  117. package/dist/esm/{index-41kqns5c.mjs → index-eb5txqp6.mjs} +8 -7
  118. package/dist/esm/{index-1089795y.mjs → index-f97r9e2g.mjs} +4 -21
  119. package/dist/esm/{index-jrw61pkj.mjs → index-g7k2dvar.mjs} +1 -1
  120. package/dist/esm/{index-mww32xc8.mjs → index-x40wwfmt.mjs} +3 -3
  121. package/dist/esm/index.mjs +12 -6
  122. package/dist/esm/internals.mjs +7 -7
  123. package/dist/esm/previewEntry.mjs +7 -7
  124. package/dist/helpers/client-id.d.ts +1 -0
  125. package/dist/helpers/client-id.js +8 -4
  126. package/dist/helpers/cube-lut.d.ts +12 -0
  127. package/dist/helpers/cube-lut.js +160 -0
  128. package/dist/helpers/get-preview-file-type.d.ts +1 -1
  129. package/dist/helpers/get-preview-file-type.js +3 -0
  130. package/dist/helpers/open-in-editor.d.ts +5 -2
  131. package/dist/helpers/open-in-editor.js +12 -4
  132. package/dist/helpers/settings-tab-availability.d.ts +14 -0
  133. package/dist/helpers/settings-tab-availability.js +35 -0
  134. package/dist/helpers/use-menu-structure.js +16 -12
  135. package/dist/icons/lut.d.ts +4 -0
  136. package/dist/icons/lut.js +6 -0
  137. package/dist/icons/sparkles.d.ts +4 -0
  138. package/dist/icons/sparkles.js +6 -0
  139. package/dist/state/modals.d.ts +12 -2
  140. package/package.json +19 -19
  141. package/dist/error-overlay/remotion-overlay/CodeFrame.js +0 -62
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeFontWeightForKeyframe = void 0;
4
+ const normalizeFontWeightForKeyframe = (value) => {
5
+ if (value === 'normal') {
6
+ return 400;
7
+ }
8
+ if (value === 'bold') {
9
+ return 700;
10
+ }
11
+ if (typeof value === 'number') {
12
+ return Number.isFinite(value) ? value : null;
13
+ }
14
+ if (typeof value === 'string' && /^\d+(?:\.\d+)?$/.test(value)) {
15
+ return Number(value);
16
+ }
17
+ return null;
18
+ };
19
+ exports.normalizeFontWeightForKeyframe = normalizeFontWeightForKeyframe;
@@ -0,0 +1,9 @@
1
+ import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
2
+ export type TimelineDisplayGroup = {
3
+ readonly key: string;
4
+ readonly numberOfSequences: number;
5
+ };
6
+ export type TimelineTrackWithDisplayGroup = TimelineTrackData & {
7
+ readonly displayGroup: TimelineDisplayGroup | null;
8
+ };
9
+ export declare const addTimelineDisplayGroups: (tracks: readonly TimelineTrackData[]) => TimelineTrackWithDisplayGroup[];
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addTimelineDisplayGroups = void 0;
4
+ const timeline_node_path_key_1 = require("../../helpers/timeline-node-path-key");
5
+ const addTimelineDisplayGroups = (tracks) => {
6
+ var _a, _b;
7
+ const stacksBySequenceId = new Map();
8
+ const resolvedNodePathKeysByStack = new Map();
9
+ for (const track of tracks) {
10
+ // Only controlled sequences can eventually resolve to a source node.
11
+ const stack = track.sequence.controls === null ? null : track.sequence.getStack();
12
+ stacksBySequenceId.set(track.sequence.id, stack);
13
+ if (stack === null || track.nodePathInfo === null) {
14
+ continue;
15
+ }
16
+ const nodePathKey = `node-path:${(0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey)}`;
17
+ const nodePathKeys = (_a = resolvedNodePathKeysByStack.get(stack)) !== null && _a !== void 0 ? _a : new Set();
18
+ nodePathKeys.add(nodePathKey);
19
+ resolvedNodePathKeysByStack.set(stack, nodePathKeys);
20
+ }
21
+ const displayKeys = tracks.map((track) => {
22
+ var _a;
23
+ if (track.nodePathInfo !== null) {
24
+ return `node-path:${(0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey)}`;
25
+ }
26
+ const stack = (_a = stacksBySequenceId.get(track.sequence.id)) !== null && _a !== void 0 ? _a : null;
27
+ if (stack === null) {
28
+ return null;
29
+ }
30
+ const resolvedNodePathKeys = resolvedNodePathKeysByStack.get(stack);
31
+ if ((resolvedNodePathKeys === null || resolvedNodePathKeys === void 0 ? void 0 : resolvedNodePathKeys.size) === 1) {
32
+ const resolvedNodePathKey = resolvedNodePathKeys.values().next().value;
33
+ if (resolvedNodePathKey === undefined) {
34
+ throw new Error('Expected a resolved timeline node path key');
35
+ }
36
+ return resolvedNodePathKey;
37
+ }
38
+ // This identity is display-only. Source operations continue to require
39
+ // track.nodePathInfo.
40
+ return `stack:${stack}`;
41
+ });
42
+ const counts = new Map();
43
+ for (const key of displayKeys) {
44
+ if (key !== null) {
45
+ counts.set(key, ((_b = counts.get(key)) !== null && _b !== void 0 ? _b : 0) + 1);
46
+ }
47
+ }
48
+ return tracks.map((track, index) => {
49
+ const key = displayKeys[index];
50
+ if (key === null) {
51
+ return { ...track, displayGroup: null };
52
+ }
53
+ const numberOfSequences = counts.get(key);
54
+ if (numberOfSequences === undefined) {
55
+ throw new Error('Expected a timeline display group count');
56
+ }
57
+ return {
58
+ ...track,
59
+ displayGroup: {
60
+ key,
61
+ numberOfSequences,
62
+ },
63
+ };
64
+ });
65
+ };
66
+ exports.addTimelineDisplayGroups = addTimelineDisplayGroups;
@@ -10,6 +10,7 @@ const modals_1 = require("../../state/modals");
10
10
  const canvas_capture_drop_1 = require("../canvas-capture-drop");
11
11
  const drop_handler_data_1 = require("../drop-handler-data");
12
12
  const effect_drag_and_drop_1 = require("../effect-drag-and-drop");
13
+ const element_drag_and_drop_1 = require("../element-drag-and-drop");
13
14
  const handle_drop_1 = require("../handle-drop");
14
15
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
15
16
  const SvgImportDialog_1 = require("../SvgImportDialog");
@@ -29,7 +30,6 @@ const useTimelineAssetDrop = () => {
29
30
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
30
31
  const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
31
32
  const [assetDropFrame, setAssetDropFrame] = (0, react_1.useState)(null);
32
- const unsupportedDropNotifiedRef = (0, react_1.useRef)(false);
33
33
  const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
34
34
  const currentComposition = (0, react_1.useMemo)(() => {
35
35
  var _a;
@@ -42,13 +42,13 @@ const useTimelineAssetDrop = () => {
42
42
  compositionId: currentCompositionId,
43
43
  });
44
44
  const previewInteractive = previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
45
- const canInsertAsset = previewInteractive &&
45
+ const canReceiveElementDrop = previewInteractive &&
46
46
  !window.remotion_isReadOnlyStudio &&
47
- (compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true &&
48
47
  currentCompositionId !== null &&
49
48
  compositionFile !== null &&
50
49
  videoConfig !== null &&
51
50
  !isAddingAsset;
51
+ const canInsertAsset = canReceiveElementDrop && (compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true;
52
52
  const getDropFrame = (0, react_1.useCallback)((event) => {
53
53
  if (videoConfig === null) {
54
54
  return null;
@@ -72,30 +72,28 @@ const useTimelineAssetDrop = () => {
72
72
  dataTransfer === null ||
73
73
  !(0, drop_handler_data_1.isSupportedDropEvent)(event) ||
74
74
  !isEventTargetInsideElement(event, timeline)) {
75
- unsupportedDropNotifiedRef.current = false;
76
75
  setAssetDropFrame(null);
77
76
  return;
78
77
  }
79
- const mayBeCanvasCapture = (0, drop_handler_data_1.isFileDragEvent)(event) && !window.remotion_isReadOnlyStudio;
80
- const shouldNotifyAboutUnsupportedDrop = (compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === false &&
81
- !mayBeCanvasCapture;
82
- if (shouldNotifyAboutUnsupportedDrop &&
83
- !unsupportedDropNotifiedRef.current) {
84
- (0, NotificationCenter_1.showCannotAddSequenceDropNotification)();
85
- }
86
- unsupportedDropNotifiedRef.current = shouldNotifyAboutUnsupportedDrop;
78
+ const canDropElementIntoNewComposition = (compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === false &&
79
+ canReceiveElementDrop &&
80
+ (0, element_drag_and_drop_1.hasElementDragType)(dataTransfer);
87
81
  event.preventDefault();
88
82
  event.stopPropagation();
89
- dataTransfer.dropEffect = canInsertAsset ? 'copy' : 'none';
83
+ dataTransfer.dropEffect =
84
+ canInsertAsset || canDropElementIntoNewComposition ? 'copy' : 'none';
90
85
  const scrollable = timeline_refs_1.scrollableRef.current;
91
86
  const shouldShowDropFrame = canInsertAsset &&
92
87
  scrollable !== null &&
93
88
  isEventTargetInsideElement(event, scrollable);
94
89
  setAssetDropFrame(shouldShowDropFrame ? getDropFrame(event) : null);
95
- }, [canInsertAsset, compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence, getDropFrame]);
90
+ }, [
91
+ canInsertAsset,
92
+ canReceiveElementDrop,
93
+ compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence,
94
+ getDropFrame,
95
+ ]);
96
96
  const onAssetDrop = (0, react_1.useCallback)(async (event) => {
97
- const unsupportedDropWasNotified = unsupportedDropNotifiedRef.current;
98
- unsupportedDropNotifiedRef.current = false;
99
97
  setAssetDropFrame(null);
100
98
  const timeline = timeline_refs_1.timelineVerticalScroll.current;
101
99
  const { dataTransfer } = event;
@@ -130,13 +128,15 @@ const useTimelineAssetDrop = () => {
130
128
  }
131
129
  event.preventDefault();
132
130
  event.stopPropagation();
133
- if (!canInsertAsset ||
131
+ const canDropElementIntoNewComposition = (compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === false &&
132
+ canReceiveElementDrop &&
133
+ (0, element_drag_and_drop_1.getElementDragData)(dataTransfer) !== null;
134
+ if ((!canInsertAsset && !canDropElementIntoNewComposition) ||
134
135
  currentCompositionId === null ||
135
136
  compositionFile === null ||
136
137
  videoConfig === null) {
137
- if ((compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === false &&
138
- !unsupportedDropWasNotified) {
139
- (0, NotificationCenter_1.showCannotAddSequenceDropNotification)();
138
+ if ((compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === false) {
139
+ (0, NotificationCenter_1.showNotification)('Cannot insert this item: This composition component cannot accept a new <Sequence>.', 3000);
140
140
  }
141
141
  return;
142
142
  }
@@ -170,6 +170,7 @@ const useTimelineAssetDrop = () => {
170
170
  }
171
171
  }, [
172
172
  canInsertAsset,
173
+ canReceiveElementDrop,
173
174
  chooseSvgImportMode,
174
175
  compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence,
175
176
  compositionFile,
@@ -179,7 +180,6 @@ const useTimelineAssetDrop = () => {
179
180
  videoConfig,
180
181
  ]);
181
182
  const clearAssetDropFrame = (0, react_1.useCallback)(() => {
182
- unsupportedDropNotifiedRef.current = false;
183
183
  setAssetDropFrame(null);
184
184
  }, []);
185
185
  (0, react_1.useEffect)(() => {
@@ -1,8 +1,9 @@
1
1
  import { type TSequence } from 'remotion';
2
2
  import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
- export declare const useTimelineSequenceHasExpandableContent: ({ sequence, nodePathInfo, }: {
3
+ export declare const useTimelineSequenceHasExpandableContent: ({ sequence, nodePathInfo, selectedItems, }: {
4
4
  readonly sequence: TSequence;
5
5
  readonly nodePathInfo: SequenceNodePathInfo;
6
+ readonly selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[];
6
7
  }) => boolean;
7
8
  export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, includeTextContent, includeSourceControls, }: {
8
9
  readonly sequence: TSequence;
@@ -9,10 +9,9 @@ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
9
9
  const get_node_keyframes_1 = require("./get-node-keyframes");
10
10
  const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
11
11
  const TimelineSelection_1 = require("./TimelineSelection");
12
- const useTimelineSequenceHasExpandableContent = ({ sequence, nodePathInfo, }) => {
12
+ const useTimelineSequenceHasExpandableContent = ({ sequence, nodePathInfo, selectedItems, }) => {
13
13
  const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
14
14
  const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
15
- const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
16
15
  const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
17
16
  const selectHasExpandableContent = (0, react_1.useCallback)((runtimeValues) => {
18
17
  const tree = (0, timeline_layout_1.buildTimelineTree)({
@@ -6,12 +6,12 @@ export type Bug = {
6
6
  link: string;
7
7
  versions: string[];
8
8
  };
9
- type UpgradeState = 'idle' | 'upgrading' | 'upgraded' | 'shutting-down' | 'shutdown';
9
+ type UpgradeState = 'idle' | 'upgrading' | 'upgraded' | 'restarting';
10
10
  type UpdateStatusContextValue = {
11
11
  readonly upgradeState: UpgradeState;
12
12
  readonly upgradeError: string | null;
13
13
  readonly upgrade: (version: string) => Promise<void>;
14
- readonly shutdown: () => Promise<void>;
14
+ readonly restart: () => Promise<void>;
15
15
  readonly error: string | null;
16
16
  readonly info: UpdateAvailableResponse | null;
17
17
  readonly knownBugs: Bug[] | null;
@@ -4,7 +4,7 @@ exports.useUpdateStatus = exports.UpdateStatusProvider = 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 shut_down_studio_1 = require("../api/shut-down-studio");
7
+ const restart_studio_1 = require("../api/restart-studio");
8
8
  const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
9
9
  const can_show_updates_1 = require("../helpers/can-show-updates");
10
10
  const client_id_1 = require("../helpers/client-id");
@@ -35,16 +35,15 @@ const UpdateStatusProvider = ({ children }) => {
35
35
  busy.current = false;
36
36
  }
37
37
  }, []);
38
- const shutdown = (0, react_1.useCallback)(async () => {
38
+ const restart = (0, react_1.useCallback)(async () => {
39
39
  if (busy.current) {
40
40
  return;
41
41
  }
42
42
  busy.current = true;
43
- setUpgradeState('shutting-down');
43
+ setUpgradeState('restarting');
44
44
  setUpgradeError(null);
45
45
  try {
46
- await (0, shut_down_studio_1.shutDownStudio)();
47
- setUpgradeState('shutdown');
46
+ await (0, restart_studio_1.restartStudio)();
48
47
  }
49
48
  catch (err) {
50
49
  setUpgradeError(err.message);
@@ -109,9 +108,9 @@ const UpdateStatusProvider = ({ children }) => {
109
108
  upgradeState,
110
109
  upgradeError,
111
110
  upgrade,
112
- shutdown,
111
+ restart,
113
112
  };
114
- }, [error, info, knownBugs, upgradeState, upgradeError, upgrade, shutdown]);
113
+ }, [error, info, knownBugs, upgradeState, upgradeError, upgrade, restart]);
115
114
  return (jsx_runtime_1.jsx(UpdateStatusContext.Provider, { value: value, children: children }));
116
115
  };
117
116
  exports.UpdateStatusProvider = UpdateStatusProvider;
@@ -173,7 +173,7 @@ const RenderedReleaseNotes = ({ release }) => {
173
173
  };
174
174
  const UpdatesSettings = () => {
175
175
  const { remotionSkillsInfo } = (0, SettingsContext_1.useSettings)();
176
- const { error, info, knownBugs, upgradeState, upgradeError, upgrade, shutdown, } = (0, UpdateStatusContext_1.useUpdateStatus)();
176
+ const { error, info, knownBugs, upgradeState, upgradeError, upgrade, restart } = (0, UpdateStatusContext_1.useUpdateStatus)();
177
177
  const [releaseNotes, setReleaseNotes] = (0, react_1.useState)(null);
178
178
  (0, react_1.useEffect)(() => {
179
179
  if (!(info === null || info === void 0 ? void 0 : info.updateAvailable)) {
@@ -239,11 +239,11 @@ const UpdatesSettings = () => {
239
239
  ? 'Upgrading Remotion...'
240
240
  : 'Remotion has been upgraded.' }), jsx_runtime_1.jsx("div", { style: text, children: upgradeState === 'upgrading'
241
241
  ? 'This may take a few minutes. You can follow the progress in your terminal.'
242
- : upgradeState === 'shutdown'
243
- ? 'Studio is shutting down. Run your Studio start command again in the terminal to use the new version.'
244
- : 'Restart Studio to use the new version. Shut down the server below, then run your Studio start command again in the terminal.' }), upgradeState === 'upgraded' || upgradeState === 'shutting-down' ? (jsx_runtime_1.jsx("div", { style: { marginTop: 12 }, children: jsx_runtime_1.jsx(ModalButton_1.ModalButton, { onClick: shutdown, disabled: upgradeState === 'shutting-down', children: upgradeState === 'shutting-down'
245
- ? 'Shutting down...'
246
- : 'Shut down Studio' }) })) : null, upgradeError ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: upgradeError, type: "error", align: "flex-start" })) : null] }));
242
+ : upgradeState === 'restarting'
243
+ ? 'Studio is restarting with the new version.'
244
+ : 'Restart Studio to use the new version.' }), upgradeState === 'upgraded' || upgradeState === 'restarting' ? (jsx_runtime_1.jsx("div", { style: { marginTop: 12 }, children: jsx_runtime_1.jsx(ModalButton_1.ModalButton, { onClick: restart, disabled: upgradeState === 'restarting', children: upgradeState === 'restarting'
245
+ ? 'Restarting...'
246
+ : 'Restart Studio' }) })) : null, upgradeError ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: upgradeError, type: "error", align: "flex-start" })) : null] }));
247
247
  }
248
248
  if (info === null) {
249
249
  return (jsx_runtime_1.jsx("div", { style: container, children: error ? (jsx_runtime_1.jsx("div", { style: { paddingTop: 12 }, children: jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: 'Could not check for updates: ' + error, align: "flex-start", type: "error" }) })) : (jsx_runtime_1.jsx("div", { style: title, children: "Checking for updates..." })) }));
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.WebMcp = void 0;
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
37
38
  const studio_shared_1 = require("@remotion/studio-shared");
38
39
  const react_1 = require("react");
39
40
  const remotion_1 = require("remotion");
@@ -128,20 +129,10 @@ const resolveAssetPath = ({ assetPath, currentContent, staticFiles, }) => {
128
129
  }
129
130
  return resolvedAssetPath;
130
131
  };
131
- const WebMcp = () => {
132
+ const WebMcpSelectionSync = ({ currentSelectionRef, selectedSequenceRef }) => {
132
133
  var _a;
133
- var _b, _c, _d, _e, _f;
134
- const { addCaptionJob, addVideoMattingJob } = (0, react_1.useContext)(context_1.RenderQueueContext);
135
- const staticFiles = (0, use_static_files_1.useStaticFiles)();
136
- const { canSelect, clearSelection, selectedItems, selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
137
- const { canvasContent, compositions, currentCompositionMetadata, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
138
- const { playbackRate: currentPlaybackRate, setPlaybackRate } = remotion_1.Internals.usePlaybackRate();
139
- const { isPlaying } = remotion_1.Internals.Timeline.useTimelineContext();
140
- const { mediaVolume, playerMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
141
- const { setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
142
- const { setZoom: setTimelineZoom, zoom: timelineZoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
143
- const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
144
- const { editorShowGuides, guidesList, setEditorShowGuides, setGuidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
134
+ var _b, _c, _d, _e;
135
+ const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
145
136
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
146
137
  const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
147
138
  const selectedItem = selectedItems.length === 1 ? selectedItems[0] : null;
@@ -161,16 +152,10 @@ const WebMcp = () => {
161
152
  const currentResolvedLocation = stack === currentStack ? resolvedLocation : null;
162
153
  const currentSelection = (0, react_1.useMemo)(() => {
163
154
  var _a;
164
- if (selectedItems.length === 0) {
165
- return null;
166
- }
167
- if (selectedItems.length > 1) {
168
- return null;
169
- }
170
- if (selectedItem === null || selectedItem.type === 'guide') {
171
- return null;
172
- }
173
- if (track === null) {
155
+ if (selectedItems.length !== 1 ||
156
+ selectedItem === null ||
157
+ selectedItem.type === 'guide' ||
158
+ track === null) {
174
159
  return null;
175
160
  }
176
161
  let name;
@@ -209,15 +194,28 @@ const WebMcp = () => {
209
194
  root: window.remotion_cwd,
210
195
  });
211
196
  }, [currentResolvedLocation, selectedItem, selectedItems.length, track]);
212
- const currentSelectionRef = (0, react_1.useRef)(currentSelection);
213
197
  currentSelectionRef.current = currentSelection;
214
- const selectedSequence = (0, react_1.useMemo)(() => (track === null ? null : serializeSequence(track)), [track]);
215
- const selectedSequenceRef = (0, react_1.useRef)(selectedSequence);
216
- selectedSequenceRef.current = selectedSequence;
217
- const selectedItemsRef = (0, react_1.useRef)(selectedItems);
218
- selectedItemsRef.current = selectedItems;
219
- const canSelectRef = (0, react_1.useRef)(canSelect);
220
- canSelectRef.current = canSelect;
198
+ selectedSequenceRef.current =
199
+ track === null ? null : serializeSequence(track);
200
+ return null;
201
+ };
202
+ const WebMcp = () => {
203
+ var _a;
204
+ const { addCaptionJob, addVideoMattingJob } = (0, react_1.useContext)(context_1.RenderQueueContext);
205
+ const staticFiles = (0, use_static_files_1.useStaticFiles)();
206
+ const timelineSelectionRef = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
207
+ const currentSelectionRef = (0, react_1.useRef)(null);
208
+ const selectedSequenceRef = (0, react_1.useRef)(null);
209
+ const { canvasContent, compositions, currentCompositionMetadata, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
210
+ const { playbackRate: currentPlaybackRate, setPlaybackRate } = remotion_1.Internals.usePlaybackRate();
211
+ const { isPlaying } = remotion_1.Internals.Timeline.useTimelineContext();
212
+ const { mediaVolume, playerMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
213
+ const { setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
214
+ const { setZoom: setTimelineZoom, zoom: timelineZoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
215
+ const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
216
+ const { editorShowGuides, guidesList, setEditorShowGuides, setGuidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
217
+ const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
218
+ const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
221
219
  const currentCompositionDefinition = (0, react_1.useMemo)(() => {
222
220
  var _a;
223
221
  if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'composition') {
@@ -241,7 +239,7 @@ const WebMcp = () => {
241
239
  currentContentRef.current = currentContent;
242
240
  const staticFilesRef = (0, react_1.useRef)(staticFiles);
243
241
  staticFilesRef.current = staticFiles;
244
- const currentComposition = (_f = currentCompositionDefinition === null || currentCompositionDefinition === void 0 ? void 0 : currentCompositionDefinition.id) !== null && _f !== void 0 ? _f : null;
242
+ const currentComposition = (_a = currentCompositionDefinition === null || currentCompositionDefinition === void 0 ? void 0 : currentCompositionDefinition.id) !== null && _a !== void 0 ? _a : null;
245
243
  const currentCompositionRef = (0, react_1.useRef)(currentComposition);
246
244
  currentCompositionRef.current = currentComposition;
247
245
  const currentCompositionDefinitionRef = (0, react_1.useRef)(currentCompositionDefinition);
@@ -766,7 +764,7 @@ const WebMcp = () => {
766
764
  if (compositionId === null) {
767
765
  throw new Error('No composition is currently selected.');
768
766
  }
769
- if (!canSelectRef.current) {
767
+ if (!timelineSelectionRef.current.canSelect) {
770
768
  throw new Error('Studio sequence selection is unavailable.');
771
769
  }
772
770
  const timelineTrack = getCurrentTimeline().find((candidate) => candidate.sequence.id === sequenceId);
@@ -777,7 +775,9 @@ const WebMcp = () => {
777
775
  if (selection === null) {
778
776
  throw new Error(`Sequence ${sequenceId} cannot be selected.`);
779
777
  }
780
- selectItems([selection], { reveal: true });
778
+ timelineSelectionRef.current.selectItems([selection], {
779
+ reveal: true,
780
+ });
781
781
  return Promise.resolve({
782
782
  currentContent: currentContentRef.current,
783
783
  selectedSequence: serializeSequence(timelineTrack),
@@ -1025,8 +1025,8 @@ const WebMcp = () => {
1025
1025
  currentFrame: (0, imperative_state_1.getCurrentFrame)(),
1026
1026
  currentSelection: currentSelectionRef.current,
1027
1027
  currentContent: currentContentRef.current,
1028
- selectionType: selectedItemsRef.current.length === 1
1029
- ? selectedItemsRef.current[0].type
1028
+ selectionType: timelineSelectionRef.current.selectedItems.length === 1
1029
+ ? timelineSelectionRef.current.selectedItems[0].type
1030
1030
  : null,
1031
1031
  selectedSequence: selectedSequenceRef.current,
1032
1032
  }),
@@ -1181,9 +1181,9 @@ const WebMcp = () => {
1181
1181
  guidesListRef.current = nextGuides;
1182
1182
  setGuidesList(() => nextGuides);
1183
1183
  (0, editor_guides_1.persistGuidesList)(nextGuides);
1184
- const removedGuideWasSelected = selectedItemsRef.current.some((item) => item.type === 'guide' && item.guideId === guideId);
1184
+ const removedGuideWasSelected = timelineSelectionRef.current.selectedItems.some((item) => item.type === 'guide' && item.guideId === guideId);
1185
1185
  if (removedGuideWasSelected) {
1186
- clearSelection();
1186
+ timelineSelectionRef.current.clearSelection();
1187
1187
  }
1188
1188
  return Promise.resolve({
1189
1189
  currentContent: currentContentRef.current,
@@ -1426,16 +1426,15 @@ const WebMcp = () => {
1426
1426
  }, [
1427
1427
  addCaptionJob,
1428
1428
  addVideoMattingJob,
1429
- clearSelection,
1430
1429
  isPlaying,
1431
1430
  selectComposition,
1432
- selectItems,
1433
1431
  setEditorShowGuides,
1434
1432
  setGuidesList,
1435
1433
  setPlaybackRate,
1436
1434
  setPlayerMuted,
1437
1435
  setTimelineZoom,
1436
+ timelineSelectionRef,
1438
1437
  ]);
1439
- return null;
1438
+ return (jsx_runtime_1.jsx(WebMcpSelectionSync, { currentSelectionRef: currentSelectionRef, selectedSequenceRef: selectedSequenceRef }));
1440
1439
  };
1441
1440
  exports.WebMcp = WebMcp;
@@ -0,0 +1,32 @@
1
+ import type { ComboboxValue } from './NewComposition/ComboBox';
2
+ export declare const getAssetActionAvailability: ({ browserStudioCanMutateAssets, readOnlyStudio, connectionStatus, publicFolderExists, }: {
3
+ browserStudioCanMutateAssets: boolean | null;
4
+ readOnlyStudio: boolean;
5
+ connectionStatus: "connected" | "disconnected" | "init";
6
+ publicFolderExists: string | null;
7
+ }) => {
8
+ mutationsDisabled: boolean;
9
+ fileExplorerDisabled: boolean;
10
+ };
11
+ export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, copyAbsolutePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }: {
12
+ relativePath: string;
13
+ fileManagerName: string;
14
+ copyFileName: () => void;
15
+ copyStaticFilePath: () => void;
16
+ copyAbsolutePath: (() => void) | null;
17
+ openAssetInConvert: () => void;
18
+ openAssetInExplorer: () => void;
19
+ renameAsset: () => void;
20
+ deleteAsset: () => void;
21
+ fileExplorerAvailable: boolean;
22
+ fileExplorerDisabled: boolean;
23
+ mutationsDisabled: boolean;
24
+ }) => ComboboxValue[];
25
+ export declare const useAssetContextMenuItems: ({ relativePath, readOnlyStudio, }: {
26
+ relativePath: string | null;
27
+ readOnlyStudio: boolean;
28
+ }) => {
29
+ fileExplorerDisabled: boolean;
30
+ fileManagerName: string;
31
+ getContextMenuItems: () => ComboboxValue[];
32
+ };