@remotion/studio 4.0.516 → 4.0.518
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.
- package/dist/components/AssetSelector.js +63 -22
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +41 -10
- package/dist/components/Canvas.js +15 -12
- package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
- package/dist/components/CanvasCaptureDropHandler.js +42 -0
- package/dist/components/CanvasOrLoading.js +4 -3
- package/dist/components/CaptionInspector.js +1 -1
- package/dist/components/CaptionTextEditor.js +32 -8
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox.js +2 -19
- package/dist/components/CompositionContextButton.js +2 -1
- package/dist/components/CompositionSelector.js +1 -1
- package/dist/components/ConfigureLicenseModal.js +79 -46
- package/dist/components/CurrentAsset.d.ts +1 -1
- package/dist/components/CurrentAsset.js +9 -4
- package/dist/components/Editor.js +2 -1
- package/dist/components/EditorContent.js +11 -5
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EditorRuler/Ruler.d.ts +1 -0
- package/dist/components/EditorRuler/Ruler.js +9 -8
- package/dist/components/EditorRuler/index.d.ts +1 -0
- package/dist/components/EditorRuler/index.js +3 -4
- package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
- package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
- package/dist/components/ElementInstallConfirmation.d.ts +5 -0
- package/dist/components/ElementInstallConfirmation.js +25 -1
- package/dist/components/ElementLibraryModal.d.ts +5 -0
- package/dist/components/ElementLibraryModal.js +40 -0
- package/dist/components/FilePreview.js +71 -0
- package/dist/components/InlineCaptionInspector.js +13 -2
- package/dist/components/InlineEditableTitle.js +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
- package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
- package/dist/components/InspectorPanel/EasingInspector.js +2 -2
- package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
- package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
- package/dist/components/InspectorPanel/common.d.ts +0 -1
- package/dist/components/InspectorPanel/common.js +3 -7
- package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
- package/dist/components/InspectorPanel/styles.d.ts +0 -1
- package/dist/components/InspectorPanel/styles.js +3 -4
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
- package/dist/components/InspectorSequenceSection.d.ts +1 -2
- package/dist/components/InspectorSourceLocation.js +1 -1
- package/dist/components/Menu/MenuItem.js +15 -6
- package/dist/components/MenuToolbar.js +7 -3
- package/dist/components/Modals.js +51 -1
- package/dist/components/PlaybackRateSelector.js +3 -6
- package/dist/components/Preview.js +83 -5
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
- package/dist/components/PreviewToolbarOverflowButton.js +9 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -8
- package/dist/components/RadioButton.d.ts +6 -0
- package/dist/components/RadioButton.js +62 -0
- package/dist/components/RenderButton.js +2 -1
- package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
- package/dist/components/RulersAndGuidesToggle.js +18 -7
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -3
- package/dist/components/SelectedOutlineOverlay.js +21 -17
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
- package/dist/components/SelectedOutlineRenderer.d.ts +2 -3
- package/dist/components/SelectedOutlineRenderer.js +9 -78
- package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
- package/dist/components/SettingsModal.js +1 -1
- package/dist/components/SettingsModalFooter.d.ts +3 -1
- package/dist/components/SettingsModalFooter.js +19 -4
- package/dist/components/ShowPixelGridProvider.d.ts +4 -0
- package/dist/components/ShowPixelGridProvider.js +24 -0
- package/dist/components/SidebarCollapserControls.js +2 -2
- package/dist/components/SidebarRenderButton.js +2 -1
- package/dist/components/Timeline/Timeline.js +41 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
- package/dist/components/Timeline/TimelineDragHandler.js +11 -4
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
- package/dist/components/Timeline/TimelineSelection.js +30 -170
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
- package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
- package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
- package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
- package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
- package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
- package/dist/components/WebMcp.d.ts +2 -0
- package/dist/components/WebMcp.js +945 -0
- package/dist/components/canvas-capture-drop.d.ts +4 -0
- package/dist/components/canvas-capture-drop.js +22 -0
- package/dist/components/composition-menu-items.js +26 -0
- package/dist/components/selected-outline-geometry.d.ts +2 -21
- package/dist/components/selected-outline-geometry.js +5 -16
- package/dist/components/selected-outline-measurement.d.ts +8 -37
- package/dist/components/selected-outline-measurement.js +1 -231
- package/dist/components/selected-outline-types.d.ts +2 -15
- package/dist/components/selected-outline-uv.js +3 -106
- package/dist/esm/{chunk-w4244j4n.js → chunk-7prjt5n5.js} +32831 -26820
- package/dist/esm/internals.mjs +32831 -26820
- package/dist/esm/previewEntry.mjs +17304 -11293
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +1 -7
- package/dist/helpers/calculate-timeline.js +2 -146
- package/dist/helpers/create-folder-tree.js +16 -1
- package/dist/helpers/editor-ruler.js +6 -5
- package/dist/helpers/format-file-location.d.ts +8 -0
- package/dist/helpers/format-file-location.js +14 -3
- package/dist/helpers/get-asset-metadata.d.ts +19 -0
- package/dist/helpers/get-asset-metadata.js +51 -6
- package/dist/helpers/get-connected-compositions.d.ts +1 -6
- package/dist/helpers/get-connected-compositions.js +2 -8
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
- package/dist/helpers/get-sequence-visible-range.js +6 -51
- package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
- package/dist/helpers/get-timeline-max-zoom.js +17 -6
- package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
- package/dist/helpers/get-timeline-nestedness.js +2 -12
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
- package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +4 -1
- package/dist/helpers/is-current-selected-still.js +4 -2
- package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
- package/dist/helpers/sort-by-nonce-history.js +3 -148
- package/dist/helpers/timeline-node-path-key.d.ts +1 -2
- package/dist/helpers/timeline-node-path-key.js +2 -2
- package/dist/helpers/use-menu-structure.js +20 -0
- package/dist/icons/enter.d.ts +4 -0
- package/dist/icons/enter.js +10 -0
- package/dist/state/editor-pixel-grid.d.ts +8 -0
- package/dist/state/editor-pixel-grid.js +18 -0
- package/dist/state/modals.d.ts +4 -0
- package/dist/state/playbackrate.d.ts +1 -0
- package/dist/state/playbackrate.js +4 -1
- package/package.json +14 -12
- package/dist/components/selected-outline-order.d.ts +0 -12
- package/dist/components/selected-outline-order.js +0 -251
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
- package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
- package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
- package/dist/helpers/get-box-quads-ponyfill.js +0 -23
|
@@ -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
|
|
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
|
-
|
|
42
|
-
|
|
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
|
|
46
|
-
|
|
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("
|
|
174
|
-
jsx_runtime_1.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
|
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.
|
|
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.
|
|
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, {})
|
|
@@ -16,6 +16,7 @@ const Timeline_1 = require("./Timeline/Timeline");
|
|
|
16
16
|
const TimelineEmptyState_1 = require("./Timeline/TimelineEmptyState");
|
|
17
17
|
const TimelineKeyframeDragState_1 = require("./Timeline/TimelineKeyframeDragState");
|
|
18
18
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
19
|
+
const WebMcp_1 = require("./WebMcp");
|
|
19
20
|
const noop = () => undefined;
|
|
20
21
|
const container = {
|
|
21
22
|
display: 'flex',
|
|
@@ -34,13 +35,18 @@ const StudioClearSelectionArea = ({ children }) => {
|
|
|
34
35
|
return (jsx_runtime_1.jsx("div", { style: container, onPointerDown: onPointerDown, children: children }));
|
|
35
36
|
};
|
|
36
37
|
const EditorContent = ({ readOnlyStudio, children }) => {
|
|
37
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
38
|
-
const showTimeline = canvasContent !== null &&
|
|
38
|
+
const { canvasContent, currentAssetMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
39
|
+
const showTimeline = canvasContent !== null &&
|
|
40
|
+
(canvasContent.type === 'composition' ||
|
|
41
|
+
(canvasContent.type === 'asset' &&
|
|
42
|
+
(currentAssetMetadata === null || currentAssetMetadata === void 0 ? void 0 : currentAssetMetadata.asset) === canvasContent.asset));
|
|
39
43
|
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
44
|
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
45
|
] }));
|
|
42
|
-
return (jsx_runtime_1.
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
return (jsx_runtime_1.jsxs(TimelineSelection_1.TimelineSelectionProvider, { children: [
|
|
47
|
+
jsx_runtime_1.jsx(WebMcp_1.WebMcp, {}), jsx_runtime_1.jsx(transform_3d_mode_1.Transform3DModeStateProvider, { children: jsx_runtime_1.jsxs(StudioClearSelectionArea, { children: [
|
|
48
|
+
jsx_runtime_1.jsx(InitialCompositionLoader_1.InitialCompositionLoader, {}), jsx_runtime_1.jsx(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, {}), jsx_runtime_1.jsx(TimelineKeyframeDragState_1.TimelineKeyframeDragStateProvider, { children: content })
|
|
49
|
+
] }) })
|
|
50
|
+
] }));
|
|
45
51
|
};
|
|
46
52
|
exports.EditorContent = EditorContent;
|
|
@@ -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
|
|
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
|
-
|
|
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)(
|
|
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
|
-
|
|
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;
|
|
@@ -19,13 +19,12 @@ const originBlockStyles = {
|
|
|
19
19
|
position: 'absolute',
|
|
20
20
|
top: 0,
|
|
21
21
|
left: 0,
|
|
22
|
-
|
|
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(
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useIsRulerVisible: () => boolean
|
|
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 &&
|
|
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;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export declare const ElementLibraryAddConfirmation: React.FC<{
|
|
3
|
+
readonly displayName: string | null;
|
|
4
|
+
readonly origin: string;
|
|
5
|
+
readonly url: string;
|
|
6
|
+
}>;
|
|
2
7
|
export declare const ElementInstallConfirmation: React.FC<{
|
|
3
8
|
readonly displayName: string;
|
|
4
9
|
readonly sourceLabel: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ElementInstallConfirmation = void 0;
|
|
3
|
+
exports.ElementInstallConfirmation = exports.ElementLibraryAddConfirmation = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../helpers/colors");
|
|
6
6
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
@@ -130,6 +130,13 @@ const warningDescriptionStyle = {
|
|
|
130
130
|
fontWeight: 400,
|
|
131
131
|
lineHeight: 1.5,
|
|
132
132
|
};
|
|
133
|
+
const browseElementsStyle = {
|
|
134
|
+
color: 'inherit',
|
|
135
|
+
fontFamily: 'inherit',
|
|
136
|
+
fontSize: 'inherit',
|
|
137
|
+
fontWeight: 600,
|
|
138
|
+
lineHeight: 'inherit',
|
|
139
|
+
};
|
|
133
140
|
const sourceDetailsStyle = {
|
|
134
141
|
paddingTop: 2,
|
|
135
142
|
fontFamily: 'sans-serif',
|
|
@@ -171,6 +178,23 @@ const makeSourceControlsVisible = (sourceCode) => {
|
|
|
171
178
|
return `\\u${(_a = character.codePointAt(0)) === null || _a === void 0 ? void 0 : _a.toString(16).padStart(4, '0')}`;
|
|
172
179
|
});
|
|
173
180
|
};
|
|
181
|
+
const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
182
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
183
|
+
jsx_runtime_1.jsxs("dl", { style: metadataStyle, "aria-label": "Catalog details", children: [displayName === null ? null : (jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
184
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Display name" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: displayName })
|
|
185
|
+
] })), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
186
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Request source" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: origin })
|
|
187
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
188
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Catalog URL" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: url }) })
|
|
189
|
+
] })
|
|
190
|
+
] }), jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
|
|
191
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["This adds the catalog to", ' ', jsx_runtime_1.jsx("strong", { style: browseElementsStyle, children: "Browse Elements" }),
|
|
192
|
+
" when nothing is selected on the canvas. It is saved in", ' ', jsx_runtime_1.jsx("code", { style: codeStyle, children: "remotion.config.ts" }),
|
|
193
|
+
"."] })
|
|
194
|
+
] })
|
|
195
|
+
] }));
|
|
196
|
+
};
|
|
197
|
+
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
174
198
|
const ElementInstallConfirmation = ({ displayName, sourceLabel, sourceIsUnverified, compositionId, filePath, overwritesExistingFile, dependenciesToReview, missingPackages, sourceCode, usesBrowserDependencyResolution, }) => {
|
|
175
199
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
176
200
|
jsx_runtime_1.jsxs("dl", { style: metadataStyle, "aria-label": "Installation details", children: [
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
const iframeUrl = new URL(url);
|
|
33
|
+
iframeUrl.searchParams.set('remotion-studio', 'true');
|
|
34
|
+
iframe.src = iframeUrl.toString();
|
|
35
|
+
}, [url]);
|
|
36
|
+
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
|
|
37
|
+
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` })
|
|
38
|
+
] }));
|
|
39
|
+
};
|
|
40
|
+
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
|
}
|