@remotion/studio 4.0.502 → 4.0.504

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 (217) hide show
  1. package/dist/api/install-package.d.ts +2 -1
  2. package/dist/api/install-package.js +6 -2
  3. package/dist/components/AssetSelectorItem.js +4 -16
  4. package/dist/components/Canvas.js +41 -54
  5. package/dist/components/CheckboardToggle.js +3 -1
  6. package/dist/components/ColorPicker/AlphaSlider.js +14 -10
  7. package/dist/components/ColorPicker/HueSlider.js +14 -10
  8. package/dist/components/ColorPicker/SaturationValueArea.js +14 -12
  9. package/dist/components/CompositionContextButton.js +1 -1
  10. package/dist/components/CompositionSelectorItem.js +2 -3
  11. package/dist/components/ConfigureDefaultEditorModal.d.ts +2 -0
  12. package/dist/components/ConfigureDefaultEditorModal.js +151 -0
  13. package/dist/components/ConfirmationDialog.js +6 -3
  14. package/dist/components/ContextMenu.js +0 -2
  15. package/dist/components/ControlButton.d.ts +4 -2
  16. package/dist/components/ControlButton.js +6 -20
  17. package/dist/components/Editor.js +1 -4
  18. package/dist/components/EditorContent.js +1 -1
  19. package/dist/components/EditorGuides/Guide.js +48 -74
  20. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  21. package/dist/components/EditorRuler/Ruler.js +3 -1
  22. package/dist/components/EditorRuler/index.js +26 -23
  23. package/dist/components/EffectPickerModal.js +68 -7
  24. package/dist/components/ElementInstallConfirmation.d.ts +12 -0
  25. package/dist/components/ElementInstallConfirmation.js +205 -0
  26. package/dist/components/ForceSpecificCursor.js +14 -0
  27. package/dist/components/FullscreenToggle.js +1 -2
  28. package/dist/components/InitialCompositionLoader.js +1 -14
  29. package/dist/components/InlineAction.d.ts +4 -4
  30. package/dist/components/InlineAction.js +6 -4
  31. package/dist/components/InspectorLocationCopy.d.ts +1 -0
  32. package/dist/components/InspectorLocationCopy.js +7 -3
  33. package/dist/components/InspectorOpenInEditor.d.ts +5 -0
  34. package/dist/components/InspectorOpenInEditor.js +135 -0
  35. package/dist/components/InspectorPanel/AlignmentControls.js +1 -1
  36. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +3 -3
  37. package/dist/components/InspectorPanel/CompositionMetadata.js +8 -7
  38. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +2 -2
  39. package/dist/components/InspectorPanel/KeyframeInspector.js +2 -3
  40. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -2
  41. package/dist/components/InspectorPanel/styles.js +4 -0
  42. package/dist/components/InspectorSequenceSection.js +2 -2
  43. package/dist/components/LoopToggle.js +1 -1
  44. package/dist/components/Menu/MenuItem.js +13 -6
  45. package/dist/components/Menu/MenuSubItem.js +3 -1
  46. package/dist/components/MenuBuildIndicator.d.ts +3 -1
  47. package/dist/components/MenuBuildIndicator.js +6 -4
  48. package/dist/components/MenuCompositionName.js +1 -1
  49. package/dist/components/MenuToolbar.js +1 -1
  50. package/dist/components/MobilePanel.d.ts +1 -2
  51. package/dist/components/MobilePanel.js +6 -6
  52. package/dist/components/ModalContainer.js +1 -1
  53. package/dist/components/ModalFooter.d.ts +1 -0
  54. package/dist/components/ModalFooter.js +2 -2
  55. package/dist/components/Modals.js +11 -2
  56. package/dist/components/MuteToggle.js +2 -1
  57. package/dist/components/NewComposition/ComboBox.d.ts +1 -0
  58. package/dist/components/NewComposition/ComboBox.js +2 -2
  59. package/dist/components/NewComposition/InputDragger.d.ts +4 -0
  60. package/dist/components/NewComposition/InputDragger.js +26 -32
  61. package/dist/components/Notifications/NotificationCenter.js +12 -2
  62. package/dist/components/OutlineToggle.js +10 -2
  63. package/dist/components/PlayPause.js +1 -5
  64. package/dist/components/PlaybackRateSelector.js +2 -1
  65. package/dist/components/PreviewToolbar.js +8 -7
  66. package/dist/components/PreviewToolbarOverflowButton.d.ts +0 -1
  67. package/dist/components/PreviewToolbarOverflowButton.js +2 -75
  68. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -2
  69. package/dist/components/RenderButton.d.ts +0 -1
  70. package/dist/components/RenderButton.js +10 -9
  71. package/dist/components/RenderModal/FrameRangeSetting.js +6 -1
  72. package/dist/components/RenderModal/InlineEyeIcon.js +1 -1
  73. package/dist/components/RenderModal/InlineRemoveButton.js +1 -1
  74. package/dist/components/RenderModal/MultiRangeSlider.js +8 -8
  75. package/dist/components/RenderModal/RenderModalEnvironmentVariables.js +1 -9
  76. package/dist/components/RenderModal/RenderModalOutputName.js +12 -3
  77. package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +1 -1
  78. package/dist/components/RenderModal/ServerRenderModal.js +2 -17
  79. package/dist/components/RenderModal/WebRenderModal.js +3 -17
  80. package/dist/components/RenderModal/layout.js +7 -5
  81. package/dist/components/RenderModal/render-modals.js +18 -15
  82. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +1 -1
  83. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +1 -1
  84. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
  85. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +1 -1
  86. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -1
  87. package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -15
  88. package/dist/components/SelectedOutlineCropControls.js +7 -6
  89. package/dist/components/SelectedOutlineElement.js +32 -38
  90. package/dist/components/SelectedOutlineUvControls.js +25 -24
  91. package/dist/components/ShowGuidesProvider.js +2 -0
  92. package/dist/components/SidebarCollapserControls.js +2 -2
  93. package/dist/components/SidebarRenderButton.js +2 -16
  94. package/dist/components/SizeSelector.js +2 -1
  95. package/dist/components/SnappingToggle.js +1 -2
  96. package/dist/components/Spinner.d.ts +1 -0
  97. package/dist/components/Spinner.js +2 -2
  98. package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
  99. package/dist/components/Splitter/SplitterContainer.js +4 -1
  100. package/dist/components/Splitter/SplitterContext.d.ts +4 -3
  101. package/dist/components/Splitter/SplitterContext.js +3 -2
  102. package/dist/components/Splitter/SplitterElement.js +6 -1
  103. package/dist/components/Splitter/SplitterHandle.js +18 -68
  104. package/dist/components/Tabs/vertical.d.ts +1 -0
  105. package/dist/components/Tabs/vertical.js +8 -10
  106. package/dist/components/TimeValue.js +26 -8
  107. package/dist/components/Timeline/EasingEditorModal.js +27 -19
  108. package/dist/components/Timeline/Timeline.js +1 -1
  109. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  110. package/dist/components/Timeline/TimelineClipboardKeybindings.js +3 -6
  111. package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -7
  112. package/dist/components/Timeline/TimelineDragHandler.js +38 -7
  113. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +2 -1
  114. package/dist/components/Timeline/TimelineInOutDragHandler.js +26 -11
  115. package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +1 -1
  116. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -2
  117. package/dist/components/Timeline/TimelineLayerEye.js +36 -4
  118. package/dist/components/Timeline/TimelineSelection.js +16 -24
  119. package/dist/components/Timeline/TimelineSequence.js +7 -3
  120. package/dist/components/Timeline/TimelineSequenceItem.js +24 -18
  121. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +1 -1
  122. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +76 -43
  123. package/dist/components/Timeline/TimelineStack/get-stack.js +7 -2
  124. package/dist/components/Timeline/TimelineZoomControls.d.ts +3 -1
  125. package/dist/components/Timeline/TimelineZoomControls.js +24 -12
  126. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +4 -2
  127. package/dist/components/Timeline/get-sequence-context-menu-items.js +38 -2
  128. package/dist/components/Timeline/should-subscribe-to-source-file.d.ts +1 -0
  129. package/dist/components/Timeline/should-subscribe-to-source-file.js +11 -0
  130. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +2 -3
  131. package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +3 -1
  132. package/dist/components/Timeline/use-open-sequence-in-editor.js +5 -2
  133. package/dist/components/Timeline/use-sequence-props-subscription.js +2 -0
  134. package/dist/components/Timeline/use-timeline-asset-drop.js +3 -7
  135. package/dist/components/Timeline/use-timeline-keyframe-drag.js +31 -16
  136. package/dist/components/TimelineInOutToggle.js +3 -3
  137. package/dist/components/TopPanel.js +3 -2
  138. package/dist/components/UndoRedoButtons.js +6 -5
  139. package/dist/components/UpdateCheck.d.ts +2 -0
  140. package/dist/components/UpdateCheck.js +29 -11
  141. package/dist/components/UpdateModal/UpdateModal.js +58 -19
  142. package/dist/components/VisualControls/ClickableFileName.js +5 -2
  143. package/dist/components/composition-menu-items.d.ts +2 -4
  144. package/dist/components/composition-menu-items.js +32 -55
  145. package/dist/components/element-install-request.d.ts +3 -0
  146. package/dist/components/element-install-request.js +17 -0
  147. package/dist/components/folder-menu-items.js +1 -1
  148. package/dist/components/handle-drop.d.ts +2 -3
  149. package/dist/components/handle-drop.js +11 -4
  150. package/dist/components/import-assets.d.ts +7 -6
  151. package/dist/components/import-assets.js +5 -16
  152. package/dist/components/use-default-editor-info.d.ts +4 -0
  153. package/dist/components/use-default-editor-info.js +47 -0
  154. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
  155. package/dist/error-overlay/remotion-overlay/StackFrame.js +1 -1
  156. package/dist/esm/{chunk-fjv75ty4.js → chunk-43m68z1k.js} +8689 -7374
  157. package/dist/esm/internals.mjs +8689 -7374
  158. package/dist/esm/previewEntry.mjs +8668 -7353
  159. package/dist/esm/renderEntry.mjs +1 -1
  160. package/dist/helpers/inject-css.js +58 -67
  161. package/dist/helpers/install-required-package.d.ts +3 -2
  162. package/dist/helpers/install-required-package.js +20 -15
  163. package/dist/helpers/open-in-editor.d.ts +3 -3
  164. package/dist/helpers/open-in-editor.js +10 -6
  165. package/dist/helpers/pointer-session.d.ts +9 -0
  166. package/dist/helpers/pointer-session.js +94 -0
  167. package/dist/helpers/use-menu-structure.js +109 -51
  168. package/dist/icons/audio.d.ts +1 -1
  169. package/dist/icons/audio.js +1 -1
  170. package/dist/icons/caret.js +1 -1
  171. package/dist/icons/certificate.d.ts +1 -1
  172. package/dist/icons/certificate.js +1 -1
  173. package/dist/icons/custom-editor.d.ts +4 -0
  174. package/dist/icons/custom-editor.js +11 -0
  175. package/dist/icons/data.d.ts +1 -1
  176. package/dist/icons/data.js +2 -2
  177. package/dist/icons/editor.d.ts +6 -0
  178. package/dist/icons/editor.js +52 -0
  179. package/dist/icons/effects.d.ts +5 -0
  180. package/dist/icons/effects.js +8 -0
  181. package/dist/icons/ellipsis.js +1 -1
  182. package/dist/icons/external-link.d.ts +5 -0
  183. package/dist/icons/external-link.js +10 -0
  184. package/dist/icons/fullscreen.js +1 -1
  185. package/dist/icons/gear.d.ts +1 -1
  186. package/dist/icons/gear.js +1 -1
  187. package/dist/icons/gif.d.ts +1 -1
  188. package/dist/icons/gif.js +1 -1
  189. package/dist/icons/input-props.d.ts +2 -0
  190. package/dist/icons/input-props.js +9 -0
  191. package/dist/icons/jump-to-start.js +2 -2
  192. package/dist/icons/magnet.d.ts +3 -1
  193. package/dist/icons/magnet.js +2 -2
  194. package/dist/icons/media-volume.d.ts +6 -2
  195. package/dist/icons/media-volume.js +8 -6
  196. package/dist/icons/minus.d.ts +3 -1
  197. package/dist/icons/minus.js +2 -2
  198. package/dist/icons/pause.js +1 -1
  199. package/dist/icons/play.js +1 -1
  200. package/dist/icons/plus.js +1 -1
  201. package/dist/icons/redo.js +2 -2
  202. package/dist/icons/step-back.js +2 -2
  203. package/dist/icons/step-forward.js +2 -2
  204. package/dist/icons/timelineInOutPointer.js +2 -2
  205. package/dist/icons/undo.js +2 -2
  206. package/dist/state/editor-guides.d.ts +1 -0
  207. package/dist/state/editor-guides.js +1 -0
  208. package/dist/state/modals.d.ts +2 -0
  209. package/dist/state/z-index.d.ts +1 -0
  210. package/dist/state/z-index.js +34 -18
  211. package/package.json +12 -13
  212. package/dist/components/StudioCanvasCapture.d.ts +0 -5
  213. package/dist/components/StudioCanvasCapture.js +0 -40
  214. package/dist/components/canvas-capture-enabled.d.ts +0 -1
  215. package/dist/components/canvas-capture-enabled.js +0 -4
  216. package/dist/components/use-element-overwrite-confirmation.d.ts +0 -2
  217. package/dist/components/use-element-overwrite-confirmation.js +0 -73
@@ -20,7 +20,7 @@ exports.containerColumn = {
20
20
  flex: 1,
21
21
  height: 0,
22
22
  };
23
- const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, minFlexerSize, maxAntiFlexerSize, id, }) => {
23
+ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, minFlexerSize, maxAntiFlexerSize, minAntiFlexerSize, id, }) => {
24
24
  const [initialTimelineFlex, persistFlex] = (0, timeline_1.useTimelineFlex)(id);
25
25
  const [flexValue, setFlexValue] = (0, react_1.useState)(initialTimelineFlex !== null && initialTimelineFlex !== void 0 ? initialTimelineFlex : defaultFlex);
26
26
  const ref = (0, react_1.useRef)(null);
@@ -39,6 +39,7 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
39
39
  maxAntiFlexerSize,
40
40
  maxFlex,
41
41
  maxFlexerSize,
42
+ minAntiFlexerSize,
42
43
  minFlex,
43
44
  minFlexerSize,
44
45
  });
@@ -55,6 +56,7 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
55
56
  maxFlexerSize,
56
57
  minFlexerSize,
57
58
  maxAntiFlexerSize,
59
+ minAntiFlexerSize,
58
60
  defaultFlex,
59
61
  persistFlex,
60
62
  };
@@ -66,6 +68,7 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
66
68
  maxFlexerSize,
67
69
  minFlexerSize,
68
70
  maxAntiFlexerSize,
71
+ minAntiFlexerSize,
69
72
  minFlex,
70
73
  orientation,
71
74
  persistFlex,
@@ -14,6 +14,7 @@ export type TSplitterContext = {
14
14
  maxFlexerSize: number | null;
15
15
  minFlexerSize: number | null;
16
16
  maxAntiFlexerSize: number | null;
17
+ minAntiFlexerSize: number | null;
17
18
  defaultFlex: number;
18
19
  id: string;
19
20
  persistFlex: (value: number) => void;
@@ -22,14 +23,14 @@ export type TSplitterContext = {
22
23
  y: number;
23
24
  }>;
24
25
  };
25
- type SplitterFlexBounds = Pick<TSplitterContext, 'maxAntiFlexerSize' | 'maxFlex' | 'maxFlexerSize' | 'minFlex' | 'minFlexerSize'> & {
26
+ type SplitterFlexBounds = Pick<TSplitterContext, 'maxAntiFlexerSize' | 'maxFlex' | 'maxFlexerSize' | 'minAntiFlexerSize' | 'minFlex' | 'minFlexerSize'> & {
26
27
  readonly availableSize: number | null;
27
28
  };
28
- export declare const getSplitterFlexBounds: ({ availableSize, maxAntiFlexerSize, maxFlex, maxFlexerSize, minFlex, minFlexerSize, }: SplitterFlexBounds) => {
29
+ export declare const getSplitterFlexBounds: ({ availableSize, maxAntiFlexerSize, maxFlex, maxFlexerSize, minAntiFlexerSize, minFlex, minFlexerSize, }: SplitterFlexBounds) => {
29
30
  minFlex: number;
30
31
  maxFlex: number;
31
32
  };
32
- export declare const getClampedSplitterFlex: ({ flexValue, ...bounds }: Pick<TSplitterContext, "maxAntiFlexerSize" | "maxFlex" | "maxFlexerSize" | "minFlex" | "minFlexerSize"> & {
33
+ export declare const getClampedSplitterFlex: ({ flexValue, ...bounds }: Pick<TSplitterContext, "maxAntiFlexerSize" | "maxFlex" | "maxFlexerSize" | "minAntiFlexerSize" | "minFlex" | "minFlexerSize"> & {
33
34
  readonly availableSize: number | null;
34
35
  } & {
35
36
  readonly flexValue: number;
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SplitterContext = exports.getClampedSplitterFlex = exports.getSplitterFlexBounds = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const getSplitterFlexBounds = ({ availableSize, maxAntiFlexerSize, maxFlex, maxFlexerSize, minFlex, minFlexerSize, }) => {
8
+ const getSplitterFlexBounds = ({ availableSize, maxAntiFlexerSize, maxFlex, maxFlexerSize, minAntiFlexerSize, minFlex, minFlexerSize, }) => {
9
9
  if (availableSize === null || availableSize <= 0) {
10
10
  return { minFlex, maxFlex };
11
11
  }
12
12
  const minimum = Math.min(1, Math.max(minFlex, minFlexerSize === null ? 0 : minFlexerSize / availableSize, maxAntiFlexerSize === null ? 0 : 1 - maxAntiFlexerSize / availableSize));
13
- const maximum = Math.max(minimum, Math.min(maxFlex, maxFlexerSize === null ? 1 : maxFlexerSize / availableSize));
13
+ const maximum = Math.max(minimum, Math.min(maxFlex, maxFlexerSize === null ? 1 : maxFlexerSize / availableSize, minAntiFlexerSize === null ? 1 : 1 - minAntiFlexerSize / availableSize));
14
14
  return { minFlex: minimum, maxFlex: maximum };
15
15
  };
16
16
  exports.getSplitterFlexBounds = getSplitterFlexBounds;
@@ -30,6 +30,7 @@ exports.SplitterContext = react_1.default.createContext({
30
30
  maxFlexerSize: null,
31
31
  minFlexerSize: null,
32
32
  maxAntiFlexerSize: null,
33
+ minAntiFlexerSize: null,
33
34
  defaultFlex: 1,
34
35
  id: '--',
35
36
  persistFlex: () => undefined,
@@ -9,6 +9,7 @@ const SplitterContext_1 = require("./SplitterContext");
9
9
  const SplitterElement = ({ children, type, sticky }) => {
10
10
  const context = (0, react_1.useContext)(SplitterContext_1.SplitterContext);
11
11
  const maxSize = type === 'flexer' ? context.maxFlexerSize : context.maxAntiFlexerSize;
12
+ const minSize = type === 'flexer' ? context.minFlexerSize : context.minAntiFlexerSize;
12
13
  const style = (0, react_1.useMemo)(() => {
13
14
  return {
14
15
  flex:
@@ -22,8 +23,12 @@ const SplitterElement = ({ children, type, sticky }) => {
22
23
  maxHeight: context.orientation === 'horizontal'
23
24
  ? (maxSize !== null && maxSize !== void 0 ? maxSize : undefined)
24
25
  : undefined,
26
+ minWidth: context.orientation === 'vertical' ? (minSize !== null && minSize !== void 0 ? minSize : undefined) : undefined,
27
+ minHeight: context.orientation === 'horizontal'
28
+ ? (minSize !== null && minSize !== void 0 ? minSize : undefined)
29
+ : undefined,
25
30
  };
26
- }, [context.flexValue, context.orientation, maxSize, type]);
31
+ }, [context.flexValue, context.orientation, maxSize, minSize, type]);
27
32
  const stickStyle = (0, react_1.useMemo)(() => {
28
33
  return {
29
34
  position: 'absolute',
@@ -4,6 +4,7 @@ exports.SplitterHandle = exports.SPLITTER_HANDLE_SIZE = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const player_1 = require("@remotion/player");
6
6
  const react_1 = require("react");
7
+ const pointer_session_1 = require("../../helpers/pointer-session");
7
8
  const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
8
9
  const SplitterContext_1 = require("./SplitterContext");
9
10
  exports.SPLITTER_HANDLE_SIZE = 3;
@@ -28,7 +29,6 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
28
29
  if (!current) {
29
30
  return;
30
31
  }
31
- // Cleanup for the listeners that only exist for the duration of a drag.
32
32
  let endDrag = null;
33
33
  const onPointerDown = (e) => {
34
34
  var _a;
@@ -54,13 +54,13 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
54
54
  maxAntiFlexerSize: dragContext.maxAntiFlexerSize,
55
55
  maxFlex: dragContext.maxFlex,
56
56
  maxFlexerSize: dragContext.maxFlexerSize,
57
+ minAntiFlexerSize: dragContext.minAntiFlexerSize,
57
58
  minFlex: dragContext.minFlex,
58
59
  minFlexerSize: dragContext.minFlexerSize,
59
60
  });
60
61
  const startFlex = Math.min(maxFlex, Math.max(minFlex, dragContext.flexValue));
61
62
  dragContext.isDragging.current = start;
62
63
  (0, ForceSpecificCursor_1.forceSpecificCursor)(dragContext.orientation === 'horizontal' ? 'row-resize' : 'col-resize');
63
- current.classList.add('remotion-splitter-active');
64
64
  const getNewValue = (ev, clamp) => {
65
65
  if (!dragContext.ref.current) {
66
66
  throw new Error('domRect is not mounted');
@@ -75,17 +75,6 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
75
75
  }
76
76
  return newFlex;
77
77
  };
78
- endDrag = () => {
79
- dragContext.isDragging.current = false;
80
- (0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
81
- current.classList.remove('remotion-splitter-active');
82
- window.removeEventListener('pointermove', onPointerMove);
83
- window.removeEventListener('pointerup', onPointerUp);
84
- window.removeEventListener('pointercancel', onPointerCancel);
85
- window.removeEventListener('blur', onWindowBlur);
86
- endDrag = null;
87
- player_1.PlayerInternals.updateAllElementsSizes();
88
- };
89
78
  const onPointerMove = (ev) => {
90
79
  if (!dragContext.isDragging.current) {
91
80
  return;
@@ -107,23 +96,22 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
107
96
  }
108
97
  }
109
98
  };
110
- const onPointerUp = (ev) => {
111
- if (!dragContext.isDragging.current) {
112
- return;
113
- }
114
- dragContext.persistFlex(getNewValue(ev, true));
115
- endDrag === null || endDrag === void 0 ? void 0 : endDrag();
116
- };
117
- const onPointerCancel = () => {
118
- endDrag === null || endDrag === void 0 ? void 0 : endDrag();
119
- };
120
- const onWindowBlur = () => {
121
- endDrag === null || endDrag === void 0 ? void 0 : endDrag();
122
- };
123
- window.addEventListener('pointermove', onPointerMove);
124
- window.addEventListener('pointerup', onPointerUp);
125
- window.addEventListener('pointercancel', onPointerCancel);
126
- window.addEventListener('blur', onWindowBlur);
99
+ endDrag = (0, pointer_session_1.startPointerSession)({
100
+ event: e,
101
+ target: current,
102
+ onMove: onPointerMove,
103
+ onEnd: (reason, endEvent) => {
104
+ if ((reason === 'pointerup' || reason === 'buttons-released') &&
105
+ endEvent &&
106
+ dragContext.isDragging.current) {
107
+ dragContext.persistFlex(getNewValue(endEvent, true));
108
+ }
109
+ dragContext.isDragging.current = false;
110
+ (0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
111
+ endDrag = null;
112
+ player_1.PlayerInternals.updateAllElementsSizes();
113
+ },
114
+ });
127
115
  };
128
116
  current.addEventListener('pointerdown', onPointerDown);
129
117
  return () => {
@@ -131,44 +119,6 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
131
119
  endDrag === null || endDrag === void 0 ? void 0 : endDrag();
132
120
  };
133
121
  }, []);
134
- (0, react_1.useEffect)(() => {
135
- const { current } = ref;
136
- if (!current) {
137
- return;
138
- }
139
- let isMouseDown = false;
140
- const onMouseDown = () => {
141
- isMouseDown = true;
142
- };
143
- const onMouseUp = () => {
144
- isMouseDown = false;
145
- };
146
- const onMouseEnter = (e) => {
147
- if (e.button !== 0) {
148
- return;
149
- }
150
- if (isMouseDown) {
151
- return;
152
- }
153
- current.classList.add('remotion-splitter-hover');
154
- };
155
- const onMouseLeave = (e) => {
156
- if (e.button !== 0) {
157
- return;
158
- }
159
- current.classList.remove('remotion-splitter-hover');
160
- };
161
- current.addEventListener('mouseenter', onMouseEnter);
162
- current.addEventListener('mouseleave', onMouseLeave);
163
- window.addEventListener('mousedown', onMouseDown);
164
- window.addEventListener('mouseup', onMouseUp);
165
- return () => {
166
- current.removeEventListener('mouseenter', onMouseEnter);
167
- current.removeEventListener('mouseleave', onMouseLeave);
168
- window.removeEventListener('mousedown', onMouseDown);
169
- window.removeEventListener('mouseup', onMouseUp);
170
- };
171
- }, []);
172
122
  return (jsx_runtime_1.jsx("div", { ref: ref, className: [
173
123
  'remotion-splitter',
174
124
  context.orientation === 'horizontal'
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export declare const VerticalTab: React.FC<{
3
3
  readonly children: React.ReactNode;
4
4
  readonly onClick: React.MouseEventHandler<HTMLButtonElement>;
5
+ readonly renderIcon?: (color: string) => React.ReactNode;
5
6
  readonly style?: React.CSSProperties;
6
7
  readonly selected: boolean;
7
8
  }>;
@@ -12,13 +12,14 @@ const selectorButton = {
12
12
  paddingLeft: 16,
13
13
  display: 'flex',
14
14
  flexDirection: 'row',
15
+ fontFamily: 'sans-serif',
15
16
  fontSize: 14,
16
17
  color: 'inherit',
17
18
  alignItems: 'center',
18
19
  userSelect: 'none',
19
20
  WebkitUserSelect: 'none',
20
21
  };
21
- const VerticalTab = ({ children, onClick, style, selected }) => {
22
+ const VerticalTab = ({ children, onClick, renderIcon, style, selected }) => {
22
23
  const [hovered, setHovered] = (0, react_1.useState)(false);
23
24
  const { tabIndex } = (0, z_index_1.useZIndex)();
24
25
  const onPointerEnter = (0, react_1.useCallback)(() => {
@@ -27,19 +28,16 @@ const VerticalTab = ({ children, onClick, style, selected }) => {
27
28
  const onPointerLeave = (0, react_1.useCallback)(() => {
28
29
  setHovered(false);
29
30
  }, []);
31
+ const color = selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT;
30
32
  const definiteStyle = (0, react_1.useMemo)(() => {
31
33
  return {
32
34
  ...selectorButton,
33
- backgroundColor: selected
34
- ? colors_1.SELECTED_BACKGROUND
35
- : hovered
36
- ? colors_1.WHITE_ALPHA_06
37
- : colors_1.TRANSPARENT,
38
- color: selected ? colors_1.WHITE : colors_1.LIGHT_TEXT,
39
- boxShadow: selected ? 'none' : undefined,
35
+ backgroundColor: selected || hovered ? colors_1.WHITE_ALPHA_06 : colors_1.TRANSPARENT,
36
+ color,
37
+ boxShadow: 'none',
40
38
  ...style,
41
39
  };
42
- }, [hovered, selected, style]);
43
- return (jsx_runtime_1.jsx("button", { style: definiteStyle, type: "button", onClick: onClick, tabIndex: tabIndex, onPointerLeave: onPointerLeave, onPointerEnter: onPointerEnter, children: children }));
40
+ }, [color, hovered, selected, style]);
41
+ return (jsx_runtime_1.jsxs("button", { style: definiteStyle, type: "button", onClick: onClick, tabIndex: tabIndex, onPointerLeave: onPointerLeave, onPointerEnter: onPointerEnter, children: [renderIcon ? renderIcon(color) : null, children] }));
44
42
  };
45
43
  exports.VerticalTab = VerticalTab;
@@ -11,6 +11,7 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
11
11
  const render_frame_1 = require("../state/render-frame");
12
12
  const layout_1 = require("./layout");
13
13
  const InputDragger_1 = require("./NewComposition/InputDragger");
14
+ const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
14
15
  const text = {
15
16
  color: colors_1.WHITE,
16
17
  display: 'flex',
@@ -20,19 +21,32 @@ const text = {
20
21
  lineHeight: 1,
21
22
  width: '100%',
22
23
  };
23
- const time = {
24
+ const currentTimeTypography = {
25
+ color: colors_1.WHITE,
24
26
  display: 'inline-block',
25
- fontSize: 16,
27
+ fontSize: 14,
28
+ fontVariantNumeric: 'tabular-nums',
29
+ fontWeight: 400,
26
30
  lineHeight: 1,
27
31
  fontFamily: 'monospace',
28
32
  };
29
- const frameStyle = {
33
+ const currentTimeInputStyle = {
34
+ ...currentTimeTypography,
35
+ padding: '4px 6px 4px 0',
36
+ };
37
+ const currentTimeButtonStyle = {
38
+ paddingLeft: 0,
39
+ transform: 'translateY(-1px)',
40
+ };
41
+ const currentTimeSubtitle = {
30
42
  color: colors_1.LIGHT_TEXT,
31
- fontWeight: 500,
32
- lineHeight: 1,
33
- fontSize: 16,
43
+ display: 'block',
34
44
  fontFamily: 'monospace',
35
- paddingRight: 10,
45
+ fontSize: 10,
46
+ fontWeight: 400,
47
+ lineHeight: 1,
48
+ marginTop: -2,
49
+ textAlign: 'left',
36
50
  };
37
51
  const TimeValue = () => {
38
52
  const frame = (0, remotion_1.useCurrentFrame)();
@@ -47,6 +61,10 @@ const TimeValue = () => {
47
61
  const onValueChange = (0, react_1.useCallback)((val) => {
48
62
  seek(val);
49
63
  }, [seek]);
64
+ const formatter = (0, react_1.useCallback)((value) => {
65
+ return config ? (0, render_frame_1.renderFrame)(Number(value), config.fps) : String(value);
66
+ }, [config]);
67
+ const formatterSubtitle = (0, react_1.useCallback)((value) => String(value), []);
50
68
  (0, react_1.useImperativeHandle)(remotion_1.Internals.timeValueRef, () => ({
51
69
  goToFrame: () => {
52
70
  var _a;
@@ -81,7 +99,7 @@ const TimeValue = () => {
81
99
  return null;
82
100
  }
83
101
  return (jsx_runtime_1.jsxs("div", { style: text, children: [
84
- jsx_runtime_1.jsx("div", { style: time, children: (0, render_frame_1.renderFrame)(frame, config.fps) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(InputDragger_1.InputDragger, { ref: ref, value: frame, onTextChange: onTextChange, onValueChange: onValueChange, rightAlign: true, status: "ok", style: frameStyle })
102
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { ref: ref, "aria-label": String(frame), value: frame, onTextChange: onTextChange, onValueChange: onValueChange, formatter: formatter, formatterStyle: currentTimeTypography, formatterSubtitle: formatterSubtitle, formatterSubtitleStyle: currentTimeSubtitle, buttonStyle: currentTimeButtonStyle, rightAlign: false, status: "ok", style: currentTimeInputStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(TimelineZoomControls_1.TimelineZoomControls, { sliderMaxWidth: 80 }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
85
103
  ] }));
86
104
  };
87
105
  exports.TimeValue = TimeValue;
@@ -7,6 +7,7 @@ const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const client_id_1 = require("../../helpers/client-id");
9
9
  const colors_1 = require("../../helpers/colors");
10
+ const pointer_session_1 = require("../../helpers/pointer-session");
10
11
  const Checkbox_1 = require("../Checkbox");
11
12
  const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
12
13
  const InputDragger_1 = require("../NewComposition/InputDragger");
@@ -642,33 +643,40 @@ const EasingEditor = ({ state, renderHeader }) => {
642
643
  }
643
644
  setBezierAndPreview(next);
644
645
  }, [getValueFromPointer, setBezierAndPreview]);
645
- (0, react_1.useEffect)(() => {
646
- if (activeHandle === null) {
647
- return;
648
- }
649
- const onPointerMove = (event) => {
650
- updateHandleFromPointer(activeHandle, event);
651
- };
652
- const onPointerUp = () => {
653
- commitEasing(serializeBezier(bezierRef.current), liveOverrideVersionRef.current);
654
- setActiveHandle(null);
655
- };
656
- window.addEventListener('pointermove', onPointerMove);
657
- window.addEventListener('pointerup', onPointerUp, { once: true });
658
- return () => {
659
- window.removeEventListener('pointermove', onPointerMove);
660
- window.removeEventListener('pointerup', onPointerUp);
661
- };
662
- }, [activeHandle, commitEasing, updateHandleFromPointer]);
663
646
  const onHandlePointerDown = (0, react_1.useCallback)((handle, event) => {
664
647
  if (previewServerState.type !== 'connected') {
665
648
  return;
666
649
  }
667
650
  event.preventDefault();
668
651
  event.stopPropagation();
652
+ const bezierBeforeDrag = [...bezierRef.current];
669
653
  setActiveHandle(handle);
670
654
  updateHandleFromPointer(handle, event);
671
- }, [previewServerState.type, updateHandleFromPointer]);
655
+ (0, pointer_session_1.startPointerSession)({
656
+ event,
657
+ target: event.currentTarget,
658
+ onMove: (moveEvent) => {
659
+ updateHandleFromPointer(handle, moveEvent);
660
+ },
661
+ onEnd: (reason) => {
662
+ if (reason === 'pointerup' || reason === 'buttons-released') {
663
+ commitEasing(serializeBezier(bezierRef.current), liveOverrideVersionRef.current);
664
+ }
665
+ else {
666
+ clearEasingDragOverrides(pendingOverrideTargetsRef.current);
667
+ pendingOverrideTargetsRef.current = [];
668
+ bezierRef.current = bezierBeforeDrag;
669
+ setBezier(bezierBeforeDrag);
670
+ }
671
+ setActiveHandle(null);
672
+ },
673
+ });
674
+ }, [
675
+ clearEasingDragOverrides,
676
+ commitEasing,
677
+ previewServerState.type,
678
+ updateHandleFromPointer,
679
+ ]);
672
680
  (0, react_1.useEffect)(() => {
673
681
  return () => {
674
682
  clearEasingDragOverrides(pendingOverrideTargetsRef.current);
@@ -268,7 +268,7 @@ const TimelineInner = () => {
268
268
  }
269
269
  return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, componentIdentity: sequence.controls.componentIdentity, schema: sequence.controls.schema, getStack: sequence.getStack, effects: sequence.effects }, sequence.id));
270
270
  }), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}) : null, jsx_runtime_1.jsx(TimelineKeyframeTracksContext_1.TimelineKeyframeTracksProvider, { tracks: filtered, children: jsx_runtime_1.jsxs(TimelineSelection_1.TimelineSelectableItemsProvider, { timeline: shown, children: [(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectAllKeybindings, { timeline: shown })) : null, jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: isStill ? (jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown })) : (jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
271
- jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, minFlexerSize: MIN_TIMELINE_LABELS_WIDTH, maxAntiFlexerSize: null, children: [
271
+ jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, minFlexerSize: MIN_TIMELINE_LABELS_WIDTH, maxAntiFlexerSize: null, minAntiFlexerSize: null, children: [
272
272
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [
273
273
  jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineInOutDragHandler_1.TimelineInOutDragHandler, {})) : null, jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
274
274
  ] }) })
@@ -96,7 +96,7 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
96
96
  compositionSelection: null,
97
97
  });
98
98
  }, [initialQuery, onSelect, selectFile, setSelectedModal]);
99
- const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
99
+ const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
100
100
  if (inlineSourceAction === null) {
101
101
  return action;
102
102
  }
@@ -18,6 +18,7 @@ const call_update_keyframe_settings_1 = require("./call-update-keyframe-settings
18
18
  const delete_selected_timeline_item_1 = require("./delete-selected-timeline-item");
19
19
  const effects_clipboard_1 = require("./effects-clipboard");
20
20
  const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
21
+ const imperative_state_1 = require("./imperative-state");
21
22
  const keyframe_clipboard_1 = require("./keyframe-clipboard");
22
23
  const save_effect_prop_1 = require("./save-effect-prop");
23
24
  const TimelineSelection_1 = require("./TimelineSelection");
@@ -379,9 +380,6 @@ const getPasteEffectPropTarget = ({ selectedItems, payload, propStatuses, sequen
379
380
  exports.getPasteEffectPropTarget = getPasteEffectPropTarget;
380
381
  const TimelineClipboardKeybindings = () => {
381
382
  const keybindings = (0, use_keybinding_1.useKeybinding)();
382
- const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
383
- const timelinePositionRef = (0, react_1.useRef)(timelinePosition);
384
- timelinePositionRef.current = timelinePosition;
385
383
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
386
384
  const { canSelect } = (0, TimelineSelection_1.useTimelineSelection)();
387
385
  const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
@@ -556,7 +554,7 @@ const TimelineClipboardKeybindings = () => {
556
554
  clientId,
557
555
  confirm,
558
556
  propStatuses,
559
- timelinePosition: timelinePositionRef.current,
557
+ timelinePosition: (0, imperative_state_1.getCurrentFrame)(),
560
558
  });
561
559
  return deletePromise === null || deletePromise === void 0 ? void 0 : deletePromise.then((deleted) => {
562
560
  if (!deleted) {
@@ -612,7 +610,7 @@ const TimelineClipboardKeybindings = () => {
612
610
  const keyframeTarget = (0, keyframe_clipboard_1.getPasteKeyframeTarget)({
613
611
  selectedItems,
614
612
  payload: keyframeResult.data,
615
- timelinePosition: timelinePositionRef.current,
613
+ timelinePosition: (0, imperative_state_1.getCurrentFrame)(),
616
614
  sequences,
617
615
  overrideIdsToNodePaths: overrideIdToNodePathMappings,
618
616
  propStatuses,
@@ -870,7 +868,6 @@ const TimelineClipboardKeybindings = () => {
870
868
  previewServerState,
871
869
  sequencesRef,
872
870
  setPropStatuses,
873
- timelinePositionRef,
874
871
  ]);
875
872
  return null;
876
873
  };
@@ -10,6 +10,7 @@ const editor_guides_1 = require("../../state/editor-guides");
10
10
  const ConfirmationDialog_1 = require("../ConfirmationDialog");
11
11
  const delete_selected_timeline_item_1 = require("./delete-selected-timeline-item");
12
12
  const duplicate_selected_timeline_item_1 = require("./duplicate-selected-timeline-item");
13
+ const imperative_state_1 = require("./imperative-state");
13
14
  const reset_selected_timeline_props_1 = require("./reset-selected-timeline-props");
14
15
  const split_selected_timeline_item_1 = require("./split-selected-timeline-item");
15
16
  const TimelineSelection_1 = require("./TimelineSelection");
@@ -25,15 +26,13 @@ const TimelineDeleteKeybindings = () => {
25
26
  const { canSelect } = (0, TimelineSelection_1.useTimelineSelection)();
26
27
  const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
27
28
  const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
28
- const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
29
- const timelinePositionRef = (0, react_1.useRef)(timelinePosition);
30
- timelinePositionRef.current = timelinePosition;
31
29
  (0, react_1.useEffect)(() => {
32
30
  if (!canSelect || previewServerState.type !== 'connected') {
33
31
  return;
34
32
  }
35
33
  const { clientId } = previewServerState;
36
34
  const handleDelete = () => {
35
+ const timelinePosition = (0, imperative_state_1.getCurrentFrame)();
37
36
  const { selectedItems, clearSelection, selectItems } = currentSelection.current;
38
37
  const sequences = sequencesRef.current;
39
38
  const propStatuses = propStatusesRef.current;
@@ -58,7 +57,7 @@ const TimelineDeleteKeybindings = () => {
58
57
  clientId,
59
58
  confirm,
60
59
  propStatuses,
61
- timelinePosition: timelinePositionRef.current,
60
+ timelinePosition,
62
61
  });
63
62
  if (deletePromise !== null) {
64
63
  deletePromise
@@ -69,7 +68,7 @@ const TimelineDeleteKeybindings = () => {
69
68
  sequences,
70
69
  overrideIdsToNodePaths: overrideIdToNodePathMappings,
71
70
  propStatuses,
72
- timelinePosition: timelinePositionRef.current,
71
+ timelinePosition,
73
72
  });
74
73
  if (nextSelection.length === 0) {
75
74
  clearSelection();
@@ -169,7 +168,7 @@ const TimelineDeleteKeybindings = () => {
169
168
  sequences: sequencesRef.current,
170
169
  overrideIdsToNodePaths: overrideIdToNodePathMappings,
171
170
  propStatuses: propStatusesRef.current,
172
- splitFrame: timelinePositionRef.current,
171
+ splitFrame: (0, imperative_state_1.getCurrentFrame)(),
173
172
  });
174
173
  if (splitPromise === null) {
175
174
  return;
@@ -198,7 +197,6 @@ const TimelineDeleteKeybindings = () => {
198
197
  sequencesRef,
199
198
  setGuidesList,
200
199
  setPropStatuses,
201
- timelinePositionRef,
202
200
  ]);
203
201
  return null;
204
202
  };
@@ -39,6 +39,7 @@ const player_1 = require("@remotion/player");
39
39
  const react_1 = __importStar(require("react"));
40
40
  const remotion_1 = require("remotion");
41
41
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
42
+ const pointer_session_1 = require("../../helpers/pointer-session");
42
43
  const timeline_layout_1 = require("../../helpers/timeline-layout");
43
44
  const timeline_zoom_1 = require("../../state/timeline-zoom");
44
45
  const z_index_1 = require("../../state/z-index");
@@ -116,6 +117,7 @@ const TimelineDragHandlerInner = () => {
116
117
  }
117
118
  };
118
119
  const onPointerDown = (0, react_1.useCallback)((e) => {
120
+ var _a, _b;
119
121
  if (e.button !== 0) {
120
122
  return;
121
123
  }
@@ -139,7 +141,11 @@ const TimelineDragHandlerInner = () => {
139
141
  setDragging({
140
142
  dragging: true,
141
143
  wasPlaying: playing,
144
+ button: e.button,
145
+ pointerId: e.pointerId,
146
+ target: e.currentTarget,
142
147
  });
148
+ (_b = (_a = e.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, e.pointerId);
143
149
  pause();
144
150
  }, [isHighestContext, videoConfig, left, width, seek, playing, pause]);
145
151
  const onPointerMoveScrubbing = (0, react_1.useCallback)((e) => {
@@ -249,17 +255,42 @@ const TimelineDragHandlerInner = () => {
249
255
  play();
250
256
  }
251
257
  }, [dragging, left, play, videoConfig, setFrame, width]);
258
+ const onPointerCancelScrubbing = (0, react_1.useCallback)(() => {
259
+ stopInterval();
260
+ document.body.style.userSelect = '';
261
+ document.body.style.webkitUserSelect = '';
262
+ if (!dragging.dragging) {
263
+ return;
264
+ }
265
+ setDragging({ dragging: false });
266
+ if (dragging.wasPlaying) {
267
+ play();
268
+ }
269
+ }, [dragging, play]);
252
270
  (0, react_1.useEffect)(() => {
253
271
  if (!dragging.dragging) {
254
272
  return;
255
273
  }
256
- window.addEventListener('pointermove', onPointerMoveScrubbing);
257
- window.addEventListener('pointerup', onPointerUpScrubbing);
258
- return () => {
259
- window.removeEventListener('pointermove', onPointerMoveScrubbing);
260
- window.removeEventListener('pointerup', onPointerUpScrubbing);
261
- };
262
- }, [dragging.dragging, onPointerMoveScrubbing, onPointerUpScrubbing]);
274
+ return (0, pointer_session_1.startPointerSession)({
275
+ event: dragging,
276
+ target: dragging.target,
277
+ onMove: onPointerMoveScrubbing,
278
+ onEnd: (reason, endEvent) => {
279
+ if ((reason === 'pointerup' || reason === 'buttons-released') &&
280
+ endEvent) {
281
+ onPointerUpScrubbing(endEvent);
282
+ }
283
+ else {
284
+ onPointerCancelScrubbing();
285
+ }
286
+ },
287
+ });
288
+ }, [
289
+ dragging,
290
+ onPointerCancelScrubbing,
291
+ onPointerMoveScrubbing,
292
+ onPointerUpScrubbing,
293
+ ]);
263
294
  const ref = (0, react_1.useRef)(null);
264
295
  (0, react_1.useEffect)(() => {
265
296
  const currentRef = ref.current;
@@ -43,6 +43,7 @@ const TimelineKeyframeEasingLine_1 = require("./TimelineKeyframeEasingLine");
43
43
  const TimelineSelection_1 = require("./TimelineSelection");
44
44
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
45
45
  const rowClipper = {
46
+ boxSizing: 'border-box',
46
47
  marginLeft: -timeline_layout_1.TIMELINE_PADDING,
47
48
  marginRight: -timeline_layout_1.TIMELINE_PADDING,
48
49
  overflow: 'hidden',
@@ -61,7 +62,7 @@ const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, canEditEasin
61
62
  const easingSegments = canEditEasing
62
63
  ? (0, get_timeline_easing_segments_1.getTimelineEasingSegments)(keyframes)
63
64
  : [];
64
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showSeparator ? jsx_runtime_1.jsx("div", { style: rowSeparator }) : null, jsx_runtime_1.jsx("div", { style: { ...rowClipper, height }, children: jsx_runtime_1.jsxs("div", { style: { ...row, height }, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, easingSegments.map((segment) => (jsx_runtime_1.jsx(TimelineKeyframeEasingLine_1.TimelineKeyframeEasingLine, { fromFrame: segment.fromFrame, toFrame: segment.toFrame, rowHeight: height, nodePathInfo: nodePathInfo, segmentIndex: segment.segmentIndex }, `${segment.segmentIndex}-${segment.fromFrame}-${segment.toFrame}`))), keyframes.map((keyframe) => (jsx_runtime_1.jsx(TimelineKeyframeDiamond_1.TimelineKeyframeDiamond, { frame: keyframe.frame, rowHeight: height, nodePathInfo: nodePathInfo }, keyframe.frame)))] }) })
65
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showSeparator ? jsx_runtime_1.jsx("div", { style: rowSeparator }) : null, jsx_runtime_1.jsx("div", { style: { ...rowClipper, height, width: timelineWidth !== null && timelineWidth !== void 0 ? timelineWidth : undefined }, children: jsx_runtime_1.jsxs("div", { style: { ...row, height }, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, easingSegments.map((segment) => (jsx_runtime_1.jsx(TimelineKeyframeEasingLine_1.TimelineKeyframeEasingLine, { fromFrame: segment.fromFrame, toFrame: segment.toFrame, rowHeight: height, nodePathInfo: nodePathInfo, segmentIndex: segment.segmentIndex }, `${segment.segmentIndex}-${segment.fromFrame}-${segment.toFrame}`))), keyframes.map((keyframe) => (jsx_runtime_1.jsx(TimelineKeyframeDiamond_1.TimelineKeyframeDiamond, { frame: keyframe.frame, rowHeight: height, nodePathInfo: nodePathInfo }, keyframe.frame)))] }) })
65
66
  ] }));
66
67
  };
67
68
  exports.TimelineExpandedKeyframeRow = react_1.default.memo(TimelineExpandedKeyframeRowUnmemoized);