@remotion/studio 4.0.518 → 4.0.520

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/visual-control.js +2 -2
  2. package/dist/components/AppLaunchButton.d.ts +16 -0
  3. package/dist/components/AppLaunchButton.js +90 -0
  4. package/dist/components/AssetSelector.js +7 -6
  5. package/dist/components/AssetSelectorItem.d.ts +12 -0
  6. package/dist/components/AssetSelectorItem.js +180 -62
  7. package/dist/components/AudioWaveform.js +6 -1
  8. package/dist/components/Button.js +20 -7
  9. package/dist/components/Canvas.js +117 -92
  10. package/dist/components/CanvasOrLoading.js +7 -7
  11. package/dist/components/CodingAgentButton.d.ts +7 -0
  12. package/dist/components/CodingAgentButton.js +59 -0
  13. package/dist/components/CompositionContextButton.d.ts +1 -0
  14. package/dist/components/CompositionContextButton.js +6 -3
  15. package/dist/components/CompositionSelector.js +21 -20
  16. package/dist/components/CompositionSelectorItem.js +23 -35
  17. package/dist/components/ConfigureLicenseModal.js +4 -48
  18. package/dist/components/CurrentAsset.js +1 -1
  19. package/dist/components/CurrentCompositionSideEffects.js +5 -0
  20. package/dist/components/ElementInstallConfirmation.d.ts +2 -10
  21. package/dist/components/ElementInstallConfirmation.js +339 -32
  22. package/dist/components/FixComputedValueModal.js +5 -131
  23. package/dist/components/FpsCounter.js +1 -1
  24. package/dist/components/FramePersistor.js +1 -1
  25. package/dist/components/InitialCompositionLoader.js +3 -2
  26. package/dist/components/InspectorOpenInEditor.js +48 -33
  27. package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
  28. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
  29. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
  30. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  31. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +5 -4
  33. package/dist/components/InspectorPanel/common.js +1 -0
  34. package/dist/components/InspectorPanel/styles.js +1 -0
  35. package/dist/components/InspectorPanel/use-composition-actions.js +5 -8
  36. package/dist/components/InspectorSequenceSection.js +8 -3
  37. package/dist/components/InspectorSourceLocation.js +5 -1
  38. package/dist/components/KnownBugs.d.ts +1 -1
  39. package/dist/components/KnownBugs.js +1 -1
  40. package/dist/components/LicenseExplanation.d.ts +2 -0
  41. package/dist/components/LicenseExplanation.js +63 -0
  42. package/dist/components/MenuToolbar.js +7 -1
  43. package/dist/components/Modals.js +1 -2
  44. package/dist/components/NewComposition/InputDragger.js +29 -2
  45. package/dist/components/NewComposition/NewCompDuration.js +1 -1
  46. package/dist/components/NewComposition/NewComposition.d.ts +23 -0
  47. package/dist/components/NewComposition/NewComposition.js +217 -80
  48. package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
  49. package/dist/components/PlayPause.js +2 -13
  50. package/dist/components/PreviewToolbar.js +1 -1
  51. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
  52. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +50 -28
  53. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +14 -1
  54. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +64 -9
  55. package/dist/components/QuickSwitcher/composition-search.d.ts +16 -0
  56. package/dist/components/QuickSwitcher/composition-search.js +136 -0
  57. package/dist/components/RenderQueue/actions.d.ts +1 -0
  58. package/dist/components/RenderQueue/actions.js +5 -1
  59. package/dist/components/ResetZoomButton.js +17 -2
  60. package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
  61. package/dist/components/SelectedOutlineElement.js +12 -31
  62. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  63. package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
  64. package/dist/components/SelectedOutlineOverlay.js +21 -26
  65. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  66. package/dist/components/SelectedOutlinePolygon.js +12 -4
  67. package/dist/components/SelectedOutlineRenderer.js +88 -21
  68. package/dist/components/SettingsContext.js +2 -1
  69. package/dist/components/SettingsModal.d.ts +1 -1
  70. package/dist/components/SettingsModal.js +19 -3
  71. package/dist/components/SidebarRenderButton.d.ts +1 -0
  72. package/dist/components/SidebarRenderButton.js +14 -5
  73. package/dist/components/Timeline/SequencePropsObserver.js +29 -14
  74. package/dist/components/Timeline/Timeline.js +2 -1
  75. package/dist/components/Timeline/TimelineAssetField.js +1 -0
  76. package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -90
  77. package/dist/components/Timeline/TimelineDragHandler.js +18 -8
  78. package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -3
  79. package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
  80. package/dist/components/Timeline/TimelinePinchZoom.js +14 -4
  81. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +8 -4
  82. package/dist/components/Timeline/TimelineRowChrome.js +4 -2
  83. package/dist/components/Timeline/TimelineSequence.js +52 -45
  84. package/dist/components/Timeline/TimelineSequenceItem.js +44 -32
  85. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +3 -3
  86. package/dist/components/Timeline/TimelineSlider.js +2 -2
  87. package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
  88. package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
  89. package/dist/components/Timeline/TimelineWidthProvider.js +15 -8
  90. package/dist/components/Timeline/TimelineZoomControls.js +25 -8
  91. package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
  92. package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
  93. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
  94. package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
  95. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
  96. package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
  97. package/dist/components/Timeline/timeline-scroll-logic.d.ts +1 -0
  98. package/dist/components/Timeline/timeline-scroll-logic.js +21 -17
  99. package/dist/components/Timeline/use-delete-timeline-items.d.ts +1 -0
  100. package/dist/components/Timeline/use-delete-timeline-items.js +118 -0
  101. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
  102. package/dist/components/Timeline/use-timeline-asset-drop.js +8 -14
  103. package/dist/components/TimelineCombobox.js +1 -0
  104. package/dist/components/UpdateCheck.d.ts +0 -8
  105. package/dist/components/UpdateCheck.js +7 -54
  106. package/dist/components/UpdateStatusContext.d.ts +18 -0
  107. package/dist/components/UpdateStatusContext.js +74 -0
  108. package/dist/components/UpdatesSettings.d.ts +2 -0
  109. package/dist/components/UpdatesSettings.js +251 -0
  110. package/dist/components/WebMcp.js +64 -11
  111. package/dist/components/ZoomPersistor.js +2 -2
  112. package/dist/components/composition-drag-data.d.ts +36 -0
  113. package/dist/components/composition-drag-data.js +232 -0
  114. package/dist/components/drop-handler-data.d.ts +2 -1
  115. package/dist/components/drop-handler-data.js +6 -4
  116. package/dist/components/effect-drag-and-drop.d.ts +2 -5
  117. package/dist/components/get-open-in-menu-items.d.ts +4 -0
  118. package/dist/components/get-open-in-menu-items.js +28 -24
  119. package/dist/components/handle-drop.js +6 -2
  120. package/dist/components/import-assets.d.ts +5 -13
  121. package/dist/components/root-composition-menu-items.d.ts +4 -1
  122. package/dist/components/root-composition-menu-items.js +38 -1
  123. package/dist/components/selected-outline-geometry.d.ts +21 -2
  124. package/dist/components/selected-outline-geometry.js +16 -5
  125. package/dist/components/selected-outline-measurement.d.ts +40 -1
  126. package/dist/components/selected-outline-measurement.js +239 -1
  127. package/dist/components/selected-outline-order.d.ts +12 -0
  128. package/dist/components/selected-outline-order.js +251 -0
  129. package/dist/components/selected-outline-types.d.ts +15 -2
  130. package/dist/components/selected-outline-uv.js +106 -3
  131. package/dist/components/use-configure-default-apps.d.ts +1 -0
  132. package/dist/components/use-configure-default-apps.js +24 -0
  133. package/dist/error-overlay/current-error.d.ts +13 -0
  134. package/dist/error-overlay/current-error.js +21 -0
  135. package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
  136. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
  137. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
  138. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +6 -2
  139. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
  140. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
  141. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  142. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
  143. package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
  144. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  145. package/dist/esm/chunk-6jf1natv.js +25 -0
  146. package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
  147. package/dist/esm/chunk-m0jqdbkr.js +14571 -0
  148. package/dist/esm/{chunk-7prjt5n5.js → chunk-np6q13k5.js} +18637 -12189
  149. package/dist/esm/index.mjs +4 -3
  150. package/dist/esm/internals.mjs +35826 -14822
  151. package/dist/esm/previewEntry.mjs +40028 -18935
  152. package/dist/esm/renderEntry.mjs +6 -3
  153. package/dist/helpers/can-show-updates.d.ts +5 -0
  154. package/dist/helpers/can-show-updates.js +7 -0
  155. package/dist/helpers/colors.d.ts +0 -3
  156. package/dist/helpers/colors.js +2 -5
  157. package/dist/helpers/create-folder-tree.d.ts +5 -0
  158. package/dist/helpers/create-folder-tree.js +26 -6
  159. package/dist/helpers/document-title.d.ts +2 -0
  160. package/dist/helpers/document-title.js +14 -3
  161. package/dist/helpers/get-asset-metadata.js +1 -1
  162. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
  163. package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
  164. package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
  165. package/dist/helpers/get-box-quads-ponyfill.js +23 -0
  166. package/dist/helpers/get-git-menu-item.d.ts +5 -0
  167. package/dist/helpers/get-git-menu-item.js +15 -1
  168. package/dist/helpers/get-timeline-max-zoom.d.ts +34 -28
  169. package/dist/helpers/get-timeline-max-zoom.js +46 -29
  170. package/dist/helpers/hoverable.js +10 -5
  171. package/dist/helpers/install-fiber-sequence-order-observer.d.ts +37 -0
  172. package/dist/helpers/install-fiber-sequence-order-observer.js +109 -0
  173. package/dist/helpers/open-in-editor.js +53 -2
  174. package/dist/helpers/preview-server-events.js +3 -0
  175. package/dist/helpers/timeline-layout.d.ts +0 -1
  176. package/dist/helpers/timeline-layout.js +1 -5
  177. package/dist/helpers/url-state.d.ts +1 -0
  178. package/dist/helpers/url-state.js +12 -5
  179. package/dist/helpers/use-runtime-values.d.ts +1 -1
  180. package/dist/helpers/use-runtime-values.js +5 -4
  181. package/dist/helpers/use-sync-external-store.d.ts +3 -0
  182. package/dist/helpers/use-sync-external-store.js +5 -0
  183. package/dist/previewEntry.js +2 -0
  184. package/dist/renderEntry.js +2 -0
  185. package/dist/state/folders.d.ts +3 -0
  186. package/dist/state/folders.js +40 -1
  187. package/dist/state/modals.d.ts +19 -8
  188. package/dist/state/timeline-sequence-hover.js +3 -2
  189. package/dist/state/timeline-zoom.d.ts +0 -1
  190. package/dist/state/timeline-zoom.js +13 -6
  191. package/package.json +18 -15
  192. package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
  193. package/dist/components/UpdateModal/UpdateModal.js +0 -104
  194. package/dist/helpers/sort-by-nonce-history.d.ts +0 -1
  195. package/dist/helpers/sort-by-nonce-history.js +0 -6
  196. /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
@@ -26,35 +26,33 @@ const confirmDuplicatingProgrammaticallyDuplicatedSequences = (nodePathInfos, co
26
26
  confirmLabel: 'Duplicate',
27
27
  });
28
28
  };
29
- const duplicateSequence = (nodePathInfo) => {
30
- const nodePath = nodePathInfo.sequenceSubscriptionKey;
31
- return (0, duplicate_jsx_node_api_1.duplicateJsxNode)({
32
- fileName: nodePath.absolutePath,
33
- nodePath: nodePath.nodePath,
34
- });
35
- };
36
- const duplicateSequencesFromSource = (nodePathInfos, confirm) => {
29
+ const duplicateSequencesFromSource = async (nodePathInfos, confirm) => {
37
30
  const programmaticallyDuplicated = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath > 1);
38
31
  const regular = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath <= 1);
39
- return confirmDuplicatingProgrammaticallyDuplicatedSequences(programmaticallyDuplicated, confirm).then((shouldDuplicateProgrammaticSequences) => {
40
- const toDuplicate = [...regular];
41
- if (shouldDuplicateProgrammaticSequences) {
42
- toDuplicate.push(...programmaticallyDuplicated);
32
+ const shouldDuplicateProgrammaticSequences = await confirmDuplicatingProgrammaticallyDuplicatedSequences(programmaticallyDuplicated, confirm);
33
+ const toDuplicate = [...regular];
34
+ if (shouldDuplicateProgrammaticSequences) {
35
+ toDuplicate.push(...programmaticallyDuplicated);
36
+ }
37
+ const nodes = toDuplicate.map((nodePathInfo) => {
38
+ const nodePath = nodePathInfo.sequenceSubscriptionKey;
39
+ return {
40
+ fileName: nodePath.absolutePath,
41
+ nodePath: nodePath.nodePath,
42
+ };
43
+ });
44
+ try {
45
+ if (nodes.length === 0) {
46
+ return;
43
47
  }
44
- if (toDuplicate.length === 0) {
45
- return Promise.resolve();
48
+ const result = await (0, duplicate_jsx_node_api_1.duplicateJsxNode)({ nodes });
49
+ if (!result.success) {
50
+ (0, NotificationCenter_1.showNotification)(result.reason, 4000);
46
51
  }
47
- return Promise.all(toDuplicate.map(duplicateSequence))
48
- .then((results) => {
49
- const failedResult = results.find((result) => !result.success);
50
- if (failedResult && !failedResult.success) {
51
- (0, NotificationCenter_1.showNotification)(failedResult.reason, 4000);
52
- }
53
- })
54
- .catch((err) => {
55
- (0, NotificationCenter_1.showNotification)(err.message, 4000);
56
- });
57
- });
52
+ }
53
+ catch (err) {
54
+ (0, NotificationCenter_1.showNotification)(err.message, 4000);
55
+ }
58
56
  };
59
57
  exports.duplicateSequencesFromSource = duplicateSequencesFromSource;
60
58
  const isDuplicatableSequenceRowSelection = (selection) => selection.type === 'sequence';
@@ -2,6 +2,12 @@ import type { EditorPickerId, GetDefaultCodingAgentInfoResponse, GetDefaultEdito
2
2
  import type { ResolvedStackLocation, TSequence } from 'remotion';
3
3
  import type { ComboboxValue } from '../NewComposition/ComboBox';
4
4
  import type { TimelineAssetLinkInfo } from './timeline-asset-link';
5
+ export declare const getMultiSequenceContextMenuItems: ({ deleteDisabled, duplicateDisabled, onDeleteSelectedSequences, onDuplicateSelectedSequences, }: {
6
+ readonly deleteDisabled: boolean;
7
+ readonly duplicateDisabled: boolean;
8
+ readonly onDeleteSelectedSequences: () => void;
9
+ readonly onDuplicateSelectedSequences: () => void;
10
+ }) => ComboboxValue[];
5
11
  export declare const getSequenceContextMenuItems: ({ assetLinkInfo, canOpenInEditor, deleteDisabled, disableInteractivityDisabled, duplicateDisabled, isProgrammaticallyDuplicated, includeSourceEditItems, codingAgentInfo, editorInfo, onConfigureApps, onDeleteSequenceFromSource, onDisableSequenceInteractivity, onDuplicateSequenceFromSource, openInCodingAgent, openInEditor, originalLocation, selectAsset, sequence, sourceActions, }: {
6
12
  readonly assetLinkInfo: TimelineAssetLinkInfo | null;
7
13
  readonly canOpenInEditor: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSequenceContextMenuItems = void 0;
3
+ exports.getSequenceContextMenuItems = exports.getMultiSequenceContextMenuItems = void 0;
4
4
  const no_react_1 = require("remotion/no-react");
5
5
  const format_file_location_1 = require("../../helpers/format-file-location");
6
6
  const get_open_in_menu_items_1 = require("../get-open-in-menu-items");
@@ -27,6 +27,39 @@ const normalizeMenuDividers = (items) => {
27
27
  return normalized;
28
28
  };
29
29
  const interactiveSvgComponentIdentity = 'dev.remotion.remotion.Interactive.Svg';
30
+ const getMultiSequenceContextMenuItems = ({ deleteDisabled, duplicateDisabled, onDeleteSelectedSequences, onDuplicateSelectedSequences, }) => {
31
+ return [
32
+ {
33
+ type: 'item',
34
+ id: 'duplicate-selected-sequences',
35
+ keyHint: null,
36
+ label: 'Duplicate selected',
37
+ leftItem: null,
38
+ disabled: duplicateDisabled,
39
+ onClick: onDuplicateSelectedSequences,
40
+ quickSwitcherLabel: null,
41
+ subMenu: null,
42
+ value: 'duplicate-selected-sequences',
43
+ },
44
+ {
45
+ type: 'divider',
46
+ id: 'duplicate-delete-selected-sequences-divider',
47
+ },
48
+ {
49
+ type: 'item',
50
+ id: 'delete-selected-sequences',
51
+ keyHint: null,
52
+ label: 'Delete selected',
53
+ leftItem: null,
54
+ disabled: deleteDisabled,
55
+ onClick: onDeleteSelectedSequences,
56
+ quickSwitcherLabel: null,
57
+ subMenu: null,
58
+ value: 'delete-selected-sequences',
59
+ },
60
+ ];
61
+ };
62
+ exports.getMultiSequenceContextMenuItems = getMultiSequenceContextMenuItems;
30
63
  const getSequenceContextMenuItems = ({ assetLinkInfo, canOpenInEditor, deleteDisabled, disableInteractivityDisabled, duplicateDisabled, isProgrammaticallyDuplicated, includeSourceEditItems, codingAgentInfo, editorInfo, onConfigureApps, onDeleteSequenceFromSource, onDisableSequenceInteractivity, onDuplicateSequenceFromSource, openInCodingAgent, openInEditor, originalLocation, selectAsset, sequence, sourceActions = [], }) => {
31
64
  var _a, _b, _c;
32
65
  var _d, _e, _f;
@@ -2,6 +2,8 @@ import type { SequenceNodePath, InteractivitySchema, VideoConfigValues } from 'r
2
2
  import { subscribeToSequenceProps } from '../sequence-props-api';
3
3
  type SubscribeResult = Awaited<ReturnType<typeof subscribeToSequenceProps>>;
4
4
  type ApplyResult = (result: SubscribeResult) => void;
5
+ export declare const subscribeToSequencePropsRefresh: (overrideId: string, listener: () => void) => () => void;
6
+ export declare const refreshSequencePropsSubscription: (overrideId: string) => void;
5
7
  export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, stack, }: {
6
8
  fileName: string;
7
9
  line: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.acquireSequencePropsSubscription = void 0;
3
+ exports.acquireSequencePropsSubscription = exports.refreshSequencePropsSubscription = exports.subscribeToSequencePropsRefresh = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const remotion_1 = require("remotion");
6
6
  const sequence_props_api_1 = require("../sequence-props-api");
@@ -8,6 +8,27 @@ const sequence_props_api_1 = require("../sequence-props-api");
8
8
  // resolve both the old and new JSX nodes to the same line and column.
9
9
  const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, assetKeys, effectKeys, videoConfigValues, stack, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${assetKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}\0${JSON.stringify(videoConfigValues)}\0${stack !== null && stack !== void 0 ? stack : ''}`;
10
10
  const entries = new Map();
11
+ const refreshListeners = new Map();
12
+ const subscribeToSequencePropsRefresh = (overrideId, listener) => {
13
+ var _a;
14
+ const listeners = (_a = refreshListeners.get(overrideId)) !== null && _a !== void 0 ? _a : new Set();
15
+ listeners.add(listener);
16
+ refreshListeners.set(overrideId, listeners);
17
+ return () => {
18
+ listeners.delete(listener);
19
+ if (listeners.size === 0) {
20
+ refreshListeners.delete(overrideId);
21
+ }
22
+ };
23
+ };
24
+ exports.subscribeToSequencePropsRefresh = subscribeToSequencePropsRefresh;
25
+ const refreshSequencePropsSubscription = (overrideId) => {
26
+ var _a;
27
+ for (const listener of (_a = refreshListeners.get(overrideId)) !== null && _a !== void 0 ? _a : []) {
28
+ listener();
29
+ }
30
+ };
31
+ exports.refreshSequencePropsSubscription = refreshSequencePropsSubscription;
11
32
  const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, stack, }) => {
12
33
  const sequenceKeys = (0, studio_shared_1.getAllSchemaKeys)(schema);
13
34
  const assetKeys = (0, studio_shared_1.getAssetSchemaKeys)(schema);
@@ -3,6 +3,7 @@ export declare const canScrollTimelineIntoDirection: () => {
3
3
  canScrollLeft: boolean;
4
4
  };
5
5
  export declare const SCROLL_INCREMENT = 200;
6
+ export declare const getTimelineContentWidth: () => number;
6
7
  export declare const EDGE_SCROLL_VERTICAL_INCREMENT = 60;
7
8
  export type TimelineEdgeScrollDirections = {
8
9
  x: 'left' | 'right' | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prepareToPreserveTimelineCursor = exports.getScrollLeftToKeepCursorInPlace = exports.viewportClientXToScrollContentX = exports.getFrameFromTimelineDrop = exports.getFrameFromX = exports.getFrameWhileScrollingRight = exports.getFrameIncrementFromWidth = exports.getScrollPositionForCursorOnRightEdge = exports.getScrollPositionForCursorOnLeftEdge = exports.scrollToTimelineXOffset = exports.ensureFrameIsInViewport = exports.isCursorInViewport = exports.getFrameWhileScrollingLeft = exports.startTimelineEdgeAutoScroll = exports.EDGE_SCROLL_VERTICAL_INCREMENT = exports.SCROLL_INCREMENT = exports.canScrollTimelineIntoDirection = void 0;
3
+ exports.prepareToPreserveTimelineCursor = exports.getScrollLeftToKeepCursorInPlace = exports.viewportClientXToScrollContentX = exports.getFrameFromTimelineDrop = exports.getFrameFromX = exports.getFrameWhileScrollingRight = exports.getFrameIncrementFromWidth = exports.getScrollPositionForCursorOnRightEdge = exports.getScrollPositionForCursorOnLeftEdge = exports.scrollToTimelineXOffset = exports.ensureFrameIsInViewport = exports.isCursorInViewport = exports.getFrameWhileScrollingLeft = exports.startTimelineEdgeAutoScroll = exports.EDGE_SCROLL_VERTICAL_INCREMENT = exports.getTimelineContentWidth = exports.SCROLL_INCREMENT = exports.canScrollTimelineIntoDirection = void 0;
4
4
  const remotion_1 = require("remotion");
5
5
  const timeline_layout_1 = require("../../helpers/timeline-layout");
6
6
  const imperative_state_1 = require("./imperative-state");
@@ -15,6 +15,12 @@ const canScrollTimelineIntoDirection = () => {
15
15
  };
16
16
  exports.canScrollTimelineIntoDirection = canScrollTimelineIntoDirection;
17
17
  exports.SCROLL_INCREMENT = 200;
18
+ const getTimelineContentWidth = () => {
19
+ var _a, _b;
20
+ var _c, _d;
21
+ return ((_d = (_c = (_a = timeline_refs_1.sliderAreaRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _c !== void 0 ? _c : (_b = timeline_refs_1.scrollableRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth) !== null && _d !== void 0 ? _d : 0);
22
+ };
23
+ exports.getTimelineContentWidth = getTimelineContentWidth;
18
24
  exports.EDGE_SCROLL_VERTICAL_INCREMENT = 60;
19
25
  const EDGE_SCROLL_INTERVAL_MS = 100;
20
26
  // Once edge-scrolling has started, the pointer must move this many pixels
@@ -169,10 +175,10 @@ const getFrameWhileScrollingLeft = ({ durationInFrames, width, }) => {
169
175
  };
170
176
  exports.getFrameWhileScrollingLeft = getFrameWhileScrollingLeft;
171
177
  const isCursorInViewport = ({ frame, durationInFrames, }) => {
172
- var _a, _b;
173
- var _c, _d;
174
- const width = (_c = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) !== null && _c !== void 0 ? _c : 0;
175
- const scrollLeft = (_d = (_b = timeline_refs_1.scrollableRef.current) === null || _b === void 0 ? void 0 : _b.scrollLeft) !== null && _d !== void 0 ? _d : 0;
178
+ var _a;
179
+ var _b;
180
+ const width = (0, exports.getTimelineContentWidth)();
181
+ const scrollLeft = (_b = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
176
182
  const scrollPosOnRightEdge = (0, exports.getScrollPositionForCursorOnRightEdge)({
177
183
  nextFrame: frame,
178
184
  durationInFrames,
@@ -194,14 +200,14 @@ const isCursorInViewport = ({ frame, durationInFrames, }) => {
194
200
  };
195
201
  exports.isCursorInViewport = isCursorInViewport;
196
202
  const ensureFrameIsInViewport = ({ direction, durationInFrames, frame, }) => {
197
- var _a, _b, _c;
198
- var _d, _e;
203
+ var _a, _b;
204
+ var _c;
199
205
  // Sync the imperative frame first: scrolling below triggers the scroll
200
206
  // listener in TimelineSlider, which reads the frame imperatively.
201
207
  (0, imperative_state_1.setCurrentFrame)(frame);
202
208
  (_a = TimelineSlider_1.redrawTimelineSliderFast.current) === null || _a === void 0 ? void 0 : _a.draw(frame);
203
- const width = (_d = (_b = timeline_refs_1.scrollableRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth) !== null && _d !== void 0 ? _d : 0;
204
- const scrollLeft = (_e = (_c = timeline_refs_1.scrollableRef.current) === null || _c === void 0 ? void 0 : _c.scrollLeft) !== null && _e !== void 0 ? _e : 0;
209
+ const width = (0, exports.getTimelineContentWidth)();
210
+ const scrollLeft = (_c = (_b = timeline_refs_1.scrollableRef.current) === null || _b === void 0 ? void 0 : _b.scrollLeft) !== null && _c !== void 0 ? _c : 0;
205
211
  if (direction === 'fit-left') {
206
212
  const currentFrameLeft = (0, exports.getFrameFromX)({
207
213
  clientX: scrollLeft,
@@ -281,22 +287,20 @@ const getScrollPositionForCursorOnLeftEdge = ({ nextFrame, durationInFrames, })
281
287
  };
282
288
  exports.getScrollPositionForCursorOnLeftEdge = getScrollPositionForCursorOnLeftEdge;
283
289
  const getScrollPositionForCursorOnRightEdge = ({ nextFrame, durationInFrames, }) => {
284
- var _a, _b;
290
+ var _a;
285
291
  const frameIncrement = getFrameIncrement(durationInFrames);
286
292
  const framesRemaining = durationInFrames - 1 - nextFrame;
287
293
  const fromRight = framesRemaining * frameIncrement + timeline_layout_1.TIMELINE_PADDING;
288
- const scrollPos = ((_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) -
294
+ const scrollPos = (0, exports.getTimelineContentWidth)() -
289
295
  fromRight -
290
- ((_b = timeline_refs_1.scrollableRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) +
296
+ ((_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) +
291
297
  timeline_layout_1.TIMELINE_PADDING +
292
298
  4; // clearfix;
293
299
  return scrollPos;
294
300
  };
295
301
  exports.getScrollPositionForCursorOnRightEdge = getScrollPositionForCursorOnRightEdge;
296
302
  const getFrameIncrement = (durationInFrames) => {
297
- var _a;
298
- var _b;
299
- const width = (_b = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) !== null && _b !== void 0 ? _b : 0;
303
+ const width = (0, exports.getTimelineContentWidth)();
300
304
  return (0, exports.getFrameIncrementFromWidth)(durationInFrames, width);
301
305
  };
302
306
  const getFrameIncrementFromWidth = (durationInFrames, width) => {
@@ -366,7 +370,7 @@ const prepareToPreserveTimelineCursor = ({ currentFrame, currentDurationInFrames
366
370
  if (!current) {
367
371
  return () => undefined;
368
372
  }
369
- const oldTimelineWidth = current.scrollWidth;
373
+ const oldTimelineWidth = (0, exports.getTimelineContentWidth)();
370
374
  const oldScrollLeft = current.scrollLeft;
371
375
  const frameIncrement = (0, exports.getFrameIncrementFromWidth)(currentDurationInFrames, oldTimelineWidth);
372
376
  const frameForScroll = anchorFrame !== null && anchorFrame !== void 0 ? anchorFrame : currentFrame;
@@ -381,7 +385,7 @@ const prepareToPreserveTimelineCursor = ({ currentFrame, currentDurationInFrames
381
385
  anchorContentX: prevCursorPosition,
382
386
  oldScrollLeft,
383
387
  oldTimelineWidth,
384
- newTimelineWidth: current.scrollWidth,
388
+ newTimelineWidth: (0, exports.getTimelineContentWidth)(),
385
389
  });
386
390
  };
387
391
  };
@@ -0,0 +1 @@
1
+ export declare const useDeleteTimelineItems: () => (selectedItemsOverride: readonly import("@remotion/canvas").CanvasSelectionItem[] | null) => void;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDeleteTimelineItems = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const client_id_1 = require("../../helpers/client-id");
8
+ const editor_guides_1 = require("../../state/editor-guides");
9
+ const ConfirmationDialog_1 = require("../ConfirmationDialog");
10
+ const delete_selected_timeline_item_1 = require("./delete-selected-timeline-item");
11
+ const imperative_state_1 = require("./imperative-state");
12
+ const reset_selected_timeline_props_1 = require("./reset-selected-timeline-props");
13
+ const TimelineSelection_1 = require("./TimelineSelection");
14
+ const update_selected_easing_1 = require("./update-selected-easing");
15
+ const useDeleteTimelineItems = () => {
16
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
17
+ const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
18
+ const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
19
+ const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
20
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
21
+ const { setGuidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
22
+ const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
23
+ const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
24
+ return (0, react_1.useCallback)((selectedItemsOverride) => {
25
+ if (previewServerState.type !== 'connected') {
26
+ return;
27
+ }
28
+ const { clientId } = previewServerState;
29
+ const { selectedItems: currentSelectedItems, clearSelection, selectItems, } = currentSelection.current;
30
+ const selectedItems = selectedItemsOverride !== null && selectedItemsOverride !== void 0 ? selectedItemsOverride : currentSelectedItems;
31
+ const sequences = sequencesRef.current;
32
+ const propStatuses = propStatusesRef.current;
33
+ const timelinePosition = (0, imperative_state_1.getCurrentFrame)();
34
+ if (selectedItems.length === 0) {
35
+ return;
36
+ }
37
+ const selectedGuide = selectedItems.find((item) => item.type === 'guide');
38
+ if (selectedGuide) {
39
+ setGuidesList((prevGuides) => {
40
+ const newGuides = prevGuides.filter((guide) => guide.id !== selectedGuide.guideId);
41
+ (0, editor_guides_1.persistGuidesList)(newGuides);
42
+ return newGuides;
43
+ });
44
+ clearSelection();
45
+ return;
46
+ }
47
+ const deletePromise = (0, delete_selected_timeline_item_1.deleteSelectedTimelineItems)({
48
+ selections: selectedItems,
49
+ sequences,
50
+ overrideIdsToNodePaths: overrideIdToNodePathMappings,
51
+ setPropStatuses,
52
+ clientId,
53
+ confirm,
54
+ propStatuses,
55
+ timelinePosition,
56
+ });
57
+ if (deletePromise !== null) {
58
+ deletePromise
59
+ .then((deleted) => {
60
+ if (!deleted) {
61
+ return;
62
+ }
63
+ const nextSelection = (0, delete_selected_timeline_item_1.getTimelineSelectionAfterDeletingItems)({
64
+ selections: selectedItems,
65
+ sequences,
66
+ overrideIdsToNodePaths: overrideIdToNodePathMappings,
67
+ propStatuses,
68
+ timelinePosition,
69
+ });
70
+ if (nextSelection.length === 0) {
71
+ clearSelection();
72
+ }
73
+ else {
74
+ selectItems(nextSelection);
75
+ }
76
+ })
77
+ .catch(() => undefined);
78
+ return;
79
+ }
80
+ const easingSelections = (0, update_selected_easing_1.getEasingSelections)(selectedItems);
81
+ if (easingSelections.length === selectedItems.length) {
82
+ const resetEasingPromise = (0, update_selected_easing_1.updateSelectedTimelineEasings)({
83
+ selections: easingSelections,
84
+ sequences,
85
+ overrideIdsToNodePaths: overrideIdToNodePathMappings,
86
+ propStatuses,
87
+ setPropStatuses,
88
+ clientId,
89
+ easing: studio_shared_1.LINEAR_KEYFRAME_EASING,
90
+ });
91
+ if (resetEasingPromise !== null) {
92
+ resetEasingPromise.catch(() => undefined);
93
+ return;
94
+ }
95
+ }
96
+ const resetPromise = (0, reset_selected_timeline_props_1.resetSelectedTimelineProps)({
97
+ selections: selectedItems,
98
+ sequences,
99
+ overrideIdsToNodePaths: overrideIdToNodePathMappings,
100
+ propStatuses,
101
+ setPropStatuses,
102
+ clientId,
103
+ });
104
+ if (resetPromise !== null) {
105
+ resetPromise.catch(() => undefined);
106
+ }
107
+ }, [
108
+ confirm,
109
+ currentSelection,
110
+ overrideIdToNodePathMappings,
111
+ previewServerState,
112
+ propStatusesRef,
113
+ sequencesRef,
114
+ setGuidesList,
115
+ setPropStatuses,
116
+ ]);
117
+ };
118
+ exports.useDeleteTimelineItems = useDeleteTimelineItems;
@@ -15,6 +15,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
15
15
  const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
16
16
  const { migrateExpandedTracksForSubscriptionKey } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
17
17
  const { previewServerState: state } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
18
+ const [refreshToken, setRefreshToken] = (0, react_1.useState)(0);
18
19
  const previousNodePathRef = (0, react_1.useRef)(null);
19
20
  const overrideIdToNodePathMappingsRef = (0, react_1.useRef)(overrideIdToNodePathMappings);
20
21
  overrideIdToNodePathMappingsRef.current = overrideIdToNodePathMappings;
@@ -37,6 +38,11 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
37
38
  const locationSource = (_a = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) !== null && _a !== void 0 ? _a : null;
38
39
  const locationLine = (_b = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.line) !== null && _b !== void 0 ? _b : null;
39
40
  const locationColumn = (_c = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.column) !== null && _c !== void 0 ? _c : null;
41
+ (0, react_1.useEffect)(() => {
42
+ return (0, sequence_props_subscription_store_1.subscribeToSequencePropsRefresh)(overrideId, () => {
43
+ setRefreshToken((token) => token + 1);
44
+ });
45
+ }, [overrideId]);
40
46
  (0, react_1.useEffect)(() => {
41
47
  var _a, _b;
42
48
  if (!clientId ||
@@ -108,6 +114,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
108
114
  migrateExpandedTracksForSubscriptionKey,
109
115
  overrideId,
110
116
  preferMappedNodePath,
117
+ refreshToken,
111
118
  schema,
112
119
  setPropStatuses,
113
120
  setOverrideIdToNodePath,
@@ -17,15 +17,8 @@ const imperative_state_1 = require("./imperative-state");
17
17
  const timeline_refs_1 = require("./timeline-refs");
18
18
  const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
19
19
  const use_resolved_stack_1 = require("./use-resolved-stack");
20
- const isEventInsideElement = (event, element) => {
21
- if (event.target instanceof Node && element.contains(event.target)) {
22
- return true;
23
- }
24
- const rect = element.getBoundingClientRect();
25
- return (event.clientX >= rect.left &&
26
- event.clientX <= rect.right &&
27
- event.clientY >= rect.top &&
28
- event.clientY <= rect.bottom);
20
+ const isEventTargetInsideElement = (event, element) => {
21
+ return event.target instanceof Node && element.contains(event.target);
29
22
  };
30
23
  const useTimelineAssetDrop = () => {
31
24
  var _a, _b;
@@ -60,13 +53,14 @@ const useTimelineAssetDrop = () => {
60
53
  return null;
61
54
  }
62
55
  const scrollable = timeline_refs_1.scrollableRef.current;
63
- return scrollable !== null && isEventInsideElement(event, scrollable)
56
+ return scrollable !== null &&
57
+ isEventTargetInsideElement(event, scrollable)
64
58
  ? (0, timeline_scroll_logic_1.getFrameFromTimelineDrop)({
65
59
  clientX: event.clientX,
66
60
  durationInFrames: videoConfig.durationInFrames,
67
61
  scrollLeft: scrollable.scrollLeft,
68
62
  timelineLeft: scrollable.getBoundingClientRect().left,
69
- timelineWidth: scrollable.scrollWidth,
63
+ timelineWidth: (0, timeline_scroll_logic_1.getTimelineContentWidth)(),
70
64
  })
71
65
  : (0, imperative_state_1.getCurrentFrame)();
72
66
  }, [videoConfig]);
@@ -76,7 +70,7 @@ const useTimelineAssetDrop = () => {
76
70
  if (timeline === null ||
77
71
  dataTransfer === null ||
78
72
  !(0, drop_handler_data_1.isSupportedDropEvent)(event) ||
79
- !isEventInsideElement(event, timeline)) {
73
+ !isEventTargetInsideElement(event, timeline)) {
80
74
  setAssetDropFrame(null);
81
75
  return;
82
76
  }
@@ -86,7 +80,7 @@ const useTimelineAssetDrop = () => {
86
80
  const scrollable = timeline_refs_1.scrollableRef.current;
87
81
  const shouldShowDropFrame = canInsertAsset &&
88
82
  scrollable !== null &&
89
- isEventInsideElement(event, scrollable);
83
+ isEventTargetInsideElement(event, scrollable);
90
84
  setAssetDropFrame(shouldShowDropFrame ? getDropFrame(event) : null);
91
85
  }, [canInsertAsset, getDropFrame]);
92
86
  const onAssetDrop = (0, react_1.useCallback)(async (event) => {
@@ -96,7 +90,7 @@ const useTimelineAssetDrop = () => {
96
90
  if (timeline === null ||
97
91
  dataTransfer === null ||
98
92
  !(0, drop_handler_data_1.isSupportedDropEvent)(event) ||
99
- !isEventInsideElement(event, timeline)) {
93
+ !isEventTargetInsideElement(event, timeline)) {
100
94
  return;
101
95
  }
102
96
  const localFiles = (0, drop_handler_data_1.isFileDragEvent)(event)
@@ -18,6 +18,7 @@ const label = {
18
18
  overflow: 'hidden',
19
19
  textAlign: 'left',
20
20
  textOverflow: 'ellipsis',
21
+ userSelect: 'none',
21
22
  whiteSpace: 'nowrap',
22
23
  };
23
24
  const TimelineCombobox = ({ values, selectedId, title, labelWidth = 32, renderLeftItem, unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
@@ -1,9 +1 @@
1
- import type { GetRemotionSkillsInfoResponse, UpdateAvailableResponse } from '@remotion/studio-shared';
2
- export type UpdateInfo = UpdateAvailableResponse & Pick<GetRemotionSkillsInfoResponse, 'remotionUpgradeSkillAvailable'>;
3
- export type Bug = {
4
- title: string;
5
- description: string;
6
- link: string;
7
- versions: string[];
8
- };
9
1
  export declare const UpdateCheck: () => import("react/jsx-runtime").JSX.Element | null;
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateCheck = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const remotion_1 = require("remotion");
7
6
  const colors_1 = require("../helpers/colors");
8
7
  const modals_1 = require("../state/modals");
9
8
  const z_index_1 = require("../state/z-index");
10
9
  const InlineAction_1 = require("./InlineAction");
11
- const actions_1 = require("./RenderQueue/actions");
12
- const SettingsContext_1 = require("./SettingsContext");
10
+ const UpdateStatusContext_1 = require("./UpdateStatusContext");
13
11
  const buttonStyle = {
14
12
  appearance: 'none',
15
13
  border: 'none',
@@ -27,67 +25,22 @@ const updateIconContainer = {
27
25
  flexShrink: 0,
28
26
  };
29
27
  const UpdateCheck = () => {
30
- const [info, setInfo] = (0, react_1.useState)(null);
31
28
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
32
- const { remotionSkillsInfo } = (0, SettingsContext_1.useSettings)();
33
29
  const { tabIndex } = (0, z_index_1.useZIndex)();
34
- const [knownBugs, setKnownBugs] = (0, react_1.useState)(null);
30
+ const { info, knownBugs } = (0, UpdateStatusContext_1.useUpdateStatus)();
35
31
  const [hovered, setHovered] = (0, react_1.useState)(false);
36
32
  const hasBugfixesAvailable = (0, react_1.useMemo)(() => {
37
33
  return Boolean((info === null || info === void 0 ? void 0 : info.updateAvailable) && knownBugs && knownBugs.length > 0);
38
34
  }, [info === null || info === void 0 ? void 0 : info.updateAvailable, knownBugs]);
39
- const checkForUpdates = (0, react_1.useCallback)(() => {
40
- const controller = new AbortController();
41
- (0, actions_1.updateAvailable)(controller.signal)
42
- .then((d) => {
43
- setInfo(d);
44
- })
45
- .catch((err) => {
46
- if (err.message.includes('aborted')) {
47
- return;
48
- }
49
- // eslint-disable-next-line no-console
50
- console.log('Could not check for updates', err);
51
- });
52
- return controller;
53
- }, []);
54
- const checkForBugs = (0, react_1.useCallback)(() => {
55
- const controller = new AbortController();
56
- fetch(`https://bugs.remotion.dev/api/${remotion_1.VERSION}`, {
57
- signal: controller.signal,
58
- })
59
- .then(async (res) => {
60
- const body = await res.json();
61
- setKnownBugs(body.bugs);
62
- })
63
- .catch((err) => {
64
- if (err.message.includes('aborted')) {
65
- return;
66
- }
67
- // eslint-disable-next-line no-console
68
- console.log('Could not check for bugs in this version', err);
69
- });
70
- return controller;
71
- }, []);
72
- (0, react_1.useEffect)(() => {
73
- const abortUpdate = checkForUpdates();
74
- const abortBugs = checkForBugs();
75
- return () => {
76
- abortUpdate.abort();
77
- abortBugs.abort();
78
- };
79
- }, [checkForBugs, checkForUpdates]);
80
35
  const openModal = (0, react_1.useCallback)(() => {
81
36
  var _a;
37
+ var _b;
82
38
  setSelectedModal({
83
- type: 'update',
84
- info: {
85
- ...info,
86
- remotionUpgradeSkillAvailable: (_a = remotionSkillsInfo === null || remotionSkillsInfo === void 0 ? void 0 : remotionSkillsInfo.remotionUpgradeSkillAvailable) !== null && _a !== void 0 ? _a : false,
87
- },
88
- knownBugs: knownBugs,
39
+ type: 'settings',
40
+ initialTab: 'updates',
41
+ initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
89
42
  });
90
- }, [info, knownBugs, remotionSkillsInfo, setSelectedModal]);
43
+ }, [setSelectedModal]);
91
44
  const dynButtonStyle = (0, react_1.useMemo)(() => {
92
45
  return {
93
46
  ...buttonStyle,
@@ -0,0 +1,18 @@
1
+ import type { UpdateAvailableResponse } from '@remotion/studio-shared';
2
+ import React from 'react';
3
+ export type Bug = {
4
+ title: string;
5
+ description: string;
6
+ link: string;
7
+ versions: string[];
8
+ };
9
+ type UpdateStatusContextValue = {
10
+ readonly error: string | null;
11
+ readonly info: UpdateAvailableResponse | null;
12
+ readonly knownBugs: Bug[] | null;
13
+ };
14
+ export declare const UpdateStatusProvider: React.FC<{
15
+ readonly children: React.ReactNode;
16
+ }>;
17
+ export declare const useUpdateStatus: () => UpdateStatusContextValue;
18
+ export {};