@remotion/studio 4.0.494 → 4.0.496
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/get-static-files.d.ts +1 -1
- package/dist/components/AssetFileIcon.d.ts +7 -0
- package/dist/components/AssetFileIcon.js +24 -0
- package/dist/components/AssetSelectorItem.js +20 -14
- package/dist/components/Canvas.js +191 -36
- package/dist/components/CompositionSelectorItem.js +20 -31
- package/dist/components/CurrentAsset.d.ts +1 -0
- package/dist/components/CurrentAsset.js +21 -4
- package/dist/components/Editor.js +2 -4
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +56 -11
- package/dist/components/InspectorInfoHeader.d.ts +2 -0
- package/dist/components/InspectorInfoHeader.js +16 -4
- package/dist/components/InspectorLocationCopy.js +2 -2
- package/dist/components/InspectorPanel/AssetInspector.d.ts +4 -0
- package/dist/components/InspectorPanel/AssetInspector.js +11 -0
- package/dist/components/InspectorPanel/{DefaultInspector.d.ts → CompositionInspector.d.ts} +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +114 -0
- package/dist/components/InspectorPanel/CompositionInspectorHeader.d.ts +1 -0
- package/dist/components/{CurrentComposition.js → InspectorPanel/CompositionInspectorHeader.js} +26 -21
- package/dist/components/InspectorPanel/{CompositionDimensions.d.ts → CompositionMetadata.d.ts} +1 -1
- package/dist/components/InspectorPanel/{CompositionDimensions.js → CompositionMetadata.js} +17 -8
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +2 -2
- package/dist/components/InspectorPanel/EasingInspector.js +4 -6
- package/dist/components/InspectorPanel/KeyframeInspector.js +7 -8
- package/dist/components/InspectorPanel/KeyframeSettings.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +28 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +34 -1
- package/dist/components/InspectorPanel/common.d.ts +12 -2
- package/dist/components/InspectorPanel/common.js +45 -22
- package/dist/components/InspectorPanel/styles.d.ts +5 -6
- package/dist/components/InspectorPanel/styles.js +13 -39
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +8 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +114 -0
- package/dist/components/InspectorPanel.js +11 -2
- package/dist/components/InspectorSequenceSection.d.ts +0 -1
- package/dist/components/InspectorSequenceSection.js +20 -49
- package/dist/components/InspectorSourceLocation.d.ts +1 -0
- package/dist/components/InspectorSourceLocation.js +5 -1
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/ComboBox.d.ts +2 -1
- package/dist/components/NewComposition/ComboBox.js +32 -7
- package/dist/components/NewComposition/InputDragger.d.ts +6 -0
- package/dist/components/NewComposition/InputDragger.js +26 -13
- package/dist/components/NewComposition/NewComposition.js +8 -1
- package/dist/components/NewComposition/ValidationMessage.d.ts +1 -1
- package/dist/components/PlaybackRateSelector.js +3 -3
- package/dist/components/Preview.js +15 -7
- package/dist/components/PreviewToolbar.js +3 -3
- package/dist/components/RenderButton.d.ts +1 -0
- package/dist/components/RenderButton.js +51 -7
- package/dist/components/RenderModal/RenderModalOutputName.js +34 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/SelectedOutlineOverlay.js +1 -0
- package/dist/components/SizeSelector.js +3 -3
- package/dist/components/SvgImportDialog.d.ts +7 -0
- package/dist/components/SvgImportDialog.js +103 -0
- package/dist/components/Timeline/Timeline.js +1 -0
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +8 -1
- package/dist/components/Timeline/TimelineEnumField.js +1 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +26 -6
- package/dist/components/Timeline/TimelineList.js +9 -4
- package/dist/components/Timeline/TimelineRowChrome.js +10 -2
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowLayoutContext.js +6 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +19 -11
- package/dist/components/Timeline/nest-timeline-tracks.d.ts +8 -0
- package/dist/components/Timeline/nest-timeline-tracks.js +25 -0
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +8 -4
- package/dist/components/Timeline/timeline-scroll-logic.js +29 -15
- package/dist/components/import-assets.d.ts +17 -1
- package/dist/components/import-assets.js +96 -11
- package/dist/components/layout.d.ts +2 -0
- package/dist/components/layout.js +3 -1
- package/dist/components/open-in-new-window.d.ts +2 -0
- package/dist/components/open-in-new-window.js +28 -0
- package/dist/components/selected-outline-measurement.d.ts +2 -1
- package/dist/components/selected-outline-measurement.js +3 -1
- package/dist/esm/{chunk-tdncqycp.js → chunk-0v4n7nkh.js} +8463 -7092
- package/dist/esm/internals.mjs +8463 -7092
- package/dist/esm/previewEntry.mjs +8613 -7242
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.js +2 -1
- package/dist/helpers/clipboard-figma.d.ts +4 -0
- package/dist/helpers/clipboard-figma.js +41 -0
- package/dist/helpers/clipboard-images.d.ts +10 -0
- package/dist/helpers/clipboard-images.js +77 -0
- package/dist/helpers/clipboard-svg.d.ts +3 -0
- package/dist/helpers/clipboard-svg.js +47 -0
- package/dist/helpers/get-effective-translation.d.ts +2 -1
- package/dist/helpers/get-effective-translation.js +15 -7
- package/dist/helpers/get-preview-file-type.d.ts +1 -1
- package/dist/helpers/get-preview-file-type.js +5 -1
- package/dist/helpers/inject-css.js +11 -0
- package/dist/helpers/studio-fit-padding.d.ts +41 -0
- package/dist/helpers/studio-fit-padding.js +64 -0
- package/dist/helpers/use-image-metadata.d.ts +8 -0
- package/dist/helpers/use-image-metadata.js +82 -0
- package/dist/helpers/use-studio-canvas-dimensions.js +2 -2
- package/dist/icons/audio.d.ts +3 -0
- package/dist/icons/audio.js +3 -1
- package/dist/icons/font.d.ts +4 -0
- package/dist/icons/font.js +8 -0
- package/dist/icons/frame.d.ts +3 -1
- package/dist/icons/frame.js +1 -1
- package/dist/icons/json.d.ts +4 -0
- package/dist/icons/json.js +8 -0
- package/dist/icons/magnet.js +1 -1
- package/dist/icons/scissors.d.ts +5 -0
- package/dist/icons/scissors.js +8 -0
- package/dist/icons/solid.d.ts +5 -0
- package/dist/icons/solid.js +8 -0
- package/dist/icons/video.d.ts +3 -0
- package/dist/icons/video.js +5 -1
- package/dist/state/modals.d.ts +8 -1
- package/dist/state/timeline-zoom.js +12 -11
- package/package.json +11 -11
- package/dist/components/CurrentComposition.d.ts +0 -2
- package/dist/components/InspectorPanel/DefaultInspector.js +0 -97
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCompositionActions = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
7
|
+
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
8
|
+
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
9
|
+
const call_api_1 = require("../call-api");
|
|
10
|
+
const import_assets_1 = require("../import-assets");
|
|
11
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
12
|
+
const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
|
|
13
|
+
const useCompositionActions = () => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
16
|
+
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
17
|
+
const [isAddingSolid, setIsAddingSolid] = (0, react_1.useState)(false);
|
|
18
|
+
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
19
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
20
|
+
const previewConnected = previewServerState.type === 'connected';
|
|
21
|
+
const previewInteractive = previewConnected && interactivity_enabled_1.studioInteractivityEnabled;
|
|
22
|
+
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
23
|
+
const currentComposition = (0, react_1.useMemo)(() => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (currentCompositionId === null) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return ((_a = compositions.find((composition) => composition.id === currentCompositionId)) !== null && _a !== void 0 ? _a : null);
|
|
29
|
+
}, [compositions, currentCompositionId]);
|
|
30
|
+
const resolvedCompositionLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _a !== void 0 ? _a : null);
|
|
31
|
+
const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b : null;
|
|
32
|
+
const compositionComponentInfo = (0, open_in_editor_1.useCachedCompositionComponentInfo)({
|
|
33
|
+
compositionFile,
|
|
34
|
+
compositionId: currentCompositionId,
|
|
35
|
+
});
|
|
36
|
+
const canShowInsertSolid = previewInteractive &&
|
|
37
|
+
(compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true &&
|
|
38
|
+
currentCompositionId !== null &&
|
|
39
|
+
compositionFile !== null &&
|
|
40
|
+
videoConfig !== null;
|
|
41
|
+
const canInsertSolid = canShowInsertSolid && !isAddingSolid;
|
|
42
|
+
const canShowInsertAsset = previewInteractive &&
|
|
43
|
+
!window.remotion_isReadOnlyStudio &&
|
|
44
|
+
(compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true &&
|
|
45
|
+
currentCompositionId !== null &&
|
|
46
|
+
compositionFile !== null;
|
|
47
|
+
const canInsertAsset = canShowInsertAsset && !isAddingAsset;
|
|
48
|
+
const insertSolid = (0, react_1.useCallback)(async () => {
|
|
49
|
+
if (!canInsertSolid ||
|
|
50
|
+
currentCompositionId === null ||
|
|
51
|
+
compositionFile === null ||
|
|
52
|
+
videoConfig === null) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
setIsAddingSolid(true);
|
|
56
|
+
try {
|
|
57
|
+
const result = await (0, call_api_1.callApi)('/api/insert-jsx-element', {
|
|
58
|
+
compositionFile,
|
|
59
|
+
compositionId: currentCompositionId,
|
|
60
|
+
element: {
|
|
61
|
+
type: 'solid',
|
|
62
|
+
width: videoConfig.width,
|
|
63
|
+
height: videoConfig.height,
|
|
64
|
+
position: null,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
if (result.success) {
|
|
68
|
+
(0, NotificationCenter_1.showNotification)('Added <Solid> to source file', 2000);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
setIsAddingSolid(false);
|
|
78
|
+
}
|
|
79
|
+
}, [canInsertSolid, compositionFile, currentCompositionId, videoConfig]);
|
|
80
|
+
const insertAsset = (0, react_1.useCallback)(async () => {
|
|
81
|
+
if (!canInsertAsset ||
|
|
82
|
+
currentCompositionId === null ||
|
|
83
|
+
compositionFile === null) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const files = await (0, import_assets_1.pickFilesToImport)();
|
|
87
|
+
if (files.length === 0) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
setIsAddingAsset(true);
|
|
91
|
+
try {
|
|
92
|
+
await (0, import_assets_1.importAssets)({
|
|
93
|
+
files,
|
|
94
|
+
compositionFile,
|
|
95
|
+
compositionId: currentCompositionId,
|
|
96
|
+
destinationDimensions: null,
|
|
97
|
+
dropPosition: null,
|
|
98
|
+
svgImportMode: 'image',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
setIsAddingAsset(false);
|
|
103
|
+
}
|
|
104
|
+
}, [canInsertAsset, compositionFile, currentCompositionId]);
|
|
105
|
+
return {
|
|
106
|
+
canInsertAsset,
|
|
107
|
+
canInsertSolid,
|
|
108
|
+
canShowInsertAsset,
|
|
109
|
+
canShowInsertSolid,
|
|
110
|
+
insertAsset,
|
|
111
|
+
insertSolid,
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
exports.useCompositionActions = useCompositionActions;
|
|
@@ -3,17 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InspectorPanel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const AssetInspector_1 = require("./InspectorPanel/AssetInspector");
|
|
6
8
|
const common_1 = require("./InspectorPanel/common");
|
|
7
|
-
const
|
|
9
|
+
const CompositionInspector_1 = require("./InspectorPanel/CompositionInspector");
|
|
8
10
|
const inspector_selection_1 = require("./InspectorPanel/inspector-selection");
|
|
9
11
|
const SelectedInspector_1 = require("./InspectorPanel/SelectedInspector");
|
|
10
12
|
const styles_1 = require("./InspectorPanel/styles");
|
|
11
13
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
12
14
|
const InspectorPanel = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
|
|
15
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
13
16
|
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
14
17
|
const sameSequenceInspectorSelection = (0, react_1.useMemo)(() => (0, inspector_selection_1.getSameSequenceInspectorSelection)(selectedItems), [selectedItems]);
|
|
15
18
|
if (selectedItems.length === 0) {
|
|
16
|
-
|
|
19
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset') {
|
|
20
|
+
return jsx_runtime_1.jsx(AssetInspector_1.AssetInspector, { readOnlyStudio: readOnlyStudio });
|
|
21
|
+
}
|
|
22
|
+
if (composition === null) {
|
|
23
|
+
return jsx_runtime_1.jsx("div", { style: styles_1.container });
|
|
24
|
+
}
|
|
25
|
+
return (jsx_runtime_1.jsx(CompositionInspector_1.CompositionInspector, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps }));
|
|
17
26
|
}
|
|
18
27
|
if (selectedItems.length > 1) {
|
|
19
28
|
if (sameSequenceInspectorSelection) {
|
|
@@ -14,7 +14,6 @@ export declare const InspectorSequenceSection: React.FC<{
|
|
|
14
14
|
readonly validatedLocation: CodePosition;
|
|
15
15
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
16
16
|
readonly keyframeDisplayOffset: number;
|
|
17
|
-
readonly renderSectionHeader: (children: React.ReactNode) => React.ReactNode;
|
|
18
17
|
readonly renderTransformControls: () => React.ReactNode;
|
|
19
18
|
}>;
|
|
20
19
|
export {};
|
|
@@ -1,48 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.InspectorSequenceSection = exports.hasSequenceControls = exports.getInspectorSelectableItems = void 0;
|
|
37
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const react_1 =
|
|
5
|
+
const react_1 = require("react");
|
|
39
6
|
const client_id_1 = require("../helpers/client-id");
|
|
40
7
|
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
41
9
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
42
10
|
const plus_1 = require("../icons/plus");
|
|
43
11
|
const modals_1 = require("../state/modals");
|
|
44
|
-
const
|
|
12
|
+
const AssetFileIcon_1 = require("./AssetFileIcon");
|
|
45
13
|
const InlineAction_1 = require("./InlineAction");
|
|
14
|
+
const common_1 = require("./InspectorPanel/common");
|
|
46
15
|
const styles_1 = require("./InspectorPanel/styles");
|
|
47
16
|
const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
|
|
48
17
|
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
@@ -63,11 +32,7 @@ const emptyState = {
|
|
|
63
32
|
fontFamily: 'sans-serif',
|
|
64
33
|
fontSize: 12,
|
|
65
34
|
lineHeight: 1.4,
|
|
66
|
-
padding: '0 12px
|
|
67
|
-
};
|
|
68
|
-
const controlsEffectsDivider = {
|
|
69
|
-
...styles_1.sequenceHeaderDivider,
|
|
70
|
-
margin: '8px 0 4px',
|
|
35
|
+
padding: '0 12px',
|
|
71
36
|
};
|
|
72
37
|
const effectsHeaderTitle = {
|
|
73
38
|
...styles_1.sectionHeaderTitle,
|
|
@@ -77,6 +42,11 @@ const plusIcon = {
|
|
|
77
42
|
width: 15,
|
|
78
43
|
height: 15,
|
|
79
44
|
};
|
|
45
|
+
const assetSelectorIcon = {
|
|
46
|
+
flexShrink: 0,
|
|
47
|
+
height: 18,
|
|
48
|
+
width: 18,
|
|
49
|
+
};
|
|
80
50
|
const remoteSourceLabel = {
|
|
81
51
|
color: colors_1.LIGHT_TEXT,
|
|
82
52
|
display: 'flex',
|
|
@@ -170,7 +140,8 @@ const hasSequenceControls = (sequence) => {
|
|
|
170
140
|
return sequence.controls !== null;
|
|
171
141
|
};
|
|
172
142
|
exports.hasSequenceControls = hasSequenceControls;
|
|
173
|
-
const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset,
|
|
143
|
+
const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
|
|
144
|
+
var _a;
|
|
174
145
|
const { tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
175
146
|
sequence,
|
|
176
147
|
nodePathInfo,
|
|
@@ -191,6 +162,9 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
191
162
|
(0, timeline_asset_link_1.openTimelineAssetLink)(localAsset, selectAsset);
|
|
192
163
|
}
|
|
193
164
|
}, [localAsset, selectAsset]);
|
|
165
|
+
const localAssetFileName = localAsset
|
|
166
|
+
? ((_a = localAsset.assetPath.split('/').pop()) !== null && _a !== void 0 ? _a : localAsset.assetPath)
|
|
167
|
+
: null;
|
|
194
168
|
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
195
169
|
return !collapsedKeys.has(getInspectorExpansionKey(candidate));
|
|
196
170
|
}, [collapsedKeys]);
|
|
@@ -240,7 +214,6 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
240
214
|
const controlGroups = (0, react_1.useMemo)(() => getInspectorControlGroups(controlRows), [controlRows]);
|
|
241
215
|
const { schema } = sequence.controls;
|
|
242
216
|
const showEffectsSection = nodePathInfo.supportsEffects || effectRows.length > 0;
|
|
243
|
-
const showControlsEffectsDivider = controlRows.length > 0 && showEffectsSection;
|
|
244
217
|
const canAddEffect = nodePathInfo.supportsEffects &&
|
|
245
218
|
previewServerState.type === 'connected' &&
|
|
246
219
|
Boolean(validatedLocation.source);
|
|
@@ -261,18 +234,16 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
261
234
|
setSelectedModal,
|
|
262
235
|
validatedLocation.source,
|
|
263
236
|
]);
|
|
264
|
-
const
|
|
265
|
-
|
|
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 }) })] }));
|
|
267
|
-
};
|
|
237
|
+
const effectsHeader = (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
|
|
238
|
+
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 }) })] }));
|
|
268
239
|
const renderRow = ({ node, depth }) => {
|
|
269
240
|
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)));
|
|
270
241
|
};
|
|
271
242
|
if (controlRows.length === 0 && !showEffectsSection) {
|
|
272
|
-
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" }) }));
|
|
243
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Controls", children: jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" }) }) }));
|
|
273
244
|
}
|
|
274
|
-
return (jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group
|
|
245
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group) => (jsx_runtime_1.jsxs(common_1.InspectorSection, { header: group.label, children: [group.id === 'source' && localAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: jumpToAsset, renderIcon: (color) => (jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { color: color, fileType: (0, get_preview_file_type_1.getPreviewFileType)(localAsset.assetPath), style: assetSelectorIcon })), size: "compact", title: localAsset.assetPath, children: localAssetFileName })) : null, group.id === 'source' && remoteAsset && remoteSourceParts ? (jsx_runtime_1.jsxs("div", { style: remoteSourceLabel, title: remoteAsset.href, children: [
|
|
275
246
|
jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: remoteSourceParts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: remoteSourceParts.trailing })
|
|
276
|
-
] })) : null, group.id === 'transforms' ? renderTransformControls() : null, group.id === 'source' ? null : group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.
|
|
247
|
+
] })) : null, group.id === 'transforms' ? renderTransformControls() : null, group.id === 'source' ? null : group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: effectsHeader, children: effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null })) : null] }));
|
|
277
248
|
};
|
|
278
249
|
exports.InspectorSequenceSection = InspectorSequenceSection;
|
|
@@ -5,6 +5,7 @@ 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 format_file_location_1 = require("../helpers/format-file-location");
|
|
8
|
+
const common_1 = require("./InspectorPanel/common");
|
|
8
9
|
const source_attribution_1 = require("./Timeline/TimelineStack/source-attribution");
|
|
9
10
|
const sourceLocationStyle = {
|
|
10
11
|
alignSelf: 'flex-start',
|
|
@@ -40,7 +41,7 @@ const sourceLocationLabelStyle = {
|
|
|
40
41
|
textOverflow: 'ellipsis',
|
|
41
42
|
whiteSpace: 'nowrap',
|
|
42
43
|
};
|
|
43
|
-
const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon }) => {
|
|
44
|
+
const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon, size = 'default' }) => {
|
|
44
45
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
45
46
|
const validLocation = (0, react_1.useMemo)(() => {
|
|
46
47
|
if (!(location === null || location === void 0 ? void 0 : location.source) || location.line === null) {
|
|
@@ -80,6 +81,9 @@ const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon }) => {
|
|
|
80
81
|
if (!label) {
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
84
|
+
if (size === 'inline-action') {
|
|
85
|
+
return (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canOpen, onClick: onClick, renderIcon: (iconColor) => renderIcon === null || renderIcon === void 0 ? void 0 : renderIcon(iconColor), size: "compact", title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, children: label }));
|
|
86
|
+
}
|
|
83
87
|
return (jsx_runtime_1.jsxs("button", { type: "button", style: style, title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, onClick: onClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [renderIcon ? renderIcon(color) : null, jsx_runtime_1.jsx("span", { style: sourceLocationLabelStyle, children: label })
|
|
84
88
|
] }));
|
|
85
89
|
};
|
|
@@ -26,6 +26,7 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
26
26
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
27
27
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
28
28
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
29
|
+
const SvgImportDialog_1 = require("./SvgImportDialog");
|
|
29
30
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
30
31
|
const Modals = ({ readOnlyStudio }) => {
|
|
31
32
|
var _a;
|
|
@@ -34,6 +35,6 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
34
35
|
'connected';
|
|
35
36
|
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 === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
36
37
|
modalContextType.type === 'server-render' &&
|
|
37
|
-
(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 })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
38
|
+
(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, {})] }));
|
|
38
39
|
};
|
|
39
40
|
exports.Modals = Modals;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type ComboboxSize = 'default' | 'compact' | 'small';
|
|
2
3
|
type DividerItem = {
|
|
3
4
|
type: 'divider';
|
|
4
5
|
id: string;
|
|
@@ -26,6 +27,6 @@ export declare const Combobox: React.FC<{
|
|
|
26
27
|
readonly selectedId: string | number;
|
|
27
28
|
readonly style?: React.CSSProperties;
|
|
28
29
|
readonly title: string;
|
|
29
|
-
readonly
|
|
30
|
+
readonly size?: ComboboxSize;
|
|
30
31
|
}>;
|
|
31
32
|
export {};
|
|
@@ -24,8 +24,17 @@ const container = {
|
|
|
24
24
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
25
25
|
borderWidth: 1,
|
|
26
26
|
borderStyle: 'solid',
|
|
27
|
+
borderRadius: 4,
|
|
28
|
+
fontFamily: 'inherit',
|
|
27
29
|
maxWidth: '100%',
|
|
28
30
|
};
|
|
31
|
+
const compactContainer = {
|
|
32
|
+
...container,
|
|
33
|
+
boxSizing: 'border-box',
|
|
34
|
+
borderRadius: 0,
|
|
35
|
+
height: layout_1.COMPACT_CONTROL_ROW_HEIGHT + 2,
|
|
36
|
+
padding: '5px 6px',
|
|
37
|
+
};
|
|
29
38
|
const smallContainer = {
|
|
30
39
|
...container,
|
|
31
40
|
padding: '3px 4px',
|
|
@@ -34,16 +43,25 @@ const label = {
|
|
|
34
43
|
flex: 1,
|
|
35
44
|
overflow: 'hidden',
|
|
36
45
|
textOverflow: 'ellipsis',
|
|
46
|
+
color: 'inherit',
|
|
47
|
+
fontFamily: 'inherit',
|
|
37
48
|
fontSize: 14,
|
|
49
|
+
lineHeight: '21px',
|
|
50
|
+
minWidth: 0,
|
|
38
51
|
textAlign: 'left',
|
|
39
52
|
whiteSpace: 'nowrap',
|
|
40
53
|
};
|
|
54
|
+
const compactLabel = {
|
|
55
|
+
...label,
|
|
56
|
+
fontSize: 12,
|
|
57
|
+
lineHeight: '16px',
|
|
58
|
+
};
|
|
41
59
|
const smallLabel = {
|
|
42
60
|
...label,
|
|
43
61
|
fontSize: 11,
|
|
44
|
-
lineHeight:
|
|
62
|
+
lineHeight: '12px',
|
|
45
63
|
};
|
|
46
|
-
const Combobox = ({ values, selectedId, style: customStyle, title,
|
|
64
|
+
const Combobox = ({ values, selectedId, style: customStyle, title, size: controlSize = 'default', }) => {
|
|
47
65
|
const [hovered, setIsHovered] = (0, react_1.useState)(false);
|
|
48
66
|
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
49
67
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -163,7 +181,11 @@ const Combobox = ({ values, selectedId, style: customStyle, title, small = false
|
|
|
163
181
|
const selected = values.find((v) => v.id === selectedId);
|
|
164
182
|
const style = (0, react_1.useMemo)(() => {
|
|
165
183
|
return {
|
|
166
|
-
...(
|
|
184
|
+
...(controlSize === 'small'
|
|
185
|
+
? smallContainer
|
|
186
|
+
: controlSize === 'compact'
|
|
187
|
+
? compactContainer
|
|
188
|
+
: container),
|
|
167
189
|
...(customStyle !== null && customStyle !== void 0 ? customStyle : {}),
|
|
168
190
|
userSelect: 'none',
|
|
169
191
|
WebkitUserSelect: 'none',
|
|
@@ -177,11 +199,14 @@ const Combobox = ({ values, selectedId, style: customStyle, title, small = false
|
|
|
177
199
|
? colors_1.WHITE_ALPHA_05
|
|
178
200
|
: colors_1.BLACK_ALPHA_60,
|
|
179
201
|
};
|
|
180
|
-
}, [customStyle, hovered, opened
|
|
202
|
+
}, [controlSize, customStyle, hovered, opened]);
|
|
203
|
+
const selectedLabelStyle = controlSize === 'small'
|
|
204
|
+
? smallLabel
|
|
205
|
+
: controlSize === 'compact'
|
|
206
|
+
? compactLabel
|
|
207
|
+
: label;
|
|
181
208
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
182
|
-
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style:
|
|
183
|
-
" ",
|
|
184
|
-
jsx_runtime_1.jsx(caret_1.CaretDown, { small: small })
|
|
209
|
+
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: selectedLabelStyle, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'default' ? 1 : 0.5 }), ' ', jsx_runtime_1.jsx(caret_1.CaretDown, { small: controlSize === 'small' })
|
|
185
210
|
] }), portalStyle
|
|
186
211
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, onPointerDown: onOverlayPointerDown, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => selected && v.id === selected.id), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
187
212
|
: null] }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { InputHTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { RemInputStatus } from './RemInput';
|
|
4
|
+
export declare const inputDraggerContainerStyle: React.CSSProperties;
|
|
4
5
|
export declare const deriveInputDraggerStep: ({ min, snapToStep, step, }: {
|
|
5
6
|
readonly min: string | number | undefined;
|
|
6
7
|
readonly snapToStep: boolean;
|
|
@@ -10,6 +11,11 @@ export declare const deriveInputDraggerDragStartValue: ({ min, value, }: {
|
|
|
10
11
|
readonly min: string | number | undefined;
|
|
11
12
|
readonly value: string | number | readonly string[] | undefined;
|
|
12
13
|
}) => number;
|
|
14
|
+
export declare const isInputDraggerValueInRange: ({ max, min, value, }: {
|
|
15
|
+
readonly max: string | number | undefined;
|
|
16
|
+
readonly min: string | number | undefined;
|
|
17
|
+
readonly value: number;
|
|
18
|
+
}) => boolean;
|
|
13
19
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
14
20
|
readonly onValueChange: (newVal: number) => void;
|
|
15
21
|
readonly onValueChangeEnd?: ((newVal: number) => void) | 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.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = void 0;
|
|
36
|
+
exports.InputDragger = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = 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");
|
|
@@ -43,6 +43,15 @@ const input_dragger_click_lock_1 = require("../../state/input-dragger-click-lock
|
|
|
43
43
|
const z_index_1 = require("../../state/z-index");
|
|
44
44
|
const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
|
|
45
45
|
const RemInput_1 = require("./RemInput");
|
|
46
|
+
exports.inputDraggerContainerStyle = {
|
|
47
|
+
...RemInput_1.inputBaseStyle,
|
|
48
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
49
|
+
borderColor: colors_1.TRANSPARENT,
|
|
50
|
+
display: 'inline-block',
|
|
51
|
+
lineHeight: 1.5,
|
|
52
|
+
outline: 'none',
|
|
53
|
+
padding: '4px 6px',
|
|
54
|
+
};
|
|
46
55
|
const isInt = (num) => {
|
|
47
56
|
return num % 1 === 0;
|
|
48
57
|
};
|
|
@@ -76,20 +85,18 @@ const deriveInputDraggerDragStartValue = ({ min, value, }) => {
|
|
|
76
85
|
return 0;
|
|
77
86
|
};
|
|
78
87
|
exports.deriveInputDraggerDragStartValue = deriveInputDraggerDragStartValue;
|
|
88
|
+
const isInputDraggerValueInRange = ({ max, min, value, }) => {
|
|
89
|
+
const numericMin = Number(min);
|
|
90
|
+
const numericMax = Number(max);
|
|
91
|
+
return ((!Number.isFinite(numericMin) || value >= numericMin) &&
|
|
92
|
+
(!Number.isFinite(numericMax) || value <= numericMax));
|
|
93
|
+
};
|
|
94
|
+
exports.isInputDraggerValueInRange = isInputDraggerValueInRange;
|
|
79
95
|
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, ...props }, ref) => {
|
|
80
96
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
81
97
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
82
98
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
83
99
|
const pointerDownRef = (0, react_1.useRef)(false);
|
|
84
|
-
const style = (0, react_1.useMemo)(() => {
|
|
85
|
-
return {
|
|
86
|
-
...RemInput_1.inputBaseStyle,
|
|
87
|
-
backgroundColor: colors_1.TRANSPARENT,
|
|
88
|
-
borderColor: colors_1.TRANSPARENT,
|
|
89
|
-
padding: '4px 6px',
|
|
90
|
-
...{ outline: 'none' },
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
100
|
const span = (0, react_1.useMemo)(() => ({
|
|
94
101
|
color: dragging ? 'var(--remotion-cli-internals-blue-hovered)' : colors_1.BLUE,
|
|
95
102
|
cursor: 'ew-resize',
|
|
@@ -126,10 +133,16 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
126
133
|
}, []);
|
|
127
134
|
const onInputChange = (0, react_1.useCallback)((e) => {
|
|
128
135
|
const parsed = Number(e.target.value);
|
|
129
|
-
if (e.target.value !== '' &&
|
|
136
|
+
if (e.target.value !== '' &&
|
|
137
|
+
!Number.isNaN(parsed) &&
|
|
138
|
+
(0, exports.isInputDraggerValueInRange)({
|
|
139
|
+
max: _max,
|
|
140
|
+
min: _min,
|
|
141
|
+
value: parsed,
|
|
142
|
+
})) {
|
|
130
143
|
onValueChange(parsed);
|
|
131
144
|
}
|
|
132
|
-
}, [onValueChange]);
|
|
145
|
+
}, [_max, _min, onValueChange]);
|
|
133
146
|
const onBlur = (0, react_1.useCallback)(() => {
|
|
134
147
|
if (!fallbackRef.current) {
|
|
135
148
|
return;
|
|
@@ -233,6 +246,6 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
233
246
|
if (inputFallback) {
|
|
234
247
|
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign, small: small, ...props }) }));
|
|
235
248
|
}
|
|
236
|
-
return (jsx_runtime_1.jsx("button", { ref: ref, type: "button", className: '__remotion_input_dragger', style:
|
|
249
|
+
return (jsx_runtime_1.jsx("button", { ref: ref, type: "button", className: '__remotion_input_dragger', style: exports.inputDraggerContainerStyle, onClick: onClick, onFocus: onFocus, onKeyDown: onKeyDown, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }) }));
|
|
237
250
|
};
|
|
238
251
|
exports.InputDragger = react_1.default.forwardRef(InputDraggerForwardRefFn);
|
|
@@ -36,6 +36,13 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
36
36
|
: null;
|
|
37
37
|
const initialDimensions = (0, get_new_composition_defaults_1.getNewCompositionDefaults)(initialComposition);
|
|
38
38
|
const [newId, setName] = (0, react_1.useState)(() => (0, use_create_composition_1.getUniqueCompositionName)(compositions));
|
|
39
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
40
|
+
(0, react_1.useEffect)(() => {
|
|
41
|
+
const input = inputRef.current;
|
|
42
|
+
if (!input)
|
|
43
|
+
return;
|
|
44
|
+
input.select();
|
|
45
|
+
}, []);
|
|
39
46
|
const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(initialDimensions.fps);
|
|
40
47
|
const [size, setSize] = (0, react_1.useState)(() => ({
|
|
41
48
|
width: initialDimensions.width,
|
|
@@ -102,7 +109,7 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
102
109
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx("span", { style: folderPathStyle, children: folderPath }) })
|
|
103
110
|
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
104
111
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
105
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
112
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
106
113
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
|
|
107
114
|
] })) : null] }) })
|
|
108
115
|
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
export declare const WarningTriangle: React.FC<SVGProps<SVGSVGElement>>;
|
|
4
4
|
type ValidationMessageSize = 'default' | 'compact';
|
|
5
5
|
export declare const ValidationMessage: React.FC<{
|
|
6
|
-
readonly message:
|
|
6
|
+
readonly message: React.ReactNode;
|
|
7
7
|
readonly align: 'flex-start' | 'flex-end';
|
|
8
8
|
readonly type: 'warning' | 'error';
|
|
9
9
|
readonly action?: React.ReactNode;
|
|
@@ -16,13 +16,13 @@ const getPlaybackRateLabel = (playbackRate) => {
|
|
|
16
16
|
return `${playbackRate}x`;
|
|
17
17
|
};
|
|
18
18
|
const accessibilityLabel = 'Change the playback rate';
|
|
19
|
-
const comboStyle = { width:
|
|
19
|
+
const comboStyle = { width: 64 };
|
|
20
20
|
const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
21
21
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
22
22
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
23
23
|
const style = (0, react_1.useMemo)(() => {
|
|
24
24
|
return {
|
|
25
|
-
padding: ControlButton_1.CONTROL_BUTTON_PADDING,
|
|
25
|
+
padding: ControlButton_1.CONTROL_BUTTON_PADDING - 2,
|
|
26
26
|
};
|
|
27
27
|
}, []);
|
|
28
28
|
const items = (0, react_1.useMemo)(() => {
|
|
@@ -54,6 +54,6 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
|
54
54
|
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }) }));
|
|
57
|
+
return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "compact", title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }) }));
|
|
58
58
|
};
|
|
59
59
|
exports.PlaybackRateSelector = PlaybackRateSelector;
|