@remotion/studio 4.0.524 → 4.0.526
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/api/focus-default-props-path.js +7 -1
- package/dist/api/restart-studio.d.ts +1 -1
- package/dist/api/restart-studio.js +1 -1
- package/dist/components/ActionTooltip.d.ts +2 -0
- package/dist/components/ActionTooltip.js +14 -4
- package/dist/components/AgentPrompt.d.ts +6 -0
- package/dist/components/AgentPrompt.js +107 -0
- package/dist/components/AppLaunchButton.js +2 -0
- package/dist/components/AssetFileIcon.js +2 -0
- package/dist/components/AssetSelectorItem.d.ts +1 -23
- package/dist/components/AssetSelectorItem.js +10 -200
- package/dist/components/AssetSelectorModal.d.ts +6 -0
- package/dist/components/AssetSelectorModal.js +174 -0
- package/dist/components/Canvas.js +21 -4
- package/dist/components/CaptionInspector.js +9 -3
- package/dist/components/CheckboardToggle.js +2 -1
- package/dist/{error-overlay/remotion-overlay → components}/CodeFrame.d.ts +2 -0
- package/dist/components/CodeFrame.js +77 -0
- package/dist/components/ColorPicker/AlphaSlider.js +1 -1
- package/dist/components/ColorPicker/HueSlider.js +1 -1
- package/dist/components/ColorPicker/SaturationValueArea.js +1 -1
- package/dist/components/CompositionSelector.js +1 -0
- package/dist/components/CompositionSelectorItem.js +7 -17
- package/dist/components/CurrentAsset.js +5 -4
- package/dist/components/EditorGuides/Guide.js +1 -1
- package/dist/components/ElementInstallConfirmation.js +100 -61
- package/dist/components/FilePreview.js +4 -0
- package/dist/components/FixComputedValueModal.js +64 -96
- package/dist/components/FullscreenToggle.js +1 -1
- package/dist/components/GenerateWithAgentModal.d.ts +9 -0
- package/dist/components/GenerateWithAgentModal.js +39 -0
- package/dist/components/GlobalKeybindings.js +14 -0
- package/dist/components/InlineEditableTitle.js +2 -0
- package/dist/components/InspectorLocationCopy.js +1 -1
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +25 -18
- package/dist/components/InspectorPanel/CollapsibleInspectorSection.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSection.js +14 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +19 -8
- package/dist/components/InspectorPanel/CompositionInspector.js +30 -13
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +6 -7
- package/dist/components/InspectorPanel/CompositionMetadata.js +4 -0
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +6 -12
- package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -0
- package/dist/components/InspectorPanel/GuideInspector.js +2 -3
- package/dist/components/InspectorPanel/KeyframeSettings.js +5 -6
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +2 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +4 -12
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -3
- package/dist/components/InspectorPanel/common.d.ts +4 -0
- package/dist/components/InspectorPanel/common.js +14 -2
- package/dist/components/InspectorPanel/styles.d.ts +0 -3
- package/dist/components/InspectorPanel/styles.js +1 -27
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +2 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +15 -0
- package/dist/components/InspectorPanel/use-inspector-section-expanded.d.ts +1 -0
- package/dist/components/InspectorPanel/use-inspector-section-expanded.js +21 -0
- package/dist/components/InspectorSequenceSection.js +61 -43
- package/dist/components/InspectorSourceLocation.js +1 -0
- package/dist/components/KeyboardShortcutsSettings.js +12 -4
- package/dist/components/LoopToggle.js +2 -1
- package/dist/components/LutPreview.d.ts +4 -0
- package/dist/components/LutPreview.js +192 -0
- package/dist/components/Menu/MenuItem.js +1 -2
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/MenuCompositionName.js +4 -9
- package/dist/components/Modals.js +4 -6
- package/dist/components/ModelsSettings.js +15 -4
- package/dist/components/MuteToggle.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.js +1 -0
- package/dist/components/NewComposition/DeleteComposition.js +42 -6
- package/dist/components/NewComposition/DeleteFolder.js +1 -0
- package/dist/components/NewComposition/DuplicateComposition.js +5 -0
- package/dist/components/NewComposition/InputDragger.js +2 -2
- package/dist/components/NewComposition/NewFolder.js +29 -2
- package/dist/components/NewComposition/RenameFolder.js +1 -0
- package/dist/components/NewComposition/duplicate-composition-api.d.ts +3 -2
- package/dist/components/NewComposition/duplicate-composition-api.js +9 -2
- package/dist/components/OutlineToggle.js +2 -1
- package/dist/components/PlayPause.js +1 -1
- package/dist/components/Preview.js +0 -3
- package/dist/components/PreviewToolbar.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +4 -9
- package/dist/components/RenderButton.js +40 -4
- package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.js +2 -1
- package/dist/components/RenderModal/WebRenderModal.js +10 -2
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderModal/render-modals.js +3 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
- package/dist/components/RenderQueue/actions.d.ts +2 -1
- package/dist/components/RenderQueue/actions.js +2 -1
- package/dist/components/RendersTab.js +2 -0
- package/dist/components/RulersAndGuidesToggle.js +2 -1
- package/dist/components/SegmentedButton.d.ts +1 -0
- package/dist/components/SegmentedButton.js +9 -3
- package/dist/components/SelectedOutlineElement.js +22 -6
- package/dist/components/SelectedOutlinePolygon.js +4 -2
- package/dist/components/SettingsButton.js +11 -2
- package/dist/components/SettingsContext.d.ts +8 -0
- package/dist/components/SettingsContext.js +57 -2
- package/dist/components/SettingsModal.d.ts +1 -2
- package/dist/components/SettingsModal.js +27 -6
- package/dist/components/SettingsModalFooter.js +17 -3
- package/dist/components/SidebarCollapserControls.js +1 -1
- package/dist/components/SkillsSettings.d.ts +5 -0
- package/dist/components/SkillsSettings.js +49 -15
- package/dist/components/SnappingToggle.js +2 -1
- package/dist/components/Splitter/SplitterHandle.js +1 -2
- package/dist/components/Tabs/vertical.d.ts +1 -1
- package/dist/components/Tabs/vertical.js +16 -2
- package/dist/components/Timeline/EasingEditorModal.js +2 -2
- package/dist/components/Timeline/Timeline.js +10 -11
- package/dist/components/Timeline/TimelineAssetField.js +178 -9
- package/dist/components/Timeline/TimelineDragHandler.js +1 -2
- package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectItem.js +2 -2
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineHeightContainer.js +11 -1
- package/dist/components/Timeline/TimelineInOutDragHandler.js +1 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +15 -1
- package/dist/components/Timeline/TimelineLayerChildren.d.ts +3 -3
- package/dist/components/Timeline/TimelineLayerChildren.js +11 -9
- package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +6 -3
- package/dist/components/Timeline/TimelineList.js +9 -3
- package/dist/components/Timeline/TimelineSchemaField.js +10 -7
- package/dist/components/Timeline/TimelineSelection.d.ts +17 -4
- package/dist/components/Timeline/TimelineSelection.js +121 -52
- package/dist/components/Timeline/TimelineSequence.js +8 -8
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +29 -23
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +3 -12
- package/dist/components/Timeline/TimelineTranslateField.js +25 -12
- package/dist/components/Timeline/TimelineVirtualization.d.ts +3 -3
- package/dist/components/Timeline/TimelineZoomControls.js +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +3 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +152 -51
- package/dist/components/Timeline/normalize-font-weight-for-keyframe.d.ts +1 -0
- package/dist/components/Timeline/normalize-font-weight-for-keyframe.js +19 -0
- package/dist/components/Timeline/timeline-display-groups.d.ts +9 -0
- package/dist/components/Timeline/timeline-display-groups.js +66 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +4 -2
- package/dist/components/Timeline/timeline-translate-utils.d.ts +17 -0
- package/dist/components/Timeline/timeline-translate-utils.js +53 -12
- package/dist/components/Timeline/use-open-sequence-in-apps.d.ts +2 -0
- package/dist/components/Timeline/use-open-sequence-in-apps.js +17 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +20 -6
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +1 -2
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/UndoRedoButtons.js +11 -0
- package/dist/components/UpdateStatusContext.d.ts +2 -2
- package/dist/components/UpdateStatusContext.js +6 -7
- package/dist/components/UpdatesSettings.js +6 -6
- package/dist/components/WebMcp.js +40 -41
- package/dist/components/asset-context-menu.d.ts +32 -0
- package/dist/components/asset-context-menu.js +242 -0
- package/dist/components/composition-menu-items.d.ts +4 -6
- package/dist/components/composition-menu-items.js +212 -42
- package/dist/components/folder-menu-items.js +44 -0
- package/dist/components/get-open-in-menu-items.d.ts +6 -5
- package/dist/components/get-open-in-menu-items.js +16 -10
- package/dist/components/import-assets.d.ts +24 -1
- package/dist/components/import-assets.js +3 -1
- package/dist/components/keyboard-shortcuts.d.ts +4 -4
- package/dist/components/keyboard-shortcuts.js +5 -0
- package/dist/components/selected-outline-order.js +18 -12
- package/dist/components/use-open-in-menu-apps.d.ts +14 -0
- package/dist/components/use-open-in-menu-apps.js +33 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +3 -3
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +5 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +26 -19
- package/dist/esm/{LazyModels-hc33szyn.mjs → LazyModels-mtggyjye.mjs} +3 -3
- package/dist/esm/{LazyModels-sg40rjw6.mjs → LazyModels-nk7py0zt.mjs} +3 -3
- package/dist/esm/{TranscriptionModal-3ctnxpt6.mjs → TranscriptionModal-ymnx1c7m.mjs} +6 -6
- package/dist/esm/{VideoMattingModal-b0r7e60n.mjs → VideoMattingModal-05vpczks.mjs} +6 -6
- package/dist/esm/{index-er3mh6em.mjs → index-0gewwxse.mjs} +7031 -5834
- package/dist/esm/{index-q5xv20xx.mjs → index-4dsz9035.mjs} +8 -8
- package/dist/esm/{index-wbmp5srk.mjs → index-5bfxbpca.mjs} +1 -1
- package/dist/esm/{index-e3zwf3e7.mjs → index-5gd8k9yv.mjs} +1 -1
- package/dist/esm/{index-c37kme2v.mjs → index-bs39wngg.mjs} +4929 -3801
- package/dist/esm/{index-yfrysr5f.mjs → index-cdy8v54v.mjs} +17 -3
- package/dist/esm/{index-9qtvmwtx.mjs → index-eb5txqp6.mjs} +12 -9
- package/dist/esm/{index-q2epbw93.mjs → index-f97r9e2g.mjs} +4 -21
- package/dist/esm/{index-2j3d1g81.mjs → index-g7k2dvar.mjs} +1 -1
- package/dist/esm/{index-1b9skrrd.mjs → index-x40wwfmt.mjs} +3 -3
- package/dist/esm/index.mjs +12 -6
- package/dist/esm/internals.mjs +7 -7
- package/dist/esm/previewEntry.mjs +7 -7
- package/dist/helpers/client-id.d.ts +1 -0
- package/dist/helpers/client-id.js +8 -4
- package/dist/helpers/cube-lut.d.ts +12 -0
- package/dist/helpers/cube-lut.js +160 -0
- package/dist/helpers/get-git-menu-item.d.ts +4 -0
- package/dist/helpers/get-git-menu-item.js +8 -1
- package/dist/helpers/get-preview-file-type.d.ts +1 -1
- package/dist/helpers/get-preview-file-type.js +3 -0
- package/dist/helpers/get-sequence-double-click-action.d.ts +3 -3
- package/dist/helpers/get-sequence-double-click-action.js +2 -2
- package/dist/helpers/open-in-editor.d.ts +5 -2
- package/dist/helpers/open-in-editor.js +12 -4
- package/dist/helpers/pointer-session.d.ts +1 -0
- package/dist/helpers/pointer-session.js +10 -1
- package/dist/helpers/settings-tab-availability.d.ts +14 -0
- package/dist/helpers/settings-tab-availability.js +35 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/use-create-composition.js +5 -0
- package/dist/helpers/use-keybinding.d.ts +1 -1
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
- package/dist/helpers/use-media-metadata.js +5 -1
- package/dist/helpers/use-menu-structure.js +21 -13
- package/dist/helpers/use-rename-composition.js +6 -1
- package/dist/icons/lut.d.ts +4 -0
- package/dist/icons/lut.js +6 -0
- package/dist/icons/sparkles.d.ts +4 -0
- package/dist/icons/sparkles.js +6 -0
- package/dist/state/modals.d.ts +25 -3
- package/dist/state/z-index.js +1 -3
- package/package.json +19 -19
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +0 -62
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssetSelectorModal = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const modals_1 = require("../state/modals");
|
|
8
|
+
const Button_1 = require("./Button");
|
|
9
|
+
const layout_1 = require("./layout");
|
|
10
|
+
const ModalButton_1 = require("./ModalButton");
|
|
11
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
12
|
+
const ModalFooter_1 = require("./ModalFooter");
|
|
13
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
14
|
+
const RemInput_1 = require("./NewComposition/RemInput");
|
|
15
|
+
const QuickSwitcherContent_1 = require("./QuickSwitcher/QuickSwitcherContent");
|
|
16
|
+
const SegmentedControl_1 = require("./SegmentedControl");
|
|
17
|
+
const panel = {
|
|
18
|
+
maxWidth: 'calc(100vw - 40px)',
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
width: 400,
|
|
21
|
+
};
|
|
22
|
+
const sourceSelector = {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
padding: '12px 16px 0',
|
|
25
|
+
};
|
|
26
|
+
const urlContent = {
|
|
27
|
+
boxSizing: 'border-box',
|
|
28
|
+
minHeight: 300,
|
|
29
|
+
padding: 16,
|
|
30
|
+
};
|
|
31
|
+
const compactUrlContent = {
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
padding: 16,
|
|
34
|
+
};
|
|
35
|
+
const label = {
|
|
36
|
+
color: colors_1.LIGHT_TEXT,
|
|
37
|
+
display: 'block',
|
|
38
|
+
fontFamily: 'sans-serif',
|
|
39
|
+
fontSize: 12,
|
|
40
|
+
marginBottom: 8,
|
|
41
|
+
};
|
|
42
|
+
const previewRow = {
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
display: 'flex',
|
|
45
|
+
gap: 16,
|
|
46
|
+
minHeight: 112,
|
|
47
|
+
paddingTop: 16,
|
|
48
|
+
};
|
|
49
|
+
const previewImage = {
|
|
50
|
+
display: 'block',
|
|
51
|
+
height: 96,
|
|
52
|
+
objectFit: 'contain',
|
|
53
|
+
width: 96,
|
|
54
|
+
};
|
|
55
|
+
const previewStatus = {
|
|
56
|
+
color: colors_1.LIGHT_TEXT,
|
|
57
|
+
fontFamily: 'sans-serif',
|
|
58
|
+
fontSize: 12,
|
|
59
|
+
lineHeight: 1.5,
|
|
60
|
+
};
|
|
61
|
+
const footer = {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
minWidth: 0,
|
|
64
|
+
width: '100%',
|
|
65
|
+
};
|
|
66
|
+
const isHttpUrl = (value) => {
|
|
67
|
+
try {
|
|
68
|
+
const { protocol } = new URL(value.startsWith('//') ? `https:${value}` : value);
|
|
69
|
+
return protocol === 'http:' || protocol === 'https:';
|
|
70
|
+
}
|
|
71
|
+
catch (_a) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const AssetSelectorModal = ({ state, readOnlyStudio }) => {
|
|
76
|
+
var _a;
|
|
77
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
78
|
+
const [mode, setMode] = (0, react_1.useState)(() => state.initialUrl === null ? 'project' : 'url');
|
|
79
|
+
const [draft, setDraft] = (0, react_1.useState)((_a = state.initialUrl) !== null && _a !== void 0 ? _a : '');
|
|
80
|
+
const [previewState, setPreviewState] = (0, react_1.useState)(() => state.assetType === 'image' && state.initialUrl !== null
|
|
81
|
+
? { type: 'loading' }
|
|
82
|
+
: { type: 'empty' });
|
|
83
|
+
const close = (0, react_1.useCallback)(() => {
|
|
84
|
+
setSelectedModal(null);
|
|
85
|
+
}, [setSelectedModal]);
|
|
86
|
+
(0, react_1.useEffect)(() => {
|
|
87
|
+
if (state.assetType !== 'image') {
|
|
88
|
+
setPreviewState({ type: 'empty' });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const value = draft.trim();
|
|
92
|
+
if (value === '') {
|
|
93
|
+
setPreviewState({ type: 'empty' });
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (!isHttpUrl(value)) {
|
|
97
|
+
setPreviewState({ type: 'invalid' });
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
let cancelled = false;
|
|
101
|
+
const image = new Image();
|
|
102
|
+
setPreviewState({ type: 'loading' });
|
|
103
|
+
image.onload = () => {
|
|
104
|
+
if (!cancelled) {
|
|
105
|
+
setPreviewState({
|
|
106
|
+
type: 'loaded',
|
|
107
|
+
width: image.naturalWidth,
|
|
108
|
+
height: image.naturalHeight,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
image.onerror = () => {
|
|
113
|
+
if (!cancelled) {
|
|
114
|
+
setPreviewState({ type: 'error' });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
image.src = value.startsWith('//') ? `https:${value}` : value;
|
|
118
|
+
return () => {
|
|
119
|
+
cancelled = true;
|
|
120
|
+
image.onload = null;
|
|
121
|
+
image.onerror = null;
|
|
122
|
+
};
|
|
123
|
+
}, [draft, state.assetType]);
|
|
124
|
+
const items = (0, react_1.useMemo)(() => [
|
|
125
|
+
{
|
|
126
|
+
key: 'project',
|
|
127
|
+
label: 'Project assets',
|
|
128
|
+
onClick: () => setMode('project'),
|
|
129
|
+
selected: mode === 'project',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
key: 'url',
|
|
133
|
+
label: 'URL',
|
|
134
|
+
onClick: () => setMode('url'),
|
|
135
|
+
selected: mode === 'url',
|
|
136
|
+
},
|
|
137
|
+
], [mode]);
|
|
138
|
+
const trimmedDraft = draft.trim();
|
|
139
|
+
const canApply = isHttpUrl(trimmedDraft);
|
|
140
|
+
const invalidDraft = trimmedDraft !== '' && !canApply;
|
|
141
|
+
const apply = (0, react_1.useCallback)(() => {
|
|
142
|
+
if (!canApply) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
state.onSelectedUrl(trimmedDraft);
|
|
146
|
+
close();
|
|
147
|
+
}, [canApply, close, state, trimmedDraft]);
|
|
148
|
+
const onSubmit = (0, react_1.useCallback)((event) => {
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
apply();
|
|
151
|
+
}, [apply]);
|
|
152
|
+
const assetTypeLabel = state.assetType.charAt(0).toUpperCase() + state.assetType.slice(1);
|
|
153
|
+
return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onEscape: close, onOutsideClick: close, panelStyle: panel, children: [
|
|
154
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Replace ${state.assetType}`, onClose: close }), jsx_runtime_1.jsx("div", { style: sourceSelector, children: jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: items, needsWrapping: false, size: "compact" }) }), mode === 'project' ? (jsx_runtime_1.jsx(QuickSwitcherContent_1.QuickSwitcherContent, { assetSelection: state.assetSelection, compositionSelection: null, initialMode: "assets", invocationTimestamp: state.invocationTimestamp, readOnlyStudio: readOnlyStudio })) : (jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
155
|
+
jsx_runtime_1.jsxs("div", { style: state.assetType === 'image' ? urlContent : compactUrlContent, children: [
|
|
156
|
+
jsx_runtime_1.jsxs("label", { htmlFor: "remotion-asset-url", style: label, children: [assetTypeLabel, " URL"] }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { id: "remotion-asset-url", autoFocus: true, onChange: (event) => setDraft(event.target.value), placeholder: `https://example.com/${state.assetType}`, rightAlign: false, status: invalidDraft ? 'error' : 'ok', type: "url", value: draft }), state.assetType === 'image' ? (jsx_runtime_1.jsxs("div", { style: previewRow, role: "status", children: [previewState.type === 'loaded' ? (jsx_runtime_1.jsx("img", { alt: "Image URL preview", src: trimmedDraft.startsWith('//')
|
|
157
|
+
? `https:${trimmedDraft}`
|
|
158
|
+
: trimmedDraft, style: previewImage })) : null, jsx_runtime_1.jsx("div", { style: previewState.type === 'error'
|
|
159
|
+
? { ...previewStatus, color: colors_1.FAIL_COLOR }
|
|
160
|
+
: previewStatus, children: previewState.type === 'empty'
|
|
161
|
+
? 'Enter an image URL.'
|
|
162
|
+
: previewState.type === 'invalid'
|
|
163
|
+
? 'Enter an HTTP(S) URL.'
|
|
164
|
+
: previewState.type === 'loading'
|
|
165
|
+
? 'Loading preview…'
|
|
166
|
+
: previewState.type === 'error'
|
|
167
|
+
? 'Preview unavailable. You can still replace the source.'
|
|
168
|
+
: `${previewState.width} × ${previewState.height}` })
|
|
169
|
+
] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footer, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", flex: 1, justify: "flex-end", children: [
|
|
170
|
+
jsx_runtime_1.jsx(Button_1.Button, { onClick: close, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { disabled: !canApply, onClick: apply, children: ["Replace ", state.assetType] })
|
|
171
|
+
] }) })
|
|
172
|
+
] }))] }));
|
|
173
|
+
};
|
|
174
|
+
exports.AssetSelectorModal = AssetSelectorModal;
|
|
@@ -36,6 +36,7 @@ const EditorGuides_1 = __importDefault(require("./EditorGuides"));
|
|
|
36
36
|
const EditorRuler_1 = require("./EditorRuler");
|
|
37
37
|
const use_is_ruler_visible_1 = require("./EditorRuler/use-is-ruler-visible");
|
|
38
38
|
const effect_drag_and_drop_1 = require("./effect-drag-and-drop");
|
|
39
|
+
const element_drag_and_drop_1 = require("./element-drag-and-drop");
|
|
39
40
|
const element_install_api_1 = require("./element-install-api");
|
|
40
41
|
const element_install_request_1 = require("./element-install-request");
|
|
41
42
|
const handle_drop_1 = require("./handle-drop");
|
|
@@ -847,6 +848,10 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
847
848
|
return;
|
|
848
849
|
}
|
|
849
850
|
const mayBeCanvasCapture = (0, drop_handler_data_1.isFileDragEvent)(event) && !window.remotion_isReadOnlyStudio;
|
|
851
|
+
const canDropElementIntoNewComposition = cannotAddSequence &&
|
|
852
|
+
canReceiveElementInstallRequest &&
|
|
853
|
+
!isAddingAsset &&
|
|
854
|
+
(0, element_drag_and_drop_1.hasElementDragType)(event.dataTransfer);
|
|
850
855
|
if (!canDropAssets && !cannotAddSequence && !mayBeCanvasCapture) {
|
|
851
856
|
setCompositionDropPreview(null);
|
|
852
857
|
return;
|
|
@@ -854,7 +859,11 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
854
859
|
event.preventDefault();
|
|
855
860
|
if (event.dataTransfer) {
|
|
856
861
|
event.dataTransfer.dropEffect =
|
|
857
|
-
canDropAssets ||
|
|
862
|
+
canDropAssets ||
|
|
863
|
+
canDropElementIntoNewComposition ||
|
|
864
|
+
mayBeCanvasCapture
|
|
865
|
+
? 'copy'
|
|
866
|
+
: 'none';
|
|
858
867
|
}
|
|
859
868
|
if (!canDropAssets ||
|
|
860
869
|
contentDimensions === null ||
|
|
@@ -921,8 +930,10 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
921
930
|
addFitPadding,
|
|
922
931
|
canDropAssets,
|
|
923
932
|
cannotAddSequence,
|
|
933
|
+
canReceiveElementInstallRequest,
|
|
924
934
|
contentDimensions,
|
|
925
935
|
editorSnapping,
|
|
936
|
+
isAddingAsset,
|
|
926
937
|
previewSize,
|
|
927
938
|
size,
|
|
928
939
|
]);
|
|
@@ -972,13 +983,17 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
972
983
|
}
|
|
973
984
|
}
|
|
974
985
|
}
|
|
975
|
-
|
|
986
|
+
const canDropElementIntoNewComposition = cannotAddSequence &&
|
|
987
|
+
canReceiveElementInstallRequest &&
|
|
988
|
+
!isAddingAsset &&
|
|
989
|
+
(0, element_drag_and_drop_1.getElementDragData)(event.dataTransfer) !== null;
|
|
990
|
+
if (cannotAddSequence && !canDropElementIntoNewComposition) {
|
|
976
991
|
event.preventDefault();
|
|
977
992
|
event.stopPropagation();
|
|
978
|
-
(0, NotificationCenter_1.showNotification)('Cannot insert
|
|
993
|
+
(0, NotificationCenter_1.showNotification)('Cannot insert this item: This composition component cannot accept a new <Sequence>.', 3000);
|
|
979
994
|
return;
|
|
980
995
|
}
|
|
981
|
-
if (!canDropAssets ||
|
|
996
|
+
if ((!canDropAssets && !canDropElementIntoNewComposition) ||
|
|
982
997
|
compositionFile === null ||
|
|
983
998
|
currentCompositionId === null ||
|
|
984
999
|
config === null) {
|
|
@@ -1049,12 +1064,14 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
1049
1064
|
addFitPadding,
|
|
1050
1065
|
canDropAssets,
|
|
1051
1066
|
cannotAddSequence,
|
|
1067
|
+
canReceiveElementInstallRequest,
|
|
1052
1068
|
chooseSvgImportMode,
|
|
1053
1069
|
compositionFile,
|
|
1054
1070
|
config,
|
|
1055
1071
|
contentDimensions,
|
|
1056
1072
|
currentCompositionId,
|
|
1057
1073
|
editorSnapping,
|
|
1074
|
+
isAddingAsset,
|
|
1058
1075
|
previewSize,
|
|
1059
1076
|
size,
|
|
1060
1077
|
setSelectedModal,
|
|
@@ -60,6 +60,8 @@ const readOnlyStatus = {
|
|
|
60
60
|
};
|
|
61
61
|
const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onTextCancel, onReplaceCaptions, onToggle, readOnly, readOnlyTitle, }) => {
|
|
62
62
|
const fileInput = (0, react_1.useRef)(null);
|
|
63
|
+
const expansionRef = (0, react_1.useRef)({ expanded, onToggle });
|
|
64
|
+
expansionRef.current = { expanded, onToggle };
|
|
63
65
|
const [isImporting, setIsImporting] = (0, react_1.useState)(false);
|
|
64
66
|
const { setSelectedModal } = react_1.default.useContext(modals_1.SetSelectedModalContext);
|
|
65
67
|
const importCaptions = (0, react_1.useCallback)(async ({ fileName, contents, }) => {
|
|
@@ -68,10 +70,14 @@ const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onText
|
|
|
68
70
|
}
|
|
69
71
|
setIsImporting(true);
|
|
70
72
|
try {
|
|
71
|
-
|
|
73
|
+
const imported = (0, parse_caption_file_1.parseCaptionFile)({
|
|
72
74
|
fileName,
|
|
73
75
|
contents: await contents,
|
|
74
|
-
})
|
|
76
|
+
});
|
|
77
|
+
onReplaceCaptions(imported);
|
|
78
|
+
if (imported.length > 0 && !expansionRef.current.expanded) {
|
|
79
|
+
expansionRef.current.onToggle();
|
|
80
|
+
}
|
|
75
81
|
}
|
|
76
82
|
catch (error) {
|
|
77
83
|
(0, NotificationCenter_1.showNotification)(`Could not import ${fileName}: ${error instanceof Error ? error.message : String(error)}`, 5000);
|
|
@@ -112,6 +118,6 @@ const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onText
|
|
|
112
118
|
}, [importCaptions, setSelectedModal]);
|
|
113
119
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
114
120
|
jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderEnd, children: [onReplaceCaptions === null ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
115
|
-
jsx_runtime_1.jsx("input", { ref: fileInput, accept: ".json", "aria-label": "Import captions file", hidden: true, onChange: onFileSelected, type: "file" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { "aria-label": "Import captions", className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME, disabled: isImporting, onClick: openCaptionSelection, renderAction: (color) => (jsx_runtime_1.jsx(upload_1.UploadIcon, { "aria-hidden": "true", color: color, focusable: "false", style: { height: 14, width: 14 } })), title: importTooltip, variant: null })] })), readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null] }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
|
|
121
|
+
jsx_runtime_1.jsx("input", { ref: fileInput, accept: ".json", "aria-label": "Import captions file", hidden: true, onChange: onFileSelected, type: "file" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { "aria-label": "Import captions", className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME, disabled: isImporting, onClick: openCaptionSelection, renderAction: (color) => (jsx_runtime_1.jsx(upload_1.UploadIcon, { "aria-hidden": "true", color: color, focusable: "false", style: { height: 14, width: 14 } })), title: importTooltip, variant: null })] })), readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null] }), expanded: expanded, label: "Captions", onToggle: captions.length > 0 ? onToggle : null }) }), expanded || captions.length === 0 ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
|
|
116
122
|
};
|
|
117
123
|
exports.CaptionInspector = CaptionInspector;
|
|
@@ -9,6 +9,7 @@ const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-
|
|
|
9
9
|
const checkerboard_1 = require("../state/checkerboard");
|
|
10
10
|
const ActionTooltip_1 = require("./ActionTooltip");
|
|
11
11
|
const ControlButton_1 = require("./ControlButton");
|
|
12
|
+
const buttonStyle = { width: 26 };
|
|
12
13
|
const CheckboardToggle = () => {
|
|
13
14
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
14
15
|
const onClick = (0, react_1.useCallback)(() => {
|
|
@@ -20,7 +21,7 @@ const CheckboardToggle = () => {
|
|
|
20
21
|
const ariaKeyShortcuts = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleCheckerboard');
|
|
21
22
|
const accessibilityLabel = 'Show transparency as checkerboard';
|
|
22
23
|
const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
23
|
-
return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label:
|
|
24
|
+
return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Checkerboard", shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-pressed": checkerboard, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined, onClick: onClick, style: buttonStyle, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
|
|
24
25
|
jsx_runtime_1.jsx("path", { fill: checkerboard ? colors_1.BLUE : color, d: "M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z" }), jsx_runtime_1.jsx("rect", { x: "48", y: "48", width: "416", height: "416", rx: "24", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" }), jsx_runtime_1.jsx("path", { d: "M256 48v416M48 256h416", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" })
|
|
25
26
|
] })) }) }));
|
|
26
27
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeFrame = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const LazySyntaxHighlightedSource_1 = require("./LazySyntaxHighlightedSource");
|
|
7
|
+
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
8
|
+
const frame = {
|
|
9
|
+
backgroundColor: colors_1.ERROR_CODE_FRAME_BACKGROUND,
|
|
10
|
+
borderRadius: 6,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
marginBottom: 20,
|
|
13
|
+
overflow: 'hidden',
|
|
14
|
+
};
|
|
15
|
+
const sourceContainer = {
|
|
16
|
+
flex: 1,
|
|
17
|
+
minWidth: 0,
|
|
18
|
+
overflowX: 'auto',
|
|
19
|
+
overscrollBehaviorX: 'none',
|
|
20
|
+
};
|
|
21
|
+
const lineNumberColumn = {
|
|
22
|
+
flexShrink: 0,
|
|
23
|
+
width: 60,
|
|
24
|
+
};
|
|
25
|
+
const lineNumber = {
|
|
26
|
+
whiteSpace: 'pre',
|
|
27
|
+
paddingRight: 12,
|
|
28
|
+
color: 'inherit',
|
|
29
|
+
lineHeight: 1.7,
|
|
30
|
+
width: 60,
|
|
31
|
+
flexShrink: 0,
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'flex-end',
|
|
35
|
+
fontFamily: 'monospace',
|
|
36
|
+
};
|
|
37
|
+
const CodeFrame = ({ source, lineNumberWidth, fontSize, horizontalMargin }) => {
|
|
38
|
+
return (jsx_runtime_1.jsxs("div", { style: {
|
|
39
|
+
...frame,
|
|
40
|
+
marginLeft: horizontalMargin,
|
|
41
|
+
marginRight: horizontalMargin,
|
|
42
|
+
}, children: [
|
|
43
|
+
jsx_runtime_1.jsx("div", { style: lineNumberColumn, children: source.map((s, j) => {
|
|
44
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
45
|
+
...lineNumber,
|
|
46
|
+
fontSize,
|
|
47
|
+
backgroundColor: s.highlight
|
|
48
|
+
? colors_1.ERROR_CODE_FRAME_BACKGROUND
|
|
49
|
+
: colors_1.ERROR_CODE_FRAME_LINE_BACKGROUND,
|
|
50
|
+
backgroundImage: s.highlight
|
|
51
|
+
? `linear-gradient(${colors_1.SELECTED_BACKGROUND}, ${colors_1.SELECTED_BACKGROUND})`
|
|
52
|
+
: undefined,
|
|
53
|
+
color: s.highlight ? colors_1.WHITE : colors_1.WHITE_ALPHA_40,
|
|
54
|
+
}, children: String(s.lineNumber).padStart(lineNumberWidth, ' ') }, j));
|
|
55
|
+
}) }), jsx_runtime_1.jsx("div", { style: sourceContainer, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx("div", { style: { minWidth: '100%', width: 'max-content' }, children: source.map((s, j) => {
|
|
56
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
57
|
+
backgroundColor: s.highlight
|
|
58
|
+
? colors_1.SELECTED_BACKGROUND
|
|
59
|
+
: colors_1.TRANSPARENT,
|
|
60
|
+
}, children: jsx_runtime_1.jsx("code", { className: "language-tsx", style: {
|
|
61
|
+
display: 'block',
|
|
62
|
+
fontFamily: 'monospace',
|
|
63
|
+
fontSize,
|
|
64
|
+
color: '#9cdcfe',
|
|
65
|
+
whiteSpace: 'pre',
|
|
66
|
+
tabSize: 2,
|
|
67
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
68
|
+
lineHeight: 1.7,
|
|
69
|
+
paddingRight: 12,
|
|
70
|
+
paddingLeft: 12,
|
|
71
|
+
paddingTop: 0,
|
|
72
|
+
paddingBottom: 0,
|
|
73
|
+
}, children: jsx_runtime_1.jsx(LazySyntaxHighlightedSource_1.LazySyntaxHighlightedSource, { source: s.content }) }) }, j));
|
|
74
|
+
}) }) })
|
|
75
|
+
] }));
|
|
76
|
+
};
|
|
77
|
+
exports.CodeFrame = CodeFrame;
|
|
@@ -67,7 +67,7 @@ const AlphaSlider = ({ hue, saturation, value, alpha, onChange, onChangeComplete
|
|
|
67
67
|
updateFromEvent(ev.clientX, false);
|
|
68
68
|
},
|
|
69
69
|
onEnd: (reason, ev) => {
|
|
70
|
-
const shouldUseEndEvent =
|
|
70
|
+
const shouldUseEndEvent = (0, pointer_session_1.isPointerSessionRelease)(reason, ev);
|
|
71
71
|
updateFromEvent(shouldUseEndEvent && ev ? ev.clientX : lastClientX, true);
|
|
72
72
|
},
|
|
73
73
|
});
|
|
@@ -49,7 +49,7 @@ const HueSlider = ({ hue, onChange, onChangeComplete }) => {
|
|
|
49
49
|
updateFromEvent(ev.clientX, false);
|
|
50
50
|
},
|
|
51
51
|
onEnd: (reason, ev) => {
|
|
52
|
-
const shouldUseEndEvent =
|
|
52
|
+
const shouldUseEndEvent = (0, pointer_session_1.isPointerSessionRelease)(reason, ev);
|
|
53
53
|
updateFromEvent(shouldUseEndEvent && ev ? ev.clientX : lastClientX, true);
|
|
54
54
|
},
|
|
55
55
|
});
|
|
@@ -63,7 +63,7 @@ const SaturationValueArea = ({ hue, saturation, value, onChange, onChangeComplet
|
|
|
63
63
|
updateFromEvent(ev.clientX, ev.clientY, false);
|
|
64
64
|
},
|
|
65
65
|
onEnd: (reason, ev) => {
|
|
66
|
-
const shouldUseEndEvent =
|
|
66
|
+
const shouldUseEndEvent = (0, pointer_session_1.isPointerSessionRelease)(reason, ev);
|
|
67
67
|
updateFromEvent(shouldUseEndEvent && ev ? ev.clientX : lastPosition.clientX, shouldUseEndEvent && ev ? ev.clientY : lastPosition.clientY, true);
|
|
68
68
|
},
|
|
69
69
|
});
|
|
@@ -238,6 +238,7 @@ const CompositionSelector = () => {
|
|
|
238
238
|
dryRun: false,
|
|
239
239
|
signal: controller.signal,
|
|
240
240
|
symbolicatedStack: (0, composition_selector_drag_data_1.compositionSelectorDragDataToSymbolicatedStack)(dragData),
|
|
241
|
+
undoRedoNavigation: null,
|
|
241
242
|
});
|
|
242
243
|
if (result.success) {
|
|
243
244
|
notification.dismiss();
|
|
@@ -4,7 +4,6 @@ exports.CompositionSelectorItem = void 0;
|
|
|
4
4
|
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
|
-
const client_id_1 = require("../helpers/client-id");
|
|
8
7
|
const colors_1 = require("../helpers/colors");
|
|
9
8
|
const hoverable_1 = require("../helpers/hoverable");
|
|
10
9
|
const noop_1 = require("../helpers/noop");
|
|
@@ -23,7 +22,7 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
|
23
22
|
const actions_1 = require("./RenderQueue/actions");
|
|
24
23
|
const SidebarRenderButton_1 = require("./SidebarRenderButton");
|
|
25
24
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
26
|
-
const
|
|
25
|
+
const use_open_in_menu_apps_1 = require("./use-open-in-menu-apps");
|
|
27
26
|
const itemStyle = {
|
|
28
27
|
paddingRight: 2,
|
|
29
28
|
paddingTop: 5,
|
|
@@ -193,9 +192,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
193
192
|
}
|
|
194
193
|
}, [onClick]);
|
|
195
194
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
196
|
-
const connectionStatus = (0,
|
|
197
|
-
.previewServerState.type;
|
|
198
|
-
const { defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(connectionStatus === 'connected');
|
|
195
|
+
const { connectionStatus, openInApps } = (0, use_open_in_menu_apps_1.useOpenInMenuApps)();
|
|
199
196
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(item.type === 'composition' ? item.composition.stack : item.folder.stack);
|
|
200
197
|
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
201
198
|
if (item.type === 'composition') {
|
|
@@ -203,9 +200,8 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
203
200
|
closeMenu: noop_1.noop,
|
|
204
201
|
composition: item.composition,
|
|
205
202
|
connectionStatus,
|
|
206
|
-
editorId: defaultEditorId,
|
|
207
|
-
editorName: defaultEditorName,
|
|
208
203
|
includeCompositionManagementItems: true,
|
|
204
|
+
openInApps,
|
|
209
205
|
resolvedLocation,
|
|
210
206
|
setSelectedModal,
|
|
211
207
|
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
@@ -214,21 +210,14 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
214
210
|
return (0, folder_menu_items_1.getFolderMenuItems)({
|
|
215
211
|
closeMenu: noop_1.noop,
|
|
216
212
|
connectionStatus,
|
|
217
|
-
editorId: defaultEditorId,
|
|
218
|
-
editorName: defaultEditorName,
|
|
213
|
+
editorId: openInApps.defaultEditorId,
|
|
214
|
+
editorName: openInApps.defaultEditorName,
|
|
219
215
|
folder: item.folder,
|
|
220
216
|
resolvedLocation,
|
|
221
217
|
setSelectedModal,
|
|
222
218
|
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
223
219
|
});
|
|
224
|
-
}, [
|
|
225
|
-
connectionStatus,
|
|
226
|
-
defaultEditorId,
|
|
227
|
-
defaultEditorName,
|
|
228
|
-
item,
|
|
229
|
-
resolvedLocation,
|
|
230
|
-
setSelectedModal,
|
|
231
|
-
]);
|
|
220
|
+
}, [connectionStatus, item, openInApps, resolvedLocation, setSelectedModal]);
|
|
232
221
|
const onItemDragStart = (0, react_1.useCallback)((event) => {
|
|
233
222
|
var _a, _b, _c, _d, _e;
|
|
234
223
|
if (window.remotion_isReadOnlyStudio) {
|
|
@@ -408,6 +397,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
408
397
|
dryRun: false,
|
|
409
398
|
signal: new AbortController().signal,
|
|
410
399
|
symbolicatedStack: (0, composition_selector_drag_data_1.compositionSelectorDragDataToSymbolicatedStack)(dragData),
|
|
400
|
+
undoRedoNavigation: null,
|
|
411
401
|
});
|
|
412
402
|
if (result.success) {
|
|
413
403
|
notification.dismiss();
|
|
@@ -25,6 +25,7 @@ const modals_1 = require("../state/modals");
|
|
|
25
25
|
const AssetAudioVolume_1 = require("./AssetAudioVolume");
|
|
26
26
|
const InlineEditableTitle_1 = require("./InlineEditableTitle");
|
|
27
27
|
const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
|
|
28
|
+
const CollapsibleInspectorSection_1 = require("./InspectorPanel/CollapsibleInspectorSection");
|
|
28
29
|
const common_1 = require("./InspectorPanel/common");
|
|
29
30
|
const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
|
|
30
31
|
const layout_1 = require("./layout");
|
|
@@ -246,12 +247,12 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
|
|
|
246
247
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
247
248
|
jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, minHeight: exports.CURRENT_ASSET_HEIGHT, padding: contentSized
|
|
248
249
|
? `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 6px`
|
|
249
|
-
: '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(
|
|
250
|
+
: '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(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: true, label: "File", sectionId: "asset-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(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: true, label: "Video", sectionId: "asset-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(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: mediaSections.audio.length > 0, label: "Audio", sectionId: "asset-audio", children: mediaSections.audio.length === 0 ? (jsx_runtime_1.jsx("div", { style: assetEmptyStateStyle, children: "None" })) : (jsx_runtime_1.jsxs("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))), src ? (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Average volume", children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: jsx_runtime_1.jsx(AssetAudioVolume_1.AssetAudioVolume, { src: (_d = volumeMetadata === null || volumeMetadata === void 0 ? void 0 : volumeMetadata.src) !== null && _d !== void 0 ? _d : null, waveformSampleRate: volumeMetadata
|
|
250
251
|
? Math.ceil(volumeMetadata.fps *
|
|
251
252
|
get_timeline_max_zoom_1.TIMELINE_FRAME_WIDTH_AT_MAX_ZOOM)
|
|
252
|
-
: null }, (_e = volumeMetadata === null || volumeMetadata === void 0 ? void 0 : volumeMetadata.src) !== null && _e !== void 0 ? _e : src) }) })) : null] })) })) : null, jsx_runtime_1.jsx(
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
: null }, (_e = volumeMetadata === null || volumeMetadata === void 0 ? void 0 : volumeMetadata.src) !== null && _e !== void 0 ? _e : src) }) })) : null] })) })) : null, jsx_runtime_1.jsx(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: true, label: "Actions", sectionId: "asset-actions", children: jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [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, src ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onTranscribe, renderIcon: (color) => (jsx_runtime_1.jsx(transcription_1.TranscriptionIcon, { color: color, style: quickActionIconStyle })), children: "Transcribe" })) : null, fileType === 'video' ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onTrackMatting, renderIcon: (color) => (jsx_runtime_1.jsx(separation_1.SeparationIcon, { color: color, style: quickActionIconStyle })), children: "Separate foreground" })) : null, 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",
|
|
254
|
+
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" }) })
|
|
255
|
+
] })) : 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" })] }) })
|
|
255
256
|
] }));
|
|
256
257
|
};
|
|
257
258
|
exports.AssetInfo = AssetInfo;
|
|
@@ -128,7 +128,7 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
128
128
|
pointerDownPositionRef.current = null;
|
|
129
129
|
const shouldDeleteGuide = shouldDeleteGuideRef.current;
|
|
130
130
|
finishGuideInteraction();
|
|
131
|
-
if (shouldDeleteGuide || reason
|
|
131
|
+
if (shouldDeleteGuide || !(0, pointer_session_1.isPointerSessionRelease)(reason, endEvent)) {
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
if ((0, editor_guide_selection_1.isGuidePointerUpAClick)({
|