@remotion/studio 4.0.516 → 4.0.517

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 (117) hide show
  1. package/dist/components/AssetSelector.js +1 -1
  2. package/dist/components/Canvas.js +15 -12
  3. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  4. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  5. package/dist/components/CanvasOrLoading.js +4 -3
  6. package/dist/components/CaptionInspector.js +1 -1
  7. package/dist/components/CheckboardToggle.js +1 -1
  8. package/dist/components/Checkbox.d.ts +0 -1
  9. package/dist/components/Checkbox.js +2 -19
  10. package/dist/components/ConfigureLicenseModal.js +79 -46
  11. package/dist/components/CurrentAsset.d.ts +1 -1
  12. package/dist/components/CurrentAsset.js +9 -4
  13. package/dist/components/Editor.js +2 -1
  14. package/dist/components/EditorContent.js +5 -2
  15. package/dist/components/EditorContexts.js +2 -1
  16. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  17. package/dist/components/EditorRuler/Ruler.js +9 -8
  18. package/dist/components/EditorRuler/index.d.ts +1 -0
  19. package/dist/components/EditorRuler/index.js +3 -4
  20. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  21. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  22. package/dist/components/ElementLibraryModal.d.ts +5 -0
  23. package/dist/components/ElementLibraryModal.js +38 -0
  24. package/dist/components/FilePreview.js +71 -0
  25. package/dist/components/InlineEditableTitle.js +2 -2
  26. package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
  27. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  28. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  29. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  30. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  31. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  32. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  33. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
  34. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
  35. package/dist/components/InspectorPanel/common.d.ts +0 -1
  36. package/dist/components/InspectorPanel/common.js +3 -7
  37. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  38. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  39. package/dist/components/InspectorPanel/styles.js +3 -4
  40. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  41. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  42. package/dist/components/InspectorSourceLocation.js +1 -1
  43. package/dist/components/Menu/MenuItem.js +15 -6
  44. package/dist/components/MenuToolbar.js +7 -3
  45. package/dist/components/Modals.js +2 -1
  46. package/dist/components/PlaybackRateSelector.js +1 -1
  47. package/dist/components/Preview.js +83 -5
  48. package/dist/components/PreviewToolbar.js +10 -4
  49. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  50. package/dist/components/PreviewToolbarOverflowButton.js +9 -2
  51. package/dist/components/RadioButton.d.ts +6 -0
  52. package/dist/components/RadioButton.js +62 -0
  53. package/dist/components/RenderButton.js +2 -1
  54. package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
  55. package/dist/components/RulersAndGuidesToggle.js +18 -7
  56. package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
  57. package/dist/components/SelectedOutlineRenderer.d.ts +1 -2
  58. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  59. package/dist/components/SettingsModal.js +1 -1
  60. package/dist/components/SettingsModalFooter.d.ts +3 -1
  61. package/dist/components/SettingsModalFooter.js +19 -4
  62. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  63. package/dist/components/ShowPixelGridProvider.js +24 -0
  64. package/dist/components/SidebarCollapserControls.js +2 -2
  65. package/dist/components/Timeline/Timeline.js +41 -0
  66. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  67. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  68. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  69. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  70. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  71. package/dist/components/Timeline/TimelineSelection.js +30 -170
  72. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  73. package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
  74. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
  75. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  76. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  77. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  78. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  79. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  80. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  81. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  82. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  83. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  84. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  85. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  86. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
  87. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  88. package/dist/components/canvas-capture-drop.d.ts +4 -0
  89. package/dist/components/canvas-capture-drop.js +22 -0
  90. package/dist/components/selected-outline-measurement.d.ts +7 -8
  91. package/dist/esm/{chunk-w4244j4n.js → chunk-gzqm3g2m.js} +15184 -8344
  92. package/dist/esm/internals.mjs +15184 -8344
  93. package/dist/esm/previewEntry.mjs +15096 -8256
  94. package/dist/esm/renderEntry.mjs +1 -1
  95. package/dist/helpers/calculate-timeline.d.ts +1 -7
  96. package/dist/helpers/calculate-timeline.js +2 -146
  97. package/dist/helpers/editor-ruler.js +6 -5
  98. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  99. package/dist/helpers/get-asset-metadata.js +51 -6
  100. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  101. package/dist/helpers/get-connected-compositions.js +2 -8
  102. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  103. package/dist/helpers/get-sequence-visible-range.js +6 -51
  104. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  105. package/dist/helpers/get-timeline-nestedness.js +2 -12
  106. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
  107. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  108. package/dist/helpers/is-current-selected-still.js +4 -2
  109. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  110. package/dist/helpers/sort-by-nonce-history.js +3 -148
  111. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  112. package/dist/helpers/timeline-node-path-key.js +2 -2
  113. package/dist/helpers/use-menu-structure.js +20 -0
  114. package/dist/state/editor-pixel-grid.d.ts +8 -0
  115. package/dist/state/editor-pixel-grid.js +18 -0
  116. package/dist/state/modals.d.ts +4 -0
  117. package/package.json +14 -12
@@ -140,7 +140,7 @@ const AssetSelector = ({ readOnlyStudio }) => {
140
140
  }
141
141
  return;
142
142
  }
143
- const { files } = e.dataTransfer;
143
+ const files = Array.from(e.dataTransfer.files);
144
144
  if (files.length === 0) {
145
145
  setDropLocation(null);
146
146
  return;
@@ -16,7 +16,6 @@ const clipboard_images_1 = require("../helpers/clipboard-images");
16
16
  const clipboard_svg_1 = require("../helpers/clipboard-svg");
17
17
  const colors_1 = require("../helpers/colors");
18
18
  const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
19
- const get_canvas_capture_import_1 = require("../helpers/get-canvas-capture-import");
20
19
  const get_effective_translation_1 = require("../helpers/get-effective-translation");
21
20
  const install_required_package_1 = require("../helpers/install-required-package");
22
21
  const open_in_editor_1 = require("../helpers/open-in-editor");
@@ -29,6 +28,7 @@ const editor_snapping_1 = require("../state/editor-snapping");
29
28
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
30
29
  const modals_1 = require("../state/modals");
31
30
  const call_api_1 = require("./call-api");
31
+ const canvas_capture_drop_1 = require("./canvas-capture-drop");
32
32
  const composition_drop_preview_1 = require("./composition-drop-preview");
33
33
  const ConfirmationDialog_1 = require("./ConfirmationDialog");
34
34
  const drop_handler_data_1 = require("./drop-handler-data");
@@ -135,6 +135,7 @@ const Canvas = ({ canvasContent, size }) => {
135
135
  const { editorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
136
136
  const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
137
137
  const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
138
+ const { setCurrentAssetMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
138
139
  const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
139
140
  const previewServerClientId = previewServerState.type === 'connected'
140
141
  ? previewServerState.clientId
@@ -146,6 +147,7 @@ const Canvas = ({ canvasContent, size }) => {
146
147
  const [activeElementInstallRequest, setActiveElementInstallRequest] = (0, react_1.useState)(null);
147
148
  const lastFocusedAtRef = (0, react_1.useRef)(typeof document === 'undefined' || document.hasFocus() ? Date.now() : null);
148
149
  const [assetResolution, setAssetResolution] = (0, react_1.useState)(null);
150
+ const metadataRequestRef = (0, react_1.useRef)(0);
149
151
  const currentCompositionId = canvasContent.type === 'composition' ? canvasContent.compositionId : null;
150
152
  const currentComposition = (0, react_1.useMemo)(() => {
151
153
  var _a;
@@ -530,13 +532,19 @@ const Canvas = ({ canvasContent, size }) => {
530
532
  };
531
533
  }, [keybindings, onReset, onZoomIn, onZoomOut]);
532
534
  const fetchMetadata = (0, react_1.useCallback)(async () => {
535
+ const request = ++metadataRequestRef.current;
533
536
  setAssetResolution(null);
534
537
  if (canvasContent.type === 'composition') {
538
+ setCurrentAssetMetadata(null);
535
539
  return;
536
540
  }
537
541
  const metadata = await (0, get_asset_metadata_1.getAssetMetadata)(canvasContent, canvasContent.type === 'asset');
542
+ if (request !== metadataRequestRef.current) {
543
+ return;
544
+ }
538
545
  setAssetResolution(metadata);
539
- }, [canvasContent]);
546
+ setCurrentAssetMetadata((0, get_asset_metadata_1.getAssetPreviewMetadata)({ canvasContent, metadata }));
547
+ }, [canvasContent, setCurrentAssetMetadata]);
540
548
  (0, react_1.useEffect)(() => {
541
549
  if (canvasContent.type !== 'asset') {
542
550
  return;
@@ -855,15 +863,10 @@ const Canvas = ({ canvasContent, size }) => {
855
863
  if (localFiles.length === 1) {
856
864
  setIsAddingAsset(true);
857
865
  try {
858
- const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(localFiles[0]);
859
- if (canvasCapture !== null) {
860
- setSelectedModal({
861
- type: 'new-comp',
862
- canvasCapture,
863
- folderName: null,
864
- parentName: null,
865
- stack: null,
866
- });
866
+ if (await (0, canvas_capture_drop_1.handleCanvasCaptureDrop)({
867
+ files: localFiles,
868
+ setSelectedModal,
869
+ })) {
867
870
  return;
868
871
  }
869
872
  }
@@ -1097,6 +1100,6 @@ const Canvas = ({ canvasContent, size }) => {
1097
1100
  };
1098
1101
  }, [compositionDropPreview, contentDimensions, previewSize, size]);
1099
1102
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
1100
- jsx_runtime_1.jsxs("div", { ref: canvas_ref_1.canvasRef, style: getContainerStyle(editorZoomGestures), children: [size ? (jsx_runtime_1.jsx(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, onRetryAssetMetadata: fetchMetadata })) : null, compositionDropPreviewStyle === null ? null : (jsx_runtime_1.jsx("div", { className: "css-reset", "data-testid": "composition-drop-preview", style: compositionDropPreviewStyle })), isFit ? null : (jsx_runtime_1.jsx("div", { style: resetZoom, className: "css-reset", children: jsx_runtime_1.jsx(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) })), editorShowGuides && canvasContent.type === 'composition' && (jsx_runtime_1.jsx(EditorGuides_1.default, { canvasSize: size, contentDimensions: contentDimensions, assetMetadata: assetResolution }))] }), areRulersVisible && (jsx_runtime_1.jsx(EditorRuler_1.EditorRulers, { contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, containerRef: canvas_ref_1.canvasRef }))] }));
1103
+ jsx_runtime_1.jsxs("div", { ref: canvas_ref_1.canvasRef, style: getContainerStyle(editorZoomGestures), children: [size ? (jsx_runtime_1.jsx(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, onRetryAssetMetadata: fetchMetadata })) : null, compositionDropPreviewStyle === null ? null : (jsx_runtime_1.jsx("div", { className: "css-reset", "data-testid": "composition-drop-preview", style: compositionDropPreviewStyle })), isFit ? null : (jsx_runtime_1.jsx("div", { style: resetZoom, className: "css-reset", children: jsx_runtime_1.jsx(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) })), editorShowGuides && canvasContent.type === 'composition' && (jsx_runtime_1.jsx(EditorGuides_1.default, { canvasSize: size, contentDimensions: contentDimensions, assetMetadata: assetResolution }))] }), areRulersVisible && (jsx_runtime_1.jsx(EditorRuler_1.EditorRulers, { canCreateGuides: canvasContent.type === 'composition', contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, containerRef: canvas_ref_1.canvasRef }))] }));
1101
1104
  };
1102
1105
  exports.Canvas = Canvas;
@@ -0,0 +1,4 @@
1
+ import { type FC } from 'react';
2
+ export declare const CanvasCaptureDropHandler: FC<{
3
+ readonly readOnlyStudio: boolean;
4
+ }>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CanvasCaptureDropHandler = void 0;
4
+ const react_1 = require("react");
5
+ const modals_1 = require("../state/modals");
6
+ const canvas_capture_drop_1 = require("./canvas-capture-drop");
7
+ const drop_handler_data_1 = require("./drop-handler-data");
8
+ const CanvasCaptureDropHandler = ({ readOnlyStudio }) => {
9
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
10
+ const onDragOver = (0, react_1.useCallback)((event) => {
11
+ if (readOnlyStudio || !(0, drop_handler_data_1.isFileDragEvent)(event)) {
12
+ return;
13
+ }
14
+ event.preventDefault();
15
+ if (event.dataTransfer) {
16
+ event.dataTransfer.dropEffect = 'copy';
17
+ }
18
+ }, [readOnlyStudio]);
19
+ const onDrop = (0, react_1.useCallback)(async (event) => {
20
+ var _a;
21
+ var _b;
22
+ if (readOnlyStudio || !(0, drop_handler_data_1.isFileDragEvent)(event)) {
23
+ return;
24
+ }
25
+ const files = Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
26
+ if (files.length === 0) {
27
+ return;
28
+ }
29
+ event.preventDefault();
30
+ await (0, canvas_capture_drop_1.handleCanvasCaptureDrop)({ files, setSelectedModal });
31
+ }, [readOnlyStudio, setSelectedModal]);
32
+ (0, react_1.useEffect)(() => {
33
+ document.addEventListener('dragover', onDragOver);
34
+ document.addEventListener('drop', onDrop);
35
+ return () => {
36
+ document.removeEventListener('dragover', onDragOver);
37
+ document.removeEventListener('drop', onDrop);
38
+ };
39
+ }, [onDragOver, onDrop]);
40
+ return null;
41
+ };
42
+ exports.CanvasCaptureDropHandler = CanvasCaptureDropHandler;
@@ -58,9 +58,10 @@ const CanvasOrLoading = ({ size }) => {
58
58
  }
59
59
  const content = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
60
60
  jsx_runtime_1.jsx(ZoomPersistor_1.ZoomPersistor, {}), jsx_runtime_1.jsx(Canvas_1.Canvas, { size: size, canvasContent: canvasContent }), (resolved === null || resolved === void 0 ? void 0 : resolved.type) === 'success-and-refreshing' ? (jsx_runtime_1.jsx(RefreshCompositionOverlay_1.RefreshCompositionOverlay, {})) : null] }));
61
- if (canvasContent.type === 'asset' ||
62
- canvasContent.type === 'output' ||
63
- canvasContent.type === 'output-blob') {
61
+ if (canvasContent.type === 'output' || canvasContent.type === 'output-blob') {
62
+ return content;
63
+ }
64
+ if (canvasContent.type === 'asset' && resolved === null) {
64
65
  return content;
65
66
  }
66
67
  if (!resolved) {
@@ -17,6 +17,6 @@ const readOnlyStatus = {
17
17
  };
18
18
  const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onTextCancel, onToggle, readOnly, readOnlyTitle, }) => {
19
19
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
20
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
20
+ jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
21
21
  };
22
22
  exports.CaptionInspector = CaptionInspector;
@@ -21,7 +21,7 @@ const CheckboardToggle = () => {
21
21
  return !c;
22
22
  });
23
23
  }, [setCheckerboard]);
24
- return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
24
+ return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": checkerboard, onClick: onClick, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
25
25
  jsx_runtime_1.jsx("path", { fill: checkerboard ? colors_1.BLUE : color, d: "M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z" }), jsx_runtime_1.jsx("rect", { x: "48", y: "48", width: "416", height: "416", rx: "24", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" }), jsx_runtime_1.jsx("path", { d: "M256 48v416M48 256h416", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" })
26
26
  ] })) }));
27
27
  };
@@ -8,7 +8,6 @@ export declare const Checkbox: React.FC<{
8
8
  readonly checked: boolean;
9
9
  readonly onChange: React.ChangeEventHandler<HTMLInputElement>;
10
10
  readonly name: string;
11
- readonly rounded?: boolean;
12
11
  readonly disabled?: boolean;
13
12
  readonly variant?: CheckboxVariant;
14
13
  }>;
@@ -9,30 +9,18 @@ const SIZES = {
9
9
  default: 20,
10
10
  small: 18,
11
11
  };
12
- const BULLET_SIZES = {
13
- default: 10,
14
- small: 9,
15
- };
16
12
  const CHECKMARK_SIZES = {
17
13
  default: 14,
18
14
  small: 13,
19
15
  };
20
- const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'default' }) => {
21
- const ref = (0, react_1.useRef)(null);
16
+ const Checkbox = ({ checked, onChange, disabled, name, variant = 'default' }) => {
22
17
  const size = SIZES[variant];
23
- const bulletSize = BULLET_SIZES[variant];
24
18
  const checkmarkSize = CHECKMARK_SIZES[variant];
25
19
  const background = (0, react_1.useMemo)(() => ({
26
20
  height: size,
27
21
  width: size,
28
22
  position: 'relative',
29
23
  }), [size]);
30
- const bullet = (0, react_1.useMemo)(() => ({
31
- width: bulletSize,
32
- height: bulletSize,
33
- backgroundColor: colors_1.WHITE,
34
- borderRadius: '50%',
35
- }), [bulletSize]);
36
24
  const box = (0, react_1.useMemo)(() => ({
37
25
  display: 'flex',
38
26
  justifyContent: 'center',
@@ -58,13 +46,8 @@ const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'defau
58
46
  margin: 0,
59
47
  };
60
48
  }, [disabled, size]);
61
- (0, react_1.useEffect)(() => {
62
- if (ref.current) {
63
- ref.current.style.setProperty('border-radius', rounded ? '50%' : '0%', 'important');
64
- }
65
- }, [rounded]);
66
49
  return (jsx_runtime_1.jsxs("div", { style: background, children: [
67
- jsx_runtime_1.jsx("input", { ref: ref, style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), jsx_runtime_1.jsx("div", { style: box, children: checked ? (rounded ? (jsx_runtime_1.jsx("div", { style: bullet })) : (jsx_runtime_1.jsx(Checkmark_1.Checkmark, { size: checkmarkSize }))) : null })
50
+ jsx_runtime_1.jsx("input", { style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), jsx_runtime_1.jsx("div", { style: box, children: checked ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, { size: checkmarkSize }) : null })
68
51
  ] }));
69
52
  };
70
53
  exports.Checkbox = Checkbox;
@@ -4,11 +4,11 @@ exports.LicenseSettings = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
- const Checkbox_1 = require("./Checkbox");
8
7
  const layout_1 = require("./layout");
9
8
  const LicenseKeyValidation_1 = require("./LicenseKeyValidation");
10
9
  const RemInput_1 = require("./NewComposition/RemInput");
11
10
  const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
11
+ const RadioButton_1 = require("./RadioButton");
12
12
  const SettingsContext_1 = require("./SettingsContext");
13
13
  const use_auto_save_config_1 = require("./use-auto-save-config");
14
14
  const container = {
@@ -34,21 +34,50 @@ const descriptionLink = {
34
34
  fontSize: 14,
35
35
  lineHeight: '21px',
36
36
  };
37
- const checkboxRow = {
37
+ const externalDescriptionLink = {
38
+ ...descriptionLink,
39
+ color: colors_1.BLUE,
40
+ };
41
+ const externalLinkIndicator = {
42
+ display: 'inline-block',
43
+ height: 12,
44
+ marginLeft: 4,
45
+ verticalAlign: -2,
46
+ width: 12,
47
+ };
48
+ const licenseExplanation = {
49
+ display: 'flex',
50
+ flexDirection: 'column',
51
+ gap: 12,
52
+ };
53
+ const licenseExplanationRow = {
38
54
  display: 'flex',
39
- flexDirection: 'row',
40
55
  alignItems: 'center',
41
- cursor: 'pointer',
42
- marginTop: 5,
56
+ gap: 12,
57
+ };
58
+ const people = {
59
+ display: 'grid',
60
+ gridTemplateColumns: 'repeat(4, 9px)',
61
+ gap: 3,
62
+ flexShrink: 0,
63
+ };
64
+ const person = {
65
+ display: 'block',
66
+ height: 24,
67
+ overflow: 'visible',
68
+ width: 9,
69
+ };
70
+ const PersonIcon = ({ handsUp, opacity }) => {
71
+ return (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", opacity: opacity, style: person, viewBox: "0 0 192 512", xmlns: "http://www.w3.org/2000/svg", children: [
72
+ jsx_runtime_1.jsx("path", { fill: colors_1.LIGHT_TEXT, d: "M128 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM32 64A64 64 0 1 1 160 64 64 64 0 1 1 32 64zm0 128l0 128 128 0 0-128-128 0zM0 160l192 0 0 192-32 0 0 160-32 0 0-160-64 0 0 160-32 0 0-160-32 0 0-192z" }), handsUp ? (jsx_runtime_1.jsx("path", { d: "M10.667 192 0 -32 M181.333 192 192 -32", fill: "none", stroke: colors_1.LIGHT_TEXT, strokeWidth: "32" })) : null] }));
73
+ };
74
+ const freeLicenseMessage = {
75
+ ...description,
43
76
  marginBottom: 5,
77
+ marginLeft: 28,
44
78
  };
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',
79
+ const companyLicenseContent = {
80
+ marginLeft: 28,
52
81
  };
53
82
  const inputLabel = {
54
83
  color: colors_1.LIGHT_TEXT,
@@ -170,40 +199,44 @@ const LicenseSettings = () => {
170
199
  });
171
200
  const displayedError = error !== null && error !== void 0 ? error : settingsError;
172
201
  return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { style: content, children: [
173
- jsx_runtime_1.jsxs("p", { style: description, children: ["Remotion is free to use if you are an individual or company with a headcount of 3 or less.",
174
- jsx_runtime_1.jsx("br", {}),
175
- "If used in an organization with 4 people or more, a", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "Company License" }), ' needs to be obtained.'] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: (event) => {
176
- if (!(event.target instanceof HTMLInputElement)) {
177
- toggleFreeLicense();
178
- }
179
- }, children: [
180
- jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'free', onChange: toggleFreeLicense, 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" })
181
- ] }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: (event) => {
182
- if (!(event.target instanceof HTMLInputElement)) {
183
- toggleCompanyLicense();
184
- }
185
- }, children: [
186
- jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'company', onChange: toggleCompanyLicense, 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" })
187
- ] }), licenseType === 'company' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
188
- 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",
189
- jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: localLicenseKeyValidation.message ||
190
- remoteValidationMessage ||
191
- (licenseKeyDetails !== null &&
192
- !(0, LicenseKeyValidation_1.hasActiveCompanyLicense)(licenseKeyDetails))
193
- ? 'error'
194
- : 'ok', rightAlign: false, value: companyLicenseKey, onChange: (event) => {
195
- setCompanyLicenseKey(event.target.value);
196
- setError(null);
197
- }, onBlur: () => {
198
- setCompanyLicenseKeyToSave(companyLicenseKey.trim());
199
- }, placeholder: "rm_pub_...", autoFocus: true })
200
- ] }), localLicenseKeyValidation.message ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
201
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: localLicenseKeyValidation.message, align: "flex-start", type: "error" })
202
- ] })) : null, remoteValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
203
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: remoteValidationMessage, align: "flex-start", type: "error" })
204
- ] })) : null, isValidatingLicenseKey ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
205
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx("p", { style: description, children: "Loading license key details..." })
206
- ] })) : null, licenseKeyDetails ? (jsx_runtime_1.jsx(LicenseKeyValidation_1.LicenseKeyDetailsDisplay, { details: licenseKeyDetails })) : null] })) : null, displayedError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
202
+ jsx_runtime_1.jsxs("div", { style: licenseExplanation, children: [
203
+ jsx_runtime_1.jsxs("div", { style: licenseExplanationRow, children: [
204
+ jsx_runtime_1.jsxs("div", { style: people, children: [
205
+ jsx_runtime_1.jsx(PersonIcon, { handsUp: true, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: true, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: true, opacity: 1 })
206
+ ] }), jsx_runtime_1.jsx("p", { style: description, children: "Remotion is free to use if you are an individual or company of 3 or less." })
207
+ ] }), jsx_runtime_1.jsxs("div", { style: licenseExplanationRow, children: [
208
+ jsx_runtime_1.jsxs("div", { style: people, children: [
209
+ jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 })
210
+ ] }), jsx_runtime_1.jsxs("p", { style: description, children: ["If used in an organization with 4+ people, you need a", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "Company License" }),
211
+ "."] })
212
+ ] }), jsx_runtime_1.jsxs("div", { style: licenseExplanationRow, children: [
213
+ jsx_runtime_1.jsxs("div", { style: people, children: [
214
+ jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 0.3 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 0.3 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 0.3 })
215
+ ] }), jsx_runtime_1.jsx("p", { style: description, children: "The total headcount matters, not the amount of people using Remotion." })
216
+ ] })
217
+ ] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { "aria-label": "License type", role: "radiogroup", children: [
218
+ jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: licenseType === 'free', onClick: toggleFreeLicense, children: "I am eligible for the Free License" }), licenseType === 'free' ? (jsx_runtime_1.jsx("p", { style: freeLicenseMessage, children: "That's it! Enjoy Remotion." })) : null, jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: licenseType === 'company', onClick: toggleCompanyLicense, children: "I need a Company License" }), licenseType === 'company' ? (jsx_runtime_1.jsxs("div", { style: companyLicenseContent, children: [
219
+ jsx_runtime_1.jsxs("p", { style: description, children: ["Visit", ' ', jsx_runtime_1.jsxs("a", { style: externalDescriptionLink, href: "https://remotion.pro/license", target: "_blank", rel: "noopener noreferrer", children: ["remotion.pro/license",
220
+ jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: externalLinkIndicator, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.BLUE, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })
221
+ ] }), ' ', "to obtain a license key. Then enter it here."] }), jsx_runtime_1.jsxs("label", { style: inputLabel, children: ["Public license key",
222
+ jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: localLicenseKeyValidation.message ||
223
+ remoteValidationMessage ||
224
+ (licenseKeyDetails !== null &&
225
+ !(0, LicenseKeyValidation_1.hasActiveCompanyLicense)(licenseKeyDetails))
226
+ ? 'error'
227
+ : 'ok', rightAlign: false, value: companyLicenseKey, onChange: (event) => {
228
+ setCompanyLicenseKey(event.target.value);
229
+ setError(null);
230
+ }, onBlur: () => {
231
+ setCompanyLicenseKeyToSave(companyLicenseKey.trim());
232
+ }, placeholder: "rm_pub_...", autoFocus: true })
233
+ ] }), localLicenseKeyValidation.message ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
234
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: localLicenseKeyValidation.message, align: "flex-start", type: "error" })
235
+ ] })) : null, remoteValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
236
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: remoteValidationMessage, align: "flex-start", type: "error" })
237
+ ] })) : null, isValidatingLicenseKey ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
238
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx("p", { style: description, children: "Loading license key details..." })
239
+ ] })) : null, licenseKeyDetails ? (jsx_runtime_1.jsx(LicenseKeyValidation_1.LicenseKeyDetailsDisplay, { details: licenseKeyDetails })) : null] })) : null] }), displayedError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
207
240
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: displayedError, align: "flex-start", type: "error" })
208
241
  ] })) : null] }) }));
209
242
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MediaMetadata } from '../helpers/use-media-metadata';
3
- export declare const CURRENT_ASSET_HEIGHT: number;
3
+ export declare const CURRENT_ASSET_HEIGHT = 28;
4
4
  export declare const getCurrentAssetMetadataSource: (assetName: string | null) => string | null;
5
5
  export declare const getCurrentAssetImageMetadataSource: (assetName: string | null) => string | null;
6
6
  type CurrentAssetDetail = {
@@ -28,7 +28,7 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
28
28
  const actions_1 = require("./RenderQueue/actions");
29
29
  const use_delete_asset_1 = require("./use-delete-asset");
30
30
  const use_static_files_1 = require("./use-static-files");
31
- exports.CURRENT_ASSET_HEIGHT = layout_1.COMPACT_INLINE_ROW_HEIGHT + 8;
31
+ exports.CURRENT_ASSET_HEIGHT = layout_1.COMPACT_CONTROL_ROW_HEIGHT;
32
32
  const quickActionIconStyle = {
33
33
  display: 'block',
34
34
  height: 18,
@@ -189,6 +189,12 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
189
189
  }
190
190
  const fileName = (_a = assetName.split('/').pop()) !== null && _a !== void 0 ? _a : assetName;
191
191
  const fileDetails = [];
192
+ if (imageMetadata !== null) {
193
+ fileDetails.push({
194
+ label: 'Dimensions',
195
+ value: `${imageMetadata.width} × ${imageMetadata.height}`,
196
+ });
197
+ }
192
198
  const container = (_c = (_b = mediaMetadata === null || mediaMetadata === void 0 ? void 0 : mediaMetadata.format) !== null && _b !== void 0 ? _b : imageMetadata === null || imageMetadata === void 0 ? void 0 : imageMetadata.format) !== null && _c !== void 0 ? _c : null;
193
199
  if (container !== null) {
194
200
  fileDetails.push({ label: 'Container', value: container });
@@ -207,10 +213,9 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
207
213
  const mutationsDisabled = browserStudioOperations === null &&
208
214
  (readOnlyStudio || connectionStatus !== 'connected');
209
215
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
210
- jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, minHeight: exports.CURRENT_ASSET_HEIGHT, padding: contentSized
216
+ jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, minHeight: exports.CURRENT_ASSET_HEIGHT, padding: contentSized
211
217
  ? `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 6px`
212
- : '4px 0', children: [
213
- jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, size: contentSized ? 'default' : 'inspector', title: assetName }), imageMetadata ? (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { size: contentSized ? 'default' : 'inspector', children: [imageMetadata.width, " \u00D7 ", imageMetadata.height] })) : null] }), fileDetails.length > 0 ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "File", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: fileDetails.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.video ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Video", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.video.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.audio !== null ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Audio", children: mediaSections.audio.length === 0 ? (jsx_runtime_1.jsx("div", { style: assetEmptyStateStyle, children: "None" })) : (jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.audio.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) })) })) : null, jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [src ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, onClick: onOpenConvert, renderIcon: (color) => (jsx_runtime_1.jsx(remotion_convert_1.RemotionConvertIcon, { color: color, style: quickActionIconStyle })), children: ["Convert",
218
+ : '4px 0', children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, size: contentSized ? 'default' : 'inspector', title: assetName }) }), fileDetails.length > 0 ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "File", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: fileDetails.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.video ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Video", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.video.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.audio !== null ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Audio", children: mediaSections.audio.length === 0 ? (jsx_runtime_1.jsx("div", { style: assetEmptyStateStyle, children: "None" })) : (jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.audio.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) })) })) : null, jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [src ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, onClick: onOpenConvert, renderIcon: (color) => (jsx_runtime_1.jsx(remotion_convert_1.RemotionConvertIcon, { color: color, style: quickActionIconStyle })), children: ["Convert",
214
219
  jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: convertArrowStyle, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.CURRENT_COLOR, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })
215
220
  ] })) : null, fileManagerAvailable ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: fileManagerDisabled, onClick: onShowInFileManager, renderIcon: (color) => (jsx_runtime_1.jsx(folder_1.ExpandedFolderIcon, { color: color, style: quickActionIconStyle })), children: ["Show in ", fileManagerName] })) : null, jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { color: color, style: quickActionIconStyle })), children: "Delete" })] })
216
221
  ] }));
@@ -48,6 +48,7 @@ const composition_list_1 = require("../state/composition-list");
48
48
  const scale_lock_1 = require("../state/scale-lock");
49
49
  const timeline_zoom_1 = require("../state/timeline-zoom");
50
50
  const z_index_1 = require("../state/z-index");
51
+ const CanvasCaptureDropHandler_1 = require("./CanvasCaptureDropHandler");
51
52
  const EditorContent_1 = require("./EditorContent");
52
53
  const ForceSpecificCursor_1 = require("./ForceSpecificCursor");
53
54
  const Modals_1 = require("./Modals");
@@ -111,7 +112,7 @@ const Editor = ({ Root, readOnlyStudio }) => {
111
112
  const renderErrorContextValue = (0, react_1.useMemo)(() => ({ error: renderError }), [renderError]);
112
113
  return (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: [
113
114
  jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
114
- jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
115
+ jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(CanvasCaptureDropHandler_1.CanvasCaptureDropHandler, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
115
116
  jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? (jsx_runtime_1.jsx(RootCompositionLoader, { Root: 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 }) }) }) })
116
117
  ] }) })
117
118
  ] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
@@ -34,8 +34,11 @@ const StudioClearSelectionArea = ({ children }) => {
34
34
  return (jsx_runtime_1.jsx("div", { style: container, onPointerDown: onPointerDown, children: children }));
35
35
  };
36
36
  const EditorContent = ({ readOnlyStudio, children }) => {
37
- const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
38
- const showTimeline = canvasContent !== null && canvasContent.type === 'composition';
37
+ const { canvasContent, currentAssetMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
38
+ const showTimeline = canvasContent !== null &&
39
+ (canvasContent.type === 'composition' ||
40
+ (canvasContent.type === 'asset' &&
41
+ (currentAssetMetadata === null || currentAssetMetadata === void 0 ? void 0 : currentAssetMetadata.asset) === canvasContent.asset));
39
42
  const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, maxFlexerSize: null, minFlexerSize: null, maxAntiFlexerSize: null, minAntiFlexerSize: null, children: [
40
43
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
41
44
  ] }));
@@ -21,6 +21,7 @@ const SetTimelineInOutProvider_1 = require("./SetTimelineInOutProvider");
21
21
  const SettingsContext_1 = require("./SettingsContext");
22
22
  const ShowGuidesProvider_1 = require("./ShowGuidesProvider");
23
23
  const ShowOutlinesProvider_1 = require("./ShowOutlinesProvider");
24
+ const ShowPixelGridProvider_1 = require("./ShowPixelGridProvider");
24
25
  const ShowRulersProvider_1 = require("./ShowRulersProvider");
25
26
  const SnappingProvider_1 = require("./SnappingProvider");
26
27
  const VisualControlsUndoSync_1 = require("./VisualControls/VisualControlsUndoSync");
@@ -28,7 +29,7 @@ const ZoomGesturesProvider_1 = require("./ZoomGesturesProvider");
28
29
  const EditorContexts = ({ children }) => {
29
30
  return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.jsx(client_id_1.PreviewServerConnection, { children: jsx_runtime_1.jsxs(SettingsContext_1.SettingsProvider, { children: [
30
31
  jsx_runtime_1.jsx(VisualControlsUndoSync_1.VisualControlsUndoSync, {}), jsx_runtime_1.jsxs(context_1.RenderQueueContextProvider, { children: [
31
- jsx_runtime_1.jsx(ClientRenderQueueProcessor_1.ClientRenderQueueProcessor, {}), jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(CheckerboardProvider_1.CheckerboardProvider, { children: jsx_runtime_1.jsx(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: jsx_runtime_1.jsx(ShowRulersProvider_1.ShowRulersProvider, { children: jsx_runtime_1.jsx(ShowGuidesProvider_1.ShowGuidesProvider, { children: jsx_runtime_1.jsx(ShowOutlinesProvider_1.ShowOutlinesProvider, { children: jsx_runtime_1.jsx(SnappingProvider_1.SnappingProvider, { children: jsx_runtime_1.jsx(preview_size_1.PreviewSizeProvider, { children: jsx_runtime_1.jsx(ModalsProvider_1.ModalsProvider, { children: jsx_runtime_1.jsx(MediaVolumeProvider_1.MediaVolumeProvider, { children: jsx_runtime_1.jsx(player_1.PlayerInternals.PlayerEmitterProvider, { currentPlaybackRate: null, children: jsx_runtime_1.jsx(sidebar_1.SidebarContextProvider, { children: jsx_runtime_1.jsx(folders_1.FolderContextProvider, { children: jsx_runtime_1.jsx(highest_z_index_1.HighestZIndexProvider, { children: jsx_runtime_1.jsx(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: jsx_runtime_1.jsx(ExpandedTracksProvider_1.ExpandedTracksProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })
32
+ jsx_runtime_1.jsx(ClientRenderQueueProcessor_1.ClientRenderQueueProcessor, {}), jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(CheckerboardProvider_1.CheckerboardProvider, { children: jsx_runtime_1.jsx(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: jsx_runtime_1.jsx(ShowPixelGridProvider_1.ShowPixelGridProvider, { children: jsx_runtime_1.jsx(ShowRulersProvider_1.ShowRulersProvider, { children: jsx_runtime_1.jsx(ShowGuidesProvider_1.ShowGuidesProvider, { children: jsx_runtime_1.jsx(ShowOutlinesProvider_1.ShowOutlinesProvider, { children: jsx_runtime_1.jsx(SnappingProvider_1.SnappingProvider, { children: jsx_runtime_1.jsx(preview_size_1.PreviewSizeProvider, { children: jsx_runtime_1.jsx(ModalsProvider_1.ModalsProvider, { children: jsx_runtime_1.jsx(MediaVolumeProvider_1.MediaVolumeProvider, { children: jsx_runtime_1.jsx(player_1.PlayerInternals.PlayerEmitterProvider, { currentPlaybackRate: null, children: jsx_runtime_1.jsx(sidebar_1.SidebarContextProvider, { children: jsx_runtime_1.jsx(folders_1.FolderContextProvider, { children: jsx_runtime_1.jsx(highest_z_index_1.HighestZIndexProvider, { children: jsx_runtime_1.jsx(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: jsx_runtime_1.jsx(ExpandedTracksProvider_1.ExpandedTracksProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })
32
33
  ] })
33
34
  ] }) }) }) }));
34
35
  };
@@ -12,6 +12,7 @@ interface RulerProps {
12
12
  readonly markingGaps: number;
13
13
  readonly orientation: 'horizontal' | 'vertical';
14
14
  readonly size: Size;
15
+ readonly canCreateGuides: boolean;
15
16
  readonly onPointerSessionStart: (event: React.PointerEvent<HTMLCanvasElement>, guideId: string) => void;
16
17
  }
17
18
  declare const Ruler: React.FC<RulerProps>;
@@ -14,7 +14,7 @@ const TimelineSelection_1 = require("../Timeline/TimelineSelection");
14
14
  const makeGuideId = () => {
15
15
  return Math.random().toString(36).substring(7);
16
16
  };
17
- const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, orientation, onPointerSessionStart, }) => {
17
+ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, orientation, canCreateGuides, onPointerSessionStart, }) => {
18
18
  const rulerCanvasRef = (0, react_1.useRef)(null);
19
19
  const isVerticalRuler = orientation === 'vertical';
20
20
  const { shouldCreateGuideRef, setGuidesList, draggingGuideId, hoveredGuideId, setDraggingGuideId, guidesList, setEditorShowGuides, } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
@@ -23,7 +23,8 @@ 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 = isVerticalRuler ? 'ew-resize' : 'ns-resize';
26
+ const guideCursor = isVerticalRuler ? 'ew-resize' : 'ns-resize';
27
+ const cursor = canCreateGuides ? guideCursor : 'default';
27
28
  const guideHighlight = (0, react_1.useMemo)(() => (0, editor_guide_selection_1.getRulerGuideHighlight)({
28
29
  guidesList,
29
30
  selectedItems,
@@ -66,19 +67,18 @@ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, o
66
67
  height: rulerHeight,
67
68
  left: isVerticalRuler ? 0 : 'unset',
68
69
  top: isVerticalRuler ? 'unset' : 0,
69
- borderBottom: isVerticalRuler ? undefined : '1px solid ' + colors_1.RULER_COLOR,
70
- borderRight: isVerticalRuler ? '1px solid ' + colors_1.RULER_COLOR : undefined,
70
+ boxShadow: colors_1.SHADOW_BLACK,
71
71
  cursor,
72
72
  }), [rulerWidth, rulerHeight, cursor, isVerticalRuler]);
73
73
  const onPointerDown = (0, react_1.useCallback)((e) => {
74
- if (e.button !== 0) {
74
+ if (!canCreateGuides || e.button !== 0) {
75
75
  return;
76
76
  }
77
77
  e.preventDefault();
78
78
  // Prevent deselection of currently selected items
79
79
  e.stopPropagation();
80
80
  shouldCreateGuideRef.current = true;
81
- (0, ForceSpecificCursor_1.forceSpecificCursor)(cursor);
81
+ (0, ForceSpecificCursor_1.forceSpecificCursor)(guideCursor);
82
82
  const guideId = makeGuideId();
83
83
  setEditorShowGuides(() => true);
84
84
  setDraggingGuideId(() => guideId);
@@ -103,9 +103,10 @@ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, o
103
103
  orientation,
104
104
  originOffset,
105
105
  unsafeVideoConfig.id,
106
- cursor,
106
+ guideCursor,
107
107
  onPointerSessionStart,
108
+ canCreateGuides,
108
109
  ]);
109
- 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 }));
110
+ return (jsx_runtime_1.jsx("canvas", { ref: rulerCanvasRef, width: rulerWidth * window.devicePixelRatio, height: rulerHeight * window.devicePixelRatio, style: rulerStyle, "aria-label": `${isVerticalRuler ? 'Vertical' : 'Horizontal'} ruler`, "aria-readonly": !canCreateGuides, [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', onPointerDown: onPointerDown }));
110
111
  };
111
112
  exports.default = Ruler;
@@ -7,4 +7,5 @@ export declare const EditorRulers: React.FC<{
7
7
  readonly contentDimensions: Dimensions | 'none' | null;
8
8
  readonly assetMetadata: AssetMetadata | null;
9
9
  readonly containerRef: React.RefObject<HTMLDivElement | null>;
10
+ readonly canCreateGuides: boolean;
10
11
  }>;
@@ -19,13 +19,12 @@ const originBlockStyles = {
19
19
  position: 'absolute',
20
20
  top: 0,
21
21
  left: 0,
22
- borderBottom: '1px solid ' + colors_1.RULER_COLOR,
23
- borderRight: '1px solid ' + colors_1.RULER_COLOR,
22
+ boxShadow: `inset -1px -1px 0 ${colors_1.WHITE_ALPHA_15}`,
24
23
  width: `${editor_rulers_1.RULER_WIDTH}px`,
25
24
  height: `${editor_rulers_1.RULER_WIDTH}px`,
26
25
  background: colors_1.BACKGROUND,
27
26
  };
28
- const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef }) => {
27
+ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef, canCreateGuides, }) => {
29
28
  const { scale, canvasPosition } = (0, use_studio_canvas_dimensions_1.useStudioCanvasDimensions)({
30
29
  canvasSize,
31
30
  contentDimensions,
@@ -176,7 +175,7 @@ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerR
176
175
  });
177
176
  }, [finishGuideInteraction, onMouseMove]);
178
177
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
179
- jsx_runtime_1.jsx("div", { style: originBlockStyles }), jsx_runtime_1.jsx(Ruler_1.default, { orientation: "horizontal", scale: scale, points: horizontalRulerPoints, startMarking: horizontalRulerStartMarking, markingGaps: rulerMarkingGaps, originOffset: canvasPosition.left, size: canvasSize, onPointerSessionStart: onPointerSessionStart }), jsx_runtime_1.jsx(Ruler_1.default, { orientation: "vertical", scale: scale, points: verticalRulerPoints, startMarking: verticalRulerStartMarking, markingGaps: rulerMarkingGaps, originOffset: canvasPosition.top, size: canvasSize, onPointerSessionStart: onPointerSessionStart })
178
+ jsx_runtime_1.jsx(Ruler_1.default, { canCreateGuides: canCreateGuides, orientation: "horizontal", scale: scale, points: horizontalRulerPoints, startMarking: horizontalRulerStartMarking, markingGaps: rulerMarkingGaps, originOffset: canvasPosition.left, size: canvasSize, onPointerSessionStart: onPointerSessionStart }), jsx_runtime_1.jsx(Ruler_1.default, { canCreateGuides: canCreateGuides, orientation: "vertical", scale: scale, points: verticalRulerPoints, startMarking: verticalRulerStartMarking, markingGaps: rulerMarkingGaps, originOffset: canvasPosition.top, size: canvasSize, onPointerSessionStart: onPointerSessionStart }), jsx_runtime_1.jsx("div", { style: originBlockStyles })
180
179
  ] }));
181
180
  };
182
181
  exports.EditorRulers = EditorRulers;