@remotion/studio 4.0.477 → 4.0.479

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 (191) hide show
  1. package/dist/components/AssetSelector.js +8 -14
  2. package/dist/components/Button.d.ts +1 -0
  3. package/dist/components/Button.js +8 -5
  4. package/dist/components/CanvasIfSizeIsAvailable.js +2 -6
  5. package/dist/components/CompactExplanation.d.ts +12 -0
  6. package/dist/components/CompactExplanation.js +52 -0
  7. package/dist/components/CompositionSelector.js +2 -4
  8. package/dist/components/CurrentAsset.d.ts +3 -1
  9. package/dist/components/CurrentAsset.js +42 -34
  10. package/dist/components/CurrentComposition.d.ts +1 -1
  11. package/dist/components/CurrentComposition.js +38 -31
  12. package/dist/components/DefaultPropsEditor.d.ts +12 -2
  13. package/dist/components/DefaultPropsEditor.js +2 -2
  14. package/dist/components/EditorGuides/Guide.js +37 -9
  15. package/dist/components/EditorRuler/Ruler.js +4 -14
  16. package/dist/components/EditorRuler/index.js +9 -4
  17. package/dist/components/EffectPickerModal.d.ts +5 -0
  18. package/dist/components/EffectPickerModal.js +179 -0
  19. package/dist/components/InlineAction.js +1 -0
  20. package/dist/components/InspectorInfoHeader.d.ts +11 -0
  21. package/dist/components/InspectorInfoHeader.js +55 -0
  22. package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
  23. package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
  24. package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
  25. package/dist/components/InspectorPanel/EasingInspector.js +41 -0
  26. package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
  27. package/dist/components/InspectorPanel/GuideInspector.js +55 -0
  28. package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
  29. package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
  30. package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
  31. package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
  33. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
  34. package/dist/components/InspectorPanel/common.d.ts +15 -0
  35. package/dist/components/InspectorPanel/common.js +18 -0
  36. package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
  37. package/dist/components/InspectorPanel/inspector-selection.js +34 -0
  38. package/dist/components/InspectorPanel/styles.d.ts +27 -0
  39. package/dist/components/InspectorPanel/styles.js +178 -0
  40. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
  41. package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
  42. package/dist/components/InspectorPanel.d.ts +8 -0
  43. package/dist/components/InspectorPanel.js +26 -0
  44. package/dist/components/InspectorPanelLayout.d.ts +1 -0
  45. package/dist/components/InspectorPanelLayout.js +4 -0
  46. package/dist/components/InspectorSequenceSection.d.ts +16 -0
  47. package/dist/components/InspectorSequenceSection.js +147 -0
  48. package/dist/components/InspectorSourceLocation.d.ts +7 -0
  49. package/dist/components/InspectorSourceLocation.js +71 -0
  50. package/dist/components/MenuToolbar.d.ts +1 -0
  51. package/dist/components/MenuToolbar.js +4 -1
  52. package/dist/components/Modals.js +3 -3
  53. package/dist/components/NewComposition/InputDragger.js +1 -1
  54. package/dist/components/NewComposition/RemInput.d.ts +1 -0
  55. package/dist/components/NewComposition/RemInput.js +8 -2
  56. package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
  57. package/dist/components/NewComposition/RemTextarea.js +8 -2
  58. package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
  59. package/dist/components/NewComposition/ValidationMessage.js +16 -5
  60. package/dist/components/OptionsPanel.d.ts +1 -1
  61. package/dist/components/OptionsPanel.js +8 -17
  62. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
  63. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
  64. package/dist/components/QuickSwitcher/shared.d.ts +4 -0
  65. package/dist/components/QuickSwitcher/shared.js +24 -0
  66. package/dist/components/RenderModal/DataEditor.d.ts +29 -2
  67. package/dist/components/RenderModal/DataEditor.js +107 -56
  68. package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
  69. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
  70. package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
  71. package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
  72. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
  73. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
  74. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
  75. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
  76. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
  77. package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
  78. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  79. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  80. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
  81. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  82. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
  83. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
  84. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
  85. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
  86. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  87. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
  88. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
  89. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  90. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  91. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  92. package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
  93. package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
  94. package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
  95. package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
  96. package/dist/components/RendersTab.js +1 -1
  97. package/dist/components/SegmentedControl.d.ts +3 -0
  98. package/dist/components/SegmentedControl.js +11 -5
  99. package/dist/components/SelectedOutlineElement.js +135 -31
  100. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  101. package/dist/components/SelectedOutlineOverlay.js +45 -29
  102. package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
  103. package/dist/components/SelectedOutlineUvControls.js +64 -10
  104. package/dist/components/Tabs/index.js +4 -4
  105. package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
  106. package/dist/components/Timeline/EasingEditorModal.js +597 -124
  107. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
  108. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
  109. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
  110. package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
  111. package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
  112. package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
  113. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
  114. package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
  115. package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
  116. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  117. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
  118. package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
  119. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
  120. package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
  121. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
  122. package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
  123. package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
  124. package/dist/components/Timeline/TimelineNumberField.js +5 -11
  125. package/dist/components/Timeline/TimelineRotationField.js +5 -6
  126. package/dist/components/Timeline/TimelineScaleField.js +4 -8
  127. package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
  128. package/dist/components/Timeline/TimelineSelection.js +109 -14
  129. package/dist/components/Timeline/TimelineSequence.js +22 -14
  130. package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
  131. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
  132. package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
  133. package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
  134. package/dist/components/Timeline/TimelineTranslateField.js +4 -5
  135. package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
  136. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  137. package/dist/components/Timeline/TimelineVideoInfo.js +93 -8
  138. package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
  139. package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
  140. package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
  141. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
  142. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
  143. package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
  144. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +7 -0
  145. package/dist/components/Timeline/duplicate-selected-timeline-item.js +32 -3
  146. package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
  147. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
  148. package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
  149. package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
  150. package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
  151. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
  152. package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
  153. package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
  154. package/dist/components/Timeline/timeline-video-filmstrip-times.d.ts +17 -0
  155. package/dist/components/Timeline/timeline-video-filmstrip-times.js +22 -0
  156. package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
  157. package/dist/components/Timeline/update-selected-easing.js +40 -9
  158. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
  159. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
  160. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
  161. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
  162. package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
  163. package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
  164. package/dist/components/VisualControls/VisualControlsContent.js +4 -5
  165. package/dist/components/effect-drag-and-drop.d.ts +10 -0
  166. package/dist/components/effect-drag-and-drop.js +17 -8
  167. package/dist/components/effect-picker-search.d.ts +5 -0
  168. package/dist/components/effect-picker-search.js +77 -0
  169. package/dist/components/import-assets.d.ts +11 -2
  170. package/dist/components/import-assets.js +61 -6
  171. package/dist/components/selected-outline-drag.d.ts +44 -2
  172. package/dist/components/selected-outline-drag.js +74 -1
  173. package/dist/components/selected-outline-types.d.ts +7 -7
  174. package/dist/components/selected-outline-uv.d.ts +4 -3
  175. package/dist/components/selected-outline-uv.js +6 -2
  176. package/dist/error-overlay/remotion-overlay/Overlay.js +3 -0
  177. package/dist/esm/{chunk-t8fjnw2d.js → chunk-fge2mq5p.js} +17004 -13432
  178. package/dist/esm/internals.mjs +17004 -13432
  179. package/dist/esm/previewEntry.mjs +26617 -23041
  180. package/dist/esm/renderEntry.mjs +1 -1
  181. package/dist/helpers/editor-guide-selection.js +1 -1
  182. package/dist/helpers/get-preview-file-type.js +1 -1
  183. package/dist/helpers/render-codec-label.d.ts +2 -0
  184. package/dist/helpers/render-codec-label.js +49 -0
  185. package/dist/helpers/ruler-canvas-size.d.ts +5 -0
  186. package/dist/helpers/ruler-canvas-size.js +17 -0
  187. package/dist/helpers/timeline-layout.d.ts +4 -4
  188. package/dist/helpers/use-media-metadata.d.ts +8 -2
  189. package/dist/helpers/use-media-metadata.js +17 -4
  190. package/dist/state/modals.d.ts +9 -4
  191. package/package.json +12 -12
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.AssetSelector = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = require("react");
39
- const remotion_1 = require("remotion");
40
39
  const write_static_file_1 = require("../api/write-static-file");
41
40
  const client_id_1 = require("../helpers/client-id");
42
41
  const colors_1 = require("../helpers/colors");
@@ -47,7 +46,6 @@ const use_asset_drag_events_1 = __importStar(require("../helpers/use-asset-drag-
47
46
  const folders_1 = require("../state/folders");
48
47
  const z_index_1 = require("../state/z-index");
49
48
  const AssetSelectorItem_1 = require("./AssetSelectorItem");
50
- const CurrentAsset_1 = require("./CurrentAsset");
51
49
  const styles_1 = require("./Menu/styles");
52
50
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
53
51
  const use_static_files_1 = require("./use-static-files");
@@ -77,21 +75,17 @@ const baseList = {
77
75
  };
78
76
  const AssetSelector = ({ readOnlyStudio }) => {
79
77
  const { tabIndex } = (0, z_index_1.useZIndex)();
80
- const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
81
78
  const { assetFoldersExpanded, setAssetFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
82
79
  const [dropLocation, setDropLocation] = (0, react_1.useState)(null);
83
80
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
84
81
  .previewServerState.type;
85
82
  const shouldAllowUpload = connectionStatus === 'connected' && !readOnlyStudio;
86
- const showCurrentAsset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset';
87
83
  const list = (0, react_1.useMemo)(() => {
88
84
  return {
89
85
  ...baseList,
90
- height: showCurrentAsset
91
- ? `calc(100% - ${CurrentAsset_1.CURRENT_ASSET_HEIGHT}px)`
92
- : '100%',
86
+ height: '100%',
93
87
  };
94
- }, [showCurrentAsset]);
88
+ }, []);
95
89
  const staticFiles = (0, use_static_files_1.useStaticFiles)();
96
90
  const publicFolderExists = window.remotion_publicFolderExists;
97
91
  const assetTree = (0, react_1.useMemo)(() => {
@@ -164,11 +158,11 @@ const AssetSelector = ({ readOnlyStudio }) => {
164
158
  setDropLocation(null);
165
159
  }
166
160
  }, [dropLocation, staticFiles]);
167
- return (jsx_runtime_1.jsxs("div", { style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: [showCurrentAsset ? jsx_runtime_1.jsx(CurrentAsset_1.CurrentAsset, {}) : null, staticFiles.length === 0 ? (publicFolderExists ? (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, place a file in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
168
- " folder of your project or drag and drop a file here."] }) })) : (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, create a folder called", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
169
- " in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
170
- ...list,
171
- backgroundColor: isDropDiv ? colors_1.CLEAR_HOVER : colors_1.BACKGROUND,
172
- }, onDragEnter: onDragEnter, onDragLeave: onDragLeave, children: jsx_runtime_1.jsx(AssetSelectorItem_1.AssetFolderTree, { item: assetTree, level: 0, parentFolder: null, name: null, tabIndex: tabIndex, toggleFolder: toggleFolder, dropLocation: dropLocation, setDropLocation: setDropLocation, readOnlyStudio: readOnlyStudio }) }))] }));
161
+ return (jsx_runtime_1.jsx("div", { style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: staticFiles.length === 0 ? (publicFolderExists ? (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, place a file in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
162
+ " folder of your project or drag and drop a file here."] }) })) : (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, create a folder called", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
163
+ " in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
164
+ ...list,
165
+ backgroundColor: isDropDiv ? colors_1.CLEAR_HOVER : colors_1.BACKGROUND,
166
+ }, onDragEnter: onDragEnter, onDragLeave: onDragLeave, children: jsx_runtime_1.jsx(AssetSelectorItem_1.AssetFolderTree, { item: assetTree, level: 0, parentFolder: null, name: null, tabIndex: tabIndex, toggleFolder: toggleFolder, dropLocation: dropLocation, setDropLocation: setDropLocation, readOnlyStudio: readOnlyStudio }) })) }));
173
167
  };
174
168
  exports.AssetSelector = AssetSelector;
@@ -3,6 +3,7 @@ export type ButtonProps = {
3
3
  readonly onClick: () => void;
4
4
  readonly disabled?: boolean;
5
5
  readonly children: React.ReactNode;
6
+ readonly size?: 'default' | 'compact' | 'condensed';
6
7
  readonly style?: React.CSSProperties;
7
8
  readonly buttonContainerStyle?: React.CSSProperties;
8
9
  readonly autoFocus?: boolean;
@@ -14,22 +14,25 @@ const button = {
14
14
  color: 'white',
15
15
  flexDirection: 'row',
16
16
  };
17
- const ButtonRefForwardFunction = ({ children, onClick, title, disabled, style, id, autoFocus, buttonContainerStyle, }, ref) => {
17
+ const ButtonRefForwardFunction = ({ children, onClick, title, disabled, size = 'default', style, id, autoFocus, buttonContainerStyle, }, ref) => {
18
18
  const combined = (0, react_1.useMemo)(() => {
19
19
  return {
20
20
  ...button,
21
+ ...(size === 'compact' ? { fontSize: 12 } : null),
22
+ ...(size === 'condensed' ? { fontSize: 11 } : null),
21
23
  ...(style !== null && style !== void 0 ? style : {}),
22
24
  };
23
- }, [style]);
25
+ }, [size, style]);
24
26
  const buttonContainer = (0, react_1.useMemo)(() => {
25
27
  return {
26
- padding: 10,
28
+ padding: size === 'condensed' ? '2px 7px' : size === 'compact' ? '5px 8px' : 10,
27
29
  cursor: disabled ? 'inherit' : 'pointer',
28
- fontSize: 14,
30
+ fontSize: size === 'condensed' ? 11 : size === 'compact' ? 12 : 14,
31
+ lineHeight: size === 'condensed' ? '14px' : size === 'compact' ? '14px' : undefined,
29
32
  opacity: disabled ? 0.7 : 1,
30
33
  ...(buttonContainerStyle !== null && buttonContainerStyle !== void 0 ? buttonContainerStyle : {}),
31
34
  };
32
- }, [buttonContainerStyle, disabled]);
35
+ }, [buttonContainerStyle, disabled, size]);
33
36
  return (jsx_runtime_1.jsx("button", { ref: ref, id: id, style: combined, type: "button", disabled: disabled, onClick: onClick, autoFocus: autoFocus, title: title, children: jsx_runtime_1.jsx("div", { className: "css-reset", style: buttonContainer, children: children }) }));
34
37
  };
35
38
  exports.Button = (0, react_1.forwardRef)(ButtonRefForwardFunction);
@@ -4,7 +4,7 @@ exports.CanvasIfSizeIsAvailable = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
- const editor_rulers_1 = require("../state/editor-rulers");
7
+ const ruler_canvas_size_1 = require("../helpers/ruler-canvas-size");
8
8
  const CanvasOrLoading_1 = require("./CanvasOrLoading");
9
9
  const use_is_ruler_visible_1 = require("./EditorRuler/use-is-ruler-visible");
10
10
  const CanvasIfSizeIsAvailable = () => {
@@ -18,11 +18,7 @@ const CanvasIfSizeIsAvailable = () => {
18
18
  if (!size) {
19
19
  return null;
20
20
  }
21
- return {
22
- ...size,
23
- width: size.width - editor_rulers_1.RULER_WIDTH,
24
- height: size.height - editor_rulers_1.RULER_WIDTH,
25
- };
21
+ return (0, ruler_canvas_size_1.applyRulerInsetsToCanvasSize)({ rulersAreVisible, size });
26
22
  }, [context, rulersAreVisible]);
27
23
  if (!sizeWithRulersApplied) {
28
24
  return null;
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare const CompactExplanation: ({ children, learnMoreAriaLabel, learnMoreHref, learnMoreTitle, }: {
3
+ readonly children: ReactNode;
4
+ readonly learnMoreAriaLabel?: string | undefined;
5
+ readonly learnMoreHref?: string | undefined;
6
+ readonly learnMoreTitle?: string | undefined;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CompactNotSetUp: ({ learnMoreAriaLabel, learnMoreHref, learnMoreTitle, }: {
9
+ readonly learnMoreAriaLabel: string;
10
+ readonly learnMoreHref: string;
11
+ readonly learnMoreTitle?: string | undefined;
12
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompactNotSetUp = exports.CompactExplanation = 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 compactExplanation = {
8
+ color: colors_1.LIGHT_TEXT,
9
+ fontFamily: 'sans-serif',
10
+ fontSize: 12,
11
+ lineHeight: 1.4,
12
+ padding: '0 12px 8px',
13
+ };
14
+ const compactHelpLink = {
15
+ alignItems: 'center',
16
+ color: 'inherit',
17
+ cursor: 'default',
18
+ display: 'inline-flex',
19
+ height: 13,
20
+ justifyContent: 'center',
21
+ marginLeft: 8,
22
+ opacity: 1,
23
+ textDecoration: 'none',
24
+ verticalAlign: 'text-bottom',
25
+ width: 13,
26
+ };
27
+ const compactHelpLinkHovered = {
28
+ ...compactHelpLink,
29
+ color: 'white',
30
+ };
31
+ const compactHelpIcon = {
32
+ color: 'inherit',
33
+ display: 'block',
34
+ fill: 'currentColor',
35
+ height: 13,
36
+ width: 13,
37
+ };
38
+ const compactHelpIconPath = {
39
+ color: 'inherit',
40
+ };
41
+ const CompactHelpLink = ({ href, ariaLabel, title, }) => {
42
+ const [hovered, setHovered] = (0, react_1.useState)(false);
43
+ return (jsx_runtime_1.jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", style: hovered ? compactHelpLinkHovered : compactHelpLink, "aria-label": ariaLabel, title: title, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: compactHelpIcon, "aria-hidden": "true", children: jsx_runtime_1.jsx("path", { style: compactHelpIconPath, fill: "currentColor", d: "M464 256a208 208 0 1 0 -416 0 208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256-80c-17.7 0-32 14.3-32 32l-48 0c0-44.2 35.8-80 80-80s80 35.8 80 80c0 35.1-20.5 57.5-38.2 70-6.3 4.4-12.5 7.8-17.8 10.4l0 21.9-48 0 0-56.7c1.4-.4 2.7-.7 4.1-1.1 12.2-3.2 23.3-6.1 34.1-13.7 10.4-7.3 17.8-16.9 17.8-30.8 0-17.7-14.3-32-32-32zM232 344l48 0 0 48-48 0 0-48z" }) }) }));
44
+ };
45
+ const CompactExplanation = ({ children, learnMoreAriaLabel, learnMoreHref, learnMoreTitle = 'Learn more', }) => {
46
+ return (jsx_runtime_1.jsxs("div", { style: compactExplanation, children: [children, learnMoreHref ? (jsx_runtime_1.jsx(CompactHelpLink, { href: learnMoreHref, ariaLabel: learnMoreAriaLabel !== null && learnMoreAriaLabel !== void 0 ? learnMoreAriaLabel : learnMoreTitle, title: learnMoreTitle })) : null] }));
47
+ };
48
+ exports.CompactExplanation = CompactExplanation;
49
+ const CompactNotSetUp = ({ learnMoreAriaLabel, learnMoreHref, learnMoreTitle, }) => {
50
+ return (jsx_runtime_1.jsx(exports.CompactExplanation, { learnMoreAriaLabel: learnMoreAriaLabel, learnMoreHref: learnMoreHref, learnMoreTitle: learnMoreTitle !== null && learnMoreTitle !== void 0 ? learnMoreTitle : 'Learn more', children: "Not set up" }));
51
+ };
52
+ exports.CompactNotSetUp = CompactNotSetUp;
@@ -13,7 +13,6 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
13
13
  const modals_1 = require("../state/modals");
14
14
  const z_index_1 = require("../state/z-index");
15
15
  const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
16
- const CurrentComposition_1 = require("./CurrentComposition");
17
16
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
18
17
  const useCompositionNavigation = () => {
19
18
  const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
@@ -59,7 +58,6 @@ const container = {
59
58
  overflow: 'hidden',
60
59
  backgroundColor: colors_1.BACKGROUND,
61
60
  };
62
- const QUICK_SWITCHER_TRIGGER_HEIGHT = 38;
63
61
  const quickSwitcherArea = {
64
62
  padding: '4px 12px',
65
63
  borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
@@ -99,7 +97,7 @@ const CompositionSelector = () => {
99
97
  }, [sortedCompositions, sortedFolders, foldersExpanded]);
100
98
  const list = (0, react_1.useMemo)(() => {
101
99
  return {
102
- height: `calc(100% - ${CurrentComposition_1.CURRENT_COMPOSITION_HEIGHT}px - ${QUICK_SWITCHER_TRIGGER_HEIGHT}px)`,
100
+ flex: 1,
103
101
  overflowY: 'auto',
104
102
  };
105
103
  }, []);
@@ -115,7 +113,7 @@ const CompositionSelector = () => {
115
113
  });
116
114
  }, [setSelectedModal]);
117
115
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
118
- jsx_runtime_1.jsx(CurrentComposition_1.CurrentComposition, {}), jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: list, children: items.map((c) => {
116
+ jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: list, children: items.map((c) => {
119
117
  return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
120
118
  ? canvasContent.compositionId
121
119
  : null, selectComposition: selectComposition, toggleFolder: toggleFolder, tabIndex: tabIndex, item: c }, c.key + c.type));
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
- export declare const CURRENT_ASSET_HEIGHT = 80;
2
+ import type { MediaMetadata } from '../helpers/use-media-metadata';
3
+ export declare const CURRENT_ASSET_HEIGHT = 84;
3
4
  export declare const getCurrentAssetMetadataSource: (assetName: string | null) => string | null;
5
+ export declare const getCurrentAssetMediaDetailLines: (mediaMetadata: MediaMetadata) => string[];
4
6
  export declare const CurrentAsset: React.FC;
@@ -1,44 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CurrentAsset = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
3
+ exports.CurrentAsset = exports.getCurrentAssetMediaDetailLines = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
- const colors_1 = require("../helpers/colors");
9
8
  const format_media_duration_1 = require("../helpers/format-media-duration");
10
9
  const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
10
+ const render_codec_label_1 = require("../helpers/render-codec-label");
11
11
  const use_media_metadata_1 = require("../helpers/use-media-metadata");
12
+ const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
12
13
  const use_static_files_1 = require("./use-static-files");
13
- exports.CURRENT_ASSET_HEIGHT = 80;
14
- const container = {
15
- height: exports.CURRENT_ASSET_HEIGHT,
16
- display: 'block',
17
- borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
18
- padding: 12,
19
- color: 'white',
20
- backgroundColor: colors_1.BACKGROUND,
21
- };
22
- const title = {
23
- fontWeight: 'bold',
24
- fontSize: 12,
25
- whiteSpace: 'nowrap',
26
- lineHeight: '18px',
27
- backgroundColor: colors_1.BACKGROUND,
28
- };
29
- const subtitle = {
30
- fontSize: 12,
31
- opacity: 0.8,
32
- whiteSpace: 'nowrap',
33
- lineHeight: '18px',
34
- backgroundColor: colors_1.BACKGROUND,
35
- };
36
- const row = {
37
- display: 'flex',
38
- flexDirection: 'row',
39
- lineHeight: '18px',
40
- backgroundColor: colors_1.BACKGROUND,
41
- };
14
+ exports.CURRENT_ASSET_HEIGHT = InspectorInfoHeader_1.INSPECTOR_INFO_HEADER_MIN_HEIGHT;
42
15
  const getCurrentAssetMetadataSource = (assetName) => {
43
16
  if (!assetName) {
44
17
  return null;
@@ -49,6 +22,36 @@ const getCurrentAssetMetadataSource = (assetName) => {
49
22
  : null;
50
23
  };
51
24
  exports.getCurrentAssetMetadataSource = getCurrentAssetMetadataSource;
25
+ const formatFps = (fps) => `${fps.toFixed(2)} FPS`;
26
+ const getCurrentAssetMediaDetailLines = (mediaMetadata) => {
27
+ const detailLines = [];
28
+ if (mediaMetadata.hasVideoTrack === true) {
29
+ const videoParts = [
30
+ (0, render_codec_label_1.renderHumanReadableVideoCodec)(mediaMetadata.videoCodec),
31
+ ];
32
+ if (mediaMetadata.fps !== null) {
33
+ videoParts.push(formatFps(mediaMetadata.fps));
34
+ }
35
+ if (mediaMetadata.isHdr !== null) {
36
+ videoParts.push(`HDR: ${mediaMetadata.isHdr ? 'Yes' : 'No'}`);
37
+ }
38
+ detailLines.push(`Video: ${videoParts.join(' · ')}`);
39
+ }
40
+ if (mediaMetadata.hasAudioTrack === true) {
41
+ const audioParts = [
42
+ (0, render_codec_label_1.renderHumanReadableAudioCodec)(mediaMetadata.audioCodec),
43
+ ];
44
+ if (mediaMetadata.sampleRate !== null) {
45
+ audioParts.push(`${mediaMetadata.sampleRate} Hz`);
46
+ }
47
+ detailLines.push(`Audio: ${audioParts.join(' · ')}`);
48
+ }
49
+ else if (mediaMetadata.hasAudioTrack === false) {
50
+ detailLines.push('Audio: No audio');
51
+ }
52
+ return detailLines;
53
+ };
54
+ exports.getCurrentAssetMediaDetailLines = getCurrentAssetMediaDetailLines;
52
55
  const CurrentAsset = () => {
53
56
  var _a;
54
57
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
@@ -65,7 +68,7 @@ const CurrentAsset = () => {
65
68
  const src = (0, exports.getCurrentAssetMetadataSource)(assetName);
66
69
  const mediaMetadata = (0, use_media_metadata_1.useMediaMetadata)(src);
67
70
  if (!assetName) {
68
- return jsx_runtime_1.jsx("div", { style: container });
71
+ return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, {});
69
72
  }
70
73
  const fileName = (_a = assetName.split('/').pop()) !== null && _a !== void 0 ? _a : assetName;
71
74
  const subtitleParts = [];
@@ -80,7 +83,12 @@ const CurrentAsset = () => {
80
83
  subtitleParts.push(`${mediaMetadata.width}x${mediaMetadata.height}`);
81
84
  }
82
85
  }
83
- return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs("div", { children: [
84
- jsx_runtime_1.jsx("div", { style: title, children: fileName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx("div", { style: subtitle, children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx("div", { style: subtitle, children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null] }) }) }));
86
+ const mediaDetailLines = mediaMetadata
87
+ ? (0, exports.getCurrentAssetMediaDetailLines)(mediaMetadata)
88
+ : [];
89
+ return (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { children: [
90
+ jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoTitle, { children: fileName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null, mediaDetailLines.map((line) => {
91
+ return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: line }, line);
92
+ })] }));
85
93
  };
86
94
  exports.CurrentAsset = CurrentAsset;
@@ -1,2 +1,2 @@
1
- export declare const CURRENT_COMPOSITION_HEIGHT = 64;
1
+ export declare const CURRENT_COMPOSITION_HEIGHT = 84;
2
2
  export declare const CurrentComposition: () => import("react/jsx-runtime").JSX.Element;
@@ -2,41 +2,48 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CurrentComposition = exports.CURRENT_COMPOSITION_HEIGHT = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const remotion_1 = require("remotion");
6
- const colors_1 = require("../helpers/colors");
7
7
  const is_composition_still_1 = require("../helpers/is-composition-still");
8
+ const open_in_editor_1 = require("../helpers/open-in-editor");
8
9
  const render_frame_1 = require("../state/render-frame");
9
- exports.CURRENT_COMPOSITION_HEIGHT = 64;
10
- const container = {
11
- height: exports.CURRENT_COMPOSITION_HEIGHT,
12
- display: 'block',
13
- padding: '6px 12px',
14
- color: 'white',
15
- backgroundColor: colors_1.BACKGROUND,
16
- };
17
- const title = {
18
- fontWeight: 'bold',
19
- fontSize: 12,
20
- whiteSpace: 'nowrap',
21
- lineHeight: '18px',
22
- backgroundColor: colors_1.BACKGROUND,
23
- };
24
- const subtitle = {
25
- fontSize: 12,
26
- opacity: 0.8,
27
- whiteSpace: 'nowrap',
28
- lineHeight: '18px',
29
- backgroundColor: colors_1.BACKGROUND,
30
- };
31
- const row = {
32
- display: 'flex',
33
- flexDirection: 'row',
34
- lineHeight: '18px',
35
- backgroundColor: colors_1.BACKGROUND,
36
- };
10
+ const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
11
+ const InspectorSourceLocation_1 = require("./InspectorSourceLocation");
12
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
13
+ const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
14
+ exports.CURRENT_COMPOSITION_HEIGHT = InspectorInfoHeader_1.INSPECTOR_INFO_HEADER_MIN_HEIGHT;
37
15
  const CurrentComposition = () => {
16
+ var _a;
38
17
  const video = remotion_1.Internals.useVideo();
39
- return (jsx_runtime_1.jsx("div", { style: container, children: video ? (jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs("div", { children: [
40
- jsx_runtime_1.jsx("div", { style: title, children: video.id }), jsx_runtime_1.jsxs("div", { style: subtitle, children: [video.width, "x", video.height, (0, is_composition_still_1.isCompositionStill)(video) ? null : `, ${video.fps} FPS`] }), (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx("div", { style: subtitle, children: "Still" })) : (jsx_runtime_1.jsxs("div", { style: subtitle, children: ["Duration ", (0, render_frame_1.renderFrame)(video.durationInFrames, video.fps)] }))] }) })) : null }));
18
+ const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
19
+ const currentComposition = (0, react_1.useMemo)(() => {
20
+ var _a;
21
+ if (!video) {
22
+ return null;
23
+ }
24
+ return ((_a = compositions.find((composition) => composition.id === video.id)) !== null && _a !== void 0 ? _a : null);
25
+ }, [compositions, video]);
26
+ const resolvedCompositionLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _a !== void 0 ? _a : null);
27
+ const validatedLocation = (0, react_1.useMemo)(() => {
28
+ if (!(resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) ||
29
+ resolvedCompositionLocation.line === null) {
30
+ return null;
31
+ }
32
+ return {
33
+ column: resolvedCompositionLocation.column,
34
+ line: resolvedCompositionLocation.line,
35
+ source: resolvedCompositionLocation.source,
36
+ };
37
+ }, [resolvedCompositionLocation]);
38
+ const openFileLocation = (0, react_1.useCallback)(() => {
39
+ if (!validatedLocation) {
40
+ return;
41
+ }
42
+ (0, open_in_editor_1.openOriginalPositionInEditor)(validatedLocation).catch((err) => {
43
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
44
+ });
45
+ }, [validatedLocation]);
46
+ return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { children: video ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
47
+ jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoTitle, { children: video.id }), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null, onOpen: openFileLocation }), jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: [video.width, "x", video.height, (0, is_composition_still_1.isCompositionStill)(video) ? null : `, ${video.fps} FPS`] }), (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: "Still" })) : (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: ["Duration ", (0, render_frame_1.renderFrame)(video.durationInFrames, video.fps)] }))] })) : null }));
41
48
  };
42
49
  exports.CurrentComposition = CurrentComposition;
@@ -1,8 +1,18 @@
1
- import type { PropsEditType } from './RenderModal/DataEditor';
1
+ import type { DataEditorLayout, DataEditorMode, PropsEditType, RenderModalWarning } from './RenderModal/DataEditor';
2
+ import type { SchemaErrorMode } from './RenderModal/SchemaEditor/SchemaErrorMessages';
2
3
  import type { UpdaterFunction } from './RenderModal/SchemaEditor/ZodSwitch';
3
- export declare const DefaultPropsEditor: ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, }: {
4
+ export declare const DefaultPropsEditor: ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, schemaErrorMode, layout, mode, onModeChange, hideModeControls, warnings, showWarning, setShowWarning, hideWarningButton, }: {
4
5
  readonly unresolvedComposition: import("remotion").AnyComposition;
5
6
  readonly defaultProps: Record<string, unknown>;
6
7
  readonly setDefaultProps: UpdaterFunction<Record<string, unknown>>;
7
8
  readonly propsEditType: PropsEditType;
9
+ readonly schemaErrorMode?: SchemaErrorMode | undefined;
10
+ readonly layout?: DataEditorLayout | undefined;
11
+ readonly mode?: DataEditorMode | undefined;
12
+ readonly onModeChange?: ((mode: DataEditorMode) => void) | undefined;
13
+ readonly hideModeControls?: boolean | undefined;
14
+ readonly warnings?: RenderModalWarning[] | undefined;
15
+ readonly showWarning?: boolean | undefined;
16
+ readonly setShowWarning?: import("react").Dispatch<import("react").SetStateAction<boolean>> | undefined;
17
+ readonly hideWarningButton?: boolean | undefined;
8
18
  }) => import("react/jsx-runtime").JSX.Element;
@@ -5,11 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const ObserveDefaultPropsContext_1 = require("./ObserveDefaultPropsContext");
7
7
  const DataEditor_1 = require("./RenderModal/DataEditor");
8
- const DefaultPropsEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, }) => {
8
+ const DefaultPropsEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, schemaErrorMode, layout, mode, onModeChange, hideModeControls, warnings, showWarning, setShowWarning, hideWarningButton, }) => {
9
9
  const canSaveDefaultProps = (0, react_1.useContext)(ObserveDefaultPropsContext_1.ObserveDefaultPropsContext);
10
10
  if (canSaveDefaultProps === null) {
11
11
  throw new Error('ObserveDefaultPropsContext is not set');
12
12
  }
13
- return (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { unresolvedComposition: unresolvedComposition, defaultProps: defaultProps, setDefaultProps: setDefaultProps, propsEditType: propsEditType, canSaveDefaultProps: canSaveDefaultProps.canSaveDefaultProps }));
13
+ return (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { unresolvedComposition: unresolvedComposition, defaultProps: defaultProps, setDefaultProps: setDefaultProps, propsEditType: propsEditType, canSaveDefaultProps: canSaveDefaultProps.canSaveDefaultProps, schemaErrorMode: schemaErrorMode, layout: layout, mode: mode, onModeChange: onModeChange, hideModeControls: hideModeControls, warnings: warnings, showWarning: showWarning, setShowWarning: setShowWarning, hideWarningButton: hideWarningButton }));
14
14
  };
15
15
  exports.DefaultPropsEditor = DefaultPropsEditor;
@@ -73,8 +73,7 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
73
73
  clientX: e.clientX,
74
74
  clientY: e.clientY,
75
75
  };
76
- shouldCreateGuideRef.current = true;
77
- (0, ForceSpecificCursor_1.forceSpecificCursor)('no-drop');
76
+ shouldCreateGuideRef.current = false;
78
77
  setDraggingGuideId(() => guide.id);
79
78
  }, [guide.id, setDraggingGuideId, shouldCreateGuideRef]);
80
79
  const onMouseDown = (0, react_1.useCallback)((e) => {
@@ -89,8 +88,7 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
89
88
  clientX: e.clientX,
90
89
  clientY: e.clientY,
91
90
  };
92
- shouldCreateGuideRef.current = true;
93
- (0, ForceSpecificCursor_1.forceSpecificCursor)('no-drop');
91
+ shouldCreateGuideRef.current = false;
94
92
  setDraggingGuideId(() => guide.id);
95
93
  }, [guide.id, setDraggingGuideId, shouldCreateGuideRef]);
96
94
  const updateHasMovedGuide = (0, react_1.useCallback)((clientX, clientY) => {
@@ -113,13 +111,40 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
113
111
  const onMouseMove = (0, react_1.useCallback)((e) => {
114
112
  updateHasMovedGuide(e.clientX, e.clientY);
115
113
  }, [updateHasMovedGuide]);
114
+ const finishGuideInteraction = (0, react_1.useCallback)(() => {
115
+ const shouldDeleteGuide = shouldDeleteGuideRef.current;
116
+ setGuidesList((prevState) => {
117
+ const newGuides = shouldDeleteGuide
118
+ ? prevState.filter((candidate) => candidate.id !== guide.id)
119
+ : prevState;
120
+ (0, editor_guides_1.persistGuidesList)(newGuides);
121
+ return newGuides;
122
+ });
123
+ if (shouldDeleteGuide && selected) {
124
+ clearSelection();
125
+ }
126
+ shouldDeleteGuideRef.current = false;
127
+ shouldCreateGuideRef.current = false;
128
+ (0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
129
+ setDraggingGuideId(() => null);
130
+ }, [
131
+ clearSelection,
132
+ guide.id,
133
+ selected,
134
+ setDraggingGuideId,
135
+ setGuidesList,
136
+ shouldCreateGuideRef,
137
+ shouldDeleteGuideRef,
138
+ ]);
116
139
  const onPointerUp = (0, react_1.useCallback)((e) => {
117
140
  if (e.currentTarget.hasPointerCapture(e.pointerId)) {
118
141
  e.currentTarget.releasePointerCapture(e.pointerId);
119
142
  }
120
143
  const pointerDownPosition = pointerDownPositionRef.current;
121
144
  pointerDownPositionRef.current = null;
122
- if (shouldDeleteGuideRef.current) {
145
+ const shouldDeleteGuide = shouldDeleteGuideRef.current;
146
+ finishGuideInteraction();
147
+ if (shouldDeleteGuide) {
123
148
  return;
124
149
  }
125
150
  if ((0, editor_guide_selection_1.isGuidePointerUpAClick)({
@@ -130,11 +155,13 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
130
155
  })) {
131
156
  onSelect();
132
157
  }
133
- }, [guide.id, onSelect, shouldDeleteGuideRef]);
158
+ }, [finishGuideInteraction, guide.id, onSelect, shouldDeleteGuideRef]);
134
159
  const onMouseUp = (0, react_1.useCallback)((e) => {
135
160
  const pointerDownPosition = pointerDownPositionRef.current;
136
161
  pointerDownPositionRef.current = null;
137
- if (shouldDeleteGuideRef.current) {
162
+ const shouldDeleteGuide = shouldDeleteGuideRef.current;
163
+ finishGuideInteraction();
164
+ if (shouldDeleteGuide) {
138
165
  return;
139
166
  }
140
167
  if ((0, editor_guide_selection_1.isGuidePointerUpAClick)({
@@ -145,7 +172,7 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
145
172
  })) {
146
173
  onSelect();
147
174
  }
148
- }, [guide.id, onSelect, shouldDeleteGuideRef]);
175
+ }, [finishGuideInteraction, guide.id, onSelect, shouldDeleteGuideRef]);
149
176
  const onClick = (0, react_1.useCallback)((e) => {
150
177
  if (e.button !== 0) {
151
178
  return;
@@ -155,7 +182,8 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
155
182
  }, []);
156
183
  const onPointerCancel = (0, react_1.useCallback)(() => {
157
184
  pointerDownPositionRef.current = null;
158
- }, []);
185
+ finishGuideInteraction();
186
+ }, [finishGuideInteraction]);
159
187
  const isActive = selected || hoveredGuideId === guide.id;
160
188
  const activeClassName = isActive ? '__remotion_editor_guide_selected' : null;
161
189
  const guideClassName = (0, react_1.useMemo)(() => {
@@ -23,7 +23,7 @@ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, o
23
23
  if (!unsafeVideoConfig) {
24
24
  throw new Error('Video config not set');
25
25
  }
26
- const [cursor, setCursor] = (0, react_1.useState)(isVerticalRuler ? 'ew-resize' : 'ns-resize');
26
+ const cursor = isVerticalRuler ? 'ew-resize' : 'ns-resize';
27
27
  const guideHighlight = (0, react_1.useMemo)(() => (0, editor_guide_selection_1.getRulerGuideHighlight)({
28
28
  guidesList,
29
29
  selectedItems,
@@ -76,7 +76,7 @@ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, o
76
76
  // Prevent deselection of currently selected items
77
77
  e.stopPropagation();
78
78
  shouldCreateGuideRef.current = true;
79
- (0, ForceSpecificCursor_1.forceSpecificCursor)('no-drop');
79
+ (0, ForceSpecificCursor_1.forceSpecificCursor)(cursor);
80
80
  const guideId = makeGuideId();
81
81
  setEditorShowGuides(() => true);
82
82
  setDraggingGuideId(() => guideId);
@@ -100,18 +100,8 @@ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, o
100
100
  orientation,
101
101
  originOffset,
102
102
  unsafeVideoConfig.id,
103
+ cursor,
103
104
  ]);
104
- const changeCursor = (0, react_1.useCallback)((e) => {
105
- e.preventDefault();
106
- if (draggingGuideId !== null) {
107
- setCursor('no-drop');
108
- }
109
- }, [setCursor, draggingGuideId]);
110
- (0, react_1.useEffect)(() => {
111
- if (draggingGuideId === null) {
112
- setCursor(isVerticalRuler ? 'ew-resize' : 'ns-resize');
113
- }
114
- }, [draggingGuideId, isVerticalRuler]);
115
- return (jsx_runtime_1.jsx("canvas", { ref: rulerCanvasRef, width: rulerWidth * window.devicePixelRatio, height: rulerHeight * window.devicePixelRatio, style: rulerStyle, [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', onPointerDown: onPointerDown, onPointerEnter: changeCursor, onPointerLeave: changeCursor }));
105
+ return (jsx_runtime_1.jsx("canvas", { ref: rulerCanvasRef, width: rulerWidth * window.devicePixelRatio, height: rulerHeight * window.devicePixelRatio, style: rulerStyle, [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', onPointerDown: onPointerDown }));
116
106
  };
117
107
  exports.default = Ruler;