@remotion/cli 3.3.1 → 3.3.3

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 (65) hide show
  1. package/dist/compositions.js +2 -44
  2. package/dist/config/index.js +2 -0
  3. package/dist/config/number-of-shared-audio-tags.d.ts +2 -0
  4. package/dist/config/number-of-shared-audio-tags.js +12 -0
  5. package/dist/editor/components/RenderButton.d.ts +6 -0
  6. package/dist/editor/components/RenderButton.js +53 -0
  7. package/dist/editor/components/RenderModal/RenderModal.d.ts +5 -0
  8. package/dist/editor/components/RenderModal/RenderModal.js +90 -0
  9. package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +5 -0
  10. package/dist/editor/components/RenderQueue/RenderQueueItem.js +25 -0
  11. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.d.ts +5 -0
  12. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +19 -0
  13. package/dist/editor/components/RenderQueue/RenderQueueOutputName.d.ts +5 -0
  14. package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +70 -0
  15. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.d.ts +5 -0
  16. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +56 -0
  17. package/dist/editor/components/RenderQueue/context.d.ts +18 -0
  18. package/dist/editor/components/RenderQueue/context.js +49 -0
  19. package/dist/editor/components/RenderQueue/index.d.ts +2 -0
  20. package/dist/editor/components/RenderQueue/index.js +18 -0
  21. package/dist/editor/components/RendersTab.d.ts +6 -0
  22. package/dist/editor/components/RendersTab.js +40 -0
  23. package/dist/editor/components/SidebarContent.d.ts +5 -0
  24. package/dist/editor/components/SidebarContent.js +34 -0
  25. package/dist/editor/components/Tabs/index.d.ts +11 -0
  26. package/dist/editor/components/Tabs/index.js +49 -0
  27. package/dist/editor/icons/render.d.ts +6 -0
  28. package/dist/editor/icons/render.js +8 -0
  29. package/dist/get-default-out-name.d.ts +4 -0
  30. package/dist/get-default-out-name.js +8 -0
  31. package/dist/index.d.ts +4 -1
  32. package/dist/index.js +2 -0
  33. package/dist/parse-command-line.d.ts +8 -2
  34. package/dist/preview-server/live-event-listener.d.ts +0 -0
  35. package/dist/preview-server/live-event-listener.js +1 -0
  36. package/dist/preview-server/parse-body.d.ts +2 -0
  37. package/dist/preview-server/parse-body.js +16 -0
  38. package/dist/preview-server/render-queue/add-render.d.ts +2 -0
  39. package/dist/preview-server/render-queue/add-render.js +39 -0
  40. package/dist/preview-server/render-queue/index.d.ts +7 -0
  41. package/dist/preview-server/render-queue/index.js +105 -0
  42. package/dist/preview-server/render-queue/job.d.ts +29 -0
  43. package/dist/preview-server/render-queue/job.js +2 -0
  44. package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +1 -0
  45. package/dist/preview-server/render-queue/open-directory-in-finder.js +32 -0
  46. package/dist/preview-server/render-queue/open-in-file-explorer.d.ts +2 -0
  47. package/dist/preview-server/render-queue/open-in-file-explorer.js +30 -0
  48. package/dist/preview-server/render-queue/remove-render.d.ts +2 -0
  49. package/dist/preview-server/render-queue/remove-render.js +28 -0
  50. package/dist/preview-server/routes.js +4 -0
  51. package/dist/previewEntry.js +1 -1
  52. package/dist/print-compositions.d.ts +2 -0
  53. package/dist/print-compositions.js +50 -0
  54. package/dist/progress-bar.d.ts +13 -1
  55. package/dist/progress-bar.js +41 -2
  56. package/dist/setup-cache.js +52 -5
  57. package/package.json +7 -7
  58. package/dist/deps.d.ts +0 -2
  59. package/dist/deps.js +0 -36
  60. package/dist/editor/components/KeyboardShortcutsModal.d.ts +0 -2
  61. package/dist/editor/components/KeyboardShortcutsModal.js +0 -67
  62. package/dist/editor/components/QuickSwitcher/agolia-search.d.ts +0 -2
  63. package/dist/editor/components/QuickSwitcher/agolia-search.js +0 -40
  64. package/dist/remotion-cli.d.ts +0 -1
  65. package/dist/remotion-cli.js +0 -15
@@ -24,18 +24,54 @@ exports.bundleOnCliOrTakeServeUrl = bundleOnCliOrTakeServeUrl;
24
24
  const bundleOnCli = async ({ fullPath, steps, remotionRoot, publicDir, }) => {
25
25
  var _a;
26
26
  const shouldCache = config_1.ConfigInternals.getWebpackCaching();
27
+ const symlinkState = {
28
+ symlinks: [],
29
+ };
27
30
  const onProgress = (progress) => {
28
- bundlingProgress.update((0, progress_bar_1.makeBundlingProgress)({
31
+ bundlingState = {
29
32
  progress: progress / 100,
30
33
  steps,
31
34
  doneIn: null,
35
+ };
36
+ bundlingProgress.update((0, progress_bar_1.makeBundlingAndCopyProgress)({
37
+ bundling: bundlingState,
38
+ copying: copyingState,
39
+ symLinks: symlinkState,
32
40
  }));
33
41
  };
42
+ let copyingState = {
43
+ bytes: 0,
44
+ doneIn: null,
45
+ };
46
+ let copyStart = null;
47
+ const updateProgress = (newline) => {
48
+ bundlingProgress.update((0, progress_bar_1.makeBundlingAndCopyProgress)({
49
+ bundling: bundlingState,
50
+ copying: copyingState,
51
+ symLinks: symlinkState,
52
+ }) + (newline ? '\n' : ''));
53
+ };
54
+ const onPublicDirCopyProgress = (bytes) => {
55
+ if (copyStart === null) {
56
+ copyStart = Date.now();
57
+ }
58
+ copyingState = {
59
+ bytes,
60
+ doneIn: null,
61
+ };
62
+ updateProgress(false);
63
+ };
64
+ const onSymlinkDetected = (absPath) => {
65
+ symlinkState.symlinks.push(absPath);
66
+ updateProgress(false);
67
+ };
34
68
  const options = {
35
69
  enableCaching: shouldCache,
36
70
  webpackOverride: (_a = config_1.ConfigInternals.getWebpackOverrideFn()) !== null && _a !== void 0 ? _a : ((f) => f),
37
71
  rootDir: remotionRoot,
38
72
  publicDir,
73
+ onPublicDirCopyProgress,
74
+ onSymlinkDetected,
39
75
  };
40
76
  const [hash] = bundler_1.BundlerInternals.getConfig({
41
77
  outDir: '',
@@ -55,22 +91,33 @@ const bundleOnCli = async ({ fullPath, steps, remotionRoot, publicDir, }) => {
55
91
  }
56
92
  const bundleStartTime = Date.now();
57
93
  const bundlingProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
94
+ let bundlingState = {
95
+ progress: 0,
96
+ steps,
97
+ doneIn: null,
98
+ };
58
99
  const bundled = await (0, bundler_1.bundle)({
59
100
  entryPoint: fullPath,
60
101
  onProgress: (progress) => {
61
- bundlingProgress.update((0, progress_bar_1.makeBundlingProgress)({
102
+ bundlingState = {
62
103
  progress: progress / 100,
63
104
  steps,
64
105
  doneIn: null,
65
- }));
106
+ };
107
+ updateProgress(false);
66
108
  },
67
109
  ...options,
68
110
  });
69
- bundlingProgress.update((0, progress_bar_1.makeBundlingProgress)({
111
+ bundlingState = {
70
112
  progress: 1,
71
113
  steps,
72
114
  doneIn: Date.now() - bundleStartTime,
73
- }) + '\n');
115
+ };
116
+ copyingState = {
117
+ ...copyingState,
118
+ doneIn: copyStart ? Date.now() - copyStart : null,
119
+ };
120
+ updateProgress(true);
74
121
  log_1.Log.verbose('Bundled under', bundled);
75
122
  const cacheExistedAfter = bundler_1.BundlerInternals.cacheExists(remotionRoot, 'production', hash) === 'exists';
76
123
  if (cacheExistedAfter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
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.3.1",
26
- "@remotion/media-utils": "3.3.1",
27
- "@remotion/player": "3.3.1",
28
- "@remotion/renderer": "3.3.1",
25
+ "@remotion/bundler": "3.3.3",
26
+ "@remotion/media-utils": "3.3.3",
27
+ "@remotion/player": "3.3.3",
28
+ "@remotion/renderer": "3.3.3",
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.3.1",
34
+ "remotion": "3.3.3",
35
35
  "semver": "7.3.5",
36
36
  "source-map": "0.6.1"
37
37
  },
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "f56a29f8ab19e279e1a9950d3a3ccbb3c8ae42e0"
75
+ "gitHead": "27db3bbb7b8bd67aa3767e55c5c8f21a8d9fa16b"
76
76
  }
package/dist/deps.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const INSTALL_COMMAND: "install";
2
- export declare const installCommand: (remotionRoot: string, args: string[]) => Promise<void>;
package/dist/deps.js DELETED
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installCommand = exports.INSTALL_COMMAND = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const log_1 = require("./log");
6
- exports.INSTALL_COMMAND = 'install';
7
- const installCommand = async (remotionRoot, args) => {
8
- const firstArg = args[0];
9
- if (firstArg === 'ffmpeg') {
10
- const { wasAlreadyInstalled } = await (0, renderer_1.ensureFfmpeg)({ remotionRoot });
11
- if (wasAlreadyInstalled) {
12
- log_1.Log.info('FFmpeg is already installed');
13
- }
14
- else {
15
- log_1.Log.info('Successfully installed FFmpeg');
16
- }
17
- return;
18
- }
19
- if (firstArg === 'ffprobe') {
20
- const { wasAlreadyInstalled } = await (0, renderer_1.ensureFfprobe)({ remotionRoot });
21
- if (wasAlreadyInstalled) {
22
- log_1.Log.info('FFmpeg is already installed');
23
- }
24
- else {
25
- log_1.Log.info('Successfully installed FFmpeg');
26
- }
27
- return;
28
- }
29
- log_1.Log.error('Please specify either "ffmpeg" or "ffprobe" as the first argument to the install command');
30
- log_1.Log.error();
31
- log_1.Log.info('Example Usage: ');
32
- log_1.Log.info(' remotion install ffmpeg');
33
- log_1.Log.info(' remotion install ffprobe');
34
- process.exit(1);
35
- };
36
- exports.installCommand = installCommand;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const KeyboardShortcuts: React.FC;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeyboardShortcuts = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const use_keybinding_1 = require("../helpers/use-keybinding");
7
- const keys_1 = require("../icons/keys");
8
- const modals_1 = require("../state/modals");
9
- const layout_1 = require("./layout");
10
- const ModalContainer_1 = require("./ModalContainer");
11
- const ModalHeader_1 = require("./ModalHeader");
12
- const left = {
13
- width: 100,
14
- paddingTop: 8,
15
- paddingBottom: 8,
16
- };
17
- const shortLeft = {
18
- ...left,
19
- width: 40,
20
- };
21
- const key = {
22
- background: '#333',
23
- padding: '3px 6px',
24
- color: 'white',
25
- borderRadius: 3,
26
- border: '1px solid black',
27
- borderBottomWidth: 3,
28
- fontSize: 13,
29
- fontFamily: 'monospace',
30
- };
31
- const right = {
32
- fontSize: 14,
33
- color: '#eee',
34
- };
35
- const container = {
36
- paddingLeft: 20,
37
- paddingRight: 40,
38
- paddingTop: 10,
39
- paddingBottom: 10,
40
- };
41
- const title = {
42
- fontWeight: 'bold',
43
- color: 'white',
44
- fontSize: 14,
45
- marginBottom: 10,
46
- };
47
- const keyboardShortcutsDisabled = {
48
- padding: 12,
49
- width: '100%',
50
- fontSize: 14,
51
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
52
- };
53
- const ul = {
54
- marginTop: 0,
55
- marginBottom: 0,
56
- };
57
- const li = {
58
- fontSize: 14,
59
- };
60
- const KeyboardShortcuts = () => {
61
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
62
- const onQuit = (0, react_1.useCallback)(() => {
63
- setSelectedModal(null);
64
- }, [setSelectedModal]);
65
- return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onEscape: onQuit, onOutsideClick: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "Keyboard shortcuts" }), (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.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (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.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (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)(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: shortLeft, 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: shortLeft, 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: shortLeft, 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.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: shortLeft, 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: shortLeft, 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: shortLeft, 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: shortLeft, 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: shortLeft, 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: shortLeft, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] })] })] })] }));
66
- };
67
- exports.KeyboardShortcuts = KeyboardShortcuts;
@@ -1,2 +0,0 @@
1
- import type { TQuickSwitcherResult } from './QuickSwitcherResult';
2
- export declare const agoliaSearch: (query: string) => Promise<TQuickSwitcherResult[]>;
@@ -1,40 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const dotenv_1 = __importDefault(require("dotenv"));
7
- const index_tsx_1 = require("./index.tsx");
8
- dotenv_1.default.config();
9
- (0, index_tsx_1.cli)()
10
- .then(() => process.exit(0))
11
- .catch((err) => {
12
- // eslint-disable-next-line no-console
13
- console.error(err);
14
- process.exit(1);
15
- });