@remotion/studio 4.0.505 → 4.0.507

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 (208) hide show
  1. package/dist/api/copy-render-output-to-asset.d.ts +4 -0
  2. package/dist/api/copy-render-output-to-asset.js +11 -0
  3. package/dist/api/install-package.d.ts +2 -3
  4. package/dist/api/install-package.js +1 -3
  5. package/dist/api/visual-control.d.ts +3 -0
  6. package/dist/api/visual-control.js +3 -0
  7. package/dist/components/AssetSelector.js +19 -4
  8. package/dist/components/AssetSelectorItem.js +3 -3
  9. package/dist/components/Canvas.js +2 -0
  10. package/dist/components/CodingAgentIcon.d.ts +4 -0
  11. package/dist/components/CodingAgentIcon.js +17 -0
  12. package/dist/components/CompositionSelector.js +1 -1
  13. package/dist/components/CompositionSelectorItem.js +1 -1
  14. package/dist/components/ConfigureDefaultEditorModal.d.ts +1 -1
  15. package/dist/components/ConfigureDefaultEditorModal.js +117 -69
  16. package/dist/components/ConfigureLicenseModal.d.ts +1 -3
  17. package/dist/components/ConfigureLicenseModal.js +105 -89
  18. package/dist/components/ConfirmationDialog.js +2 -2
  19. package/dist/components/ContextMenu.js +10 -8
  20. package/dist/components/Editor.js +2 -0
  21. package/dist/components/EditorContexts.js +6 -5
  22. package/dist/components/EffectPickerModal.js +1 -1
  23. package/dist/components/ExpandedTracksProvider.js +10 -53
  24. package/dist/components/GlobalKeybindings.js +3 -2
  25. package/dist/components/InlineCaptionInspector.d.ts +2 -2
  26. package/dist/components/InlineDropdown.d.ts +2 -1
  27. package/dist/components/InlineDropdown.js +10 -4
  28. package/dist/components/InspectorLocationCopy.js +8 -8
  29. package/dist/components/InspectorOpenInEditor.d.ts +2 -0
  30. package/dist/components/InspectorOpenInEditor.js +63 -49
  31. package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
  32. package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
  33. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
  34. package/dist/components/InspectorPanel/EasingInspector.js +7 -4
  35. package/dist/components/InspectorPanel/KeyframeInspector.js +5 -1
  36. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -0
  37. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +22 -4
  38. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
  39. package/dist/components/InspectorPanel/common.d.ts +1 -0
  40. package/dist/components/InspectorPanel/common.js +2 -2
  41. package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
  42. package/dist/components/InspectorSequenceSection.js +4 -4
  43. package/dist/components/InstallPackage.js +1 -1
  44. package/dist/components/Menu/MenuSectionHeader.d.ts +4 -0
  45. package/dist/components/Menu/MenuSectionHeader.js +20 -0
  46. package/dist/components/Menu/SubMenu.js +13 -2
  47. package/dist/components/Menu/menu-tree-context.d.ts +3 -0
  48. package/dist/components/Menu/menu-tree-context.js +13 -0
  49. package/dist/components/MenuBuildIndicator.js +1 -0
  50. package/dist/components/MenuToolbar.js +1 -1
  51. package/dist/components/ModalFooter.d.ts +1 -0
  52. package/dist/components/ModalFooter.js +6 -2
  53. package/dist/components/ModalHeader.js +1 -1
  54. package/dist/components/Modals.js +18 -7
  55. package/dist/components/ModalsProvider.js +5 -6
  56. package/dist/components/NewComposition/CodemodFooter.js +1 -1
  57. package/dist/components/NewComposition/ComboBox.d.ts +6 -1
  58. package/dist/components/NewComposition/DismissableModal.js +1 -1
  59. package/dist/components/NewComposition/MenuContent.js +27 -19
  60. package/dist/components/NewComposition/RenameStaticFile.js +1 -1
  61. package/dist/components/NewComposition/menu-typeahead.js +2 -2
  62. package/dist/components/OverrideInputProps.js +1 -1
  63. package/dist/components/PlayPause.js +2 -1
  64. package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
  65. package/dist/components/Preview.js +29 -4
  66. package/dist/components/PreviewToolbarOverflowButton.js +4 -2
  67. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
  68. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
  69. package/dist/components/RenderButton.d.ts +3 -3
  70. package/dist/components/RenderButton.js +42 -7
  71. package/dist/components/RenderModal/RenderStatusModal.js +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -0
  73. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +2 -2
  74. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +3 -3
  75. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
  76. package/dist/components/RenderModal/ServerRenderModal.js +5 -1
  77. package/dist/components/RenderModal/WebRenderModal.js +3 -2
  78. package/dist/components/RenderQueue/RenderQueueError.js +1 -1
  79. package/dist/components/RenderQueue/RenderQueueItem.js +8 -2
  80. package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
  81. package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
  82. package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
  83. package/dist/components/RenderQueue/actions.d.ts +4 -2
  84. package/dist/components/RenderQueue/actions.js +4 -2
  85. package/dist/components/RenderQueue/index.js +3 -4
  86. package/dist/components/RenderQueue/use-render-output-file-drag.d.ts +8 -0
  87. package/dist/components/RenderQueue/use-render-output-file-drag.js +121 -0
  88. package/dist/components/SegmentedControl.js +0 -1
  89. package/dist/components/SelectedOutlineElement.d.ts +14 -17
  90. package/dist/components/SelectedOutlineElement.js +113 -931
  91. package/dist/components/SelectedOutlineKeyboardControls.d.ts +7 -0
  92. package/dist/components/SelectedOutlineKeyboardControls.js +261 -0
  93. package/dist/components/SelectedOutlineOverlay.d.ts +6 -13
  94. package/dist/components/SelectedOutlineOverlay.js +360 -832
  95. package/dist/components/SelectedOutlinePolygon.d.ts +25 -0
  96. package/dist/components/SelectedOutlinePolygon.js +359 -0
  97. package/dist/components/SelectedOutlineRenderer.d.ts +18 -0
  98. package/dist/components/SelectedOutlineRenderer.js +208 -0
  99. package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +16 -0
  100. package/dist/components/SelectedOutlineRotationCornerHandle.js +269 -0
  101. package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +16 -0
  102. package/dist/components/SelectedOutlineScaleEdgeLine.js +211 -0
  103. package/dist/components/SelectedOutlineSnapIndicators.d.ts +9 -0
  104. package/dist/components/SelectedOutlineSnapIndicators.js +29 -0
  105. package/dist/components/SelectedOutlineTransformOriginHandle.d.ts +9 -0
  106. package/dist/components/SelectedOutlineTransformOriginHandle.js +286 -0
  107. package/dist/components/SelectedOutlineUvControls.d.ts +3 -9
  108. package/dist/components/SelectedOutlineUvControls.js +57 -12
  109. package/dist/components/SettingsContext.d.ts +15 -0
  110. package/dist/components/SettingsContext.js +116 -0
  111. package/dist/components/SettingsModal.d.ts +7 -0
  112. package/dist/components/SettingsModal.js +56 -0
  113. package/dist/components/SettingsModalFooter.d.ts +2 -0
  114. package/dist/components/SettingsModalFooter.js +44 -0
  115. package/dist/components/ShowOutlinesProvider.js +2 -3
  116. package/dist/components/SidebarRenderButton.js +1 -1
  117. package/dist/components/SvgImportDialog.js +2 -2
  118. package/dist/components/TimeValue.js +1 -1
  119. package/dist/components/Timeline/EasingEditorModal.js +66 -22
  120. package/dist/components/Timeline/Timeline.js +23 -5
  121. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  122. package/dist/components/Timeline/TimelineDragHandler.js +3 -3
  123. package/dist/components/Timeline/TimelineDuplicateCount.d.ts +4 -0
  124. package/dist/components/Timeline/TimelineDuplicateCount.js +28 -0
  125. package/dist/components/Timeline/TimelineEffectPropItem.js +5 -3
  126. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +3 -23
  127. package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
  128. package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
  129. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +4 -2
  130. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +11 -1
  131. package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
  132. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  133. package/dist/components/Timeline/TimelineSelection.js +1 -0
  134. package/dist/components/Timeline/TimelineSequence.js +28 -25
  135. package/dist/components/Timeline/TimelineSequenceItem.js +74 -58
  136. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +1 -1
  137. package/dist/components/Timeline/TimelineTrack.js +2 -1
  138. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -3
  139. package/dist/components/Timeline/get-sequence-context-menu-items.js +58 -53
  140. package/dist/components/Timeline/reset-selected-timeline-props.js +1 -1
  141. package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +1 -1
  142. package/dist/components/Timeline/timeline-asset-link.d.ts +2 -2
  143. package/dist/components/Timeline/timeline-asset-link.js +2 -2
  144. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +38 -2
  145. package/dist/components/Timeline/{use-open-sequence-in-editor.d.ts → use-open-sequence-in-apps.d.ts} +4 -1
  146. package/dist/components/Timeline/{use-open-sequence-in-editor.js → use-open-sequence-in-apps.js} +20 -4
  147. package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
  148. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +5 -0
  149. package/dist/components/Timeline/use-timeline-expanded-tree.js +50 -1
  150. package/dist/components/Timeline/use-timeline-height.js +20 -0
  151. package/dist/components/TimelineInOutToggle.js +5 -1
  152. package/dist/components/TopPanel.js +16 -0
  153. package/dist/components/UpdateCheck.js +1 -1
  154. package/dist/components/effect-drag-and-drop.js +1 -1
  155. package/dist/components/get-open-in-menu-items.d.ts +12 -0
  156. package/dist/components/get-open-in-menu-items.js +83 -0
  157. package/dist/components/handle-drop.d.ts +2 -1
  158. package/dist/components/handle-drop.js +12 -2
  159. package/dist/components/import-assets.d.ts +18 -6
  160. package/dist/components/import-assets.js +76 -32
  161. package/dist/components/selected-outline-measurement.d.ts +2 -2
  162. package/dist/components/selected-outline-order.d.ts +12 -0
  163. package/dist/components/selected-outline-order.js +251 -0
  164. package/dist/components/selected-outline-types.d.ts +9 -10
  165. package/dist/components/svg-point-to-client-point.d.ts +2 -0
  166. package/dist/components/svg-point-to-client-point.js +10 -0
  167. package/dist/components/use-auto-save-config.d.ts +8 -0
  168. package/dist/components/use-auto-save-config.js +74 -0
  169. package/dist/components/use-default-editor-info.d.ts +1 -0
  170. package/dist/components/use-default-editor-info.js +10 -30
  171. package/dist/esm/{chunk-jefhcs5z.js → chunk-fgedsvhb.js} +1 -2
  172. package/dist/esm/{chunk-7pgk8h5m.js → chunk-ptnd65a9.js} +14596 -12725
  173. package/dist/esm/internals.mjs +14595 -12724
  174. package/dist/esm/previewEntry.mjs +12726 -10855
  175. package/dist/esm/renderEntry.mjs +2 -2
  176. package/dist/helpers/are-sequence-node-path-infos-equal.d.ts +2 -0
  177. package/dist/helpers/are-sequence-node-path-infos-equal.js +27 -0
  178. package/dist/helpers/calculate-timeline.js +3 -3
  179. package/dist/helpers/client-id.d.ts +3 -1
  180. package/dist/helpers/client-id.js +28 -4
  181. package/dist/helpers/format-file-location.d.ts +1 -1
  182. package/dist/helpers/format-file-location.js +3 -3
  183. package/dist/helpers/install-required-package.d.ts +3 -3
  184. package/dist/helpers/install-required-package.js +1 -6
  185. package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
  186. package/dist/helpers/open-in-editor.d.ts +1 -0
  187. package/dist/helpers/open-in-editor.js +5 -1
  188. package/dist/helpers/studio-fit-padding.d.ts +1 -1
  189. package/dist/helpers/studio-fit-padding.js +1 -1
  190. package/dist/helpers/studio-runtime-config.js +3 -0
  191. package/dist/helpers/timeline-layout.d.ts +2 -1
  192. package/dist/helpers/timeline-layout.js +5 -2
  193. package/dist/helpers/timeline-node-path-key.d.ts +2 -0
  194. package/dist/helpers/timeline-node-path-key.js +3 -1
  195. package/dist/helpers/use-asset-drag-events.d.ts +2 -1
  196. package/dist/helpers/use-asset-drag-events.js +14 -6
  197. package/dist/helpers/use-menu-structure.js +25 -35
  198. package/dist/helpers/use-runtime-values.d.ts +9 -0
  199. package/dist/helpers/use-runtime-values.js +76 -0
  200. package/dist/icons/apps.d.ts +2 -0
  201. package/dist/icons/apps.js +7 -0
  202. package/dist/icons/browse-elements.d.ts +4 -0
  203. package/dist/icons/browse-elements.js +10 -0
  204. package/dist/state/modals.d.ts +5 -6
  205. package/dist/state/modals.js +5 -3
  206. package/dist/state/timeline-sequence-hover.d.ts +9 -3
  207. package/dist/state/timeline-sequence-hover.js +63 -12
  208. package/package.json +12 -12
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
3
3
  export declare const InspectorOpenInEditor: React.FC<{
4
+ readonly contextForAgents?: string | null;
4
5
  readonly location: OriginalPosition | null;
6
+ readonly label?: React.ReactNode;
5
7
  }>;
@@ -10,22 +10,27 @@ const caret_1 = require("../icons/caret");
10
10
  const editor_1 = require("../icons/editor");
11
11
  const modals_1 = require("../state/modals");
12
12
  const z_index_1 = require("../state/z-index");
13
+ const get_open_in_menu_items_1 = require("./get-open-in-menu-items");
13
14
  const InlineDropdown_1 = require("./InlineDropdown");
14
15
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
15
16
  const use_default_editor_info_1 = require("./use-default-editor-info");
16
17
  const splitButton = {
17
18
  alignItems: 'center',
19
+ borderRadius: 3,
18
20
  display: 'inline-flex',
19
21
  flexDirection: 'row',
20
22
  flexShrink: 0,
23
+ gap: 1,
21
24
  height: 24,
25
+ overflow: 'hidden',
22
26
  };
23
27
  const mainButtonBase = {
24
28
  alignItems: 'center',
25
29
  background: colors_1.TRANSPARENT,
26
30
  border: 'none',
27
- borderRadius: 3,
31
+ borderRadius: '3px 0 0 3px',
28
32
  color: colors_1.LIGHT_TEXT,
33
+ columnGap: 4,
29
34
  display: 'inline-flex',
30
35
  fontFamily: 'sans-serif',
31
36
  fontSize: 11,
@@ -34,22 +39,17 @@ const mainButtonBase = {
34
39
  padding: '0 6px',
35
40
  whiteSpace: 'nowrap',
36
41
  };
37
- const menuLabel = {
38
- color: 'inherit',
39
- fontFamily: 'sans-serif',
40
- fontSize: 13,
41
- lineHeight: '16px',
42
- };
43
42
  const editorButtonIconSize = 18;
44
- const editorMenuIconSize = 18;
45
- const InspectorOpenInEditor = ({ location }) => {
43
+ const InspectorOpenInEditor = ({ contextForAgents = null, label, location }) => {
46
44
  var _a;
47
45
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
48
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
46
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
49
47
  const { tabIndex } = (0, z_index_1.useZIndex)();
50
48
  const [hovered, setHovered] = (0, react_1.useState)(false);
49
+ const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
51
50
  const editorPickerAvailable = (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected');
52
51
  const editorInfo = (0, use_default_editor_info_1.useDefaultEditorInfo)(editorPickerAvailable);
52
+ const codingAgentInfo = (0, use_default_editor_info_1.useDefaultCodingAgentInfo)(editorPickerAvailable);
53
53
  const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
54
54
  if (!location) {
55
55
  return;
@@ -62,65 +62,78 @@ const InspectorOpenInEditor = ({ location }) => {
62
62
  }
63
63
  }, [location]);
64
64
  const preferredEditorId = (0, use_default_editor_info_1.getPreferredEditorId)(editorInfo);
65
+ const openWithCodingAgent = (0, react_1.useCallback)(async (codingAgentId, codingAgentName) => {
66
+ try {
67
+ const response = await (0, open_in_editor_1.openInCodingAgent)(codingAgentId, codingAgentId === 'copilot' ? null : contextForAgents);
68
+ if (!response.success) {
69
+ (0, NotificationCenter_1.showNotification)(`Could not open ${codingAgentName}`, 2000);
70
+ }
71
+ }
72
+ catch (err) {
73
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
74
+ }
75
+ }, [contextForAgents]);
65
76
  const editorName = (_a = window.remotion_editorName) !== null && _a !== void 0 ? _a : 'default editor';
66
77
  const canOpenDefault = location !== null && window.remotion_editorName !== null;
67
78
  const onOpenDefault = (0, react_1.useCallback)((event) => {
68
79
  event.stopPropagation();
69
80
  openWithEditor(null).catch(() => undefined);
70
81
  }, [openWithEditor]);
82
+ const mainHovered = hovered && !dropdownOpened;
71
83
  const mainButtonStyle = (0, react_1.useMemo)(() => {
72
84
  return {
73
85
  ...mainButtonBase,
74
86
  background: (0, colors_1.getBackgroundFromHoverState)({
75
- hovered,
87
+ hovered: mainHovered,
76
88
  selected: false,
77
89
  }),
78
- color: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
90
+ color: mainHovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
79
91
  opacity: canOpenDefault ? 1 : 0.5,
80
92
  pointerEvents: canOpenDefault ? 'auto' : 'none',
81
93
  };
82
- }, [canOpenDefault, hovered]);
94
+ }, [canOpenDefault, mainHovered]);
95
+ const dropdownForegroundColor = hovered || dropdownOpened ? colors_1.WHITE : colors_1.LIGHT_TEXT;
96
+ const dropdownStyle = (0, react_1.useMemo)(() => {
97
+ return {
98
+ background: (0, colors_1.getBackgroundFromHoverState)({
99
+ hovered,
100
+ selected: dropdownOpened,
101
+ }),
102
+ borderRadius: '0 3px 3px 0',
103
+ color: dropdownForegroundColor,
104
+ };
105
+ }, [dropdownForegroundColor, dropdownOpened, hovered]);
83
106
  const renderDropdownAction = (0, react_1.useCallback)((color) => {
84
107
  return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
85
108
  }, []);
86
109
  const menuItems = (0, react_1.useMemo)(() => {
87
- var _a;
88
- const alternateEditors = ((_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors) !== null && _a !== void 0 ? _a : [])
89
- .filter((editor) => editor.id !== preferredEditorId)
90
- .map((editor) => ({
91
- id: `open-in-${editor.id}`,
92
- keyHint: null,
93
- label: jsx_runtime_1.jsx("span", { style: menuLabel, children: editor.name }),
94
- leftItem: jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editor.id, size: editorMenuIconSize }),
95
- onClick: () => {
96
- openWithEditor(editor.id).catch(() => undefined);
110
+ return (0, get_open_in_menu_items_1.getOpenInMenuItems)({
111
+ codingAgentInfo,
112
+ editorDisabled: location === null,
113
+ editorInfo,
114
+ excludeCodingAgentId: null,
115
+ excludeEditorId: preferredEditorId,
116
+ onConfigureApps: () => {
117
+ var _a;
118
+ var _b;
119
+ setSelectedModal({
120
+ type: 'settings',
121
+ initialTab: 'apps',
122
+ initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
123
+ });
124
+ },
125
+ onOpenInCodingAgent: (codingAgentId, codingAgentName) => {
126
+ openWithCodingAgent(codingAgentId, codingAgentName).catch(() => undefined);
97
127
  },
98
- quickSwitcherLabel: null,
99
- subMenu: null,
100
- type: 'item',
101
- value: editor.id,
102
- }));
103
- const settingsItems = [
104
- ...(alternateEditors.length > 0
105
- ? [{ type: 'divider', id: 'editor-settings-divider' }]
106
- : []),
107
- {
108
- id: 'set-default-editor',
109
- keyHint: null,
110
- label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Set default editor..." }),
111
- leftItem: null,
112
- onClick: () => {
113
- setSelectedModal({ type: 'configure-default-editor' });
114
- },
115
- quickSwitcherLabel: null,
116
- subMenu: null,
117
- type: 'item',
118
- value: 'set-default-editor',
128
+ onOpenInEditor: (editorId) => {
129
+ openWithEditor(editorId).catch(() => undefined);
119
130
  },
120
- ];
121
- return [...alternateEditors, ...settingsItems];
131
+ });
122
132
  }, [
123
- editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors,
133
+ codingAgentInfo,
134
+ editorInfo,
135
+ location,
136
+ openWithCodingAgent,
124
137
  openWithEditor,
125
138
  preferredEditorId,
126
139
  setSelectedModal,
@@ -128,8 +141,9 @@ const InspectorOpenInEditor = ({ location }) => {
128
141
  if (!editorPickerAvailable) {
129
142
  return null;
130
143
  }
131
- return (jsx_runtime_1.jsxs("div", { style: splitButton, children: [
132
- jsx_runtime_1.jsx("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: preferredEditorId, size: editorButtonIconSize }) }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderDropdownAction, title: "Open in another editor", values: menuItems, variant: "compact" })
144
+ return (jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
145
+ 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: preferredEditorId, size: editorButtonIconSize })
146
+ ] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { onOpenChange: setDropdownOpened, renderAction: renderDropdownAction, style: dropdownStyle, title: "Open in another app", unhoveredColor: dropdownForegroundColor, values: menuItems, variant: "compact" })
133
147
  ] }));
134
148
  };
135
149
  exports.InspectorOpenInEditor = InspectorOpenInEditor;
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const client_id_1 = require("../../helpers/client-id");
8
8
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
9
+ const use_runtime_values_1 = require("../../helpers/use-runtime-values");
9
10
  const align_bottom_1 = require("../../icons/align-bottom");
10
11
  const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
11
12
  const align_center_vertical_1 = require("../../icons/align-center-vertical");
@@ -48,6 +49,7 @@ const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
48
49
  };
49
50
  const AlignmentControls = ({ track }) => {
50
51
  var _a;
52
+ const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)(track.sequence.controls);
51
53
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
52
54
  const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
53
55
  const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
@@ -79,7 +81,7 @@ const AlignmentControls = ({ track }) => {
79
81
  const dragOverrides = (_b = getDragOverrides(nodePath)) !== null && _b !== void 0 ? _b : {};
80
82
  const activeSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
81
83
  schema: track.sequence.controls.schema,
82
- currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
84
+ currentRuntimeValueDotNotation: runtimeValues,
83
85
  dragOverrides,
84
86
  propStatus: nodePropStatuses,
85
87
  frame: sourceFrame,
@@ -176,6 +178,7 @@ const AlignmentControls = ({ track }) => {
176
178
  currentCompositionMetadata,
177
179
  timelinePosition,
178
180
  propStatuses,
181
+ runtimeValues,
179
182
  getDragOverrides,
180
183
  setPropStatuses,
181
184
  ]);
@@ -192,7 +195,7 @@ const AlignmentControls = ({ track }) => {
192
195
  const renderDragOverrides = (_a = getDragOverrides(renderNodePath)) !== null && _a !== void 0 ? _a : {};
193
196
  const renderActiveSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
194
197
  schema: track.sequence.controls.schema,
195
- currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
198
+ currentRuntimeValueDotNotation: runtimeValues,
196
199
  dragOverrides: renderDragOverrides,
197
200
  propStatus: renderNodePropStatuses,
198
201
  frame: renderSourceFrame,
@@ -4,6 +4,7 @@ exports.CompositionInspector = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
7
+ const browse_elements_1 = require("../../icons/browse-elements");
7
8
  const frame_1 = require("../../icons/frame");
8
9
  const solid_1 = require("../../icons/solid");
9
10
  const video_1 = require("../../icons/video");
@@ -26,13 +27,26 @@ const actionIconStyle = {
26
27
  height: 18,
27
28
  width: 18,
28
29
  };
30
+ const browseElementsIconStyle = {
31
+ height: 22,
32
+ width: 22,
33
+ };
34
+ const browseElementsIconContainerStyle = {
35
+ height: 22,
36
+ marginLeft: -2,
37
+ marginRight: -2,
38
+ width: 22,
39
+ };
29
40
  const CompositionActions = ({ readOnlyStudio }) => {
30
41
  const { canInsertAsset, canInsertComposition, canInsertSolid, canShowInsertAsset, canShowInsertComposition, canShowInsertSolid, insertAsset, insertComposition, insertSolid, } = (0, use_composition_actions_1.useCompositionActions)();
42
+ const openElementsLibrary = (0, react_1.useCallback)(() => {
43
+ window.open('https://www.remotion.dev/elements', '_blank', 'noopener,noreferrer');
44
+ }, []);
31
45
  if ((readOnlyStudio && !canShowInsertSolid) ||
32
46
  (!canShowInsertAsset && !canShowInsertComposition && !canShowInsertSolid)) {
33
47
  return null;
34
48
  }
35
- return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null] }));
49
+ return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.", children: "Browse Elements..." })) : null] }));
36
50
  };
37
51
  const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
38
52
  var _a;
@@ -40,7 +40,7 @@ const ConnectedCompositionsSection = ({ connectedCompositions }) => {
40
40
  exports.ConnectedCompositionsSection = ConnectedCompositionsSection;
41
41
  const ConnectedCompositionRow = ({ composition }) => {
42
42
  const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
43
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
43
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
44
44
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
45
45
  .previewServerState.type;
46
46
  const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(composition.stack);
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const client_id_1 = require("../../helpers/client-id");
8
8
  const timeline_layout_1 = require("../../helpers/timeline-layout");
9
+ const use_runtime_values_1 = require("../../helpers/use-runtime-values");
9
10
  const plus_1 = require("../../icons/plus");
10
11
  const render_frame_1 = require("../../state/render-frame");
11
12
  const is_menu_item_1 = require("../Menu/is-menu-item");
@@ -26,8 +27,9 @@ const addKeyframeIcon = {
26
27
  width: 18,
27
28
  };
28
29
  const EasingInspector = ({ selection }) => {
29
- var _a, _b;
30
+ var _a, _b, _c;
30
31
  const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
32
+ const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)((_a = track === null || track === void 0 ? void 0 : track.sequence.controls) !== null && _a !== void 0 ? _a : null);
31
33
  const videoConfig = (0, remotion_1.useVideoConfig)();
32
34
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
33
35
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
@@ -44,7 +46,7 @@ const EasingInspector = ({ selection }) => {
44
46
  overrideIdsToNodePaths: overrideIdToNodePathMappings,
45
47
  propStatuses,
46
48
  }), [overrideIdToNodePathMappings, propStatuses, selection, sequences]);
47
- const initialEasing = (_a = easingUpdate === null || easingUpdate === void 0 ? void 0 : easingUpdate.currentEasing) !== null && _a !== void 0 ? _a : null;
49
+ const initialEasing = (_b = easingUpdate === null || easingUpdate === void 0 ? void 0 : easingUpdate.currentEasing) !== null && _b !== void 0 ? _b : null;
48
50
  const easingDetails = (0, react_1.useMemo)(() => {
49
51
  var _a, _b, _c, _d, _e, _f, _g;
50
52
  if (easingUpdate === null || track === null) {
@@ -61,7 +63,7 @@ const EasingInspector = ({ selection }) => {
61
63
  }
62
64
  const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
63
65
  schema: track.sequence.controls.schema,
64
- currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
66
+ currentRuntimeValueDotNotation: runtimeValues,
65
67
  getDragOverrides,
66
68
  propStatuses,
67
69
  nodePath: easingUpdate.nodePath,
@@ -100,9 +102,10 @@ const EasingInspector = ({ selection }) => {
100
102
  getDragOverrides,
101
103
  getEffectDragOverrides,
102
104
  propStatuses,
105
+ runtimeValues,
103
106
  track,
104
107
  ]);
105
- const fieldLabel = (_b = easingDetails === null || easingDetails === void 0 ? void 0 : easingDetails.fieldLabel) !== null && _b !== void 0 ? _b : null;
108
+ const fieldLabel = (_c = easingDetails === null || easingDetails === void 0 ? void 0 : easingDetails.fieldLabel) !== null && _c !== void 0 ? _c : null;
106
109
  const currentEasingSelection = (0, react_1.useMemo)(() => {
107
110
  if (easingUpdate === null || track === null) {
108
111
  return null;
@@ -7,6 +7,7 @@ const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const client_id_1 = require("../../helpers/client-id");
9
9
  const timeline_layout_1 = require("../../helpers/timeline-layout");
10
+ const use_runtime_values_1 = require("../../helpers/use-runtime-values");
10
11
  const is_menu_item_1 = require("../Menu/is-menu-item");
11
12
  const InputDragger_1 = require("../NewComposition/InputDragger");
12
13
  const call_delete_keyframe_1 = require("../Timeline/call-delete-keyframe");
@@ -53,7 +54,9 @@ const TrashIcon = ({ color }) => {
53
54
  return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 448 512", style: removeKeyframeIcon, children: jsx_runtime_1.jsx("path", { fill: color, d: "M160.5 27.4c2-6.8 8.3-11.4 15.3-11.4l96.4 0c7.1 0 13.3 4.6 15.3 11.4l11 36.6-149 0 11-36.6zM116.1 64L16 64C7.2 64 0 71.2 0 80S7.2 96 16 96l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-100.1 0-13.7-45.8C312.1-2.1 293.4-16 272.2-16l-96.4 0c-21.2 0-39.9 13.9-46 34.2L116.1 64zM28.7 144L51.6 452.7c2.5 33.4 30.3 59.3 63.8 59.3l217.1 0c33.5 0 61.3-25.9 63.8-59.3l22.9-308.7-32.1 0-22.7 306.4c-1.2 16.7-15.2 29.6-31.9 29.6l-217.1 0c-16.8 0-30.7-12.9-31.9-29.6L60.8 144 28.7 144z" }) }));
54
55
  };
55
56
  const KeyframeInspector = ({ selection }) => {
57
+ var _a;
56
58
  const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
59
+ const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)((_a = track === null || track === void 0 ? void 0 : track.sequence.controls) !== null && _a !== void 0 ? _a : null);
57
60
  const videoConfig = (0, remotion_1.useVideoConfig)();
58
61
  const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
59
62
  const { clearDragOverrides, clearEffectDragOverrides, setDragOverrides, setEffectDragOverrides, setPropStatuses, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
@@ -81,7 +84,7 @@ const KeyframeInspector = ({ selection }) => {
81
84
  if (keyframeField.type === 'sequence') {
82
85
  const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
83
86
  schema: track.sequence.controls.schema,
84
- currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
87
+ currentRuntimeValueDotNotation: runtimeValues,
85
88
  getDragOverrides,
86
89
  propStatuses,
87
90
  nodePath,
@@ -148,6 +151,7 @@ const KeyframeInspector = ({ selection }) => {
148
151
  getDragOverrides,
149
152
  getEffectDragOverrides,
150
153
  propStatuses,
154
+ runtimeValues,
151
155
  selection,
152
156
  track,
153
157
  ]);
@@ -11,6 +11,9 @@ export declare const SequenceInspectorHeader: React.FC<{
11
11
  readonly sourceLocation: SequenceInspectorSourceLocation;
12
12
  readonly track: TimelineTrackData;
13
13
  }>;
14
+ export declare const SequenceInspectorDuplicationSection: React.FC<{
15
+ readonly track: TimelineTrackData;
16
+ }>;
14
17
  export declare const SequenceInspectorSections: React.FC<{
15
18
  readonly track: TimelineTrackData;
16
19
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SequenceInspectorSections = exports.SequenceInspectorHeader = exports.useSequenceInspectorSourceLocation = void 0;
3
+ exports.SequenceInspectorSections = exports.SequenceInspectorDuplicationSection = exports.SequenceInspectorHeader = exports.useSequenceInspectorSourceLocation = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const client_id_1 = require("../../helpers/client-id");
@@ -10,7 +10,7 @@ const InspectorInfoHeader_1 = require("../InspectorInfoHeader");
10
10
  const InspectorLocationCopy_1 = require("../InspectorLocationCopy");
11
11
  const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
12
12
  const layout_1 = require("../layout");
13
- const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
13
+ const use_open_sequence_in_apps_1 = require("../Timeline/use-open-sequence-in-apps");
14
14
  const use_rename_sequence_1 = require("../Timeline/use-rename-sequence");
15
15
  const common_1 = require("./common");
16
16
  const ConnectedCompositionsSection_1 = require("./ConnectedCompositionsSection");
@@ -38,7 +38,7 @@ const defaultCursor = {
38
38
  cursor: 'default',
39
39
  };
40
40
  const useSequenceInspectorSourceLocation = (sequence) => {
41
- const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_editor_1.useOpenSequenceInEditor)(sequence);
41
+ const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_apps_1.useOpenSequenceInApps)(sequence);
42
42
  const validatedLocation = (0, react_1.useMemo)(() => {
43
43
  var _a;
44
44
  if (!originalLocation ||
@@ -99,11 +99,29 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
99
99
  ] }) }));
100
100
  };
101
101
  exports.SequenceInspectorHeader = SequenceInspectorHeader;
102
+ const SequenceInspectorDuplicationSection = ({ track }) => {
103
+ var _a;
104
+ var _b;
105
+ const numberOfInstances = (_b = (_a = track.nodePathInfo) === null || _a === void 0 ? void 0 : _a.numberOfSequencesWithThisNodePath) !== null && _b !== void 0 ? _b : 0;
106
+ if (numberOfInstances <= 1) {
107
+ return null;
108
+ }
109
+ return (jsx_runtime_1.jsx(common_1.InspectorSection, { header: jsx_runtime_1.jsxs("span", { style: {
110
+ color: 'inherit',
111
+ display: 'block',
112
+ fontFamily: 'inherit',
113
+ fontSize: 'inherit',
114
+ fontWeight: 'normal',
115
+ lineHeight: 'inherit',
116
+ margin: '2px 0',
117
+ }, children: [numberOfInstances, " instances"] }), children: null }));
118
+ };
119
+ exports.SequenceInspectorDuplicationSection = SequenceInspectorDuplicationSection;
102
120
  const SequenceInspectorSections = ({ track }) => {
103
121
  const sourceLocation = (0, exports.useSequenceInspectorSourceLocation)(track.sequence);
104
122
  const connectedCompositions = (0, ConnectedCompositionsSection_1.useConnectedCompositions)({ track });
105
123
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
106
- jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
124
+ jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(exports.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
107
125
  jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
108
126
  ] })) : null] }));
109
127
  };
@@ -141,7 +141,7 @@ const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
141
141
  return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
142
142
  }
143
143
  return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
144
- jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
144
+ jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
145
145
  jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
146
146
  ] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [
147
147
  jsx_runtime_1.jsx(SplitSequenceAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
@@ -33,6 +33,7 @@ export type InspectorInlineActionSegment = {
33
33
  export type InspectorInlineActionProps = {
34
34
  readonly children: React.ReactNode;
35
35
  readonly disabled: boolean;
36
+ readonly iconContainerStyle?: React.CSSProperties;
36
37
  readonly onClick: React.MouseEventHandler<HTMLButtonElement> | null;
37
38
  readonly renderIcon?: (color: string) => React.ReactNode;
38
39
  readonly size?: 'default' | 'compact';
@@ -115,7 +115,7 @@ const segmentedTrailingAction = {
115
115
  padding: 0,
116
116
  width: 28,
117
117
  };
118
- const InspectorInlineAction = ({ children, disabled, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
118
+ const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
119
119
  const isSegmented = variant.type === 'segmented';
120
120
  // A non-clickable single action (onClick === null) never shows a hover
121
121
  // effect. In the segmented variant, the main segment highlights whenever
@@ -135,7 +135,7 @@ const InspectorInlineAction = ({ children, disabled, onClick, renderIcon, size =
135
135
  ...(isSegmented ? segmentedMainAction : null),
136
136
  ...style,
137
137
  }), [disabled, showsHover, isSegmented, size, style]);
138
- const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: inlineLabelIcon, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
138
+ 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
139
  ] }));
140
140
  const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-inline-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
141
  if (variant.type === 'segmented') {
@@ -21,7 +21,7 @@ const useCompositionActions = () => {
21
21
  const [isAddingSolid, setIsAddingSolid] = (0, react_1.useState)(false);
22
22
  const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
23
23
  const [isAddingComposition, setIsAddingComposition] = (0, react_1.useState)(false);
24
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
24
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
25
25
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
26
26
  const previewConnected = previewServerState.type === 'connected';
27
27
  const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
@@ -121,6 +121,7 @@ const useCompositionActions = () => {
121
121
  destinationDimensions: null,
122
122
  dropPosition: null,
123
123
  from: null,
124
+ preferCompositionStart: null,
124
125
  svgImportMode: 'image',
125
126
  });
126
127
  }
@@ -145,6 +146,7 @@ const useCompositionActions = () => {
145
146
  destinationDimensions: null,
146
147
  dropPosition: null,
147
148
  from: null,
149
+ preferCompositionStart: null,
148
150
  });
149
151
  }
150
152
  finally {
@@ -198,6 +200,7 @@ const useCompositionActions = () => {
198
200
  compositionId: currentCompositionId,
199
201
  dropPosition: null,
200
202
  from: null,
203
+ preferCompositionStart: null,
201
204
  });
202
205
  }
203
206
  catch (error) {
@@ -230,7 +230,7 @@ const hasSequenceControls = (sequence) => {
230
230
  exports.hasSequenceControls = hasSequenceControls;
231
231
  const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
232
232
  var _a;
233
- const { tree, propStatuses } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
233
+ const { tree, propStatuses, runtimeValues } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
234
234
  sequence,
235
235
  nodePathInfo,
236
236
  includeTextContent: true,
@@ -242,9 +242,9 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
242
242
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
243
243
  const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
244
244
  const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
245
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
245
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
246
246
  const selectAsset = (0, use_select_asset_1.useSelectAsset)();
247
- const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls);
247
+ const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls, runtimeValues);
248
248
  const assetSelectionInitialQuery = (0, asset_search_1.getAssetSearchQueryForComponent)(sequence.controls.componentIdentity);
249
249
  const getSourceAction = (0, react_1.useCallback)((src) => {
250
250
  var _a;
@@ -412,7 +412,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
412
412
  });
413
413
  const borderRadiusConversion = (0, border_radius_representation_1.getBorderRadiusConversion)(sequencePropStatuses, getDragOverrides(nodePathInfo.sequenceSubscriptionKey));
414
414
  const inlineCaptionValue = ((_a = schema.captions) === null || _a === void 0 ? void 0 : _a.type) === 'remotion-captions'
415
- ? sequence.controls.currentRuntimeValueDotNotation.captions
415
+ ? runtimeValues.captions
416
416
  : null;
417
417
  const inlineCaptions = Array.isArray(inlineCaptionValue)
418
418
  ? inlineCaptionValue
@@ -73,7 +73,7 @@ const InstallPackageModal = ({ packageManager }) => {
73
73
  }
74
74
  setState({ type: 'installing' });
75
75
  try {
76
- await (0, install_package_1.installPackages)(selectedPackages);
76
+ await (0, install_package_1.installPackages)(selectedPackages.map((name) => ({ name, version: null })));
77
77
  setState({ type: 'done' });
78
78
  }
79
79
  catch (err) {
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const MenuSectionHeader: React.FC<{
3
+ readonly children: string;
4
+ }>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MenuSectionHeader = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const colors_1 = require("../../helpers/colors");
6
+ const sectionHeader = {
7
+ color: colors_1.WHITE_ALPHA_50,
8
+ fontSize: 10,
9
+ lineHeight: '12px',
10
+ paddingBottom: 2,
11
+ paddingLeft: 8,
12
+ paddingRight: 8,
13
+ paddingTop: 6,
14
+ userSelect: 'none',
15
+ WebkitUserSelect: 'none',
16
+ };
17
+ const MenuSectionHeader = ({ children }) => {
18
+ return jsx_runtime_1.jsx("div", { style: sectionHeader, children: children });
19
+ };
20
+ exports.MenuSectionHeader = MenuSectionHeader;
@@ -7,22 +7,33 @@ const mobile_layout_1 = require("../../helpers/mobile-layout");
7
7
  const noop_1 = require("../../helpers/noop");
8
8
  const z_index_1 = require("../../state/z-index");
9
9
  const MenuContent_1 = require("../NewComposition/MenuContent");
10
+ const menu_tree_context_1 = require("./menu-tree-context");
10
11
  const portals_1 = require("./portals");
11
12
  const SubMenuComponent = ({ portalStyle, subMenuActivated, subMenu, onQuitFullMenu, onQuitSubMenu, }) => {
12
13
  const mobileLayout = (0, mobile_layout_1.useMobileLayout)();
14
+ const menuTreeId = (0, react_1.useContext)(menu_tree_context_1.MenuTreeContext);
13
15
  const onOutsideClick = (0, react_1.useCallback)((e) => {
16
+ if (menuTreeId !== null) {
17
+ if ((0, menu_tree_context_1.isNodeInMenuTree)(e, menuTreeId)) {
18
+ onQuitSubMenu();
19
+ }
20
+ else {
21
+ onQuitFullMenu();
22
+ }
23
+ return;
24
+ }
14
25
  if (portals_1.portals.find((p) => p.contains(e)) || mobileLayout) {
15
26
  onQuitSubMenu();
16
27
  }
17
28
  else {
18
29
  onQuitFullMenu();
19
30
  }
20
- }, [mobileLayout, onQuitFullMenu, onQuitSubMenu]);
31
+ }, [menuTreeId, mobileLayout, onQuitFullMenu, onQuitSubMenu]);
21
32
  const onPointerDown = (0, react_1.useCallback)((e) => {
22
33
  // Prevent deselection of currently selected items
23
34
  e.stopPropagation();
24
35
  }, []);
25
- return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onQuitFullMenu, onOutsideClick: onOutsideClick, children: jsx_runtime_1.jsx("div", { style: portalStyle, className: "css-reset", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: onQuitSubMenu, values: subMenu.items, onHide: onQuitFullMenu, leaveLeftSpace: subMenu.leaveLeftSpace, preselectIndex: subMenuActivated === 'without-mouse' &&
36
+ return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onQuitFullMenu, onOutsideClick: onOutsideClick, children: jsx_runtime_1.jsx("div", { "data-remotion-menu-tree-id": menuTreeId !== null && menuTreeId !== void 0 ? menuTreeId : undefined, style: portalStyle, className: "css-reset", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: onQuitSubMenu, values: subMenu.items, onHide: onQuitFullMenu, leaveLeftSpace: subMenu.leaveLeftSpace, preselectIndex: subMenuActivated === 'without-mouse' &&
26
37
  typeof subMenu.preselectIndex === 'number'
27
38
  ? subMenu.preselectIndex
28
39
  : false, topItemCanBeUnselected: false, fixedHeight: null }) }) }));
@@ -0,0 +1,3 @@
1
+ export declare const getNextMenuTreeId: () => number;
2
+ export declare const MenuTreeContext: import("react").Context<number | null>;
3
+ export declare const isNodeInMenuTree: (node: Node, menuTreeId: number) => boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNodeInMenuTree = exports.MenuTreeContext = exports.getNextMenuTreeId = void 0;
4
+ const react_1 = require("react");
5
+ let nextMenuTreeId = 0;
6
+ const getNextMenuTreeId = () => nextMenuTreeId++;
7
+ exports.getNextMenuTreeId = getNextMenuTreeId;
8
+ exports.MenuTreeContext = (0, react_1.createContext)(null);
9
+ const isNodeInMenuTree = (node, menuTreeId) => {
10
+ const element = node instanceof Element ? node : node.parentElement;
11
+ return ((element === null || element === void 0 ? void 0 : element.closest(`[data-remotion-menu-tree-id="${menuTreeId}"]`)) !== null);
12
+ };
13
+ exports.isNodeInMenuTree = isNodeInMenuTree;