@remotion/studio 4.0.515 → 4.0.517

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 (277) hide show
  1. package/dist/api/restart-studio.js +4 -0
  2. package/dist/components/AssetSelector.js +4 -10
  3. package/dist/components/AssetSelectorItem.d.ts +2 -1
  4. package/dist/components/AssetSelectorItem.js +24 -29
  5. package/dist/components/Canvas.js +21 -15
  6. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  7. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  8. package/dist/components/CanvasOrLoading.js +4 -3
  9. package/dist/components/CaptionInspector.d.ts +2 -0
  10. package/dist/components/CaptionInspector.js +3 -5
  11. package/dist/components/CheckboardToggle.js +1 -1
  12. package/dist/components/Checkbox.d.ts +0 -1
  13. package/dist/components/Checkbox.js +2 -19
  14. package/dist/components/CompositionSelector.js +6 -3
  15. package/dist/components/CompositionSelectorItem.js +9 -10
  16. package/dist/components/ConfigSelect.d.ts +17 -0
  17. package/dist/components/ConfigSelect.js +50 -0
  18. package/dist/components/ConfigureLicenseModal.js +79 -46
  19. package/dist/components/CurrentAsset.d.ts +10 -2
  20. package/dist/components/CurrentAsset.js +143 -45
  21. package/dist/components/Editor.js +2 -1
  22. package/dist/components/EditorContent.js +5 -2
  23. package/dist/components/EditorContexts.js +2 -1
  24. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  25. package/dist/components/EditorRuler/Ruler.js +9 -8
  26. package/dist/components/EditorRuler/index.d.ts +1 -0
  27. package/dist/components/EditorRuler/index.js +3 -4
  28. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  29. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  30. package/dist/components/ElementLibraryModal.d.ts +5 -0
  31. package/dist/components/ElementLibraryModal.js +38 -0
  32. package/dist/components/FilePreview.js +71 -0
  33. package/dist/components/FixComputedValueModal.js +54 -51
  34. package/dist/components/GlobalKeybindings.js +5 -5
  35. package/dist/components/InlineAction.d.ts +1 -1
  36. package/dist/components/InlineAction.js +12 -2
  37. package/dist/components/InlineCaptionInspector.d.ts +2 -0
  38. package/dist/components/InlineCaptionInspector.js +2 -2
  39. package/dist/components/InlineCompositionName.js +1 -1
  40. package/dist/components/InlineEditableTitle.js +5 -4
  41. package/dist/components/InspectorInfoHeader.js +1 -1
  42. package/dist/components/InspectorOpenInEditor.js +48 -72
  43. package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
  44. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
  45. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
  46. package/dist/components/InspectorPanel/CompositionInspector.js +25 -45
  47. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  48. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  49. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  50. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  51. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  52. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
  53. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  54. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +14 -6
  55. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -7
  56. package/dist/components/InspectorPanel/common.d.ts +0 -13
  57. package/dist/components/InspectorPanel/common.js +6 -59
  58. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  59. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  60. package/dist/components/InspectorPanel/styles.js +3 -4
  61. package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
  62. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  63. package/dist/components/InspectorPanelLayout.d.ts +1 -1
  64. package/dist/components/InspectorPanelLayout.js +1 -1
  65. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  66. package/dist/components/InspectorSequenceSection.js +40 -54
  67. package/dist/components/InspectorSourceLocation.js +1 -1
  68. package/dist/components/InstallPackage.d.ts +2 -1
  69. package/dist/components/InstallPackage.js +60 -30
  70. package/dist/components/InstallablePackage.js +37 -11
  71. package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
  72. package/dist/components/KeyboardShortcutsSettings.js +177 -0
  73. package/dist/components/Menu/MenuItem.js +15 -6
  74. package/dist/components/MenuBuildIndicator.js +1 -1
  75. package/dist/components/MenuToolbar.js +7 -3
  76. package/dist/components/Modals.js +7 -5
  77. package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
  78. package/dist/components/NewComposition/CodemodFooter.js +2 -8
  79. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  80. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  81. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  82. package/dist/components/NewComposition/InputDragger.js +27 -4
  83. package/dist/components/NewComposition/NewComposition.js +1 -1
  84. package/dist/components/NewComposition/NewFolder.js +1 -3
  85. package/dist/components/NewComposition/RenameComposition.js +1 -1
  86. package/dist/components/NewComposition/RenameFolder.js +1 -1
  87. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  88. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  89. package/dist/components/Notifications/NotificationCenter.js +5 -0
  90. package/dist/components/OptionsPanel.js +9 -12
  91. package/dist/components/PlaybackRateSelector.js +1 -1
  92. package/dist/components/Preview.js +83 -5
  93. package/dist/components/PreviewToolbar.js +12 -3
  94. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  95. package/dist/components/PreviewToolbarOverflowButton.js +39 -2
  96. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
  97. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
  98. package/dist/components/RadioButton.d.ts +6 -0
  99. package/dist/components/RadioButton.js +62 -0
  100. package/dist/components/RenderButton.js +68 -184
  101. package/dist/components/RenderModal/DataEditor.js +15 -12
  102. package/dist/components/RenderModal/RenderStatusModal.js +0 -1
  103. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
  104. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
  105. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
  106. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
  107. package/dist/components/RenderingSettings.js +7 -4
  108. package/dist/components/RulersAndGuidesToggle.d.ts +4 -0
  109. package/dist/components/RulersAndGuidesToggle.js +34 -0
  110. package/dist/components/SegmentedButton.d.ts +29 -0
  111. package/dist/components/SegmentedButton.js +226 -0
  112. package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
  113. package/dist/components/SelectedOutlineEditingHandles.js +66 -0
  114. package/dist/components/SelectedOutlineElement.d.ts +2 -4
  115. package/dist/components/SelectedOutlineElement.js +15 -54
  116. package/dist/components/SelectedOutlineOverlay.js +32 -6
  117. package/dist/components/SelectedOutlinePolygon.d.ts +4 -6
  118. package/dist/components/SelectedOutlinePolygon.js +18 -16
  119. package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
  120. package/dist/components/SelectedOutlineRenderer.js +66 -14
  121. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  122. package/dist/components/SettingsModal.d.ts +1 -1
  123. package/dist/components/SettingsModal.js +30 -7
  124. package/dist/components/SettingsModalFooter.d.ts +3 -1
  125. package/dist/components/SettingsModalFooter.js +20 -4
  126. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  127. package/dist/components/ShowPixelGridProvider.js +24 -0
  128. package/dist/components/SidebarCollapserControls.js +2 -2
  129. package/dist/components/SkillsSettings.d.ts +2 -0
  130. package/dist/components/SkillsSettings.js +129 -0
  131. package/dist/components/StaticFilePreview.js +7 -1
  132. package/dist/components/StudioSettings.js +7 -48
  133. package/dist/components/Tabs/index.js +1 -1
  134. package/dist/components/Timeline/Timeline.js +41 -1
  135. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  136. package/dist/components/Timeline/TimelineAssetField.js +15 -9
  137. package/dist/components/Timeline/TimelineBooleanField.js +1 -4
  138. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  139. package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
  140. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  141. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  142. package/dist/components/Timeline/TimelineEffectItem.js +23 -10
  143. package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
  144. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  145. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  146. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
  147. package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
  148. package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
  149. package/dist/components/Timeline/TimelineImageInfo.js +13 -32
  150. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  151. package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
  152. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  153. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  154. package/dist/components/Timeline/TimelineRotationField.js +0 -2
  155. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
  156. package/dist/components/Timeline/TimelineRowChrome.js +3 -4
  157. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
  158. package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
  159. package/dist/components/Timeline/TimelineScaleField.js +2 -6
  160. package/dist/components/Timeline/TimelineSchemaField.js +9 -3
  161. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  162. package/dist/components/Timeline/TimelineSelection.js +31 -171
  163. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  164. package/dist/components/Timeline/TimelineSequence.js +110 -19
  165. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  166. package/dist/components/Timeline/TimelineSequenceItem.js +13 -11
  167. package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
  168. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +7 -6
  169. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
  170. package/dist/components/Timeline/TimelineTrack.js +1 -1
  171. package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
  172. package/dist/components/Timeline/TimelineTranslateField.js +0 -4
  173. package/dist/components/Timeline/TimelineVirtualization.js +3 -1
  174. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  175. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  176. package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
  177. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  178. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
  179. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
  180. package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
  181. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
  182. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
  183. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  184. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  185. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  186. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  187. package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
  188. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  189. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  190. package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
  191. package/dist/components/Timeline/timeline-field-utils.js +0 -2
  192. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  193. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  194. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  195. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -0
  196. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  197. package/dist/components/TimelineCombobox.js +25 -160
  198. package/dist/components/TimelineInOutToggle.js +4 -1
  199. package/dist/components/canvas-capture-drop.d.ts +4 -0
  200. package/dist/components/canvas-capture-drop.js +22 -0
  201. package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
  202. package/dist/components/duplicate-jsx-node-api.js +12 -0
  203. package/dist/components/effect-drag-and-drop.js +1 -4
  204. package/dist/components/handle-drop.d.ts +2 -1
  205. package/dist/components/handle-drop.js +3 -3
  206. package/dist/components/import-assets.js +9 -65
  207. package/dist/components/keyboard-shortcuts.d.ts +10 -0
  208. package/dist/components/keyboard-shortcuts.js +135 -0
  209. package/dist/components/selected-outline-control-layout.js +2 -6
  210. package/dist/components/selected-outline-measurement.d.ts +8 -9
  211. package/dist/components/selected-outline-measurement.js +16 -3
  212. package/dist/components/use-delete-asset.d.ts +1 -0
  213. package/dist/components/use-delete-asset.js +40 -0
  214. package/dist/components/use-selected-outline-control-target.d.ts +11 -0
  215. package/dist/components/use-selected-outline-control-target.js +79 -0
  216. package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
  217. package/dist/esm/{chunk-v5a8vpv4.js → chunk-gzqm3g2m.js} +47432 -40444
  218. package/dist/esm/index.mjs +3 -0
  219. package/dist/esm/internals.mjs +47431 -40443
  220. package/dist/esm/previewEntry.mjs +47169 -40181
  221. package/dist/esm/renderEntry.mjs +2 -2
  222. package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
  223. package/dist/helpers/add-asset-cache-bust.js +10 -0
  224. package/dist/helpers/calculate-timeline.d.ts +1 -7
  225. package/dist/helpers/calculate-timeline.js +2 -145
  226. package/dist/helpers/colors.d.ts +2 -0
  227. package/dist/helpers/colors.js +6 -2
  228. package/dist/helpers/drag-aware-double-click.d.ts +6 -0
  229. package/dist/helpers/drag-aware-double-click.js +20 -0
  230. package/dist/helpers/editor-ruler.js +6 -5
  231. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  232. package/dist/helpers/get-asset-metadata.js +75 -21
  233. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  234. package/dist/helpers/get-connected-compositions.js +2 -8
  235. package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
  236. package/dist/helpers/get-sequence-double-click-action.js +7 -1
  237. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  238. package/dist/helpers/get-sequence-visible-range.js +6 -51
  239. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  240. package/dist/helpers/get-timeline-nestedness.js +2 -12
  241. package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
  242. package/dist/helpers/get-timeline-sequence-layout.js +15 -6
  243. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -21
  244. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  245. package/dist/helpers/hoverable.d.ts +1 -0
  246. package/dist/helpers/hoverable.js +2 -1
  247. package/dist/helpers/inject-css.js +3 -1
  248. package/dist/helpers/is-current-selected-still.js +4 -2
  249. package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
  250. package/dist/helpers/open-in-remotion-convert.js +18 -0
  251. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  252. package/dist/helpers/sort-by-nonce-history.js +3 -148
  253. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  254. package/dist/helpers/timeline-node-path-key.js +2 -2
  255. package/dist/helpers/use-media-metadata.d.ts +2 -1
  256. package/dist/helpers/use-media-metadata.js +12 -5
  257. package/dist/helpers/use-menu-structure.js +52 -32
  258. package/dist/icons/align-center-horizontal.js +1 -1
  259. package/dist/icons/align-left.js +1 -1
  260. package/dist/icons/align-right.js +1 -1
  261. package/dist/icons/keyboard.d.ts +4 -0
  262. package/dist/icons/keyboard.js +10 -0
  263. package/dist/icons/license.d.ts +4 -0
  264. package/dist/icons/license.js +8 -0
  265. package/dist/icons/package.d.ts +4 -0
  266. package/dist/icons/package.js +8 -0
  267. package/dist/icons/react.js +1 -1
  268. package/dist/icons/remotion-convert.d.ts +4 -0
  269. package/dist/icons/remotion-convert.js +10 -0
  270. package/dist/icons/skills.d.ts +4 -0
  271. package/dist/icons/skills.js +10 -0
  272. package/dist/state/editor-pixel-grid.d.ts +8 -0
  273. package/dist/state/editor-pixel-grid.js +18 -0
  274. package/dist/state/modals.d.ts +6 -5
  275. package/package.json +14 -12
  276. package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
  277. package/dist/components/KeyboardShortcutsExplainer.js +0 -194
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const ElementLibraryModal: React.FC<{
3
+ readonly name: string;
4
+ readonly url: string;
5
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ElementLibraryModal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const ModalContainer_1 = require("./ModalContainer");
7
+ const ModalHeader_1 = require("./ModalHeader");
8
+ const DismissableModal_1 = require("./NewComposition/DismissableModal");
9
+ const panelStyle = {
10
+ display: 'flex',
11
+ flexDirection: 'column',
12
+ height: (0, ModalContainer_1.getMaxModalHeight)(1000),
13
+ overflow: 'hidden',
14
+ width: (0, ModalContainer_1.getMaxModalWidth)(1400),
15
+ };
16
+ const iframeStyle = {
17
+ border: 0,
18
+ flex: 1,
19
+ minHeight: 0,
20
+ width: '100%',
21
+ };
22
+ const ElementLibraryModal = ({ name, url }) => {
23
+ const iframeRef = (0, react_1.useRef)(null);
24
+ (0, react_1.useLayoutEffect)(() => {
25
+ const iframe = iframeRef.current;
26
+ if (iframe === null) {
27
+ return;
28
+ }
29
+ // Studio is cross-origin isolated. A credentialless iframe may embed a
30
+ // library that does not set Cross-Origin-Resource-Policy headers.
31
+ iframe.setAttribute('credentialless', '');
32
+ iframe.src = url;
33
+ }, [url]);
34
+ return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
35
+ jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: name }), jsx_runtime_1.jsx("iframe", { ref: iframeRef, allow: "local-network-access; loopback-network", style: iframeStyle, title: `${name} library` })
36
+ ] }));
37
+ };
38
+ exports.ElementLibraryModal = ElementLibraryModal;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilePreview = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
+ const react_1 = require("react");
6
7
  const colors_1 = require("../helpers/colors");
7
8
  const JSONViewer_1 = require("./JSONViewer");
8
9
  const layout_1 = require("./layout");
@@ -14,6 +15,73 @@ const msgStyle = {
14
15
  display: 'flex',
15
16
  justifyContent: 'center',
16
17
  };
18
+ const fontPreviewContainerStyle = {
19
+ display: 'flex',
20
+ flex: 1,
21
+ flexDirection: 'column',
22
+ justifyContent: 'center',
23
+ overflow: 'hidden',
24
+ padding: 40,
25
+ textAlign: 'center',
26
+ };
27
+ const fontPreviewLargeTextStyle = {
28
+ color: colors_1.WHITE,
29
+ fontSize: 'clamp(80px, 18vh, 180px)',
30
+ lineHeight: 1,
31
+ };
32
+ const fontPreviewTextStyle = {
33
+ color: colors_1.LIGHT_TEXT,
34
+ fontSize: 'clamp(18px, 4vh, 40px)',
35
+ lineHeight: 1.35,
36
+ marginTop: 32,
37
+ wordBreak: 'break-word',
38
+ };
39
+ let fontPreviewId = 0;
40
+ const FontPreview = ({ src }) => {
41
+ const [fontFamily] = (0, react_1.useState)(() => {
42
+ fontPreviewId++;
43
+ return `RemotionStudioFontPreview${fontPreviewId}`;
44
+ });
45
+ const [fontLoaded, setFontLoaded] = (0, react_1.useState)(false);
46
+ const [fontLoadFailed, setFontLoadFailed] = (0, react_1.useState)(false);
47
+ (0, react_1.useEffect)(() => {
48
+ let cancelled = false;
49
+ const fontFace = new FontFace(fontFamily, `url(${JSON.stringify(src)})`);
50
+ setFontLoaded(false);
51
+ setFontLoadFailed(false);
52
+ fontFace
53
+ .load()
54
+ .then((loadedFontFace) => {
55
+ if (cancelled) {
56
+ return;
57
+ }
58
+ document.fonts.add(loadedFontFace);
59
+ setFontLoaded(true);
60
+ })
61
+ .catch(() => {
62
+ if (!cancelled) {
63
+ setFontLoadFailed(true);
64
+ }
65
+ });
66
+ return () => {
67
+ cancelled = true;
68
+ document.fonts.delete(fontFace);
69
+ };
70
+ }, [fontFamily, src]);
71
+ if (fontLoadFailed) {
72
+ return jsx_runtime_1.jsx("div", { style: msgStyle, children: "Could not preview font" });
73
+ }
74
+ if (!fontLoaded) {
75
+ return jsx_runtime_1.jsx("div", { style: msgStyle, children: "Loading font preview..." });
76
+ }
77
+ return (jsx_runtime_1.jsxs("div", { style: { ...fontPreviewContainerStyle, fontFamily }, children: [
78
+ jsx_runtime_1.jsx("div", { style: fontPreviewLargeTextStyle, children: "Aa" }), jsx_runtime_1.jsxs("div", { style: fontPreviewTextStyle, children: ["ABCDEFGHIJKLMNOPQRSTUVWXYZ",
79
+ jsx_runtime_1.jsx("br", {}),
80
+ "abcdefghijklmnopqrstuvwxyz",
81
+ jsx_runtime_1.jsx("br", {}),
82
+ "0123456789"] })
83
+ ] }));
84
+ };
17
85
  const FilePreview = ({ fileType, src, currentAsset, assetMetadata }) => {
18
86
  if (!assetMetadata) {
19
87
  throw new Error('expected to have assetMetadata');
@@ -33,6 +101,9 @@ const FilePreview = ({ fileType, src, currentAsset, assetMetadata }) => {
33
101
  if (fileType === 'image') {
34
102
  return jsx_runtime_1.jsx("img", { src: src });
35
103
  }
104
+ if (fileType === 'font') {
105
+ return jsx_runtime_1.jsx(FontPreview, { src: src });
106
+ }
36
107
  if (fileType === 'json') {
37
108
  return jsx_runtime_1.jsx(JSONViewer_1.JSONViewer, { src: src });
38
109
  }
@@ -41,14 +41,13 @@ const copy_text_1 = require("../helpers/copy-text");
41
41
  const open_in_editor_1 = require("../helpers/open-in-editor");
42
42
  const caret_1 = require("../icons/caret");
43
43
  const clipboard_1 = require("../icons/clipboard");
44
- const z_index_1 = require("../state/z-index");
45
44
  const CodingAgentIcon_1 = require("./CodingAgentIcon");
46
45
  const InlineAction_1 = require("./InlineAction");
47
- const InlineDropdown_1 = require("./InlineDropdown");
48
46
  const ModalFooter_1 = require("./ModalFooter");
49
47
  const ModalHeader_1 = require("./ModalHeader");
50
48
  const DismissableModal_1 = require("./NewComposition/DismissableModal");
51
49
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
50
+ const SegmentedButton_1 = require("./SegmentedButton");
52
51
  const SettingsContext_1 = require("./SettingsContext");
53
52
  const panelStyle = {
54
53
  borderRadius: 6,
@@ -94,36 +93,13 @@ const footer = {
94
93
  flex: 'none',
95
94
  justifyContent: 'flex-end',
96
95
  };
97
- const splitButton = {
98
- alignItems: 'center',
99
- borderRadius: 4,
100
- display: 'inline-flex',
101
- flexDirection: 'row',
102
- gap: 1,
103
- height: 24,
104
- overflow: 'hidden',
105
- };
106
- const mainButtonBase = {
107
- alignItems: 'center',
108
- background: colors_1.TRANSPARENT,
109
- border: 'none',
110
- borderRadius: '4px 0 0 4px',
111
- color: colors_1.LIGHT_TEXT,
112
- display: 'inline-flex',
113
- fontFamily: 'sans-serif',
114
- fontSize: 12,
96
+ const mainSegmentStyle = {
115
97
  gap: 6,
116
- height: 24,
117
98
  padding: '0 9px',
118
- whiteSpace: 'nowrap',
119
99
  };
120
- const singleButton = {
121
- borderRadius: 4,
122
- };
123
- const dropdownButton = {
124
- borderRadius: '0 4px 4px 0',
125
- height: 24,
126
- width: 24,
100
+ const dropdownSegmentStyle = {
101
+ padding: 0,
102
+ width: 20,
127
103
  };
128
104
  const menuLabel = {
129
105
  color: 'inherit',
@@ -134,8 +110,6 @@ const menuLabel = {
134
110
  const FixComputedValueModal = ({ state }) => {
135
111
  var _a, _b;
136
112
  const { codingAgentInfo } = (0, SettingsContext_1.useSettings)();
137
- const { tabIndex } = (0, z_index_1.useZIndex)();
138
- const [hovered, setHovered] = react_1.default.useState(false);
139
113
  const prompt = `/remotion-interactivity ${state.context} make "${state.prop}" interactive`;
140
114
  const installCommand = 'npx remotion skills add';
141
115
  const installedCodingAgents = (_a = codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents) !== null && _a !== void 0 ? _a : [];
@@ -180,20 +154,54 @@ const FixComputedValueModal = ({ state }) => {
180
154
  value: `coding-agent-${codingAgent.id}`,
181
155
  }));
182
156
  }, [alternativeCodingAgents, openWithCodingAgent]);
183
- const renderDropdownAction = (0, react_1.useCallback)((color) => {
184
- return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
185
- }, []);
186
- const mainButtonStyle = react_1.default.useMemo(() => {
187
- return {
188
- ...mainButtonBase,
189
- ...(alternativeCodingAgents.length === 0 ? singleButton : null),
190
- background: (0, colors_1.getBackgroundFromHoverState)({
191
- hovered,
192
- selected: false,
193
- }),
194
- color: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
195
- };
196
- }, [alternativeCodingAgents.length, hovered]);
157
+ const segments = react_1.default.useMemo(() => {
158
+ if (!defaultCodingAgent) {
159
+ return [];
160
+ }
161
+ return [
162
+ {
163
+ ariaLabel: `Open in ${defaultCodingAgent.nameWithType}`,
164
+ buttonId: null,
165
+ disabled: false,
166
+ idleColor: colors_1.LIGHT_TEXT,
167
+ onClick: () => {
168
+ openWithCodingAgent(defaultCodingAgent.id, defaultCodingAgent.nameWithType).catch(() => undefined);
169
+ },
170
+ onPointerDown: null,
171
+ renderContent: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
172
+ jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: defaultCodingAgent.id, size: 18 }),
173
+ "Open in ", defaultCodingAgent.name] })),
174
+ segmentId: 'default-coding-agent',
175
+ style: mainSegmentStyle,
176
+ title: `Open in ${defaultCodingAgent.nameWithType}`,
177
+ type: 'action',
178
+ },
179
+ ...(alternativeCodingAgents.length > 0
180
+ ? [
181
+ {
182
+ ariaLabel: 'Open in another coding agent',
183
+ buttonId: null,
184
+ disabled: false,
185
+ idleColor: colors_1.LIGHT_TEXT,
186
+ leaveLeftSpace: true,
187
+ onOpenChange: null,
188
+ renderContent: (color) => jsx_runtime_1.jsx(caret_1.CaretDown, { color: color }),
189
+ segmentId: 'another-coding-agent',
190
+ selectedId: null,
191
+ style: dropdownSegmentStyle,
192
+ title: 'Open in another coding agent',
193
+ type: 'menu',
194
+ values: agentMenuItems,
195
+ },
196
+ ]
197
+ : []),
198
+ ];
199
+ }, [
200
+ agentMenuItems,
201
+ alternativeCodingAgents.length,
202
+ defaultCodingAgent,
203
+ openWithCodingAgent,
204
+ ]);
197
205
  return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
198
206
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Fix computed value" }), jsx_runtime_1.jsxs("div", { style: container, children: [state.remotionInteractivitySkillAvailable ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
199
207
  jsx_runtime_1.jsx("div", { style: text, children: "First, install the Remotion Agent Skills:" }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
@@ -207,11 +215,6 @@ const FixComputedValueModal = ({ state }) => {
207
215
  : 'Then, paste this prompt into your coding agent:' }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
208
216
  jsx_runtime_1.jsx("pre", { style: code, children: prompt }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopyPrompt, renderAction: renderCopyAction, title: "Copy prompt" })
209
217
  ] })
210
- ] }), defaultCodingAgent ? (jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footer, children: jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
211
- jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${defaultCodingAgent.nameWithType}`, onClick: () => {
212
- openWithCodingAgent(defaultCodingAgent.id, defaultCodingAgent.nameWithType).catch(() => undefined);
213
- }, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${defaultCodingAgent.nameWithType}`, type: "button", children: [
214
- jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: defaultCodingAgent.id, size: 18 }),
215
- "Open in ", defaultCodingAgent.name] }), alternativeCodingAgents.length > 0 ? (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderDropdownAction, style: dropdownButton, title: "Open in another coding agent", values: agentMenuItems, variant: null })) : null] }) })) : null] }));
218
+ ] }), defaultCodingAgent ? (jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footer, children: jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: null, title: null }) })) : null] }));
216
219
  };
217
220
  exports.FixComputedValueModal = FixComputedValueModal;
@@ -162,12 +162,12 @@ const GlobalKeybindings = () => {
162
162
  event: 'keypress',
163
163
  key: '?',
164
164
  callback: () => {
165
+ var _a;
166
+ var _b;
165
167
  setSelectedModal({
166
- type: 'quick-switcher',
167
- mode: 'docs',
168
- invocationTimestamp: Date.now(),
169
- assetSelection: null,
170
- compositionSelection: null,
168
+ type: 'settings',
169
+ initialTab: 'shortcuts',
170
+ initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
171
171
  });
172
172
  },
173
173
  commandCtrlKey: false,
@@ -8,4 +8,4 @@ export type InlineActionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElemen
8
8
  readonly variant: 'compact' | null;
9
9
  readonly style?: React.CSSProperties;
10
10
  };
11
- export declare const InlineAction: ({ renderAction, onClick, disabled, title, hoveredColor, unhoveredColor, variant, style: customStyle, className, ...buttonProps }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const InlineAction: ({ renderAction, onClick, disabled, title, hoveredColor, unhoveredColor, variant, style: customStyle, className, onPointerDown: onPointerDownProp, ...buttonProps }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,9 +6,19 @@ const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
7
  const hoverable_1 = require("../helpers/hoverable");
8
8
  const z_index_1 = require("../state/z-index");
9
- const InlineAction = ({ renderAction, onClick, disabled, title, hoveredColor = colors_1.WHITE, unhoveredColor = colors_1.LIGHT_TEXT, variant, style: customStyle, className, ...buttonProps }) => {
9
+ const InlineAction = ({ renderAction, onClick, disabled, title, hoveredColor = colors_1.WHITE, unhoveredColor = colors_1.LIGHT_TEXT, variant, style: customStyle, className, onPointerDown: onPointerDownProp, ...buttonProps }) => {
10
10
  var _a;
11
11
  const { tabIndex } = (0, z_index_1.useZIndex)();
12
+ const onPointerDown = (0, react_1.useCallback)((event) => {
13
+ onPointerDownProp === null || onPointerDownProp === void 0 ? void 0 : onPointerDownProp(event);
14
+ if (event.button !== 0) {
15
+ return;
16
+ }
17
+ if (document.activeElement instanceof HTMLElement) {
18
+ document.activeElement.blur();
19
+ }
20
+ event.preventDefault();
21
+ }, [onPointerDownProp]);
12
22
  const style = (0, react_1.useMemo)(() => {
13
23
  return {
14
24
  border: 'none',
@@ -34,6 +44,6 @@ const InlineAction = ({ renderAction, onClick, disabled, title, hoveredColor = c
34
44
  }, [customStyle, disabled, hoveredColor, unhoveredColor, variant]);
35
45
  return (jsx_runtime_1.jsx("button", { ...buttonProps, type: "button", className: className
36
46
  ? `${hoverable_1.HOVERABLE_CLASS_NAME} ${className}`
37
- : hoverable_1.HOVERABLE_CLASS_NAME, disabled: disabled, onClick: onClick, style: style, tabIndex: tabIndex, title: title, "aria-label": (_a = buttonProps['aria-label']) !== null && _a !== void 0 ? _a : title, children: renderAction(colors_1.CURRENT_COLOR) }));
47
+ : hoverable_1.HOVERABLE_CLASS_NAME, disabled: disabled, onClick: onClick, onPointerDown: onPointerDown, style: style, tabIndex: tabIndex, title: title, "aria-label": (_a = buttonProps['aria-label']) !== null && _a !== void 0 ? _a : title, children: renderAction(colors_1.CURRENT_COLOR) }));
38
48
  };
39
49
  exports.InlineAction = InlineAction;
@@ -5,7 +5,9 @@ import type { CodePosition } from '../error-overlay/react-overlay/utils/get-sour
5
5
  export declare const InlineCaptionInspector: React.FC<{
6
6
  readonly captions: Caption[];
7
7
  readonly controls: SequenceRegistrationControls;
8
+ readonly expanded: boolean;
8
9
  readonly nodePath: SequencePropsSubscriptionKey;
10
+ readonly onToggle: () => void;
9
11
  readonly readOnlyStudio: boolean;
10
12
  readonly validatedLocation: CodePosition;
11
13
  }>;
@@ -30,7 +30,7 @@ const getCaptionPatches = ({ previous, next, }) => {
30
30
  }
31
31
  return patches;
32
32
  };
33
- const InlineCaptionInspector = ({ captions, controls, nodePath, readOnlyStudio, validatedLocation }) => {
33
+ const InlineCaptionInspector = ({ captions, controls, expanded, nodePath, onToggle, readOnlyStudio, validatedLocation, }) => {
34
34
  var _a;
35
35
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
36
36
  const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
@@ -103,6 +103,6 @@ const InlineCaptionInspector = ({ captions, controls, nodePath, readOnlyStudio,
103
103
  : (captionStatus === null || captionStatus === void 0 ? void 0 : captionStatus.status) === 'computed'
104
104
  ? 'Captions must be a direct inline JSX array to edit them'
105
105
  : 'Captions are not ready for editing';
106
- return (jsx_runtime_1.jsx(CaptionInspector_1.CaptionInspector, { captions: draftCaptions, onTextChange: updateCaptions, onTextSave: saveCaptions, onTextCancel: cancelCaptions, readOnly: !canSave, readOnlyTitle: canSave ? null : readOnlyTitle }));
106
+ return (jsx_runtime_1.jsx(CaptionInspector_1.CaptionInspector, { captions: draftCaptions, expanded: expanded, onTextChange: updateCaptions, onTextSave: saveCaptions, onTextCancel: cancelCaptions, onToggle: onToggle, readOnly: !canSave, readOnlyTitle: canSave ? null : readOnlyTitle }));
107
107
  };
108
108
  exports.InlineCaptionInspector = InlineCaptionInspector;
@@ -41,7 +41,7 @@ const InlineCompositionName = ({ compositionId, stack, compositions }) => {
41
41
  notification.replaceContent(`Could not rename composition: ${result.reason}`, 2000);
42
42
  return;
43
43
  }
44
- notification.replaceContent(`Renamed to ${newId}`, 2000);
44
+ notification.dismiss();
45
45
  })
46
46
  .catch((err) => {
47
47
  notification.replaceContent(`Could not rename composition: ${err.message}`, 2000);
@@ -4,6 +4,7 @@ exports.InlineEditableTitle = 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 InspectorPanelLayout_1 = require("./InspectorPanelLayout");
7
8
  const layout_1 = require("./layout");
8
9
  const titleWrapper = {
9
10
  boxSizing: 'border-box',
@@ -58,7 +59,7 @@ const inspectorTitleWrapper = {
58
59
  ...titleWrapper,
59
60
  fontFamily: 'sans-serif',
60
61
  fontSize: 13,
61
- height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
62
+ height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
62
63
  margin: '0 4px',
63
64
  width: 'calc(100% - 8px)',
64
65
  };
@@ -67,10 +68,10 @@ const inspectorTitleInner = {
67
68
  alignItems: 'center',
68
69
  fontFamily: 'sans-serif',
69
70
  fontSize: 13,
70
- height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
71
+ height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
71
72
  paddingBottom: 0,
72
- paddingLeft: 8,
73
- paddingRight: 8,
73
+ paddingLeft: InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4,
74
+ paddingRight: InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4,
74
75
  paddingTop: 0,
75
76
  width: '100%',
76
77
  };
@@ -52,7 +52,7 @@ const inspectorSubtitle = {
52
52
  height: 20,
53
53
  lineHeight: '20px',
54
54
  margin: '0 4px',
55
- padding: '0 8px',
55
+ padding: `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4}px`,
56
56
  width: 'calc(100% - 8px)',
57
57
  };
58
58
  const InspectorInfoHeader = ({ children, contentSized = false, minHeight, padding }) => {
@@ -10,45 +10,25 @@ const open_in_editor_1 = require("../helpers/open-in-editor");
10
10
  const caret_1 = require("../icons/caret");
11
11
  const editor_1 = require("../icons/editor");
12
12
  const modals_1 = require("../state/modals");
13
- const z_index_1 = require("../state/z-index");
14
13
  const get_open_in_menu_items_1 = require("./get-open-in-menu-items");
15
- const InlineDropdown_1 = require("./InlineDropdown");
16
14
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
17
15
  const actions_1 = require("./RenderQueue/actions");
16
+ const SegmentedButton_1 = require("./SegmentedButton");
18
17
  const use_default_editor_info_1 = require("./use-default-editor-info");
19
- const splitButton = {
20
- alignItems: 'center',
21
- borderRadius: 3,
22
- display: 'inline-flex',
23
- flexDirection: 'row',
24
- flexShrink: 0,
25
- gap: 1,
26
- height: 24,
27
- overflow: 'hidden',
28
- };
29
- const mainButtonBase = {
30
- alignItems: 'center',
31
- background: colors_1.TRANSPARENT,
32
- border: 'none',
33
- borderRadius: '3px 0 0 3px',
34
- color: colors_1.LIGHT_TEXT,
18
+ const mainSegmentStyle = {
35
19
  columnGap: 4,
36
- display: 'inline-flex',
37
- fontFamily: 'sans-serif',
38
20
  fontSize: 11,
39
- height: 24,
40
21
  lineHeight: '14px',
41
- padding: '0 6px',
42
- whiteSpace: 'nowrap',
22
+ padding: '0 2px 0 4px',
23
+ };
24
+ const dropdownSegmentStyle = {
25
+ padding: 0,
26
+ width: 20,
43
27
  };
44
28
  const editorButtonIconSize = 18;
45
29
  const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locationType }) => {
46
30
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
47
31
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
48
- const { tabIndex } = (0, z_index_1.useZIndex)();
49
- const [hovered, setHovered] = (0, react_1.useState)(false);
50
- const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
51
- const ignorePointerEnter = (0, react_1.useRef)(false);
52
32
  const { canConfigureApps, canOpenInEditor, defaultEditorId, defaultEditorName, editorInfo, } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
53
33
  const codingAgentInfo = (0, use_default_editor_info_1.useDefaultCodingAgentInfo)(canConfigureApps);
54
34
  const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
@@ -81,40 +61,6 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
81
61
  openWithEditor(defaultEditorId).catch(() => undefined);
82
62
  }
83
63
  }, [defaultEditorId, openWithEditor]);
84
- const onDropdownOpenChange = (0, react_1.useCallback)((open) => {
85
- setDropdownOpened(open);
86
- if (!open) {
87
- ignorePointerEnter.current = true;
88
- setHovered(false);
89
- }
90
- }, []);
91
- const mainHovered = hovered && !dropdownOpened;
92
- const mainButtonStyle = (0, react_1.useMemo)(() => {
93
- return {
94
- ...mainButtonBase,
95
- background: (0, colors_1.getBackgroundFromHoverState)({
96
- hovered: mainHovered,
97
- selected: false,
98
- }),
99
- color: mainHovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
100
- opacity: canOpenDefault ? 1 : 0.5,
101
- pointerEvents: canOpenDefault ? 'auto' : 'none',
102
- };
103
- }, [canOpenDefault, mainHovered]);
104
- const dropdownForegroundColor = hovered || dropdownOpened ? colors_1.WHITE : colors_1.LIGHT_TEXT;
105
- const dropdownStyle = (0, react_1.useMemo)(() => {
106
- return {
107
- background: (0, colors_1.getBackgroundFromHoverState)({
108
- hovered,
109
- selected: dropdownOpened,
110
- }),
111
- borderRadius: '0 3px 3px 0',
112
- color: dropdownForegroundColor,
113
- };
114
- }, [dropdownForegroundColor, dropdownOpened, hovered]);
115
- const renderDropdownAction = (0, react_1.useCallback)((color) => {
116
- return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
117
- }, []);
118
64
  const menuItems = (0, react_1.useMemo)(() => {
119
65
  return (0, get_open_in_menu_items_1.getOpenInMenuItems)({
120
66
  codingAgentInfo,
@@ -187,20 +133,50 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
187
133
  openWithEditor,
188
134
  setSelectedModal,
189
135
  ]);
136
+ const segments = (0, react_1.useMemo)(() => {
137
+ return [
138
+ {
139
+ ariaLabel: `Open in ${editorName}`,
140
+ buttonId: null,
141
+ disabled: !canOpenDefault,
142
+ idleColor: colors_1.LIGHT_TEXT,
143
+ onClick: onOpenDefault,
144
+ onPointerDown: null,
145
+ renderContent: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [label, jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: defaultEditorId, size: editorButtonIconSize })
146
+ ] })),
147
+ segmentId: 'default-editor',
148
+ style: mainSegmentStyle,
149
+ title: `Open in ${editorName}`,
150
+ type: 'action',
151
+ },
152
+ {
153
+ ariaLabel: 'Open in another app',
154
+ buttonId: null,
155
+ disabled: false,
156
+ idleColor: colors_1.LIGHT_TEXT,
157
+ leaveLeftSpace: true,
158
+ onOpenChange: null,
159
+ renderContent: (color) => jsx_runtime_1.jsx(caret_1.CaretDown, { color: color }),
160
+ segmentId: 'another-app',
161
+ selectedId: null,
162
+ style: dropdownSegmentStyle,
163
+ title: 'Open in another app',
164
+ type: 'menu',
165
+ values: menuItems,
166
+ },
167
+ ];
168
+ }, [
169
+ canOpenDefault,
170
+ defaultEditorId,
171
+ editorName,
172
+ label,
173
+ menuItems,
174
+ onOpenDefault,
175
+ ]);
190
176
  if (previewServerState.type !== 'connected' ||
191
177
  (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
192
178
  return null;
193
179
  }
194
- return (jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => {
195
- if (!ignorePointerEnter.current) {
196
- setHovered(true);
197
- }
198
- }, onPointerLeave: () => {
199
- ignorePointerEnter.current = false;
200
- setHovered(false);
201
- }, children: [
202
- jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: [label, jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: defaultEditorId, size: editorButtonIconSize })
203
- ] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { onOpenChange: onDropdownOpenChange, renderAction: renderDropdownAction, style: dropdownStyle, title: "Open in another app", unhoveredColor: dropdownForegroundColor, values: menuItems, variant: "compact" })
204
- ] }));
180
+ return jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: null, title: null });
205
181
  };
206
182
  exports.InspectorOpenInEditor = InspectorOpenInEditor;
@@ -39,10 +39,9 @@ const iconStyle = {
39
39
  width: 16,
40
40
  height: 16,
41
41
  };
42
- const verticalDivider = {
42
+ const verticalSpacer = {
43
43
  width: 1,
44
44
  height: 16,
45
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
46
45
  margin: '0 8px',
47
46
  };
48
47
  const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
@@ -218,7 +217,7 @@ const AlignmentControls = ({ track }) => {
218
217
  }
219
218
  const alignmentDisabled = !isPropStatusDraggable(renderPropStatus);
220
219
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
221
- jsx_runtime_1.jsx(AlignmentButton, { title: "Align left", onClick: () => handleAlign('left'), Icon: align_left_1.AlignLeftIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center horizontally", onClick: () => handleAlign('center-h'), Icon: align_center_horizontal_1.AlignCenterHorizontalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align right", onClick: () => handleAlign('right'), Icon: align_right_1.AlignRightIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx("div", { style: verticalDivider }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align top", onClick: () => handleAlign('top'), Icon: align_top_1.AlignTopIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center vertically", onClick: () => handleAlign('center-v'), Icon: align_center_vertical_1.AlignCenterVerticalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align bottom", onClick: () => handleAlign('bottom'), Icon: align_bottom_1.AlignBottomIcon, disabled: alignmentDisabled })
220
+ jsx_runtime_1.jsx(AlignmentButton, { title: "Align left", onClick: () => handleAlign('left'), Icon: align_left_1.AlignLeftIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center horizontally", onClick: () => handleAlign('center-h'), Icon: align_center_horizontal_1.AlignCenterHorizontalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align right", onClick: () => handleAlign('right'), Icon: align_right_1.AlignRightIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx("div", { style: verticalSpacer }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align top", onClick: () => handleAlign('top'), Icon: align_top_1.AlignTopIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center vertically", onClick: () => handleAlign('center-v'), Icon: align_center_vertical_1.AlignCenterVerticalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align bottom", onClick: () => handleAlign('bottom'), Icon: align_bottom_1.AlignBottomIcon, disabled: alignmentDisabled })
222
221
  ] }));
223
222
  };
224
223
  exports.AlignmentControls = AlignmentControls;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare const CollapsibleInspectorSectionHeader: React.FC<{
3
+ readonly action: React.ReactNode;
4
+ readonly expanded: boolean;
5
+ readonly label: string;
6
+ readonly onToggle: () => void;
7
+ }>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollapsibleInspectorSectionHeader = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const colors_1 = require("../../helpers/colors");
6
+ const hoverable_1 = require("../../helpers/hoverable");
7
+ const styles_1 = require("./styles");
8
+ const collapsibleSectionHeaderButton = {
9
+ appearance: 'none',
10
+ backgroundColor: 'transparent',
11
+ border: 'none',
12
+ borderRadius: 3,
13
+ cursor: 'default',
14
+ display: 'block',
15
+ flex: 1,
16
+ fontFamily: 'Arial, Helvetica, sans-serif',
17
+ fontSize: 12,
18
+ fontWeight: 'bold',
19
+ lineHeight: '16px',
20
+ margin: 0,
21
+ minWidth: 0,
22
+ overflow: 'hidden',
23
+ padding: '4px 0',
24
+ textAlign: 'left',
25
+ textOverflow: 'ellipsis',
26
+ userSelect: 'none',
27
+ whiteSpace: 'nowrap',
28
+ ...(0, hoverable_1.hoverableStyle)({
29
+ idleBackground: colors_1.TRANSPARENT,
30
+ hoverBackground: colors_1.TRANSPARENT,
31
+ idleColor: colors_1.LIGHT_TEXT,
32
+ hoverColor: colors_1.WHITE,
33
+ }),
34
+ };
35
+ const CollapsibleInspectorSectionHeader = ({ action, expanded, label, onToggle }) => {
36
+ return (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
37
+ jsx_runtime_1.jsx("button", { type: "button", "aria-expanded": expanded, "aria-label": `${expanded ? 'Collapse' : 'Expand'} ${label}`, className: `__remotion-inspector-section-title ${hoverable_1.HOVERABLE_CLASS_NAME}`, onClick: onToggle, style: collapsibleSectionHeaderButton, children: label }), action] }));
38
+ };
39
+ exports.CollapsibleInspectorSectionHeader = CollapsibleInspectorSectionHeader;