@remotion/studio 4.0.518 → 4.0.520

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 (196) hide show
  1. package/dist/api/visual-control.js +2 -2
  2. package/dist/components/AppLaunchButton.d.ts +16 -0
  3. package/dist/components/AppLaunchButton.js +90 -0
  4. package/dist/components/AssetSelector.js +7 -6
  5. package/dist/components/AssetSelectorItem.d.ts +12 -0
  6. package/dist/components/AssetSelectorItem.js +180 -62
  7. package/dist/components/AudioWaveform.js +6 -1
  8. package/dist/components/Button.js +20 -7
  9. package/dist/components/Canvas.js +117 -92
  10. package/dist/components/CanvasOrLoading.js +7 -7
  11. package/dist/components/CodingAgentButton.d.ts +7 -0
  12. package/dist/components/CodingAgentButton.js +59 -0
  13. package/dist/components/CompositionContextButton.d.ts +1 -0
  14. package/dist/components/CompositionContextButton.js +6 -3
  15. package/dist/components/CompositionSelector.js +21 -20
  16. package/dist/components/CompositionSelectorItem.js +23 -35
  17. package/dist/components/ConfigureLicenseModal.js +4 -48
  18. package/dist/components/CurrentAsset.js +1 -1
  19. package/dist/components/CurrentCompositionSideEffects.js +5 -0
  20. package/dist/components/ElementInstallConfirmation.d.ts +2 -10
  21. package/dist/components/ElementInstallConfirmation.js +339 -32
  22. package/dist/components/FixComputedValueModal.js +5 -131
  23. package/dist/components/FpsCounter.js +1 -1
  24. package/dist/components/FramePersistor.js +1 -1
  25. package/dist/components/InitialCompositionLoader.js +3 -2
  26. package/dist/components/InspectorOpenInEditor.js +48 -33
  27. package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
  28. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
  29. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
  30. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  31. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +5 -4
  33. package/dist/components/InspectorPanel/common.js +1 -0
  34. package/dist/components/InspectorPanel/styles.js +1 -0
  35. package/dist/components/InspectorPanel/use-composition-actions.js +5 -8
  36. package/dist/components/InspectorSequenceSection.js +8 -3
  37. package/dist/components/InspectorSourceLocation.js +5 -1
  38. package/dist/components/KnownBugs.d.ts +1 -1
  39. package/dist/components/KnownBugs.js +1 -1
  40. package/dist/components/LicenseExplanation.d.ts +2 -0
  41. package/dist/components/LicenseExplanation.js +63 -0
  42. package/dist/components/MenuToolbar.js +7 -1
  43. package/dist/components/Modals.js +1 -2
  44. package/dist/components/NewComposition/InputDragger.js +29 -2
  45. package/dist/components/NewComposition/NewCompDuration.js +1 -1
  46. package/dist/components/NewComposition/NewComposition.d.ts +23 -0
  47. package/dist/components/NewComposition/NewComposition.js +217 -80
  48. package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
  49. package/dist/components/PlayPause.js +2 -13
  50. package/dist/components/PreviewToolbar.js +1 -1
  51. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
  52. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +50 -28
  53. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +14 -1
  54. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +64 -9
  55. package/dist/components/QuickSwitcher/composition-search.d.ts +16 -0
  56. package/dist/components/QuickSwitcher/composition-search.js +136 -0
  57. package/dist/components/RenderQueue/actions.d.ts +1 -0
  58. package/dist/components/RenderQueue/actions.js +5 -1
  59. package/dist/components/ResetZoomButton.js +17 -2
  60. package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
  61. package/dist/components/SelectedOutlineElement.js +12 -31
  62. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  63. package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
  64. package/dist/components/SelectedOutlineOverlay.js +21 -26
  65. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  66. package/dist/components/SelectedOutlinePolygon.js +12 -4
  67. package/dist/components/SelectedOutlineRenderer.js +88 -21
  68. package/dist/components/SettingsContext.js +2 -1
  69. package/dist/components/SettingsModal.d.ts +1 -1
  70. package/dist/components/SettingsModal.js +19 -3
  71. package/dist/components/SidebarRenderButton.d.ts +1 -0
  72. package/dist/components/SidebarRenderButton.js +14 -5
  73. package/dist/components/Timeline/SequencePropsObserver.js +29 -14
  74. package/dist/components/Timeline/Timeline.js +2 -1
  75. package/dist/components/Timeline/TimelineAssetField.js +1 -0
  76. package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -90
  77. package/dist/components/Timeline/TimelineDragHandler.js +18 -8
  78. package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -3
  79. package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
  80. package/dist/components/Timeline/TimelinePinchZoom.js +14 -4
  81. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +8 -4
  82. package/dist/components/Timeline/TimelineRowChrome.js +4 -2
  83. package/dist/components/Timeline/TimelineSequence.js +52 -45
  84. package/dist/components/Timeline/TimelineSequenceItem.js +44 -32
  85. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +3 -3
  86. package/dist/components/Timeline/TimelineSlider.js +2 -2
  87. package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
  88. package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
  89. package/dist/components/Timeline/TimelineWidthProvider.js +15 -8
  90. package/dist/components/Timeline/TimelineZoomControls.js +25 -8
  91. package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
  92. package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
  93. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
  94. package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
  95. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
  96. package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
  97. package/dist/components/Timeline/timeline-scroll-logic.d.ts +1 -0
  98. package/dist/components/Timeline/timeline-scroll-logic.js +21 -17
  99. package/dist/components/Timeline/use-delete-timeline-items.d.ts +1 -0
  100. package/dist/components/Timeline/use-delete-timeline-items.js +118 -0
  101. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
  102. package/dist/components/Timeline/use-timeline-asset-drop.js +8 -14
  103. package/dist/components/TimelineCombobox.js +1 -0
  104. package/dist/components/UpdateCheck.d.ts +0 -8
  105. package/dist/components/UpdateCheck.js +7 -54
  106. package/dist/components/UpdateStatusContext.d.ts +18 -0
  107. package/dist/components/UpdateStatusContext.js +74 -0
  108. package/dist/components/UpdatesSettings.d.ts +2 -0
  109. package/dist/components/UpdatesSettings.js +251 -0
  110. package/dist/components/WebMcp.js +64 -11
  111. package/dist/components/ZoomPersistor.js +2 -2
  112. package/dist/components/composition-drag-data.d.ts +36 -0
  113. package/dist/components/composition-drag-data.js +232 -0
  114. package/dist/components/drop-handler-data.d.ts +2 -1
  115. package/dist/components/drop-handler-data.js +6 -4
  116. package/dist/components/effect-drag-and-drop.d.ts +2 -5
  117. package/dist/components/get-open-in-menu-items.d.ts +4 -0
  118. package/dist/components/get-open-in-menu-items.js +28 -24
  119. package/dist/components/handle-drop.js +6 -2
  120. package/dist/components/import-assets.d.ts +5 -13
  121. package/dist/components/root-composition-menu-items.d.ts +4 -1
  122. package/dist/components/root-composition-menu-items.js +38 -1
  123. package/dist/components/selected-outline-geometry.d.ts +21 -2
  124. package/dist/components/selected-outline-geometry.js +16 -5
  125. package/dist/components/selected-outline-measurement.d.ts +40 -1
  126. package/dist/components/selected-outline-measurement.js +239 -1
  127. package/dist/components/selected-outline-order.d.ts +12 -0
  128. package/dist/components/selected-outline-order.js +251 -0
  129. package/dist/components/selected-outline-types.d.ts +15 -2
  130. package/dist/components/selected-outline-uv.js +106 -3
  131. package/dist/components/use-configure-default-apps.d.ts +1 -0
  132. package/dist/components/use-configure-default-apps.js +24 -0
  133. package/dist/error-overlay/current-error.d.ts +13 -0
  134. package/dist/error-overlay/current-error.js +21 -0
  135. package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
  136. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
  137. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
  138. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +6 -2
  139. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
  140. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
  141. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  142. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
  143. package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
  144. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  145. package/dist/esm/chunk-6jf1natv.js +25 -0
  146. package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
  147. package/dist/esm/chunk-m0jqdbkr.js +14571 -0
  148. package/dist/esm/{chunk-7prjt5n5.js → chunk-np6q13k5.js} +18637 -12189
  149. package/dist/esm/index.mjs +4 -3
  150. package/dist/esm/internals.mjs +35826 -14822
  151. package/dist/esm/previewEntry.mjs +40028 -18935
  152. package/dist/esm/renderEntry.mjs +6 -3
  153. package/dist/helpers/can-show-updates.d.ts +5 -0
  154. package/dist/helpers/can-show-updates.js +7 -0
  155. package/dist/helpers/colors.d.ts +0 -3
  156. package/dist/helpers/colors.js +2 -5
  157. package/dist/helpers/create-folder-tree.d.ts +5 -0
  158. package/dist/helpers/create-folder-tree.js +26 -6
  159. package/dist/helpers/document-title.d.ts +2 -0
  160. package/dist/helpers/document-title.js +14 -3
  161. package/dist/helpers/get-asset-metadata.js +1 -1
  162. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
  163. package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
  164. package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
  165. package/dist/helpers/get-box-quads-ponyfill.js +23 -0
  166. package/dist/helpers/get-git-menu-item.d.ts +5 -0
  167. package/dist/helpers/get-git-menu-item.js +15 -1
  168. package/dist/helpers/get-timeline-max-zoom.d.ts +34 -28
  169. package/dist/helpers/get-timeline-max-zoom.js +46 -29
  170. package/dist/helpers/hoverable.js +10 -5
  171. package/dist/helpers/install-fiber-sequence-order-observer.d.ts +37 -0
  172. package/dist/helpers/install-fiber-sequence-order-observer.js +109 -0
  173. package/dist/helpers/open-in-editor.js +53 -2
  174. package/dist/helpers/preview-server-events.js +3 -0
  175. package/dist/helpers/timeline-layout.d.ts +0 -1
  176. package/dist/helpers/timeline-layout.js +1 -5
  177. package/dist/helpers/url-state.d.ts +1 -0
  178. package/dist/helpers/url-state.js +12 -5
  179. package/dist/helpers/use-runtime-values.d.ts +1 -1
  180. package/dist/helpers/use-runtime-values.js +5 -4
  181. package/dist/helpers/use-sync-external-store.d.ts +3 -0
  182. package/dist/helpers/use-sync-external-store.js +5 -0
  183. package/dist/previewEntry.js +2 -0
  184. package/dist/renderEntry.js +2 -0
  185. package/dist/state/folders.d.ts +3 -0
  186. package/dist/state/folders.js +40 -1
  187. package/dist/state/modals.d.ts +19 -8
  188. package/dist/state/timeline-sequence-hover.js +3 -2
  189. package/dist/state/timeline-zoom.d.ts +0 -1
  190. package/dist/state/timeline-zoom.js +13 -6
  191. package/package.json +18 -15
  192. package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
  193. package/dist/components/UpdateModal/UpdateModal.js +0 -104
  194. package/dist/helpers/sort-by-nonce-history.d.ts +0 -1
  195. package/dist/helpers/sort-by-nonce-history.js +0 -6
  196. /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useUpdateStatus = exports.UpdateStatusProvider = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
8
+ const can_show_updates_1 = require("../helpers/can-show-updates");
9
+ const client_id_1 = require("../helpers/client-id");
10
+ const actions_1 = require("./RenderQueue/actions");
11
+ const UpdateStatusContext = (0, react_1.createContext)(null);
12
+ const UpdateStatusProvider = ({ children }) => {
13
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
14
+ const [info, setInfo] = (0, react_1.useState)(null);
15
+ const [knownBugs, setKnownBugs] = (0, react_1.useState)(null);
16
+ const [error, setError] = (0, react_1.useState)(null);
17
+ const showUpdates = (0, can_show_updates_1.canShowUpdates)({
18
+ connectionStatus: previewServerState.type,
19
+ isBrowserStudio: (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null,
20
+ readOnlyStudio: window.remotion_isReadOnlyStudio,
21
+ });
22
+ (0, react_1.useEffect)(() => {
23
+ if (!showUpdates) {
24
+ setInfo(null);
25
+ setKnownBugs(null);
26
+ setError(null);
27
+ return;
28
+ }
29
+ const updateController = new AbortController();
30
+ const bugsController = new AbortController();
31
+ (0, actions_1.updateAvailable)(updateController.signal)
32
+ .then((response) => {
33
+ setInfo(response);
34
+ setError(null);
35
+ })
36
+ .catch((err) => {
37
+ if (updateController.signal.aborted) {
38
+ return;
39
+ }
40
+ setError(err.message);
41
+ });
42
+ fetch('https://bugs.remotion.dev/api/' + remotion_1.VERSION, {
43
+ signal: bugsController.signal,
44
+ })
45
+ .then(async (response) => {
46
+ const body = await response.json();
47
+ setKnownBugs(body.bugs);
48
+ })
49
+ .catch((err) => {
50
+ if (bugsController.signal.aborted) {
51
+ return;
52
+ }
53
+ // eslint-disable-next-line no-console
54
+ console.log('Could not check for bugs in this version', err);
55
+ });
56
+ return () => {
57
+ updateController.abort();
58
+ bugsController.abort();
59
+ };
60
+ }, [showUpdates]);
61
+ const value = (0, react_1.useMemo)(() => {
62
+ return { error, info, knownBugs };
63
+ }, [error, info, knownBugs]);
64
+ return (jsx_runtime_1.jsx(UpdateStatusContext.Provider, { value: value, children: children }));
65
+ };
66
+ exports.UpdateStatusProvider = UpdateStatusProvider;
67
+ const useUpdateStatus = () => {
68
+ const context = (0, react_1.useContext)(UpdateStatusContext);
69
+ if (context === null) {
70
+ throw new Error('useUpdateStatus must be used inside UpdateStatusProvider');
71
+ }
72
+ return context;
73
+ };
74
+ exports.useUpdateStatus = useUpdateStatus;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const UpdatesSettings: React.FC;
@@ -0,0 +1,251 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdatesSettings = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const copy_text_1 = require("../helpers/copy-text");
8
+ const clipboard_1 = require("../icons/clipboard");
9
+ const InlineAction_1 = require("./InlineAction");
10
+ const KnownBugs_1 = require("./KnownBugs");
11
+ const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
12
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
13
+ const actions_1 = require("./RenderQueue/actions");
14
+ const SettingsContext_1 = require("./SettingsContext");
15
+ const UpdateStatusContext_1 = require("./UpdateStatusContext");
16
+ const container = {
17
+ alignSelf: 'flex-start',
18
+ boxSizing: 'border-box',
19
+ flex: 1,
20
+ minWidth: 0,
21
+ padding: '4px 16px 0',
22
+ };
23
+ const text = {
24
+ color: colors_1.LIGHT_TEXT,
25
+ fontFamily: 'sans-serif',
26
+ fontSize: 14,
27
+ lineHeight: 1.5,
28
+ };
29
+ const title = {
30
+ paddingTop: 12,
31
+ paddingBottom: 8,
32
+ ...text,
33
+ };
34
+ const titleBeforeCommand = {
35
+ ...title,
36
+ paddingBottom: 0,
37
+ };
38
+ const commandField = {
39
+ alignItems: 'center',
40
+ background: colors_1.SELECTED_BACKGROUND,
41
+ borderRadius: 6,
42
+ boxSizing: 'border-box',
43
+ display: 'flex',
44
+ marginBottom: 10,
45
+ marginTop: 10,
46
+ padding: '8px 8px 8px 10px',
47
+ width: '100%',
48
+ };
49
+ const code = {
50
+ color: colors_1.WHITE,
51
+ flex: 1,
52
+ fontFamily: 'monospace',
53
+ fontSize: 14,
54
+ lineHeight: 1.5,
55
+ margin: 0,
56
+ minWidth: 0,
57
+ overflowX: 'auto',
58
+ whiteSpace: 'pre',
59
+ };
60
+ const copyIcon = {
61
+ flexShrink: 0,
62
+ height: 12,
63
+ width: 12,
64
+ };
65
+ const link = {
66
+ ...text,
67
+ fontWeight: 'bold',
68
+ color: colors_1.BLUE,
69
+ textDecoration: 'none',
70
+ };
71
+ const releaseNotesFrame = {
72
+ backgroundColor: colors_1.BACKGROUND,
73
+ border: 0,
74
+ display: 'block',
75
+ marginTop: 8,
76
+ overflow: 'hidden',
77
+ width: '100%',
78
+ };
79
+ const releaseNotesTitle = {
80
+ ...title,
81
+ borderBottom: colors_1.BORDER_WHITE_ALPHA_12,
82
+ width: '100%',
83
+ };
84
+ const commands = {
85
+ npm: 'npx remotion upgrade',
86
+ yarn: 'yarn remotion upgrade',
87
+ pnpm: 'pnpm exec remotion upgrade',
88
+ bun: 'bun remotion upgrade',
89
+ unknown: 'npx remotion upgrade',
90
+ };
91
+ const skillsUpdateCommand = 'npx remotion skills update';
92
+ const remotionUpgradeSkill = '/remotion-upgrade';
93
+ const formatReleaseDate = (publishedAt) => {
94
+ if (publishedAt === null) {
95
+ return null;
96
+ }
97
+ const date = new Date(publishedAt);
98
+ if (Number.isNaN(date.getTime())) {
99
+ return null;
100
+ }
101
+ const day = date.getDate();
102
+ const lastTwoDigits = day % 100;
103
+ const suffix = lastTwoDigits >= 11 && lastTwoDigits <= 13
104
+ ? 'th'
105
+ : day % 10 === 1
106
+ ? 'st'
107
+ : day % 10 === 2
108
+ ? 'nd'
109
+ : day % 10 === 3
110
+ ? 'rd'
111
+ : 'th';
112
+ const month = new Intl.DateTimeFormat('en-US', {
113
+ month: 'long',
114
+ }).format(date);
115
+ return `${month} ${day}${suffix}, ${date.getFullYear()}`;
116
+ };
117
+ const RenderedReleaseNotes = ({ release }) => {
118
+ const [height, setHeight] = (0, react_1.useState)(220);
119
+ const frameRef = (0, react_1.useRef)(null);
120
+ const resizeObserver = (0, react_1.useRef)(null);
121
+ const formattedReleaseDate = formatReleaseDate(release.publishedAt);
122
+ const document = (0, react_1.useMemo)(() => {
123
+ if (release.releaseNotesHtml === null) {
124
+ return null;
125
+ }
126
+ return `<!doctype html><html><head><base href="https://github.com/remotion-dev/remotion/" target="_blank"><style>
127
+ :root { color-scheme: dark; }
128
+ html, body { overflow: hidden; }
129
+ body { background: ${colors_1.BACKGROUND}; color: ${colors_1.LIGHT_TEXT}; font-family: sans-serif; font-size: 13px; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
130
+ h1, h2, h3, h4, h5, h6 { color: ${colors_1.WHITE}; line-height: 1.25; margin: 16px 0 8px; }
131
+ h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }
132
+ h1 { font-size: 18px; } h2 { font-size: 16px; } h3, h4, h5, h6 { font-size: 14px; }
133
+ p, ul, ol, pre, blockquote { margin: 8px 0; }
134
+ ul, ol { padding-left: 22px; }
135
+ a { color: ${colors_1.BLUE}; text-decoration: none; }
136
+ code { background: transparent; color: ${colors_1.LIGHT_TEXT}; font-family: monospace; padding: 0; }
137
+ pre { background: ${colors_1.SELECTED_BACKGROUND}; border-radius: 6px; overflow-x: auto; padding: 10px; }
138
+ pre code { background: transparent; padding: 0; }
139
+ img { max-width: 100%; }
140
+ blockquote { border-left: 3px solid ${colors_1.SELECTED_BACKGROUND}; margin-left: 0; padding-left: 10px; }
141
+ hr { border: 0; border-top: 1px solid ${colors_1.SELECTED_BACKGROUND}; }
142
+ </style></head><body>${release.releaseNotesHtml}</body></html>`;
143
+ }, [release.releaseNotesHtml]);
144
+ (0, react_1.useEffect)(() => {
145
+ return () => {
146
+ var _a;
147
+ return (_a = resizeObserver.current) === null || _a === void 0 ? void 0 : _a.disconnect();
148
+ };
149
+ }, []);
150
+ const onLoad = (0, react_1.useCallback)(() => {
151
+ var _a, _b;
152
+ (_a = resizeObserver.current) === null || _a === void 0 ? void 0 : _a.disconnect();
153
+ const iframeDocument = (_b = frameRef.current) === null || _b === void 0 ? void 0 : _b.contentDocument;
154
+ if (!(iframeDocument === null || iframeDocument === void 0 ? void 0 : iframeDocument.body)) {
155
+ return;
156
+ }
157
+ const updateHeight = () => {
158
+ setHeight(iframeDocument.documentElement.scrollHeight + 2);
159
+ };
160
+ updateHeight();
161
+ const observer = new ResizeObserver(updateHeight);
162
+ observer.observe(iframeDocument.body);
163
+ resizeObserver.current = observer;
164
+ }, []);
165
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
166
+ jsx_runtime_1.jsxs("div", { style: releaseNotesTitle, children: [release.version, formattedReleaseDate === null
167
+ ? null
168
+ : ` \u2013\u00a0${formattedReleaseDate}`] }), document === null ? (jsx_runtime_1.jsxs("div", { style: text, children: ["Release notes could not be loaded.", ' ', jsx_runtime_1.jsx("a", { style: link, target: "_blank", href: `https://github.com/remotion-dev/remotion/releases/tag/v${release.version}`, children: "View them on GitHub" }),
169
+ "."] })) : (jsx_runtime_1.jsx("iframe", { ref: frameRef, onLoad: onLoad, sandbox: "allow-popups allow-popups-to-escape-sandbox allow-same-origin", scrolling: "no", srcDoc: document, style: { ...releaseNotesFrame, height }, title: `Release notes for Remotion ${release.version}` }))] }));
170
+ };
171
+ const UpdatesSettings = () => {
172
+ const { remotionSkillsInfo } = (0, SettingsContext_1.useSettings)();
173
+ const { error, info, knownBugs } = (0, UpdateStatusContext_1.useUpdateStatus)();
174
+ const [releaseNotes, setReleaseNotes] = (0, react_1.useState)(null);
175
+ (0, react_1.useEffect)(() => {
176
+ if (!(info === null || info === void 0 ? void 0 : info.updateAvailable)) {
177
+ return;
178
+ }
179
+ const controller = new AbortController();
180
+ (0, actions_1.getReleaseNotes)(info.currentVersion, info.latestVersion, controller.signal)
181
+ .then((response) => {
182
+ setReleaseNotes({
183
+ ...response,
184
+ currentVersion: info.currentVersion,
185
+ latestVersion: info.latestVersion,
186
+ });
187
+ })
188
+ .catch(() => {
189
+ if (!controller.signal.aborted) {
190
+ setReleaseNotes({
191
+ currentVersion: info.currentVersion,
192
+ hasMore: false,
193
+ latestVersion: info.latestVersion,
194
+ releases: [],
195
+ });
196
+ }
197
+ });
198
+ return () => controller.abort();
199
+ }, [info]);
200
+ const hasKnownBugs = (0, react_1.useMemo)(() => {
201
+ var _a;
202
+ return ((_a = knownBugs === null || knownBugs === void 0 ? void 0 : knownBugs.length) !== null && _a !== void 0 ? _a : 0) > 0;
203
+ }, [knownBugs]);
204
+ const updateAction = info
205
+ ? (remotionSkillsInfo === null || remotionSkillsInfo === void 0 ? void 0 : remotionSkillsInfo.remotionUpgradeSkillAvailable)
206
+ ? remotionUpgradeSkill
207
+ : info.updateAvailable
208
+ ? commands[info.packageManager]
209
+ : skillsUpdateCommand
210
+ : null;
211
+ const updateActionType = (remotionSkillsInfo === null || remotionSkillsInfo === void 0 ? void 0 : remotionSkillsInfo.remotionUpgradeSkillAvailable)
212
+ ? 'skill'
213
+ : 'command';
214
+ const onClick = (0, react_1.useCallback)(() => {
215
+ if (updateAction === null) {
216
+ return;
217
+ }
218
+ (0, copy_text_1.copyText)(updateAction).catch((err) => {
219
+ (0, NotificationCenter_1.showNotification)('Could not copy: ' + err.message, 2000);
220
+ });
221
+ }, [updateAction]);
222
+ const renderCopyAction = (0, react_1.useCallback)((color) => {
223
+ return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { color: color, style: copyIcon });
224
+ }, []);
225
+ if (info === null) {
226
+ 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..." })) }));
227
+ }
228
+ if (info.timedOut && !info.skillsUpdateAvailable) {
229
+ return (jsx_runtime_1.jsxs("div", { style: container, children: [
230
+ jsx_runtime_1.jsx("div", { style: title, children: "Could not check for updates." }), jsx_runtime_1.jsx("div", { style: text, children: "The update check timed out. Try again later." })
231
+ ] }));
232
+ }
233
+ if (!info.updateAvailable && !info.skillsUpdateAvailable) {
234
+ return (jsx_runtime_1.jsxs("div", { style: container, children: [
235
+ jsx_runtime_1.jsxs("div", { style: title, children: ["You", "'re", " up to date."] }), jsx_runtime_1.jsxs("div", { style: text, children: ["Remotion ", info.currentVersion, " and your Remotion Agent Skills are up to date."] })
236
+ ] }));
237
+ }
238
+ return (jsx_runtime_1.jsxs("div", { style: container, children: [hasKnownBugs && info.updateAvailable ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
239
+ jsx_runtime_1.jsxs("div", { style: title, children: ["The currently installed version ", info.currentVersion, " has the following known bugs:"] }), jsx_runtime_1.jsx(KnownBugs_1.KnownBugs, { bugs: knownBugs !== null && knownBugs !== void 0 ? knownBugs : [] }), jsx_runtime_1.jsx("div", { style: { height: '20px' } }), jsx_runtime_1.jsxs("div", { style: text, children: ["To update, run the following ", updateActionType, ":"] })
240
+ ] })) : info.updateAvailable ? (jsx_runtime_1.jsxs("div", { style: titleBeforeCommand, children: ["A new Remotion update is available. Run the following", ' ', updateActionType, ":"] })) : (jsx_runtime_1.jsxs("div", { style: titleBeforeCommand, children: ["Your Remotion Agent Skills are out of date. Run the following", ' ', updateActionType, ":"] })), jsx_runtime_1.jsxs("div", { style: commandField, children: [
241
+ jsx_runtime_1.jsx("pre", { style: code, children: updateAction }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onClick, renderAction: renderCopyAction, title: "Copy command" })
242
+ ] }), info.updateAvailable ? (jsx_runtime_1.jsxs("div", { style: text, children: ["This will update Remotion from ", info.currentVersion, " to", ' ', info.latestVersion, info.skillsUpdateAvailable
243
+ ? ' and update your project Remotion Agent Skills.'
244
+ : '.'] })) : null, info.updateAvailable ? ((releaseNotes === null || releaseNotes === void 0 ? void 0 : releaseNotes.currentVersion) === info.currentVersion &&
245
+ releaseNotes.latestVersion === info.latestVersion ? (releaseNotes.releases.length === 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
246
+ jsx_runtime_1.jsx("div", { style: releaseNotesTitle, children: info.latestVersion }), jsx_runtime_1.jsxs("div", { style: text, children: ["Release notes could not be loaded.", ' ', jsx_runtime_1.jsx("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "View them on GitHub" }),
247
+ "."] })
248
+ ] })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [releaseNotes.releases.map((release) => (jsx_runtime_1.jsx(RenderedReleaseNotes, { release: release }, release.version))), releaseNotes.hasMore ? (jsx_runtime_1.jsxs("div", { style: { ...text, paddingTop: 12 }, children: ["Showing the 5 most recent releases.", ' ', jsx_runtime_1.jsx("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "View all releases on GitHub" }),
249
+ "."] })) : null] }))) : (jsx_runtime_1.jsx("div", { style: text, children: "Loading release notes..." }))) : null] }));
250
+ };
251
+ exports.UpdatesSettings = UpdatesSettings;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebMcp = void 0;
4
- const canvas_1 = require("@remotion/canvas");
5
4
  const react_1 = require("react");
6
5
  const remotion_1 = require("remotion");
7
6
  const pause_1 = require("../api/pause");
8
7
  const play_1 = require("../api/play");
9
8
  const seek_1 = require("../api/seek");
9
+ const current_error_1 = require("../error-overlay/current-error");
10
10
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
11
11
  const create_folder_tree_1 = require("../helpers/create-folder-tree");
12
12
  const format_file_location_1 = require("../helpers/format-file-location");
@@ -17,10 +17,12 @@ const mute_1 = require("../state/mute");
17
17
  const playbackrate_1 = require("../state/playbackrate");
18
18
  const timeline_zoom_1 = require("../state/timeline-zoom");
19
19
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
20
+ const selected_outline_measurement_1 = require("./selected-outline-measurement");
20
21
  const find_track_for_node_path_info_1 = require("./Timeline/find-track-for-node-path-info");
21
22
  const imperative_state_1 = require("./Timeline/imperative-state");
22
23
  const parse_keyframe_field_from_node_path_1 = require("./Timeline/parse-keyframe-field-from-node-path");
23
24
  const should_show_track_in_timeline_1 = require("./Timeline/should-show-track-in-timeline");
25
+ const timeline_refs_1 = require("./Timeline/timeline-refs");
24
26
  const TimelineSelection_1 = require("./Timeline/TimelineSelection");
25
27
  const get_stack_1 = require("./Timeline/TimelineStack/get-stack");
26
28
  const use_resolved_stack_react_to_change_1 = require("./Timeline/use-resolved-stack-react-to-change");
@@ -64,7 +66,7 @@ const WebMcp = () => {
64
66
  const { canSelect, clearSelection, selectedItems, selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
65
67
  const { canvasContent, compositions, currentCompositionMetadata, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
66
68
  const { playbackRate: currentPlaybackRate, setPlaybackRate } = remotion_1.Internals.usePlaybackRate();
67
- const [, , imperativePlaying] = remotion_1.Internals.Timeline.usePlayingState();
69
+ const { isPlaying } = remotion_1.Internals.Timeline.useTimelineContext();
68
70
  const { mediaVolume, playerMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
69
71
  const { setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
70
72
  const { setZoom: setTimelineZoom, zoom: timelineZoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
@@ -201,6 +203,38 @@ const WebMcp = () => {
201
203
  }).filter((timelineTrack) => (0, should_show_track_in_timeline_1.shouldShowTrackInTimeline)(timelineTrack, durationInFrames));
202
204
  };
203
205
  Promise.all([
206
+ modelContext.registerTool({
207
+ name: 'get_current_error',
208
+ title: 'Get current Studio error',
209
+ description: 'Read the error currently shown in the Remotion Studio error overlay. Returns null when the overlay is not visible and includes symbolicated stack frames when symbolication succeeds.',
210
+ inputSchema: {
211
+ type: 'object',
212
+ properties: {},
213
+ additionalProperties: false,
214
+ },
215
+ annotations: { readOnlyHint: true },
216
+ execute: async () => {
217
+ var _a, _b;
218
+ const currentError = (0, current_error_1.getCurrentError)();
219
+ if (currentError === null) {
220
+ return null;
221
+ }
222
+ let symbolicatedStackFrames = null;
223
+ try {
224
+ const record = await currentError.symbolication;
225
+ symbolicatedStackFrames = (_a = record === null || record === void 0 ? void 0 : record.stackFrames) !== null && _a !== void 0 ? _a : null;
226
+ }
227
+ catch (_c) {
228
+ // Fall back to the original stack if symbolication fails.
229
+ }
230
+ return {
231
+ name: currentError.error.name,
232
+ message: currentError.error.message,
233
+ stack: (_b = currentError.error.stack) !== null && _b !== void 0 ? _b : null,
234
+ symbolicatedStackFrames,
235
+ };
236
+ },
237
+ }, { signal: controller.signal }),
204
238
  modelContext.registerTool({
205
239
  name: 'get_compositions',
206
240
  title: 'Get Studio compositions',
@@ -397,7 +431,7 @@ const WebMcp = () => {
397
431
  };
398
432
  }
399
433
  const currentFrame = (0, imperative_state_1.getCurrentFrame)();
400
- const selectableOutlines = (0, canvas_1.getCanvasSelectableOutlines)({
434
+ const selectableOutlines = (0, selected_outline_measurement_1.getSequencesWithSelectableOutlines)({
401
435
  sequences: sequencesRef.current,
402
436
  overrideIdsToNodePaths: overrideIdToNodePathMappingsRef.current,
403
437
  compositions: compositionsRef.current,
@@ -416,7 +450,7 @@ const WebMcp = () => {
416
450
  scaleY === 0) {
417
451
  throw new Error('The Studio canvas is not ready to be measured.');
418
452
  }
419
- const measuredOutlines = (0, canvas_1.measureCanvasOutlines)(portalNode, selectableOutlines.map((outline) => {
453
+ const measuredOutlines = (0, selected_outline_measurement_1.measureOutlineTargets)(portalNode, selectableOutlines.map((outline) => {
420
454
  if (outline.sequence.refForOutline === null) {
421
455
  throw new Error('Expected an outline ref.');
422
456
  }
@@ -496,6 +530,7 @@ const WebMcp = () => {
496
530
  annotations: { readOnlyHint: true },
497
531
  execute: () => {
498
532
  var _a;
533
+ var _b, _c;
499
534
  const compositionId = currentCompositionRef.current;
500
535
  if (compositionId === null) {
501
536
  return Promise.resolve({
@@ -509,17 +544,28 @@ const WebMcp = () => {
509
544
  timelineZoom: null,
510
545
  });
511
546
  }
547
+ const durationInFrames = (0, imperative_state_1.getCurrentDuration)();
548
+ const timelineViewportWidth = (_b = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
549
+ const minZoom = (0, get_timeline_max_zoom_1.getTimelineMinZoom)({
550
+ durationInFrames,
551
+ timelineViewportWidth,
552
+ });
553
+ const timelineZoom = (0, get_timeline_max_zoom_1.getTimelineZoom)({
554
+ durationInFrames,
555
+ timelineViewportWidth,
556
+ zoom: (_c = timelineZoomRef.current[compositionId]) !== null && _c !== void 0 ? _c : null,
557
+ });
512
558
  return Promise.resolve({
513
559
  currentComposition: compositionId,
514
560
  currentFrame: (0, imperative_state_1.getCurrentFrame)(),
515
- playing: imperativePlaying.current,
561
+ playing: isPlaying(),
516
562
  muted: playerMutedRef.current,
517
563
  volume: mediaVolumeRef.current,
518
564
  playbackRate: playbackRateRef.current,
519
565
  looping: (0, loop_1.loadLoopOption)(),
520
566
  timelineZoom: (0, get_timeline_max_zoom_1.timelineZoomToNormalized)({
521
- zoom: (_a = timelineZoomRef.current[compositionId]) !== null && _a !== void 0 ? _a : get_timeline_max_zoom_1.TIMELINE_MIN_ZOOM,
522
- maxZoom: (0, get_timeline_max_zoom_1.getTimelineMaxZoom)((0, imperative_state_1.getCurrentDuration)()),
567
+ zoom: timelineZoom,
568
+ minZoom,
523
569
  }),
524
570
  });
525
571
  },
@@ -823,6 +869,8 @@ const WebMcp = () => {
823
869
  },
824
870
  annotations: { readOnlyHint: false },
825
871
  execute: ({ zoom }) => {
872
+ var _a;
873
+ var _b;
826
874
  if (typeof zoom !== 'number' ||
827
875
  !Number.isFinite(zoom) ||
828
876
  zoom < 0 ||
@@ -837,13 +885,18 @@ const WebMcp = () => {
837
885
  if (durationInFrames <= 1) {
838
886
  throw new Error('The current composition is a still and has no timeline zoom.');
839
887
  }
840
- const maxZoom = (0, get_timeline_max_zoom_1.getTimelineMaxZoom)(durationInFrames);
888
+ const timelineViewportWidth = (_b = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
889
+ const minZoom = (0, get_timeline_max_zoom_1.getTimelineMinZoom)({
890
+ durationInFrames,
891
+ timelineViewportWidth,
892
+ });
841
893
  const timelineZoom = (0, get_timeline_max_zoom_1.clampTimelineZoom)({
842
894
  zoom: (0, get_timeline_max_zoom_1.normalizedToTimelineZoom)({
843
895
  normalized: zoom,
844
- maxZoom,
896
+ minZoom,
845
897
  }),
846
898
  durationInFrames,
899
+ timelineViewportWidth,
847
900
  });
848
901
  setTimelineZoom(compositionId, () => timelineZoom, {
849
902
  anchorFrame: null,
@@ -853,7 +906,7 @@ const WebMcp = () => {
853
906
  currentComposition: compositionId,
854
907
  timelineZoom: (0, get_timeline_max_zoom_1.timelineZoomToNormalized)({
855
908
  zoom: timelineZoom,
856
- maxZoom,
909
+ minZoom,
857
910
  }),
858
911
  });
859
912
  },
@@ -931,7 +984,7 @@ const WebMcp = () => {
931
984
  };
932
985
  }, [
933
986
  clearSelection,
934
- imperativePlaying,
987
+ isPlaying,
935
988
  selectComposition,
936
989
  selectItems,
937
990
  setEditorShowGuides,
@@ -6,7 +6,7 @@ const remotion_1 = require("remotion");
6
6
  const timeline_zoom_1 = require("../state/timeline-zoom");
7
7
  const load_canvas_content_from_url_1 = require("./load-canvas-content-from-url");
8
8
  const makeKey = () => {
9
- return `remotion.zoom-map`;
9
+ return `remotion.zoom-map-pixels-per-frame`;
10
10
  };
11
11
  const persistCurrentZoom = (zoom) => {
12
12
  localStorage.setItem(makeKey(), JSON.stringify(zoom));
@@ -17,7 +17,7 @@ const getZoomFromLocalStorage = () => {
17
17
  };
18
18
  exports.getZoomFromLocalStorage = getZoomFromLocalStorage;
19
19
  const ZoomPersistor = () => {
20
- const [playing] = remotion_1.Internals.Timeline.usePlayingState();
20
+ const playing = remotion_1.Internals.usePlaying();
21
21
  const { zoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
22
22
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
23
23
  const urlState = (0, load_canvas_content_from_url_1.deriveCanvasContentFromUrl)();
@@ -0,0 +1,36 @@
1
+ import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
2
+ export type CompositionDragData = {
3
+ readonly type: 'remotion-composition';
4
+ readonly version: 1;
5
+ readonly compositionId: string;
6
+ readonly compositionFile: string | null;
7
+ };
8
+ export type CompositionDragPreviewMetadata = {
9
+ readonly type: 'composition';
10
+ readonly width: number | null;
11
+ readonly height: number | null;
12
+ readonly durationInFrames: number | null;
13
+ readonly mimeType: string;
14
+ };
15
+ type MakeCompositionDragDataInput = {
16
+ readonly compositionFile: string | null;
17
+ readonly compositionId: string;
18
+ readonly width: number | null;
19
+ readonly height: number | null;
20
+ readonly durationInFrames: number | null;
21
+ };
22
+ type SerializedCompositionDragData = {
23
+ readonly mimeType: string;
24
+ readonly payload: string;
25
+ };
26
+ type CompositionDragDataTransfer = {
27
+ readonly types: ArrayLike<string>;
28
+ readonly getData: (mimeType: string) => string;
29
+ };
30
+ export declare const makeCompositionDragData: ({ compositionFile, compositionId, width, height, durationInFrames, }: MakeCompositionDragDataInput) => SerializedCompositionDragData & {
31
+ readonly data: CompositionDragData;
32
+ };
33
+ export declare const getCompositionDragPreviewMetadata: (mimeTypes: ArrayLike<string>) => CompositionDragPreviewMetadata | null;
34
+ export declare const parseCompositionDragData: (source: CompositionDragDataTransfer | SerializedCompositionDragData) => CompositionDragData | null;
35
+ export declare const compositionDragDataToSymbolicatedStack: (dragData: CompositionDragData) => SymbolicatedStackFrame | null;
36
+ export {};