@remotion/studio 4.0.491 → 4.0.492
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/AssetSelectorItem.js +7 -4
- package/dist/components/Canvas.js +1 -0
- package/dist/components/CompositionOrStillIcon.d.ts +7 -0
- package/dist/components/CompositionOrStillIcon.js +11 -0
- package/dist/components/CompositionSelector.js +13 -1
- package/dist/components/CompositionSelectorItem.js +33 -5
- package/dist/components/CurrentAsset.d.ts +6 -0
- package/dist/components/CurrentAsset.js +14 -8
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +12 -7
- package/dist/components/InspectorInfoHeader.d.ts +1 -0
- package/dist/components/InspectorInfoHeader.js +7 -4
- package/dist/components/InspectorPanel/SequenceCompositionsSection.d.ts +5 -0
- package/dist/components/InspectorPanel/SequenceCompositionsSection.js +37 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
- package/dist/components/InspectorPanel/common.js +1 -1
- package/dist/components/InspectorPanel/get-compositions-matching-single-child.d.ts +6 -0
- package/dist/components/InspectorPanel/get-compositions-matching-single-child.js +11 -0
- package/dist/components/InspectorSequenceSection.js +57 -3
- package/dist/components/NewComposition/NewComposition.js +11 -4
- package/dist/components/NewComposition/get-new-composition-defaults.d.ts +4 -0
- package/dist/components/NewComposition/get-new-composition-defaults.js +13 -0
- package/dist/components/Timeline/TimelineAssetField.d.ts +14 -0
- package/dist/components/Timeline/TimelineAssetField.js +125 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineRowChrome.js +8 -6
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +7 -0
- package/dist/components/Timeline/TimelineRowLayoutContext.js +13 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +1 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +3 -3
- package/dist/components/Timeline/sequence-props-subscription-store.js +5 -1
- package/dist/components/Timeline/timeline-asset-link.d.ts +6 -0
- package/dist/components/Timeline/timeline-asset-link.js +27 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +2 -2
- package/dist/components/Timeline/timeline-row-layout.d.ts +3 -2
- package/dist/components/Timeline/timeline-row-layout.js +6 -5
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +1 -0
- package/dist/components/import-assets.d.ts +10 -2
- package/dist/components/import-assets.js +20 -6
- package/dist/components/root-composition-menu-items.d.ts +8 -0
- package/dist/components/root-composition-menu-items.js +45 -0
- package/dist/esm/{chunk-9wh9k3jj.js → chunk-ewx0568t.js} +5366 -4870
- package/dist/esm/internals.mjs +5366 -4870
- package/dist/esm/previewEntry.mjs +4742 -4246
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/get-file-manager-name.d.ts +1 -0
- package/dist/helpers/get-file-manager-name.js +13 -0
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -1
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +8 -6
- package/dist/helpers/use-menu-structure.js +4 -2
- package/package.json +11 -11
|
@@ -43,6 +43,7 @@ const delete_static_file_1 = require("../api/delete-static-file");
|
|
|
43
43
|
const client_id_1 = require("../helpers/client-id");
|
|
44
44
|
const colors_1 = require("../helpers/colors");
|
|
45
45
|
const copy_text_1 = require("../helpers/copy-text");
|
|
46
|
+
const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
|
|
46
47
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
47
48
|
const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
|
|
48
49
|
const url_state_1 = require("../helpers/url-state");
|
|
@@ -165,6 +166,7 @@ const AssetFolderTree = ({ item, level, name, parentFolder, toggleFolder, tabInd
|
|
|
165
166
|
};
|
|
166
167
|
exports.AssetFolderTree = AssetFolderTree;
|
|
167
168
|
const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }) => {
|
|
169
|
+
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
168
170
|
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
169
171
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
170
172
|
const [isDragging, setIsDragging] = (0, react_1.useState)(false);
|
|
@@ -338,10 +340,10 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
338
340
|
{
|
|
339
341
|
id: 'open-asset-in-explorer',
|
|
340
342
|
keyHint: null,
|
|
341
|
-
label:
|
|
343
|
+
label: `Show in ${fileManagerName}`,
|
|
342
344
|
leftItem: null,
|
|
343
345
|
onClick: openAssetInExplorer,
|
|
344
|
-
quickSwitcherLabel:
|
|
346
|
+
quickSwitcherLabel: `Show asset in ${fileManagerName}`,
|
|
345
347
|
subMenu: null,
|
|
346
348
|
type: 'item',
|
|
347
349
|
value: 'open-asset-in-explorer',
|
|
@@ -380,8 +382,9 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
380
382
|
}, [
|
|
381
383
|
copyFileName,
|
|
382
384
|
copyStaticFilePath,
|
|
383
|
-
openAssetInExplorer,
|
|
384
385
|
deleteAsset,
|
|
386
|
+
fileManagerName,
|
|
387
|
+
openAssetInExplorer,
|
|
385
388
|
relativePath,
|
|
386
389
|
serverActionDisabled,
|
|
387
390
|
setSelectedModal,
|
|
@@ -397,6 +400,6 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
397
400
|
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("div", { ref: rowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, draggable: canDragAsset, onDragStart: onDragStart, onDragEnd: onDragEnd, tabIndex: tabIndex, title: item.name, children: [
|
|
398
401
|
jsx_runtime_1.jsx(file_1.FileIcon, { style: iconStyle, color: colors_1.LIGHT_TEXT }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.name }), hovered && !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
399
402
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: "Copy staticFile() path", renderAction: renderCopyAction, onClick: copyToClipboard }), serverActionDisabled ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
400
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title:
|
|
403
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: `Show in ${fileManagerName}`, renderAction: renderFileExplorerAction, onClick: revealInExplorer })
|
|
401
404
|
] }))] })) : null] }) }) }));
|
|
402
405
|
};
|
|
@@ -840,6 +840,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
840
840
|
composition: compositionDragData,
|
|
841
841
|
compositionFile,
|
|
842
842
|
compositionId: currentCompositionId,
|
|
843
|
+
destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
|
|
843
844
|
dropPosition,
|
|
844
845
|
});
|
|
845
846
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { _InternalTypes } from 'remotion';
|
|
3
|
+
export declare const CompositionOrStillIcon: React.FC<{
|
|
4
|
+
readonly color: string;
|
|
5
|
+
readonly composition: _InternalTypes['AnyComposition'];
|
|
6
|
+
readonly style: React.CSSProperties;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompositionOrStillIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const is_composition_still_1 = require("../helpers/is-composition-still");
|
|
6
|
+
const still_1 = require("../icons/still");
|
|
7
|
+
const video_1 = require("../icons/video");
|
|
8
|
+
const CompositionOrStillIcon = ({ color, composition, style }) => {
|
|
9
|
+
return (0, is_composition_still_1.isCompositionStill)(composition) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: style })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: style }));
|
|
10
|
+
};
|
|
11
|
+
exports.CompositionOrStillIcon = CompositionOrStillIcon;
|
|
@@ -6,6 +6,7 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
9
|
+
const client_id_1 = require("../helpers/client-id");
|
|
9
10
|
const colors_1 = require("../helpers/colors");
|
|
10
11
|
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
11
12
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
@@ -14,9 +15,11 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
14
15
|
const modals_1 = require("../state/modals");
|
|
15
16
|
const z_index_1 = require("../state/z-index");
|
|
16
17
|
const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
|
|
18
|
+
const ContextMenu_1 = require("./ContextMenu");
|
|
17
19
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
18
20
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
19
21
|
const actions_1 = require("./RenderQueue/actions");
|
|
22
|
+
const root_composition_menu_items_1 = require("./root-composition-menu-items");
|
|
20
23
|
const useCompositionNavigation = () => {
|
|
21
24
|
const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
22
25
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
@@ -107,6 +110,15 @@ const CompositionSelector = () => {
|
|
|
107
110
|
const { compositions, canvasContent, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
108
111
|
const { foldersExpanded } = (0, react_1.useContext)(persist_open_folders_1.ExpandedFoldersContext);
|
|
109
112
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
113
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
114
|
+
.previewServerState.type;
|
|
115
|
+
const rootContextMenuItems = (0, react_1.useMemo)(() => {
|
|
116
|
+
return (0, root_composition_menu_items_1.getRootCompositionMenuItems)({
|
|
117
|
+
connectionStatus,
|
|
118
|
+
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
119
|
+
setSelectedModal,
|
|
120
|
+
});
|
|
121
|
+
}, [connectionStatus, setSelectedModal]);
|
|
110
122
|
const [rootDragHovered, setRootDragHovered] = (0, react_1.useState)(false);
|
|
111
123
|
const listRef = (0, react_1.useRef)(null);
|
|
112
124
|
const autoScrollAnimation = (0, react_1.useRef)(null);
|
|
@@ -249,7 +261,7 @@ const CompositionSelector = () => {
|
|
|
249
261
|
}
|
|
250
262
|
}, [compositions, stopCompositionListAutoScroll]);
|
|
251
263
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
252
|
-
jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { ref: listRef, className: "__remotion-vertical-scrollbar", style: list, onDragOverCapture: onCompositionListDragOverCapture, onDragEndCapture: stopCompositionListAutoScroll, onDragOver: onRootDragOver, onDragLeave: onRootDragLeave, onDropCapture: stopCompositionListAutoScroll, onDrop: onRootDrop, children: items.map((c) => {
|
|
264
|
+
jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, values: rootContextMenuItems, onOpen: null }), jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { ref: listRef, className: "__remotion-vertical-scrollbar", style: list, onDragOverCapture: onCompositionListDragOverCapture, onDragEndCapture: stopCompositionListAutoScroll, onDragOver: onRootDragOver, onDragLeave: onRootDragLeave, onDropCapture: stopCompositionListAutoScroll, onDrop: onRootDrop, children: items.map((c) => {
|
|
253
265
|
return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
|
|
254
266
|
? canvasContent.compositionId
|
|
255
267
|
: null, selectComposition: selectComposition, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover, tabIndex: tabIndex, item: c }, c.key + c.type));
|
|
@@ -7,15 +7,14 @@ const react_1 = require("react");
|
|
|
7
7
|
const client_id_1 = require("../helpers/client-id");
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
9
|
const get_folder_id_1 = require("../helpers/get-folder-id");
|
|
10
|
-
const is_composition_still_1 = require("../helpers/is-composition-still");
|
|
11
10
|
const noop_1 = require("../helpers/noop");
|
|
12
11
|
const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
|
|
12
|
+
const url_state_1 = require("../helpers/url-state");
|
|
13
13
|
const folder_1 = require("../icons/folder");
|
|
14
|
-
const still_1 = require("../icons/still");
|
|
15
|
-
const video_1 = require("../icons/video");
|
|
16
14
|
const modals_1 = require("../state/modals");
|
|
17
15
|
const composition_menu_items_1 = require("./composition-menu-items");
|
|
18
16
|
const CompositionContextButton_1 = require("./CompositionContextButton");
|
|
17
|
+
const CompositionOrStillIcon_1 = require("./CompositionOrStillIcon");
|
|
19
18
|
const ContextMenu_1 = require("./ContextMenu");
|
|
20
19
|
const folder_menu_items_1 = require("./folder-menu-items");
|
|
21
20
|
const layout_1 = require("./layout");
|
|
@@ -119,7 +118,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
119
118
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(item.type === 'composition' ? item.composition.stack : item.folder.stack);
|
|
120
119
|
const contextMenu = (0, react_1.useMemo)(() => {
|
|
121
120
|
if (item.type === 'composition') {
|
|
122
|
-
|
|
121
|
+
const compositionMenuItems = (0, composition_menu_items_1.getCompositionMenuItems)({
|
|
123
122
|
closeMenu: noop_1.noop,
|
|
124
123
|
composition: item.composition,
|
|
125
124
|
connectionStatus,
|
|
@@ -127,6 +126,34 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
127
126
|
setSelectedModal,
|
|
128
127
|
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
129
128
|
});
|
|
129
|
+
return [
|
|
130
|
+
{
|
|
131
|
+
id: 'open-in-new-window',
|
|
132
|
+
keyHint: null,
|
|
133
|
+
label: 'Open in new window',
|
|
134
|
+
leftItem: null,
|
|
135
|
+
onClick: () => {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
const screen = window.screen;
|
|
138
|
+
const width = Math.min(1200, Math.floor(screen.availWidth * 0.8));
|
|
139
|
+
const height = Math.min(800, Math.floor(screen.availHeight * 0.8));
|
|
140
|
+
const displayLeft = (_a = screen.availLeft) !== null && _a !== void 0 ? _a : 0;
|
|
141
|
+
const displayTop = (_b = screen.availTop) !== null && _b !== void 0 ? _b : 0;
|
|
142
|
+
const left = Math.round(Math.min(Math.max(window.screenX + (window.outerWidth - width) / 2, displayLeft), displayLeft + screen.availWidth - width));
|
|
143
|
+
const top = Math.round(Math.min(Math.max(window.screenY + (window.outerHeight - height) / 2, displayTop), displayTop + screen.availHeight - height));
|
|
144
|
+
window.open((0, url_state_1.getUrlForRoute)(`/${item.composition.id}`), '_blank', `popup,width=${width},height=${height},left=${left},top=${top}`);
|
|
145
|
+
},
|
|
146
|
+
quickSwitcherLabel: null,
|
|
147
|
+
subMenu: null,
|
|
148
|
+
type: 'item',
|
|
149
|
+
value: 'open-in-new-window',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: 'divider',
|
|
153
|
+
id: 'open-in-new-window-divider',
|
|
154
|
+
},
|
|
155
|
+
...compositionMenuItems,
|
|
156
|
+
];
|
|
130
157
|
}
|
|
131
158
|
return (0, folder_menu_items_1.getFolderMenuItems)({
|
|
132
159
|
closeMenu: noop_1.noop,
|
|
@@ -231,7 +258,8 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
231
258
|
return (jsx_runtime_1.jsx(exports.CompositionSelectorItem, { currentComposition: currentComposition, selectComposition: selectComposition, item: childItem, tabIndex: tabIndex, level: level + 1, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover }, childItem.key + childItem.type));
|
|
232
259
|
}) })) : null] }));
|
|
233
260
|
}
|
|
234
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, draggable: !window.remotion_isReadOnlyStudio, onDragStart: onCompositionDragStart, type: "button", title: item.composition.id, className: "__remotion-composition", "data-compname": item.composition.id, children: [
|
|
261
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, draggable: !window.remotion_isReadOnlyStudio, onDragStart: onCompositionDragStart, type: "button", title: item.composition.id, className: "__remotion-composition", "data-compname": item.composition.id, children: [
|
|
262
|
+
jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { composition: item.composition, color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.composition.id }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { values: contextMenu, visible: hovered }), jsx_runtime_1.jsx(SidebarRenderButton_1.SidebarRenderButton, { visible: hovered, composition: item.composition })
|
|
235
263
|
] }) }) }));
|
|
236
264
|
};
|
|
237
265
|
exports.CompositionSelectorItem = CompositionSelectorItem;
|
|
@@ -3,6 +3,12 @@ import type { MediaMetadata } from '../helpers/use-media-metadata';
|
|
|
3
3
|
export declare const CURRENT_ASSET_HEIGHT = 84;
|
|
4
4
|
export declare const getCurrentAssetMetadataSource: (assetName: string | null) => string | null;
|
|
5
5
|
export declare const getCurrentAssetMediaDetailLines: (mediaMetadata: MediaMetadata) => string[];
|
|
6
|
+
export declare const AssetInfo: React.FC<{
|
|
7
|
+
readonly assetName: string | null;
|
|
8
|
+
readonly contentSized?: boolean;
|
|
9
|
+
readonly onAssetClick?: () => void;
|
|
10
|
+
readonly readOnlyStudio: boolean;
|
|
11
|
+
}>;
|
|
6
12
|
export declare const CurrentAsset: React.FC<{
|
|
7
13
|
readonly readOnlyStudio: boolean;
|
|
8
14
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CurrentAsset = exports.getCurrentAssetMediaDetailLines = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
|
|
3
|
+
exports.CurrentAsset = exports.AssetInfo = exports.getCurrentAssetMediaDetailLines = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -55,12 +55,10 @@ const getCurrentAssetMediaDetailLines = (mediaMetadata) => {
|
|
|
55
55
|
return detailLines;
|
|
56
56
|
};
|
|
57
57
|
exports.getCurrentAssetMediaDetailLines = getCurrentAssetMediaDetailLines;
|
|
58
|
-
const
|
|
58
|
+
const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStudio }) => {
|
|
59
59
|
var _a;
|
|
60
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
61
60
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
62
61
|
.previewServerState.type;
|
|
63
|
-
const assetName = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
|
|
64
62
|
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
65
63
|
const renameFile = (0, use_rename_static_file_1.useRenameStaticFile)({
|
|
66
64
|
relativePath: assetName !== null && assetName !== void 0 ? assetName : '',
|
|
@@ -76,12 +74,14 @@ const CurrentAsset = ({ readOnlyStudio }) => {
|
|
|
76
74
|
}, [assetName, staticFiles]);
|
|
77
75
|
const src = (0, exports.getCurrentAssetMetadataSource)(assetName);
|
|
78
76
|
const mediaMetadata = (0, use_media_metadata_1.useMediaMetadata)(src);
|
|
79
|
-
const canRename =
|
|
77
|
+
const canRename = onAssetClick === undefined &&
|
|
78
|
+
connectionStatus === 'connected' &&
|
|
79
|
+
!readOnlyStudio;
|
|
80
80
|
const onRename = (0, react_1.useCallback)((newName) => {
|
|
81
81
|
renameFile(newName).catch(() => undefined);
|
|
82
82
|
}, [renameFile]);
|
|
83
83
|
if (!assetName) {
|
|
84
|
-
return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, {});
|
|
84
|
+
return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized });
|
|
85
85
|
}
|
|
86
86
|
const fileName = (_a = assetName.split('/').pop()) !== null && _a !== void 0 ? _a : assetName;
|
|
87
87
|
const subtitleParts = [];
|
|
@@ -99,9 +99,15 @@ const CurrentAsset = ({ readOnlyStudio }) => {
|
|
|
99
99
|
const mediaDetailLines = mediaMetadata
|
|
100
100
|
? (0, exports.getCurrentAssetMediaDetailLines)(mediaMetadata)
|
|
101
101
|
: [];
|
|
102
|
-
return (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { children: [
|
|
103
|
-
jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onCommit: onRename, title: assetName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null, mediaDetailLines.map((line) => {
|
|
102
|
+
return (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, children: [
|
|
103
|
+
jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, title: assetName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null, mediaDetailLines.map((line) => {
|
|
104
104
|
return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: line }, line);
|
|
105
105
|
})] }));
|
|
106
106
|
};
|
|
107
|
+
exports.AssetInfo = AssetInfo;
|
|
108
|
+
const CurrentAsset = ({ readOnlyStudio }) => {
|
|
109
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
110
|
+
const assetName = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
|
|
111
|
+
return jsx_runtime_1.jsx(exports.AssetInfo, { assetName: assetName, readOnlyStudio: readOnlyStudio });
|
|
112
|
+
};
|
|
107
113
|
exports.CurrentAsset = CurrentAsset;
|
|
@@ -3,6 +3,7 @@ export declare const InlineEditableTitle: React.FC<{
|
|
|
3
3
|
readonly value: string;
|
|
4
4
|
readonly canRename: boolean;
|
|
5
5
|
readonly getInitialSelection?: (value: string) => [number, number];
|
|
6
|
+
readonly onClick?: () => void;
|
|
6
7
|
readonly onCommit: (newValue: string) => void;
|
|
7
8
|
readonly title?: string;
|
|
8
9
|
}>;
|
|
@@ -53,7 +53,7 @@ const titleInput = {
|
|
|
53
53
|
WebkitAppearance: 'none',
|
|
54
54
|
width: '100%',
|
|
55
55
|
};
|
|
56
|
-
const InlineEditableTitle = ({ value, canRename, getInitialSelection, onCommit, title }) => {
|
|
56
|
+
const InlineEditableTitle = ({ value, canRename, getInitialSelection, onClick, onCommit, title }) => {
|
|
57
57
|
const [isEditing, setIsEditing] = (0, react_1.useState)(false);
|
|
58
58
|
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
59
59
|
const [draftValue, setDraftValue] = (0, react_1.useState)(value);
|
|
@@ -84,14 +84,18 @@ const InlineEditableTitle = ({ value, canRename, getInitialSelection, onCommit,
|
|
|
84
84
|
setIsEditing(false);
|
|
85
85
|
onCommit(newValue);
|
|
86
86
|
}, [onCommit]);
|
|
87
|
-
const
|
|
87
|
+
const handleClick = (0, react_1.useCallback)(() => {
|
|
88
|
+
if (onClick) {
|
|
89
|
+
onClick();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
88
92
|
if (!canRename) {
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
95
|
cancelledRef.current = false;
|
|
92
96
|
setDraftValue(value);
|
|
93
97
|
setIsEditing(true);
|
|
94
|
-
}, [canRename, value]);
|
|
98
|
+
}, [canRename, onClick, value]);
|
|
95
99
|
const onChange = (0, react_1.useCallback)((e) => {
|
|
96
100
|
setDraftValue(e.target.value);
|
|
97
101
|
}, []);
|
|
@@ -111,21 +115,22 @@ const InlineEditableTitle = ({ value, canRename, getInitialSelection, onCommit,
|
|
|
111
115
|
setIsEditing(false);
|
|
112
116
|
}
|
|
113
117
|
}, [value]);
|
|
118
|
+
const isInteractive = canRename || onClick !== undefined;
|
|
114
119
|
const backgroundColor = isEditing
|
|
115
120
|
? colors_1.INPUT_BACKGROUND
|
|
116
|
-
: isHovered &&
|
|
121
|
+
: isHovered && isInteractive
|
|
117
122
|
? colors_1.WHITE_ALPHA_06
|
|
118
123
|
: colors_1.TRANSPARENT;
|
|
119
124
|
const innerStyle = (0, react_1.useMemo)(() => {
|
|
120
125
|
return {
|
|
121
126
|
...titleInner,
|
|
122
127
|
backgroundColor,
|
|
123
|
-
cursor: isEditing ? 'text' :
|
|
128
|
+
cursor: isEditing ? 'text' : isInteractive ? 'pointer' : 'default',
|
|
124
129
|
userSelect: isEditing ? 'text' : 'none',
|
|
125
130
|
width: isEditing ? '100%' : undefined,
|
|
126
131
|
};
|
|
127
|
-
}, [backgroundColor,
|
|
128
|
-
return (jsx_runtime_1.jsx("div", { style: titleWrapper, title: title !== null && title !== void 0 ? title : value, children: jsx_runtime_1.jsxs("span", { style: innerStyle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: isEditing || !
|
|
132
|
+
}, [backgroundColor, isEditing, isInteractive]);
|
|
133
|
+
return (jsx_runtime_1.jsx("div", { style: titleWrapper, title: title !== null && title !== void 0 ? title : value, children: jsx_runtime_1.jsxs("span", { style: innerStyle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: isEditing || !isInteractive ? undefined : handleClick, children: [
|
|
129
134
|
jsx_runtime_1.jsx("span", { "aria-hidden": isEditing, style: {
|
|
130
135
|
...titleGridItem,
|
|
131
136
|
visibility: isEditing ? 'hidden' : 'visible',
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const INSPECTOR_INFO_HEADER_MIN_HEIGHT = 84;
|
|
3
3
|
export declare const InspectorInfoHeader: React.FC<{
|
|
4
4
|
readonly children?: React.ReactNode;
|
|
5
|
+
readonly contentSized?: boolean;
|
|
5
6
|
}>;
|
|
6
7
|
export declare const InspectorInfoTitle: React.FC<{
|
|
7
8
|
readonly children: React.ReactNode;
|
|
@@ -5,13 +5,16 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const colors_1 = require("../helpers/colors");
|
|
6
6
|
const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
|
|
7
7
|
exports.INSPECTOR_INFO_HEADER_MIN_HEIGHT = 84;
|
|
8
|
-
const
|
|
8
|
+
const containerBase = {
|
|
9
9
|
backgroundColor: colors_1.BACKGROUND,
|
|
10
10
|
color: colors_1.WHITE,
|
|
11
11
|
display: 'block',
|
|
12
|
-
minHeight: exports.INSPECTOR_INFO_HEADER_MIN_HEIGHT,
|
|
13
12
|
padding: `6px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px`,
|
|
14
13
|
};
|
|
14
|
+
const container = {
|
|
15
|
+
...containerBase,
|
|
16
|
+
minHeight: exports.INSPECTOR_INFO_HEADER_MIN_HEIGHT,
|
|
17
|
+
};
|
|
15
18
|
const row = {
|
|
16
19
|
backgroundColor: colors_1.BACKGROUND,
|
|
17
20
|
display: 'flex',
|
|
@@ -41,8 +44,8 @@ const subtitle = {
|
|
|
41
44
|
textOverflow: 'ellipsis',
|
|
42
45
|
whiteSpace: 'nowrap',
|
|
43
46
|
};
|
|
44
|
-
const InspectorInfoHeader = ({ children }) => {
|
|
45
|
-
return (jsx_runtime_1.jsx("div", { style: container, children: children === undefined || children === null ? null : (jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsx("div", { style: content, children: children }) })) }));
|
|
47
|
+
const InspectorInfoHeader = ({ children, contentSized = false }) => {
|
|
48
|
+
return (jsx_runtime_1.jsx("div", { style: contentSized ? containerBase : container, children: children === undefined || children === null ? null : (jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsx("div", { style: content, children: children }) })) }));
|
|
46
49
|
};
|
|
47
50
|
exports.InspectorInfoHeader = InspectorInfoHeader;
|
|
48
51
|
const InspectorInfoTitle = ({ children }) => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequenceCompositionsSection = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
|
|
8
|
+
const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
|
|
9
|
+
const common_1 = require("./common");
|
|
10
|
+
const get_compositions_matching_single_child_1 = require("./get-compositions-matching-single-child");
|
|
11
|
+
const styles_1 = require("./styles");
|
|
12
|
+
const compositionIconStyle = {
|
|
13
|
+
height: 13,
|
|
14
|
+
width: 13,
|
|
15
|
+
};
|
|
16
|
+
const compositionListStyle = {
|
|
17
|
+
...styles_1.detailsContainer,
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
paddingBottom: 6,
|
|
21
|
+
paddingTop: 6,
|
|
22
|
+
};
|
|
23
|
+
const SequenceCompositionsSection = ({ track }) => {
|
|
24
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
25
|
+
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
26
|
+
const matchingCompositions = (0, react_1.useMemo)(() => (0, get_compositions_matching_single_child_1.getCompositionsMatchingSingleChild)({
|
|
27
|
+
compositions,
|
|
28
|
+
singleChildComponent: track.sequence.singleChildComponent,
|
|
29
|
+
}), [compositions, track.sequence.singleChildComponent]);
|
|
30
|
+
if (matchingCompositions.length === 0) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
34
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsx("div", { style: compositionListStyle, children: matchingCompositions.map((composition) => (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }, composition.id))) })
|
|
35
|
+
] }));
|
|
36
|
+
};
|
|
37
|
+
exports.SequenceCompositionsSection = SequenceCompositionsSection;
|
|
@@ -9,6 +9,7 @@ const InspectorLocationCopy_1 = require("../InspectorLocationCopy");
|
|
|
9
9
|
const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
|
|
10
10
|
const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
|
|
11
11
|
const use_rename_sequence_1 = require("../Timeline/use-rename-sequence");
|
|
12
|
+
const SequenceCompositionsSection_1 = require("./SequenceCompositionsSection");
|
|
12
13
|
const styles_1 = require("./styles");
|
|
13
14
|
const useSequenceInspectorSourceLocation = (sequence) => {
|
|
14
15
|
const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_editor_1.useOpenSequenceInEditor)(sequence);
|
|
@@ -75,7 +76,7 @@ exports.SequenceInspectorHeader = SequenceInspectorHeader;
|
|
|
75
76
|
const SequenceInspectorHeaderWithDivider = ({ track }) => {
|
|
76
77
|
const sourceLocation = (0, exports.useSequenceInspectorSourceLocation)(track.sequence);
|
|
77
78
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
78
|
-
jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider })
|
|
79
|
+
jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(SequenceCompositionsSection_1.SequenceCompositionsSection, { track: track }), jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider })
|
|
79
80
|
] }));
|
|
80
81
|
};
|
|
81
82
|
exports.SequenceInspectorHeaderWithDivider = SequenceInspectorHeaderWithDivider;
|
|
@@ -9,6 +9,7 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
|
9
9
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
10
10
|
const AlignmentControls_1 = require("./AlignmentControls");
|
|
11
11
|
const common_1 = require("./common");
|
|
12
|
+
const SequenceCompositionsSection_1 = require("./SequenceCompositionsSection");
|
|
12
13
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
13
14
|
const styles_1 = require("./styles");
|
|
14
15
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
@@ -52,7 +53,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
52
53
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
53
54
|
}
|
|
54
55
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
55
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })), renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) })] }));
|
|
56
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(SequenceCompositionsSection_1.SequenceCompositionsSection, { track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })), renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) })] }));
|
|
56
57
|
};
|
|
57
58
|
const SequenceSelectionInspector = ({ selection }) => {
|
|
58
59
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getCompositionsMatchingSingleChild: <Composition extends {
|
|
2
|
+
readonly componentFromProps?: unknown;
|
|
3
|
+
}>({ compositions, singleChildComponent, }: {
|
|
4
|
+
readonly compositions: readonly Composition[];
|
|
5
|
+
readonly singleChildComponent: unknown;
|
|
6
|
+
}) => Composition[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCompositionsMatchingSingleChild = void 0;
|
|
4
|
+
const getCompositionsMatchingSingleChild = ({ compositions, singleChildComponent, }) => {
|
|
5
|
+
if (singleChildComponent === null ||
|
|
6
|
+
typeof singleChildComponent === 'undefined') {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return compositions.filter((composition) => composition.componentFromProps === singleChildComponent);
|
|
10
|
+
};
|
|
11
|
+
exports.getCompositionsMatchingSingleChild = getCompositionsMatchingSingleChild;
|
|
@@ -41,11 +41,16 @@ const colors_1 = require("../helpers/colors");
|
|
|
41
41
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
42
42
|
const plus_1 = require("../icons/plus");
|
|
43
43
|
const modals_1 = require("../state/modals");
|
|
44
|
+
const CurrentAsset_1 = require("./CurrentAsset");
|
|
44
45
|
const InlineAction_1 = require("./InlineAction");
|
|
45
46
|
const styles_1 = require("./InspectorPanel/styles");
|
|
47
|
+
const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
|
|
48
|
+
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
46
49
|
const TimelineExpandedRow_1 = require("./Timeline/TimelineExpandedRow");
|
|
50
|
+
const TimelineRowLayoutContext_1 = require("./Timeline/TimelineRowLayoutContext");
|
|
47
51
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
48
52
|
const use_timeline_expanded_tree_1 = require("./Timeline/use-timeline-expanded-tree");
|
|
53
|
+
const use_select_asset_1 = require("./use-select-asset");
|
|
49
54
|
const container = {
|
|
50
55
|
color: colors_1.WHITE,
|
|
51
56
|
display: 'flex',
|
|
@@ -72,6 +77,38 @@ const plusIcon = {
|
|
|
72
77
|
width: 15,
|
|
73
78
|
height: 15,
|
|
74
79
|
};
|
|
80
|
+
const remoteSourceLabel = {
|
|
81
|
+
color: colors_1.LIGHT_TEXT,
|
|
82
|
+
display: 'flex',
|
|
83
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
84
|
+
fontSize: 12,
|
|
85
|
+
lineHeight: '18px',
|
|
86
|
+
minWidth: 0,
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
padding: `6px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px`,
|
|
89
|
+
whiteSpace: 'nowrap',
|
|
90
|
+
};
|
|
91
|
+
const remoteSourceLeading = {
|
|
92
|
+
color: colors_1.LIGHT_TEXT,
|
|
93
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
94
|
+
fontSize: 12,
|
|
95
|
+
lineHeight: '18px',
|
|
96
|
+
minWidth: 0,
|
|
97
|
+
overflow: 'hidden',
|
|
98
|
+
textOverflow: 'ellipsis',
|
|
99
|
+
whiteSpace: 'nowrap',
|
|
100
|
+
};
|
|
101
|
+
const remoteSourceTrailing = {
|
|
102
|
+
color: colors_1.LIGHT_TEXT,
|
|
103
|
+
flexShrink: 0,
|
|
104
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
105
|
+
fontSize: 12,
|
|
106
|
+
lineHeight: '18px',
|
|
107
|
+
maxWidth: '55%',
|
|
108
|
+
overflow: 'hidden',
|
|
109
|
+
textOverflow: 'ellipsis',
|
|
110
|
+
whiteSpace: 'nowrap',
|
|
111
|
+
};
|
|
75
112
|
const isEffectsRoot = (node) => {
|
|
76
113
|
if (node.kind !== 'group' || node.effectInfo !== null) {
|
|
77
114
|
return false;
|
|
@@ -138,10 +175,22 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
138
175
|
sequence,
|
|
139
176
|
nodePathInfo,
|
|
140
177
|
includeTextContent: true,
|
|
178
|
+
includeSourceControls: true,
|
|
141
179
|
});
|
|
142
180
|
const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(loadInspectorCollapsedKeys);
|
|
143
181
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
144
182
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
183
|
+
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
184
|
+
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls);
|
|
185
|
+
const assetLinkInfo = (0, react_1.useMemo)(() => (mediaSrc ? (0, timeline_asset_link_1.getTimelineAssetLinkInfo)(mediaSrc) : null), [mediaSrc]);
|
|
186
|
+
const localAsset = (assetLinkInfo === null || assetLinkInfo === void 0 ? void 0 : assetLinkInfo.kind) === 'local' ? assetLinkInfo : null;
|
|
187
|
+
const remoteAsset = (assetLinkInfo === null || assetLinkInfo === void 0 ? void 0 : assetLinkInfo.kind) === 'remote' ? assetLinkInfo : null;
|
|
188
|
+
const remoteSourceParts = (0, react_1.useMemo)(() => remoteAsset ? (0, timeline_asset_link_1.splitRemoteSourceForMiddleEllipsis)(remoteAsset.href) : null, [remoteAsset]);
|
|
189
|
+
const jumpToAsset = (0, react_1.useCallback)(() => {
|
|
190
|
+
if (localAsset) {
|
|
191
|
+
(0, timeline_asset_link_1.openTimelineAssetLink)(localAsset, selectAsset);
|
|
192
|
+
}
|
|
193
|
+
}, [localAsset, selectAsset]);
|
|
145
194
|
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
146
195
|
return !collapsedKeys.has(getInspectorExpansionKey(candidate));
|
|
147
196
|
}, [collapsedKeys]);
|
|
@@ -183,7 +232,10 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
183
232
|
}),
|
|
184
233
|
};
|
|
185
234
|
}, [getIsExpanded, tree]);
|
|
186
|
-
const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(controlRows)
|
|
235
|
+
const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(controlRows.filter(({ node }) => {
|
|
236
|
+
var _a;
|
|
237
|
+
return node.kind !== 'field' || ((_a = node.field) === null || _a === void 0 ? void 0 : _a.key) !== 'src';
|
|
238
|
+
})), [controlRows]);
|
|
187
239
|
const effectSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(effectRows), [effectRows]);
|
|
188
240
|
const controlGroups = (0, react_1.useMemo)(() => getInspectorControlGroups(controlRows), [controlRows]);
|
|
189
241
|
const { schema } = sequence.controls;
|
|
@@ -214,7 +266,7 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
214
266
|
jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
|
|
215
267
|
};
|
|
216
268
|
const renderRow = ({ node, depth }) => {
|
|
217
|
-
return (jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }, JSON.stringify(node.nodePathInfo)));
|
|
269
|
+
return (jsx_runtime_1.jsx(TimelineRowLayoutContext_1.TimelineRowLayoutContext.Provider, { value: TimelineRowLayoutContext_1.INSPECTOR_TIMELINE_ROW_LAYOUT, children: jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }) }, JSON.stringify(node.nodePathInfo)));
|
|
218
270
|
};
|
|
219
271
|
if (controlRows.length === 0 && !showEffectsSection) {
|
|
220
272
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
@@ -222,6 +274,8 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
222
274
|
] }));
|
|
223
275
|
}
|
|
224
276
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
225
|
-
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider }), controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group, i) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i === 0 ? null : jsx_runtime_1.jsx("div", { style: controlsEffectsDivider }), renderSectionHeader(group.label), group.id === '
|
|
277
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider }), controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group, i) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i === 0 ? null : jsx_runtime_1.jsx("div", { style: controlsEffectsDivider }), renderSectionHeader(group.label), group.id === 'source' && localAsset ? (jsx_runtime_1.jsx(CurrentAsset_1.AssetInfo, { assetName: localAsset.assetPath, contentSized: true, onAssetClick: jumpToAsset, readOnlyStudio: true })) : null, group.id === 'source' && remoteAsset && remoteSourceParts ? (jsx_runtime_1.jsxs("div", { style: remoteSourceLabel, title: remoteAsset.href, children: [
|
|
278
|
+
jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: remoteSourceParts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: remoteSourceParts.trailing })
|
|
279
|
+
] })) : null, group.id === 'transforms' ? renderTransformControls() : null, group.id === 'source' ? null : group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showControlsEffectsDivider ? (jsx_runtime_1.jsx("div", { style: controlsEffectsDivider })) : null, renderEffectsHeader(), effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null] })) : null] }));
|
|
226
280
|
};
|
|
227
281
|
exports.InspectorSequenceSection = InspectorSequenceSection;
|