@remotion/studio 4.0.523 → 4.0.524

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 (98) hide show
  1. package/dist/components/ActionTooltip.d.ts +9 -0
  2. package/dist/components/ActionTooltip.js +143 -0
  3. package/dist/components/Canvas.js +3 -2
  4. package/dist/components/CheckboardToggle.js +7 -10
  5. package/dist/components/ElementInstallConfirmation.js +6 -41
  6. package/dist/components/FullscreenToggle.js +5 -8
  7. package/dist/components/GlobalKeybindings.js +57 -0
  8. package/dist/components/InspectorSequenceSection.js +5 -5
  9. package/dist/components/LazySyntaxHighlightedSource.d.ts +4 -0
  10. package/dist/components/LazySyntaxHighlightedSource.js +43 -0
  11. package/dist/components/LoopToggle.js +8 -2
  12. package/dist/components/MenuToolbar.js +6 -4
  13. package/dist/components/MuteToggle.d.ts +1 -0
  14. package/dist/components/MuteToggle.js +16 -6
  15. package/dist/components/NewComposition/NewComposition.d.ts +1 -0
  16. package/dist/components/NewComposition/NewComposition.js +5 -4
  17. package/dist/components/NewComposition/NewFolder.js +2 -4
  18. package/dist/components/NewComposition/RenameComposition.js +3 -2
  19. package/dist/components/NewComposition/RenameFolder.js +2 -4
  20. package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
  21. package/dist/components/NewComposition/SlugPreview.js +18 -0
  22. package/dist/components/OutlineToggle.js +16 -10
  23. package/dist/components/PlayPause.js +7 -1
  24. package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
  25. package/dist/components/PlaybackKeyboardShortcutsManager.js +36 -1
  26. package/dist/components/PlaybackRateSelector.js +2 -2
  27. package/dist/components/PreviewToolbar.js +1 -1
  28. package/dist/components/PreviewToolbarOverflowButton.js +8 -2
  29. package/dist/components/RenderQueue/CaptionQueueItem.js +2 -1
  30. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
  31. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
  32. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
  33. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
  34. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
  35. package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
  36. package/dist/components/RenderQueue/VideoMattingQueueItem.js +2 -1
  37. package/dist/components/RulersAndGuidesToggle.js +7 -1
  38. package/dist/components/SettingsButton.js +8 -6
  39. package/dist/components/SettingsModal.js +1 -1
  40. package/dist/components/SidebarCollapserControls.js +13 -16
  41. package/dist/components/SizeSelector.js +2 -2
  42. package/dist/components/SnappingToggle.js +6 -8
  43. package/dist/components/StudioSettings.js +32 -18
  44. package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
  45. package/dist/components/{HighlightedElementSource.js → SyntaxHighlightedSource.js} +2 -2
  46. package/dist/components/Timeline/Timeline.js +47 -39
  47. package/dist/components/Timeline/TimelineLayerChildren.js +12 -9
  48. package/dist/components/Timeline/TimelineZoomControls.js +2 -1
  49. package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
  50. package/dist/components/TimelineCombobox.d.ts +1 -0
  51. package/dist/components/TimelineCombobox.js +8 -4
  52. package/dist/components/TimelineInOutToggle.js +8 -15
  53. package/dist/components/handle-drop.js +3 -2
  54. package/dist/components/keyboard-shortcuts.d.ts +4 -4
  55. package/dist/components/keyboard-shortcuts.js +23 -9
  56. package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -18
  57. package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
  58. package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
  59. package/dist/esm/{HighlightedElementSource-jfc66k4p.mjs → SyntaxHighlightedSource-3xks91rz.mjs} +4 -4
  60. package/dist/esm/{TranscriptionModal-916jqhry.mjs → TranscriptionModal-3ctnxpt6.mjs} +7 -7
  61. package/dist/esm/{VideoMattingModal-2tm79s9b.mjs → VideoMattingModal-b0r7e60n.mjs} +7 -7
  62. package/dist/esm/{index-te66vvrp.mjs → index-1b9skrrd.mjs} +4 -4
  63. package/dist/esm/{index-1x7bsdh6.mjs → index-2j3d1g81.mjs} +2 -2
  64. package/dist/esm/{index-hy4xcgty.mjs → index-9qtvmwtx.mjs} +1 -1
  65. package/dist/esm/{index-6cvm9a65.mjs → index-c37kme2v.mjs} +842 -556
  66. package/dist/esm/{index-5qddp5h7.mjs → index-e3zwf3e7.mjs} +1 -1
  67. package/dist/esm/{index-x7t2y7ws.mjs → index-er3mh6em.mjs} +3584 -3090
  68. package/dist/esm/{index-jg13hf2g.mjs → index-k426ye99.mjs} +2 -1
  69. package/dist/esm/{index-sgtmgc4h.mjs → index-q2epbw93.mjs} +3 -3
  70. package/dist/esm/{index-3hgr6gjx.mjs → index-q5xv20xx.mjs} +1 -1
  71. package/dist/esm/{index-czwvnn9g.mjs → index-wbmp5srk.mjs} +1 -1
  72. package/dist/esm/{index-xhe2m2qr.mjs → index-yfrysr5f.mjs} +18 -10
  73. package/dist/esm/index.mjs +3 -3
  74. package/dist/esm/internals.mjs +8 -8
  75. package/dist/esm/previewEntry.mjs +8 -8
  76. package/dist/esm/renderEntry.mjs +3 -3
  77. package/dist/helpers/colors.d.ts +1 -0
  78. package/dist/helpers/colors.js +4 -3
  79. package/dist/helpers/inject-css.js +2 -2
  80. package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -0
  81. package/dist/helpers/prism-vsc-dark-plus.js +305 -0
  82. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  83. package/dist/helpers/use-create-composition.d.ts +1 -0
  84. package/dist/helpers/use-create-composition.js +12 -7
  85. package/dist/helpers/use-keybinding.d.ts +1 -1
  86. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
  87. package/dist/helpers/use-menu-structure.js +1 -1
  88. package/dist/helpers/use-rename-composition.d.ts +1 -0
  89. package/dist/helpers/use-rename-composition.js +11 -5
  90. package/dist/icons/skills.js +1 -1
  91. package/dist/renderEntry.js +2 -2
  92. package/package.json +20 -20
  93. package/dist/components/HighlightedElementSource.d.ts +0 -5
  94. package/dist/esm/LazyModels-2trdm224.mjs +0 -11
  95. package/dist/esm/LazyModels-fjb5ckaq.mjs +0 -11
  96. package/dist/helpers/prism-tomorrow.d.ts +0 -1
  97. package/dist/helpers/prism-tomorrow.js +0 -151
  98. /package/dist/esm/{resolve-composition-component-location-14148845.mjs → resolve-composition-component-location-bt2d6qxq.mjs} +0 -0
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare const ActionTooltip: React.FC<{
3
+ readonly label: string;
4
+ readonly shortcut: string | null;
5
+ /** Hover delay in milliseconds. Pass null to show immediately. */
6
+ readonly delay: number | null;
7
+ readonly dismissOnClick: boolean;
8
+ readonly children: React.ReactNode;
9
+ }>;
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionTooltip = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_dom_1 = require("react-dom");
7
+ const colors_1 = require("../helpers/colors");
8
+ const z_index_1 = require("../state/z-index");
9
+ const portals_1 = require("./Menu/portals");
10
+ const styles_1 = require("./Menu/styles");
11
+ const triggerStyle = { display: 'inline-flex' };
12
+ const tooltipStyle = {
13
+ position: 'fixed',
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ gap: 6,
17
+ backgroundColor: colors_1.TIMELINE_BACKGROUND_COLOR,
18
+ color: colors_1.WHITE_ALPHA_90,
19
+ borderRadius: 6,
20
+ padding: '6px 8px',
21
+ fontSize: 12,
22
+ lineHeight: '16px',
23
+ whiteSpace: 'pre-wrap',
24
+ overflowWrap: 'anywhere',
25
+ maxWidth: 'calc(100vw - 16px)',
26
+ boxShadow: styles_1.SHADOW_TOWARDS_TOP,
27
+ pointerEvents: 'none',
28
+ };
29
+ const labelStyle = {
30
+ font: 'inherit',
31
+ color: 'inherit',
32
+ minWidth: 0,
33
+ };
34
+ const shortcutStyle = {
35
+ ...labelStyle,
36
+ backgroundColor: colors_1.WHITE_ALPHA_10,
37
+ borderRadius: 3,
38
+ padding: '0 4px',
39
+ minWidth: 16,
40
+ textAlign: 'center',
41
+ whiteSpace: 'nowrap',
42
+ flexShrink: 0,
43
+ };
44
+ let visibleTooltipCount = 0;
45
+ let lastTooltipHiddenAt = null;
46
+ const TOOLTIP_SKIP_DELAY_WINDOW = 300;
47
+ const ActionTooltip = ({ label, shortcut, delay, dismissOnClick, children }) => {
48
+ var _a, _b;
49
+ const triggerRef = (0, react_1.useRef)(null);
50
+ const tooltipRef = (0, react_1.useRef)(null);
51
+ const timer = (0, react_1.useRef)(null);
52
+ const [visible, setVisible] = (0, react_1.useState)(false);
53
+ const [position, setPosition] = (0, react_1.useState)(null);
54
+ const { currentZIndex } = (0, z_index_1.useZIndex)();
55
+ (0, react_1.useLayoutEffect)(() => {
56
+ if (!visible) {
57
+ return;
58
+ }
59
+ visibleTooltipCount++;
60
+ return () => {
61
+ visibleTooltipCount--;
62
+ lastTooltipHiddenAt = Date.now();
63
+ };
64
+ }, [visible]);
65
+ const hide = (0, react_1.useCallback)(() => {
66
+ if (timer.current !== null) {
67
+ clearTimeout(timer.current);
68
+ timer.current = null;
69
+ }
70
+ setVisible(false);
71
+ setPosition(null);
72
+ }, []);
73
+ const show = (0, react_1.useCallback)(() => {
74
+ if (timer.current !== null) {
75
+ clearTimeout(timer.current);
76
+ timer.current = null;
77
+ }
78
+ setVisible(true);
79
+ }, []);
80
+ const onPointerEnter = (0, react_1.useCallback)((event) => {
81
+ if (event.pointerType === 'touch' ||
82
+ timer.current !== null ||
83
+ !event.currentTarget.contains(event.target)) {
84
+ return;
85
+ }
86
+ // Keep adjacent controls instant, including crossing the gap between them.
87
+ if (!delay ||
88
+ visibleTooltipCount > 0 ||
89
+ (lastTooltipHiddenAt !== null &&
90
+ Date.now() - lastTooltipHiddenAt < TOOLTIP_SKIP_DELAY_WINDOW)) {
91
+ show();
92
+ return;
93
+ }
94
+ timer.current = setTimeout(show, delay);
95
+ }, [delay, show]);
96
+ (0, react_1.useEffect)(() => {
97
+ const onKeyDown = (event) => {
98
+ if (event.key === 'Escape') {
99
+ hide();
100
+ }
101
+ };
102
+ window.addEventListener('keydown', onKeyDown);
103
+ window.addEventListener('blur', hide);
104
+ window.addEventListener('resize', hide);
105
+ window.addEventListener('scroll', hide, true);
106
+ return () => {
107
+ if (timer.current !== null) {
108
+ clearTimeout(timer.current);
109
+ }
110
+ window.removeEventListener('keydown', onKeyDown);
111
+ window.removeEventListener('blur', hide);
112
+ window.removeEventListener('resize', hide);
113
+ window.removeEventListener('scroll', hide, true);
114
+ };
115
+ }, [hide]);
116
+ (0, react_1.useLayoutEffect)(() => {
117
+ if (!visible || !triggerRef.current || !tooltipRef.current) {
118
+ return;
119
+ }
120
+ const trigger = triggerRef.current.getBoundingClientRect();
121
+ const tooltip = tooltipRef.current.getBoundingClientRect();
122
+ const above = trigger.top - tooltip.height - 4;
123
+ setPosition({
124
+ left: Math.max(8, Math.min(trigger.left + (trigger.width - tooltip.width) / 2, window.innerWidth - tooltip.width - 8)),
125
+ top: Math.max(8, Math.min(above >= 8 ? above : trigger.bottom + 4, window.innerHeight - tooltip.height - 8)),
126
+ });
127
+ }, [label, shortcut, visible]);
128
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
129
+ jsx_runtime_1.jsx("span", { ref: triggerRef, style: triggerStyle, onPointerEnter: onPointerEnter, onPointerLeave: hide, onPointerDownCapture: dismissOnClick ? hide : undefined, onClickCapture: dismissOnClick ? hide : undefined, onFocus: (event) => {
130
+ if (event.currentTarget.contains(event.target)) {
131
+ show();
132
+ }
133
+ }, onBlur: hide, children: children }), visible
134
+ ? (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs("div", { ref: tooltipRef, role: "tooltip", className: "css-reset", style: {
135
+ ...tooltipStyle,
136
+ left: (_a = position === null || position === void 0 ? void 0 : position.left) !== null && _a !== void 0 ? _a : 0,
137
+ top: (_b = position === null || position === void 0 ? void 0 : position.top) !== null && _b !== void 0 ? _b : 0,
138
+ visibility: position ? 'visible' : 'hidden',
139
+ }, children: [
140
+ jsx_runtime_1.jsx("span", { style: labelStyle, children: label }), shortcut ? jsx_runtime_1.jsx("kbd", { style: shortcutStyle, children: shortcut }) : null] }), (0, portals_1.getPortal)(currentZIndex))
141
+ : null] }));
142
+ };
143
+ exports.ActionTooltip = ActionTooltip;
@@ -622,7 +622,7 @@ const Canvas = ({ canvasContent, size }) => {
622
622
  }, [previewServerClientId, subscribeToEvent]);
623
623
  (0, react_1.useEffect)(() => {
624
624
  const onMessage = (event) => {
625
- var _a, _b;
625
+ var _a, _b, _c;
626
626
  const elementLibrary = document.querySelector('iframe[data-remotion-element-library]');
627
627
  if (event.source !== (elementLibrary === null || elementLibrary === void 0 ? void 0 : elementLibrary.contentWindow) ||
628
628
  !studio_protocol_1.StudioProtocolInternals.isAllowedStudioProtocolPageOrigin(event.origin)) {
@@ -646,7 +646,8 @@ const Canvas = ({ canvasContent, size }) => {
646
646
  element: {
647
647
  ...payload.element,
648
648
  durationInFrames: (_a = payload.element.durationInFrames) !== null && _a !== void 0 ? _a : null,
649
- installationMode: (_b = payload.element.installationMode) !== null && _b !== void 0 ? _b : null,
649
+ initialProps: (_b = payload.element.initialProps) !== null && _b !== void 0 ? _b : null,
650
+ installationMode: (_c = payload.element.installationMode) !== null && _c !== void 0 ? _c : null,
650
651
  },
651
652
  from: null,
652
653
  id: crypto.randomUUID(),
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CheckboardToggle = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const no_react_1 = require("remotion/no-react");
7
6
  const colors_1 = require("../helpers/colors");
8
7
  const use_keybinding_1 = require("../helpers/use-keybinding");
9
8
  const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
10
9
  const checkerboard_1 = require("../state/checkerboard");
10
+ const ActionTooltip_1 = require("./ActionTooltip");
11
11
  const ControlButton_1 = require("./ControlButton");
12
12
  const CheckboardToggle = () => {
13
13
  const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
@@ -17,14 +17,11 @@ const CheckboardToggle = () => {
17
17
  });
18
18
  }, [setCheckerboard]);
19
19
  const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleCheckerboard');
20
- const accessibilityLabel = [
21
- 'Show transparency as checkerboard',
22
- (0, use_keybinding_1.areKeyboardShortcutsDisabled)() || shortcut === '' ? null : `(${shortcut})`,
23
- ]
24
- .filter(no_react_1.NoReactInternals.truthy)
25
- .join(' ');
26
- return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": checkerboard, onClick: onClick, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
27
- jsx_runtime_1.jsx("path", { fill: checkerboard ? colors_1.BLUE : color, d: "M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z" }), jsx_runtime_1.jsx("rect", { x: "48", y: "48", width: "416", height: "416", rx: "24", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" }), jsx_runtime_1.jsx("path", { d: "M256 48v416M48 256h416", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" })
28
- ] })) }));
20
+ const ariaKeyShortcuts = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleCheckerboard');
21
+ const accessibilityLabel = 'Show transparency as checkerboard';
22
+ const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
23
+ return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-pressed": checkerboard, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined, onClick: onClick, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
24
+ jsx_runtime_1.jsx("path", { fill: checkerboard ? colors_1.BLUE : color, d: "M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z" }), jsx_runtime_1.jsx("rect", { x: "48", y: "48", width: "416", height: "416", rx: "24", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" }), jsx_runtime_1.jsx("path", { d: "M256 48v416M48 256h416", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" })
25
+ ] })) }) }));
29
26
  };
30
27
  exports.CheckboardToggle = CheckboardToggle;
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.ElementInstallConfirmation = exports.ElementLibraryAddConfirmation = void 0;
37
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -50,6 +17,7 @@ const Button_1 = require("./Button");
50
17
  const element_install_api_1 = require("./element-install-api");
51
18
  const import_assets_1 = require("./import-assets");
52
19
  const layout_1 = require("./layout");
20
+ const LazySyntaxHighlightedSource_1 = require("./LazySyntaxHighlightedSource");
53
21
  const is_menu_item_1 = require("./Menu/is-menu-item");
54
22
  const portals_1 = require("./Menu/portals");
55
23
  const ModalButton_1 = require("./ModalButton");
@@ -63,7 +31,6 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
63
31
  const RadioButton_1 = require("./RadioButton");
64
32
  const SegmentedControl_1 = require("./SegmentedControl");
65
33
  const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
66
- const HighlightedElementSource = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./HighlightedElementSource'))));
67
34
  const container = {
68
35
  display: 'flex',
69
36
  flexDirection: 'column',
@@ -402,7 +369,7 @@ const ElementInstallConfirmation = ({ state }) => {
402
369
  canceled = true;
403
370
  };
404
371
  }, [folderCompositionFile, newPlan, request.element, selectedFolderStack]);
405
- const { createComposition, heightValidationMessage, nameValidationMessage, valid: newCompositionValuesAreValid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
372
+ const { compositionId: newCompositionId, createComposition, heightValidationMessage, nameValidationMessage, valid: newCompositionValuesAreValid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
406
373
  canvasCapture: null,
407
374
  compositions,
408
375
  durationInFrames: newCompositionValues.durationInFrames,
@@ -582,9 +549,7 @@ const ElementInstallConfirmation = ({ state }) => {
582
549
  compositionFile: mode === 'new-composition'
583
550
  ? selectedPlan.compositionFile
584
551
  : request.compositionFile,
585
- compositionId: mode === 'new-composition'
586
- ? newCompositionValues.id
587
- : request.compositionId,
552
+ compositionId: mode === 'new-composition' ? newCompositionId : request.compositionId,
588
553
  element: request.element,
589
554
  // The insert operation revalidates this even if the name preflight is pending.
590
555
  expectedFileState: (_b = activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState) !== null && _b !== void 0 ? _b : { exists: false },
@@ -609,7 +574,7 @@ const ElementInstallConfirmation = ({ state }) => {
609
574
  createComposition,
610
575
  folderSymbolicatedStack,
611
576
  mode,
612
- newCompositionValues.id,
577
+ newCompositionId,
613
578
  onClose,
614
579
  request,
615
580
  selectedFolderStack,
@@ -658,7 +623,7 @@ const ElementInstallConfirmation = ({ state }) => {
658
623
  ] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
659
624
  jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["Studio could not find a safe place in \u201C", request.compositionId, "\u201D to insert the Element. Install it into a new composition instead."] })
660
625
  ] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: { ...sectionStyle, marginInline: -16 }, "aria-label": "New composition settings", children: [
661
- jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: compositionAlreadyCreated ? null : nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, jsx_runtime_1.jsx("section", { style: sectionStyle, "aria-label": "Element implementation", children: existingDestination ? (jsx_runtime_1.jsxs("div", { role: "radiogroup", "aria-label": "Existing Element file", style: sectionStyle, children: [
626
+ jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { compositionId: newCompositionId, heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: compositionAlreadyCreated ? null : nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, jsx_runtime_1.jsx("section", { style: sectionStyle, "aria-label": "Element implementation", children: existingDestination ? (jsx_runtime_1.jsxs("div", { role: "radiogroup", "aria-label": "Existing Element file", style: sectionStyle, children: [
662
627
  jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: !overwriteExisting, disabled: submitting, onClick: () => setInput((previous) => ({ ...previous, overwritePlan: null })), children: "Create a copy" }), !overwriteExisting ? (jsx_runtime_1.jsxs("div", { style: {
663
628
  ...sectionStyle,
664
629
  paddingLeft: 28,
@@ -686,7 +651,7 @@ const ElementInstallConfirmation = ({ state }) => {
686
651
  ] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
687
652
  jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsx("p", { style: warningDescriptionStyle, children: "Installed code can access your files and network." })
688
653
  ] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
689
- jsx_runtime_1.jsx("summary", { className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("div", { style: sourceCodeContainerStyle, children: jsx_runtime_1.jsx("pre", { className: `language-tsx ${is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME} ${is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: jsx_runtime_1.jsx(react_1.Suspense, { fallback: sourcePreview, children: jsx_runtime_1.jsx(HighlightedElementSource, { source: sourcePreview }) }) }) }) })
654
+ jsx_runtime_1.jsx("summary", { className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("div", { style: sourceCodeContainerStyle, children: jsx_runtime_1.jsx("pre", { className: `language-tsx ${is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME} ${is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: jsx_runtime_1.jsx(LazySyntaxHighlightedSource_1.LazySyntaxHighlightedSource, { source: sourcePreview }) }) }) })
690
655
  ] })
691
656
  ] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footerStyle, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
692
657
  jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: submitting, onClick: cancel, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { autoFocus: mode === 'current-composition', disabled: !canSubmit, onClick: submit, children: [submitting
@@ -4,11 +4,11 @@ exports.FullScreenToggle = 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 no_react_1 = require("remotion/no-react");
8
7
  const use_keybinding_1 = require("../helpers/use-keybinding");
9
8
  const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
10
9
  const fullscreen_1 = require("../icons/fullscreen");
11
10
  const canvas_ref_1 = require("../state/canvas-ref");
11
+ const ActionTooltip_1 = require("./ActionTooltip");
12
12
  const ControlButton_1 = require("./ControlButton");
13
13
  const FullScreenToggle = ({ hidden }) => {
14
14
  const keybindings = (0, use_keybinding_1.useKeybinding)();
@@ -26,12 +26,9 @@ const FullScreenToggle = ({ hidden }) => {
26
26
  }));
27
27
  }, [setSize]);
28
28
  const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('enterFullscreen');
29
- const accessibilityLabel = [
30
- 'Enter fullscreen preview',
31
- (0, use_keybinding_1.areKeyboardShortcutsDisabled)() || shortcut === '' ? null : `(${shortcut})`,
32
- ]
33
- .filter(no_react_1.NoReactInternals.truthy)
34
- .join(' ');
29
+ const ariaKeyShortcuts = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('enterFullscreen');
30
+ const accessibilityLabel = 'Enter fullscreen preview';
31
+ const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
35
32
  (0, react_1.useEffect)(() => {
36
33
  const f = keybindings.registerKeybinding({
37
34
  event: 'keydown',
@@ -45,6 +42,6 @@ const FullScreenToggle = ({ hidden }) => {
45
42
  f.unregister();
46
43
  };
47
44
  }, [keybindings, onClick]);
48
- return hidden ? (jsx_runtime_1.jsx("button", { id: "fullscreen-toggle", type: "button", style: { display: 'none' }, onClick: onClick })) : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { id: "fullscreen-toggle", title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => (jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: color, style: { width: 18, height: 18 } })) }));
45
+ return hidden ? (jsx_runtime_1.jsx("button", { id: "fullscreen-toggle", type: "button", style: { display: 'none' }, onClick: onClick })) : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { id: "fullscreen-toggle", title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined, onClick: onClick, children: (color) => (jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: color, style: { width: 18, height: 18 } })) }) }));
49
46
  };
50
47
  exports.FullScreenToggle = FullScreenToggle;
@@ -4,10 +4,14 @@ exports.GlobalKeybindings = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
7
+ const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
7
8
  const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
8
9
  const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
9
10
  const use_keybinding_1 = require("../helpers/use-keybinding");
10
11
  const checkerboard_1 = require("../state/checkerboard");
12
+ const editor_guides_1 = require("../state/editor-guides");
13
+ const editor_outlines_1 = require("../state/editor-outlines");
14
+ const editor_rulers_1 = require("../state/editor-rulers");
11
15
  const editor_snapping_1 = require("../state/editor-snapping");
12
16
  const modals_1 = require("../state/modals");
13
17
  const AskAiModal_1 = require("./AskAiModal");
@@ -27,6 +31,59 @@ const GlobalKeybindings = () => {
27
31
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
28
32
  const { setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
29
33
  const { setEditorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
34
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
35
+ const { setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
36
+ const { editorShowRulers, setEditorShowRulers } = (0, react_1.useContext)(editor_rulers_1.EditorShowRulersContext);
37
+ const { editorShowGuides, setEditorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
38
+ const showGuides = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition';
39
+ const showCanvasViewControls = showGuides ||
40
+ ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' &&
41
+ (0, get_preview_file_type_1.getPreviewFileType)(canvasContent.asset) === 'video');
42
+ (0, react_1.useEffect)(() => {
43
+ if (!showCanvasViewControls)
44
+ return;
45
+ const outlines = showGuides
46
+ ? keybindings.registerKeybinding({
47
+ event: 'keydown',
48
+ action: 'toggleOutlines',
49
+ callback: (event) => {
50
+ if (!event.repeat)
51
+ setEditorShowOutlines((current) => !current);
52
+ },
53
+ preventDefault: true,
54
+ triggerIfInputFieldFocused: false,
55
+ keepRegisteredWhenNotHighestContext: false,
56
+ })
57
+ : null;
58
+ const rulers = keybindings.registerKeybinding({
59
+ event: 'keydown',
60
+ action: 'toggleRulersAndGuides',
61
+ callback: (event) => {
62
+ if (event.repeat)
63
+ return;
64
+ const visible = editorShowRulers || (showGuides && editorShowGuides);
65
+ setEditorShowRulers(() => !visible);
66
+ if (showGuides)
67
+ setEditorShowGuides(() => !visible);
68
+ },
69
+ preventDefault: true,
70
+ triggerIfInputFieldFocused: false,
71
+ keepRegisteredWhenNotHighestContext: false,
72
+ });
73
+ return () => {
74
+ outlines === null || outlines === void 0 ? void 0 : outlines.unregister();
75
+ rulers.unregister();
76
+ };
77
+ }, [
78
+ keybindings,
79
+ showCanvasViewControls,
80
+ showGuides,
81
+ editorShowRulers,
82
+ editorShowGuides,
83
+ setEditorShowOutlines,
84
+ setEditorShowRulers,
85
+ setEditorShowGuides,
86
+ ]);
30
87
  const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
31
88
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
32
89
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
@@ -484,11 +484,11 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
484
484
  return node.kind === 'field' && ((_a = node.field) === null || _a === void 0 ? void 0 : _a.key) === border_radius_representation_1.BORDER_RADIUS_SHORTHAND_KEY;
485
485
  });
486
486
  const borderRadiusConversion = (0, border_radius_representation_1.getBorderRadiusConversion)(sequencePropStatuses, getDragOverrides(nodePathInfo.sequenceSubscriptionKey));
487
- const inlineCaptionValue = ((_a = schema.captions) === null || _a === void 0 ? void 0 : _a.type) === 'remotion-captions'
488
- ? runtimeValues.captions
489
- : null;
490
- const inlineCaptions = Array.isArray(inlineCaptionValue)
491
- ? inlineCaptionValue
487
+ const hasCaptionsSchema = ((_a = schema.captions) === null || _a === void 0 ? void 0 : _a.type) === 'remotion-captions';
488
+ const inlineCaptions = hasCaptionsSchema
489
+ ? Array.isArray(runtimeValues.captions)
490
+ ? runtimeValues.captions
491
+ : []
492
492
  : null;
493
493
  const showEffectsSection = nodePathInfo.supportsEffects || effectRows.length > 0;
494
494
  const canAddEffect = nodePathInfo.supportsEffects &&
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const LazySyntaxHighlightedSource: React.FC<{
3
+ readonly source: string;
4
+ }>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.LazySyntaxHighlightedSource = void 0;
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const react_1 = require("react");
39
+ const SyntaxHighlightedSource = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SyntaxHighlightedSource'))));
40
+ const LazySyntaxHighlightedSource = ({ source }) => {
41
+ return (jsx_runtime_1.jsx(react_1.Suspense, { fallback: source, children: jsx_runtime_1.jsx(SyntaxHighlightedSource, { source: source }) }));
42
+ };
43
+ exports.LazySyntaxHighlightedSource = LazySyntaxHighlightedSource;
@@ -4,9 +4,12 @@ exports.LoopToggle = exports.toggleLoop = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
+ const use_keybinding_1 = require("../helpers/use-keybinding");
8
+ const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
7
9
  const loop_1 = require("../state/loop");
10
+ const ActionTooltip_1 = require("./ActionTooltip");
8
11
  const ControlButton_1 = require("./ControlButton");
9
- const accessibilityLabel = 'Loop video';
12
+ const accessibilityLabel = 'Loop';
10
13
  const toggleLoop = (setLoop) => {
11
14
  setLoop((currentLoop) => {
12
15
  (0, loop_1.persistLoopOption)(!currentLoop);
@@ -15,9 +18,12 @@ const toggleLoop = (setLoop) => {
15
18
  };
16
19
  exports.toggleLoop = toggleLoop;
17
20
  const LoopToggle = ({ loop, setLoop }) => {
21
+ const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleLoop');
22
+ const ariaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleLoop');
23
+ const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
18
24
  const onClick = (0, react_1.useCallback)(() => {
19
25
  (0, exports.toggleLoop)(setLoop);
20
26
  }, [setLoop]);
21
- return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: jsx_runtime_1.jsx("path", { fill: loop ? colors_1.BLUE : color, d: "M384 150.3V41.6l64 53.3v2l-64 53.3zM352 23.5V80H192C86 80 0 166 0 272c0 8.8 7.2 16 16 16s16-7.2 16-16c0-88.4 71.6-160 160-160h160v56.5c0 13 10.5 23.5 23.5 23.5 5.5 0 10.8-1.9 15-5.4l78-65c7.3-6.1 11.5-15.1 11.5-24.6v-2c0-9.5-4.2-18.5-11.5-24.6l-78-65c-4.2-3.5-9.5-5.4-15-5.4-13 0-23.5 10.5-23.5 23.5zM128 415.9v54.5l-64-53.3v-2l64-53.3v54.1zM160 400v-56.5c0-13-10.5-23.5-23.5-23.5-5.5 0-10.8 1.9-15 5.4l-78 65C36.2 396.5 32 405.5 32 415v2c0 9.5 4.2 18.5 11.5 24.6l78 65c4.2 3.5 9.5 5.4 15 5.4 13 0 23.5-10.5 23.5-23.5V432h160c106 0 192-86 192-192 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 88.4-71.6 160-160 160H160z" }) })) }));
27
+ return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, "aria-pressed": loop, onClick: onClick, children: (color) => (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: jsx_runtime_1.jsx("path", { fill: loop ? colors_1.BLUE : color, d: "M384 150.3V41.6l64 53.3v2l-64 53.3zM352 23.5V80H192C86 80 0 166 0 272c0 8.8 7.2 16 16 16s16-7.2 16-16c0-88.4 71.6-160 160-160h160v56.5c0 13 10.5 23.5 23.5 23.5 5.5 0 10.8-1.9 15-5.4l78-65c7.3-6.1 11.5-15.1 11.5-24.6v-2c0-9.5-4.2-18.5-11.5-24.6l-78-65c-4.2-3.5-9.5-5.4-15-5.4-13 0-23.5 10.5-23.5 23.5zM128 415.9v54.5l-64-53.3v-2l64-53.3v54.1zM160 400v-56.5c0-13-10.5-23.5-23.5-23.5-5.5 0-10.8 1.9-15 5.4l-78 65C36.2 396.5 32 405.5 32 415v2c0 9.5 4.2 18.5 11.5 24.6l78 65c4.2 3.5 9.5 5.4 15 5.4 13 0 23.5-10.5 23.5-23.5V432h160c106 0 192-86 192-192 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 88.4-71.6 160-160 160H160z" }) })) }) }));
22
28
  };
23
29
  exports.LoopToggle = LoopToggle;
@@ -13,6 +13,7 @@ const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-
13
13
  const use_menu_structure_1 = require("../helpers/use-menu-structure");
14
14
  const search_1 = require("../icons/search");
15
15
  const modals_1 = require("../state/modals");
16
+ const ActionTooltip_1 = require("./ActionTooltip");
16
17
  const InlineAction_1 = require("./InlineAction");
17
18
  const layout_1 = require("./layout");
18
19
  const menu_toolbar_height_1 = require("./menu-toolbar-height");
@@ -133,11 +134,12 @@ const MenuToolbar = ({ readOnlyStudio }) => {
133
134
  return jsx_runtime_1.jsx(search_1.SearchIcon, { color: color, width: 18, height: 18 });
134
135
  }, []);
135
136
  const quickSwitcherShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('quickSwitcher');
136
- const searchTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() || quickSwitcherShortcut === ''
137
- ? 'Quick Switcher'
138
- : `Quick Switcher (${quickSwitcherShortcut})`;
137
+ const quickSwitcherAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('quickSwitcher');
138
+ const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
139
139
  return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", className: "css-reset", style: row, onPointerDown: onPointerDown, children: [
140
- jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [mobileLayout ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openQuickSwitcher, renderAction: renderSearchIcon, title: searchTooltip })) : (jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" })), jsx_runtime_1.jsx("div", { style: menuItems, children: structure.map((s) => {
140
+ jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [mobileLayout ? (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Quick switcher", shortcut: shortcutsDisabled ? null : quickSwitcherShortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openQuickSwitcher, renderAction: renderSearchIcon, "aria-label": "Quick switcher", "aria-keyshortcuts": shortcutsDisabled
141
+ ? undefined
142
+ : quickSwitcherAriaShortcut || undefined }) })) : (jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" })), jsx_runtime_1.jsx("div", { style: menuItems, children: structure.map((s) => {
141
143
  return (jsx_runtime_1.jsx(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
142
144
  }) })
143
145
  ] }), mobileLayout ? null : jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, { mobileLayout: mobileLayout }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [canUndoAndRedo ? jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}) : null, jsx_runtime_1.jsx(SettingsButton_1.SettingsButton, { showUpdates: showUpdates }), jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "right" })
@@ -1,3 +1,4 @@
1
+ export declare const toggleMute: (setMuted: import("react").Dispatch<import("react").SetStateAction<boolean>>) => void;
1
2
  export declare const MuteToggle: React.FC<{
2
3
  muted: boolean;
3
4
  setMuted: React.Dispatch<React.SetStateAction<boolean>>;
@@ -1,20 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MuteToggle = void 0;
3
+ exports.MuteToggle = exports.toggleMute = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
+ const use_keybinding_1 = require("../helpers/use-keybinding");
8
+ const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
7
9
  const media_volume_1 = require("../icons/media-volume");
8
10
  const mute_1 = require("../state/mute");
11
+ const ActionTooltip_1 = require("./ActionTooltip");
9
12
  const ControlButton_1 = require("./ControlButton");
13
+ const toggleMute = (setMuted) => {
14
+ setMuted((muted) => {
15
+ (0, mute_1.persistMuteOption)(!muted);
16
+ return !muted;
17
+ });
18
+ };
19
+ exports.toggleMute = toggleMute;
10
20
  const MuteToggle = ({ muted, setMuted }) => {
21
+ const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleMute');
22
+ const ariaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleMute');
23
+ const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
11
24
  const onClick = (0, react_1.useCallback)(() => {
12
- setMuted((m) => {
13
- (0, mute_1.persistMuteOption)(!m);
14
- return !m;
15
- });
25
+ (0, exports.toggleMute)(setMuted);
16
26
  }, [setMuted]);
17
27
  const accessibilityLabel = muted ? 'Unmute video' : 'Mute video';
18
- return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => muted ? jsx_runtime_1.jsx(media_volume_1.VolumeOffIcon, { color: colors_1.BLUE }) : jsx_runtime_1.jsx(media_volume_1.VolumeOnIcon, { color: color }) }));
28
+ return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, onClick: onClick, children: (color) => muted ? (jsx_runtime_1.jsx(media_volume_1.VolumeOffIcon, { color: colors_1.BLUE })) : (jsx_runtime_1.jsx(media_volume_1.VolumeOnIcon, { color: color })) }) }));
19
29
  };
20
30
  exports.MuteToggle = MuteToggle;
@@ -16,6 +16,7 @@ export type NewCompositionFormValues = {
16
16
  };
17
17
  };
18
18
  export declare const NewCompositionFields: React.FC<{
19
+ readonly compositionId: string;
19
20
  readonly heightValidationMessage: string | null;
20
21
  readonly inputRef: RefObject<HTMLInputElement | null>;
21
22
  readonly nameValidationMessage: string | null;