@remotion/studio 4.0.502 → 4.0.503

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 (121) hide show
  1. package/dist/components/AssetSelectorItem.js +2 -2
  2. package/dist/components/Canvas.js +34 -54
  3. package/dist/components/ColorPicker/AlphaSlider.js +14 -10
  4. package/dist/components/ColorPicker/HueSlider.js +14 -10
  5. package/dist/components/ColorPicker/SaturationValueArea.js +14 -12
  6. package/dist/components/CompositionContextButton.js +1 -1
  7. package/dist/components/ConfigureDefaultEditorModal.d.ts +2 -0
  8. package/dist/components/ConfigureDefaultEditorModal.js +151 -0
  9. package/dist/components/ConfirmationDialog.js +6 -3
  10. package/dist/components/ContextMenu.js +0 -2
  11. package/dist/components/Editor.js +1 -4
  12. package/dist/components/EditorGuides/Guide.js +48 -74
  13. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  14. package/dist/components/EditorRuler/Ruler.js +3 -1
  15. package/dist/components/EditorRuler/index.js +26 -23
  16. package/dist/components/ElementInstallConfirmation.d.ts +12 -0
  17. package/dist/components/ElementInstallConfirmation.js +205 -0
  18. package/dist/components/ForceSpecificCursor.js +14 -0
  19. package/dist/components/InlineAction.d.ts +2 -1
  20. package/dist/components/InlineAction.js +3 -3
  21. package/dist/components/InspectorLocationCopy.d.ts +1 -0
  22. package/dist/components/InspectorLocationCopy.js +7 -3
  23. package/dist/components/InspectorOpenInEditor.d.ts +5 -0
  24. package/dist/components/InspectorOpenInEditor.js +135 -0
  25. package/dist/components/InspectorPanel/AlignmentControls.js +1 -1
  26. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +3 -3
  27. package/dist/components/InspectorPanel/CompositionMetadata.js +1 -1
  28. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +2 -2
  29. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -2
  30. package/dist/components/InspectorSequenceSection.js +2 -2
  31. package/dist/components/Menu/MenuItem.js +13 -6
  32. package/dist/components/Menu/MenuSubItem.js +3 -1
  33. package/dist/components/MenuBuildIndicator.js +1 -1
  34. package/dist/components/MenuCompositionName.js +1 -1
  35. package/dist/components/MobilePanel.js +5 -1
  36. package/dist/components/ModalContainer.js +1 -1
  37. package/dist/components/ModalFooter.d.ts +1 -0
  38. package/dist/components/ModalFooter.js +2 -2
  39. package/dist/components/Modals.js +11 -2
  40. package/dist/components/NewComposition/InputDragger.js +19 -29
  41. package/dist/components/PreviewToolbarOverflowButton.js +1 -1
  42. package/dist/components/RenderModal/InlineEyeIcon.js +1 -1
  43. package/dist/components/RenderModal/InlineRemoveButton.js +1 -1
  44. package/dist/components/RenderModal/RenderModalOutputName.js +1 -1
  45. package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +1 -1
  46. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +1 -1
  47. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +1 -1
  48. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
  49. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +1 -1
  50. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -1
  51. package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
  52. package/dist/components/SelectedOutlineCropControls.js +7 -6
  53. package/dist/components/SelectedOutlineElement.js +28 -26
  54. package/dist/components/SelectedOutlineUvControls.js +25 -24
  55. package/dist/components/ShowGuidesProvider.js +2 -0
  56. package/dist/components/SidebarCollapserControls.js +2 -2
  57. package/dist/components/SidebarRenderButton.js +1 -1
  58. package/dist/components/Splitter/SplitterHandle.js +17 -68
  59. package/dist/components/Timeline/EasingEditorModal.js +27 -19
  60. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  61. package/dist/components/Timeline/TimelineDragHandler.js +38 -7
  62. package/dist/components/Timeline/TimelineInOutDragHandler.js +26 -11
  63. package/dist/components/Timeline/TimelineLayerEye.js +36 -4
  64. package/dist/components/Timeline/TimelineSelection.js +14 -21
  65. package/dist/components/Timeline/TimelineSequence.js +7 -3
  66. package/dist/components/Timeline/TimelineSequenceItem.js +24 -18
  67. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +1 -1
  68. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +76 -43
  69. package/dist/components/Timeline/TimelineStack/get-stack.js +7 -2
  70. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +4 -2
  71. package/dist/components/Timeline/get-sequence-context-menu-items.js +38 -2
  72. package/dist/components/Timeline/should-subscribe-to-source-file.d.ts +1 -0
  73. package/dist/components/Timeline/should-subscribe-to-source-file.js +11 -0
  74. package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +3 -1
  75. package/dist/components/Timeline/use-open-sequence-in-editor.js +5 -2
  76. package/dist/components/Timeline/use-sequence-props-subscription.js +2 -0
  77. package/dist/components/Timeline/use-timeline-asset-drop.js +0 -4
  78. package/dist/components/Timeline/use-timeline-keyframe-drag.js +31 -16
  79. package/dist/components/UndoRedoButtons.js +1 -1
  80. package/dist/components/UpdateCheck.d.ts +2 -0
  81. package/dist/components/UpdateCheck.js +12 -7
  82. package/dist/components/UpdateModal/UpdateModal.js +26 -10
  83. package/dist/components/VisualControls/ClickableFileName.js +5 -2
  84. package/dist/components/composition-menu-items.js +1 -1
  85. package/dist/components/element-install-request.d.ts +3 -0
  86. package/dist/components/element-install-request.js +17 -0
  87. package/dist/components/folder-menu-items.js +1 -1
  88. package/dist/components/handle-drop.d.ts +2 -3
  89. package/dist/components/handle-drop.js +11 -4
  90. package/dist/components/import-assets.d.ts +5 -5
  91. package/dist/components/import-assets.js +4 -15
  92. package/dist/components/use-default-editor-info.d.ts +4 -0
  93. package/dist/components/use-default-editor-info.js +47 -0
  94. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
  95. package/dist/error-overlay/remotion-overlay/StackFrame.js +1 -1
  96. package/dist/esm/{chunk-fjv75ty4.js → chunk-bj1r1hh5.js} +7068 -6120
  97. package/dist/esm/internals.mjs +7068 -6120
  98. package/dist/esm/previewEntry.mjs +7077 -6129
  99. package/dist/esm/renderEntry.mjs +1 -1
  100. package/dist/helpers/inject-css.js +18 -44
  101. package/dist/helpers/open-in-editor.d.ts +3 -3
  102. package/dist/helpers/open-in-editor.js +10 -6
  103. package/dist/helpers/pointer-session.d.ts +9 -0
  104. package/dist/helpers/pointer-session.js +94 -0
  105. package/dist/helpers/use-menu-structure.js +24 -2
  106. package/dist/icons/custom-editor.d.ts +4 -0
  107. package/dist/icons/custom-editor.js +11 -0
  108. package/dist/icons/editor.d.ts +6 -0
  109. package/dist/icons/editor.js +52 -0
  110. package/dist/state/editor-guides.d.ts +1 -0
  111. package/dist/state/editor-guides.js +1 -0
  112. package/dist/state/modals.d.ts +2 -0
  113. package/dist/state/z-index.d.ts +1 -0
  114. package/dist/state/z-index.js +34 -18
  115. package/package.json +12 -13
  116. package/dist/components/StudioCanvasCapture.d.ts +0 -5
  117. package/dist/components/StudioCanvasCapture.js +0 -40
  118. package/dist/components/canvas-capture-enabled.d.ts +0 -1
  119. package/dist/components/canvas-capture-enabled.js +0 -4
  120. package/dist/components/use-element-overwrite-confirmation.d.ts +0 -2
  121. package/dist/components/use-element-overwrite-confirmation.js +0 -73
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDefaultEditorInfo = exports.getPreferredEditorId = exports.canUseEditorPicker = void 0;
4
+ const react_1 = require("react");
5
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
6
+ const call_api_1 = require("./call-api");
7
+ let editorInfoPromise = null;
8
+ const loadDefaultEditorInfo = () => {
9
+ editorInfoPromise !== null && editorInfoPromise !== void 0 ? editorInfoPromise : (editorInfoPromise = (0, call_api_1.callApi)('/api/default-editor-info', {}).catch((err) => {
10
+ editorInfoPromise = null;
11
+ throw err;
12
+ }));
13
+ return editorInfoPromise;
14
+ };
15
+ const canUseEditorPicker = (previewServerConnected) => {
16
+ return (previewServerConnected &&
17
+ !window.remotion_isReadOnlyStudio &&
18
+ (0, browser_studio_operations_1.getBrowserStudioOperations)() === null);
19
+ };
20
+ exports.canUseEditorPicker = canUseEditorPicker;
21
+ const getPreferredEditorId = (editorInfo) => {
22
+ var _a;
23
+ var _b;
24
+ return ((_b = (_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.name === window.remotion_editorName)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null);
25
+ };
26
+ exports.getPreferredEditorId = getPreferredEditorId;
27
+ const useDefaultEditorInfo = (enabled) => {
28
+ const [editorInfo, setEditorInfo] = (0, react_1.useState)(null);
29
+ (0, react_1.useEffect)(() => {
30
+ if (!enabled) {
31
+ return;
32
+ }
33
+ let cancelled = false;
34
+ loadDefaultEditorInfo()
35
+ .then((response) => {
36
+ if (!cancelled) {
37
+ setEditorInfo(response);
38
+ }
39
+ })
40
+ .catch(() => undefined);
41
+ return () => {
42
+ cancelled = true;
43
+ };
44
+ }, [enabled]);
45
+ return editorInfo;
46
+ };
47
+ exports.useDefaultEditorInfo = useDefaultEditorInfo;
@@ -42,7 +42,7 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
42
42
  }, []);
43
43
  const openInBrowser = (0, react_1.useCallback)(() => {
44
44
  dispatch({ type: 'start' });
45
- (0, open_in_editor_1.openInEditor)(stack)
45
+ (0, open_in_editor_1.openInEditor)(stack, null)
46
46
  .then((data) => {
47
47
  if (data.success) {
48
48
  dispatchIfMounted({ type: 'succeed' });
@@ -48,7 +48,7 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
48
48
  if (!canOpenFileLocation) {
49
49
  return;
50
50
  }
51
- (0, open_in_editor_1.openInEditor)(s).catch((err) => {
51
+ (0, open_in_editor_1.openInEditor)(s, null).catch((err) => {
52
52
  // eslint-disable-next-line no-console
53
53
  console.log('Could not open in editor', err);
54
54
  });