@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
@@ -1 +1 @@
1
- export declare const useIsRulerVisible: () => boolean | null;
1
+ export declare const useIsRulerVisible: () => boolean;
@@ -3,10 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useIsRulerVisible = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
+ const get_preview_file_type_1 = require("../../helpers/get-preview-file-type");
6
7
  const editor_rulers_1 = require("../../state/editor-rulers");
7
8
  const useIsRulerVisible = () => {
8
- const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
9
+ const { canvasContent, currentAssetMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
9
10
  const { editorShowRulers } = (0, react_1.useContext)(editor_rulers_1.EditorShowRulersContext);
10
- return (editorShowRulers && canvasContent && canvasContent.type === 'composition');
11
+ return (editorShowRulers &&
12
+ canvasContent !== null &&
13
+ (canvasContent.type === 'composition' ||
14
+ (canvasContent.type === 'asset' &&
15
+ (0, get_preview_file_type_1.getPreviewFileType)(canvasContent.asset) === 'video' &&
16
+ (currentAssetMetadata === null || currentAssetMetadata === void 0 ? void 0 : currentAssetMetadata.asset) === canvasContent.asset)));
11
17
  };
12
18
  exports.useIsRulerVisible = useIsRulerVisible;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const ElementLibraryModal: React.FC<{
3
+ readonly name: string;
4
+ readonly url: string;
5
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ElementLibraryModal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const ModalContainer_1 = require("./ModalContainer");
7
+ const ModalHeader_1 = require("./ModalHeader");
8
+ const DismissableModal_1 = require("./NewComposition/DismissableModal");
9
+ const panelStyle = {
10
+ display: 'flex',
11
+ flexDirection: 'column',
12
+ height: (0, ModalContainer_1.getMaxModalHeight)(1000),
13
+ overflow: 'hidden',
14
+ width: (0, ModalContainer_1.getMaxModalWidth)(1400),
15
+ };
16
+ const iframeStyle = {
17
+ border: 0,
18
+ flex: 1,
19
+ minHeight: 0,
20
+ width: '100%',
21
+ };
22
+ const ElementLibraryModal = ({ name, url }) => {
23
+ const iframeRef = (0, react_1.useRef)(null);
24
+ (0, react_1.useLayoutEffect)(() => {
25
+ const iframe = iframeRef.current;
26
+ if (iframe === null) {
27
+ return;
28
+ }
29
+ // Studio is cross-origin isolated. A credentialless iframe may embed a
30
+ // library that does not set Cross-Origin-Resource-Policy headers.
31
+ iframe.setAttribute('credentialless', '');
32
+ iframe.src = url;
33
+ }, [url]);
34
+ return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
35
+ jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: name }), jsx_runtime_1.jsx("iframe", { ref: iframeRef, allow: "local-network-access; loopback-network", style: iframeStyle, title: `${name} library` })
36
+ ] }));
37
+ };
38
+ exports.ElementLibraryModal = ElementLibraryModal;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilePreview = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
+ const react_1 = require("react");
6
7
  const colors_1 = require("../helpers/colors");
7
8
  const JSONViewer_1 = require("./JSONViewer");
8
9
  const layout_1 = require("./layout");
@@ -14,6 +15,73 @@ const msgStyle = {
14
15
  display: 'flex',
15
16
  justifyContent: 'center',
16
17
  };
18
+ const fontPreviewContainerStyle = {
19
+ display: 'flex',
20
+ flex: 1,
21
+ flexDirection: 'column',
22
+ justifyContent: 'center',
23
+ overflow: 'hidden',
24
+ padding: 40,
25
+ textAlign: 'center',
26
+ };
27
+ const fontPreviewLargeTextStyle = {
28
+ color: colors_1.WHITE,
29
+ fontSize: 'clamp(80px, 18vh, 180px)',
30
+ lineHeight: 1,
31
+ };
32
+ const fontPreviewTextStyle = {
33
+ color: colors_1.LIGHT_TEXT,
34
+ fontSize: 'clamp(18px, 4vh, 40px)',
35
+ lineHeight: 1.35,
36
+ marginTop: 32,
37
+ wordBreak: 'break-word',
38
+ };
39
+ let fontPreviewId = 0;
40
+ const FontPreview = ({ src }) => {
41
+ const [fontFamily] = (0, react_1.useState)(() => {
42
+ fontPreviewId++;
43
+ return `RemotionStudioFontPreview${fontPreviewId}`;
44
+ });
45
+ const [fontLoaded, setFontLoaded] = (0, react_1.useState)(false);
46
+ const [fontLoadFailed, setFontLoadFailed] = (0, react_1.useState)(false);
47
+ (0, react_1.useEffect)(() => {
48
+ let cancelled = false;
49
+ const fontFace = new FontFace(fontFamily, `url(${JSON.stringify(src)})`);
50
+ setFontLoaded(false);
51
+ setFontLoadFailed(false);
52
+ fontFace
53
+ .load()
54
+ .then((loadedFontFace) => {
55
+ if (cancelled) {
56
+ return;
57
+ }
58
+ document.fonts.add(loadedFontFace);
59
+ setFontLoaded(true);
60
+ })
61
+ .catch(() => {
62
+ if (!cancelled) {
63
+ setFontLoadFailed(true);
64
+ }
65
+ });
66
+ return () => {
67
+ cancelled = true;
68
+ document.fonts.delete(fontFace);
69
+ };
70
+ }, [fontFamily, src]);
71
+ if (fontLoadFailed) {
72
+ return jsx_runtime_1.jsx("div", { style: msgStyle, children: "Could not preview font" });
73
+ }
74
+ if (!fontLoaded) {
75
+ return jsx_runtime_1.jsx("div", { style: msgStyle, children: "Loading font preview..." });
76
+ }
77
+ return (jsx_runtime_1.jsxs("div", { style: { ...fontPreviewContainerStyle, fontFamily }, children: [
78
+ jsx_runtime_1.jsx("div", { style: fontPreviewLargeTextStyle, children: "Aa" }), jsx_runtime_1.jsxs("div", { style: fontPreviewTextStyle, children: ["ABCDEFGHIJKLMNOPQRSTUVWXYZ",
79
+ jsx_runtime_1.jsx("br", {}),
80
+ "abcdefghijklmnopqrstuvwxyz",
81
+ jsx_runtime_1.jsx("br", {}),
82
+ "0123456789"] })
83
+ ] }));
84
+ };
17
85
  const FilePreview = ({ fileType, src, currentAsset, assetMetadata }) => {
18
86
  if (!assetMetadata) {
19
87
  throw new Error('expected to have assetMetadata');
@@ -33,6 +101,9 @@ const FilePreview = ({ fileType, src, currentAsset, assetMetadata }) => {
33
101
  if (fileType === 'image') {
34
102
  return jsx_runtime_1.jsx("img", { src: src });
35
103
  }
104
+ if (fileType === 'font') {
105
+ return jsx_runtime_1.jsx(FontPreview, { src: src });
106
+ }
36
107
  if (fileType === 'json') {
37
108
  return jsx_runtime_1.jsx(JSONViewer_1.JSONViewer, { src: src });
38
109
  }
@@ -59,7 +59,7 @@ const inspectorTitleWrapper = {
59
59
  ...titleWrapper,
60
60
  fontFamily: 'sans-serif',
61
61
  fontSize: 13,
62
- height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
62
+ height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
63
63
  margin: '0 4px',
64
64
  width: 'calc(100% - 8px)',
65
65
  };
@@ -68,7 +68,7 @@ const inspectorTitleInner = {
68
68
  alignItems: 'center',
69
69
  fontFamily: 'sans-serif',
70
70
  fontSize: 13,
71
- height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
71
+ height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
72
72
  paddingBottom: 0,
73
73
  paddingLeft: InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4,
74
74
  paddingRight: InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4,
@@ -5,10 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
7
7
  const client_id_1 = require("../../helpers/client-id");
8
- const colors_1 = require("../../helpers/colors");
9
8
  const download_blob_1 = require("../../helpers/download-blob");
10
9
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
11
- const browse_elements_1 = require("../../icons/browse-elements");
12
10
  const cloud_download_1 = require("../../icons/cloud-download");
13
11
  const frame_1 = require("../../icons/frame");
14
12
  const solid_1 = require("../../icons/solid");
@@ -28,29 +26,13 @@ const VisualControlsContent_1 = require("../VisualControls/VisualControlsContent
28
26
  const common_1 = require("./common");
29
27
  const CompositionInspectorHeader_1 = require("./CompositionInspectorHeader");
30
28
  const CompositionMetadata_1 = require("./CompositionMetadata");
29
+ const ElementLibraryButton_1 = require("./ElementLibraryButton");
31
30
  const styles_1 = require("./styles");
32
31
  const use_composition_actions_1 = require("./use-composition-actions");
33
32
  const actionIconStyle = {
34
33
  height: 18,
35
34
  width: 18,
36
35
  };
37
- const browseElementsIconStyle = {
38
- height: 22,
39
- width: 22,
40
- };
41
- const browseElementsIconContainerStyle = {
42
- height: 22,
43
- marginLeft: -2,
44
- marginRight: -2,
45
- width: 22,
46
- };
47
- const browseElementsArrowStyle = {
48
- display: 'inline-block',
49
- height: 12,
50
- marginLeft: 4,
51
- verticalAlign: -2,
52
- width: 12,
53
- };
54
36
  const CompositionActions = () => {
55
37
  var _a;
56
38
  var _b;
@@ -69,18 +51,13 @@ const CompositionActions = () => {
69
51
  (0, NotificationCenter_1.showNotification)(`Could not download project: ${error instanceof Error ? error.message : String(error)}`, 2000);
70
52
  }
71
53
  }, [downloadProject]);
72
- const openElementsLibrary = (0, react_1.useCallback)(() => {
73
- window.open('https://www.remotion.dev/elements', '_blank', 'noopener,noreferrer');
74
- }, []);
75
54
  if (!canShowInsertAsset &&
76
55
  !canShowInsertComposition &&
77
56
  !canShowInsertSolid &&
78
57
  downloadProject === null) {
79
58
  return null;
80
59
  }
81
- return (jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.", children: ["Browse Elements",
82
- jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: browseElementsArrowStyle, 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" }) })
83
- ] })) : null, downloadProject ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, onClick: onDownloadProject, renderIcon: (color) => (jsx_runtime_1.jsx(cloud_download_1.CloudDownloadIcon, { color: color, style: actionIconStyle })), children: "Download project" })) : null] }));
60
+ return (jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? jsx_runtime_1.jsx(ElementLibraryButton_1.ElementLibraryButton, {}) : null, downloadProject ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, onClick: onDownloadProject, renderIcon: (color) => (jsx_runtime_1.jsx(cloud_download_1.CloudDownloadIcon, { color: color, style: actionIconStyle })), children: "Download project" })) : null] }));
84
61
  };
85
62
  const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
86
63
  var _a;
@@ -138,14 +115,12 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, read
138
115
  if (readOnlyStudio || !canShowDefaultPropsSection) {
139
116
  return null;
140
117
  }
141
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
142
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsxs("div", { style: styles_1.compositionDefaultPropsSection, children: [
143
- jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
144
- jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderStart, children: [
145
- jsx_runtime_1.jsx("span", { style: styles_1.sectionHeaderTitle, children: "Default Props" }), jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: defaultPropsModeItems, needsWrapping: false, size: "compact" })
146
- ] }), jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: defaultPropsWarnings.length > 0 ? (jsx_runtime_1.jsx(WarningIndicatorButton_1.WarningIndicatorButton, { setShowWarning: setShowWarning, showWarning: showWarning, warningCount: defaultPropsWarnings.length, size: "compact" })) : null })
147
- ] }) }), defaultPropsWarnings.length > 0 && showWarning ? (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningContainer, children: jsx_runtime_1.jsx(common_1.InspectorDefaultPropsWarnings, { warnings: defaultPropsWarnings }) })) : null, jsx_runtime_1.jsx(DefaultPropsEditor_1.DefaultPropsEditor, { unresolvedComposition: composition, defaultProps: currentDefaultProps, setDefaultProps: setDefaultProps, propsEditType: "default-props", schemaErrorMode: "compact", layout: "inspector", mode: defaultPropsMode, onModeChange: setDefaultPropsMode, hideModeControls: canShowDefaultPropsSection, warnings: defaultPropsWarnings, showWarning: false, setShowWarning: setShowWarning, hideWarningButton: true }, composition.id)
148
- ] })
118
+ return (jsx_runtime_1.jsxs("div", { style: styles_1.compositionDefaultPropsSection, children: [
119
+ jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
120
+ jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderStart, children: [
121
+ jsx_runtime_1.jsx("span", { style: styles_1.sectionHeaderTitle, children: "Default Props" }), jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: defaultPropsModeItems, needsWrapping: false, size: "compact" })
122
+ ] }), jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: defaultPropsWarnings.length > 0 ? (jsx_runtime_1.jsx(WarningIndicatorButton_1.WarningIndicatorButton, { setShowWarning: setShowWarning, showWarning: showWarning, warningCount: defaultPropsWarnings.length, size: "compact" })) : null })
123
+ ] }) }), defaultPropsWarnings.length > 0 && showWarning ? (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningContainer, children: jsx_runtime_1.jsx(common_1.InspectorDefaultPropsWarnings, { warnings: defaultPropsWarnings }) })) : null, jsx_runtime_1.jsx(DefaultPropsEditor_1.DefaultPropsEditor, { unresolvedComposition: composition, defaultProps: currentDefaultProps, setDefaultProps: setDefaultProps, propsEditType: "default-props", schemaErrorMode: "compact", layout: "inspector", mode: defaultPropsMode, onModeChange: setDefaultPropsMode, hideModeControls: canShowDefaultPropsSection, warnings: defaultPropsWarnings, showWarning: false, setShowWarning: setShowWarning, hideWarningButton: true }, composition.id)
149
124
  ] }));
150
125
  };
151
126
  const CompositionVisualControlsSection = ({ readOnlyStudio }) => {
@@ -156,17 +131,15 @@ const CompositionVisualControlsSection = ({ readOnlyStudio }) => {
156
131
  if (!hasVisualControls) {
157
132
  return null;
158
133
  }
159
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
160
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsxs("div", { style: styles_1.compositionVisualControlsSection, children: [
161
- jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Visual Controls" }), jsx_runtime_1.jsx(VisualControlsContent_1.VisualControlsContent, {})
162
- ] })
134
+ return (jsx_runtime_1.jsxs("div", { style: styles_1.compositionVisualControlsSection, children: [
135
+ jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Visual Controls" }), jsx_runtime_1.jsx(VisualControlsContent_1.VisualControlsContent, {})
163
136
  ] }));
164
137
  };
165
138
  const CompositionInspector = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
166
139
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
167
140
  return (jsx_runtime_1.jsxs("div", { style: styles_1.scrollableContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
168
141
  jsx_runtime_1.jsxs("div", { style: styles_1.inspectorOverviewSection, children: [
169
- jsx_runtime_1.jsx(CompositionInspectorHeader_1.CompositionInspectorHeader, {}), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(CompositionMetadata_1.CompositionMetadata, { compositionId: composition.id, disabled: readOnlyStudio || previewServerState.type !== 'connected', stack: composition.stack })
142
+ jsx_runtime_1.jsx(CompositionInspectorHeader_1.CompositionInspectorHeader, {}), jsx_runtime_1.jsx(CompositionMetadata_1.CompositionMetadata, { compositionId: composition.id, disabled: readOnlyStudio || previewServerState.type !== 'connected', stack: composition.stack })
170
143
  ] }), jsx_runtime_1.jsx(CompositionDefaultPropsSection, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps }), jsx_runtime_1.jsx(CompositionVisualControlsSection, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CompositionActions, {})
171
144
  ] }));
172
145
  };
@@ -18,7 +18,7 @@ const layout_1 = require("../layout");
18
18
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
19
19
  const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
20
20
  const use_default_editor_info_1 = require("../use-default-editor-info");
21
- const COMPOSITION_INSPECTOR_HEADER_HEIGHT = 66;
21
+ const COMPOSITION_INSPECTOR_HEADER_HEIGHT = layout_1.COMPACT_CONTROL_ROW_HEIGHT * 3;
22
22
  const sourceLocationIconStyle = {
23
23
  flexShrink: 0,
24
24
  height: 18,
@@ -26,7 +26,7 @@ const sourceLocationIconStyle = {
26
26
  };
27
27
  const componentLocationPlaceholder = {
28
28
  flexShrink: 0,
29
- height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
29
+ height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
30
30
  };
31
31
  const renderReactIcon = (color) => {
32
32
  return jsx_runtime_1.jsx(react_2.ReactIcon, { color: color, style: sourceLocationIconStyle });
@@ -39,23 +39,30 @@ const computedValueStyle = {
39
39
  fontStyle: 'italic',
40
40
  lineHeight: '20px',
41
41
  };
42
+ const metadataFormatterStyle = {
43
+ fontSize: 13,
44
+ };
42
45
  const metadataDraggerStyles = {
43
46
  durationInFrames: {
47
+ fontSize: 13,
44
48
  padding: '2px 0 2px 6px',
45
49
  textAlign: 'right',
46
- width: 92,
50
+ width: 104,
47
51
  },
48
52
  fps: {
53
+ fontSize: 13,
49
54
  padding: '2px 0 2px 6px',
50
55
  textAlign: 'right',
51
56
  width: 72,
52
57
  },
53
58
  height: {
59
+ fontSize: 13,
54
60
  padding: '2px 0 2px 6px',
55
61
  textAlign: 'right',
56
62
  width: 52,
57
63
  },
58
64
  width: {
65
+ fontSize: 13,
59
66
  padding: '2px 0 2px 6px',
60
67
  textAlign: 'right',
61
68
  width: 52,
@@ -115,7 +122,7 @@ const dimensionPresets = [
115
122
  const frameRatePresets = [23.976, 24, 25, 29.97, 30, 50, 60];
116
123
  const PresetDropdown = ({ disabled, title, values, visible }) => {
117
124
  const renderAction = (0, react_1.useCallback)((color) => {
118
- return (jsx_runtime_1.jsx("span", { style: presetButtonIcon, children: jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true }) }));
125
+ return (jsx_runtime_1.jsx("span", { style: presetButtonIcon, children: jsx_runtime_1.jsx(caret_1.CaretDown, { color: color }) }));
119
126
  }, []);
120
127
  return (jsx_runtime_1.jsx("div", { style: {
121
128
  ...presetDropdownContainer,
@@ -146,7 +153,7 @@ const CompositionMetadataValue = ({ computed, disabled, field, onSave, pendingVa
146
153
  }
147
154
  return String(roundedValue);
148
155
  }, [field]);
149
- return computed ? (jsx_runtime_1.jsx("span", { style: computedContainerStyle, children: jsx_runtime_1.jsx("span", { style: computedValueStyle, children: formatValue(value) }) })) : disabled ? (formatValue(value)) : (jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": fieldLabels[field], buttonStyle: metadataDraggerStyles[field], type: "number", value: (_a = dragValue !== null && dragValue !== void 0 ? dragValue : pendingValue === null || pendingValue === void 0 ? void 0 : pendingValue.value) !== null && _a !== void 0 ? _a : value, disabled: pendingValue !== null, status: "ok", onValueChange: setDragValue, onValueChangeEnd: save, onTextChange: () => undefined, min: isFps ? 0.01 : 1, step: isFps ? 0.01 : 1, dragDecimalPlaces: isFps ? 2 : 0, formatter: formatValue, rightAlign: true, style: metadataDraggerStyles[field] }));
156
+ return computed || disabled ? (jsx_runtime_1.jsx("span", { style: computedContainerStyle, children: jsx_runtime_1.jsx("span", { style: computedValueStyle, children: formatValue(value) }) })) : (jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": fieldLabels[field], buttonStyle: metadataDraggerStyles[field], type: "number", value: (_a = dragValue !== null && dragValue !== void 0 ? dragValue : pendingValue === null || pendingValue === void 0 ? void 0 : pendingValue.value) !== null && _a !== void 0 ? _a : value, disabled: pendingValue !== null, status: "ok", onValueChange: setDragValue, onValueChangeEnd: save, onTextChange: () => undefined, min: isFps ? 0.01 : 1, step: isFps ? 0.01 : 1, dragDecimalPlaces: isFps ? 2 : 0, formatter: formatValue, formatterStyle: metadataFormatterStyle, rightAlign: true, style: metadataDraggerStyles[field] }));
150
157
  };
151
158
  const CompositionMetadata = ({ compositionId, disabled, stack }) => {
152
159
  var _a, _b, _c, _d;
@@ -310,7 +317,7 @@ const CompositionMetadata = ({ compositionId, disabled, stack }) => {
310
317
  return (jsx_runtime_1.jsxs("div", { style: compositionMetadataContainer, children: [jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: (hovered) => (jsx_runtime_1.jsxs("div", { style: metadataLabelControls, children: [
311
318
  jsx_runtime_1.jsx("span", { style: metadataLabelText, children: "Dimensions" }), disabled || widthIsComputed || heightIsComputed ? null : (jsx_runtime_1.jsx(PresetDropdown, { disabled: pendingValues.width !== undefined ||
312
319
  pendingValues.height !== undefined, title: "Choose dimension preset", values: dimensionPresetValues, visible: hovered }))] })), children: jsx_runtime_1.jsxs("div", { style: dimensionsControls, children: [
313
- jsx_runtime_1.jsx(CompositionMetadataValue, { computed: widthIsComputed, disabled: disabled, field: "width", onSave: saveMetadata, pendingValue: (_a = pendingValues.width) !== null && _a !== void 0 ? _a : null, value: video.width }), disabled ? '\u00A0' : null, jsx_runtime_1.jsx(CompositionMetadataValue, { computed: heightIsComputed, disabled: disabled, field: "height", onSave: saveMetadata, pendingValue: (_b = pendingValues.height) !== null && _b !== void 0 ? _b : null, value: video.height })
320
+ jsx_runtime_1.jsx(CompositionMetadataValue, { computed: widthIsComputed, disabled: disabled, field: "width", onSave: saveMetadata, pendingValue: (_a = pendingValues.width) !== null && _a !== void 0 ? _a : null, value: video.width }), jsx_runtime_1.jsx(CompositionMetadataValue, { computed: heightIsComputed, disabled: disabled, field: "height", onSave: saveMetadata, pendingValue: (_b = pendingValues.height) !== null && _b !== void 0 ? _b : null, value: video.height })
314
321
  ] }) }), isStill ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: (hovered) => (jsx_runtime_1.jsxs("div", { style: metadataLabelControls, children: [
315
322
  jsx_runtime_1.jsx("span", { style: metadataLabelText, children: "Frame rate" }), disabled || fpsIsComputed ? null : (jsx_runtime_1.jsx(PresetDropdown, { disabled: pendingValues.fps !== undefined, title: "Choose frame rate preset", values: frameRatePresetValues, visible: hovered }))] })), children: jsx_runtime_1.jsx("div", { style: dimensionsControls, children: jsx_runtime_1.jsx(CompositionMetadataValue, { computed: fpsIsComputed, disabled: disabled, field: "fps", onSave: saveMetadata, pendingValue: (_c = pendingValues.fps) !== null && _c !== void 0 ? _c : null, value: video.fps }) }) }), jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Duration", children: jsx_runtime_1.jsx(CompositionMetadataValue, { computed: durationIsComputed, disabled: disabled, field: "durationInFrames", onSave: saveMetadata, pendingValue: (_d = pendingValues.durationInFrames) !== null && _d !== void 0 ? _d : null, value: video.durationInFrames }) })
316
323
  ] }))] }));
@@ -206,7 +206,7 @@ const EasingInspector = ({ selection }) => {
206
206
  easingKeyframeDisplayOffset,
207
207
  ]);
208
208
  const renderHeader = (0, react_1.useCallback)(() => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
209
- jsx_runtime_1.jsx(common_1.InspectorBackAction, { disabled: parentSelection === null, onClick: onSelectParent, title: "Back to property", children: fieldLabel }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), easingUpdate === null || track === null ? null : (jsx_runtime_1.jsx(KeyframeEasingNavigator_1.KeyframeEasingNavigator, { currentSelection: currentEasingSelection !== null && currentEasingSelection !== void 0 ? currentEasingSelection : selection, includeEasings: true, keyframes: easingUpdate.propStatus.keyframes.map((keyframe) => ({
209
+ jsx_runtime_1.jsx(common_1.InspectorBackAction, { disabled: parentSelection === null, onClick: onSelectParent, title: "Back to property", children: fieldLabel }), easingUpdate === null || track === null ? null : (jsx_runtime_1.jsx(KeyframeEasingNavigator_1.KeyframeEasingNavigator, { currentSelection: currentEasingSelection !== null && currentEasingSelection !== void 0 ? currentEasingSelection : selection, includeEasings: true, keyframes: easingUpdate.propStatus.keyframes.map((keyframe) => ({
210
210
  ...keyframe,
211
211
  frame: keyframe.frame + easingKeyframeDisplayOffset,
212
212
  })), nodePathInfo: selection.nodePathInfo }))] })), [
@@ -226,6 +226,6 @@ const EasingInspector = ({ selection }) => {
226
226
  return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Easing unavailable" });
227
227
  }
228
228
  return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
229
- jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsx(common_1.InspectorQuickActionsSection, { children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })) : null] }));
229
+ jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsx(common_1.InspectorQuickActionsSection, { children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })) : null] }));
230
230
  };
231
231
  exports.EasingInspector = EasingInspector;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ElementLibraryButton: React.FC;
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ElementLibraryButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
7
+ const colors_1 = require("../../helpers/colors");
8
+ const browse_elements_1 = require("../../icons/browse-elements");
9
+ const caret_1 = require("../../icons/caret");
10
+ const modals_1 = require("../../state/modals");
11
+ const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
12
+ const SegmentedButton_1 = require("../SegmentedButton");
13
+ const SettingsContext_1 = require("../SettingsContext");
14
+ const common_1 = require("./common");
15
+ const noElementLibraries = [];
16
+ const browseElementsIconStyle = {
17
+ height: 22,
18
+ width: 22,
19
+ };
20
+ const browseElementsIconContainerStyle = {
21
+ height: 22,
22
+ marginLeft: -2,
23
+ marginRight: -2,
24
+ width: 22,
25
+ };
26
+ const browseElementsArrowStyle = {
27
+ display: 'inline-block',
28
+ height: 12,
29
+ marginLeft: 4,
30
+ verticalAlign: -2,
31
+ width: 12,
32
+ };
33
+ const elementLibraryDropdownStyle = {
34
+ borderRadius: 4,
35
+ height: 28,
36
+ margin: '0 4px',
37
+ width: 'calc(100% - 8px)',
38
+ };
39
+ const elementLibraryDropdownSegmentStyle = {
40
+ fontSize: 13,
41
+ gap: 8,
42
+ justifyContent: 'flex-start',
43
+ padding: `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4}px`,
44
+ width: '100%',
45
+ };
46
+ const elementLibraryDropdownLabelStyle = {
47
+ flex: 1,
48
+ fontFamily: 'sans-serif',
49
+ fontSize: 13,
50
+ lineHeight: '18px',
51
+ minWidth: 0,
52
+ overflow: 'hidden',
53
+ textAlign: 'left',
54
+ textOverflow: 'ellipsis',
55
+ whiteSpace: 'nowrap',
56
+ };
57
+ const elementLibraryDropdownCaretStyle = {
58
+ display: 'flex',
59
+ height: 12,
60
+ width: 12,
61
+ };
62
+ const ElementLibraryButton = () => {
63
+ var _a;
64
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
65
+ const { studioRuntimeConfig } = (0, SettingsContext_1.useSettings)();
66
+ const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
67
+ const elementLibraries = (_a = studioRuntimeConfig === null || studioRuntimeConfig === void 0 ? void 0 : studioRuntimeConfig.elementLibraries) !== null && _a !== void 0 ? _a : noElementLibraries;
68
+ const openElementLibrary = (0, react_1.useCallback)((name, url) => {
69
+ if (isBrowserStudio) {
70
+ window.open(url, '_blank', 'noopener,noreferrer');
71
+ return;
72
+ }
73
+ setSelectedModal({
74
+ type: 'element-library',
75
+ name,
76
+ url,
77
+ });
78
+ }, [isBrowserStudio, setSelectedModal]);
79
+ const openElementsLibrary = (0, react_1.useCallback)(() => {
80
+ openElementLibrary('Remotion Elements', 'https://www.remotion.dev/elements');
81
+ }, [openElementLibrary]);
82
+ const elementLibraryDropdownSegments = (0, react_1.useMemo)(() => [
83
+ {
84
+ ariaLabel: 'Browse Elements',
85
+ buttonId: null,
86
+ disabled: false,
87
+ idleColor: colors_1.LIGHT_TEXT,
88
+ leaveLeftSpace: false,
89
+ onOpenChange: null,
90
+ renderContent: (color) => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
91
+ jsx_runtime_1.jsx("span", { style: browseElementsIconContainerStyle, children: jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle }) }), jsx_runtime_1.jsx("span", { style: elementLibraryDropdownLabelStyle, children: "Browse Elements" }), jsx_runtime_1.jsx("span", { style: elementLibraryDropdownCaretStyle, children: jsx_runtime_1.jsx(caret_1.CaretDown, { color: color }) })
92
+ ] })),
93
+ segmentId: 'element-library',
94
+ selectedId: null,
95
+ style: elementLibraryDropdownSegmentStyle,
96
+ title: 'Choose an Element library to browse inside Studio.',
97
+ type: 'menu',
98
+ values: [
99
+ {
100
+ disabled: false,
101
+ id: 'remotion-elements',
102
+ keyHint: null,
103
+ label: 'Remotion Elements',
104
+ leftItem: null,
105
+ onClick: openElementsLibrary,
106
+ quickSwitcherLabel: null,
107
+ subMenu: null,
108
+ type: 'item',
109
+ value: 'https://www.remotion.dev/elements',
110
+ },
111
+ ...elementLibraries.map((library, index) => {
112
+ var _a;
113
+ const parsedUrl = new URL(library.url);
114
+ const pathname = parsedUrl.pathname.replace(/\/$/, '');
115
+ const label = (_a = library.displayName) !== null && _a !== void 0 ? _a : `${parsedUrl.host}${pathname}`;
116
+ return {
117
+ disabled: false,
118
+ id: `external-element-library-${index}`,
119
+ keyHint: null,
120
+ label,
121
+ leftItem: null,
122
+ onClick: () => openElementLibrary(label, library.url),
123
+ quickSwitcherLabel: null,
124
+ subMenu: null,
125
+ type: 'item',
126
+ value: library.url,
127
+ };
128
+ }),
129
+ ],
130
+ },
131
+ ], [elementLibraries, openElementLibrary, openElementsLibrary]);
132
+ if (elementLibraries.length > 0 && !isBrowserStudio) {
133
+ return (jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: elementLibraryDropdownSegments, style: elementLibraryDropdownStyle, title: null }));
134
+ }
135
+ return (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: isBrowserStudio
136
+ ? 'Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.'
137
+ : 'Browse the Remotion Elements library inside Studio.', children: ["Browse Elements", isBrowserStudio ? (jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: browseElementsArrowStyle, 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" }) })) : null] }));
138
+ };
139
+ exports.ElementLibraryButton = ElementLibraryButton;
@@ -338,7 +338,7 @@ const KeyframeInspector = ({ selection }) => {
338
338
  return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Keyframe unavailable" });
339
339
  }
340
340
  return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
341
- jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorBackAction, { disabled: parentSelection === null, onClick: onSelectParent, title: "Back to property", children: details.fieldLabel }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(KeyframeEasingNavigator_1.KeyframeEasingNavigator, { currentSelection: selection, includeEasings: (0, update_selected_easing_1.canEditEasingForInterpolationFunction)(details.propStatus.interpolationFunction), keyframes: details.propStatus.keyframes.map((keyframe) => ({
341
+ jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorBackAction, { disabled: parentSelection === null, onClick: onSelectParent, title: "Back to property", children: details.fieldLabel }), jsx_runtime_1.jsx(KeyframeEasingNavigator_1.KeyframeEasingNavigator, { currentSelection: selection, includeEasings: (0, update_selected_easing_1.canEditEasingForInterpolationFunction)(details.propStatus.interpolationFunction), keyframes: details.propStatus.keyframes.map((keyframe) => ({
342
342
  ...keyframe,
343
343
  frame: keyframe.frame + details.keyframeDisplayOffset,
344
344
  })), nodePathInfo: selection.nodePathInfo }), jsx_runtime_1.jsxs("div", { style: styles_1.detailsWithInlineAction, children: [
@@ -4,6 +4,7 @@ exports.SequenceInspectorSections = exports.SequenceInspectorDuplicationSection
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const client_id_1 = require("../../helpers/client-id");
7
+ const colors_1 = require("../../helpers/colors");
7
8
  const react_2 = require("../../icons/react");
8
9
  const InlineEditableTitle_1 = require("../InlineEditableTitle");
9
10
  const InspectorInfoHeader_1 = require("../InspectorInfoHeader");
@@ -29,7 +30,7 @@ const sequenceInspectorSubtitle = {
29
30
  alignItems: 'center',
30
31
  boxSizing: 'border-box',
31
32
  fontSize: 13,
32
- height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
33
+ height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
33
34
  lineHeight: '18px',
34
35
  margin: '0 4px',
35
36
  padding: `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING - 4}px`,
@@ -38,6 +39,13 @@ const sequenceInspectorSubtitle = {
38
39
  const defaultCursor = {
39
40
  cursor: 'default',
40
41
  };
42
+ const externalTabIndicatorStyle = {
43
+ display: 'inline-block',
44
+ height: 12,
45
+ marginLeft: 4,
46
+ verticalAlign: -2,
47
+ width: 12,
48
+ };
41
49
  const useSequenceInspectorSourceLocation = (sequence) => {
42
50
  const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_apps_1.useOpenSequenceInApps)(sequence);
43
51
  const validatedLocation = (0, react_1.useMemo)(() => {
@@ -96,7 +104,8 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
96
104
  saveName(newName).catch(() => undefined);
97
105
  }, [saveName]);
98
106
  return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: true, padding: "4px 0", children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, openInEditorLocation: sourceLocation.validatedLocation, children: [
99
- jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, style: defaultCursor, size: "compact", title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation, renderIcon: renderReactIcon, size: "quick-action" })
107
+ jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, style: defaultCursor, title: "Open component docs", onClick: openDocumentationLink, children: [componentName, jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: externalTabIndicatorStyle, 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" }) })
108
+ ] })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation, renderIcon: renderReactIcon, size: "quick-action" })
100
109
  ] }) }));
101
110
  };
102
111
  exports.SequenceInspectorHeader = SequenceInspectorHeader;
@@ -122,8 +131,6 @@ const SequenceInspectorSections = ({ track }) => {
122
131
  const sourceLocation = (0, exports.useSequenceInspectorSourceLocation)(track.sequence);
123
132
  const connectedCompositions = (0, ConnectedCompositionsSection_1.useConnectedCompositions)({ track });
124
133
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
125
- jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(exports.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
126
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
127
- ] })) : null] }));
134
+ jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(exports.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })) : null] }));
128
135
  };
129
136
  exports.SequenceInspectorSections = SequenceInspectorSections;
@@ -168,9 +168,7 @@ const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
168
168
  return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
169
169
  }
170
170
  return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
171
- jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
172
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
173
- ] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [
171
+ jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [
174
172
  jsx_runtime_1.jsx(SplitSequenceQuickAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceQuickActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
175
173
  ] })
176
174
  ] })) : (jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Source controls unavailable" }))] }));
@@ -3,7 +3,6 @@ import type { RenderModalWarning } from '../RenderModal/DataEditor';
3
3
  export declare const InspectorSectionHeader: React.FC<{
4
4
  readonly children: React.ReactNode;
5
5
  }>;
6
- export declare const InspectorSectionDivider: React.FC;
7
6
  export declare const InspectorQuickActionsSection: React.FC<{
8
7
  readonly children: React.ReactNode;
9
8
  }>;