@remotion/studio 4.0.515 → 4.0.517

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 (277) hide show
  1. package/dist/api/restart-studio.js +4 -0
  2. package/dist/components/AssetSelector.js +4 -10
  3. package/dist/components/AssetSelectorItem.d.ts +2 -1
  4. package/dist/components/AssetSelectorItem.js +24 -29
  5. package/dist/components/Canvas.js +21 -15
  6. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  7. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  8. package/dist/components/CanvasOrLoading.js +4 -3
  9. package/dist/components/CaptionInspector.d.ts +2 -0
  10. package/dist/components/CaptionInspector.js +3 -5
  11. package/dist/components/CheckboardToggle.js +1 -1
  12. package/dist/components/Checkbox.d.ts +0 -1
  13. package/dist/components/Checkbox.js +2 -19
  14. package/dist/components/CompositionSelector.js +6 -3
  15. package/dist/components/CompositionSelectorItem.js +9 -10
  16. package/dist/components/ConfigSelect.d.ts +17 -0
  17. package/dist/components/ConfigSelect.js +50 -0
  18. package/dist/components/ConfigureLicenseModal.js +79 -46
  19. package/dist/components/CurrentAsset.d.ts +10 -2
  20. package/dist/components/CurrentAsset.js +143 -45
  21. package/dist/components/Editor.js +2 -1
  22. package/dist/components/EditorContent.js +5 -2
  23. package/dist/components/EditorContexts.js +2 -1
  24. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  25. package/dist/components/EditorRuler/Ruler.js +9 -8
  26. package/dist/components/EditorRuler/index.d.ts +1 -0
  27. package/dist/components/EditorRuler/index.js +3 -4
  28. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  29. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  30. package/dist/components/ElementLibraryModal.d.ts +5 -0
  31. package/dist/components/ElementLibraryModal.js +38 -0
  32. package/dist/components/FilePreview.js +71 -0
  33. package/dist/components/FixComputedValueModal.js +54 -51
  34. package/dist/components/GlobalKeybindings.js +5 -5
  35. package/dist/components/InlineAction.d.ts +1 -1
  36. package/dist/components/InlineAction.js +12 -2
  37. package/dist/components/InlineCaptionInspector.d.ts +2 -0
  38. package/dist/components/InlineCaptionInspector.js +2 -2
  39. package/dist/components/InlineCompositionName.js +1 -1
  40. package/dist/components/InlineEditableTitle.js +5 -4
  41. package/dist/components/InspectorInfoHeader.js +1 -1
  42. package/dist/components/InspectorOpenInEditor.js +48 -72
  43. package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
  44. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
  45. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
  46. package/dist/components/InspectorPanel/CompositionInspector.js +25 -45
  47. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  48. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  49. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  50. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  51. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  52. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
  53. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  54. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +14 -6
  55. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -7
  56. package/dist/components/InspectorPanel/common.d.ts +0 -13
  57. package/dist/components/InspectorPanel/common.js +6 -59
  58. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  59. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  60. package/dist/components/InspectorPanel/styles.js +3 -4
  61. package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
  62. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  63. package/dist/components/InspectorPanelLayout.d.ts +1 -1
  64. package/dist/components/InspectorPanelLayout.js +1 -1
  65. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  66. package/dist/components/InspectorSequenceSection.js +40 -54
  67. package/dist/components/InspectorSourceLocation.js +1 -1
  68. package/dist/components/InstallPackage.d.ts +2 -1
  69. package/dist/components/InstallPackage.js +60 -30
  70. package/dist/components/InstallablePackage.js +37 -11
  71. package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
  72. package/dist/components/KeyboardShortcutsSettings.js +177 -0
  73. package/dist/components/Menu/MenuItem.js +15 -6
  74. package/dist/components/MenuBuildIndicator.js +1 -1
  75. package/dist/components/MenuToolbar.js +7 -3
  76. package/dist/components/Modals.js +7 -5
  77. package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
  78. package/dist/components/NewComposition/CodemodFooter.js +2 -8
  79. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  80. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  81. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  82. package/dist/components/NewComposition/InputDragger.js +27 -4
  83. package/dist/components/NewComposition/NewComposition.js +1 -1
  84. package/dist/components/NewComposition/NewFolder.js +1 -3
  85. package/dist/components/NewComposition/RenameComposition.js +1 -1
  86. package/dist/components/NewComposition/RenameFolder.js +1 -1
  87. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  88. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  89. package/dist/components/Notifications/NotificationCenter.js +5 -0
  90. package/dist/components/OptionsPanel.js +9 -12
  91. package/dist/components/PlaybackRateSelector.js +1 -1
  92. package/dist/components/Preview.js +83 -5
  93. package/dist/components/PreviewToolbar.js +12 -3
  94. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  95. package/dist/components/PreviewToolbarOverflowButton.js +39 -2
  96. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
  97. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
  98. package/dist/components/RadioButton.d.ts +6 -0
  99. package/dist/components/RadioButton.js +62 -0
  100. package/dist/components/RenderButton.js +68 -184
  101. package/dist/components/RenderModal/DataEditor.js +15 -12
  102. package/dist/components/RenderModal/RenderStatusModal.js +0 -1
  103. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
  104. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
  105. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
  106. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
  107. package/dist/components/RenderingSettings.js +7 -4
  108. package/dist/components/RulersAndGuidesToggle.d.ts +4 -0
  109. package/dist/components/RulersAndGuidesToggle.js +34 -0
  110. package/dist/components/SegmentedButton.d.ts +29 -0
  111. package/dist/components/SegmentedButton.js +226 -0
  112. package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
  113. package/dist/components/SelectedOutlineEditingHandles.js +66 -0
  114. package/dist/components/SelectedOutlineElement.d.ts +2 -4
  115. package/dist/components/SelectedOutlineElement.js +15 -54
  116. package/dist/components/SelectedOutlineOverlay.js +32 -6
  117. package/dist/components/SelectedOutlinePolygon.d.ts +4 -6
  118. package/dist/components/SelectedOutlinePolygon.js +18 -16
  119. package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
  120. package/dist/components/SelectedOutlineRenderer.js +66 -14
  121. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  122. package/dist/components/SettingsModal.d.ts +1 -1
  123. package/dist/components/SettingsModal.js +30 -7
  124. package/dist/components/SettingsModalFooter.d.ts +3 -1
  125. package/dist/components/SettingsModalFooter.js +20 -4
  126. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  127. package/dist/components/ShowPixelGridProvider.js +24 -0
  128. package/dist/components/SidebarCollapserControls.js +2 -2
  129. package/dist/components/SkillsSettings.d.ts +2 -0
  130. package/dist/components/SkillsSettings.js +129 -0
  131. package/dist/components/StaticFilePreview.js +7 -1
  132. package/dist/components/StudioSettings.js +7 -48
  133. package/dist/components/Tabs/index.js +1 -1
  134. package/dist/components/Timeline/Timeline.js +41 -1
  135. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  136. package/dist/components/Timeline/TimelineAssetField.js +15 -9
  137. package/dist/components/Timeline/TimelineBooleanField.js +1 -4
  138. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  139. package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
  140. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  141. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  142. package/dist/components/Timeline/TimelineEffectItem.js +23 -10
  143. package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
  144. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  145. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  146. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
  147. package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
  148. package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
  149. package/dist/components/Timeline/TimelineImageInfo.js +13 -32
  150. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  151. package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
  152. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  153. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  154. package/dist/components/Timeline/TimelineRotationField.js +0 -2
  155. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
  156. package/dist/components/Timeline/TimelineRowChrome.js +3 -4
  157. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
  158. package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
  159. package/dist/components/Timeline/TimelineScaleField.js +2 -6
  160. package/dist/components/Timeline/TimelineSchemaField.js +9 -3
  161. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  162. package/dist/components/Timeline/TimelineSelection.js +31 -171
  163. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  164. package/dist/components/Timeline/TimelineSequence.js +110 -19
  165. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  166. package/dist/components/Timeline/TimelineSequenceItem.js +13 -11
  167. package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
  168. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +7 -6
  169. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
  170. package/dist/components/Timeline/TimelineTrack.js +1 -1
  171. package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
  172. package/dist/components/Timeline/TimelineTranslateField.js +0 -4
  173. package/dist/components/Timeline/TimelineVirtualization.js +3 -1
  174. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  175. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  176. package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
  177. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  178. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
  179. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
  180. package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
  181. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
  182. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
  183. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  184. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  185. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  186. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  187. package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
  188. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  189. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  190. package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
  191. package/dist/components/Timeline/timeline-field-utils.js +0 -2
  192. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  193. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  194. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  195. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -0
  196. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  197. package/dist/components/TimelineCombobox.js +25 -160
  198. package/dist/components/TimelineInOutToggle.js +4 -1
  199. package/dist/components/canvas-capture-drop.d.ts +4 -0
  200. package/dist/components/canvas-capture-drop.js +22 -0
  201. package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
  202. package/dist/components/duplicate-jsx-node-api.js +12 -0
  203. package/dist/components/effect-drag-and-drop.js +1 -4
  204. package/dist/components/handle-drop.d.ts +2 -1
  205. package/dist/components/handle-drop.js +3 -3
  206. package/dist/components/import-assets.js +9 -65
  207. package/dist/components/keyboard-shortcuts.d.ts +10 -0
  208. package/dist/components/keyboard-shortcuts.js +135 -0
  209. package/dist/components/selected-outline-control-layout.js +2 -6
  210. package/dist/components/selected-outline-measurement.d.ts +8 -9
  211. package/dist/components/selected-outline-measurement.js +16 -3
  212. package/dist/components/use-delete-asset.d.ts +1 -0
  213. package/dist/components/use-delete-asset.js +40 -0
  214. package/dist/components/use-selected-outline-control-target.d.ts +11 -0
  215. package/dist/components/use-selected-outline-control-target.js +79 -0
  216. package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
  217. package/dist/esm/{chunk-v5a8vpv4.js → chunk-gzqm3g2m.js} +47432 -40444
  218. package/dist/esm/index.mjs +3 -0
  219. package/dist/esm/internals.mjs +47431 -40443
  220. package/dist/esm/previewEntry.mjs +47169 -40181
  221. package/dist/esm/renderEntry.mjs +2 -2
  222. package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
  223. package/dist/helpers/add-asset-cache-bust.js +10 -0
  224. package/dist/helpers/calculate-timeline.d.ts +1 -7
  225. package/dist/helpers/calculate-timeline.js +2 -145
  226. package/dist/helpers/colors.d.ts +2 -0
  227. package/dist/helpers/colors.js +6 -2
  228. package/dist/helpers/drag-aware-double-click.d.ts +6 -0
  229. package/dist/helpers/drag-aware-double-click.js +20 -0
  230. package/dist/helpers/editor-ruler.js +6 -5
  231. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  232. package/dist/helpers/get-asset-metadata.js +75 -21
  233. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  234. package/dist/helpers/get-connected-compositions.js +2 -8
  235. package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
  236. package/dist/helpers/get-sequence-double-click-action.js +7 -1
  237. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  238. package/dist/helpers/get-sequence-visible-range.js +6 -51
  239. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  240. package/dist/helpers/get-timeline-nestedness.js +2 -12
  241. package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
  242. package/dist/helpers/get-timeline-sequence-layout.js +15 -6
  243. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -21
  244. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  245. package/dist/helpers/hoverable.d.ts +1 -0
  246. package/dist/helpers/hoverable.js +2 -1
  247. package/dist/helpers/inject-css.js +3 -1
  248. package/dist/helpers/is-current-selected-still.js +4 -2
  249. package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
  250. package/dist/helpers/open-in-remotion-convert.js +18 -0
  251. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  252. package/dist/helpers/sort-by-nonce-history.js +3 -148
  253. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  254. package/dist/helpers/timeline-node-path-key.js +2 -2
  255. package/dist/helpers/use-media-metadata.d.ts +2 -1
  256. package/dist/helpers/use-media-metadata.js +12 -5
  257. package/dist/helpers/use-menu-structure.js +52 -32
  258. package/dist/icons/align-center-horizontal.js +1 -1
  259. package/dist/icons/align-left.js +1 -1
  260. package/dist/icons/align-right.js +1 -1
  261. package/dist/icons/keyboard.d.ts +4 -0
  262. package/dist/icons/keyboard.js +10 -0
  263. package/dist/icons/license.d.ts +4 -0
  264. package/dist/icons/license.js +8 -0
  265. package/dist/icons/package.d.ts +4 -0
  266. package/dist/icons/package.js +8 -0
  267. package/dist/icons/react.js +1 -1
  268. package/dist/icons/remotion-convert.d.ts +4 -0
  269. package/dist/icons/remotion-convert.js +10 -0
  270. package/dist/icons/skills.d.ts +4 -0
  271. package/dist/icons/skills.js +10 -0
  272. package/dist/state/editor-pixel-grid.d.ts +8 -0
  273. package/dist/state/editor-pixel-grid.js +18 -0
  274. package/dist/state/modals.d.ts +6 -5
  275. package/package.json +14 -12
  276. package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
  277. package/dist/components/KeyboardShortcutsExplainer.js +0 -194
@@ -4,7 +4,7 @@ import {
4
4
  WHITE,
5
5
  __require,
6
6
  __toESM
7
- } from "./chunk-s6k99gh2.js";
7
+ } from "./chunk-4bxz1d3g.js";
8
8
 
9
9
  // src/renderEntry.tsx
10
10
  import { useContext, useEffect, useRef, useState } from "react";
@@ -213,7 +213,7 @@ var renderContent = (Root) => {
213
213
  renderToDOM(/* @__PURE__ */ jsx("div", {
214
214
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
215
215
  }));
216
- import("./chunk-v5a8vpv4.js").then(({ StudioInternals }) => {
216
+ import("./chunk-gzqm3g2m.js").then(({ StudioInternals }) => {
217
217
  window.remotion_isStudio = true;
218
218
  window.remotion_isReadOnlyStudio = true;
219
219
  window.remotion_inputProps = "{}";
@@ -0,0 +1,4 @@
1
+ export declare const addAssetCacheBust: ({ fetchedAt, src, }: {
2
+ fetchedAt: number;
3
+ src: string;
4
+ }) => string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addAssetCacheBust = void 0;
4
+ const addAssetCacheBust = ({ fetchedAt, src, }) => {
5
+ if (src.startsWith('blob:')) {
6
+ return src;
7
+ }
8
+ return `${src}${src.includes('?') ? '&' : '?'}date=${fetchedAt}`;
9
+ };
10
+ exports.addAssetCacheBust = addAssetCacheBust;
@@ -1,7 +1 @@
1
- import type { OverrideIdToNodePaths, TSequence } from 'remotion';
2
- import type { TimelineTrackData } from './get-timeline-sequence-sort-key';
3
- export declare const calculateTimeline: ({ sequences, overrideIdsToNodePaths, compositions, }: {
4
- sequences: TSequence[];
5
- overrideIdsToNodePaths: OverrideIdToNodePaths;
6
- compositions?: readonly import("remotion").AnyComposition[] | undefined;
7
- }) => TimelineTrackData[];
1
+ export { calculateTimeline } from '@remotion/canvas';
@@ -1,148 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.calculateTimeline = void 0;
4
- const get_connected_compositions_1 = require("./get-connected-compositions");
5
- const get_sequence_visible_range_1 = require("./get-sequence-visible-range");
6
- const get_timeline_nestedness_1 = require("./get-timeline-nestedness");
7
- const get_timeline_sequence_sort_key_1 = require("./get-timeline-sequence-sort-key");
8
- const sort_by_nonce_history_1 = require("./sort-by-nonce-history");
9
- const timeline_node_path_key_1 = require("./timeline-node-path-key");
10
- const getInheritedLoopDisplay = (sequence, sequences) => {
11
- if (sequence.loopDisplay) {
12
- return sequence.loopDisplay;
13
- }
14
- if (!sequence.parent) {
15
- return undefined;
16
- }
17
- const parent = sequences.find((s) => s.id === sequence.parent);
18
- if (!parent) {
19
- return undefined;
20
- }
21
- return getInheritedLoopDisplay(parent, sequences);
22
- };
23
- const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [], }) => {
24
- var _a, _b;
25
- var _c, _d;
26
- const sortedSequences = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences);
27
- const tracks = [];
28
- if (sortedSequences.length === 0) {
29
- return [];
30
- }
31
- const connectedCompositionsBySequenceId = new Map();
32
- for (const sequence of sortedSequences) {
33
- const connectedCompositions = (0, get_connected_compositions_1.getConnectedCompositions)({
34
- compositions,
35
- singleChildComponent: sequence.singleChildComponent,
36
- });
37
- if (connectedCompositions.length > 0) {
38
- connectedCompositionsBySequenceId.set(sequence.id, connectedCompositions);
39
- }
40
- }
41
- const sequencesById = new Map(sortedSequences.map((sequence) => [sequence.id, sequence]));
42
- const timelineSequences = sortedSequences.filter((sequence) => {
43
- var _a;
44
- var _b;
45
- let parentId = sequence.parent;
46
- while (parentId !== null) {
47
- if (connectedCompositionsBySequenceId.has(parentId)) {
48
- return false;
49
- }
50
- parentId = (_b = (_a = sequencesById.get(parentId)) === null || _a === void 0 ? void 0 : _a.parent) !== null && _b !== void 0 ? _b : null;
51
- }
52
- return true;
53
- });
54
- for (let i = 0; i < timelineSequences.length; i++) {
55
- const sequence = timelineSequences[i];
56
- const cascadedStart = (0, get_sequence_visible_range_1.getCascadedStart)(sequence, sortedSequences);
57
- const cascadedStartWithTrim = (0, get_sequence_visible_range_1.getCascadedStartWithTrim)(sequence, sortedSequences);
58
- const effectiveFrom = sequence.trimBefore === null
59
- ? sequence.from
60
- : sequence.from - sequence.trimBefore;
61
- const visibleStart = (0, get_sequence_visible_range_1.getTimelineVisibleStart)(sequence, sortedSequences);
62
- const visibleDuration = (0, get_sequence_visible_range_1.getTimelineVisibleDuration)(sequence, sortedSequences);
63
- const overrideId = (_c = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId) !== null && _c !== void 0 ? _c : null;
64
- const nodePath = overrideId ? overrideIdsToNodePaths[overrideId] : null;
65
- const hasKeyframeRows = sequence.controls !== null || sequence.effects.length > 0;
66
- const connectedCompositions = (_d = connectedCompositionsBySequenceId.get(sequence.id)) !== null && _d !== void 0 ? _d : [];
67
- tracks.push({
68
- ...(connectedCompositions.length > 0 ? { connectedCompositions } : {}),
69
- sequence: {
70
- ...sequence,
71
- from: visibleStart,
72
- duration: visibleDuration,
73
- loopDisplay: sequence.type === 'audio' || sequence.type === 'video'
74
- ? getInheritedLoopDisplay(sequence, sortedSequences)
75
- : sequence.loopDisplay,
76
- },
77
- depth: (0, get_timeline_nestedness_1.getTimelineNestedLevel)(sequence, sortedSequences, 0),
78
- cascadedStart,
79
- cascadedDuration: sequence.duration,
80
- keyframeDisplayOffset: hasKeyframeRows
81
- ? cascadedStartWithTrim - effectiveFrom
82
- : 0,
83
- sequenceFrameOffset: visibleStart - cascadedStartWithTrim,
84
- nodePathInfo: nodePath
85
- ? {
86
- sequenceSubscriptionKey: nodePath,
87
- auxiliaryKeys: [],
88
- index: 0,
89
- numberOfSequencesWithThisNodePath: 0,
90
- supportsEffects: ((_b = sequence.controls) === null || _b === void 0 ? void 0 : _b.supportsEffects) === true,
91
- }
92
- : null,
93
- });
94
- }
95
- const nonceRanks = new Map();
96
- for (let i = 0; i < tracks.length; i++) {
97
- nonceRanks.set(tracks[i].sequence.id, i);
98
- }
99
- const sortedTracks = tracks
100
- .sort((a, b) => {
101
- const sortKeyA = (0, get_timeline_sequence_sort_key_1.getTimelineSequenceSortKey)(a, tracks, nonceRanks);
102
- const sortKeyB = (0, get_timeline_sequence_sort_key_1.getTimelineSequenceSortKey)(b, tracks, nonceRanks);
103
- return sortKeyA.localeCompare(sortKeyB);
104
- })
105
- .map((track) => {
106
- const { cascadedDuration, cascadedStart, ...cleanTrack } = track;
107
- return cleanTrack;
108
- });
109
- const nodePathIndexCounters = new Map();
110
- return sortedTracks
111
- .map((track) => {
112
- var _a;
113
- if (track.nodePathInfo === null) {
114
- return track;
115
- }
116
- const key = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey);
117
- const index = (_a = nodePathIndexCounters.get(key)) !== null && _a !== void 0 ? _a : 0;
118
- nodePathIndexCounters.set(key, index + 1);
119
- return {
120
- ...track,
121
- nodePathInfo: {
122
- sequenceSubscriptionKey: track.nodePathInfo.sequenceSubscriptionKey,
123
- auxiliaryKeys: track.nodePathInfo.auxiliaryKeys,
124
- index,
125
- numberOfSequencesWithThisNodePath: 0,
126
- supportsEffects: track.nodePathInfo.supportsEffects,
127
- },
128
- };
129
- })
130
- .map((track) => {
131
- var _a;
132
- if (track.nodePathInfo === null) {
133
- return track;
134
- }
135
- const key = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey);
136
- return {
137
- ...track,
138
- nodePathInfo: {
139
- sequenceSubscriptionKey: track.nodePathInfo.sequenceSubscriptionKey,
140
- auxiliaryKeys: track.nodePathInfo.auxiliaryKeys,
141
- index: track.nodePathInfo.index,
142
- numberOfSequencesWithThisNodePath: (_a = nodePathIndexCounters.get(key)) !== null && _a !== void 0 ? _a : 0,
143
- supportsEffects: track.nodePathInfo.supportsEffects,
144
- },
145
- };
146
- });
147
- };
148
- exports.calculateTimeline = calculateTimeline;
4
+ const canvas_1 = require("@remotion/canvas");
5
+ Object.defineProperty(exports, "calculateTimeline", { enumerable: true, get: function () { return canvas_1.calculateTimeline; } });
@@ -63,6 +63,8 @@ export declare const INFO_BLUE = "#60a5fa";
63
63
  export declare const SERVER_DISCONNECTED_BACKGROUND = "#e74c3c";
64
64
  export declare const STACK_FRAME_BORDER_BLUE = "rgb(66, 144, 245)";
65
65
  export declare const TIMELINE_BACKGROUND_COLOR = "#15181B";
66
+ export declare const TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = "#2C2F32";
67
+ export declare const TIMELINE_NEGATIVE_START_BORDER_COLOR = "#414446";
66
68
  export declare const TIMELINE_SELECTED_BACKGROUND_COLOR = "#3B3F42";
67
69
  export declare const TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = "#B0B0B0";
68
70
  export declare const TIMELINE_BLUE = "#0b84ff";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BLUE_DISABLED = exports.BLUE_HOVERED = exports.BLUE = exports.WARNING_COLOR = exports.FAIL_COLOR = exports.BLACK_OPAQUE = exports.BLACK_ALPHA_90 = exports.BLACK_ALPHA_85 = exports.BLACK_ALPHA_80 = exports.BLACK_ALPHA_60 = exports.BLACK_ALPHA_50 = exports.BLACK_ALPHA_40 = exports.BLACK_ALPHA_30 = exports.BLACK_ALPHA_28 = exports.BLACK_ALPHA_10 = exports.WHITE_ALPHA_80 = exports.WHITE_ALPHA_72 = exports.WHITE_ALPHA_70 = exports.WHITE_ALPHA_60 = exports.WHITE_ALPHA_50 = exports.WHITE_ALPHA_45 = exports.WHITE_ALPHA_40 = exports.WHITE_ALPHA_35 = exports.WHITE_ALPHA_30 = exports.WHITE_ALPHA_25 = exports.WHITE_ALPHA_20 = exports.WHITE_ALPHA_15 = exports.WHITE_ALPHA_12 = exports.WHITE_ALPHA_10 = exports.WHITE_ALPHA_08 = exports.WHITE_ALPHA_06 = exports.WHITE_ALPHA_05 = exports.RULER_COLOR = exports.LIGHT_TEXT = exports.SELECTED_BACKGROUND = exports.LIGHT_COLOR = exports.INPUT_BACKGROUND = exports.BACKGROUND__TRANSPARENT = exports.BACKGROUND_HEX = exports.BACKGROUND = exports.BLACK_FULL_HEX = exports.BLACK_HEX = exports.WHITE_FULL_HEX = exports.WHITE_HEX = exports.CURRENT_COLOR_LOWERCASE = exports.CURRENT_COLOR = exports.TRANSPARENT = exports.RED = exports.WHITE = exports.BLACK = void 0;
4
- exports.FOCUS_BOX_SHADOW = exports.HOT_MIDDLEWARE_WARNING_STYLE = exports.HOT_MIDDLEWARE_ERROR_STYLE = exports.NOTIFICATION_BORDER = exports.COLOR_PICKER_HANDLE_SHADOW = exports.COLOR_PICKER_POPUP_SHADOW = exports.SERVER_DISCONNECTED_SHADOW = exports.NOTIFICATION_SHADOW = exports.SHADOW_BLACK_ALPHA_50_TOWARDS_TOP = exports.SHADOW_BLACK_ALPHA_50_TOWARDS_BOTTOM = exports.SHADOW_BLACK = exports.BORDER_TIMELINE_MARQUEE_BLUE = exports.BORDER_TIMELINE_DROP_BLUE = exports.BORDER_STACK_FRAME_BLUE = exports.BORDER_INFO_BLUE = exports.BORDER_WHITE_ALPHA_20 = exports.BORDER_WHITE_ALPHA_12 = exports.BORDER_BLACK_ALPHA_60 = exports.BORDER_BLACK_ALPHA_50 = exports.BORDER_TRANSPARENT_2PX = exports.BORDER_CURRENT_COLOR = exports.BORDER_WHITE_2PX = exports.BORDER_WHITE = exports.BORDER_BLACK = exports.INFO_BLUE_BACKGROUND = exports.EASING_SELECTED_BACKGROUND = exports.TIMELINE_MARQUEE_BLUE_ALPHA_75 = exports.TIMELINE_MARQUEE_BLUE_ALPHA_16 = exports.TIMELINE_DROP_BLUE_ALPHA_75 = exports.TIMELINE_DROP_BLUE_ALPHA_16 = exports.TIMELINE_DROP_BLUE_ALPHA_12 = exports.TIMELINE_PLAYHEAD_COLOR = exports.TIMELINE_BLUE = exports.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = exports.TIMELINE_SELECTED_BACKGROUND_COLOR = exports.TIMELINE_BACKGROUND_COLOR = exports.STACK_FRAME_BORDER_BLUE = exports.SERVER_DISCONNECTED_BACKGROUND = exports.INFO_BLUE = exports.ERROR_LINK_COLOR = exports.ERROR_CODE_FRAME_LINE_BACKGROUND = exports.ERROR_CODE_FRAME_BACKGROUND = exports.RENDER_STATUS_BACKGROUND = exports.NOTIFICATION_BACKGROUND = exports.KEYBOARD_SHORTCUT_KEY_COLOR = exports.LIGHT_GRAY = exports.TIMELINE_TRACK_SEPARATOR = exports.LINE_COLOR = exports.SELECTED_GUIDE = exports.UNSELECTED_GUIDE = void 0;
5
- exports.getBackgroundFromHoverState = exports.TIMELINE_IMAGE_GRADIENT = exports.TIMELINE_VIDEO_GRADIENT = exports.TIMELINE_AUDIO_GRADIENT = exports.LOOPED_INDICATOR_DROP_SHADOW = exports.SELECTED_OUTLINE_UV_DROP_SHADOW = exports.SELECTED_OUTLINE_DROP_SHADOW = exports.ERROR_MESSAGE_MASK_IMAGE = exports.COLOR_PICKER_HUE_GRADIENT = exports.COLOR_PICKER_ALPHA_TRANSPARENT = exports.COLOR_PICKER_SATURATION_BLACK_GRADIENT = exports.COLOR_PICKER_SATURATION_VALUE_GRADIENT = exports.COLOR_PICKER_CHECKER_BACKGROUND_COLOR = exports.COLOR_PICKER_CHECKER_BACKGROUND_IMAGE = exports.CHECKERBOARD_BACKGROUND_IMAGE = void 0;
4
+ exports.HOT_MIDDLEWARE_ERROR_STYLE = exports.NOTIFICATION_BORDER = exports.COLOR_PICKER_HANDLE_SHADOW = exports.COLOR_PICKER_POPUP_SHADOW = exports.SERVER_DISCONNECTED_SHADOW = exports.NOTIFICATION_SHADOW = exports.SHADOW_BLACK_ALPHA_50_TOWARDS_TOP = exports.SHADOW_BLACK_ALPHA_50_TOWARDS_BOTTOM = exports.SHADOW_BLACK = exports.BORDER_TIMELINE_MARQUEE_BLUE = exports.BORDER_TIMELINE_DROP_BLUE = exports.BORDER_STACK_FRAME_BLUE = exports.BORDER_INFO_BLUE = exports.BORDER_WHITE_ALPHA_20 = exports.BORDER_WHITE_ALPHA_12 = exports.BORDER_BLACK_ALPHA_60 = exports.BORDER_BLACK_ALPHA_50 = exports.BORDER_TRANSPARENT_2PX = exports.BORDER_CURRENT_COLOR = exports.BORDER_WHITE_2PX = exports.BORDER_WHITE = exports.BORDER_BLACK = exports.INFO_BLUE_BACKGROUND = exports.EASING_SELECTED_BACKGROUND = exports.TIMELINE_MARQUEE_BLUE_ALPHA_75 = exports.TIMELINE_MARQUEE_BLUE_ALPHA_16 = exports.TIMELINE_DROP_BLUE_ALPHA_75 = exports.TIMELINE_DROP_BLUE_ALPHA_16 = exports.TIMELINE_DROP_BLUE_ALPHA_12 = exports.TIMELINE_PLAYHEAD_COLOR = exports.TIMELINE_BLUE = exports.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = exports.TIMELINE_SELECTED_BACKGROUND_COLOR = exports.TIMELINE_NEGATIVE_START_BORDER_COLOR = exports.TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = exports.TIMELINE_BACKGROUND_COLOR = exports.STACK_FRAME_BORDER_BLUE = exports.SERVER_DISCONNECTED_BACKGROUND = exports.INFO_BLUE = exports.ERROR_LINK_COLOR = exports.ERROR_CODE_FRAME_LINE_BACKGROUND = exports.ERROR_CODE_FRAME_BACKGROUND = exports.RENDER_STATUS_BACKGROUND = exports.NOTIFICATION_BACKGROUND = exports.KEYBOARD_SHORTCUT_KEY_COLOR = exports.LIGHT_GRAY = exports.TIMELINE_TRACK_SEPARATOR = exports.LINE_COLOR = exports.SELECTED_GUIDE = exports.UNSELECTED_GUIDE = void 0;
5
+ exports.getBackgroundFromHoverState = exports.TIMELINE_IMAGE_GRADIENT = exports.TIMELINE_VIDEO_GRADIENT = exports.TIMELINE_AUDIO_GRADIENT = exports.LOOPED_INDICATOR_DROP_SHADOW = exports.SELECTED_OUTLINE_UV_DROP_SHADOW = exports.SELECTED_OUTLINE_DROP_SHADOW = exports.ERROR_MESSAGE_MASK_IMAGE = exports.COLOR_PICKER_HUE_GRADIENT = exports.COLOR_PICKER_ALPHA_TRANSPARENT = exports.COLOR_PICKER_SATURATION_BLACK_GRADIENT = exports.COLOR_PICKER_SATURATION_VALUE_GRADIENT = exports.COLOR_PICKER_CHECKER_BACKGROUND_COLOR = exports.COLOR_PICKER_CHECKER_BACKGROUND_IMAGE = exports.CHECKERBOARD_BACKGROUND_IMAGE = exports.FOCUS_BOX_SHADOW = exports.HOT_MIDDLEWARE_WARNING_STYLE = void 0;
6
6
  exports.BLACK = 'black';
7
7
  exports.WHITE = 'white';
8
8
  exports.RED = 'red';
@@ -69,6 +69,10 @@ exports.INFO_BLUE = '#60a5fa';
69
69
  exports.SERVER_DISCONNECTED_BACKGROUND = '#e74c3c';
70
70
  exports.STACK_FRAME_BORDER_BLUE = 'rgb(66, 144, 245)';
71
71
  exports.TIMELINE_BACKGROUND_COLOR = '#15181B';
72
+ // WHITE_ALPHA_10 composited over TIMELINE_BACKGROUND_COLOR.
73
+ exports.TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = '#2C2F32';
74
+ // WHITE_ALPHA_10 composited over TIMELINE_NEGATIVE_START_BACKGROUND_COLOR.
75
+ exports.TIMELINE_NEGATIVE_START_BORDER_COLOR = '#414446';
72
76
  exports.TIMELINE_SELECTED_BACKGROUND_COLOR = '#3B3F42';
73
77
  exports.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = '#B0B0B0';
74
78
  exports.TIMELINE_BLUE = '#0b84ff';
@@ -0,0 +1,6 @@
1
+ export type DragAwareDoubleClickTracker = {
2
+ readonly beginPointerGesture: () => void;
3
+ readonly endPointerGesture: (wasDragged: boolean) => void;
4
+ readonly consumePointerGestureWasDragged: () => boolean;
5
+ };
6
+ export declare const createDragAwareDoubleClickTracker: () => DragAwareDoubleClickTracker;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDragAwareDoubleClickTracker = void 0;
4
+ const createDragAwareDoubleClickTracker = () => {
5
+ let pointerGestureWasDragged = false;
6
+ return {
7
+ beginPointerGesture: () => {
8
+ pointerGestureWasDragged = false;
9
+ },
10
+ endPointerGesture: (wasDragged) => {
11
+ pointerGestureWasDragged = wasDragged;
12
+ },
13
+ consumePointerGestureWasDragged: () => {
14
+ const wasDragged = pointerGestureWasDragged;
15
+ pointerGestureWasDragged = false;
16
+ return wasDragged;
17
+ },
18
+ };
19
+ };
20
+ exports.createDragAwareDoubleClickTracker = createDragAwareDoubleClickTracker;
@@ -36,7 +36,8 @@ const drawGuide = ({ guideHighlight, scale, startMarking, context, canvasHeight,
36
36
  scale,
37
37
  }) +
38
38
  originOffset -
39
- startMarking * scale;
39
+ startMarking * scale +
40
+ 0.5;
40
41
  drawGradient({
41
42
  canvasHeight,
42
43
  context,
@@ -88,11 +89,11 @@ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, m
88
89
  canvas.height = canvasHeight;
89
90
  context.scale(window.devicePixelRatio, window.devicePixelRatio);
90
91
  context.clearRect(0, 0, canvasWidth, canvasHeight);
91
- context.strokeStyle = colors_1.RULER_COLOR;
92
+ context.strokeStyle = colors_1.WHITE_ALPHA_15;
92
93
  context.lineWidth = 1;
93
94
  context.beginPath();
94
95
  points.forEach((point) => {
95
- context.strokeStyle = colors_1.RULER_COLOR;
96
+ context.strokeStyle = colors_1.WHITE_ALPHA_15;
96
97
  context.lineWidth = 1;
97
98
  const originDistance = point.position + originOffset - startMarking * scale;
98
99
  context.beginPath();
@@ -118,13 +119,13 @@ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, m
118
119
  context.stroke();
119
120
  context.font = '10px Arial, Helvetica, sans-serif';
120
121
  context.textAlign = 'left';
121
- context.fillStyle = colors_1.RULER_COLOR;
122
+ context.fillStyle = colors_1.LIGHT_TEXT;
122
123
  drawLabel({
123
124
  orientation,
124
125
  context,
125
126
  label: point.value.toString(),
126
127
  originDistance,
127
- color: colors_1.RULER_COLOR,
128
+ color: colors_1.LIGHT_TEXT,
128
129
  });
129
130
  });
130
131
  if (guideHighlight && orientation !== guideHighlight.guide.orientation) {
@@ -1,5 +1,6 @@
1
1
  import type { CanvasContent } from 'remotion';
2
2
  import type { Dimensions } from './is-current-selected-still';
3
+ import { type MediaMetadata } from './use-media-metadata';
3
4
  export declare const remotion_outputsBase: string;
4
5
  export type AssetMetadata = {
5
6
  type: 'not-found';
@@ -11,5 +12,23 @@ export type AssetMetadata = {
11
12
  size: number;
12
13
  dimensions: Dimensions | 'none' | null;
13
14
  fetchedAt: number;
15
+ mediaMetadata: MediaMetadata | null;
14
16
  };
17
+ export declare const getAssetPreviewMetadata: ({ canvasContent, metadata, }: {
18
+ canvasContent: CanvasContent;
19
+ metadata: AssetMetadata;
20
+ }) => {
21
+ asset: string;
22
+ width: number;
23
+ height: number;
24
+ fps: number;
25
+ durationInFrames: number;
26
+ props: {};
27
+ defaultCodec: null;
28
+ defaultOutName: null;
29
+ defaultVideoImageFormat: null;
30
+ defaultPixelFormat: null;
31
+ defaultProResProfile: null;
32
+ defaultSampleRate: number | null;
33
+ } | null;
15
34
  export declare const getAssetMetadata: (canvasContent: CanvasContent, addTime: boolean) => Promise<AssetMetadata>;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAssetMetadata = exports.remotion_outputsBase = void 0;
4
- const media_utils_1 = require("@remotion/media-utils");
3
+ exports.getAssetMetadata = exports.getAssetPreviewMetadata = exports.remotion_outputsBase = void 0;
5
4
  const remotion_1 = require("remotion");
5
+ const add_asset_cache_bust_1 = require("./add-asset-cache-bust");
6
6
  const get_preview_file_type_1 = require("./get-preview-file-type");
7
+ const use_media_metadata_1 = require("./use-media-metadata");
7
8
  exports.remotion_outputsBase = window.remotion_staticBase.replace('static', 'outputs');
8
9
  const getSrcFromCanvasContent = (canvasContent) => {
9
10
  if (canvasContent.type === 'asset') {
@@ -11,13 +12,51 @@ const getSrcFromCanvasContent = (canvasContent) => {
11
12
  }
12
13
  return exports.remotion_outputsBase + canvasContent.path;
13
14
  };
15
+ const getAssetPreviewMetadata = ({ canvasContent, metadata, }) => {
16
+ if (canvasContent.type !== 'asset' ||
17
+ metadata.type !== 'found' ||
18
+ metadata.mediaMetadata === null ||
19
+ !Number.isFinite(metadata.mediaMetadata.duration) ||
20
+ metadata.mediaMetadata.duration <= 0) {
21
+ return null;
22
+ }
23
+ const fileType = (0, get_preview_file_type_1.getPreviewFileType)(canvasContent.asset);
24
+ if (fileType !== 'audio' && fileType !== 'video') {
25
+ return null;
26
+ }
27
+ const { dimensions } = metadata;
28
+ if (dimensions === null || dimensions === 'none') {
29
+ return null;
30
+ }
31
+ const detectedFps = metadata.mediaMetadata.fps;
32
+ const fps = detectedFps !== null && Number.isFinite(detectedFps) && detectedFps > 0
33
+ ? detectedFps
34
+ : 30;
35
+ return {
36
+ asset: canvasContent.asset,
37
+ width: dimensions.width,
38
+ height: dimensions.height,
39
+ fps,
40
+ durationInFrames: Math.max(1, Math.ceil(metadata.mediaMetadata.duration * fps)),
41
+ props: {},
42
+ defaultCodec: null,
43
+ defaultOutName: null,
44
+ defaultVideoImageFormat: null,
45
+ defaultPixelFormat: null,
46
+ defaultProResProfile: null,
47
+ defaultSampleRate: metadata.mediaMetadata.sampleRate,
48
+ };
49
+ };
50
+ exports.getAssetPreviewMetadata = getAssetPreviewMetadata;
14
51
  const getAssetMetadata = async (canvasContent, addTime) => {
52
+ var _a, _b, _c;
15
53
  if (canvasContent.type === 'output-blob') {
16
54
  return {
17
55
  type: 'found',
18
56
  size: canvasContent.sizeInBytes,
19
57
  dimensions: { width: canvasContent.width, height: canvasContent.height },
20
58
  fetchedAt: Date.now(),
59
+ mediaMetadata: null,
21
60
  };
22
61
  }
23
62
  if (canvasContent.type === 'composition') {
@@ -25,29 +64,42 @@ const getAssetMetadata = async (canvasContent, addTime) => {
25
64
  }
26
65
  try {
27
66
  const src = getSrcFromCanvasContent(canvasContent);
28
- const file = await fetch(src, {
29
- method: 'HEAD',
30
- });
31
- if (file.status === 404) {
32
- return { type: 'not-found' };
33
- }
34
- if (file.status !== 200) {
35
- throw new Error(`Expected status code 200 or 404 for file, got ${file.status}`);
36
- }
37
- const size = file.headers.get('content-length');
38
- if (!size) {
39
- throw new Error('Unexpected error: content-length is null');
67
+ const listedStaticFile = canvasContent.type === 'asset'
68
+ ? window.remotion_staticFiles.find((file) => file.name === canvasContent.asset && file.src === src)
69
+ : null;
70
+ let size = (_a = listedStaticFile === null || listedStaticFile === void 0 ? void 0 : listedStaticFile.sizeInBytes) !== null && _a !== void 0 ? _a : null;
71
+ if (size === null) {
72
+ const file = await fetch(src, {
73
+ method: 'HEAD',
74
+ });
75
+ if (file.status === 404) {
76
+ return { type: 'not-found' };
77
+ }
78
+ if (file.status !== 200) {
79
+ throw new Error(`Expected status code 200 or 404 for file, got ${file.status}`);
80
+ }
81
+ const contentLength = file.headers.get('content-length');
82
+ if (!contentLength) {
83
+ throw new Error('Unexpected error: content-length is null');
84
+ }
85
+ size = Number(contentLength);
40
86
  }
41
87
  const fetchedAt = Date.now();
42
- const srcWithTime = addTime ? `${src}?date=${fetchedAt}` : src;
88
+ const srcWithTime = addTime ? (0, add_asset_cache_bust_1.addAssetCacheBust)({ fetchedAt, src }) : src;
43
89
  const fileType = (0, get_preview_file_type_1.getPreviewFileType)(src);
44
- if (fileType === 'video') {
45
- const resolution = await (0, media_utils_1.getVideoMetadata)(srcWithTime);
90
+ if (fileType === 'video' || fileType === 'audio') {
91
+ const mediaMetadata = await (0, use_media_metadata_1.getMediaMetadata)(srcWithTime);
92
+ if (mediaMetadata === null) {
93
+ throw new Error(`Could not read media metadata for ${src}`);
94
+ }
95
+ const width = (_b = mediaMetadata.width) !== null && _b !== void 0 ? _b : 1920;
96
+ const height = (_c = mediaMetadata.height) !== null && _c !== void 0 ? _c : 1080;
46
97
  return {
47
98
  type: 'found',
48
- size: Number(size),
49
- dimensions: { width: resolution.width, height: resolution.height },
99
+ size,
100
+ dimensions: { width, height },
50
101
  fetchedAt,
102
+ mediaMetadata,
51
103
  };
52
104
  }
53
105
  if (fileType === 'image') {
@@ -56,9 +108,10 @@ const getAssetMetadata = async (canvasContent, addTime) => {
56
108
  img.onload = () => {
57
109
  resolve({
58
110
  type: 'found',
59
- size: Number(size),
111
+ size,
60
112
  dimensions: { width: img.width, height: img.height },
61
113
  fetchedAt,
114
+ mediaMetadata: null,
62
115
  });
63
116
  };
64
117
  img.onerror = () => {
@@ -71,8 +124,9 @@ const getAssetMetadata = async (canvasContent, addTime) => {
71
124
  return {
72
125
  type: 'found',
73
126
  dimensions: 'none',
74
- size: Number(size),
127
+ size,
75
128
  fetchedAt,
129
+ mediaMetadata: null,
76
130
  };
77
131
  }
78
132
  catch (err) {
@@ -1,6 +1 @@
1
- export declare const getConnectedCompositions: <Composition extends {
2
- readonly componentFromProps?: unknown;
3
- }>({ compositions, singleChildComponent, }: {
4
- readonly compositions: readonly Composition[];
5
- readonly singleChildComponent: unknown;
6
- }) => Composition[];
1
+ export { getConnectedCompositions } from '@remotion/canvas';
@@ -1,11 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getConnectedCompositions = void 0;
4
- const getConnectedCompositions = ({ compositions, singleChildComponent, }) => {
5
- if (singleChildComponent === null ||
6
- typeof singleChildComponent === 'undefined') {
7
- return [];
8
- }
9
- return compositions.filter((composition) => composition.componentFromProps === singleChildComponent);
10
- };
11
- exports.getConnectedCompositions = getConnectedCompositions;
4
+ const canvas_1 = require("@remotion/canvas");
5
+ Object.defineProperty(exports, "getConnectedCompositions", { enumerable: true, get: function () { return canvas_1.getConnectedCompositions; } });
@@ -1,9 +1,10 @@
1
1
  import type { TSequence } from 'remotion';
2
2
  export type SequenceDoubleClickAction = 'open-connected-composition' | 'open-in-editor';
3
- export declare const getSequenceDoubleClickAction: ({ button, canOpenInEditor, numberOfConnectedCompositions, }: {
3
+ export declare const getSequenceDoubleClickAction: ({ button, canOpenInEditor, numberOfConnectedCompositions, sequenceWasDragged, }: {
4
4
  readonly button: number;
5
5
  readonly canOpenInEditor: boolean;
6
6
  readonly numberOfConnectedCompositions: number;
7
+ readonly sequenceWasDragged: boolean;
7
8
  }) => SequenceDoubleClickAction | null;
8
9
  export declare const getConnectedCompositionFrame: ({ timelinePosition, sequence, sequenceFrameOffset, }: {
9
10
  readonly timelinePosition: number;
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getConnectedCompositionFrame = exports.getSequenceDoubleClickAction = void 0;
4
- const getSequenceDoubleClickAction = ({ button, canOpenInEditor, numberOfConnectedCompositions, }) => {
4
+ const getSequenceDoubleClickAction = ({ button, canOpenInEditor, numberOfConnectedCompositions, sequenceWasDragged, }) => {
5
+ // The browser still fires `dblclick` when the second press of a
6
+ // double-click turned into a drag. That gesture is a drag, not a
7
+ // double-click.
8
+ if (sequenceWasDragged) {
9
+ return null;
10
+ }
5
11
  if (button !== 0) {
6
12
  return null;
7
13
  }
@@ -1,5 +1 @@
1
- import type { TSequence } from 'remotion';
2
- export declare const getCascadedStart: (sequence: TSequence, sequences: TSequence[]) => number;
3
- export declare const getCascadedStartWithTrim: (sequence: TSequence, sequences: TSequence[]) => number;
4
- export declare const getTimelineVisibleStart: (sequence: TSequence, sequences: TSequence[]) => number;
5
- export declare const getTimelineVisibleDuration: (sequence: TSequence, sequences: TSequence[]) => number;
1
+ export { getCascadedStart, getCascadedStartWithTrim, getTimelineVisibleDuration, getTimelineVisibleStart, } from '@remotion/canvas';
@@ -1,53 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTimelineVisibleDuration = exports.getTimelineVisibleStart = exports.getCascadedStartWithTrim = exports.getCascadedStart = void 0;
4
- const getCascadedStart = (sequence, sequences) => {
5
- if (!sequence.parent) {
6
- return sequence.from;
7
- }
8
- const parent = sequences.find((s) => s.id === sequence.parent);
9
- if (!parent) {
10
- throw new TypeError('Parent not found for sequence ' + sequence.id);
11
- }
12
- return (0, exports.getCascadedStart)(parent, sequences) + sequence.from;
13
- };
14
- exports.getCascadedStart = getCascadedStart;
15
- const getCascadedStartWithTrim = (sequence, sequences) => {
16
- const effectiveFrom = sequence.trimBefore === null
17
- ? sequence.from
18
- : sequence.from - sequence.trimBefore;
19
- if (!sequence.parent) {
20
- return effectiveFrom;
21
- }
22
- const parent = sequences.find((s) => s.id === sequence.parent);
23
- if (!parent) {
24
- throw new TypeError('Parent not found for sequence ' + sequence.id);
25
- }
26
- return (0, exports.getCascadedStartWithTrim)(parent, sequences) + effectiveFrom;
27
- };
28
- exports.getCascadedStartWithTrim = getCascadedStartWithTrim;
29
- const getTimelineVisibleStart = (sequence, sequences) => {
30
- const cascadedStart = Math.max(0, (0, exports.getCascadedStart)(sequence, sequences));
31
- if (!sequence.parent) {
32
- return cascadedStart;
33
- }
34
- const parent = sequences.find((s) => s.id === sequence.parent);
35
- if (!parent) {
36
- throw new TypeError('Parent not found for sequence ' + sequence.id);
37
- }
38
- const timelineVisibleStart = (0, exports.getTimelineVisibleStart)(parent, sequences);
39
- return Math.max(timelineVisibleStart, cascadedStart);
40
- };
41
- exports.getTimelineVisibleStart = getTimelineVisibleStart;
42
- const getTimelineVisibleDuration = (sequence, sequences) => {
43
- const visibleDuration = sequence.duration + Math.min(sequence.from, 0);
44
- if (!sequence.parent) {
45
- return visibleDuration;
46
- }
47
- const parent = sequences.find((s) => s.id === sequence.parent);
48
- if (!parent) {
49
- throw new TypeError('Parent not found for sequence ' + sequence.id);
50
- }
51
- return Math.min(visibleDuration, (0, exports.getTimelineVisibleDuration)(parent, sequences));
52
- };
53
- exports.getTimelineVisibleDuration = getTimelineVisibleDuration;
3
+ exports.getTimelineVisibleStart = exports.getTimelineVisibleDuration = exports.getCascadedStartWithTrim = exports.getCascadedStart = void 0;
4
+ const canvas_1 = require("@remotion/canvas");
5
+ Object.defineProperty(exports, "getCascadedStart", { enumerable: true, get: function () { return canvas_1.getCascadedStart; } });
6
+ Object.defineProperty(exports, "getCascadedStartWithTrim", { enumerable: true, get: function () { return canvas_1.getCascadedStartWithTrim; } });
7
+ Object.defineProperty(exports, "getTimelineVisibleDuration", { enumerable: true, get: function () { return canvas_1.getTimelineVisibleDuration; } });
8
+ Object.defineProperty(exports, "getTimelineVisibleStart", { enumerable: true, get: function () { return canvas_1.getTimelineVisibleStart; } });
@@ -1,2 +1 @@
1
- import type { TSequence } from 'remotion';
2
- export declare const getTimelineNestedLevel: (sequence: TSequence, allSequences: TSequence[], depth: number) => number;
1
+ export { getTimelineNestedLevel } from '@remotion/canvas';
@@ -1,15 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTimelineNestedLevel = void 0;
4
- const getTimelineNestedLevel = (sequence, allSequences, depth) => {
5
- if (!sequence.parent) {
6
- return depth;
7
- }
8
- const parentSequence = allSequences.find((s) => s.id === sequence.parent);
9
- if (!parentSequence) {
10
- throw new Error('has parentId but no parent');
11
- }
12
- const parentContributes = parentSequence.showInTimeline;
13
- return (0, exports.getTimelineNestedLevel)(parentSequence, allSequences, parentContributes ? depth + 1 : depth);
14
- };
15
- exports.getTimelineNestedLevel = getTimelineNestedLevel;
4
+ const canvas_1 = require("@remotion/canvas");
5
+ Object.defineProperty(exports, "getTimelineNestedLevel", { enumerable: true, get: function () { return canvas_1.getTimelineNestedLevel; } });