@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
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRuntimeValueSnapshots = exports.useRuntimeValueSelector = exports.useRuntimeValue = exports.useRuntimeValues = void 0;
4
+ const react_1 = require("react");
5
+ const EMPTY_RUNTIME_VALUES = {};
6
+ const EMPTY_RUNTIME_VALUE_STORE = {
7
+ getSnapshot: () => EMPTY_RUNTIME_VALUES,
8
+ subscribe: () => () => undefined,
9
+ };
10
+ const useRuntimeValues = (controls) => {
11
+ var _a;
12
+ const store = (_a = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _a !== void 0 ? _a : EMPTY_RUNTIME_VALUE_STORE;
13
+ return (0, react_1.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
14
+ };
15
+ exports.useRuntimeValues = useRuntimeValues;
16
+ const useRuntimeValue = (controls, key) => {
17
+ var _a;
18
+ const store = (_a = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _a !== void 0 ? _a : EMPTY_RUNTIME_VALUE_STORE;
19
+ const getSnapshot = (0, react_1.useCallback)(() => store.getSnapshot()[key], [key, store]);
20
+ return (0, react_1.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
21
+ };
22
+ exports.useRuntimeValue = useRuntimeValue;
23
+ const useRuntimeValueSelector = ({ controls, selector, isEqual = Object.is, }) => {
24
+ var _a;
25
+ const store = (_a = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _a !== void 0 ? _a : EMPTY_RUNTIME_VALUE_STORE;
26
+ const selectedStore = (0, react_1.useMemo)(() => {
27
+ let lastSource = store.getSnapshot();
28
+ let lastSelection = selector(lastSource);
29
+ const getSnapshot = () => {
30
+ const nextSource = store.getSnapshot();
31
+ if (nextSource === lastSource) {
32
+ return lastSelection;
33
+ }
34
+ lastSource = nextSource;
35
+ const nextSelection = selector(nextSource);
36
+ if (!isEqual(lastSelection, nextSelection)) {
37
+ lastSelection = nextSelection;
38
+ }
39
+ return lastSelection;
40
+ };
41
+ return {
42
+ getSnapshot,
43
+ subscribe: store.subscribe,
44
+ };
45
+ }, [isEqual, selector, store]);
46
+ return (0, react_1.useSyncExternalStore)(selectedStore.subscribe, selectedStore.getSnapshot, selectedStore.getSnapshot);
47
+ };
48
+ exports.useRuntimeValueSelector = useRuntimeValueSelector;
49
+ const useRuntimeValueSnapshots = (controls) => {
50
+ const stores = (0, react_1.useMemo)(() => controls.map((control) => control.runtimeValues), [controls]);
51
+ const aggregateStore = (0, react_1.useMemo)(() => {
52
+ let lastSnapshots = stores.map((store) => store.getSnapshot());
53
+ const getSnapshot = () => {
54
+ const nextSnapshots = stores.map((store) => store.getSnapshot());
55
+ if (nextSnapshots.length === lastSnapshots.length &&
56
+ nextSnapshots.every((snapshot, index) => snapshot === lastSnapshots[index])) {
57
+ return lastSnapshots;
58
+ }
59
+ lastSnapshots = nextSnapshots;
60
+ return lastSnapshots;
61
+ };
62
+ return {
63
+ getSnapshot,
64
+ subscribe: (listener) => {
65
+ const unsubscribers = stores.map((store) => store.subscribe(listener));
66
+ return () => {
67
+ for (const unsubscribe of unsubscribers) {
68
+ unsubscribe();
69
+ }
70
+ };
71
+ },
72
+ };
73
+ }, [stores]);
74
+ return (0, react_1.useSyncExternalStore)(aggregateStore.subscribe, aggregateStore.getSnapshot, aggregateStore.getSnapshot);
75
+ };
76
+ exports.useRuntimeValueSnapshots = useRuntimeValueSnapshots;
@@ -0,0 +1,2 @@
1
+ import type { SVGProps } from 'react';
2
+ export declare const AppsIcon: ({ color, ...props }: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppsIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const colors_1 = require("../helpers/colors");
6
+ const AppsIcon = ({ color, ...props }) => (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", ...props, children: jsx_runtime_1.jsx("path", { fill: color !== null && color !== void 0 ? color : colors_1.CURRENT_COLOR_LOWERCASE, d: "M144 128C135.2 128 128 135.2 128 144L128 240C128 248.8 135.2 256 144 256L240 256C248.8 256 256 248.8 256 240L256 144C256 135.2 248.8 128 240 128L144 128zM96 144C96 117.5 117.5 96 144 96L240 96C266.5 96 288 117.5 288 144L288 240C288 266.5 266.5 288 240 288L144 288C117.5 288 96 266.5 96 240L96 144zM144 384C135.2 384 128 391.2 128 400L128 496C128 504.8 135.2 512 144 512L240 512C248.8 512 256 504.8 256 496L256 400C256 391.2 248.8 384 240 384L144 384zM96 400C96 373.5 117.5 352 144 352L240 352C266.5 352 288 373.5 288 400L288 496C288 522.5 266.5 544 240 544L144 544C117.5 544 96 522.5 96 496L96 400zM496 128L400 128C391.2 128 384 135.2 384 144L384 240C384 248.8 391.2 256 400 256L496 256C504.8 256 512 248.8 512 240L512 144C512 135.2 504.8 128 496 128zM400 96L496 96C522.5 96 544 117.5 544 144L544 240C544 266.5 522.5 288 496 288L400 288C373.5 288 352 266.5 352 240L352 144C352 117.5 373.5 96 400 96zM400 384C391.2 384 384 391.2 384 400L384 496C384 504.8 391.2 512 400 512L496 512C504.8 512 512 504.8 512 496L512 400C512 391.2 504.8 384 496 384L400 384zM352 400C352 373.5 373.5 352 400 352L496 352C522.5 352 544 373.5 544 400L544 496C544 522.5 522.5 544 496 544L400 544C373.5 544 352 522.5 352 496L352 400z" }) }));
7
+ exports.AppsIcon = AppsIcon;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from 'react';
2
+ export declare const BrowseElementsIcon: React.FC<SVGProps<SVGSVGElement> & {
3
+ readonly color: string;
4
+ }>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BrowseElementsIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Font Awesome Pro v7.3.1, Copyright 2026 Fonticons, Inc.
6
+ // https://fontawesome.com/license (Commercial License)
7
+ const BrowseElementsIcon = ({ color, ...props }) => {
8
+ return (jsx_runtime_1.jsx("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", children: jsx_runtime_1.jsx("path", { fill: color, d: "M320 96L224 256L416 256L320 96zM320 64C331.2 64 341.7 69.9 347.4 79.5L443.4 239.5C449.3 249.4 449.5 261.7 443.8 271.7C438.1 281.7 427.5 288 416 288L224 288C212.5 288 201.8 281.8 196.2 271.8C190.6 261.8 190.7 249.5 196.6 239.6L292.6 79.6C298.3 69.9 308.8 64 320 64zM192 528C236.2 528 272 492.2 272 448C272 403.8 236.2 368 192 368C147.8 368 112 403.8 112 448C112 492.2 147.8 528 192 528zM192 336C253.9 336 304 386.1 304 448C304 509.9 253.9 560 192 560C130.1 560 80 509.9 80 448C80 386.1 130.1 336 192 336zM504 384L392 384C387.6 384 384 387.6 384 392L384 504C384 508.4 387.6 512 392 512L504 512C508.4 512 512 508.4 512 504L512 392C512 387.6 508.4 384 504 384zM392 352L504 352C526.1 352 544 369.9 544 392L544 504C544 526.1 526.1 544 504 544L392 544C369.9 544 352 526.1 352 504L352 392C352 369.9 369.9 352 392 352z" }) }));
9
+ };
10
+ exports.BrowseElementsIcon = BrowseElementsIcon;
@@ -144,10 +144,9 @@ export type ModalState = {
144
144
  } | {
145
145
  type: 'input-props-override';
146
146
  } | {
147
- type: 'configure-license';
147
+ type: 'settings';
148
+ initialTab: 'apps' | 'license';
148
149
  initialPublicLicenseKey: string | null;
149
- } | {
150
- type: 'configure-default-editor';
151
150
  } | RenderModalState | WebRenderModalState | {
152
151
  type: 'render-progress';
153
152
  jobId: string;
@@ -172,8 +171,8 @@ export type ModalState = {
172
171
  onSelected: (composition: _InternalTypes['AnyComposition']) => void;
173
172
  } | null;
174
173
  } | AddEffectModalState | ConfirmationDialogState | SvgImportDialogState;
175
- export type ModalContextType = {
176
- selectedModal: ModalState | null;
174
+ export type SetSelectedModalContextType = {
177
175
  setSelectedModal: React.Dispatch<React.SetStateAction<ModalState | null>>;
178
176
  };
179
- export declare const ModalsContext: React.Context<ModalContextType>;
177
+ export declare const SelectedModalContext: React.Context<ModalState | null>;
178
+ export declare const SetSelectedModalContext: React.Context<SetSelectedModalContextType>;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModalsContext = void 0;
3
+ exports.SetSelectedModalContext = exports.SelectedModalContext = void 0;
4
4
  const react_1 = require("react");
5
- exports.ModalsContext = (0, react_1.createContext)({
6
- selectedModal: null,
5
+ // Keep modal state separate from its stable setter so opening a modal only
6
+ // updates consumers that need to render the selected modal.
7
+ exports.SelectedModalContext = (0, react_1.createContext)(null);
8
+ exports.SetSelectedModalContext = (0, react_1.createContext)({
7
9
  setSelectedModal: () => undefined,
8
10
  });
@@ -2,13 +2,19 @@ import type { Dispatch, SetStateAction } from 'react';
2
2
  import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
3
3
  export type TimelineSequenceHover = {
4
4
  readonly key: string;
5
+ readonly nodePathKey: string;
5
6
  readonly source: 'canvas' | 'timeline';
6
7
  };
7
- type TimelineSequenceHoverState = {
8
- readonly hoveredSequence: TimelineSequenceHover | null;
8
+ type TimelineSequenceHoverStore = {
9
+ readonly getSnapshot: () => TimelineSequenceHover | null;
10
+ readonly subscribe: (listener: () => void) => () => void;
9
11
  readonly setHoveredSequence: Dispatch<SetStateAction<TimelineSequenceHover | null>>;
10
12
  };
11
- export declare const TimelineSequenceHoverContext: import("react").Context<TimelineSequenceHoverState>;
13
+ export declare const createTimelineSequenceHoverStore: () => TimelineSequenceHoverStore;
14
+ export declare const TimelineSequenceHoverContext: import("react").Context<TimelineSequenceHoverStore>;
15
+ export declare const useTimelineSequenceHoverState: () => TimelineSequenceHover | null;
16
+ export declare const useSetTimelineSequenceHover: () => Dispatch<SetStateAction<TimelineSequenceHover | null>>;
17
+ export declare const useIsTimelineSequenceHovered: (nodePathKey: string | null) => boolean;
12
18
  export declare const useTimelineSequenceHover: (nodePathInfo: SequenceNodePathInfo | null) => {
13
19
  hovered: boolean;
14
20
  onPointerEnter: () => void;
@@ -1,33 +1,84 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useTimelineSequenceHover = exports.TimelineSequenceHoverContext = void 0;
3
+ exports.useTimelineSequenceHover = exports.useIsTimelineSequenceHovered = exports.useSetTimelineSequenceHover = exports.useTimelineSequenceHoverState = exports.TimelineSequenceHoverContext = exports.createTimelineSequenceHoverStore = void 0;
4
4
  const react_1 = require("react");
5
5
  const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
6
- exports.TimelineSequenceHoverContext = (0, react_1.createContext)({
7
- hoveredSequence: null,
8
- setHoveredSequence: () => undefined,
9
- });
6
+ const createTimelineSequenceHoverStore = () => {
7
+ let hoveredSequence = null;
8
+ const listeners = new Set();
9
+ return {
10
+ getSnapshot: () => hoveredSequence,
11
+ subscribe: (listener) => {
12
+ listeners.add(listener);
13
+ return () => listeners.delete(listener);
14
+ },
15
+ setHoveredSequence: (action) => {
16
+ const nextHoveredSequence = typeof action === 'function' ? action(hoveredSequence) : action;
17
+ if (nextHoveredSequence === hoveredSequence) {
18
+ return;
19
+ }
20
+ hoveredSequence = nextHoveredSequence;
21
+ for (const listener of listeners) {
22
+ listener();
23
+ }
24
+ },
25
+ };
26
+ };
27
+ exports.createTimelineSequenceHoverStore = createTimelineSequenceHoverStore;
28
+ exports.TimelineSequenceHoverContext = (0, react_1.createContext)((0, exports.createTimelineSequenceHoverStore)());
29
+ const useTimelineSequenceHoverState = () => {
30
+ const store = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
31
+ return (0, react_1.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
32
+ };
33
+ exports.useTimelineSequenceHoverState = useTimelineSequenceHoverState;
34
+ const useSetTimelineSequenceHover = () => {
35
+ return (0, react_1.useContext)(exports.TimelineSequenceHoverContext).setHoveredSequence;
36
+ };
37
+ exports.useSetTimelineSequenceHover = useSetTimelineSequenceHover;
38
+ const useIsTimelineSequenceHovered = (nodePathKey) => {
39
+ const store = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
40
+ const getSnapshot = (0, react_1.useCallback)(() => {
41
+ var _a;
42
+ return nodePathKey !== null && ((_a = store.getSnapshot()) === null || _a === void 0 ? void 0 : _a.nodePathKey) === nodePathKey;
43
+ }, [nodePathKey, store]);
44
+ return (0, react_1.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
45
+ };
46
+ exports.useIsTimelineSequenceHovered = useIsTimelineSequenceHovered;
10
47
  const useTimelineSequenceHover = (nodePathInfo) => {
11
- const { hoveredSequence, setHoveredSequence } = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
48
+ const store = (0, react_1.useContext)(exports.TimelineSequenceHoverContext);
12
49
  const sequenceKey = (0, react_1.useMemo)(() => nodePathInfo === null
13
50
  ? null
14
51
  : (0, timeline_node_path_key_1.timelineNodePathInfoToKey)({ ...nodePathInfo, auxiliaryKeys: [] }), [nodePathInfo]);
52
+ const nodePathKey = (0, react_1.useMemo)(() => nodePathInfo === null
53
+ ? null
54
+ : (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(nodePathInfo.sequenceSubscriptionKey), [nodePathInfo]);
55
+ const hovered = (0, exports.useIsTimelineSequenceHovered)(nodePathKey);
15
56
  const onPointerEnter = (0, react_1.useCallback)(() => {
16
- if (sequenceKey === null) {
57
+ if (sequenceKey === null || nodePathKey === null) {
17
58
  return;
18
59
  }
19
- setHoveredSequence({ key: sequenceKey, source: 'timeline' });
20
- }, [sequenceKey, setHoveredSequence]);
60
+ store.setHoveredSequence((currentHover) => {
61
+ if ((currentHover === null || currentHover === void 0 ? void 0 : currentHover.key) === sequenceKey &&
62
+ currentHover.nodePathKey === nodePathKey &&
63
+ currentHover.source === 'timeline') {
64
+ return currentHover;
65
+ }
66
+ return {
67
+ key: sequenceKey,
68
+ nodePathKey,
69
+ source: 'timeline',
70
+ };
71
+ });
72
+ }, [nodePathKey, sequenceKey, store]);
21
73
  const onPointerLeave = (0, react_1.useCallback)(() => {
22
- setHoveredSequence((currentHover) => {
74
+ store.setHoveredSequence((currentHover) => {
23
75
  if ((currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) !== 'timeline' ||
24
76
  currentHover.key !== sequenceKey) {
25
77
  return currentHover;
26
78
  }
27
79
  return null;
28
80
  });
29
- }, [sequenceKey, setHoveredSequence]);
30
- const hovered = sequenceKey !== null && (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.key) === sequenceKey;
81
+ }, [sequenceKey, store]);
31
82
  return (0, react_1.useMemo)(() => ({ hovered, onPointerEnter, onPointerLeave }), [hovered, onPointerEnter, onPointerLeave]);
32
83
  };
33
84
  exports.useTimelineSequenceHover = useTimelineSequenceHover;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
4
4
  },
5
5
  "name": "@remotion/studio",
6
- "version": "4.0.505",
6
+ "version": "4.0.507",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -24,17 +24,17 @@
24
24
  "react-dom": ">=16.8.0"
25
25
  },
26
26
  "dependencies": {
27
- "@remotion/studio-protocol": "4.0.505",
27
+ "@remotion/studio-protocol": "4.0.507",
28
28
  "semver": "7.5.3",
29
- "remotion": "4.0.505",
30
- "@remotion/captions": "4.0.505",
31
- "@remotion/player": "4.0.505",
32
- "@remotion/media-utils": "4.0.505",
33
- "@remotion/renderer": "4.0.505",
34
- "@remotion/web-renderer": "4.0.505",
35
- "@remotion/studio-shared": "4.0.505",
36
- "@remotion/timeline-utils": "4.0.505",
37
- "@remotion/zod-types": "4.0.505",
29
+ "remotion": "4.0.507",
30
+ "@remotion/captions": "4.0.507",
31
+ "@remotion/player": "4.0.507",
32
+ "@remotion/media-utils": "4.0.507",
33
+ "@remotion/renderer": "4.0.507",
34
+ "@remotion/web-renderer": "4.0.507",
35
+ "@remotion/studio-shared": "4.0.507",
36
+ "@remotion/timeline-utils": "4.0.507",
37
+ "@remotion/zod-types": "4.0.507",
38
38
  "@jridgewell/trace-mapping": "0.3.31",
39
39
  "mediabunny": "1.50.8",
40
40
  "memfs": "3.4.3",
@@ -45,7 +45,7 @@
45
45
  "react": "19.2.3",
46
46
  "react-dom": "19.2.3",
47
47
  "@types/semver": "7.5.3",
48
- "@remotion/eslint-config-internal": "4.0.505",
48
+ "@remotion/eslint-config-internal": "4.0.507",
49
49
  "eslint": "9.19.0",
50
50
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
51
51
  },