@remotion/studio 4.0.515 → 4.0.516

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 (196) hide show
  1. package/dist/api/restart-studio.js +4 -0
  2. package/dist/components/AssetSelector.js +3 -9
  3. package/dist/components/AssetSelectorItem.d.ts +2 -1
  4. package/dist/components/AssetSelectorItem.js +24 -29
  5. package/dist/components/Canvas.js +7 -4
  6. package/dist/components/CaptionInspector.d.ts +2 -0
  7. package/dist/components/CaptionInspector.js +3 -5
  8. package/dist/components/CompositionSelector.js +6 -3
  9. package/dist/components/CompositionSelectorItem.js +9 -10
  10. package/dist/components/ConfigSelect.d.ts +17 -0
  11. package/dist/components/ConfigSelect.js +50 -0
  12. package/dist/components/CurrentAsset.d.ts +10 -2
  13. package/dist/components/CurrentAsset.js +139 -46
  14. package/dist/components/FixComputedValueModal.js +54 -51
  15. package/dist/components/GlobalKeybindings.js +5 -5
  16. package/dist/components/InlineAction.d.ts +1 -1
  17. package/dist/components/InlineAction.js +12 -2
  18. package/dist/components/InlineCaptionInspector.d.ts +2 -0
  19. package/dist/components/InlineCaptionInspector.js +2 -2
  20. package/dist/components/InlineCompositionName.js +1 -1
  21. package/dist/components/InlineEditableTitle.js +3 -2
  22. package/dist/components/InspectorInfoHeader.js +1 -1
  23. package/dist/components/InspectorOpenInEditor.js +48 -72
  24. package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
  25. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
  26. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
  27. package/dist/components/InspectorPanel/CompositionInspector.js +14 -7
  28. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
  29. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
  30. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
  31. package/dist/components/InspectorPanel/common.d.ts +0 -12
  32. package/dist/components/InspectorPanel/common.js +3 -52
  33. package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
  34. package/dist/components/InspectorPanelLayout.d.ts +1 -1
  35. package/dist/components/InspectorPanelLayout.js +1 -1
  36. package/dist/components/InspectorSequenceSection.js +40 -54
  37. package/dist/components/InstallPackage.d.ts +2 -1
  38. package/dist/components/InstallPackage.js +60 -30
  39. package/dist/components/InstallablePackage.js +37 -11
  40. package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
  41. package/dist/components/KeyboardShortcutsSettings.js +177 -0
  42. package/dist/components/MenuBuildIndicator.js +1 -1
  43. package/dist/components/Modals.js +6 -5
  44. package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
  45. package/dist/components/NewComposition/CodemodFooter.js +2 -8
  46. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  47. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  48. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  49. package/dist/components/NewComposition/InputDragger.js +27 -4
  50. package/dist/components/NewComposition/NewComposition.js +1 -1
  51. package/dist/components/NewComposition/NewFolder.js +1 -3
  52. package/dist/components/NewComposition/RenameComposition.js +1 -1
  53. package/dist/components/NewComposition/RenameFolder.js +1 -1
  54. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  55. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  56. package/dist/components/Notifications/NotificationCenter.js +5 -0
  57. package/dist/components/OptionsPanel.js +9 -12
  58. package/dist/components/PreviewToolbar.js +5 -2
  59. package/dist/components/PreviewToolbarOverflowButton.js +30 -0
  60. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
  61. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
  62. package/dist/components/RenderButton.js +66 -183
  63. package/dist/components/RenderModal/DataEditor.js +15 -12
  64. package/dist/components/RenderModal/RenderStatusModal.js +0 -1
  65. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
  66. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
  67. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
  68. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
  69. package/dist/components/RenderingSettings.js +7 -4
  70. package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
  71. package/dist/components/RulersAndGuidesToggle.js +23 -0
  72. package/dist/components/SegmentedButton.d.ts +29 -0
  73. package/dist/components/SegmentedButton.js +226 -0
  74. package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
  75. package/dist/components/SelectedOutlineEditingHandles.js +66 -0
  76. package/dist/components/SelectedOutlineElement.d.ts +2 -4
  77. package/dist/components/SelectedOutlineElement.js +15 -54
  78. package/dist/components/SelectedOutlineOverlay.js +32 -6
  79. package/dist/components/SelectedOutlinePolygon.d.ts +3 -4
  80. package/dist/components/SelectedOutlinePolygon.js +18 -16
  81. package/dist/components/SelectedOutlineRenderer.js +66 -14
  82. package/dist/components/SettingsModal.d.ts +1 -1
  83. package/dist/components/SettingsModal.js +30 -7
  84. package/dist/components/SettingsModalFooter.js +2 -1
  85. package/dist/components/SkillsSettings.d.ts +2 -0
  86. package/dist/components/SkillsSettings.js +129 -0
  87. package/dist/components/StaticFilePreview.js +7 -1
  88. package/dist/components/StudioSettings.js +7 -48
  89. package/dist/components/Tabs/index.js +1 -1
  90. package/dist/components/Timeline/Timeline.js +0 -1
  91. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  92. package/dist/components/Timeline/TimelineAssetField.js +15 -9
  93. package/dist/components/Timeline/TimelineBooleanField.js +1 -4
  94. package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
  95. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  96. package/dist/components/Timeline/TimelineEffectItem.js +23 -10
  97. package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
  98. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  99. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  100. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
  101. package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
  102. package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
  103. package/dist/components/Timeline/TimelineImageInfo.js +13 -32
  104. package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
  105. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  106. package/dist/components/Timeline/TimelineRotationField.js +0 -2
  107. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
  108. package/dist/components/Timeline/TimelineRowChrome.js +3 -4
  109. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
  110. package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
  111. package/dist/components/Timeline/TimelineScaleField.js +2 -6
  112. package/dist/components/Timeline/TimelineSchemaField.js +9 -3
  113. package/dist/components/Timeline/TimelineSelection.js +1 -1
  114. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  115. package/dist/components/Timeline/TimelineSequence.js +110 -19
  116. package/dist/components/Timeline/TimelineSequenceItem.js +5 -5
  117. package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
  118. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
  119. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
  120. package/dist/components/Timeline/TimelineTrack.js +1 -1
  121. package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
  122. package/dist/components/Timeline/TimelineTranslateField.js +0 -4
  123. package/dist/components/Timeline/TimelineVirtualization.js +3 -1
  124. package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
  125. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
  126. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
  127. package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
  128. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
  129. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
  130. package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
  131. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  132. package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
  133. package/dist/components/Timeline/timeline-field-utils.js +0 -2
  134. package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
  135. package/dist/components/TimelineCombobox.js +25 -160
  136. package/dist/components/TimelineInOutToggle.js +4 -1
  137. package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
  138. package/dist/components/duplicate-jsx-node-api.js +12 -0
  139. package/dist/components/effect-drag-and-drop.js +1 -4
  140. package/dist/components/handle-drop.d.ts +2 -1
  141. package/dist/components/handle-drop.js +3 -3
  142. package/dist/components/import-assets.js +9 -65
  143. package/dist/components/keyboard-shortcuts.d.ts +10 -0
  144. package/dist/components/keyboard-shortcuts.js +135 -0
  145. package/dist/components/selected-outline-control-layout.js +2 -6
  146. package/dist/components/selected-outline-measurement.d.ts +1 -1
  147. package/dist/components/selected-outline-measurement.js +16 -3
  148. package/dist/components/use-delete-asset.d.ts +1 -0
  149. package/dist/components/use-delete-asset.js +40 -0
  150. package/dist/components/use-selected-outline-control-target.d.ts +11 -0
  151. package/dist/components/use-selected-outline-control-target.js +79 -0
  152. package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
  153. package/dist/esm/{chunk-v5a8vpv4.js → chunk-w4244j4n.js} +17766 -17618
  154. package/dist/esm/index.mjs +3 -0
  155. package/dist/esm/internals.mjs +17765 -17617
  156. package/dist/esm/previewEntry.mjs +17570 -17422
  157. package/dist/esm/renderEntry.mjs +2 -2
  158. package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
  159. package/dist/helpers/add-asset-cache-bust.js +10 -0
  160. package/dist/helpers/calculate-timeline.js +2 -1
  161. package/dist/helpers/colors.d.ts +2 -0
  162. package/dist/helpers/colors.js +6 -2
  163. package/dist/helpers/drag-aware-double-click.d.ts +6 -0
  164. package/dist/helpers/drag-aware-double-click.js +20 -0
  165. package/dist/helpers/get-asset-metadata.js +25 -16
  166. package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
  167. package/dist/helpers/get-sequence-double-click-action.js +7 -1
  168. package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
  169. package/dist/helpers/get-timeline-sequence-layout.js +15 -6
  170. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
  171. package/dist/helpers/hoverable.d.ts +1 -0
  172. package/dist/helpers/hoverable.js +2 -1
  173. package/dist/helpers/inject-css.js +3 -1
  174. package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
  175. package/dist/helpers/open-in-remotion-convert.js +18 -0
  176. package/dist/helpers/use-media-metadata.d.ts +2 -1
  177. package/dist/helpers/use-media-metadata.js +12 -5
  178. package/dist/helpers/use-menu-structure.js +32 -32
  179. package/dist/icons/align-center-horizontal.js +1 -1
  180. package/dist/icons/align-left.js +1 -1
  181. package/dist/icons/align-right.js +1 -1
  182. package/dist/icons/keyboard.d.ts +4 -0
  183. package/dist/icons/keyboard.js +10 -0
  184. package/dist/icons/license.d.ts +4 -0
  185. package/dist/icons/license.js +8 -0
  186. package/dist/icons/package.d.ts +4 -0
  187. package/dist/icons/package.js +8 -0
  188. package/dist/icons/react.js +1 -1
  189. package/dist/icons/remotion-convert.d.ts +4 -0
  190. package/dist/icons/remotion-convert.js +10 -0
  191. package/dist/icons/skills.d.ts +4 -0
  192. package/dist/icons/skills.js +10 -0
  193. package/dist/state/modals.d.ts +2 -5
  194. package/package.json +12 -12
  195. package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
  196. package/dist/components/KeyboardShortcutsExplainer.js +0 -194
@@ -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;
@@ -20,6 +20,7 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
20
20
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
21
21
  const ObserveDefaultPropsContext_1 = require("../ObserveDefaultPropsContext");
22
22
  const DataEditor_1 = require("../RenderModal/DataEditor");
23
+ const infer_zod_schema_from_value_1 = require("../RenderModal/SchemaEditor/infer-zod-schema-from-value");
23
24
  const zod_schema_type_1 = require("../RenderModal/SchemaEditor/zod-schema-type");
24
25
  const WarningIndicatorButton_1 = require("../RenderModal/WarningIndicatorButton");
25
26
  const SegmentedControl_1 = require("../SegmentedControl");
@@ -84,6 +85,7 @@ const CompositionActions = () => {
84
85
  const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
85
86
  var _a;
86
87
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
88
+ const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
87
89
  const canSaveDefaultProps = (0, react_1.useContext)(ObserveDefaultPropsContext_1.ObserveDefaultPropsContext);
88
90
  const [defaultPropsMode, setDefaultPropsMode] = (0, react_1.useState)('schema');
89
91
  const compositionId = composition.id;
@@ -110,16 +112,21 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, read
110
112
  },
111
113
  ];
112
114
  }, [defaultPropsMode]);
115
+ const schema = (0, react_1.useMemo)(() => {
116
+ var _a;
117
+ return (0, infer_zod_schema_from_value_1.resolveCompositionSchema)({
118
+ explicitSchema: composition.schema,
119
+ defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
120
+ z,
121
+ zodTypes,
122
+ });
123
+ }, [composition.defaultProps, composition.schema, z, zodTypes]);
113
124
  const canShowDefaultPropsSection = (0, react_1.useMemo)(() => {
114
- if (!z || !composition.schema || !composition.defaultProps) {
125
+ if (schema === 'no-schema' || schema === 'no-zod') {
115
126
  return false;
116
127
  }
117
- if (!(typeof composition.schema.safeParse ===
118
- 'function')) {
119
- return false;
120
- }
121
- return (0, zod_schema_type_1.getZodSchemaType)(composition.schema) !== 'any';
122
- }, [composition.defaultProps, composition.schema, z]);
128
+ return (0, zod_schema_type_1.getZodSchemaType)(schema) !== 'any';
129
+ }, [schema]);
123
130
  const { setShowWarning, showWarning } = (0, DataEditor_1.useDataEditorWarningVisibility)();
124
131
  const { warnings: defaultPropsWarnings } = (0, DataEditor_1.useDataEditorWarnings)({
125
132
  canSaveDefaultProps: (_a = canSaveDefaultProps === null || canSaveDefaultProps === void 0 ? void 0 : canSaveDefaultProps.canSaveDefaultProps) !== null && _a !== void 0 ? _a : null,
@@ -7,6 +7,7 @@ const remotion_1 = require("remotion");
7
7
  const colors_1 = require("../../helpers/colors");
8
8
  const InlineAction_1 = require("../InlineAction");
9
9
  const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
10
+ const timeline_scroll_logic_1 = require("../Timeline/timeline-scroll-logic");
10
11
  const TimelineKeyframeDiamondIcon_1 = require("../Timeline/TimelineKeyframeDiamondIcon");
11
12
  const TimelineKeyframeEasingLine_1 = require("../Timeline/TimelineKeyframeEasingLine");
12
13
  const TimelineSelection_1 = require("../Timeline/TimelineSelection");
@@ -114,26 +115,31 @@ const KeyframeEasingNavigator = ({ currentSelection, includeEasings, keyframes,
114
115
  const selectItem = (0, react_1.useCallback)((item) => {
115
116
  selectItems([item.selection], { reveal: true });
116
117
  }, [selectItems]);
117
- const seekToItem = (0, react_1.useCallback)((item) => {
118
+ const seekToItem = (0, react_1.useCallback)((item, direction) => {
118
119
  const frame = (0, keyframe_easing_navigator_items_1.getNavigatorItemPlayheadFrame)(item);
119
120
  setFrame((current) => {
120
121
  const next = { ...current, [videoConfig.id]: frame };
121
122
  remotion_1.Internals.persistCurrentFrame(next);
122
123
  return next;
123
124
  });
124
- }, [setFrame, videoConfig.id]);
125
+ (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
126
+ direction,
127
+ durationInFrames: videoConfig.durationInFrames,
128
+ frame,
129
+ });
130
+ }, [setFrame, videoConfig.durationInFrames, videoConfig.id]);
125
131
  const selectPrevious = (0, react_1.useCallback)(() => {
126
132
  if (previousItem === null) {
127
133
  return;
128
134
  }
129
- seekToItem(previousItem);
135
+ seekToItem(previousItem, 'fit-left');
130
136
  selectItem(previousItem);
131
137
  }, [previousItem, seekToItem, selectItem]);
132
138
  const selectNext = (0, react_1.useCallback)(() => {
133
139
  if (nextItem === null) {
134
140
  return;
135
141
  }
136
- seekToItem(nextItem);
142
+ seekToItem(nextItem, 'fit-right');
137
143
  selectItem(nextItem);
138
144
  }, [nextItem, seekToItem, selectItem]);
139
145
  if (currentItem === null) {
@@ -8,6 +8,7 @@ const react_2 = require("../../icons/react");
8
8
  const InlineEditableTitle_1 = require("../InlineEditableTitle");
9
9
  const InspectorInfoHeader_1 = require("../InspectorInfoHeader");
10
10
  const InspectorLocationCopy_1 = require("../InspectorLocationCopy");
11
+ const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
11
12
  const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
12
13
  const layout_1 = require("../layout");
13
14
  const use_open_sequence_in_apps_1 = require("../Timeline/use-open-sequence-in-apps");
@@ -31,7 +32,7 @@ const sequenceInspectorSubtitle = {
31
32
  height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
32
33
  lineHeight: '18px',
33
34
  margin: '0 4px',
34
- padding: '0 8px',
35
+ padding: `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4}px`,
35
36
  width: 'calc(100% - 8px)',
36
37
  };
37
38
  const defaultCursor = {
@@ -115,10 +115,7 @@ const SequenceSourceQuickActions = ({ selection, track, validatedSource }) => {
115
115
  nodePath: nodePath.nodePath,
116
116
  })
117
117
  .then((result) => {
118
- if (result.success) {
119
- (0, NotificationCenter_1.showNotification)('Split video from audio', 2000);
120
- }
121
- else {
118
+ if (!result.success) {
122
119
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
123
120
  }
124
121
  })
@@ -24,12 +24,6 @@ export declare const InspectorDetailRow: React.FC<{
24
24
  readonly label: React.ReactNode | ((hovered: boolean) => React.ReactNode);
25
25
  readonly children: React.ReactNode;
26
26
  }>;
27
- export type InspectorQuickActionSegment = {
28
- readonly disabled: boolean;
29
- readonly onClick: React.MouseEventHandler<HTMLButtonElement>;
30
- readonly renderIcon: (color: string) => React.ReactNode;
31
- readonly title?: string;
32
- };
33
27
  export type InspectorQuickActionProps = {
34
28
  readonly children: React.ReactNode;
35
29
  readonly disabled: boolean;
@@ -39,12 +33,6 @@ export type InspectorQuickActionProps = {
39
33
  readonly size?: 'default' | 'compact';
40
34
  readonly style?: React.CSSProperties;
41
35
  readonly title?: string;
42
- readonly variant?: {
43
- readonly type: 'single';
44
- } | {
45
- readonly type: 'segmented';
46
- readonly trailing: InspectorQuickActionSegment;
47
- };
48
36
  };
49
37
  export declare const InspectorQuickAction: React.FC<InspectorQuickActionProps>;
50
38
  export declare const InspectorDefaultPropsWarnings: React.FC<{
@@ -90,37 +90,8 @@ const inlineLabelIcon = {
90
90
  justifyContent: 'center',
91
91
  width: 18,
92
92
  };
93
- const segmentedInlineAction = {
94
- display: 'flex',
95
- gap: 1,
96
- margin: `0 ${INLINE_LABEL_BUTTON_MARGIN}px`,
97
- width: `calc(100% - ${INLINE_LABEL_BUTTON_MARGIN * 2}px)`,
98
- };
99
- const segmentedMainAction = {
100
- borderRadius: '4px 0 0 4px',
101
- flex: 1,
102
- margin: 0,
103
- minWidth: 0,
104
- width: 'auto',
105
- };
106
- const segmentedTrailingAction = {
107
- alignItems: 'center',
108
- appearance: 'none',
109
- border: 'none',
110
- borderRadius: '0 4px 4px 0',
111
- display: 'flex',
112
- flex: '0 0 28px',
113
- justifyContent: 'center',
114
- margin: 0,
115
- padding: 0,
116
- width: 28,
117
- };
118
- const InspectorQuickAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
119
- const isSegmented = variant.type === 'segmented';
120
- // A non-clickable single action (onClick === null) never shows a hover
121
- // effect. In the segmented variant, the main segment highlights whenever
122
- // the group is hovered, even if it is not clickable itself.
123
- const showsHover = !disabled && (onClick !== null || isSegmented);
93
+ const InspectorQuickAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, }) => {
94
+ const showsHover = !disabled && onClick !== null;
124
95
  const buttonStyle = react_1.default.useMemo(() => ({
125
96
  ...(disabled ? inlineLabelButtonDisabled : inlineLabelButton),
126
97
  ...(0, hoverable_1.hoverableStyle)({
@@ -132,31 +103,11 @@ const InspectorQuickAction = ({ children, disabled, iconContainerStyle, onClick,
132
103
  hoverColor: showsHover ? colors_1.WHITE : colors_1.LIGHT_TEXT,
133
104
  }),
134
105
  ...(size === 'compact' ? compactInlineLabelButton : null),
135
- ...(isSegmented ? segmentedMainAction : null),
136
106
  ...style,
137
- }), [disabled, showsHover, isSegmented, size, style]);
107
+ }), [disabled, showsHover, size, style]);
138
108
  const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: { ...inlineLabelIcon, ...iconContainerStyle }, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
139
109
  ] }));
140
110
  const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-quick-action ${hoverable_1.HOVERABLE_CLASS_NAME}`, type: "button", disabled: disabled, style: buttonStyle, title: title, onClick: onClick, children: mainContent })) : (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVERABLE_CLASS_NAME, style: buttonStyle, title: title, children: mainContent }));
141
- if (variant.type === 'segmented') {
142
- const trailingStyle = {
143
- ...segmentedTrailingAction,
144
- ...(0, hoverable_1.hoverableStyle)({
145
- idleBackground: colors_1.TRANSPARENT,
146
- hoverBackground: variant.trailing.disabled
147
- ? colors_1.TRANSPARENT
148
- : (0, colors_1.getBackgroundFromHoverState)({ hovered: true, selected: false }),
149
- idleColor: colors_1.LIGHT_TEXT,
150
- hoverColor: variant.trailing.disabled ? colors_1.LIGHT_TEXT : colors_1.WHITE,
151
- }),
152
- height: size === 'compact'
153
- ? layout_1.COMPACT_INLINE_ROW_HEIGHT
154
- : layout_1.COMPACT_CONTROL_ROW_HEIGHT,
155
- opacity: variant.trailing.disabled ? 0.35 : 1,
156
- };
157
- return (jsx_runtime_1.jsxs("div", { className: hoverable_1.HOVER_GROUP_CLASS_NAME, style: segmentedInlineAction, children: [mainAction, jsx_runtime_1.jsx("button", { type: "button", className: hoverable_1.HOVERABLE_CLASS_NAME, disabled: variant.trailing.disabled, style: trailingStyle, title: variant.trailing.title, onClick: variant.trailing.onClick, children: jsx_runtime_1.jsx("span", { className: hoverable_1.HOVER_GROUP_REVEAL_CLASS_NAME, style: inlineLabelIcon, children: variant.trailing.renderIcon(colors_1.CURRENT_COLOR) }) })
158
- ] }));
159
- }
160
111
  return mainAction;
161
112
  };
162
113
  exports.InspectorQuickAction = InspectorQuickAction;
@@ -82,7 +82,6 @@ const useCompositionActions = () => {
82
82
  ? await browserStudioOperations.insertSolid(request)
83
83
  : await (0, call_api_1.callApi)('/api/insert-jsx-element', request);
84
84
  if (result.success) {
85
- (0, NotificationCenter_1.showNotification)('Added <Solid> to source file', 2000);
86
85
  return;
87
86
  }
88
87
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
@@ -1 +1 @@
1
- export declare const INSPECTOR_PANEL_HORIZONTAL_PADDING = 12;
1
+ export declare const INSPECTOR_PANEL_HORIZONTAL_PADDING = 10;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.INSPECTOR_PANEL_HORIZONTAL_PADDING = void 0;
4
- exports.INSPECTOR_PANEL_HORIZONTAL_PADDING = 12;
4
+ exports.INSPECTOR_PANEL_HORIZONTAL_PADDING = 10;