@remotion/studio 4.0.496 → 4.0.498

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 (109) hide show
  1. package/dist/components/AudioWaveform.js +1 -11
  2. package/dist/components/Canvas.js +22 -203
  3. package/dist/components/Checkbox.js +1 -1
  4. package/dist/components/CompositionSelectorItem.js +2 -10
  5. package/dist/components/ConfigureLicenseModal.d.ts +4 -0
  6. package/dist/components/ConfigureLicenseModal.js +194 -0
  7. package/dist/components/Editor.d.ts +0 -1
  8. package/dist/components/Editor.js +2 -3
  9. package/dist/components/InspectorPanel/AlignmentControls.js +2 -0
  10. package/dist/components/InspectorPanel/CompositionInspector.js +2 -1
  11. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +27 -2
  12. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +65 -8
  13. package/dist/components/InspectorPanel/use-composition-actions.js +7 -3
  14. package/dist/components/LicenseKeyValidation.d.ts +17 -0
  15. package/dist/components/LicenseKeyValidation.js +113 -0
  16. package/dist/components/Modals.js +2 -1
  17. package/dist/components/NewComposition/CodemodFooter.d.ts +1 -1
  18. package/dist/components/NewComposition/CodemodFooter.js +23 -4
  19. package/dist/components/NewComposition/InputDragger.d.ts +6 -0
  20. package/dist/components/NewComposition/InputDragger.js +12 -3
  21. package/dist/components/NewComposition/NewComposition.js +1 -1
  22. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  23. package/dist/components/RenderButton.js +0 -1
  24. package/dist/components/RenderModal/WebRenderModal.js +14 -8
  25. package/dist/components/SelectedOutlineElement.js +56 -88
  26. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  27. package/dist/components/SelectedOutlineOverlay.js +10 -11
  28. package/dist/components/Timeline/MaxTimelineTracks.d.ts +0 -1
  29. package/dist/components/Timeline/MaxTimelineTracks.js +3 -3
  30. package/dist/components/Timeline/Timeline.js +19 -11
  31. package/dist/components/Timeline/TimelineAssetDropIndicator.d.ts +2 -0
  32. package/dist/components/Timeline/TimelineAssetDropIndicator.js +37 -0
  33. package/dist/components/Timeline/TimelineClipboardKeybindings.js +1 -7
  34. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  35. package/dist/components/Timeline/TimelineScrollable.js +3 -2
  36. package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
  37. package/dist/components/Timeline/TimelineSelection.js +41 -6
  38. package/dist/components/Timeline/TimelineSequence.js +26 -14
  39. package/dist/components/Timeline/TimelineSequenceFrame.js +2 -4
  40. package/dist/components/Timeline/TimelineSequenceItem.js +7 -5
  41. package/dist/components/Timeline/TimelineSequencePropItem.js +4 -0
  42. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
  43. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +135 -19
  44. package/dist/components/Timeline/TimelineTimeIndicators.d.ts +16 -0
  45. package/dist/components/Timeline/TimelineTimeIndicators.js +154 -35
  46. package/dist/components/Timeline/TimelineTranslateField.js +2 -1
  47. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  48. package/dist/components/Timeline/TimelineVideoInfo.js +4 -1
  49. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +17 -0
  50. package/dist/components/Timeline/call-update-keyframe-settings.js +43 -1
  51. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -0
  52. package/dist/components/Timeline/delete-selected-timeline-item.js +5 -4
  53. package/dist/components/Timeline/disable-sequence-interactivity.js +2 -0
  54. package/dist/components/Timeline/get-timeline-media-visualization-layout.d.ts +8 -0
  55. package/dist/components/Timeline/get-timeline-media-visualization-layout.js +10 -0
  56. package/dist/components/Timeline/get-timeline-video-info-widths.js +11 -3
  57. package/dist/components/Timeline/keyframe-clipboard.js +21 -5
  58. package/dist/components/Timeline/reset-selected-timeline-props.js +2 -0
  59. package/dist/components/Timeline/save-sequence-prop.d.ts +5 -3
  60. package/dist/components/Timeline/save-sequence-prop.js +43 -18
  61. package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +2 -0
  62. package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +1 -1
  63. package/dist/components/Timeline/timeline-asset-drop-context.d.ts +1 -0
  64. package/dist/components/Timeline/timeline-asset-drop-context.js +5 -0
  65. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -0
  66. package/dist/components/Timeline/timeline-scroll-logic.js +10 -1
  67. package/dist/components/Timeline/update-selected-easing.js +26 -23
  68. package/dist/components/Timeline/use-rename-sequence.js +2 -0
  69. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +5 -0
  70. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +18 -9
  71. package/dist/components/Timeline/use-timeline-asset-drop.d.ts +1 -0
  72. package/dist/components/Timeline/use-timeline-asset-drop.js +168 -0
  73. package/dist/components/composition-menu-items.d.ts +15 -1
  74. package/dist/components/composition-menu-items.js +137 -107
  75. package/dist/components/drop-handler-data.d.ts +13 -0
  76. package/dist/components/drop-handler-data.js +117 -0
  77. package/dist/components/handle-drop.d.ts +13 -0
  78. package/dist/components/handle-drop.js +115 -0
  79. package/dist/components/import-assets.d.ts +26 -8
  80. package/dist/components/import-assets.js +161 -49
  81. package/dist/components/selected-outline-drag.d.ts +11 -1
  82. package/dist/components/selected-outline-drag.js +74 -1
  83. package/dist/esm/{chunk-0v4n7nkh.js → chunk-7a6q9hk2.js} +5271 -4259
  84. package/dist/esm/index.mjs +0 -19
  85. package/dist/esm/internals.mjs +5271 -4259
  86. package/dist/esm/previewEntry.mjs +5475 -4463
  87. package/dist/esm/renderEntry.mjs +1 -1
  88. package/dist/helpers/interactivity-enabled.d.ts +1 -1
  89. package/dist/helpers/interactivity-enabled.js +2 -2
  90. package/dist/helpers/is-video-with-last-frame-hold.d.ts +2 -0
  91. package/dist/helpers/is-video-with-last-frame-hold.js +9 -0
  92. package/dist/helpers/retry-payload.js +0 -1
  93. package/dist/helpers/url-state.d.ts +1 -0
  94. package/dist/helpers/url-state.js +5 -1
  95. package/dist/helpers/use-max-media-duration.js +5 -3
  96. package/dist/helpers/use-menu-structure.js +11 -3
  97. package/dist/icons/duplicate.d.ts +5 -0
  98. package/dist/icons/duplicate.js +10 -0
  99. package/dist/icons/snowflake.d.ts +5 -0
  100. package/dist/icons/snowflake.js +10 -0
  101. package/dist/icons/trash.d.ts +5 -0
  102. package/dist/icons/trash.js +8 -0
  103. package/dist/state/modals.d.ts +3 -1
  104. package/dist/visual-controls/VisualControls.js +1 -1
  105. package/package.json +11 -11
  106. package/dist/components/RenderModal/WebRenderModalLicense.d.ts +0 -9
  107. package/dist/components/RenderModal/WebRenderModalLicense.js +0 -189
  108. package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.d.ts +0 -13
  109. package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.js +0 -60
@@ -31,16 +31,6 @@ const getContainerStyle = (height) => {
31
31
  height,
32
32
  };
33
33
  };
34
- const errorMessage = {
35
- fontSize: 13,
36
- paddingTop: 6,
37
- paddingBottom: 6,
38
- paddingLeft: 12,
39
- paddingRight: 12,
40
- alignSelf: 'flex-start',
41
- maxWidth: 450,
42
- opacity: 0.75,
43
- };
44
34
  const getWaveformErrorMessage = () => {
45
35
  return new Error('No waveform available. The audio could not be decoded or may not support CORS.');
46
36
  };
@@ -302,7 +292,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
302
292
  context.stroke();
303
293
  }, [height, parsedVolume, shouldRenderVolumeOverlay, visualizationWidth]);
304
294
  if (error) {
305
- return (jsx_runtime_1.jsx("div", { style: getContainerStyle(height), children: jsx_runtime_1.jsx("div", { style: errorMessage, children: "No waveform available. The audio could not be decoded or may not support CORS." }) }));
295
+ return null;
306
296
  }
307
297
  if (!canUseWorkerPath && !peaks) {
308
298
  return null;
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Canvas = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const studio_shared_1 = require("@remotion/studio-shared");
9
8
  const react_1 = require("react");
10
9
  const remotion_1 = require("remotion");
11
10
  const get_static_files_1 = require("../api/get-static-files");
@@ -18,7 +17,6 @@ const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
18
17
  const get_effective_translation_1 = require("../helpers/get-effective-translation");
19
18
  const install_required_package_1 = require("../helpers/install-required-package");
20
19
  const open_in_editor_1 = require("../helpers/open-in-editor");
21
- const remote_asset_drag_1 = require("../helpers/remote-asset-drag");
22
20
  const smooth_zoom_1 = require("../helpers/smooth-zoom");
23
21
  const studio_fit_padding_1 = require("../helpers/studio-fit-padding");
24
22
  const use_keybinding_1 = require("../helpers/use-keybinding");
@@ -27,11 +25,12 @@ const editor_guides_1 = require("../state/editor-guides");
27
25
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
28
26
  const call_api_1 = require("./call-api");
29
27
  const ConfirmationDialog_1 = require("./ConfirmationDialog");
28
+ const drop_handler_data_1 = require("./drop-handler-data");
30
29
  const EditorGuides_1 = __importDefault(require("./EditorGuides"));
31
30
  const EditorRuler_1 = require("./EditorRuler");
32
31
  const use_is_ruler_visible_1 = require("./EditorRuler/use-is-ruler-visible");
33
32
  const effect_drag_and_drop_1 = require("./effect-drag-and-drop");
34
- const element_drag_and_drop_1 = require("./element-drag-and-drop");
33
+ const handle_drop_1 = require("./handle-drop");
35
34
  const import_assets_1 = require("./import-assets");
36
35
  const layout_1 = require("./layout");
37
36
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
@@ -101,97 +100,6 @@ const calculateCanvasScale = ({ addFitPadding, canvasSize, compositionHeight, co
101
100
  ? (0, studio_fit_padding_1.calculateStudioScale)(options)
102
101
  : remotion_1.Internals.calculateScale(options);
103
102
  };
104
- const isFileDragEvent = (event) => {
105
- var _a;
106
- var _b;
107
- return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes('Files');
108
- };
109
- const isAssetDragEvent = (event) => {
110
- var _a;
111
- var _b;
112
- return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.ASSET_DRAG_MIME_TYPE);
113
- };
114
- const isComponentDragEvent = (event) => {
115
- var _a;
116
- var _b;
117
- return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.COMPONENT_DRAG_MIME_TYPE);
118
- };
119
- const isCompositionDragEvent = (event) => {
120
- var _a;
121
- var _b;
122
- return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.COMPOSITION_DRAG_MIME_TYPE);
123
- };
124
- const isElementDragEvent = (event) => {
125
- var _a;
126
- var _b;
127
- return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.ELEMENT_DRAG_MIME_TYPE);
128
- };
129
- const isSfxDragEvent = (event) => {
130
- var _a;
131
- var _b;
132
- return Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes(studio_shared_1.SFX_DRAG_MIME_TYPE);
133
- };
134
- const isRemoteAssetDragEvent = (event) => {
135
- return (!isFileDragEvent(event) &&
136
- !isAssetDragEvent(event) &&
137
- !isCompositionDragEvent(event) &&
138
- !isComponentDragEvent(event) &&
139
- !isElementDragEvent(event) &&
140
- !isSfxDragEvent(event) &&
141
- (0, remote_asset_drag_1.hasRemoteAssetDragData)(event.dataTransfer));
142
- };
143
- const getAssetDragPath = (event) => {
144
- var _a, _b;
145
- var _c;
146
- const value = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(studio_shared_1.ASSET_DRAG_MIME_TYPE);
147
- if (!value) {
148
- return null;
149
- }
150
- return (_c = (_b = (0, studio_shared_1.parseAssetDragData)(value)) === null || _b === void 0 ? void 0 : _b.assetPath) !== null && _c !== void 0 ? _c : null;
151
- };
152
- const getCompositionDragData = (event) => {
153
- var _a;
154
- const value = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(studio_shared_1.COMPOSITION_DRAG_MIME_TYPE);
155
- if (!value) {
156
- return null;
157
- }
158
- return (0, studio_shared_1.parseCompositionDragData)(value);
159
- };
160
- const getComponentDragData = (event) => {
161
- var _a;
162
- for (const type of [
163
- studio_shared_1.COMPONENT_DRAG_MIME_TYPE,
164
- 'application/json',
165
- 'text/plain',
166
- ]) {
167
- const value = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(type);
168
- if (!value) {
169
- continue;
170
- }
171
- const parsed = (0, studio_shared_1.parseComponentDragData)(value);
172
- if (parsed) {
173
- return parsed;
174
- }
175
- }
176
- return null;
177
- };
178
- const getSfxDragUrl = (event) => {
179
- const { dataTransfer } = event;
180
- if (!dataTransfer) {
181
- return null;
182
- }
183
- for (const type of [studio_shared_1.SFX_DRAG_MIME_TYPE, 'application/json', 'text/plain']) {
184
- const value = dataTransfer.getData(type);
185
- if (!value) {
186
- continue;
187
- }
188
- const parsed = (0, studio_shared_1.parseSfxDragData)(value);
189
- if (parsed) {
190
- return parsed.sfx.url;
191
- }
192
- }
193
- return null;
194
- };
195
103
  const getDropPosition = ({ addFitPadding, clientX, clientY, contentDimensions, previewSize, size, }) => {
196
104
  if (contentDimensions === null || contentDimensions === 'none') {
197
105
  return null;
@@ -766,6 +674,7 @@ const Canvas = ({ canvasContent, size }) => {
766
674
  compositionFile: activeElementInstallRequest.compositionFile,
767
675
  compositionId: activeElementInstallRequest.compositionId,
768
676
  dropPosition: null,
677
+ from: null,
769
678
  });
770
679
  }
771
680
  };
@@ -787,14 +696,7 @@ const Canvas = ({ canvasContent, size }) => {
787
696
  };
788
697
  }, [activeElementInstallRequest, confirm]);
789
698
  const onDragOver = (0, react_1.useCallback)((event) => {
790
- if ((!isFileDragEvent(event) &&
791
- !isAssetDragEvent(event) &&
792
- !isCompositionDragEvent(event) &&
793
- !isComponentDragEvent(event) &&
794
- !isElementDragEvent(event) &&
795
- !isSfxDragEvent(event) &&
796
- !isRemoteAssetDragEvent(event)) ||
797
- !isDragEventInsideCanvas(event)) {
699
+ if (!(0, drop_handler_data_1.isSupportedDropEvent)(event) || !isDragEventInsideCanvas(event)) {
798
700
  return;
799
701
  }
800
702
  if (!canDropAssets && !cannotAddSequence) {
@@ -806,16 +708,7 @@ const Canvas = ({ canvasContent, size }) => {
806
708
  }
807
709
  }, [canDropAssets, cannotAddSequence]);
808
710
  const onDrop = (0, react_1.useCallback)(async (event) => {
809
- var _a;
810
- var _b;
811
- if ((!isFileDragEvent(event) &&
812
- !isAssetDragEvent(event) &&
813
- !isCompositionDragEvent(event) &&
814
- !isComponentDragEvent(event) &&
815
- !isElementDragEvent(event) &&
816
- !isSfxDragEvent(event) &&
817
- !isRemoteAssetDragEvent(event)) ||
818
- !isDragEventInsideCanvas(event)) {
711
+ if (!(0, drop_handler_data_1.isSupportedDropEvent)(event) || !isDragEventInsideCanvas(event)) {
819
712
  return;
820
713
  }
821
714
  if (cannotAddSequence) {
@@ -826,7 +719,8 @@ const Canvas = ({ canvasContent, size }) => {
826
719
  }
827
720
  if (!canDropAssets ||
828
721
  compositionFile === null ||
829
- currentCompositionId === null) {
722
+ currentCompositionId === null ||
723
+ config === null) {
830
724
  return;
831
725
  }
832
726
  if (event.dataTransfer &&
@@ -846,96 +740,16 @@ const Canvas = ({ canvasContent, size }) => {
846
740
  previewSize,
847
741
  size,
848
742
  });
849
- if (isFileDragEvent(event)) {
850
- const files = Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
851
- if (files.length === 0) {
852
- return;
853
- }
854
- const svgImportMode = (0, import_assets_1.hasSvgFile)(files)
855
- ? await chooseSvgImportMode()
856
- : 'image';
857
- if (svgImportMode === null) {
858
- return;
859
- }
860
- await (0, import_assets_1.importAssets)({
861
- files,
862
- compositionFile,
863
- compositionId: currentCompositionId,
864
- destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
865
- dropPosition,
866
- svgImportMode,
867
- });
868
- }
869
- else if (isAssetDragEvent(event)) {
870
- const assetPath = getAssetDragPath(event);
871
- if (assetPath === null) {
872
- return;
873
- }
874
- await (0, import_assets_1.insertExistingAssets)({
875
- assetPaths: [assetPath],
876
- compositionFile,
877
- compositionId: currentCompositionId,
878
- destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
879
- dropPosition,
880
- });
881
- }
882
- else if (isSfxDragEvent(event)) {
883
- const url = getSfxDragUrl(event);
884
- if (url === null) {
885
- return;
886
- }
887
- await (0, import_assets_1.insertRemoteAudio)({
888
- url,
889
- compositionFile,
890
- compositionId: currentCompositionId,
891
- });
892
- }
893
- else if (isCompositionDragEvent(event)) {
894
- const compositionDragData = getCompositionDragData(event);
895
- if (compositionDragData === null) {
896
- return;
897
- }
898
- await (0, import_assets_1.insertComposition)({
899
- composition: compositionDragData,
900
- compositionFile,
901
- compositionId: currentCompositionId,
902
- destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
903
- dropPosition,
904
- });
905
- }
906
- else {
907
- const elementDragData = (0, element_drag_and_drop_1.getElementDragData)(event.dataTransfer);
908
- if (elementDragData !== null) {
909
- await (0, import_assets_1.insertElement)({
910
- element: elementDragData.element,
911
- compositionFile,
912
- compositionId: currentCompositionId,
913
- dropPosition,
914
- });
915
- return;
916
- }
917
- const componentDragData = getComponentDragData(event);
918
- if (componentDragData !== null) {
919
- await (0, import_assets_1.insertComponent)({
920
- component: componentDragData.component,
921
- compositionFile,
922
- compositionId: currentCompositionId,
923
- dropPosition,
924
- });
925
- return;
926
- }
927
- const url = (0, remote_asset_drag_1.getRemoteAssetUrlFromDataTransfer)(event.dataTransfer);
928
- if (url === null) {
929
- return;
930
- }
931
- await (0, import_assets_1.importRemoteAsset)({
932
- url,
933
- compositionFile,
934
- compositionId: currentCompositionId,
935
- destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
936
- dropPosition,
937
- });
938
- }
743
+ await (0, handle_drop_1.handleDrop)({
744
+ chooseSvgImportMode,
745
+ compositionFile,
746
+ compositionId: currentCompositionId,
747
+ destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
748
+ dropPosition,
749
+ event,
750
+ fps: config.fps,
751
+ from: null,
752
+ });
939
753
  }
940
754
  finally {
941
755
  setIsAddingAsset(false);
@@ -946,6 +760,7 @@ const Canvas = ({ canvasContent, size }) => {
946
760
  cannotAddSequence,
947
761
  chooseSvgImportMode,
948
762
  compositionFile,
763
+ config,
949
764
  contentDimensions,
950
765
  currentCompositionId,
951
766
  previewSize,
@@ -956,6 +771,7 @@ const Canvas = ({ canvasContent, size }) => {
956
771
  if (!canDropAssets ||
957
772
  compositionFile === null ||
958
773
  currentCompositionId === null ||
774
+ config === null ||
959
775
  event.clipboardData === null ||
960
776
  activeElement instanceof HTMLInputElement ||
961
777
  activeElement instanceof HTMLTextAreaElement ||
@@ -1023,10 +839,12 @@ const Canvas = ({ canvasContent, size }) => {
1023
839
  try {
1024
840
  await (0, import_assets_1.importAssets)({
1025
841
  files,
842
+ fps: config.fps,
1026
843
  compositionFile,
1027
844
  compositionId: currentCompositionId,
1028
845
  destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
1029
846
  dropPosition,
847
+ from: null,
1030
848
  svgImportMode,
1031
849
  });
1032
850
  }
@@ -1037,6 +855,7 @@ const Canvas = ({ canvasContent, size }) => {
1037
855
  canDropAssets,
1038
856
  chooseSvgImportMode,
1039
857
  compositionFile,
858
+ config,
1040
859
  contentDimensions,
1041
860
  currentCompositionId,
1042
861
  ]);
@@ -30,7 +30,7 @@ const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'defau
30
30
  const bullet = (0, react_1.useMemo)(() => ({
31
31
  width: bulletSize,
32
32
  height: bulletSize,
33
- backgroundColor: colors_1.LIGHT_TEXT,
33
+ backgroundColor: colors_1.WHITE,
34
34
  borderRadius: '50%',
35
35
  }), [bulletSize]);
36
36
  const box = (0, react_1.useMemo)(() => ({
@@ -18,7 +18,6 @@ const ContextMenu_1 = require("./ContextMenu");
18
18
  const folder_menu_items_1 = require("./folder-menu-items");
19
19
  const layout_1 = require("./layout");
20
20
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
21
- const open_in_new_window_1 = require("./open-in-new-window");
22
21
  const actions_1 = require("./RenderQueue/actions");
23
22
  const SidebarRenderButton_1 = require("./SidebarRenderButton");
24
23
  const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
@@ -123,22 +122,15 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
123
122
  const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(item.type === 'composition' ? item.composition.stack : item.folder.stack);
124
123
  const contextMenu = (0, react_1.useMemo)(() => {
125
124
  if (item.type === 'composition') {
126
- const compositionMenuItems = (0, composition_menu_items_1.getCompositionMenuItems)({
125
+ return (0, composition_menu_items_1.getCompositionContextMenuItems)({
127
126
  closeMenu: noop_1.noop,
128
127
  composition: item.composition,
129
128
  connectionStatus,
129
+ includeCompositionManagementItems: true,
130
130
  resolvedLocation,
131
131
  setSelectedModal,
132
132
  readOnlyStudio: window.remotion_isReadOnlyStudio,
133
133
  });
134
- return [
135
- (0, open_in_new_window_1.getOpenInNewWindowMenuItem)(`/${item.composition.id}`),
136
- {
137
- type: 'divider',
138
- id: 'open-in-new-window-divider',
139
- },
140
- ...compositionMenuItems,
141
- ];
142
134
  }
143
135
  return (0, folder_menu_items_1.getFolderMenuItems)({
144
136
  closeMenu: noop_1.noop,
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const ConfigureLicenseModal: React.FC<{
3
+ readonly initialPublicLicenseKey: string | null;
4
+ }>;
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigureLicenseModal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const modals_1 = require("../state/modals");
8
+ const call_api_1 = require("./call-api");
9
+ const Checkbox_1 = require("./Checkbox");
10
+ const layout_1 = require("./layout");
11
+ const LicenseKeyValidation_1 = require("./LicenseKeyValidation");
12
+ const ModalButton_1 = require("./ModalButton");
13
+ const ModalContainer_1 = require("./ModalContainer");
14
+ const ModalFooter_1 = require("./ModalFooter");
15
+ const ModalHeader_1 = require("./ModalHeader");
16
+ const RemInput_1 = require("./NewComposition/RemInput");
17
+ const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
18
+ const content = {
19
+ padding: 16,
20
+ width: 540,
21
+ maxWidth: 'calc(100vw - 40px)',
22
+ };
23
+ const description = {
24
+ color: colors_1.LIGHT_TEXT,
25
+ fontFamily: 'sans-serif',
26
+ fontSize: 14,
27
+ lineHeight: 1.5,
28
+ margin: 0,
29
+ marginTop: 10,
30
+ };
31
+ const descriptionLink = {
32
+ color: colors_1.WHITE,
33
+ fontFamily: 'sans-serif',
34
+ fontSize: 14,
35
+ lineHeight: '21px',
36
+ };
37
+ const checkboxRow = {
38
+ display: 'flex',
39
+ flexDirection: 'row',
40
+ alignItems: 'center',
41
+ cursor: 'pointer',
42
+ marginTop: 5,
43
+ marginBottom: 5,
44
+ };
45
+ const checkboxLabel = {
46
+ color: colors_1.LIGHT_TEXT,
47
+ fontFamily: 'sans-serif',
48
+ fontSize: 14,
49
+ lineHeight: '20px',
50
+ cursor: 'pointer',
51
+ userSelect: 'none',
52
+ };
53
+ const inputLabel = {
54
+ color: colors_1.LIGHT_TEXT,
55
+ display: 'block',
56
+ fontFamily: 'sans-serif',
57
+ fontSize: 13,
58
+ lineHeight: '20px',
59
+ marginBottom: 6,
60
+ marginTop: 10,
61
+ };
62
+ const ConfigureLicenseModal = ({ initialPublicLicenseKey }) => {
63
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
64
+ const initialLicenseType = initialPublicLicenseKey === 'free-license'
65
+ ? 'free'
66
+ : initialPublicLicenseKey === null
67
+ ? null
68
+ : 'company';
69
+ const [licenseType, setLicenseType] = (0, react_1.useState)(initialLicenseType);
70
+ const [companyLicenseKey, setCompanyLicenseKey] = (0, react_1.useState)(initialLicenseType === 'company' ? (initialPublicLicenseKey !== null && initialPublicLicenseKey !== void 0 ? initialPublicLicenseKey : '') : '');
71
+ const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
72
+ const [error, setError] = (0, react_1.useState)(null);
73
+ const [isValidatingLicenseKey, setIsValidatingLicenseKey] = (0, react_1.useState)(false);
74
+ const [remoteValidationMessage, setRemoteValidationMessage] = (0, react_1.useState)(null);
75
+ const [licenseKeyDetails, setLicenseKeyDetails] = (0, react_1.useState)(null);
76
+ const dismiss = (0, react_1.useCallback)(() => {
77
+ setSelectedModal(null);
78
+ }, [setSelectedModal]);
79
+ const chooseFreeLicense = (0, react_1.useCallback)(() => {
80
+ setLicenseType('free');
81
+ setError(null);
82
+ }, []);
83
+ const chooseCompanyLicense = (0, react_1.useCallback)(() => {
84
+ setLicenseType('company');
85
+ setError(null);
86
+ }, []);
87
+ const publicLicenseKey = (0, react_1.useMemo)(() => {
88
+ if (licenseType === 'free') {
89
+ return 'free-license';
90
+ }
91
+ if (licenseType === 'company') {
92
+ return companyLicenseKey.trim();
93
+ }
94
+ return '';
95
+ }, [companyLicenseKey, licenseType]);
96
+ const localLicenseKeyValidation = (0, react_1.useMemo)(() => (0, LicenseKeyValidation_1.validateLicenseKey)(companyLicenseKey.trim()), [companyLicenseKey]);
97
+ (0, react_1.useEffect)(() => {
98
+ let cancelled = false;
99
+ setLicenseKeyDetails(null);
100
+ setRemoteValidationMessage(null);
101
+ if (licenseType !== 'company' || !localLicenseKeyValidation.valid) {
102
+ setIsValidatingLicenseKey(false);
103
+ return () => {
104
+ cancelled = true;
105
+ };
106
+ }
107
+ setIsValidatingLicenseKey(true);
108
+ (0, LicenseKeyValidation_1.fetchLicenseKeyDetails)(companyLicenseKey.trim())
109
+ .then((details) => {
110
+ if (cancelled) {
111
+ return;
112
+ }
113
+ setIsValidatingLicenseKey(false);
114
+ if (details.isValid) {
115
+ setLicenseKeyDetails(details);
116
+ }
117
+ else {
118
+ setRemoteValidationMessage('License key is invalid or has been reset');
119
+ }
120
+ })
121
+ .catch(() => {
122
+ if (cancelled) {
123
+ return;
124
+ }
125
+ setIsValidatingLicenseKey(false);
126
+ setRemoteValidationMessage('Failed to fetch license key details');
127
+ });
128
+ return () => {
129
+ cancelled = true;
130
+ };
131
+ }, [companyLicenseKey, licenseType, localLicenseKeyValidation.valid]);
132
+ const companyLicenseKeyIsValid = localLicenseKeyValidation.valid &&
133
+ (licenseKeyDetails === null || licenseKeyDetails === void 0 ? void 0 : licenseKeyDetails.isValid) === true &&
134
+ !isValidatingLicenseKey;
135
+ const submit = (0, react_1.useCallback)(async () => {
136
+ if (publicLicenseKey.length === 0) {
137
+ setError(licenseType === null
138
+ ? 'Select a license type.'
139
+ : 'Enter your public license key.');
140
+ return;
141
+ }
142
+ if (licenseType === 'company' && !companyLicenseKeyIsValid) {
143
+ return;
144
+ }
145
+ setIsSubmitting(true);
146
+ setError(null);
147
+ try {
148
+ const response = await (0, call_api_1.callApi)('/api/update-public-license', {
149
+ publicLicenseKey,
150
+ });
151
+ if (!response.success) {
152
+ setError(response.reason);
153
+ setIsSubmitting(false);
154
+ return;
155
+ }
156
+ dismiss();
157
+ }
158
+ catch (err) {
159
+ setError(err.message);
160
+ setIsSubmitting(false);
161
+ }
162
+ }, [companyLicenseKeyIsValid, dismiss, licenseType, publicLicenseKey]);
163
+ return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onEscape: dismiss, onOutsideClick: dismiss, children: [
164
+ jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Configure License", onClose: dismiss }), jsx_runtime_1.jsxs("div", { style: content, children: [
165
+ jsx_runtime_1.jsxs("p", { style: description, children: ["Remotion is free if you are an individual or company with a headcount of 3 or less. See", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.dev/license", children: "LICENSE.md" }),
166
+ "."] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: chooseFreeLicense, children: [
167
+ jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'free', onChange: chooseFreeLicense, name: "free-license", rounded: true }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: checkboxLabel, children: "I am eligible for the Free License" })
168
+ ] }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: chooseCompanyLicense, children: [
169
+ jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'company', onChange: chooseCompanyLicense, name: "company-license", rounded: true }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: checkboxLabel, children: "I need a Company License" })
170
+ ] }), licenseType === 'company' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
171
+ jsx_runtime_1.jsxs("p", { style: description, children: ["Visit", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "remotion.pro/license" }), ' ', "to obtain a license key. Enter the public license key from", ' "License Keys".'] }), jsx_runtime_1.jsxs("label", { style: inputLabel, children: ["Public license key",
172
+ jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: localLicenseKeyValidation.message ||
173
+ remoteValidationMessage ||
174
+ (licenseKeyDetails !== null &&
175
+ !(0, LicenseKeyValidation_1.hasActiveCompanyLicense)(licenseKeyDetails))
176
+ ? 'error'
177
+ : 'ok', rightAlign: false, value: companyLicenseKey, onChange: (event) => {
178
+ setCompanyLicenseKey(event.target.value);
179
+ setError(null);
180
+ }, placeholder: "rm_pub_...", autoFocus: true })
181
+ ] }), localLicenseKeyValidation.message ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
182
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: localLicenseKeyValidation.message, align: "flex-start", type: "error" })
183
+ ] })) : null, remoteValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
184
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: remoteValidationMessage, align: "flex-start", type: "error" })
185
+ ] })) : null, isValidatingLicenseKey ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
186
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx("p", { style: description, children: "Loading license key details..." })
187
+ ] })) : null, licenseKeyDetails ? (jsx_runtime_1.jsx(LicenseKeyValidation_1.LicenseKeyDetailsDisplay, { details: licenseKeyDetails })) : null] })) : null, error ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
188
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: error, align: "flex-start", type: "error" })
189
+ ] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(layout_1.Row, { justify: "flex-end", children: jsx_runtime_1.jsx(ModalButton_1.ModalButton, { onClick: submit, disabled: isSubmitting ||
190
+ publicLicenseKey.length === 0 ||
191
+ (licenseType === 'company' && !companyLicenseKeyIsValid), autoFocus: licenseType !== 'company', children: isSubmitting ? 'Submitting...' : 'Submit and reload' }) }) })
192
+ ] }));
193
+ };
194
+ exports.ConfigureLicenseModal = ConfigureLicenseModal;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- export declare const BUFFER_STATE_DELAY_IN_MILLISECONDS: number;
3
2
  export declare const Editor: React.FC<{
4
3
  readonly Root: React.FC;
5
4
  readonly readOnlyStudio: boolean;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Editor = exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = void 0;
36
+ exports.Editor = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const player_1 = require("@remotion/player");
39
39
  const react_1 = __importStar(require("react"));
@@ -63,7 +63,6 @@ const background = {
63
63
  flexDirection: 'column',
64
64
  position: 'absolute',
65
65
  };
66
- exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)();
67
66
  const Editor = ({ Root, readOnlyStudio }) => {
68
67
  const [drawElement, setDrawElement] = (0, react_1.useState)(null);
69
68
  const size = player_1.PlayerInternals.useElementSize(drawElement, {
@@ -98,7 +97,7 @@ const Editor = ({ Root, readOnlyStudio }) => {
98
97
  const editor = (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
99
98
  jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
100
99
  jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
101
- jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: exports.BUFFER_STATE_DELAY_IN_MILLISECONDS, onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
100
+ jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)(), onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
102
101
  ] }) })
103
102
  ] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
104
103
  ] }) }) }));
@@ -136,6 +136,8 @@ const AlignmentControls = ({ track }) => {
136
136
  const label = undoLabels[direction];
137
137
  if (!propStatus || propStatus.status === 'static') {
138
138
  (0, save_sequence_prop_1.saveSequenceProps)({
139
+ addedKeyframes: null,
140
+ movedKeyframes: null,
139
141
  changes: [
140
142
  {
141
143
  fileName: nodePath.absolutePath,
@@ -94,7 +94,8 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, setD
94
94
  };
95
95
  const CompositionVisualControlsSection = () => {
96
96
  const { handles: visualControlHandles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
97
- const hasVisualControls = interactivity_enabled_1.studioInteractivityEnabled && Object.keys(visualControlHandles).length > 0;
97
+ const hasVisualControls = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
98
+ Object.keys(visualControlHandles).length > 0;
98
99
  if (!hasVisualControls) {
99
100
  return null;
100
101
  }