@remotion/studio 4.0.355 → 4.0.357

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 (30) hide show
  1. package/.turbo/turbo-make.log +2 -2
  2. package/dist/components/RenderModal/layout.js +1 -1
  3. package/dist/error-overlay/remotion-overlay/CompositionIdListItem.d.ts +9 -0
  4. package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +33 -0
  5. package/dist/error-overlay/remotion-overlay/CompositionIdsDropdown.d.ts +5 -0
  6. package/dist/error-overlay/remotion-overlay/CompositionIdsDropdown.js +103 -0
  7. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +11 -1
  8. package/dist/error-overlay/remotion-overlay/carets.d.ts +4 -1
  9. package/dist/error-overlay/remotion-overlay/carets.js +4 -4
  10. package/dist/esm/chunk-4pe36a6v.js +46840 -0
  11. package/dist/esm/chunk-6jf1natv.js +25 -0
  12. package/dist/esm/chunk-9b7dmaxn.js +47029 -0
  13. package/dist/esm/chunk-arzxf57z.js +47030 -0
  14. package/dist/esm/chunk-avss9483.js +47028 -0
  15. package/dist/esm/chunk-bgfkgcmg.js +25 -0
  16. package/dist/esm/chunk-ckeskzn9.js +46840 -0
  17. package/dist/esm/chunk-ckv2bvaf.js +46840 -0
  18. package/dist/esm/chunk-ec8ke7ka.js +47031 -0
  19. package/dist/esm/chunk-genqsbxw.js +46840 -0
  20. package/dist/esm/chunk-gsv9zjt5.js +47029 -0
  21. package/dist/esm/chunk-h26rhase.js +47029 -0
  22. package/dist/esm/chunk-jz78ytrt.js +47027 -0
  23. package/dist/esm/internals.mjs +2725 -2536
  24. package/dist/esm/previewEntry.mjs +2739 -2550
  25. package/dist/esm/renderEntry.mjs +2 -2
  26. package/dist/helpers/inject-css.js +2 -0
  27. package/dist/helpers/use-max-media-duration.d.ts +1 -1
  28. package/dist/helpers/use-max-media-duration.js +4 -3
  29. package/package.json +11 -11
  30. package/tsconfig.tsbuildinfo +1 -1
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @remotion/studio@4.0.355 make /Users/jonathanburger/remotion/packages/studio
3
+ > @remotion/studio@4.0.357 make /Users/jonathanburger/remotion/packages/studio
4
4
  > tsc -d && bun --env-file=../.env.bundle bundle.ts
5
5
 
6
- [344.69ms] Generated.
6
+ [55.83ms] Generated.
@@ -12,7 +12,7 @@ exports.optionRow = {
12
12
  paddingBottom: 8,
13
13
  };
14
14
  exports.label = {
15
- width: 220,
15
+ width: 260,
16
16
  fontSize: 15,
17
17
  lineHeight: '40px',
18
18
  color: colors_1.LIGHT_TEXT,
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare const listItemStyle: React.CSSProperties;
3
+ export declare const listItemActiveStyle: React.CSSProperties;
4
+ export declare const listItemHoverStyle: React.CSSProperties;
5
+ export declare const CompositionIdListItem: React.FC<{
6
+ readonly id: string;
7
+ readonly isActive?: boolean;
8
+ readonly onSelect: (id: string) => void;
9
+ }>;
@@ -0,0 +1,33 @@
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
+ exports.CompositionIdListItem = exports.listItemHoverStyle = exports.listItemActiveStyle = exports.listItemStyle = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = __importDefault(require("react"));
9
+ const colors_1 = require("../../helpers/colors");
10
+ exports.listItemStyle = {
11
+ padding: 8,
12
+ cursor: 'pointer',
13
+ borderRadius: 4,
14
+ lineHeight: 1.4,
15
+ color: colors_1.TEXT_COLOR,
16
+ fontFamily: 'inherit',
17
+ fontSize: 14,
18
+ };
19
+ exports.listItemActiveStyle = {
20
+ backgroundColor: colors_1.SELECTED_BACKGROUND,
21
+ };
22
+ exports.listItemHoverStyle = {
23
+ backgroundColor: colors_1.CLEAR_HOVER,
24
+ };
25
+ const CompositionIdListItem = ({ id, isActive, onSelect }) => {
26
+ const [hover, setHover] = react_1.default.useState(false);
27
+ return ((0, jsx_runtime_1.jsx)("div", { role: "button", onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), onClick: () => onSelect(id), style: {
28
+ ...exports.listItemStyle,
29
+ ...(hover ? exports.listItemHoverStyle : {}),
30
+ ...(isActive ? exports.listItemActiveStyle : {}),
31
+ }, title: id, children: id }));
32
+ };
33
+ exports.CompositionIdListItem = CompositionIdListItem;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const CompositionIdsDropdown: React.FC<{
3
+ readonly compositionIds: readonly string[];
4
+ readonly currentId?: string | null;
5
+ }>;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompositionIdsDropdown = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const Button_1 = require("../../components/Button");
7
+ const colors_1 = require("../../helpers/colors");
8
+ const CompositionIdListItem_1 = require("./CompositionIdListItem");
9
+ const carets_1 = require("./carets");
10
+ const containerStyle = {
11
+ display: 'inline-block',
12
+ position: 'relative',
13
+ };
14
+ // Button styling provided by shared Button component
15
+ const dropdownStyle = {
16
+ position: 'absolute',
17
+ top: '110%',
18
+ left: 0,
19
+ width: 320,
20
+ maxHeight: 300,
21
+ overflowY: 'auto',
22
+ backgroundColor: colors_1.INPUT_BACKGROUND,
23
+ border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
24
+ borderRadius: 8,
25
+ padding: 8,
26
+ boxShadow: '0 6px 24px rgba(0,0,0,0.35)',
27
+ zIndex: 1000,
28
+ fontFamily: 'inherit',
29
+ fontSize: 14,
30
+ };
31
+ const searchStyle = {
32
+ width: '100%',
33
+ padding: '6px 8px',
34
+ borderRadius: 6,
35
+ border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
36
+ background: colors_1.INPUT_BACKGROUND,
37
+ color: colors_1.TEXT_COLOR,
38
+ marginBottom: 8,
39
+ outline: 'none',
40
+ fontFamily: 'inherit',
41
+ fontSize: 14,
42
+ };
43
+ const CompositionIdsDropdown = ({ compositionIds, currentId }) => {
44
+ const [open, setOpen] = (0, react_1.useState)(false);
45
+ const [query, setQuery] = (0, react_1.useState)('');
46
+ const containerRef = (0, react_1.useRef)(null);
47
+ const filtered = (0, react_1.useMemo)(() => {
48
+ const q = query.trim().toLowerCase();
49
+ if (!q) {
50
+ return compositionIds;
51
+ }
52
+ return compositionIds.filter((id) => id.toLowerCase().includes(q));
53
+ }, [compositionIds, query]);
54
+ const onSelect = (id) => {
55
+ const isQuery = window.remotion_isReadOnlyStudio;
56
+ if (isQuery) {
57
+ window.location.href = `${window.location.pathname}?/${id}`;
58
+ }
59
+ else {
60
+ window.location.href = `/${id}`;
61
+ }
62
+ };
63
+ (0, react_1.useEffect)(() => {
64
+ if (!open) {
65
+ return;
66
+ }
67
+ const onClickAway = (e) => {
68
+ if (!containerRef.current) {
69
+ return;
70
+ }
71
+ if (!containerRef.current.contains(e.target)) {
72
+ setOpen(false);
73
+ }
74
+ };
75
+ const onKey = (e) => {
76
+ if (e.key === 'Escape') {
77
+ setOpen(false);
78
+ }
79
+ };
80
+ document.addEventListener('mousedown', onClickAway);
81
+ document.addEventListener('touchstart', onClickAway, { passive: true });
82
+ document.addEventListener('keydown', onKey);
83
+ return () => {
84
+ document.removeEventListener('mousedown', onClickAway);
85
+ document.removeEventListener('touchstart', onClickAway);
86
+ document.removeEventListener('keydown', onKey);
87
+ };
88
+ }, [open, containerRef]);
89
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, style: containerStyle, children: [(0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: () => setOpen((p) => !p), buttonContainerStyle: {
90
+ display: 'flex',
91
+ alignItems: 'center',
92
+ justifyContent: 'space-between',
93
+ gap: 8,
94
+ minWidth: 180,
95
+ }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
96
+ overflow: 'hidden',
97
+ textOverflow: 'ellipsis',
98
+ whiteSpace: 'nowrap',
99
+ fontSize: '14px',
100
+ lineHeight: '24px',
101
+ }, children: currentId !== null && currentId !== void 0 ? currentId : 'Select composition' }), (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { size: 20, invert: open })] }), open ? ((0, jsx_runtime_1.jsxs)("div", { style: dropdownStyle, children: [(0, jsx_runtime_1.jsx)("input", { value: query, onChange: (e) => setQuery(e.target.value), placeholder: "Search compositions...", style: searchStyle, "aria-label": "Search compositions" }), (0, jsx_runtime_1.jsx)("div", { children: filtered.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { style: { opacity: 0.7, padding: 8, textAlign: 'center' }, children: "No compositions found" })) : (filtered.map((id) => ((0, jsx_runtime_1.jsx)(CompositionIdListItem_1.CompositionIdListItem, { id: id, isActive: id === currentId, onSelect: onSelect }, id)))) })] })) : null] }));
102
+ };
103
+ exports.CompositionIdsDropdown = CompositionIdsDropdown;
@@ -6,8 +6,10 @@ const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const react_1 = require("react");
7
7
  const is_menu_item_1 = require("../../components/Menu/is-menu-item");
8
8
  const layout_1 = require("../../components/layout");
9
+ const url_state_1 = require("../../helpers/url-state");
9
10
  const AskOnDiscord_1 = require("./AskOnDiscord");
10
11
  const CalculateMetadataErrorExplainer_1 = require("./CalculateMetadataErrorExplainer");
12
+ const CompositionIdsDropdown_1 = require("./CompositionIdsDropdown");
11
13
  const ErrorTitle_1 = require("./ErrorTitle");
12
14
  const HelpLink_1 = require("./HelpLink");
13
15
  const OpenInEditor_1 = require("./OpenInEditor");
@@ -25,6 +27,8 @@ const spacer = {
25
27
  display: 'inline-block',
26
28
  };
27
29
  const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, }) => {
30
+ var _a;
31
+ const compositionIds = (_a = window === null || window === void 0 ? void 0 : window.remotion_seenCompositionIds) !== null && _a !== void 0 ? _a : [];
28
32
  const highestLineNumber = Math.max(...display.stackFrames
29
33
  .map((s) => s.originalScriptCode)
30
34
  .flat(1)
@@ -43,7 +47,13 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
43
47
  }, [display.error]);
44
48
  const lineNumberWidth = String(highestLineNumber).length;
45
49
  const helpLink = (0, get_help_link_1.getHelpLink)(message);
46
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message, canHaveDismissButton: canHaveDismissButton }), helpLink ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, display.stackFrames.length > 0 && window.remotion_editorName ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, stack: display.stackFrames[0] }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(SearchGitHubIssues_1.SearchGithubIssues, { canHaveKeyboardShortcuts: keyboardShortcuts, message: display.error.message }), (0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsx)(AskOnDiscord_1.AskOnDiscord, { canHaveKeyboardShortcuts: keyboardShortcuts }), onRetry ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsx)(Retry_1.RetryButton, { onClick: onRetry })] })) : null, calculateMetadata ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 0.5 }), (0, jsx_runtime_1.jsx)(CalculateMetadataErrorExplainer_1.CalculateMetadataErrorExplainer, {})] })) : null, (0, jsx_runtime_1.jsx)("div", { style: stack, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: display.stackFrames.map((s, i) => {
50
+ const getCurrentCompositionId = () => {
51
+ var _a;
52
+ const route = (0, url_state_1.getRoute)();
53
+ const id = route.startsWith('/') ? route.slice(1) : route;
54
+ return compositionIds.includes(id) ? id : ((_a = compositionIds[0]) !== null && _a !== void 0 ? _a : null);
55
+ };
56
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message, canHaveDismissButton: canHaveDismissButton }), helpLink ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, display.stackFrames.length > 0 && window.remotion_editorName ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, stack: display.stackFrames[0] }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, compositionIds.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(CompositionIdsDropdown_1.CompositionIdsDropdown, { compositionIds: compositionIds, currentId: getCurrentCompositionId() }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(SearchGitHubIssues_1.SearchGithubIssues, { canHaveKeyboardShortcuts: keyboardShortcuts, message: display.error.message }), (0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsx)(AskOnDiscord_1.AskOnDiscord, { canHaveKeyboardShortcuts: keyboardShortcuts }), onRetry ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: spacer }), (0, jsx_runtime_1.jsx)(Retry_1.RetryButton, { onClick: onRetry })] })) : null, calculateMetadata ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 0.5 }), (0, jsx_runtime_1.jsx)(CalculateMetadataErrorExplainer_1.CalculateMetadataErrorExplainer, {})] })) : null, (0, jsx_runtime_1.jsx)("div", { style: stack, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: display.stackFrames.map((s, i) => {
47
57
  return ((0, jsx_runtime_1.jsx)(StackFrame_1.StackElement
48
58
  // eslint-disable-next-line react/no-array-index-key
49
59
  , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)' }, i));
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
- export declare const CaretRight: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const CaretRight: ({ size }: {
3
+ readonly size?: number;
4
+ }) => import("react/jsx-runtime").JSX.Element;
3
5
  export declare const CaretDown: React.FC<{
4
6
  readonly invert: boolean;
7
+ readonly size?: number;
5
8
  }>;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CaretDown = exports.CaretRight = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const CaretRight = () => {
6
- return ((0, jsx_runtime_1.jsx)("svg", { style: { height: 20 }, "aria-hidden": "true", focusable: "false", role: "img", viewBox: "0 0 192 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }) }));
5
+ const CaretRight = ({ size }) => {
6
+ return ((0, jsx_runtime_1.jsx)("svg", { style: { height: size !== null && size !== void 0 ? size : 20 }, "aria-hidden": "true", focusable: "false", role: "img", viewBox: "0 0 192 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }) }));
7
7
  };
8
8
  exports.CaretRight = CaretRight;
9
- const CaretDown = ({ invert }) => {
10
- return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: 20, transform: invert ? `rotate(180deg)` : '' }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
9
+ const CaretDown = ({ invert, size }) => {
10
+ return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: size !== null && size !== void 0 ? size : 20, transform: invert ? `rotate(180deg)` : '' }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
11
11
  };
12
12
  exports.CaretDown = CaretDown;