@remotion/studio 4.0.298 → 4.0.301

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.
@@ -2963,6 +2963,38 @@ var CurrentComposition = () => {
2963
2963
 
2964
2964
  // src/components/CompositionSelector.tsx
2965
2965
  import { jsx as jsx32, jsxs as jsxs8 } from "react/jsx-runtime";
2966
+ var useCompositionNavigation = () => {
2967
+ const { compositions, canvasContent } = useContext9(Internals7.CompositionManager);
2968
+ const selectComposition = useSelectComposition();
2969
+ const navigateToNextComposition = useCallback15(() => {
2970
+ if (!canvasContent || canvasContent.type !== "composition" || compositions.length <= 1) {
2971
+ return;
2972
+ }
2973
+ const currentIndex = compositions.findIndex((c) => c.id === canvasContent.compositionId);
2974
+ if (currentIndex === -1) {
2975
+ return;
2976
+ }
2977
+ const nextIndex = (currentIndex + 1) % compositions.length;
2978
+ const nextComposition = compositions[nextIndex];
2979
+ selectComposition(nextComposition, true);
2980
+ }, [canvasContent, compositions, selectComposition]);
2981
+ const navigateToPreviousComposition = useCallback15(() => {
2982
+ if (!canvasContent || canvasContent.type !== "composition" || compositions.length <= 1) {
2983
+ return;
2984
+ }
2985
+ const currentIndex = compositions.findIndex((c) => c.id === canvasContent.compositionId);
2986
+ if (currentIndex === -1) {
2987
+ return;
2988
+ }
2989
+ const previousIndex = (currentIndex - 1 + compositions.length) % compositions.length;
2990
+ const previousComposition = compositions[previousIndex];
2991
+ selectComposition(previousComposition, true);
2992
+ }, [canvasContent, compositions, selectComposition]);
2993
+ return useMemo21(() => ({
2994
+ navigateToNextComposition,
2995
+ navigateToPreviousComposition
2996
+ }), [navigateToNextComposition, navigateToPreviousComposition]);
2997
+ };
2966
2998
  var container7 = {
2967
2999
  display: "flex",
2968
3000
  flexDirection: "column",
@@ -20784,6 +20816,7 @@ var GlobalKeybindings = () => {
20784
20816
  const keybindings = useKeybinding();
20785
20817
  const { setSelectedModal } = useContext69(ModalsContext);
20786
20818
  const { setCheckerboard } = useContext69(CheckerboardContext);
20819
+ const { navigateToNextComposition, navigateToPreviousComposition } = useCompositionNavigation();
20787
20820
  useEffect66(() => {
20788
20821
  const nKey = keybindings.registerKeybinding({
20789
20822
  event: "keypress",
@@ -20848,14 +20881,40 @@ var GlobalKeybindings = () => {
20848
20881
  triggerIfInputFieldFocused: false,
20849
20882
  keepRegisteredWhenNotHighestContext: false
20850
20883
  });
20884
+ const pageDown = keybindings.registerKeybinding({
20885
+ event: "keydown",
20886
+ key: "PageDown",
20887
+ callback: navigateToNextComposition,
20888
+ commandCtrlKey: false,
20889
+ preventDefault: true,
20890
+ triggerIfInputFieldFocused: false,
20891
+ keepRegisteredWhenNotHighestContext: false
20892
+ });
20893
+ const pageUp = keybindings.registerKeybinding({
20894
+ event: "keydown",
20895
+ key: "PageUp",
20896
+ callback: navigateToPreviousComposition,
20897
+ commandCtrlKey: false,
20898
+ preventDefault: true,
20899
+ triggerIfInputFieldFocused: false,
20900
+ keepRegisteredWhenNotHighestContext: false
20901
+ });
20851
20902
  return () => {
20852
20903
  nKey.unregister();
20853
20904
  cKey.unregister();
20854
20905
  questionMark.unregister();
20855
20906
  cmdKKey.unregister();
20856
20907
  cmdIKey.unregister();
20908
+ pageDown.unregister();
20909
+ pageUp.unregister();
20857
20910
  };
20858
- }, [keybindings, setCheckerboard, setSelectedModal]);
20911
+ }, [
20912
+ keybindings,
20913
+ setCheckerboard,
20914
+ setSelectedModal,
20915
+ navigateToNextComposition,
20916
+ navigateToPreviousComposition
20917
+ ]);
20859
20918
  return null;
20860
20919
  };
20861
20920
 
@@ -22496,6 +22555,38 @@ var KeyboardShortcutsExplainer = () => {
22496
22555
  style: title4,
22497
22556
  children: "Navigation"
22498
22557
  }),
22558
+ /* @__PURE__ */ jsxs109(Row, {
22559
+ align: "center",
22560
+ children: [
22561
+ /* @__PURE__ */ jsx215("div", {
22562
+ style: left3,
22563
+ children: /* @__PURE__ */ jsx215("kbd", {
22564
+ style: key4,
22565
+ children: "PageUp"
22566
+ })
22567
+ }),
22568
+ /* @__PURE__ */ jsx215("div", {
22569
+ style: right2,
22570
+ children: "Previous composition"
22571
+ })
22572
+ ]
22573
+ }),
22574
+ /* @__PURE__ */ jsxs109(Row, {
22575
+ align: "center",
22576
+ children: [
22577
+ /* @__PURE__ */ jsx215("div", {
22578
+ style: left3,
22579
+ children: /* @__PURE__ */ jsx215("kbd", {
22580
+ style: key4,
22581
+ children: "PageDown"
22582
+ })
22583
+ }),
22584
+ /* @__PURE__ */ jsx215("div", {
22585
+ style: right2,
22586
+ children: "Next composition"
22587
+ })
22588
+ ]
22589
+ }),
22499
22590
  /* @__PURE__ */ jsxs109(Row, {
22500
22591
  align: "center",
22501
22592
  children: [
@@ -2968,6 +2968,38 @@ var CurrentComposition = () => {
2968
2968
 
2969
2969
  // src/components/CompositionSelector.tsx
2970
2970
  import { jsx as jsx32, jsxs as jsxs8 } from "react/jsx-runtime";
2971
+ var useCompositionNavigation = () => {
2972
+ const { compositions, canvasContent } = useContext9(Internals7.CompositionManager);
2973
+ const selectComposition = useSelectComposition();
2974
+ const navigateToNextComposition = useCallback15(() => {
2975
+ if (!canvasContent || canvasContent.type !== "composition" || compositions.length <= 1) {
2976
+ return;
2977
+ }
2978
+ const currentIndex = compositions.findIndex((c) => c.id === canvasContent.compositionId);
2979
+ if (currentIndex === -1) {
2980
+ return;
2981
+ }
2982
+ const nextIndex = (currentIndex + 1) % compositions.length;
2983
+ const nextComposition = compositions[nextIndex];
2984
+ selectComposition(nextComposition, true);
2985
+ }, [canvasContent, compositions, selectComposition]);
2986
+ const navigateToPreviousComposition = useCallback15(() => {
2987
+ if (!canvasContent || canvasContent.type !== "composition" || compositions.length <= 1) {
2988
+ return;
2989
+ }
2990
+ const currentIndex = compositions.findIndex((c) => c.id === canvasContent.compositionId);
2991
+ if (currentIndex === -1) {
2992
+ return;
2993
+ }
2994
+ const previousIndex = (currentIndex - 1 + compositions.length) % compositions.length;
2995
+ const previousComposition = compositions[previousIndex];
2996
+ selectComposition(previousComposition, true);
2997
+ }, [canvasContent, compositions, selectComposition]);
2998
+ return useMemo21(() => ({
2999
+ navigateToNextComposition,
3000
+ navigateToPreviousComposition
3001
+ }), [navigateToNextComposition, navigateToPreviousComposition]);
3002
+ };
2971
3003
  var container7 = {
2972
3004
  display: "flex",
2973
3005
  flexDirection: "column",
@@ -21064,6 +21096,7 @@ var GlobalKeybindings = () => {
21064
21096
  const keybindings = useKeybinding();
21065
21097
  const { setSelectedModal } = useContext69(ModalsContext);
21066
21098
  const { setCheckerboard } = useContext69(CheckerboardContext);
21099
+ const { navigateToNextComposition, navigateToPreviousComposition } = useCompositionNavigation();
21067
21100
  useEffect66(() => {
21068
21101
  const nKey = keybindings.registerKeybinding({
21069
21102
  event: "keypress",
@@ -21128,14 +21161,40 @@ var GlobalKeybindings = () => {
21128
21161
  triggerIfInputFieldFocused: false,
21129
21162
  keepRegisteredWhenNotHighestContext: false
21130
21163
  });
21164
+ const pageDown = keybindings.registerKeybinding({
21165
+ event: "keydown",
21166
+ key: "PageDown",
21167
+ callback: navigateToNextComposition,
21168
+ commandCtrlKey: false,
21169
+ preventDefault: true,
21170
+ triggerIfInputFieldFocused: false,
21171
+ keepRegisteredWhenNotHighestContext: false
21172
+ });
21173
+ const pageUp = keybindings.registerKeybinding({
21174
+ event: "keydown",
21175
+ key: "PageUp",
21176
+ callback: navigateToPreviousComposition,
21177
+ commandCtrlKey: false,
21178
+ preventDefault: true,
21179
+ triggerIfInputFieldFocused: false,
21180
+ keepRegisteredWhenNotHighestContext: false
21181
+ });
21131
21182
  return () => {
21132
21183
  nKey.unregister();
21133
21184
  cKey.unregister();
21134
21185
  questionMark.unregister();
21135
21186
  cmdKKey.unregister();
21136
21187
  cmdIKey.unregister();
21188
+ pageDown.unregister();
21189
+ pageUp.unregister();
21137
21190
  };
21138
- }, [keybindings, setCheckerboard, setSelectedModal]);
21191
+ }, [
21192
+ keybindings,
21193
+ setCheckerboard,
21194
+ setSelectedModal,
21195
+ navigateToNextComposition,
21196
+ navigateToPreviousComposition
21197
+ ]);
21139
21198
  return null;
21140
21199
  };
21141
21200
 
@@ -22776,6 +22835,38 @@ var KeyboardShortcutsExplainer = () => {
22776
22835
  style: title4,
22777
22836
  children: "Navigation"
22778
22837
  }),
22838
+ /* @__PURE__ */ jsxs109(Row, {
22839
+ align: "center",
22840
+ children: [
22841
+ /* @__PURE__ */ jsx216("div", {
22842
+ style: left3,
22843
+ children: /* @__PURE__ */ jsx216("kbd", {
22844
+ style: key4,
22845
+ children: "PageUp"
22846
+ })
22847
+ }),
22848
+ /* @__PURE__ */ jsx216("div", {
22849
+ style: right2,
22850
+ children: "Previous composition"
22851
+ })
22852
+ ]
22853
+ }),
22854
+ /* @__PURE__ */ jsxs109(Row, {
22855
+ align: "center",
22856
+ children: [
22857
+ /* @__PURE__ */ jsx216("div", {
22858
+ style: left3,
22859
+ children: /* @__PURE__ */ jsx216("kbd", {
22860
+ style: key4,
22861
+ children: "PageDown"
22862
+ })
22863
+ }),
22864
+ /* @__PURE__ */ jsx216("div", {
22865
+ style: right2,
22866
+ children: "Next composition"
22867
+ })
22868
+ ]
22869
+ }),
22779
22870
  /* @__PURE__ */ jsxs109(Row, {
22780
22871
  align: "center",
22781
22872
  children: [