@remotion/studio 4.0.501 → 4.0.502

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 (67) hide show
  1. package/dist/components/AssetSelectorItem.js +2 -2
  2. package/dist/components/Canvas.js +3 -3
  3. package/dist/components/CompositionSelector.js +4 -4
  4. package/dist/components/CompositionSelectorItem.js +5 -5
  5. package/dist/components/EditorContent.js +1 -1
  6. package/dist/components/FullscreenToggle.d.ts +3 -1
  7. package/dist/components/FullscreenToggle.js +2 -2
  8. package/dist/components/InlineAction.js +1 -1
  9. package/dist/components/InspectorPanel/use-composition-actions.d.ts +1 -1
  10. package/dist/components/InspectorPanel/use-composition-actions.js +46 -3
  11. package/dist/components/LoopToggle.d.ts +1 -0
  12. package/dist/components/LoopToggle.js +9 -5
  13. package/dist/components/Menu/MenuSubItem.js +9 -1
  14. package/dist/components/ObserveDefaultPropsContext.js +7 -4
  15. package/dist/components/PlayPause.d.ts +1 -0
  16. package/dist/components/PlayPause.js +2 -4
  17. package/dist/components/PlaybackRateSelector.d.ts +9 -2
  18. package/dist/components/PlaybackRateSelector.js +21 -10
  19. package/dist/components/PreviewToolbar.js +19 -109
  20. package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
  21. package/dist/components/PreviewToolbarOverflowButton.js +217 -0
  22. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +1 -0
  23. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +1 -0
  24. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +16 -1
  25. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
  26. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
  27. package/dist/components/RenderButton.d.ts +1 -0
  28. package/dist/components/RenderButton.js +6 -4
  29. package/dist/components/SizeSelector.d.ts +6 -0
  30. package/dist/components/SizeSelector.js +17 -8
  31. package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
  32. package/dist/components/Splitter/SplitterContainer.js +23 -3
  33. package/dist/components/Splitter/SplitterContext.d.ts +14 -0
  34. package/dist/components/Splitter/SplitterContext.js +16 -1
  35. package/dist/components/Splitter/SplitterHandle.js +8 -6
  36. package/dist/components/Timeline/Timeline.js +2 -1
  37. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  38. package/dist/components/Timeline/TimelineAssetField.js +36 -1
  39. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  40. package/dist/components/Timeline/TimelineStack/get-stack.js +8 -0
  41. package/dist/components/Timeline/save-sequence-prop.js +4 -4
  42. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
  43. package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
  44. package/dist/components/TopPanel.js +1 -1
  45. package/dist/components/UpdateCheck.js +11 -4
  46. package/dist/components/default-props-api.d.ts +3 -0
  47. package/dist/components/default-props-api.js +19 -0
  48. package/dist/components/drop-handler-data.d.ts +1 -1
  49. package/dist/components/drop-handler-data.js +6 -6
  50. package/dist/components/effect-drag-and-drop.d.ts +1 -1
  51. package/dist/components/effect-drag-and-drop.js +3 -3
  52. package/dist/components/element-drag-and-drop.d.ts +1 -1
  53. package/dist/components/element-drag-and-drop.js +3 -3
  54. package/dist/components/import-assets.d.ts +4 -4
  55. package/dist/components/sequence-props-api.d.ts +4 -0
  56. package/dist/components/sequence-props-api.js +26 -0
  57. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
  58. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
  59. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
  60. package/dist/esm/{chunk-n1kj09yv.js → chunk-fjv75ty4.js} +4122 -3579
  61. package/dist/esm/internals.mjs +4122 -3579
  62. package/dist/esm/previewEntry.mjs +4175 -3632
  63. package/dist/esm/renderEntry.mjs +1 -1
  64. package/dist/icons/upload.d.ts +4 -0
  65. package/dist/icons/upload.js +8 -0
  66. package/dist/state/modals.d.ts +1 -0
  67. package/package.json +13 -13
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.AssetFolderTree = exports.getAssetContextMenuItems = exports.getCanDragAsset = exports.getAssetActionAvailability = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
- const drag_and_drop_1 = require("@remotion/drag-and-drop");
38
+ const studio_protocol_1 = require("@remotion/studio-protocol");
39
39
  const react_1 = require("react");
40
40
  const remotion_1 = require("remotion");
41
41
  const no_react_1 = require("remotion/no-react");
@@ -338,7 +338,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
338
338
  mediaMetadata.duration > 0
339
339
  ? mediaMetadata.duration
340
340
  : null;
341
- const dragData = drag_and_drop_1.DragAndDropInternals.makeDragData({
341
+ const dragData = studio_protocol_1.StudioProtocolInternals.makeDragData({
342
342
  type: 'asset',
343
343
  assetPath: relativePath,
344
344
  width: hasDimensions ? width : null,
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Canvas = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const drag_and_drop_1 = require("@remotion/drag-and-drop");
8
+ const studio_protocol_1 = require("@remotion/studio-protocol");
9
9
  const react_1 = require("react");
10
10
  const remotion_1 = require("remotion");
11
11
  const get_static_files_1 = require("../api/get-static-files");
@@ -728,7 +728,7 @@ const Canvas = ({ canvasContent, size }) => {
728
728
  setCompositionDropPreview(null);
729
729
  return;
730
730
  }
731
- const metadata = drag_and_drop_1.DragAndDropInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
731
+ const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
732
732
  if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) !== 'composition' ||
733
733
  metadata.width === undefined ||
734
734
  metadata.height === undefined) {
@@ -835,7 +835,7 @@ const Canvas = ({ canvasContent, size }) => {
835
835
  event.stopPropagation();
836
836
  setIsAddingAsset(true);
837
837
  try {
838
- const metadata = drag_and_drop_1.DragAndDropInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
838
+ const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
839
839
  const isComposition = (metadata === null || metadata === void 0 ? void 0 : metadata.type) === 'composition';
840
840
  let dropPosition = getDropPosition({
841
841
  addFitPadding,
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompositionSelector = exports.useCompositionNavigation = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const drag_and_drop_1 = require("@remotion/drag-and-drop");
5
+ const studio_protocol_1 = require("@remotion/studio-protocol");
6
6
  const studio_shared_1 = require("@remotion/studio-shared");
7
7
  const react_1 = require("react");
8
8
  const remotion_1 = require("remotion");
@@ -161,7 +161,7 @@ const CompositionSelector = () => {
161
161
  const onCompositionListDragOverCapture = (0, react_1.useCallback)((event) => {
162
162
  var _a;
163
163
  if (window.remotion_isReadOnlyStudio ||
164
- ((_a = drag_and_drop_1.DragAndDropInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
164
+ ((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
165
165
  stopCompositionListAutoScroll();
166
166
  return;
167
167
  }
@@ -178,7 +178,7 @@ const CompositionSelector = () => {
178
178
  const onRootDragOver = (0, react_1.useCallback)((event) => {
179
179
  var _a;
180
180
  if (window.remotion_isReadOnlyStudio ||
181
- ((_a = drag_and_drop_1.DragAndDropInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
181
+ ((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
182
182
  return;
183
183
  }
184
184
  event.preventDefault();
@@ -198,7 +198,7 @@ const CompositionSelector = () => {
198
198
  if (window.remotion_isReadOnlyStudio) {
199
199
  return;
200
200
  }
201
- const parsed = drag_and_drop_1.DragAndDropInternals.parseDragData(event.dataTransfer);
201
+ const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer);
202
202
  if ((parsed === null || parsed === void 0 ? void 0 : parsed.type) !== 'composition') {
203
203
  return;
204
204
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompositionSelectorItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const drag_and_drop_1 = require("@remotion/drag-and-drop");
5
+ const studio_protocol_1 = require("@remotion/studio-protocol");
6
6
  const studio_shared_1 = require("@remotion/studio-shared");
7
7
  const react_1 = require("react");
8
8
  const client_id_1 = require("../helpers/client-id");
@@ -150,7 +150,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
150
150
  }
151
151
  setIsDragging(true);
152
152
  event.dataTransfer.effectAllowed = 'copyMove';
153
- const dragData = drag_and_drop_1.DragAndDropInternals.makeDragData({
153
+ const dragData = studio_protocol_1.StudioProtocolInternals.makeDragData({
154
154
  type: 'composition',
155
155
  compositionFile: (_a = resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source) !== null && _a !== void 0 ? _a : null,
156
156
  compositionId: item.composition.id,
@@ -167,7 +167,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
167
167
  var _a;
168
168
  if (item.type !== 'folder' ||
169
169
  window.remotion_isReadOnlyStudio ||
170
- ((_a = drag_and_drop_1.DragAndDropInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
170
+ ((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
171
171
  return;
172
172
  }
173
173
  event.preventDefault();
@@ -183,7 +183,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
183
183
  var _a;
184
184
  if (item.type !== 'folder' ||
185
185
  window.remotion_isReadOnlyStudio ||
186
- ((_a = drag_and_drop_1.DragAndDropInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
186
+ ((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(event.dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) !== 'composition') {
187
187
  return;
188
188
  }
189
189
  event.preventDefault();
@@ -195,7 +195,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
195
195
  if (item.type !== 'folder' || window.remotion_isReadOnlyStudio) {
196
196
  return;
197
197
  }
198
- const parsed = drag_and_drop_1.DragAndDropInternals.parseDragData(event.dataTransfer);
198
+ const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer);
199
199
  if ((parsed === null || parsed === void 0 ? void 0 : parsed.type) !== 'composition') {
200
200
  return;
201
201
  }
@@ -35,7 +35,7 @@ const StudioClearSelectionArea = ({ children }) => {
35
35
  const EditorContent = ({ readOnlyStudio, children }) => {
36
36
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
37
37
  const showTimeline = canvasContent !== null && canvasContent.type === 'composition';
38
- const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, maxFlexerSize: null, maxAntiFlexerSize: null, children: [
38
+ const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, maxFlexerSize: null, minFlexerSize: null, maxAntiFlexerSize: null, children: [
39
39
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
40
40
  ] }));
41
41
  return (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionProvider, { children: jsx_runtime_1.jsxs(StudioClearSelectionArea, { children: [
@@ -1 +1,3 @@
1
- export declare const FullScreenToggle: React.FC<{}>;
1
+ export declare const FullScreenToggle: React.FC<{
2
+ readonly hidden: boolean;
3
+ }>;
@@ -16,7 +16,7 @@ const accessibilityLabel = [
16
16
  ]
17
17
  .filter(no_react_1.NoReactInternals.truthy)
18
18
  .join(' ');
19
- const FullScreenToggle = () => {
19
+ const FullScreenToggle = ({ hidden }) => {
20
20
  const keybindings = (0, use_keybinding_1.useKeybinding)();
21
21
  const { setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
22
22
  const onClick = (0, react_1.useCallback)(() => {
@@ -45,6 +45,6 @@ const FullScreenToggle = () => {
45
45
  f.unregister();
46
46
  };
47
47
  }, [keybindings, onClick]);
48
- return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: colors_1.WHITE_HEX, style: { width: 18, height: 18 } }) }));
48
+ return hidden ? (jsx_runtime_1.jsx("button", { id: "fullscreen-toggle", type: "button", style: { display: 'none' }, onClick: onClick })) : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { id: "fullscreen-toggle", title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: colors_1.WHITE_HEX, style: { width: 18, height: 18 } }) }));
49
49
  };
50
50
  exports.FullScreenToggle = FullScreenToggle;
@@ -31,6 +31,6 @@ const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor =
31
31
  pointerEvents: disabled ? 'none' : 'auto',
32
32
  };
33
33
  }, [disabled, hovered]);
34
- return (jsx_runtime_1.jsx("button", { type: "button", disabled: disabled, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? colors_1.WHITE : unhoveredColor) }));
34
+ return (jsx_runtime_1.jsx("button", { type: "button", disabled: disabled, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, "aria-label": title, children: renderAction(hovered ? colors_1.WHITE : unhoveredColor) }));
35
35
  };
36
36
  exports.InlineAction = InlineAction;
@@ -5,7 +5,7 @@ export declare const useCompositionActions: () => {
5
5
  canShowInsertAsset: boolean;
6
6
  canShowInsertComposition: boolean;
7
7
  canShowInsertSolid: boolean;
8
- insertAsset: () => Promise<void>;
8
+ insertAsset: () => void;
9
9
  insertComposition: () => void;
10
10
  insertSolid: () => Promise<void>;
11
11
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCompositionActions = void 0;
4
- const drag_and_drop_1 = require("@remotion/drag-and-drop");
4
+ const studio_protocol_1 = require("@remotion/studio-protocol");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
@@ -100,7 +100,7 @@ const useCompositionActions = () => {
100
100
  currentCompositionId,
101
101
  videoConfig,
102
102
  ]);
103
- const insertAsset = (0, react_1.useCallback)(async () => {
103
+ const onFilesSelected = (0, react_1.useCallback)(async () => {
104
104
  if (!canInsertAsset ||
105
105
  currentCompositionId === null ||
106
106
  compositionFile === null ||
@@ -128,6 +128,49 @@ const useCompositionActions = () => {
128
128
  setIsAddingAsset(false);
129
129
  }
130
130
  }, [canInsertAsset, compositionFile, currentCompositionId, videoConfig]);
131
+ const onAssetSelected = (0, react_1.useCallback)(async (asset) => {
132
+ if (!canInsertAsset ||
133
+ currentCompositionId === null ||
134
+ compositionFile === null ||
135
+ videoConfig === null) {
136
+ return;
137
+ }
138
+ setIsAddingAsset(true);
139
+ try {
140
+ await (0, import_assets_1.insertExistingAssets)({
141
+ assetPaths: [asset.name],
142
+ fps: videoConfig.fps,
143
+ compositionFile,
144
+ compositionId: currentCompositionId,
145
+ destinationDimensions: null,
146
+ dropPosition: null,
147
+ from: null,
148
+ });
149
+ }
150
+ finally {
151
+ setIsAddingAsset(false);
152
+ }
153
+ }, [canInsertAsset, compositionFile, currentCompositionId, videoConfig]);
154
+ const insertAsset = (0, react_1.useCallback)(() => {
155
+ if (!canInsertAsset) {
156
+ return;
157
+ }
158
+ setSelectedModal({
159
+ type: 'quick-switcher',
160
+ mode: 'assets',
161
+ invocationTimestamp: Date.now(),
162
+ assetSelection: {
163
+ initialQuery: '',
164
+ onSelectFile: () => {
165
+ onFilesSelected().catch(() => undefined);
166
+ },
167
+ onSelected: (asset) => {
168
+ onAssetSelected(asset).catch(() => undefined);
169
+ },
170
+ },
171
+ compositionSelection: null,
172
+ });
173
+ }, [canInsertAsset, onAssetSelected, onFilesSelected, setSelectedModal]);
131
174
  const onCompositionSelected = (0, react_1.useCallback)(async (composition) => {
132
175
  var _a, _b, _c, _d, _e;
133
176
  if (!canInsertComposition ||
@@ -141,7 +184,7 @@ const useCompositionActions = () => {
141
184
  ? await (0, get_stack_1.getOriginalLocationFromStack)(composition.stack, 'sequence')
142
185
  : null;
143
186
  const selectedCompositionFile = (_b = (_a = resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source) !== null && _a !== void 0 ? _a : browserStudioOperations === null || browserStudioOperations === void 0 ? void 0 : browserStudioOperations.getCompositionFile(composition.id)) !== null && _b !== void 0 ? _b : null;
144
- const compositionDragData = drag_and_drop_1.DragAndDropInternals.makeDragData({
187
+ const compositionDragData = studio_protocol_1.StudioProtocolInternals.makeDragData({
145
188
  type: 'composition',
146
189
  compositionFile: selectedCompositionFile,
147
190
  compositionId: composition.id,
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export declare const toggleLoop: (setLoop: React.Dispatch<React.SetStateAction<boolean>>) => void;
2
3
  export declare const LoopToggle: React.FC<{
3
4
  readonly loop: boolean;
4
5
  readonly setLoop: React.Dispatch<React.SetStateAction<boolean>>;
@@ -1,18 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoopToggle = void 0;
3
+ exports.LoopToggle = exports.toggleLoop = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
7
  const loop_1 = require("../state/loop");
8
8
  const ControlButton_1 = require("./ControlButton");
9
9
  const accessibilityLabel = 'Loop video';
10
+ const toggleLoop = (setLoop) => {
11
+ setLoop((currentLoop) => {
12
+ (0, loop_1.persistLoopOption)(!currentLoop);
13
+ return !currentLoop;
14
+ });
15
+ };
16
+ exports.toggleLoop = toggleLoop;
10
17
  const LoopToggle = ({ loop, setLoop }) => {
11
18
  const onClick = (0, react_1.useCallback)(() => {
12
- setLoop((c) => {
13
- (0, loop_1.persistLoopOption)(!c);
14
- return !c;
15
- });
19
+ (0, exports.toggleLoop)(setLoop);
16
20
  }, [setLoop]);
17
21
  return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: jsx_runtime_1.jsx("path", { fill: loop ? colors_1.BLUE : colors_1.WHITE, d: "M493.544 181.463c11.956 22.605 18.655 48.4 18.452 75.75C511.339 345.365 438.56 416 350.404 416H192v47.495c0 22.475-26.177 32.268-40.971 17.475l-80-80c-9.372-9.373-9.372-24.569 0-33.941l80-80C166.138 271.92 192 282.686 192 304v48h158.875c52.812 0 96.575-42.182 97.12-94.992.155-15.045-3.17-29.312-9.218-42.046-4.362-9.185-2.421-20.124 4.8-27.284 4.745-4.706 8.641-8.555 11.876-11.786 11.368-11.352 30.579-8.631 38.091 5.571zM64.005 254.992c.545-52.81 44.308-94.992 97.12-94.992H320v47.505c0 22.374 26.121 32.312 40.971 17.465l80-80c9.372-9.373 9.372-24.569 0-33.941l-80-80C346.014 16.077 320 26.256 320 48.545V96H161.596C73.44 96 .661 166.635.005 254.788c-.204 27.35 6.495 53.145 18.452 75.75 7.512 14.202 26.723 16.923 38.091 5.57 3.235-3.231 7.13-7.08 11.876-11.786 7.22-7.16 9.162-18.098 4.8-27.284-6.049-12.735-9.374-27.001-9.219-42.046z" }) }) }));
18
22
  };
@@ -90,9 +90,17 @@ const MenuSubItem = ({ label, leaveLeftSpace, leftItem, onActionChosen, id, sele
90
90
  return null;
91
91
  }
92
92
  const left = size.left + size.width + styles_1.SUBMENU_LEFT_INSET;
93
+ const minSpaceRequired = mobileLayout
94
+ ? styles_1.MAX_MOBILE_MENU_WIDTH
95
+ : styles_1.MAX_MENU_WIDTH;
96
+ const canOpenOnRight = size.windowSize.width - size.left - size.width >= minSpaceRequired;
93
97
  return {
94
98
  ...styles_1.menuContainerTowardsBottom,
95
- left: mobileLayout ? left * 0.7 : left,
99
+ ...(canOpenOnRight
100
+ ? { left }
101
+ : {
102
+ right: size.windowSize.width - size.left + styles_1.SUBMENU_LEFT_INSET,
103
+ }),
96
104
  top: size.top - styles_1.MENU_VERTICAL_PADDING,
97
105
  };
98
106
  }, [mobileLayout, selected, size, subMenu, subMenuActivated]);
@@ -38,8 +38,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const remotion_1 = require("remotion");
40
40
  const no_react_1 = require("remotion/no-react");
41
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
41
42
  const client_id_1 = require("../helpers/client-id");
42
- const call_api_1 = require("./call-api");
43
+ const default_props_api_1 = require("./default-props-api");
43
44
  exports.ObserveDefaultPropsContext = react_1.default.createContext(null);
44
45
  const ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
45
46
  const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
@@ -82,10 +83,12 @@ const ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
82
83
  }
83
84
  }, [updateProps]);
84
85
  (0, react_1.useEffect)(() => {
85
- if (readOnlyStudio || !clientId || compositionId === null) {
86
+ if ((readOnlyStudio && !(0, browser_studio_operations_1.getBrowserStudioOperations)()) ||
87
+ !clientId ||
88
+ compositionId === null) {
86
89
  return;
87
90
  }
88
- (0, call_api_1.callApi)('/api/subscribe-to-default-props', { compositionId, clientId })
91
+ (0, default_props_api_1.subscribeToDefaultProps)({ compositionId, clientId })
89
92
  .then((can) => {
90
93
  applyResult(compositionId, can);
91
94
  })
@@ -96,7 +99,7 @@ const ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
96
99
  });
97
100
  });
98
101
  return () => {
99
- (0, call_api_1.callApi)('/api/unsubscribe-from-default-props', {
102
+ (0, default_props_api_1.unsubscribeFromDefaultProps)({
100
103
  compositionId,
101
104
  clientId,
102
105
  }).catch(() => {
@@ -4,4 +4,5 @@ export declare const PlayPause: React.FC<{
4
4
  readonly loop: boolean;
5
5
  readonly bufferStateDelayInMilliseconds: number;
6
6
  readonly muted: boolean;
7
+ readonly hideNavigationControls: boolean;
7
8
  }>;
@@ -30,7 +30,7 @@ const iconButton = {
30
30
  width: 14,
31
31
  color: colors_1.WHITE,
32
32
  };
33
- const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted }) => {
33
+ const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted, hideNavigationControls, }) => {
34
34
  const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
35
35
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
36
36
  const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
@@ -198,8 +198,6 @@ const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted }
198
198
  stopped = true;
199
199
  };
200
200
  }, [bufferStateDelayInMilliseconds, emitter]);
201
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
202
- jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: !videoConfig || isFirstFrame, onClick: jumpToStart, children: jsx_runtime_1.jsx(jump_to_start_1.JumpToStart, { style: backStyle }) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: !videoConfig || isFirstFrame, onClick: oneFrameBack, children: jsx_runtime_1.jsx(step_back_1.StepBack, { style: forwardBackStyle }) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, disabled: !videoConfig, children: playing ? (showBufferIndicator ? (jsx_runtime_1.jsx(player_1.PlayerInternals.BufferingIndicator, { type: "studio" })) : (jsx_runtime_1.jsx(pause_1.Pause, { style: iconButton }))) : (jsx_runtime_1.jsx(play_1.Play, { style: iconButton })) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step forward one frame", title: "Step forward one frame", disabled: !videoConfig || isLastFrame, onClick: oneFrameForward, children: jsx_runtime_1.jsx(step_forward_1.StepForward, { style: forwardBackStyle }) })
203
- ] }));
201
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: !videoConfig || isFirstFrame, onClick: jumpToStart, children: jsx_runtime_1.jsx(jump_to_start_1.JumpToStart, { style: backStyle }) })), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: !videoConfig || isFirstFrame, onClick: oneFrameBack, children: jsx_runtime_1.jsx(step_back_1.StepBack, { style: forwardBackStyle }) })), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, disabled: !videoConfig, children: playing ? (showBufferIndicator ? (jsx_runtime_1.jsx(player_1.PlayerInternals.BufferingIndicator, { type: "studio" })) : (jsx_runtime_1.jsx(pause_1.Pause, { style: iconButton }))) : (jsx_runtime_1.jsx(play_1.Play, { style: iconButton })) }), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Step forward one frame", title: "Step forward one frame", disabled: !videoConfig || isLastFrame, onClick: oneFrameForward, children: jsx_runtime_1.jsx(step_forward_1.StepForward, { style: forwardBackStyle }) }))] }));
204
202
  };
205
203
  exports.PlayPause = PlayPause;
@@ -1,5 +1,12 @@
1
1
  import React from 'react';
2
- export declare const PlaybackRateSelector: React.FC<{
2
+ import type { ComboboxValue } from './NewComposition/ComboBox';
3
+ type PlaybackRateMenuItemsProps = {
3
4
  readonly playbackRate: number;
4
5
  readonly setPlaybackRate: React.Dispatch<React.SetStateAction<number>>;
5
- }>;
6
+ };
7
+ export declare const usePlaybackRateMenuItems: ({ playbackRate, setPlaybackRate, }: PlaybackRateMenuItemsProps) => {
8
+ items: ComboboxValue[];
9
+ selectedId: string;
10
+ };
11
+ export declare const PlaybackRateSelector: React.FC<PlaybackRateMenuItemsProps>;
12
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlaybackRateSelector = void 0;
3
+ exports.PlaybackRateSelector = exports.usePlaybackRateMenuItems = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
@@ -17,14 +17,7 @@ const getPlaybackRateLabel = (playbackRate) => {
17
17
  };
18
18
  const accessibilityLabel = 'Change the playback rate';
19
19
  const comboStyle = { width: 64 };
20
- const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
21
- const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
22
- const isStill = (0, is_current_selected_still_1.useIsStill)();
23
- const style = (0, react_1.useMemo)(() => {
24
- return {
25
- padding: ControlButton_1.CONTROL_BUTTON_PADDING - 2,
26
- };
27
- }, []);
20
+ const usePlaybackRateMenuItems = ({ playbackRate, setPlaybackRate, }) => {
28
21
  const items = (0, react_1.useMemo)(() => {
29
22
  const divider = {
30
23
  type: 'divider',
@@ -51,9 +44,27 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
51
44
  const middle = Math.floor(commonPlaybackRates.length / 2);
52
45
  return [...values.slice(0, middle), divider, ...values.slice(middle)];
53
46
  }, [playbackRate, setPlaybackRate]);
47
+ return {
48
+ items,
49
+ selectedId: String(playbackRate),
50
+ };
51
+ };
52
+ exports.usePlaybackRateMenuItems = usePlaybackRateMenuItems;
53
+ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate, }) => {
54
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
55
+ const isStill = (0, is_current_selected_still_1.useIsStill)();
56
+ const { items, selectedId } = (0, exports.usePlaybackRateMenuItems)({
57
+ playbackRate,
58
+ setPlaybackRate,
59
+ });
60
+ const style = (0, react_1.useMemo)(() => {
61
+ return {
62
+ padding: ControlButton_1.CONTROL_BUTTON_PADDING - 2,
63
+ };
64
+ }, []);
54
65
  if (isStill || canvasContent === null || canvasContent.type === 'asset') {
55
66
  return null;
56
67
  }
57
- return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "compact", title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }) }));
68
+ return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "compact", title: accessibilityLabel, style: comboStyle, selectedId: selectedId, values: items }) }));
58
69
  };
59
70
  exports.PlaybackRateSelector = PlaybackRateSelector;
@@ -21,6 +21,7 @@ const PlaybackKeyboardShortcutsManager_1 = require("./PlaybackKeyboardShortcutsM
21
21
  const PlaybackRatePersistor_1 = require("./PlaybackRatePersistor");
22
22
  const PlaybackRateSelector_1 = require("./PlaybackRateSelector");
23
23
  const PlayPause_1 = require("./PlayPause");
24
+ const PreviewToolbarOverflowButton_1 = require("./PreviewToolbarOverflowButton");
24
25
  const RenderButton_1 = require("./RenderButton");
25
26
  const SizeSelector_1 = require("./SizeSelector");
26
27
  const SnappingToggle_1 = require("./SnappingToggle");
@@ -29,6 +30,7 @@ const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
29
30
  const TOOLBAR_HEIGHT = 40;
30
31
  const container = {
31
32
  display: 'flex',
33
+ position: 'relative',
32
34
  justifyContent: 'center',
33
35
  borderTop: colors_1.BORDER_BLACK_ALPHA_50,
34
36
  alignItems: 'center',
@@ -36,45 +38,21 @@ const container = {
36
38
  background: colors_1.BACKGROUND,
37
39
  height: TOOLBAR_HEIGHT,
38
40
  };
39
- const mobileContainer = {
40
- ...container,
41
- position: 'relative',
42
- overflowX: 'auto',
43
- justifyContent: 'flex-start',
44
- };
45
- const scrollIndicatorLeft = {
46
- position: 'fixed',
47
- display: 'none',
41
+ const centeredPlayButton = {
42
+ position: 'absolute',
43
+ left: '50%',
48
44
  top: 0,
49
- left: 0,
50
- width: 40,
51
- height: '100%',
52
- pointerEvents: 'none',
53
- background: `linear-gradient(to right, ${colors_1.BACKGROUND}, ${colors_1.BACKGROUND__TRANSPARENT})`,
54
- };
55
- const scrollIndicatorRight = {
56
- position: 'fixed',
57
- display: 'none',
58
- top: 0,
59
- right: 0,
60
- width: 40,
61
- height: '100%',
62
- pointerEvents: 'none',
63
- background: `linear-gradient(to left, ${colors_1.BACKGROUND}, ${colors_1.BACKGROUND__TRANSPARENT})`,
64
- };
65
- const sideContainer = {
66
- width: 300,
67
- height: 30,
45
+ height: TOOLBAR_HEIGHT,
68
46
  display: 'flex',
69
- flexDirection: 'row',
70
47
  alignItems: 'center',
48
+ transform: 'translateX(-50%)',
71
49
  };
72
- const mobileSideContainer = {
50
+ const sideContainer = {
51
+ width: 300,
73
52
  height: 30,
74
53
  display: 'flex',
75
54
  flexDirection: 'row',
76
55
  alignItems: 'center',
77
- flexShrink: 0,
78
56
  };
79
57
  const padding = {
80
58
  width: timeline_layout_1.TIMELINE_PADDING,
@@ -95,88 +73,20 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
95
73
  const { setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
96
74
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
97
75
  const isVideoComposition = (0, is_current_selected_still_1.useIsVideoComposition)();
98
- const previewToolbarRef = (0, react_1.useRef)(null);
99
- const leftScrollIndicatorRef = (0, react_1.useRef)(null);
100
- const rightScrollIndicatorRef = (0, react_1.useRef)(null);
101
76
  const isStill = (0, is_current_selected_still_1.useIsStill)();
102
77
  const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
103
78
  const isFullscreenSupported = (0, check_fullscreen_support_1.checkFullscreenSupport)();
104
79
  const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
105
- (0, react_1.useEffect)(() => {
106
- if (!isMobileLayout) {
107
- // The indicators are `position: fixed` and are shown/placed
108
- // imperatively by the scroll handler below. Without this reset,
109
- // leaving the mobile layout (window resized past the breakpoint)
110
- // leaves them visible at stale viewport coordinates an orphaned
111
- // grey gradient rectangle floating over the canvas.
112
- if (leftScrollIndicatorRef.current) {
113
- leftScrollIndicatorRef.current.style.display = 'none';
114
- }
115
- if (rightScrollIndicatorRef.current) {
116
- rightScrollIndicatorRef.current.style.display = 'none';
117
- }
118
- return;
119
- }
120
- if (previewToolbarRef.current) {
121
- const updateScrollableIndicatorProps = (target) => {
122
- var _a;
123
- const boundingBox = target.getBoundingClientRect();
124
- const { scrollLeft, scrollWidth, clientWidth } = target;
125
- const scrollRight = scrollWidth - clientWidth - scrollLeft;
126
- if (!leftScrollIndicatorRef.current ||
127
- !rightScrollIndicatorRef.current) {
128
- return;
129
- }
130
- if (scrollLeft !== 0) {
131
- Object.assign(leftScrollIndicatorRef.current.style, {
132
- display: 'block',
133
- height: `${boundingBox.height}px`,
134
- top: `${boundingBox.top}px`,
135
- left: `${boundingBox.left}px`,
136
- });
137
- }
138
- else {
139
- Object.assign(leftScrollIndicatorRef.current.style, {
140
- display: 'none',
141
- });
142
- }
143
- if (scrollRight !== 0) {
144
- const itemWidth = ((_a = rightScrollIndicatorRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
145
- Object.assign(rightScrollIndicatorRef.current.style, {
146
- display: 'block',
147
- height: `${boundingBox.height}px`,
148
- top: `${boundingBox.top}px`,
149
- left: `${boundingBox.left + boundingBox.width - itemWidth}px`,
150
- });
151
- }
152
- else {
153
- Object.assign(rightScrollIndicatorRef.current.style, {
154
- display: 'none',
155
- });
156
- }
157
- };
158
- const previewToolbar = previewToolbarRef.current;
159
- const scrollHandler = () => {
160
- updateScrollableIndicatorProps(previewToolbar);
161
- };
162
- previewToolbar.addEventListener('scroll', scrollHandler);
163
- scrollHandler();
164
- return () => {
165
- previewToolbar.removeEventListener('scroll', scrollHandler);
166
- };
167
- }
168
- });
169
- return (jsx_runtime_1.jsxs("div", { ref: previewToolbarRef, style: isMobileLayout ? mobileContainer : container, className: "css-reset", children: [
170
- jsx_runtime_1.jsx("div", { ref: leftScrollIndicatorRef, style: scrollIndicatorLeft }), isMobileLayout ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
171
- jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
172
- jsx_runtime_1.jsx("div", { style: padding }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineZoomControls_1.TimelineZoomControls, {}) })
173
- ] }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), isVideoComposition ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
174
- jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
175
- ] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
176
- jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) }), readOnlyStudio ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, {}) }))] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
177
- jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), jsx_runtime_1.jsxs("div", { style: isMobileLayout ? mobileSideContainer : sideContainer, children: [
178
- jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio, size: "compact" }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
179
- ] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {}), jsx_runtime_1.jsx("div", { ref: rightScrollIndicatorRef, style: scrollIndicatorRight })
80
+ const playPause = (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted, hideNavigationControls: isMobileLayout }) }));
81
+ return (jsx_runtime_1.jsxs("div", { style: container, className: "css-reset", children: [
82
+ jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
83
+ jsx_runtime_1.jsx("div", { style: padding }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineZoomControls_1.TimelineZoomControls, {}) })
84
+ ] }), jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) })), !isMobileLayout && (isStill || isVideoComposition) ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null, isVideoComposition && isMobileLayout ? (jsx_runtime_1.jsx("div", { style: centeredPlayButton, children: playPause })) : null, isVideoComposition && !isMobileLayout ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
85
+ jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), playPause, jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
86
+ ] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) })), isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) })), readOnlyStudio || isMobileLayout ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, {}) }))] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, { hidden: isMobileLayout }) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
87
+ jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio, size: "compact", hidden: isMobileLayout }) }), isMobileLayout ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) })) : null, jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PreviewToolbarOverflowButton_1.PreviewToolbarOverflowButton, { readOnlyStudio: readOnlyStudio, showFullscreen: Boolean(canvasContent && isFullscreenSupported), showPlaybackRate: isVideoComposition, showLoop: isVideoComposition, showCompositionControls: (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition', playbackRate: playbackRate, setPlaybackRate: setPlaybackRate, loop: loop, setLoop: setLoop }) })
88
+ ] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
89
+ ] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {})
180
90
  ] }));
181
91
  };
182
92
  exports.PreviewToolbar = PreviewToolbar;