@remotion/studio 4.0.518 → 4.0.519

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 (140) hide show
  1. package/dist/components/AppLaunchButton.d.ts +16 -0
  2. package/dist/components/AppLaunchButton.js +90 -0
  3. package/dist/components/AssetSelector.js +7 -6
  4. package/dist/components/AssetSelectorItem.d.ts +12 -0
  5. package/dist/components/AssetSelectorItem.js +180 -62
  6. package/dist/components/Button.js +20 -7
  7. package/dist/components/Canvas.js +109 -78
  8. package/dist/components/CanvasOrLoading.js +7 -7
  9. package/dist/components/CodingAgentButton.d.ts +7 -0
  10. package/dist/components/CodingAgentButton.js +59 -0
  11. package/dist/components/CompositionContextButton.d.ts +1 -0
  12. package/dist/components/CompositionContextButton.js +6 -3
  13. package/dist/components/CompositionSelector.js +15 -10
  14. package/dist/components/CompositionSelectorItem.js +16 -23
  15. package/dist/components/ConfigureLicenseModal.js +4 -48
  16. package/dist/components/CurrentAsset.js +1 -1
  17. package/dist/components/ElementInstallConfirmation.d.ts +20 -7
  18. package/dist/components/ElementInstallConfirmation.js +325 -32
  19. package/dist/components/FixComputedValueModal.js +5 -131
  20. package/dist/components/InitialCompositionLoader.js +3 -2
  21. package/dist/components/InspectorOpenInEditor.js +48 -33
  22. package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
  23. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
  24. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
  25. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  26. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
  27. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
  28. package/dist/components/InspectorPanel/common.js +1 -0
  29. package/dist/components/InspectorPanel/styles.js +1 -0
  30. package/dist/components/InspectorSequenceSection.js +8 -3
  31. package/dist/components/InspectorSourceLocation.js +5 -1
  32. package/dist/components/KnownBugs.d.ts +1 -1
  33. package/dist/components/KnownBugs.js +1 -1
  34. package/dist/components/LicenseExplanation.d.ts +2 -0
  35. package/dist/components/LicenseExplanation.js +63 -0
  36. package/dist/components/MenuToolbar.js +7 -1
  37. package/dist/components/Modals.js +1 -2
  38. package/dist/components/NewComposition/InputDragger.js +29 -2
  39. package/dist/components/NewComposition/NewCompDuration.js +1 -1
  40. package/dist/components/NewComposition/NewComposition.d.ts +23 -0
  41. package/dist/components/NewComposition/NewComposition.js +217 -80
  42. package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
  43. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
  44. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +21 -13
  45. package/dist/components/RenderQueue/actions.d.ts +1 -0
  46. package/dist/components/RenderQueue/actions.js +5 -1
  47. package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
  48. package/dist/components/SelectedOutlineElement.js +2 -1
  49. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  50. package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
  51. package/dist/components/SelectedOutlineOverlay.js +21 -26
  52. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  53. package/dist/components/SelectedOutlinePolygon.js +12 -4
  54. package/dist/components/SelectedOutlineRenderer.js +88 -21
  55. package/dist/components/SettingsContext.js +2 -1
  56. package/dist/components/SettingsModal.d.ts +1 -1
  57. package/dist/components/SettingsModal.js +19 -3
  58. package/dist/components/SidebarRenderButton.d.ts +1 -0
  59. package/dist/components/SidebarRenderButton.js +14 -5
  60. package/dist/components/Timeline/SequencePropsObserver.js +29 -14
  61. package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
  62. package/dist/components/Timeline/TimelineRowChrome.js +4 -2
  63. package/dist/components/Timeline/TimelineSequence.js +40 -8
  64. package/dist/components/Timeline/TimelineSequenceItem.js +34 -1
  65. package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
  66. package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
  67. package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
  68. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
  69. package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
  70. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
  71. package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
  72. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
  73. package/dist/components/TimelineCombobox.js +1 -0
  74. package/dist/components/UpdateCheck.d.ts +0 -8
  75. package/dist/components/UpdateCheck.js +7 -54
  76. package/dist/components/UpdateStatusContext.d.ts +18 -0
  77. package/dist/components/UpdateStatusContext.js +74 -0
  78. package/dist/components/UpdatesSettings.d.ts +2 -0
  79. package/dist/components/UpdatesSettings.js +251 -0
  80. package/dist/components/WebMcp.js +3 -3
  81. package/dist/components/get-open-in-menu-items.d.ts +4 -0
  82. package/dist/components/get-open-in-menu-items.js +28 -24
  83. package/dist/components/root-composition-menu-items.d.ts +4 -1
  84. package/dist/components/root-composition-menu-items.js +38 -1
  85. package/dist/components/selected-outline-geometry.d.ts +21 -2
  86. package/dist/components/selected-outline-geometry.js +16 -5
  87. package/dist/components/selected-outline-measurement.d.ts +40 -1
  88. package/dist/components/selected-outline-measurement.js +239 -1
  89. package/dist/components/selected-outline-order.d.ts +12 -0
  90. package/dist/components/selected-outline-order.js +251 -0
  91. package/dist/components/selected-outline-types.d.ts +15 -2
  92. package/dist/components/selected-outline-uv.js +106 -3
  93. package/dist/components/use-configure-default-apps.d.ts +1 -0
  94. package/dist/components/use-configure-default-apps.js +24 -0
  95. package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
  96. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
  97. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
  98. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +1 -1
  99. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
  100. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
  101. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  102. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
  103. package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
  104. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  105. package/dist/esm/{chunk-7prjt5n5.js → chunk-1fkq5bfq.js} +15439 -11610
  106. package/dist/esm/chunk-6jf1natv.js +25 -0
  107. package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
  108. package/dist/esm/chunk-m0jqdbkr.js +14571 -0
  109. package/dist/esm/index.mjs +0 -2
  110. package/dist/esm/internals.mjs +32140 -13755
  111. package/dist/esm/previewEntry.mjs +35408 -17021
  112. package/dist/esm/renderEntry.mjs +6 -3
  113. package/dist/helpers/can-show-updates.d.ts +5 -0
  114. package/dist/helpers/can-show-updates.js +7 -0
  115. package/dist/helpers/colors.d.ts +0 -3
  116. package/dist/helpers/colors.js +2 -5
  117. package/dist/helpers/create-folder-tree.d.ts +5 -0
  118. package/dist/helpers/create-folder-tree.js +24 -1
  119. package/dist/helpers/get-asset-metadata.js +1 -1
  120. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
  121. package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
  122. package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
  123. package/dist/helpers/get-box-quads-ponyfill.js +23 -0
  124. package/dist/helpers/get-git-menu-item.d.ts +5 -0
  125. package/dist/helpers/get-git-menu-item.js +15 -1
  126. package/dist/helpers/hoverable.js +10 -5
  127. package/dist/helpers/open-in-editor.js +51 -1
  128. package/dist/helpers/preview-server-events.js +3 -0
  129. package/dist/helpers/timeline-layout.d.ts +0 -1
  130. package/dist/helpers/timeline-layout.js +1 -5
  131. package/dist/helpers/url-state.d.ts +1 -0
  132. package/dist/helpers/url-state.js +12 -5
  133. package/dist/renderEntry.js +2 -0
  134. package/dist/state/folders.d.ts +3 -0
  135. package/dist/state/folders.js +40 -1
  136. package/dist/state/modals.d.ts +1 -6
  137. package/package.json +17 -14
  138. package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
  139. package/dist/components/UpdateModal/UpdateModal.js +0 -104
  140. /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,7 +1,6 @@
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");
@@ -17,6 +16,7 @@ const mute_1 = require("../state/mute");
17
16
  const playbackrate_1 = require("../state/playbackrate");
18
17
  const timeline_zoom_1 = require("../state/timeline-zoom");
19
18
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
19
+ const selected_outline_measurement_1 = require("./selected-outline-measurement");
20
20
  const find_track_for_node_path_info_1 = require("./Timeline/find-track-for-node-path-info");
21
21
  const imperative_state_1 = require("./Timeline/imperative-state");
22
22
  const parse_keyframe_field_from_node_path_1 = require("./Timeline/parse-keyframe-field-from-node-path");
@@ -397,7 +397,7 @@ const WebMcp = () => {
397
397
  };
398
398
  }
399
399
  const currentFrame = (0, imperative_state_1.getCurrentFrame)();
400
- const selectableOutlines = (0, canvas_1.getCanvasSelectableOutlines)({
400
+ const selectableOutlines = (0, selected_outline_measurement_1.getSequencesWithSelectableOutlines)({
401
401
  sequences: sequencesRef.current,
402
402
  overrideIdsToNodePaths: overrideIdToNodePathMappingsRef.current,
403
403
  compositions: compositionsRef.current,
@@ -416,7 +416,7 @@ const WebMcp = () => {
416
416
  scaleY === 0) {
417
417
  throw new Error('The Studio canvas is not ready to be measured.');
418
418
  }
419
- const measuredOutlines = (0, canvas_1.measureCanvasOutlines)(portalNode, selectableOutlines.map((outline) => {
419
+ const measuredOutlines = (0, selected_outline_measurement_1.measureOutlineTargets)(portalNode, selectableOutlines.map((outline) => {
420
420
  if (outline.sequence.refForOutline === null) {
421
421
  throw new Error('Expected an outline ref.');
422
422
  }
@@ -2,6 +2,10 @@ import type { TerminalId } from '@remotion/studio-shared';
2
2
  import type { EditorPickerId, GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
3
3
  import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
4
4
  import type { ComboboxValue } from './NewComposition/ComboBox';
5
+ export declare const getConfigureDefaultAppsMenuItems: ({ hasPreviousItems, onConfigureApps, }: {
6
+ readonly hasPreviousItems: boolean;
7
+ readonly onConfigureApps: (() => void) | null;
8
+ }) => ComboboxValue[];
5
9
  export declare const getOpenInMenuItems: ({ codingAgentInfo, editorDisabled, editorInfo, excludeCodingAgentId, excludeEditorId, fileManagerDisabled, folder, location, onConfigureApps, onOpenInCodingAgent, onOpenInEditor, onOpenInFileExplorer, onOpenInGitClient, onOpenInTerminal, }: {
6
10
  readonly codingAgentInfo: GetDefaultCodingAgentInfoResponse | null;
7
11
  readonly editorDisabled: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOpenInMenuItems = void 0;
3
+ exports.getOpenInMenuItems = exports.getConfigureDefaultAppsMenuItems = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const no_react_1 = require("remotion/no-react");
6
6
  const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
@@ -17,6 +17,28 @@ const menuLabel = {
17
17
  fontSize: 13,
18
18
  lineHeight: '16px',
19
19
  };
20
+ const getConfigureDefaultAppsMenuItems = ({ hasPreviousItems, onConfigureApps, }) => {
21
+ if (!onConfigureApps) {
22
+ return [];
23
+ }
24
+ return [
25
+ ...(hasPreviousItems
26
+ ? [{ type: 'divider', id: 'open-in-settings-divider' }]
27
+ : []),
28
+ {
29
+ id: 'change-default-apps',
30
+ keyHint: null,
31
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Configure default apps..." }),
32
+ leftItem: null,
33
+ onClick: onConfigureApps,
34
+ quickSwitcherLabel: null,
35
+ subMenu: null,
36
+ type: 'item',
37
+ value: 'change-default-apps',
38
+ },
39
+ ];
40
+ };
41
+ exports.getConfigureDefaultAppsMenuItems = getConfigureDefaultAppsMenuItems;
20
42
  const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, excludeCodingAgentId, excludeEditorId, fileManagerDisabled, folder, location, onConfigureApps, onOpenInCodingAgent, onOpenInEditor, onOpenInFileExplorer, onOpenInGitClient, onOpenInTerminal, }) => {
21
43
  var _a, _b, _c, _d;
22
44
  const showFinder = window.remotion_fileSystemPlatform === 'darwin';
@@ -61,13 +83,7 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
61
83
  label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "GitHub.com" }),
62
84
  leftItem: jsx_runtime_1.jsx(github_1.GitHubIcon, { size: 18 }),
63
85
  onClick: () => {
64
- const gitSource = window.remotion_gitSource;
65
- if (!gitSource) {
66
- return;
67
- }
68
- window.open(folder || !location
69
- ? (0, get_git_menu_item_1.getGitSourceBranchUrl)(gitSource)
70
- : (0, get_git_menu_item_1.getGitRefUrl)(gitSource, location, window.remotion_cwd), '_blank');
86
+ (0, get_git_menu_item_1.openGitSource)({ folder, location });
71
87
  },
72
88
  quickSwitcherLabel: null,
73
89
  subMenu: null,
@@ -174,22 +190,10 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
174
190
  ...systemApps,
175
191
  ]
176
192
  : []),
177
- ...(onConfigureApps && (hasCategorizedApps || systemApps.length > 0)
178
- ? [{ type: 'divider', id: 'open-in-settings-divider' }]
179
- : []),
180
- onConfigureApps
181
- ? {
182
- id: 'change-default-apps',
183
- keyHint: null,
184
- label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Change default apps..." }),
185
- leftItem: null,
186
- onClick: onConfigureApps,
187
- quickSwitcherLabel: null,
188
- subMenu: null,
189
- type: 'item',
190
- value: 'change-default-apps',
191
- }
192
- : null,
193
+ ...(0, exports.getConfigureDefaultAppsMenuItems)({
194
+ hasPreviousItems: hasCategorizedApps || systemApps.length > 0,
195
+ onConfigureApps,
196
+ }),
193
197
  ].filter(no_react_1.NoReactInternals.truthy);
194
198
  };
195
199
  exports.getOpenInMenuItems = getOpenInMenuItems;
@@ -1,8 +1,11 @@
1
1
  import type { SetStateAction } from 'react';
2
+ import type { CompositionSortOrder } from '../state/folders';
2
3
  import type { ModalState } from '../state/modals';
3
4
  import type { ComboboxValue } from './NewComposition/ComboBox';
4
- export declare const getRootCompositionMenuItems: ({ connectionStatus, readOnlyStudio, setSelectedModal, }: {
5
+ export declare const getRootCompositionMenuItems: ({ connectionStatus, readOnlyStudio, setSelectedModal, compositionSortOrder, setCompositionSortOrder, }: {
5
6
  connectionStatus: "connected" | "disconnected" | "init";
6
7
  readOnlyStudio: boolean;
7
8
  setSelectedModal: (value: SetStateAction<ModalState | null>) => void;
9
+ compositionSortOrder: CompositionSortOrder;
10
+ setCompositionSortOrder: (sortOrder: CompositionSortOrder) => void;
8
11
  }) => ComboboxValue[];
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRootCompositionMenuItems = void 0;
4
- const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSelectedModal, }) => {
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Checkmark_1 = require("../icons/Checkmark");
6
+ const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSelectedModal, compositionSortOrder, setCompositionSortOrder, }) => {
5
7
  return [
6
8
  {
7
9
  id: 'new-root-composition',
@@ -41,6 +43,41 @@ const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSele
41
43
  value: 'new-root-folder',
42
44
  disabled: readOnlyStudio || connectionStatus !== 'connected',
43
45
  },
46
+ {
47
+ id: 'sort-compositions-divider',
48
+ type: 'divider',
49
+ },
50
+ {
51
+ id: 'sort-compositions-header',
52
+ label: 'Sort',
53
+ type: 'section-header',
54
+ },
55
+ {
56
+ id: 'sort-compositions-registration',
57
+ keyHint: null,
58
+ label: 'As registered',
59
+ leftItem: compositionSortOrder === 'registration' ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
60
+ onClick: () => {
61
+ setCompositionSortOrder('registration');
62
+ },
63
+ quickSwitcherLabel: 'Sort compositions as registered',
64
+ subMenu: null,
65
+ type: 'item',
66
+ value: 'registration',
67
+ },
68
+ {
69
+ id: 'sort-compositions-alphabetical',
70
+ keyHint: null,
71
+ label: 'Alphabetically',
72
+ leftItem: compositionSortOrder === 'alphabetical' ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
73
+ onClick: () => {
74
+ setCompositionSortOrder('alphabetical');
75
+ },
76
+ quickSwitcherLabel: 'Sort compositions alphabetically',
77
+ subMenu: null,
78
+ type: 'item',
79
+ value: 'alphabetical',
80
+ },
44
81
  ];
45
82
  };
46
83
  exports.getRootCompositionMenuItems = getRootCompositionMenuItems;
@@ -1,2 +1,21 @@
1
- export { clampCanvasOutlineValue as clamp, mixCanvasOutlinePoints as mixPoint, mixCanvasOutlineValues as mix, } from '@remotion/canvas';
2
- export type { CanvasOutline as SelectedOutline, CanvasOutlinePoint as OutlinePoint, } from '@remotion/canvas';
1
+ export type OutlinePoint = {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ };
5
+ export type SelectedOutline = {
6
+ readonly key: string;
7
+ readonly dimensions: {
8
+ readonly width: number;
9
+ readonly height: number;
10
+ } | null;
11
+ readonly uncroppedPoints: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint] | null;
12
+ readonly points: readonly [
13
+ OutlinePoint,
14
+ OutlinePoint,
15
+ OutlinePoint,
16
+ OutlinePoint
17
+ ];
18
+ };
19
+ export declare const clamp: (value: number, min: number, max: number) => number;
20
+ export declare const mix: (from: number, to: number, progress: number) => number;
21
+ export declare const mixPoint: (from: OutlinePoint, to: OutlinePoint, progress: number) => OutlinePoint;
@@ -1,7 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mix = exports.mixPoint = exports.clamp = void 0;
4
- const canvas_1 = require("@remotion/canvas");
5
- Object.defineProperty(exports, "clamp", { enumerable: true, get: function () { return canvas_1.clampCanvasOutlineValue; } });
6
- Object.defineProperty(exports, "mixPoint", { enumerable: true, get: function () { return canvas_1.mixCanvasOutlinePoints; } });
7
- Object.defineProperty(exports, "mix", { enumerable: true, get: function () { return canvas_1.mixCanvasOutlineValues; } });
3
+ exports.mixPoint = exports.mix = exports.clamp = void 0;
4
+ const clamp = (value, min, max) => {
5
+ return Math.min(max, Math.max(min, value));
6
+ };
7
+ exports.clamp = clamp;
8
+ const mix = (from, to, progress) => {
9
+ return from + (to - from) * progress;
10
+ };
11
+ exports.mix = mix;
12
+ const mixPoint = (from, to, progress) => {
13
+ return {
14
+ x: (0, exports.mix)(from.x, to.x, progress),
15
+ y: (0, exports.mix)(from.y, to.y, progress),
16
+ };
17
+ };
18
+ exports.mixPoint = mixPoint;
@@ -1,4 +1,6 @@
1
- import type { OutlinePoint } from './selected-outline-geometry';
1
+ import type { OverrideIdToNodePaths, TSequence } from 'remotion';
2
+ import type { OutlinePoint, SelectedOutline } from './selected-outline-geometry';
3
+ import type { SelectedOutlineLayoutTarget, SequenceWithSelectedOutline } from './selected-outline-types';
2
4
  export declare const pointToString: (point: OutlinePoint) => string;
3
5
  export declare const midpoint: (from: OutlinePoint, to: OutlinePoint) => OutlinePoint;
4
6
  export declare const getOutlineCenter: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint]) => OutlinePoint;
@@ -26,6 +28,24 @@ export declare const getSelectedOutlineRotationPivot: ({ dimensions, points, tra
26
28
  readonly points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
27
29
  readonly transformOriginValue: string;
28
30
  }) => OutlinePoint;
31
+ type SvgViewport = {
32
+ readonly x: number;
33
+ readonly y: number;
34
+ readonly width: number;
35
+ readonly height: number;
36
+ };
37
+ type SvgScreenCtm = Pick<DOMMatrixReadOnly, 'a' | 'b' | 'c' | 'd' | 'e' | 'f'>;
38
+ export declare const getTransformedSvgViewportPoints: ({ viewport, ctm, containerRect, }: {
39
+ readonly viewport: SvgViewport;
40
+ readonly ctm: SvgScreenCtm;
41
+ readonly containerRect: Pick<DOMRect, "left" | "top">;
42
+ }) => readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
43
+ export declare const cropOutlinePoints: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], crop: {
44
+ readonly left: number;
45
+ readonly right: number;
46
+ readonly top: number;
47
+ readonly bottom: number;
48
+ }) => readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
29
49
  export declare const getSelectedSequenceKeys: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => Set<string>;
30
50
  export declare const getSequenceKeysContainingSelection: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => Set<string>;
31
51
  export declare const getOutlineSelectionInteraction: ({ shiftKey, metaKey, ctrlKey, }: {
@@ -53,4 +73,23 @@ export type SelectedCropInfo = {
53
73
  export declare const getSelectedCropInfo: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => SelectedCropInfo | null;
54
74
  export declare const getSelectedTransformOriginInfo: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => SelectedTransformOriginInfo | null;
55
75
  export declare const getSelectedRotationInfo: (selectedItems: readonly import("@remotion/canvas").CanvasSelectionItem[]) => SelectedRotationInfo | null;
76
+ export declare const getSequencesWithSelectableOutlines: ({ sequences, overrideIdsToNodePaths, compositions, timelinePosition, }: {
77
+ readonly sequences: readonly TSequence[];
78
+ readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
79
+ readonly compositions?: readonly import("remotion").AnyComposition[] | undefined;
80
+ readonly timelinePosition: number;
81
+ }) => SequenceWithSelectedOutline[];
82
+ export declare const measureOutlines: (container: SVGSVGElement, targets: readonly SelectedOutlineLayoutTarget[], hoveredTimelineNodePathKey: string | null) => SelectedOutline[];
83
+ export declare const measureOutlineTargets: (container: Element, targets: readonly {
84
+ readonly crop: {
85
+ readonly left: number;
86
+ readonly right: number;
87
+ readonly top: number;
88
+ readonly bottom: number;
89
+ };
90
+ readonly includeOutsideContainer: boolean;
91
+ readonly key: string;
92
+ readonly ref: import("react").RefObject<Element | null>;
93
+ }[]) => SelectedOutline[];
94
+ export declare const outlinesAreEqual: (a: readonly SelectedOutline[], b: readonly SelectedOutline[]) => boolean;
56
95
  export {};