@remotion/studio 4.0.499 → 4.0.500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelector.js +8 -6
- package/dist/components/AssetSelectorItem.d.ts +24 -0
- package/dist/components/AssetSelectorItem.js +113 -80
- package/dist/components/CompositionSelector.js +2 -32
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/GlobalKeybindings.js +7 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +8 -7
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -7
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorSequenceSection.js +43 -19
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +8 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +7 -0
- package/dist/components/NewComposition/InputDragger.js +119 -8
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +44 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +76 -12
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +83 -43
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +130 -8
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +52 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +7 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -5
- package/dist/components/Timeline/TimelineSelection.js +8 -6
- package/dist/components/Timeline/TimelineSequence.js +1 -5
- package/dist/components/Timeline/TimelineSequenceItem.js +57 -10
- package/dist/components/Timeline/TimelineSequencePropItem.js +27 -75
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +18 -10
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/TopPanel.js +2 -2
- package/dist/components/UndoRedoButtons.js +27 -5
- package/dist/components/composition-drop-preview.js +1 -0
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-pk1zwsn1.js → chunk-dr1y1vm3.js} +8417 -7127
- package/dist/esm/internals.mjs +8417 -7127
- package/dist/esm/previewEntry.mjs +51241 -49953
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +15 -1
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-menu-structure.js +10 -1
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/state/modals.d.ts +5 -0
- package/package.json +12 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -16,7 +16,7 @@ const portals_1 = require("./portals");
|
|
|
16
16
|
const styles_1 = require("./styles");
|
|
17
17
|
const container = {
|
|
18
18
|
fontSize: 13,
|
|
19
|
-
color: colors_1.
|
|
19
|
+
color: colors_1.WHITE_ALPHA_80,
|
|
20
20
|
paddingLeft: 10,
|
|
21
21
|
paddingRight: 10,
|
|
22
22
|
cursor: 'default',
|
|
@@ -37,6 +37,7 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
37
37
|
const containerStyle = (0, react_1.useMemo)(() => {
|
|
38
38
|
return {
|
|
39
39
|
...container,
|
|
40
|
+
color: hovered || selected ? colors_1.WHITE : colors_1.WHITE_ALPHA_80,
|
|
40
41
|
backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
|
|
41
42
|
hovered,
|
|
42
43
|
selected,
|
|
@@ -6,8 +6,10 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../helpers/client-id");
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
|
+
const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
|
|
9
10
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
10
11
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
12
|
+
const actions_1 = require("./RenderQueue/actions");
|
|
11
13
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
12
14
|
const baseStyle = {
|
|
13
15
|
color: 'inherit',
|
|
@@ -35,7 +37,7 @@ const slashStyle = {
|
|
|
35
37
|
top: 1,
|
|
36
38
|
};
|
|
37
39
|
const MenuCompositionName = () => {
|
|
38
|
-
var _a;
|
|
40
|
+
var _a, _b;
|
|
39
41
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
40
42
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
41
43
|
.previewServerState.type;
|
|
@@ -48,17 +50,30 @@ const MenuCompositionName = () => {
|
|
|
48
50
|
}
|
|
49
51
|
return ((_a = compositions.find((c) => c.id === canvasContent.compositionId)) !== null && _a !== void 0 ? _a : null);
|
|
50
52
|
}, [canvasContent, compositions]);
|
|
53
|
+
const asset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
|
|
51
54
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = composition === null || composition === void 0 ? void 0 : composition.stack) !== null && _a !== void 0 ? _a : null);
|
|
52
|
-
const
|
|
55
|
+
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
56
|
+
const canOpenComposition = resolvedLocation &&
|
|
53
57
|
window.remotion_editorName &&
|
|
54
58
|
connectionStatus === 'connected';
|
|
59
|
+
const canOpenAsset = asset !== null &&
|
|
60
|
+
window.remotion_publicFolderExists !== null &&
|
|
61
|
+
connectionStatus === 'connected';
|
|
62
|
+
const canOpen = canOpenComposition || canOpenAsset;
|
|
55
63
|
const handleClick = (0, react_1.useCallback)(async () => {
|
|
56
|
-
if (!canOpen ||
|
|
64
|
+
if (!canOpen || opening) {
|
|
57
65
|
return;
|
|
58
66
|
}
|
|
59
67
|
setOpening(true);
|
|
60
68
|
try {
|
|
61
|
-
|
|
69
|
+
if (asset !== null && window.remotion_publicFolderExists !== null) {
|
|
70
|
+
await (0, actions_1.openInFileExplorer)({
|
|
71
|
+
directory: `${window.remotion_publicFolderExists}/${asset}`,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else if (resolvedLocation) {
|
|
75
|
+
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation);
|
|
76
|
+
}
|
|
62
77
|
}
|
|
63
78
|
catch (err) {
|
|
64
79
|
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
@@ -66,16 +81,24 @@ const MenuCompositionName = () => {
|
|
|
66
81
|
finally {
|
|
67
82
|
setOpening(false);
|
|
68
83
|
}
|
|
69
|
-
}, [canOpen, resolvedLocation]);
|
|
70
|
-
if (!composition) {
|
|
84
|
+
}, [asset, canOpen, opening, resolvedLocation]);
|
|
85
|
+
if (!composition && asset === null) {
|
|
71
86
|
return null;
|
|
72
87
|
}
|
|
88
|
+
const name = (_b = composition === null || composition === void 0 ? void 0 : composition.id) !== null && _b !== void 0 ? _b : asset;
|
|
89
|
+
const title = composition
|
|
90
|
+
? canOpenComposition
|
|
91
|
+
? `Open in ${window.remotion_editorName}`
|
|
92
|
+
: composition.id
|
|
93
|
+
: canOpenAsset
|
|
94
|
+
? `Show in ${fileManagerName}`
|
|
95
|
+
: (asset !== null && asset !== void 0 ? asset : undefined);
|
|
73
96
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
74
97
|
jsx_runtime_1.jsx("span", { style: slashStyle, children: "/" }), jsx_runtime_1.jsx("a", { style: canOpen && !opening
|
|
75
98
|
? hovered
|
|
76
99
|
? clickableHoveredStyle
|
|
77
100
|
: clickableStyle
|
|
78
|
-
: compositionNameStyle, title:
|
|
101
|
+
: compositionNameStyle, title: title, onClick: handleClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: name })
|
|
79
102
|
] }));
|
|
80
103
|
};
|
|
81
104
|
exports.MenuCompositionName = MenuCompositionName;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuToolbar =
|
|
3
|
+
exports.MenuToolbar = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
8
8
|
const use_menu_structure_1 = require("../helpers/use-menu-structure");
|
|
9
9
|
const layout_1 = require("./layout");
|
|
10
|
+
const menu_toolbar_height_1 = require("./menu-toolbar-height");
|
|
10
11
|
const MenuItem_1 = require("./Menu/MenuItem");
|
|
11
12
|
const MenuBuildIndicator_1 = require("./MenuBuildIndicator");
|
|
12
13
|
const SidebarCollapserControls_1 = require("./SidebarCollapserControls");
|
|
13
14
|
const UndoRedoButtons_1 = require("./UndoRedoButtons");
|
|
14
15
|
const UpdateCheck_1 = require("./UpdateCheck");
|
|
15
|
-
exports.MENU_TOOLBAR_HEIGHT = 30;
|
|
16
16
|
const row = {
|
|
17
17
|
alignItems: 'center',
|
|
18
18
|
flexDirection: 'row',
|
|
@@ -21,9 +21,9 @@ const row = {
|
|
|
21
21
|
borderBottom: colors_1.BORDER_BLACK,
|
|
22
22
|
boxSizing: 'border-box',
|
|
23
23
|
fontSize: 13,
|
|
24
|
-
height:
|
|
24
|
+
height: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
|
|
25
25
|
paddingLeft: 6,
|
|
26
|
-
paddingRight:
|
|
26
|
+
paddingRight: 6,
|
|
27
27
|
backgroundColor: colors_1.BACKGROUND,
|
|
28
28
|
};
|
|
29
29
|
const flex = {
|
|
@@ -98,10 +98,11 @@ const MenuToolbar = ({ readOnlyStudio }) => {
|
|
|
98
98
|
e.stopPropagation();
|
|
99
99
|
}, []);
|
|
100
100
|
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", className: "css-reset", style: row, onPointerDown: onPointerDown, children: [
|
|
101
|
-
jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [
|
|
101
|
+
jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [
|
|
102
|
+
jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" }), structure.map((s) => {
|
|
102
103
|
return (jsx_runtime_1.jsx(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
|
|
103
|
-
}), readOnlyStudio ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, {}), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [readOnlyStudio ? null : jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}), jsx_runtime_1.jsx(SidebarCollapserControls_1.
|
|
104
|
-
] })
|
|
104
|
+
}), readOnlyStudio ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, {}), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [readOnlyStudio ? null : jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}), jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "right" })
|
|
105
|
+
] })
|
|
105
106
|
] }));
|
|
106
107
|
};
|
|
107
108
|
exports.MenuToolbar = MenuToolbar;
|
|
@@ -5,39 +5,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = MobilePanel;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
9
10
|
const colors_1 = require("../helpers/colors");
|
|
10
11
|
const z_index_1 = require("../state/z-index");
|
|
11
|
-
const
|
|
12
|
+
const menu_toolbar_height_1 = require("./menu-toolbar-height");
|
|
12
13
|
const portals_1 = require("./Menu/portals");
|
|
13
|
-
const
|
|
14
|
-
const container = {
|
|
14
|
+
const overlay = {
|
|
15
15
|
position: 'fixed',
|
|
16
|
-
top:
|
|
16
|
+
top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
|
|
17
17
|
left: 0,
|
|
18
18
|
width: '100%',
|
|
19
|
-
height:
|
|
20
|
-
padding: '0 0px 50px 0px',
|
|
21
|
-
background: colors_1.BACKGROUND,
|
|
22
|
-
};
|
|
23
|
-
const buttonContainer = {
|
|
24
|
-
height: '40px',
|
|
25
|
-
width: '100%',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
display: 'flex',
|
|
28
|
-
justifyContent: 'flex-end',
|
|
29
|
-
paddingRight: 8,
|
|
19
|
+
height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
|
|
30
20
|
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
const panel = {
|
|
22
|
+
position: 'fixed',
|
|
23
|
+
top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
|
|
24
|
+
width: 'min(350px, calc(100% - 50px))',
|
|
25
|
+
height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
background: colors_1.BACKGROUND,
|
|
28
|
+
boxShadow: colors_1.SHADOW_BLACK,
|
|
38
29
|
};
|
|
39
|
-
function MobilePanel({ children, onClose, }) {
|
|
30
|
+
function MobilePanel({ children, onClose, side, }) {
|
|
40
31
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
const onOutsideClick = react_1.default.useCallback((target) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const element = target instanceof Element ? target : null;
|
|
35
|
+
const toggleSelector = `[data-sidebar-toggle="${side}"]`;
|
|
36
|
+
if ((element === null || element === void 0 ? void 0 : element.closest(toggleSelector)) ||
|
|
37
|
+
((_a = element === null || element === void 0 ? void 0 : element.closest('button')) === null || _a === void 0 ? void 0 : _a.querySelector(toggleSelector))) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
onClose();
|
|
41
|
+
}, [onClose, side]);
|
|
42
|
+
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: overlay, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onClose, onOutsideClick: onOutsideClick, children: jsx_runtime_1.jsx("div", { style: {
|
|
43
|
+
...panel,
|
|
44
|
+
left: side === 'left' ? 0 : undefined,
|
|
45
|
+
right: side === 'right' ? 0 : undefined,
|
|
46
|
+
}, children: children }) }) }), (0, portals_1.getPortal)(currentZIndex));
|
|
43
47
|
}
|
|
@@ -29,11 +29,11 @@ const panel = {
|
|
|
29
29
|
color: colors_1.WHITE,
|
|
30
30
|
margin: 'auto',
|
|
31
31
|
};
|
|
32
|
-
const ModalContainer = ({ children, onEscape, onOutsideClick, noZIndex }) => {
|
|
32
|
+
const ModalContainer = ({ children, onEscape, onOutsideClick, noZIndex, panelStyle }) => {
|
|
33
33
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
34
34
|
// Prevent deselection of currently selected items
|
|
35
35
|
e.stopPropagation();
|
|
36
36
|
}, []);
|
|
37
|
-
return (jsx_runtime_1.jsx("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape, children: jsx_runtime_1.jsx("div", { style: panel, children: children }) }) }));
|
|
37
|
+
return (jsx_runtime_1.jsx("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape, children: jsx_runtime_1.jsx("div", { style: { ...panel, ...panelStyle }, children: children }) }) }));
|
|
38
38
|
};
|
|
39
39
|
exports.ModalContainer = ModalContainer;
|
|
@@ -36,6 +36,6 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
36
36
|
'connected';
|
|
37
37
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'configure-license' && (jsx_runtime_1.jsx(ConfigureLicenseModal_1.ConfigureLicenseModal, { initialPublicLicenseKey: modalContextType.initialPublicLicenseKey })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
38
38
|
modalContextType.type === 'server-render' &&
|
|
39
|
-
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
39
|
+
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
40
40
|
};
|
|
41
41
|
exports.Modals = Modals;
|
|
@@ -5,11 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const modals_1 = require("../../state/modals");
|
|
7
7
|
const ModalContainer_1 = require("../ModalContainer");
|
|
8
|
-
const DismissableModal = ({ children }) => {
|
|
8
|
+
const DismissableModal = ({ children, panelStyle }) => {
|
|
9
9
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
10
10
|
const onQuit = (0, react_1.useCallback)(() => {
|
|
11
11
|
setSelectedModal(null);
|
|
12
12
|
}, [setSelectedModal]);
|
|
13
|
-
return (jsx_runtime_1.jsx(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: children }));
|
|
13
|
+
return (jsx_runtime_1.jsx(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, panelStyle: panelStyle, children: children }));
|
|
14
14
|
};
|
|
15
15
|
exports.DismissableModal = DismissableModal;
|
|
@@ -9,6 +9,13 @@ type InputDraggerValidationResult = {
|
|
|
9
9
|
readonly message: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const inputDraggerContainerStyle: React.CSSProperties;
|
|
12
|
+
export type InputDraggerExpressionResult = {
|
|
13
|
+
readonly status: 'valid';
|
|
14
|
+
readonly value: number;
|
|
15
|
+
} | {
|
|
16
|
+
readonly status: 'incomplete' | 'invalid';
|
|
17
|
+
};
|
|
18
|
+
export declare const parseInputDraggerExpression: (input: string) => InputDraggerExpressionResult;
|
|
12
19
|
export declare const parseInputDraggerNumber: (value: string) => number | null;
|
|
13
20
|
export declare const isInputDraggerValueAlignedToStep: ({ min, step, value, }: {
|
|
14
21
|
readonly min: string | number | undefined;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputDragger = exports.deriveInputDraggerValueDiff = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.deriveInputDraggerArrowValue = exports.validateInputDraggerValue = exports.isInputDraggerValueAlignedToStep = exports.parseInputDraggerNumber = exports.inputDraggerContainerStyle = void 0;
|
|
36
|
+
exports.InputDragger = exports.deriveInputDraggerValueDiff = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.deriveInputDraggerArrowValue = exports.validateInputDraggerValue = exports.isInputDraggerValueAlignedToStep = exports.parseInputDraggerNumber = exports.parseInputDraggerExpression = exports.inputDraggerContainerStyle = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -60,14 +60,125 @@ const roundToDecimalPlaces = (val, decimalPlaces) => {
|
|
|
60
60
|
const rounded = Math.round(val * factor) / factor;
|
|
61
61
|
return Object.is(rounded, -0) ? 0 : rounded;
|
|
62
62
|
};
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const numberAtStartPattern = /^(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e[+-]?\d+)?/i;
|
|
64
|
+
const parseInputDraggerExpression = (input) => {
|
|
65
|
+
let index = 0;
|
|
66
|
+
const invalid = () => ({ status: 'invalid' });
|
|
67
|
+
const incomplete = () => ({
|
|
68
|
+
status: 'incomplete',
|
|
69
|
+
});
|
|
70
|
+
const skipWhitespace = () => {
|
|
71
|
+
while (index < input.length && /\s/.test(input[index])) {
|
|
72
|
+
index++;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const parsePrimary = () => {
|
|
76
|
+
skipWhitespace();
|
|
77
|
+
if (index === input.length) {
|
|
78
|
+
return incomplete();
|
|
79
|
+
}
|
|
80
|
+
if (input[index] === '(') {
|
|
81
|
+
index++;
|
|
82
|
+
const expression = parseExpression();
|
|
83
|
+
if (expression.status !== 'valid') {
|
|
84
|
+
return expression;
|
|
85
|
+
}
|
|
86
|
+
skipWhitespace();
|
|
87
|
+
if (index === input.length) {
|
|
88
|
+
return incomplete();
|
|
89
|
+
}
|
|
90
|
+
if (input[index] !== ')') {
|
|
91
|
+
return invalid();
|
|
92
|
+
}
|
|
93
|
+
index++;
|
|
94
|
+
return expression;
|
|
95
|
+
}
|
|
96
|
+
const match = input.slice(index).match(numberAtStartPattern);
|
|
97
|
+
if (!match) {
|
|
98
|
+
return invalid();
|
|
99
|
+
}
|
|
100
|
+
index += match[0].length;
|
|
101
|
+
const rest = input.slice(index);
|
|
102
|
+
if (/^e[+-]?\s*$/i.test(rest)) {
|
|
103
|
+
return incomplete();
|
|
104
|
+
}
|
|
105
|
+
const value = Number(match[0]);
|
|
106
|
+
return Number.isFinite(value) ? { status: 'valid', value } : invalid();
|
|
107
|
+
};
|
|
108
|
+
const parseUnary = () => {
|
|
109
|
+
skipWhitespace();
|
|
110
|
+
if (input[index] !== '+' && input[index] !== '-') {
|
|
111
|
+
return parsePrimary();
|
|
112
|
+
}
|
|
113
|
+
const operator = input[index];
|
|
114
|
+
index++;
|
|
115
|
+
const operand = parseUnary();
|
|
116
|
+
if (operand.status !== 'valid') {
|
|
117
|
+
return operand;
|
|
118
|
+
}
|
|
119
|
+
const value = operator === '-' ? -operand.value : operand.value;
|
|
120
|
+
return Number.isFinite(value) ? { status: 'valid', value } : invalid();
|
|
121
|
+
};
|
|
122
|
+
const parseTerm = () => {
|
|
123
|
+
let left = parseUnary();
|
|
124
|
+
if (left.status !== 'valid') {
|
|
125
|
+
return left;
|
|
126
|
+
}
|
|
127
|
+
while (true) {
|
|
128
|
+
skipWhitespace();
|
|
129
|
+
const operator = input[index];
|
|
130
|
+
if (operator !== '*' && operator !== '/') {
|
|
131
|
+
return left;
|
|
132
|
+
}
|
|
133
|
+
index++;
|
|
134
|
+
const right = parseUnary();
|
|
135
|
+
if (right.status !== 'valid') {
|
|
136
|
+
return right;
|
|
137
|
+
}
|
|
138
|
+
if (operator === '/' && right.value === 0) {
|
|
139
|
+
return invalid();
|
|
140
|
+
}
|
|
141
|
+
const value = operator === '*' ? left.value * right.value : left.value / right.value;
|
|
142
|
+
if (!Number.isFinite(value)) {
|
|
143
|
+
return invalid();
|
|
144
|
+
}
|
|
145
|
+
left = { status: 'valid', value };
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const parseExpression = () => {
|
|
149
|
+
let left = parseTerm();
|
|
150
|
+
if (left.status !== 'valid') {
|
|
151
|
+
return left;
|
|
152
|
+
}
|
|
153
|
+
while (true) {
|
|
154
|
+
skipWhitespace();
|
|
155
|
+
const operator = input[index];
|
|
156
|
+
if (operator !== '+' && operator !== '-') {
|
|
157
|
+
return left;
|
|
158
|
+
}
|
|
159
|
+
index++;
|
|
160
|
+
const right = parseTerm();
|
|
161
|
+
if (right.status !== 'valid') {
|
|
162
|
+
return right;
|
|
163
|
+
}
|
|
164
|
+
const value = operator === '+' ? left.value + right.value : left.value - right.value;
|
|
165
|
+
if (!Number.isFinite(value)) {
|
|
166
|
+
return invalid();
|
|
167
|
+
}
|
|
168
|
+
left = { status: 'valid', value };
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const result = parseExpression();
|
|
172
|
+
if (result.status !== 'valid') {
|
|
173
|
+
return result;
|
|
68
174
|
}
|
|
69
|
-
|
|
70
|
-
return
|
|
175
|
+
skipWhitespace();
|
|
176
|
+
return index === input.length ? result : invalid();
|
|
177
|
+
};
|
|
178
|
+
exports.parseInputDraggerExpression = parseInputDraggerExpression;
|
|
179
|
+
const parseInputDraggerNumber = (value) => {
|
|
180
|
+
const result = (0, exports.parseInputDraggerExpression)(value);
|
|
181
|
+
return result.status === 'valid' ? result.value : null;
|
|
71
182
|
};
|
|
72
183
|
exports.parseInputDraggerNumber = parseInputDraggerNumber;
|
|
73
184
|
const getFiniteAttribute = (value) => {
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
8
8
|
const ControlButton_1 = require("./ControlButton");
|
|
9
|
-
const OutlineToggle = (
|
|
9
|
+
const OutlineToggle = () => {
|
|
10
10
|
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
11
11
|
const onClick = (0, react_1.useCallback)(() => {
|
|
12
12
|
setEditorShowOutlines((current) => !current);
|
|
@@ -15,6 +15,6 @@ const OutlineToggle = ({ disabled }) => {
|
|
|
15
15
|
const accessibilityLabel = editorShowOutlines
|
|
16
16
|
? 'Hide outlines'
|
|
17
17
|
: 'Show outlines';
|
|
18
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel,
|
|
18
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx("svg", { style: { width: 18, height: 18 }, viewBox: "0 0 512 512", fill: color, "aria-hidden": "true", focusable: "false", children: jsx_runtime_1.jsx("path", { d: "M32 119.4C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0 87.7 0 108.4 12.9 119.4 32l273.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-273.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-273.1zm64 0l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l273.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4z" }) }) }));
|
|
19
19
|
};
|
|
20
20
|
exports.OutlineToggle = OutlineToggle;
|
|
@@ -39,7 +39,7 @@ const container = {
|
|
|
39
39
|
const mobileContainer = {
|
|
40
40
|
...container,
|
|
41
41
|
position: 'relative',
|
|
42
|
-
|
|
42
|
+
overflowX: 'auto',
|
|
43
43
|
justifyContent: 'flex-start',
|
|
44
44
|
};
|
|
45
45
|
const scrollIndicatorLeft = {
|
|
@@ -69,6 +69,13 @@ const sideContainer = {
|
|
|
69
69
|
flexDirection: 'row',
|
|
70
70
|
alignItems: 'center',
|
|
71
71
|
};
|
|
72
|
+
const mobileSideContainer = {
|
|
73
|
+
height: 30,
|
|
74
|
+
display: 'flex',
|
|
75
|
+
flexDirection: 'row',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
flexShrink: 0,
|
|
78
|
+
};
|
|
72
79
|
const padding = {
|
|
73
80
|
width: timeline_layout_1.TIMELINE_PADDING,
|
|
74
81
|
};
|
|
@@ -166,9 +173,8 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
166
173
|
] }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), isVideoComposition ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
167
174
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
168
175
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
169
|
-
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {
|
|
170
|
-
|
|
171
|
-
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
176
|
+
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) }), readOnlyStudio ? null : (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, {}) }))] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
177
|
+
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), jsx_runtime_1.jsxs("div", { style: isMobileLayout ? mobileSideContainer : sideContainer, children: [
|
|
172
178
|
jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio, size: "compact" }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
173
179
|
] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {}), jsx_runtime_1.jsx("div", { ref: rightScrollIndicatorRef, style: scrollIndicatorRight })
|
|
174
180
|
] }));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExplorerQuickSwitcherTrigger = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const ShortcutHint_1 = require("../../error-overlay/remotion-overlay/ShortcutHint");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
8
|
+
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
9
|
+
const modals_1 = require("../../state/modals");
|
|
10
|
+
const quickSwitcherArea = {
|
|
11
|
+
padding: '4px 12px',
|
|
12
|
+
borderBottom: `1px solid ${colors_1.BLACK_HEX}`,
|
|
13
|
+
};
|
|
14
|
+
const quickSwitcherTrigger = {
|
|
15
|
+
backgroundColor: colors_1.WHITE_ALPHA_06,
|
|
16
|
+
borderRadius: 5,
|
|
17
|
+
padding: '4px 10px',
|
|
18
|
+
color: colors_1.LIGHT_TEXT,
|
|
19
|
+
fontSize: 12,
|
|
20
|
+
cursor: 'pointer',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
border: 'none',
|
|
25
|
+
width: '100%',
|
|
26
|
+
appearance: 'none',
|
|
27
|
+
};
|
|
28
|
+
const shortcutLabel = {
|
|
29
|
+
fontSize: 11,
|
|
30
|
+
opacity: 0.6,
|
|
31
|
+
};
|
|
32
|
+
const ExplorerQuickSwitcherTrigger = ({ mode, showShortcut, tabIndex }) => {
|
|
33
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
34
|
+
const openQuickSwitcher = (0, react_1.useCallback)(() => {
|
|
35
|
+
setSelectedModal({
|
|
36
|
+
type: 'quick-switcher',
|
|
37
|
+
mode,
|
|
38
|
+
invocationTimestamp: Date.now(),
|
|
39
|
+
assetSelection: null,
|
|
40
|
+
});
|
|
41
|
+
}, [mode, setSelectedModal]);
|
|
42
|
+
return (jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", showShortcut && !(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] })) : null] }) }));
|
|
43
|
+
};
|
|
44
|
+
exports.ExplorerQuickSwitcherTrigger = ExplorerQuickSwitcherTrigger;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type QuickSwitcherMode = 'commands' | 'compositions' | 'docs';
|
|
2
|
+
export type QuickSwitcherMode = 'assets' | 'commands' | 'compositions' | 'docs';
|
|
3
3
|
export declare const QuickSwitcherNoResults: React.FC<{
|
|
4
4
|
readonly query: string;
|
|
5
5
|
readonly mode: QuickSwitcherMode;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { StaticFile } from '../../api/get-static-files';
|
|
2
3
|
import type { QuickSwitcherMode } from './NoResults';
|
|
3
4
|
declare const QuickSwitcher: React.FC<{
|
|
4
5
|
readonly initialMode: QuickSwitcherMode;
|
|
5
6
|
readonly invocationTimestamp: number;
|
|
6
7
|
readonly readOnlyStudio: boolean;
|
|
8
|
+
readonly assetSelection: {
|
|
9
|
+
readonly initialQuery: string;
|
|
10
|
+
readonly onSelected: (asset: StaticFile) => void;
|
|
11
|
+
} | null;
|
|
7
12
|
}>;
|
|
8
13
|
export default QuickSwitcher;
|