@remotion/cli 3.2.37 → 3.2.39

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 (42) hide show
  1. package/dist/config/height.d.ts +2 -0
  2. package/dist/config/height.js +15 -0
  3. package/dist/config/log.d.ts +1 -1
  4. package/dist/config/width.d.ts +2 -0
  5. package/dist/config/width.js +17 -0
  6. package/dist/editor/components/Editor.js +1 -2
  7. package/dist/editor/components/GlobalKeybindings.js +5 -1
  8. package/dist/editor/components/KeyboardShortcutsExplainer.d.ts +2 -0
  9. package/dist/editor/components/KeyboardShortcutsExplainer.js +56 -0
  10. package/dist/editor/components/QuickSwitcher/AlgoliaCredit.d.ts +2 -0
  11. package/dist/editor/components/QuickSwitcher/AlgoliaCredit.js +11 -0
  12. package/dist/editor/components/QuickSwitcher/NoResults.d.ts +2 -2
  13. package/dist/editor/components/QuickSwitcher/NoResults.js +6 -1
  14. package/dist/editor/components/QuickSwitcher/QuickSwitcher.d.ts +5 -1
  15. package/dist/editor/components/QuickSwitcher/QuickSwitcher.js +2 -2
  16. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -1
  17. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +115 -27
  18. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
  19. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +26 -8
  20. package/dist/editor/components/QuickSwitcher/agolia-search.d.ts +2 -0
  21. package/dist/editor/components/QuickSwitcher/agolia-search.js +40 -0
  22. package/dist/editor/components/QuickSwitcher/algolia-search.d.ts +29 -0
  23. package/dist/editor/components/QuickSwitcher/algolia-search.js +63 -0
  24. package/dist/editor/helpers/use-menu-structure.js +28 -3
  25. package/dist/editor/state/modals.d.ts +3 -2
  26. package/dist/get-cli-options.d.ts +1 -1
  27. package/dist/get-composition-with-dimension-override.d.ts +10 -0
  28. package/dist/get-composition-with-dimension-override.js +16 -0
  29. package/dist/index.d.ts +1 -1
  30. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.d.ts +1 -0
  31. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.js +3 -3
  32. package/package.json +8 -8
  33. package/dist/check-version.d.ts +0 -1
  34. package/dist/check-version.js +0 -14
  35. package/dist/editor/components/QuickSwitcher.d.ts +0 -3
  36. package/dist/editor/components/QuickSwitcher.js +0 -32
  37. package/dist/editor/helpers/use-menu-toolbar.d.ts +0 -0
  38. package/dist/editor/helpers/use-menu-toolbar.js +0 -1
  39. package/dist/validate-ffmpeg-version.d.ts +0 -3
  40. package/dist/validate-ffmpeg-version.js +0 -17
  41. package/dist/warn-about-ffmpeg-version.d.ts +0 -5
  42. package/dist/warn-about-ffmpeg-version.js +0 -38
@@ -0,0 +1,2 @@
1
+ export declare const setHeight: (newHeight: number) => void;
2
+ export declare const getHeight: () => number | null;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHeight = exports.setHeight = void 0;
4
+ // eslint-disable-next-line no-restricted-imports
5
+ const remotion_1 = require("remotion");
6
+ let specifiedHeight;
7
+ const setHeight = (newHeight) => {
8
+ remotion_1.Internals.validateDimension(newHeight, 'height', 'passed to `setHeight()`');
9
+ specifiedHeight = newHeight;
10
+ };
11
+ exports.setHeight = setHeight;
12
+ const getHeight = () => {
13
+ return specifiedHeight;
14
+ };
15
+ exports.getHeight = getHeight;
@@ -1,3 +1,3 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
- export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
2
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
3
3
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
@@ -0,0 +1,2 @@
1
+ export declare const setWidth: (newWidth: number) => void;
2
+ export declare const getWidth: () => number | null;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWidth = exports.setWidth = void 0;
4
+ // eslint-disable-next-line no-restricted-imports
5
+ const remotion_1 = require("remotion");
6
+ let passedWidth = null;
7
+ const setWidth = (newWidth) => {
8
+ if (typeof newWidth !== 'number') {
9
+ remotion_1.Internals.validateDimension(newWidth, 'width', 'passed to `setWidth()`');
10
+ }
11
+ passedWidth = newWidth;
12
+ };
13
+ exports.setWidth = setWidth;
14
+ const getWidth = () => {
15
+ return passedWidth;
16
+ };
17
+ exports.getWidth = getWidth;
@@ -15,7 +15,6 @@ const z_index_1 = require("../state/z-index");
15
15
  const EditorContent_1 = require("./EditorContent");
16
16
  const FramePersistor_1 = require("./FramePersistor");
17
17
  const GlobalKeybindings_1 = require("./GlobalKeybindings");
18
- const KeyboardShortcutsModal_1 = require("./KeyboardShortcutsModal");
19
18
  const NewComposition_1 = __importDefault(require("./NewComposition/NewComposition"));
20
19
  const NoRegisterRoot_1 = require("./NoRegisterRoot");
21
20
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
@@ -51,6 +50,6 @@ const Editor = () => {
51
50
  }, [Root, waitForRoot]);
52
51
  return ((0, jsx_runtime_1.jsxs)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: [(0, jsx_runtime_1.jsx)(timeline_zoom_1.TimelineZoomContext, { children: (0, jsx_runtime_1.jsxs)("div", { style: background, children: [Root === null ? null : (0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), (0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), Root === null ? (0, jsx_runtime_1.jsx)(NoRegisterRoot_1.NoRegisterRoot, {}) : (0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, {}), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {}), modalContextType && modalContextType.type === 'quick-switcher' && (
53
52
  // Quick switcher here because requires timeline zoom ctx
54
- (0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, {}))] }) }), modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType && modalContextType.type === 'shortcuts' && ((0, jsx_runtime_1.jsx)(KeyboardShortcutsModal_1.KeyboardShortcuts, {}))] }));
53
+ (0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }) }), modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info }))] }));
55
54
  };
56
55
  exports.Editor = Editor;
@@ -27,6 +27,8 @@ const GlobalKeybindings = () => {
27
27
  callback: () => {
28
28
  setSelectedModal({
29
29
  type: 'quick-switcher',
30
+ mode: 'compositions',
31
+ invocationTimestamp: Date.now(),
30
32
  });
31
33
  },
32
34
  commandCtrlKey: true,
@@ -44,7 +46,9 @@ const GlobalKeybindings = () => {
44
46
  key: '?',
45
47
  callback: () => {
46
48
  setSelectedModal({
47
- type: 'shortcuts',
49
+ type: 'quick-switcher',
50
+ mode: 'docs',
51
+ invocationTimestamp: Date.now(),
48
52
  });
49
53
  },
50
54
  commandCtrlKey: false,
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const KeyboardShortcutsExplainer: React.FC;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KeyboardShortcutsExplainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
6
+ const use_keybinding_1 = require("../helpers/use-keybinding");
7
+ const keys_1 = require("../icons/keys");
8
+ const layout_1 = require("./layout");
9
+ const left = {
10
+ width: 85,
11
+ paddingTop: 8,
12
+ paddingBottom: 8,
13
+ };
14
+ const key = {
15
+ background: '#333',
16
+ padding: '3px 6px',
17
+ color: 'white',
18
+ borderRadius: 3,
19
+ border: '1px solid black',
20
+ borderBottomWidth: 3,
21
+ fontSize: 13,
22
+ fontFamily: 'monospace',
23
+ };
24
+ const right = {
25
+ fontSize: 14,
26
+ color: '#eee',
27
+ };
28
+ const container = {
29
+ paddingLeft: 20,
30
+ paddingRight: 40,
31
+ paddingTop: 10,
32
+ paddingBottom: 10,
33
+ };
34
+ const title = {
35
+ fontWeight: 'bold',
36
+ color: 'white',
37
+ fontSize: 14,
38
+ marginBottom: 10,
39
+ };
40
+ const keyboardShortcutsDisabled = {
41
+ padding: 12,
42
+ width: '100%',
43
+ fontSize: 14,
44
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
45
+ };
46
+ const ul = {
47
+ marginTop: 0,
48
+ marginBottom: 0,
49
+ };
50
+ const li = {
51
+ fontSize: 14,
52
+ };
53
+ const KeyboardShortcutsExplainer = () => {
54
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.Preview.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "N" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "New composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard transparency" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] })] })] })] }));
55
+ };
56
+ exports.KeyboardShortcutsExplainer = KeyboardShortcutsExplainer;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AlgoliaCredit: React.FC;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlgoliaCredit = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const link = {
6
+ display: 'inline-flex',
7
+ };
8
+ const AlgoliaCredit = () => {
9
+ return ((0, jsx_runtime_1.jsx)("a", { style: link, href: "https://www.algolia.com/ref/docsearch/?utm_source=www.remotion.dev&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch", target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsx)("svg", { width: "77", height: "19", "aria-label": "Algolia", role: "img", children: (0, jsx_runtime_1.jsx)("path", { d: "M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z", fill: "currentColor", fillRule: "evenodd" }) }) }));
10
+ };
11
+ exports.AlgoliaCredit = AlgoliaCredit;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- export declare type Mode = 'commands' | 'compositions';
2
+ export declare type QuickSwitcherMode = 'commands' | 'compositions' | 'docs';
3
3
  export declare const QuickSwitcherNoResults: React.FC<{
4
4
  query: string;
5
- mode: Mode;
5
+ mode: QuickSwitcherMode;
6
6
  }>;
@@ -9,7 +9,12 @@ const container = {
9
9
  textAlign: 'center',
10
10
  fontSize: 14,
11
11
  };
12
+ const MODE_TO_STRING = {
13
+ commands: 'commands',
14
+ compositions: 'compositions',
15
+ docs: 'documentation',
16
+ };
12
17
  const QuickSwitcherNoResults = ({ query, mode }) => {
13
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: ["No ", mode === 'commands' ? 'commands' : 'compositions', " matching ", '"', query, '"'] }));
18
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: ["No ", MODE_TO_STRING[mode], " matching ", '"', query, '"'] }));
14
19
  };
15
20
  exports.QuickSwitcherNoResults = QuickSwitcherNoResults;
@@ -1,3 +1,7 @@
1
1
  import React from 'react';
2
- declare const QuickSwitcher: React.FC;
2
+ import type { QuickSwitcherMode } from './NoResults';
3
+ declare const QuickSwitcher: React.FC<{
4
+ initialMode: QuickSwitcherMode;
5
+ invocationTimestamp: number;
6
+ }>;
3
7
  export default QuickSwitcher;
@@ -5,12 +5,12 @@ const react_1 = require("react");
5
5
  const modals_1 = require("../../state/modals");
6
6
  const ModalContainer_1 = require("../ModalContainer");
7
7
  const QuickSwitcherContent_1 = require("./QuickSwitcherContent");
8
- const QuickSwitcher = () => {
8
+ const QuickSwitcher = ({ initialMode, invocationTimestamp }) => {
9
9
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
10
10
  const onQuit = (0, react_1.useCallback)(() => {
11
11
  setSelectedModal(null);
12
12
  }, [setSelectedModal]);
13
13
  // Separate child component to correctly capture keybindings
14
- return ((0, jsx_runtime_1.jsx)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: (0, jsx_runtime_1.jsx)(QuickSwitcherContent_1.QuickSwitcherContent, {}) }));
14
+ return ((0, jsx_runtime_1.jsx)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: (0, jsx_runtime_1.jsx)(QuickSwitcherContent_1.QuickSwitcherContent, { invocationTimestamp: invocationTimestamp, initialMode: initialMode }) }));
15
15
  };
16
16
  exports.default = QuickSwitcher;
@@ -1,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const QuickSwitcherContent: React.FC;
2
+ import type { QuickSwitcherMode } from './NoResults';
3
+ export declare const QuickSwitcherContent: React.FC<{
4
+ initialMode: QuickSwitcherMode;
5
+ invocationTimestamp: number;
6
+ }>;
@@ -10,7 +10,10 @@ const use_keybinding_1 = require("../../helpers/use-keybinding");
10
10
  const use_menu_structure_1 = require("../../helpers/use-menu-structure");
11
11
  const modals_1 = require("../../state/modals");
12
12
  const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
13
+ const KeyboardShortcutsExplainer_1 = require("../KeyboardShortcutsExplainer");
13
14
  const layout_1 = require("../layout");
15
+ const algolia_search_1 = require("./algolia-search");
16
+ const AlgoliaCredit_1 = require("./AlgoliaCredit");
14
17
  const fuzzy_search_1 = require("./fuzzy-search");
15
18
  const NoResults_1 = require("./NoResults");
16
19
  const QuickSwitcherResult_1 = require("./QuickSwitcherResult");
@@ -19,9 +22,6 @@ const input = {
19
22
  border: '2px solid ' + colors_1.INPUT_BORDER_COLOR_UNHOVERED,
20
23
  width: '100%',
21
24
  };
22
- const container = {
23
- width: 500,
24
- };
25
25
  const modeSelector = {
26
26
  paddingLeft: 16,
27
27
  paddingRight: 16,
@@ -52,10 +52,9 @@ const content = {
52
52
  paddingRight: 16,
53
53
  paddingTop: 4,
54
54
  paddingBottom: 10,
55
- };
56
- const results = {
57
- overflowY: 'auto',
58
- height: 300,
55
+ display: 'flex',
56
+ flexDirection: 'row',
57
+ alignItems: 'center',
59
58
  };
60
59
  const loopIndex = (index, length) => {
61
60
  if (index < 0) {
@@ -63,25 +62,56 @@ const loopIndex = (index, length) => {
63
62
  }
64
63
  return index % length;
65
64
  };
66
- const QuickSwitcherContent = () => {
65
+ const stripQuery = (query) => {
66
+ if (query.startsWith('>') || query.startsWith('?')) {
67
+ return query.substring(1).trim();
68
+ }
69
+ return query.trim();
70
+ };
71
+ const mapQueryToMode = (query) => {
72
+ return query.startsWith('>')
73
+ ? 'commands'
74
+ : query.startsWith('?')
75
+ ? 'docs'
76
+ : 'compositions';
77
+ };
78
+ const mapModeToQuery = (mode) => {
79
+ if (mode === 'commands') {
80
+ return '> ';
81
+ }
82
+ if (mode === 'compositions') {
83
+ return '';
84
+ }
85
+ if (mode === 'docs') {
86
+ return '? ';
87
+ }
88
+ throw new Error('no mode' + mode);
89
+ };
90
+ const QuickSwitcherContent = ({ initialMode, invocationTimestamp }) => {
67
91
  const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
68
- const [state, setState] = (0, react_1.useState)({
69
- query: '',
70
- selectedIndex: 0,
92
+ const [state, setState] = (0, react_1.useState)(() => {
93
+ return {
94
+ query: mapModeToQuery(initialMode),
95
+ selectedIndex: 0,
96
+ };
71
97
  });
98
+ (0, react_1.useEffect)(() => {
99
+ setState({
100
+ query: mapModeToQuery(initialMode),
101
+ selectedIndex: 0,
102
+ });
103
+ }, [initialMode, invocationTimestamp]);
72
104
  const inputRef = (0, react_1.useRef)(null);
73
105
  const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
74
106
  const closeMenu = (0, react_1.useCallback)(() => undefined, []);
75
107
  const actions = (0, use_menu_structure_1.useMenuStructure)(closeMenu);
108
+ const [docResults, setDocResults] = (0, react_1.useState)({ type: 'initial' });
76
109
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
77
110
  const keybindings = (0, use_keybinding_1.useKeybinding)();
78
- const mode = state.query.startsWith('>') ? 'commands' : 'compositions';
111
+ const mode = mapQueryToMode(state.query);
79
112
  const actualQuery = (0, react_1.useMemo)(() => {
80
- if (mode === 'commands') {
81
- return state.query.substring(1).trim();
82
- }
83
- return state.query.trim();
84
- }, [mode, state.query]);
113
+ return stripQuery(state.query);
114
+ }, [state.query]);
85
115
  const menuActions = (0, react_1.useMemo)(() => {
86
116
  if (mode !== 'commands') {
87
117
  return [];
@@ -92,6 +122,9 @@ const QuickSwitcherContent = () => {
92
122
  if (mode === 'commands') {
93
123
  return (0, fuzzy_search_1.fuzzySearch)(actualQuery, menuActions);
94
124
  }
125
+ if (mode === 'docs' && docResults.type === 'results') {
126
+ return docResults.results;
127
+ }
95
128
  return (0, fuzzy_search_1.fuzzySearch)(actualQuery, compositions.map((c) => {
96
129
  return {
97
130
  id: 'composition-' + c.id,
@@ -106,9 +139,10 @@ const QuickSwitcherContent = () => {
106
139
  }));
107
140
  }, [
108
141
  mode,
109
- compositions,
110
142
  actualQuery,
143
+ compositions,
111
144
  menuActions,
145
+ docResults,
112
146
  selectComposition,
113
147
  setSelectedModal,
114
148
  ]);
@@ -140,6 +174,33 @@ const QuickSwitcherContent = () => {
140
174
  binding.unregister();
141
175
  };
142
176
  }, [keybindings, onArrowDown, onArrowUp]);
177
+ (0, react_1.useEffect)(() => {
178
+ if (mode !== 'docs') {
179
+ return;
180
+ }
181
+ if (actualQuery.trim() === '') {
182
+ setDocResults({ type: 'initial' });
183
+ return;
184
+ }
185
+ let cancelled = false;
186
+ setDocResults({ type: 'loading' });
187
+ (0, algolia_search_1.algoliaSearch)(actualQuery)
188
+ .then((agoliaResults) => {
189
+ if (cancelled) {
190
+ return;
191
+ }
192
+ setDocResults({ type: 'results', results: agoliaResults });
193
+ })
194
+ .catch((err) => {
195
+ if (cancelled) {
196
+ return;
197
+ }
198
+ setDocResults({ type: 'error', error: err });
199
+ });
200
+ return () => {
201
+ cancelled = true;
202
+ };
203
+ }, [actualQuery, mode]);
143
204
  // Arrow down
144
205
  (0, react_1.useEffect)(() => {
145
206
  const binding = keybindings.registerKeybinding({
@@ -158,22 +219,49 @@ const QuickSwitcherContent = () => {
158
219
  const selectedIndexRounded = loopIndex(state.selectedIndex, resultsArray.length);
159
220
  const onActionsSelected = (0, react_1.useCallback)(() => {
160
221
  var _a;
161
- setState({
162
- query: '> ',
222
+ setState((s) => ({
223
+ query: `> ${stripQuery(s.query)}`,
163
224
  selectedIndex: 0,
164
- });
225
+ }));
165
226
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
166
227
  }, []);
167
228
  const onCompositionsSelected = (0, react_1.useCallback)(() => {
168
229
  var _a;
169
- setState({
170
- query: '',
230
+ setState((s) => ({
231
+ query: stripQuery(s.query),
171
232
  selectedIndex: 0,
172
- });
233
+ }));
234
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
235
+ }, []);
236
+ const onDocSearchSelected = (0, react_1.useCallback)(() => {
237
+ var _a;
238
+ setState((s) => ({
239
+ query: `? ${stripQuery(s.query)}`,
240
+ selectedIndex: 0,
241
+ }));
242
+ setDocResults({ type: 'initial' });
173
243
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
174
244
  }, []);
175
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsxs)("div", { style: modeSelector, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onCompositionsSelected, style: mode === 'compositions' ? modeActive : modeInactive, type: "button", children: "Compositions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onActionsSelected, style: mode === 'commands' ? modeActive : modeInactive, type: "button", children: "Actions" })] }), (0, jsx_runtime_1.jsx)("div", { style: content, children: (0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "text", style: input, autoFocus: true, value: state.query, onChange: onTextChange, placeholder: "Search compositions..." }) }), (0, jsx_runtime_1.jsxs)("div", { style: results, children: [resultsArray.map((result, i) => {
176
- return ((0, jsx_runtime_1.jsx)(QuickSwitcherResult_1.QuickSwitcherResult, { selected: selectedIndexRounded === i, result: result }, result.id));
177
- }), resultsArray.length === 0 ? ((0, jsx_runtime_1.jsx)(NoResults_1.QuickSwitcherNoResults, { mode: mode, query: actualQuery })) : null] })] }));
245
+ const showKeyboardShortcuts = mode === 'docs' && actualQuery.trim() === '';
246
+ const showSearchLoadingState = mode === 'docs' && docResults.type === 'loading';
247
+ const container = (0, react_1.useMemo)(() => {
248
+ return {
249
+ width: showKeyboardShortcuts ? 800 : 500,
250
+ };
251
+ }, [showKeyboardShortcuts]);
252
+ const results = (0, react_1.useMemo)(() => {
253
+ if (showKeyboardShortcuts) {
254
+ return {
255
+ maxHeight: 600,
256
+ };
257
+ }
258
+ return {
259
+ overflowY: 'auto',
260
+ height: 300,
261
+ };
262
+ }, [showKeyboardShortcuts]);
263
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsxs)("div", { style: modeSelector, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onCompositionsSelected, style: mode === 'compositions' ? modeActive : modeInactive, type: "button", children: "Compositions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onActionsSelected, style: mode === 'commands' ? modeActive : modeInactive, type: "button", children: "Actions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onDocSearchSelected, style: mode === 'docs' ? modeActive : modeInactive, type: "button", children: "Documentation" })] }), (0, jsx_runtime_1.jsxs)("div", { style: content, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "text", style: input, autoFocus: true, value: state.query, onChange: onTextChange, placeholder: "Search compositions..." }), showKeyboardShortcuts ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), " ", (0, jsx_runtime_1.jsx)(AlgoliaCredit_1.AlgoliaCredit, {})] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: results, children: showKeyboardShortcuts ? ((0, jsx_runtime_1.jsx)(KeyboardShortcutsExplainer_1.KeyboardShortcutsExplainer, {})) : showSearchLoadingState ? null : resultsArray.length === 0 ? ((0, jsx_runtime_1.jsx)(NoResults_1.QuickSwitcherNoResults, { mode: mode, query: actualQuery })) : (resultsArray.map((result, i) => {
264
+ return ((0, jsx_runtime_1.jsx)(QuickSwitcherResult_1.QuickSwitcherResult, { selected: selectedIndexRounded === i, result: result }, result.id));
265
+ })) })] }));
178
266
  };
179
267
  exports.QuickSwitcherContent = QuickSwitcherContent;
@@ -4,6 +4,10 @@ declare type QuickSwitcherResultDetail = {
4
4
  compositionType: 'composition' | 'still';
5
5
  } | {
6
6
  type: 'menu-item';
7
+ } | {
8
+ type: 'search-result';
9
+ titleLine: string;
10
+ subtitleLine: string;
7
11
  };
8
12
  export declare type TQuickSwitcherResult = {
9
13
  title: string;
@@ -11,23 +11,29 @@ const layout_1 = require("../layout");
11
11
  const container = {
12
12
  paddingLeft: 16,
13
13
  paddingRight: 16,
14
- paddingTop: 3,
15
- paddingBottom: 3,
16
14
  display: 'flex',
17
15
  flexDirection: 'row',
18
16
  alignItems: 'center',
19
17
  cursor: 'pointer',
20
18
  };
21
19
  const label = {
22
- flex: 1,
23
20
  whiteSpace: 'nowrap',
24
21
  textOverflow: 'ellipsis',
25
- overflow: 'hidden',
22
+ };
23
+ const searchLabel = {
24
+ ...label,
25
+ lineHeight: 1.25,
26
26
  };
27
27
  const iconStyle = {
28
28
  width: 14,
29
29
  height: 14,
30
30
  };
31
+ const labelContainer = {
32
+ overflow: 'hidden',
33
+ flex: 1,
34
+ paddingTop: 5,
35
+ paddingBottom: 5,
36
+ };
31
37
  const QuickSwitcherResult = ({ result, selected }) => {
32
38
  const [hovered, setIsHovered] = (0, react_1.useState)(false);
33
39
  const ref = (0, react_1.useRef)(null);
@@ -80,11 +86,23 @@ const QuickSwitcherResult = ({ result, selected }) => {
80
86
  }, [hovered, selected]);
81
87
  const labelStyle = (0, react_1.useMemo)(() => {
82
88
  return {
83
- ...label,
84
- color: selected || hovered ? 'white' : colors_1.LIGHT_TEXT,
89
+ ...(result.type === 'search-result' ? searchLabel : label),
90
+ color: result.type === 'search-result'
91
+ ? colors_1.LIGHT_TEXT
92
+ : selected || hovered
93
+ ? 'white'
94
+ : colors_1.LIGHT_TEXT,
85
95
  fontSize: 15,
86
96
  };
87
- }, [hovered, selected]);
88
- return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? ((0, jsx_runtime_1.jsx)(still_1.StillIcon, { style: iconStyle })) : ((0, jsx_runtime_1.jsx)(film_1.FilmIcon, { style: iconStyle }))) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: result.title })] }, result.id));
97
+ }, [hovered, result.type, selected]);
98
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? ((0, jsx_runtime_1.jsx)(still_1.StillIcon, { style: iconStyle })) : ((0, jsx_runtime_1.jsx)(film_1.FilmIcon, { style: iconStyle }))) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelContainer, children: result.type === 'search-result' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: labelStyle,
99
+ // eslint-disable-next-line react/no-danger
100
+ dangerouslySetInnerHTML: {
101
+ __html: result.titleLine,
102
+ } }), (0, jsx_runtime_1.jsx)("div", { style: labelStyle,
103
+ // eslint-disable-next-line react/no-danger
104
+ dangerouslySetInnerHTML: {
105
+ __html: result.subtitleLine,
106
+ } })] })) : ((0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: result.title })) })] }, result.id));
89
107
  };
90
108
  exports.QuickSwitcherResult = QuickSwitcherResult;
@@ -0,0 +1,2 @@
1
+ import type { TQuickSwitcherResult } from './QuickSwitcherResult';
2
+ export declare const agoliaSearch: (query: string) => Promise<TQuickSwitcherResult[]>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agoliaSearch = void 0;
4
+ const AGOLIA_API_KEY = '3e42dbd4f895fe93ff5cf40d860c4a85';
5
+ const AGOLIA_APPLICATION_ID = 'PLSDUOL1CA';
6
+ const AGOLIA_SEARCH_URL = 'https://plsduol1ca-dsn.algolia.net/1/indexes/*/queries';
7
+ const agoliaSearch = async (query) => {
8
+ const url = new URL(AGOLIA_SEARCH_URL);
9
+ url.searchParams.set('x-algolia-agen', encodeURIComponent('Remotion Preview DocSearch'));
10
+ url.searchParams.set('x-algolia-api-key', AGOLIA_API_KEY);
11
+ url.searchParams.set('x-algolia-application-id', AGOLIA_APPLICATION_ID);
12
+ const { results } = await fetch(url.toString(), {
13
+ headers: {
14
+ 'content-type': 'application/x-www-form-urlencoded',
15
+ },
16
+ body: JSON.stringify({
17
+ requests: [
18
+ {
19
+ query,
20
+ indexName: 'remotion',
21
+ params: 'attributesToRetrieve=["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"]&attributesToSnippet=["hierarchy.lvl1:10","hierarchy.lvl2:10","hierarchy.lvl3:10","hierarchy.lvl4:10","hierarchy.lvl5:10","hierarchy.lvl6:10","content:10"]&snippetEllipsisText=…&highlightPreTag=<mark>&highlightPostTag=</mark>&hitsPerPage=20&facetFilters=[]',
22
+ },
23
+ ],
24
+ }),
25
+ method: 'POST',
26
+ }).then((res) => res.json());
27
+ const { hits } = results[0];
28
+ return hits.map((hit) => {
29
+ var _a;
30
+ return ({
31
+ type: 'menu-item',
32
+ id: hit.objectID,
33
+ title: (_a = hit.hierarchy[hit.type]) !== null && _a !== void 0 ? _a : '',
34
+ onSelected: () => {
35
+ window.open(hit.url);
36
+ },
37
+ });
38
+ });
39
+ };
40
+ exports.agoliaSearch = agoliaSearch;
@@ -0,0 +1,29 @@
1
+ import type { TQuickSwitcherResult } from './QuickSwitcherResult';
2
+ declare type Levels = 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6';
3
+ export declare type Match = {
4
+ value: string;
5
+ matchLevel: 'none' | 'partial' | 'full';
6
+ };
7
+ declare type DynamicHit = {
8
+ type: 'content';
9
+ _highlightResult: {
10
+ content: Match;
11
+ hierarchy: Record<Levels, Match>;
12
+ };
13
+ } | {
14
+ type: Levels;
15
+ _highlightResult: {
16
+ hierarchy: Record<Levels, Match>;
17
+ };
18
+ };
19
+ declare type Hit = {
20
+ url: string;
21
+ hierarchy: Record<Levels, string | null>;
22
+ objectID: string;
23
+ } & DynamicHit;
24
+ export declare const algoliaSearch: (query: string) => Promise<TQuickSwitcherResult[]>;
25
+ export declare const splitMatchIntoTitleAndSubtitle: (match: Hit) => {
26
+ title: string;
27
+ subtitle: string;
28
+ };
29
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.splitMatchIntoTitleAndSubtitle = exports.algoliaSearch = void 0;
4
+ const truthy_1 = require("../../../truthy");
5
+ const ALGOLIA_API_KEY = '3e42dbd4f895fe93ff5cf40d860c4a85';
6
+ const ALGOLIA_APPLICATION_ID = 'PLSDUOL1CA';
7
+ const AGOLIA_SEARCH_URL = 'https://plsduol1ca-dsn.algolia.net/1/indexes/*/queries';
8
+ const algoliaSearch = async (query) => {
9
+ const url = new URL(AGOLIA_SEARCH_URL);
10
+ url.searchParams.set('x-algolia-agen', encodeURIComponent('Remotion Preview DocSearch'));
11
+ url.searchParams.set('x-algolia-api-key', ALGOLIA_API_KEY);
12
+ url.searchParams.set('x-algolia-application-id', ALGOLIA_APPLICATION_ID);
13
+ const { results } = await fetch(url.toString(), {
14
+ headers: {
15
+ 'content-type': 'application/x-www-form-urlencoded',
16
+ },
17
+ body: JSON.stringify({
18
+ requests: [
19
+ {
20
+ query,
21
+ indexName: 'remotion',
22
+ params: 'attributesToRetrieve=["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"]&attributesToSnippet=["hierarchy.lvl1:10","hierarchy.lvl2:10","hierarchy.lvl3:10","hierarchy.lvl4:10","hierarchy.lvl5:10","hierarchy.lvl6:10","content:10"]&hitsPerPage=20',
23
+ },
24
+ ],
25
+ }),
26
+ method: 'POST',
27
+ }).then((res) => res.json());
28
+ const { hits } = results[0];
29
+ return hits
30
+ .map((hit) => {
31
+ var _a;
32
+ const entries = Object.values(hit._highlightResult.hierarchy);
33
+ const result = (_a = entries.find((value) => value.matchLevel === 'full')) !== null && _a !== void 0 ? _a : entries.find((value) => value.matchLevel === 'partial');
34
+ const { subtitle, title } = (0, exports.splitMatchIntoTitleAndSubtitle)(hit);
35
+ if (!result) {
36
+ return null;
37
+ }
38
+ return {
39
+ type: 'search-result',
40
+ id: hit.objectID,
41
+ title: 'Should not display',
42
+ titleLine: title,
43
+ subtitleLine: subtitle,
44
+ onSelected: () => {
45
+ window.open(hit.url);
46
+ },
47
+ };
48
+ })
49
+ .filter(truthy_1.truthy);
50
+ };
51
+ exports.algoliaSearch = algoliaSearch;
52
+ const splitMatchIntoTitleAndSubtitle = (match) => {
53
+ const main = match.type === 'content'
54
+ ? match._highlightResult.content
55
+ : match._highlightResult.hierarchy[match.type];
56
+ const title = main.value;
57
+ const subtitle = Object.entries(match._highlightResult.hierarchy)
58
+ .filter(([level]) => level !== match.type)
59
+ .map((value) => value[1].value)
60
+ .join(' • ');
61
+ return { title, subtitle };
62
+ };
63
+ exports.splitMatchIntoTitleAndSubtitle = splitMatchIntoTitleAndSubtitle;
@@ -4,6 +4,7 @@ exports.makeSearchResults = exports.useMenuStructure = 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");
7
+ const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
7
8
  const truthy_1 = require("../../truthy");
8
9
  const layout_1 = require("../components/layout");
9
10
  const SizeSelector_1 = require("../components/SizeSelector");
@@ -199,7 +200,7 @@ const useMenuStructure = (closeMenu) => {
199
200
  subMenu: null,
200
201
  type: 'item',
201
202
  value: 'expanded',
202
- quickSwitcherLabel: null,
203
+ quickSwitcherLabel: 'Expand',
203
204
  },
204
205
  {
205
206
  id: 'sidebar-collapsed',
@@ -212,7 +213,7 @@ const useMenuStructure = (closeMenu) => {
212
213
  subMenu: null,
213
214
  type: 'item',
214
215
  value: 'collapsed',
215
- quickSwitcherLabel: null,
216
+ quickSwitcherLabel: 'Collapse',
216
217
  },
217
218
  ],
218
219
  },
@@ -292,6 +293,28 @@ const useMenuStructure = (closeMenu) => {
292
293
  id: 'in-out-divider',
293
294
  type: 'divider',
294
295
  },
296
+ {
297
+ id: 'quick-switcher',
298
+ keyHint: `${ShortcutHint_1.cmdOrCtrlCharacter}+K`,
299
+ label: 'Quick Switcher',
300
+ onClick: () => {
301
+ closeMenu();
302
+ setSelectedModal({
303
+ type: 'quick-switcher',
304
+ mode: 'compositions',
305
+ invocationTimestamp: Date.now(),
306
+ });
307
+ },
308
+ type: 'item',
309
+ value: 'quick-switcher',
310
+ leftItem: null,
311
+ subMenu: null,
312
+ quickSwitcherLabel: 'Switch composition',
313
+ },
314
+ {
315
+ id: 'in-out-divider',
316
+ type: 'divider',
317
+ },
295
318
  {
296
319
  id: 'in-mark',
297
320
  keyHint: 'I',
@@ -374,7 +397,9 @@ const useMenuStructure = (closeMenu) => {
374
397
  onClick: () => {
375
398
  closeMenu();
376
399
  setSelectedModal({
377
- type: 'shortcuts',
400
+ type: 'quick-switcher',
401
+ mode: 'docs',
402
+ invocationTimestamp: Date.now(),
378
403
  });
379
404
  },
380
405
  keyHint: '?',
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
2
3
  import type { UpdateInfo } from '../components/UpdateCheck';
3
4
  export declare type CompType = 'composition' | 'still';
4
5
  export declare type ModalState = {
@@ -9,8 +10,8 @@ export declare type ModalState = {
9
10
  info: UpdateInfo;
10
11
  } | {
11
12
  type: 'quick-switcher';
12
- } | {
13
- type: 'shortcuts';
13
+ mode: QuickSwitcherMode;
14
+ invocationTimestamp: number;
14
15
  };
15
16
  export declare type ModalContextType = {
16
17
  selectedModal: ModalState | null;
@@ -31,7 +31,7 @@ export declare const getCliOptions: (options: {
31
31
  browserExecutable: BrowserExecutable;
32
32
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
33
33
  ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
34
- logLevel: "error" | "verbose" | "info" | "warn";
34
+ logLevel: "verbose" | "info" | "warn" | "error";
35
35
  scale: number;
36
36
  chromiumOptions: ChromiumOptions;
37
37
  overwrite: boolean;
@@ -0,0 +1,10 @@
1
+ import type { TCompMetadata } from 'remotion';
2
+ export declare const getCompositionWithDimensionOverride: ({ validCompositions, height, width, }: {
3
+ validCompositions: TCompMetadata[];
4
+ height: number | null;
5
+ width: number | null;
6
+ }) => Promise<{
7
+ compositionId: string;
8
+ reason: string;
9
+ config: TCompMetadata;
10
+ }>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCompositionWithDimensionOverride = void 0;
4
+ const get_composition_id_1 = require("./get-composition-id");
5
+ const getCompositionWithDimensionOverride = async ({ validCompositions, height, width, }) => {
6
+ const returnValue = await (0, get_composition_id_1.getCompositionId)(validCompositions);
7
+ return {
8
+ ...returnValue,
9
+ config: {
10
+ ...returnValue.config,
11
+ height: height !== null && height !== void 0 ? height : returnValue.config.height,
12
+ width: width !== null && width !== void 0 ? width : returnValue.config.width,
13
+ },
14
+ };
15
+ };
16
+ exports.getCompositionWithDimensionOverride = getCompositionWithDimensionOverride;
package/dist/index.d.ts CHANGED
@@ -90,7 +90,7 @@ export declare const CliInternals: {
90
90
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
91
91
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
92
92
  ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
93
- logLevel: "error" | "verbose" | "info" | "warn";
93
+ logLevel: "verbose" | "info" | "warn" | "error";
94
94
  scale: number;
95
95
  chromiumOptions: import("@remotion/renderer").ChromiumOptions;
96
96
  overwrite: boolean;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export declare const cmdOrCtrlCharacter: string;
2
3
  export declare const ShortcutHint: React.FC<{
3
4
  keyToPress: string;
4
5
  cmdOrCtrl: boolean;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShortcutHint = void 0;
3
+ exports.ShortcutHint = exports.cmdOrCtrlCharacter = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const cmdOrCtrlCharacter = window.navigator.platform.startsWith('Mac')
5
+ exports.cmdOrCtrlCharacter = window.navigator.platform.startsWith('Mac')
6
6
  ? '⌘'
7
7
  : 'Ctrl';
8
8
  const container = {
@@ -11,6 +11,6 @@ const container = {
11
11
  opacity: 0.6,
12
12
  };
13
13
  const ShortcutHint = ({ keyToPress, cmdOrCtrl }) => {
14
- return ((0, jsx_runtime_1.jsxs)("span", { style: container, children: [cmdOrCtrl ? `${cmdOrCtrlCharacter}+` : '', keyToPress.toUpperCase()] }));
14
+ return ((0, jsx_runtime_1.jsxs)("span", { style: container, children: [cmdOrCtrl ? `${exports.cmdOrCtrlCharacter}+` : '', keyToPress.toUpperCase()] }));
15
15
  };
16
16
  exports.ShortcutHint = ShortcutHint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.2.37",
3
+ "version": "3.2.39",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -22,16 +22,16 @@
22
22
  "author": "Jonny Burger <jonny@remotion.dev>",
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "dependencies": {
25
- "@remotion/bundler": "3.2.37",
26
- "@remotion/media-utils": "3.2.37",
27
- "@remotion/player": "3.2.37",
28
- "@remotion/renderer": "3.2.37",
25
+ "@remotion/bundler": "3.2.39",
26
+ "@remotion/media-utils": "3.2.39",
27
+ "@remotion/player": "3.2.39",
28
+ "@remotion/renderer": "3.2.39",
29
29
  "better-opn": "2.1.1",
30
30
  "dotenv": "9.0.2",
31
31
  "memfs": "3.4.3",
32
32
  "minimist": "1.2.6",
33
33
  "prompts": "2.4.1",
34
- "remotion": "3.2.37",
34
+ "remotion": "3.2.39",
35
35
  "semver": "7.3.5",
36
36
  "source-map": "0.6.1"
37
37
  },
@@ -44,7 +44,7 @@
44
44
  "@types/minimist": "^1.2.2",
45
45
  "@types/node": "^16.7.5",
46
46
  "@types/prompts": "^2.4.1",
47
- "@types/react": "18.0.1",
47
+ "@types/react": "18.0.23",
48
48
  "@types/react-dom": "18.0.0",
49
49
  "@types/semver": "^7.3.4",
50
50
  "@types/webpack-env": "^1.16.0",
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "b4b40f35b14bac31fbee5d35b95e7fad9f464c94"
75
+ "gitHead": "406632092cb2b96ac34d489808283508298c4e1f"
76
76
  }
@@ -1 +0,0 @@
1
- export declare const checkNodeVersion: () => void;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkNodeVersion = void 0;
4
- const log_1 = require("./log");
5
- const semver = require('semver');
6
- const current = process.version;
7
- const supported = '>=12.10.0';
8
- const checkNodeVersion = () => {
9
- if (!semver.satisfies(current, supported)) {
10
- log_1.Log.warn(`Required node version ${supported} not satisfied with current version ${current}.`);
11
- log_1.Log.warn(`Update your node version to ${supported}`);
12
- }
13
- };
14
- exports.checkNodeVersion = checkNodeVersion;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const QuickSwitcher: React.FC<{}>;
3
- export default QuickSwitcher;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const remotion_1 = require("remotion");
6
- const colors_1 = require("../helpers/colors");
7
- const modals_1 = require("../state/modals");
8
- const ModalContainer_1 = require("./ModalContainer");
9
- const input = {
10
- padding: 4,
11
- border: '2px solid ' + colors_1.INPUT_BORDER_COLOR_UNHOVERED,
12
- width: '100%',
13
- };
14
- const content = {
15
- padding: 16,
16
- minWidth: 500,
17
- };
18
- const results = {
19
- overflowY: 'auto',
20
- maxHeight: 300,
21
- };
22
- const QuickSwitcher = (props) => {
23
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
24
- const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
25
- const onQuit = (0, react_1.useCallback)(() => {
26
- setSelectedModal(null);
27
- }, [setSelectedModal]);
28
- return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)("div", { style: content, children: (0, jsx_runtime_1.jsx)("input", { type: "text", style: input, autoFocus: true, placeholder: "Search compositions and commands" }) }), (0, jsx_runtime_1.jsx)("div", { style: results, children: compositions.map((c) => {
29
- return (0, jsx_runtime_1.jsx)("div", { children: c.id }, c.id);
30
- }) })] }));
31
- };
32
- exports.default = QuickSwitcher;
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,3 +0,0 @@
1
- export declare const checkAndValidateFfmpegVersion: (options: {
2
- ffmpegExecutable: string | null;
3
- }) => Promise<void>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkAndValidateFfmpegVersion = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const log_1 = require("./log");
6
- const warn_about_ffmpeg_version_1 = require("./warn-about-ffmpeg-version");
7
- const checkAndValidateFfmpegVersion = async (options) => {
8
- const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
9
- ffmpegExecutable: options.ffmpegExecutable,
10
- });
11
- const buildConf = await renderer_1.RenderInternals.getFfmpegBuildInfo({
12
- ffmpegExecutable: options.ffmpegExecutable,
13
- });
14
- log_1.Log.verbose('Your FFMPEG version:', ffmpegVersion ? ffmpegVersion.join('.') : 'Built from source');
15
- (0, warn_about_ffmpeg_version_1.warnAboutFfmpegVersion)({ ffmpegVersion, buildConf });
16
- };
17
- exports.checkAndValidateFfmpegVersion = checkAndValidateFfmpegVersion;
@@ -1,5 +0,0 @@
1
- import type { FfmpegVersion } from '@remotion/renderer';
2
- export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
3
- ffmpegVersion: FfmpegVersion;
4
- buildConf: string | null;
5
- }) => null | undefined;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warnAboutFfmpegVersion = void 0;
4
- const log_1 = require("./log");
5
- const printMessage = (ffmpegVersion) => {
6
- log_1.Log.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
7
- log_1.Log.warn(' For audio support, you need at least version 4.1.0.');
8
- log_1.Log.warn(' Upgrade FFMPEG to get rid of this warning.');
9
- };
10
- const printBuildConfMessage = () => {
11
- log_1.Log.error('⚠️ Unsupported FFMPEG version detected.');
12
- log_1.Log.error(" Your version doesn't support the -buildconf flag");
13
- log_1.Log.error(' Audio will not be supported and you may experience other issues.');
14
- log_1.Log.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
15
- };
16
- const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
17
- if (buildConf === null) {
18
- printBuildConfMessage();
19
- return;
20
- }
21
- if (ffmpegVersion === null) {
22
- return null;
23
- }
24
- const [major, minor] = ffmpegVersion;
25
- // 3.x and below definitely is too old
26
- if (major < 4) {
27
- printMessage(ffmpegVersion);
28
- return;
29
- }
30
- // 5.x will be all good
31
- if (major > 4) {
32
- return;
33
- }
34
- if (minor < 1) {
35
- printMessage(ffmpegVersion);
36
- }
37
- };
38
- exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;