@remotion/studio 4.0.522 → 4.0.523
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/install-package.js +4 -2
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +5 -6
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +8 -6
- package/dist/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CompositionContextButton.js +4 -1
- package/dist/components/CompositionSelectorItem.js +2 -2
- package/dist/components/ConfigureLicenseModal.js +1 -1
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +287 -135
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +9 -8
- package/dist/components/GlobalKeybindings.js +50 -49
- package/dist/components/HighlightedElementSource.d.ts +5 -0
- package/dist/components/HighlightedElementSource.js +78 -0
- package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
- package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
- package/dist/components/InspectorPanel.js +4 -0
- package/dist/components/InspectorSequenceSection.js +64 -1
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/MenuToolbar.js +7 -5
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +3 -1
- package/dist/components/ModelManager.d.ts +16 -0
- package/dist/components/ModelManager.js +200 -0
- package/dist/components/ModelsSettings.d.ts +2 -0
- package/dist/components/ModelsSettings.js +133 -0
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +2 -2
- package/dist/components/NewComposition/InputDragger.js +6 -6
- package/dist/components/NewComposition/NewFolder.js +11 -8
- package/dist/components/NewComposition/RenameFolder.js +17 -10
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/PlayPause.js +4 -8
- package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +11 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
- package/dist/components/RadioButton.d.ts +1 -0
- package/dist/components/RadioButton.js +2 -2
- package/dist/components/RenderButton.js +5 -1
- package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
- package/dist/components/RenderModal/NumberSetting.js +2 -2
- package/dist/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
- package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/CaptionQueueItem.js +129 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
- package/dist/components/RenderQueue/caption-job-types.js +7 -0
- package/dist/components/RenderQueue/context.d.ts +16 -0
- package/dist/components/RenderQueue/context.js +224 -11
- package/dist/components/RenderQueue/index.js +34 -10
- package/dist/components/RenderQueue/item-style.d.ts +1 -0
- package/dist/components/RenderQueue/item-style.js +2 -1
- package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
- package/dist/components/RenderQueue/load-model-for-job.js +14 -0
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
- package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
- package/dist/components/RendersTab.js +4 -4
- package/dist/components/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl.js +38 -13
- package/dist/components/SelectedOutlinePolygon.js +8 -2
- package/dist/components/SettingsButton.d.ts +4 -0
- package/dist/components/SettingsButton.js +49 -0
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +3 -1
- package/dist/components/ShowOutlinesProvider.js +12 -0
- package/dist/components/SidebarCollapserControls.js +10 -11
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +5 -2
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +2 -2
- package/dist/components/TimeValue.js +2 -3
- package/dist/components/Timeline/SequencePropsObserver.js +4 -0
- package/dist/components/Timeline/Timeline.js +2 -42
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +11 -3
- package/dist/components/Timeline/TimelineSchemaField.js +8 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
- package/dist/components/Timeline/TimelineSelection.js +55 -2
- package/dist/components/Timeline/TimelineSequence.js +75 -17
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineInOutToggle.js +20 -17
- package/dist/components/Transcription/LazyModels.d.ts +1 -0
- package/dist/components/Transcription/LazyModels.js +5 -0
- package/dist/components/Transcription/Models.d.ts +6 -0
- package/dist/components/Transcription/Models.js +18 -0
- package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
- package/dist/components/Transcription/TranscriptionModal.js +428 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
- package/dist/components/Transcription/caption-output-name.d.ts +2 -0
- package/dist/components/Transcription/caption-output-name.js +10 -0
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
- package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
- package/dist/components/Transcription/whisper-languages.d.ts +2 -0
- package/dist/components/Transcription/whisper-languages.js +104 -0
- package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
- package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
- package/dist/components/UndoRedoButtons.js +13 -38
- package/dist/components/UpdatesSettings.js +8 -12
- package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
- package/dist/components/VideoMatting/LazyModels.js +5 -0
- package/dist/components/VideoMatting/Models.d.ts +6 -0
- package/dist/components/VideoMatting/Models.js +18 -0
- package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
- package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
- package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
- package/dist/components/VideoMatting/video-matting-capability.js +7 -0
- package/dist/components/WebMcp.js +439 -22
- package/dist/components/import-assets.d.ts +3 -2
- package/dist/components/import-assets.js +5 -9
- package/dist/components/keyboard-shortcuts.d.ts +17 -1
- package/dist/components/keyboard-shortcuts.js +177 -89
- package/dist/components/public-output-name.d.ts +5 -0
- package/dist/components/public-output-name.js +60 -0
- package/dist/components/use-model-cache-status.d.ts +7 -0
- package/dist/components/use-model-cache-status.js +35 -0
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
- package/dist/esm/LazyModels-2trdm224.mjs +11 -0
- package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
- package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
- package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1x7bsdh6.mjs +261 -0
- package/dist/esm/index-3hgr6gjx.mjs +41 -0
- package/dist/esm/index-5qddp5h7.mjs +36 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-6cvm9a65.mjs +45923 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-czwvnn9g.mjs +35 -0
- package/dist/esm/index-hy4xcgty.mjs +1366 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-sgtmgc4h.mjs +423 -0
- package/dist/esm/index-te66vvrp.mjs +142 -0
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-x7t2y7ws.mjs +54194 -0
- package/dist/esm/index-xhe2m2qr.mjs +1146 -0
- package/dist/esm/index.mjs +45 -933
- package/dist/esm/internals.mjs +13 -114393
- package/dist/esm/previewEntry.mjs +387 -115050
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- package/dist/helpers/drag-aware-double-click.d.ts +2 -1
- package/dist/helpers/drag-aware-double-click.js +12 -1
- package/dist/helpers/get-asset-metadata.d.ts +1 -0
- package/dist/helpers/get-asset-metadata.js +4 -0
- package/dist/helpers/hoverable.js +8 -0
- package/dist/helpers/inject-css.js +2 -0
- package/dist/helpers/optional-package-dependencies.d.ts +3 -0
- package/dist/helpers/optional-package-dependencies.js +24 -0
- package/dist/helpers/pointer-session.d.ts +6 -0
- package/dist/helpers/pointer-session.js +36 -14
- package/dist/helpers/prism-tomorrow.d.ts +1 -0
- package/dist/helpers/prism-tomorrow.js +151 -0
- package/dist/helpers/sequence-node-path-mutations.js +11 -0
- package/dist/helpers/slugify-name.d.ts +1 -0
- package/dist/helpers/slugify-name.js +14 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -0
- package/dist/helpers/studio-runtime-config.js +6 -1
- package/dist/helpers/use-keybinding.d.ts +9 -3
- package/dist/helpers/use-keybinding.js +8 -9
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
- package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
- package/dist/helpers/use-menu-structure.js +58 -13
- package/dist/icons/input-props.d.ts +1 -1
- package/dist/icons/input-props.js +2 -2
- package/dist/icons/models.d.ts +4 -0
- package/dist/icons/models.js +7 -0
- package/dist/icons/separation.d.ts +4 -0
- package/dist/icons/separation.js +7 -0
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/state/modals.d.ts +14 -2
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ModelsSettings = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const colors_1 = require("../helpers/colors");
|
|
40
|
+
const optional_package_dependencies_1 = require("../helpers/optional-package-dependencies");
|
|
41
|
+
const Button_1 = require("./Button");
|
|
42
|
+
const styles_1 = require("./InspectorPanel/styles");
|
|
43
|
+
const OptionalPackageModal_1 = require("./OptionalPackageModal");
|
|
44
|
+
const whisper_webgpu_capability_1 = require("./Transcription/whisper-webgpu-capability");
|
|
45
|
+
const video_matting_capability_1 = require("./VideoMatting/video-matting-capability");
|
|
46
|
+
const LazyWhisperModels = react_1.default.lazy(() => Promise.resolve().then(() => __importStar(require('./Transcription/LazyModels'))));
|
|
47
|
+
const LazyVideoMattingModels = react_1.default.lazy(() => Promise.resolve().then(() => __importStar(require('./VideoMatting/LazyModels'))));
|
|
48
|
+
const container = {
|
|
49
|
+
alignSelf: 'flex-start',
|
|
50
|
+
boxSizing: 'border-box',
|
|
51
|
+
fontFamily: 'sans-serif',
|
|
52
|
+
minWidth: 0,
|
|
53
|
+
padding: 16,
|
|
54
|
+
width: '100%',
|
|
55
|
+
};
|
|
56
|
+
const overview = {
|
|
57
|
+
color: colors_1.LIGHT_TEXT,
|
|
58
|
+
fontSize: 13,
|
|
59
|
+
lineHeight: 1.5,
|
|
60
|
+
margin: '0 0 16px',
|
|
61
|
+
};
|
|
62
|
+
const section = {
|
|
63
|
+
paddingBottom: 16,
|
|
64
|
+
};
|
|
65
|
+
const lastSection = {
|
|
66
|
+
paddingTop: 16,
|
|
67
|
+
};
|
|
68
|
+
const title = {
|
|
69
|
+
...styles_1.sectionHeader,
|
|
70
|
+
margin: 0,
|
|
71
|
+
padding: '4px 0 0',
|
|
72
|
+
};
|
|
73
|
+
const packageNameStyle = {
|
|
74
|
+
color: colors_1.LIGHT_TEXT,
|
|
75
|
+
fontFamily: 'monospace',
|
|
76
|
+
fontSize: 12,
|
|
77
|
+
lineHeight: 1.4,
|
|
78
|
+
margin: 0,
|
|
79
|
+
};
|
|
80
|
+
const headingRow = {
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
display: 'flex',
|
|
83
|
+
gap: 12,
|
|
84
|
+
justifyContent: 'space-between',
|
|
85
|
+
};
|
|
86
|
+
const missingText = {
|
|
87
|
+
color: colors_1.LIGHT_TEXT,
|
|
88
|
+
fontSize: 13,
|
|
89
|
+
lineHeight: 1.5,
|
|
90
|
+
margin: 0,
|
|
91
|
+
};
|
|
92
|
+
const missingDescription = {
|
|
93
|
+
...missingText,
|
|
94
|
+
marginTop: 14,
|
|
95
|
+
};
|
|
96
|
+
const installButton = {
|
|
97
|
+
backgroundColor: colors_1.BLUE,
|
|
98
|
+
color: colors_1.WHITE,
|
|
99
|
+
flexShrink: 0,
|
|
100
|
+
};
|
|
101
|
+
const errorStyle = {
|
|
102
|
+
color: colors_1.WARNING_COLOR,
|
|
103
|
+
fontSize: 12,
|
|
104
|
+
lineHeight: 1.4,
|
|
105
|
+
margin: '8px 0 0',
|
|
106
|
+
};
|
|
107
|
+
const OptionalModelPackage = ({ children, label, packageName, style }) => {
|
|
108
|
+
const installed = (0, OptionalPackageModal_1.useOptionalPackageInstalled)(packageName);
|
|
109
|
+
const [installState, setInstallState] = (0, react_1.useState)({
|
|
110
|
+
type: 'idle',
|
|
111
|
+
});
|
|
112
|
+
const install = (0, react_1.useCallback)(() => {
|
|
113
|
+
setInstallState({ type: 'installing' });
|
|
114
|
+
(0, OptionalPackageModal_1.installOptionalPackage)(packageName).catch((error) => {
|
|
115
|
+
setInstallState({
|
|
116
|
+
type: 'error',
|
|
117
|
+
message: error instanceof Error ? error.message : String(error),
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}, [packageName]);
|
|
121
|
+
return (jsx_runtime_1.jsxs("section", { style: style, children: [
|
|
122
|
+
jsx_runtime_1.jsxs("div", { style: headingRow, children: [
|
|
123
|
+
jsx_runtime_1.jsxs("div", { children: [
|
|
124
|
+
jsx_runtime_1.jsx("h3", { style: title, children: label }), jsx_runtime_1.jsx("p", { style: packageNameStyle, children: packageName })
|
|
125
|
+
] }), installed ? null : (jsx_runtime_1.jsx(Button_1.Button, { disabled: installState.type === 'installing', onClick: install, size: "compact", style: installButton, children: installState.type === 'installing' ? 'Installing…' : 'Install' }))] }), installed ? (jsx_runtime_1.jsx(react_1.Suspense, { fallback: jsx_runtime_1.jsx("p", { style: missingText, children: "Loading models\u2026" }), children: children })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
126
|
+
jsx_runtime_1.jsxs("p", { style: missingDescription, children: ["Install the package and ", optional_package_dependencies_1.TRANSFORMERS_PACKAGE, " to download and manage its models."] }), installState.type === 'error' ? (jsx_runtime_1.jsx("p", { style: errorStyle, children: installState.message })) : null] }))] }));
|
|
127
|
+
};
|
|
128
|
+
const ModelsSettings = () => {
|
|
129
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
130
|
+
jsx_runtime_1.jsx("p", { style: overview, children: "Models are downloaded automatically when needed. You can also manage the browser cache here." }), jsx_runtime_1.jsx(OptionalModelPackage, { label: "Transcription", packageName: whisper_webgpu_capability_1.WHISPER_WEBGPU_PACKAGE, style: section, children: jsx_runtime_1.jsx(LazyWhisperModels, { description: null, indent: false, visible: true }) }), jsx_runtime_1.jsx(OptionalModelPackage, { label: "Video matting", packageName: video_matting_capability_1.VIDEO_MATTING_PACKAGE, style: lastSection, children: jsx_runtime_1.jsx(LazyVideoMattingModels, { description: null, indent: false, visible: true }) })
|
|
131
|
+
] }));
|
|
132
|
+
};
|
|
133
|
+
exports.ModelsSettings = ModelsSettings;
|
|
@@ -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, panelStyle }) => {
|
|
8
|
+
const DismissableModal = ({ children, panelStyle, ariaLabel }) => {
|
|
9
9
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
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, panelStyle: panelStyle, children: children }));
|
|
13
|
+
return (jsx_runtime_1.jsx(ModalContainer_1.ModalContainer, { ariaLabel: ariaLabel, onOutsideClick: onQuit, onEscape: onQuit, panelStyle: panelStyle, children: children }));
|
|
14
14
|
};
|
|
15
15
|
exports.DismissableModal = DismissableModal;
|
|
@@ -55,8 +55,8 @@ export declare const deriveInputDraggerValueDiff: ({ dragSensitivity, step, xDis
|
|
|
55
55
|
readonly xDistance: number;
|
|
56
56
|
}) => number;
|
|
57
57
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
58
|
-
readonly onValueChange: (newVal: number) => void;
|
|
59
|
-
readonly onValueChangeEnd?: ((newVal: number) => void) | undefined;
|
|
58
|
+
readonly onValueChange: (newVal: number, source: "drag" | "input") => void;
|
|
59
|
+
readonly onValueChangeEnd?: ((newVal: number, source: "drag" | "input") => void) | undefined;
|
|
60
60
|
readonly onTextChange: (newVal: string) => void;
|
|
61
61
|
readonly status: RemInputStatus;
|
|
62
62
|
readonly formatter?: ((str: string | number) => string) | undefined;
|
|
@@ -385,7 +385,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
385
385
|
min: _min,
|
|
386
386
|
value: parsed,
|
|
387
387
|
})) {
|
|
388
|
-
onValueChange(parsed);
|
|
388
|
+
onValueChange(parsed, 'input');
|
|
389
389
|
}
|
|
390
390
|
}, [_max, _min, onValueChange]);
|
|
391
391
|
const onBlur = (0, react_1.useCallback)(() => {
|
|
@@ -405,7 +405,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
405
405
|
});
|
|
406
406
|
if (validation.valid) {
|
|
407
407
|
fallbackRef.current.setCustomValidity('');
|
|
408
|
-
onValueChangeEnd === null || onValueChangeEnd === void 0 ? void 0 : onValueChangeEnd(validation.value);
|
|
408
|
+
onValueChangeEnd === null || onValueChangeEnd === void 0 ? void 0 : onValueChangeEnd(validation.value, 'input');
|
|
409
409
|
setInputFallback(false);
|
|
410
410
|
}
|
|
411
411
|
else {
|
|
@@ -441,7 +441,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
441
441
|
});
|
|
442
442
|
e.currentTarget.value = String(nextValue);
|
|
443
443
|
e.currentTarget.setCustomValidity('');
|
|
444
|
-
onValueChange(nextValue);
|
|
444
|
+
onValueChange(nextValue, 'input');
|
|
445
445
|
}, [_max, _min, deriveStep, onValueChange, value]);
|
|
446
446
|
const roundToStep = (val, stepSize) => {
|
|
447
447
|
const factor = 1 / stepSize;
|
|
@@ -484,7 +484,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
484
484
|
? newValue
|
|
485
485
|
: roundToDecimalPlaces(newValue, dragDecimalPlaces);
|
|
486
486
|
lastDragValue = nextValue;
|
|
487
|
-
onValueChange(nextValue);
|
|
487
|
+
onValueChange(nextValue, 'drag');
|
|
488
488
|
};
|
|
489
489
|
(0, pointer_session_1.startCapturedPointerSession)({
|
|
490
490
|
event: e.nativeEvent,
|
|
@@ -496,7 +496,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
496
496
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
497
497
|
const commit = reason === 'pointerup' || reason === 'buttons-released';
|
|
498
498
|
if (commit && lastDragValue !== null && onValueChangeEnd) {
|
|
499
|
-
onValueChangeEnd(lastDragValue);
|
|
499
|
+
onValueChangeEnd(lastDragValue, 'drag');
|
|
500
500
|
}
|
|
501
501
|
setTimeout(() => {
|
|
502
502
|
(0, input_dragger_click_lock_1.setClickLock)(false);
|
|
@@ -529,7 +529,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
529
529
|
}
|
|
530
530
|
: inputStyle, type: "text" }) }));
|
|
531
531
|
}
|
|
532
|
-
return (jsx_runtime_1.jsxs("button", { ref: ref, type: "button", "aria-label": props['aria-label'], className: '__remotion_input_dragger', style: buttonStyle
|
|
532
|
+
return (jsx_runtime_1.jsxs("button", { ref: ref, type: "button", "aria-label": props['aria-label'], title: props.title, className: '__remotion_input_dragger', style: buttonStyle
|
|
533
533
|
? {
|
|
534
534
|
...(small
|
|
535
535
|
? compactInputDraggerContainerStyle
|
|
@@ -4,6 +4,8 @@ exports.NewFolder = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
8
|
+
const slugify_name_1 = require("../../helpers/slugify-name");
|
|
7
9
|
const validate_new_folder_name_1 = require("../../helpers/validate-new-folder-name");
|
|
8
10
|
const layout_1 = require("../layout");
|
|
9
11
|
const ModalFooter_1 = require("../ModalFooter");
|
|
@@ -46,19 +48,18 @@ const NewFolder = ({ parentName, stack }) => {
|
|
|
46
48
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
47
49
|
setName(e.target.value);
|
|
48
50
|
}, []);
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
newName,
|
|
52
|
-
|
|
53
|
-
});
|
|
51
|
+
const folderName = (0, slugify_name_1.slugifyName)(newName);
|
|
52
|
+
const folderNameErrMessage = folderName
|
|
53
|
+
? (0, validate_new_folder_name_1.validateNewFolderName)({ folders, newName: folderName, parentName })
|
|
54
|
+
: 'Enter a name containing letters or numbers.';
|
|
54
55
|
const valid = folderNameErrMessage === null;
|
|
55
56
|
const codemod = (0, react_1.useMemo)(() => {
|
|
56
57
|
return {
|
|
57
58
|
type: 'new-folder',
|
|
58
|
-
folderName
|
|
59
|
+
folderName,
|
|
59
60
|
parentName,
|
|
60
61
|
};
|
|
61
|
-
}, [
|
|
62
|
+
}, [folderName, parentName]);
|
|
62
63
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
63
64
|
e.preventDefault();
|
|
64
65
|
}, []);
|
|
@@ -68,7 +69,9 @@ const NewFolder = ({ parentName, stack }) => {
|
|
|
68
69
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Parent" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: parentName })
|
|
69
70
|
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
70
71
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
71
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }),
|
|
72
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderName && folderName !== newName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
73
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsxs("div", { "aria-live": "polite", style: { fontSize: 12, color: colors_1.LIGHT_TEXT }, children: ["Will be created as ", folderName] })
|
|
74
|
+
] })) : null, folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
72
75
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
|
|
73
76
|
] })) : null] }) })
|
|
74
77
|
] })
|
|
@@ -4,7 +4,9 @@ exports.RenameFolder = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const get_folder_id_1 = require("../../helpers/get-folder-id");
|
|
9
|
+
const slugify_name_1 = require("../../helpers/slugify-name");
|
|
8
10
|
const validate_folder_rename_1 = require("../../helpers/validate-folder-rename");
|
|
9
11
|
const layout_1 = require("../layout");
|
|
10
12
|
const ModalFooter_1 = require("../ModalFooter");
|
|
@@ -36,21 +38,24 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
|
36
38
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
37
39
|
setName(e.target.value);
|
|
38
40
|
}, []);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const slug = (0, slugify_name_1.slugifyName)(newName);
|
|
42
|
+
const folderNameErrMessage = slug
|
|
43
|
+
? (0, validate_folder_rename_1.validateFolderRename)({
|
|
44
|
+
folders,
|
|
45
|
+
newName: slug,
|
|
46
|
+
originalName: folderName,
|
|
47
|
+
parentName,
|
|
48
|
+
})
|
|
49
|
+
: 'Enter a name containing letters or numbers.';
|
|
50
|
+
const valid = folderNameErrMessage === null && folderName !== slug;
|
|
46
51
|
const codemod = (0, react_1.useMemo)(() => {
|
|
47
52
|
return {
|
|
48
53
|
type: 'rename-folder',
|
|
49
54
|
folderName,
|
|
50
55
|
parentName,
|
|
51
|
-
newName,
|
|
56
|
+
newName: slug,
|
|
52
57
|
};
|
|
53
|
-
}, [folderName,
|
|
58
|
+
}, [folderName, slug, parentName]);
|
|
54
59
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
55
60
|
e.preventDefault();
|
|
56
61
|
}, []);
|
|
@@ -59,7 +64,9 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
|
59
64
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${folderId}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
60
65
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
61
66
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
62
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }),
|
|
67
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), slug && slug !== newName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
68
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsxs("div", { "aria-live": "polite", style: { fontSize: 12, color: colors_1.LIGHT_TEXT }, children: ["Will be renamed to ", slug] })
|
|
69
|
+
] })) : null, folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
63
70
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
|
|
64
71
|
] })) : null] }) })
|
|
65
72
|
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const isOptionalPackageInstalled: (packageName: string) => boolean;
|
|
3
|
+
export declare const markOptionalPackageInstalled: (packageName: string) => void;
|
|
4
|
+
export declare const installOptionalPackage: (packageName: string) => Promise<void>;
|
|
5
|
+
export declare const useOptionalPackageInstalled: (packageName: string) => boolean;
|
|
6
|
+
export declare const OptionalPackageModal: React.FC<{
|
|
7
|
+
readonly ariaLabel: string;
|
|
8
|
+
readonly children: React.ReactNode;
|
|
9
|
+
readonly packageName: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.OptionalPackageModal = exports.useOptionalPackageInstalled = exports.installOptionalPackage = exports.markOptionalPackageInstalled = exports.isOptionalPackageInstalled = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const install_package_1 = require("../api/install-package");
|
|
40
|
+
const colors_1 = require("../helpers/colors");
|
|
41
|
+
const optional_package_dependencies_1 = require("../helpers/optional-package-dependencies");
|
|
42
|
+
const modals_1 = require("../state/modals");
|
|
43
|
+
const Button_1 = require("./Button");
|
|
44
|
+
const layout_1 = require("./layout");
|
|
45
|
+
const ModalButton_1 = require("./ModalButton");
|
|
46
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
47
|
+
const ModalFooter_1 = require("./ModalFooter");
|
|
48
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
49
|
+
const Spinner_1 = require("./Spinner");
|
|
50
|
+
const panelStyle = {
|
|
51
|
+
width: 'min(520px, calc(100vw - 40px))',
|
|
52
|
+
};
|
|
53
|
+
const contentStyle = {
|
|
54
|
+
color: colors_1.WHITE,
|
|
55
|
+
fontFamily: 'sans-serif',
|
|
56
|
+
fontSize: 14,
|
|
57
|
+
lineHeight: 1.5,
|
|
58
|
+
padding: 16,
|
|
59
|
+
};
|
|
60
|
+
const codeStyle = {
|
|
61
|
+
color: 'inherit',
|
|
62
|
+
fontFamily: 'monospace',
|
|
63
|
+
fontSize: 'inherit',
|
|
64
|
+
};
|
|
65
|
+
const statusStyle = {
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
color: colors_1.LIGHT_TEXT,
|
|
68
|
+
display: 'flex',
|
|
69
|
+
fontFamily: 'sans-serif',
|
|
70
|
+
fontSize: 14,
|
|
71
|
+
gap: 10,
|
|
72
|
+
lineHeight: 1.5,
|
|
73
|
+
};
|
|
74
|
+
const errorStyle = {
|
|
75
|
+
color: colors_1.WARNING_COLOR,
|
|
76
|
+
marginTop: 12,
|
|
77
|
+
whiteSpace: 'pre-wrap',
|
|
78
|
+
};
|
|
79
|
+
const cancelStyle = { minWidth: 90 };
|
|
80
|
+
const isOptionalPackageInstalled = (packageName) => {
|
|
81
|
+
var _a;
|
|
82
|
+
var _b;
|
|
83
|
+
return (_b = (_a = window.remotion_installedPackages) === null || _a === void 0 ? void 0 : _a.includes(packageName)) !== null && _b !== void 0 ? _b : false;
|
|
84
|
+
};
|
|
85
|
+
exports.isOptionalPackageInstalled = isOptionalPackageInstalled;
|
|
86
|
+
const OPTIONAL_PACKAGE_INSTALLED_EVENT = 'remotion-optional-package-installed';
|
|
87
|
+
const markOptionalPackageInstalled = (packageName) => {
|
|
88
|
+
var _a;
|
|
89
|
+
window.remotion_installedPackages = Array.from(new Set([...((_a = window.remotion_installedPackages) !== null && _a !== void 0 ? _a : []), packageName]));
|
|
90
|
+
window.dispatchEvent(new CustomEvent(OPTIONAL_PACKAGE_INSTALLED_EVENT, {
|
|
91
|
+
detail: packageName,
|
|
92
|
+
}));
|
|
93
|
+
};
|
|
94
|
+
exports.markOptionalPackageInstalled = markOptionalPackageInstalled;
|
|
95
|
+
const installOptionalPackage = async (packageName) => {
|
|
96
|
+
const dependencies = (0, optional_package_dependencies_1.withRequiredAuxiliaryPackages)([
|
|
97
|
+
{ name: packageName, version: null },
|
|
98
|
+
]);
|
|
99
|
+
await (0, install_package_1.installPackages)(dependencies);
|
|
100
|
+
for (const dependency of dependencies) {
|
|
101
|
+
(0, exports.markOptionalPackageInstalled)(dependency.name);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
exports.installOptionalPackage = installOptionalPackage;
|
|
105
|
+
const useOptionalPackageInstalled = (packageName) => {
|
|
106
|
+
const [installed, setInstalled] = (0, react_1.useState)(() => (0, exports.isOptionalPackageInstalled)(packageName));
|
|
107
|
+
(0, react_1.useEffect)(() => {
|
|
108
|
+
const onInstalled = (event) => {
|
|
109
|
+
if (event.detail === packageName) {
|
|
110
|
+
setInstalled(true);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
window.addEventListener(OPTIONAL_PACKAGE_INSTALLED_EVENT, onInstalled);
|
|
114
|
+
return () => window.removeEventListener(OPTIONAL_PACKAGE_INSTALLED_EVENT, onInstalled);
|
|
115
|
+
}, [packageName]);
|
|
116
|
+
return installed;
|
|
117
|
+
};
|
|
118
|
+
exports.useOptionalPackageInstalled = useOptionalPackageInstalled;
|
|
119
|
+
const OptionalPackageModal = ({ ariaLabel, children, packageName, title }) => {
|
|
120
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
121
|
+
const installed = (0, exports.useOptionalPackageInstalled)(packageName);
|
|
122
|
+
const [installState, setInstallState] = (0, react_1.useState)({
|
|
123
|
+
type: 'idle',
|
|
124
|
+
});
|
|
125
|
+
const busy = installState.type === 'installing';
|
|
126
|
+
const packageNames = (0, optional_package_dependencies_1.withRequiredAuxiliaryPackages)([
|
|
127
|
+
{ name: packageName, version: null },
|
|
128
|
+
]).map((dependency) => dependency.name);
|
|
129
|
+
const packagesLabel = packageNames.join(' and ');
|
|
130
|
+
const dismiss = (0, react_1.useCallback)(() => {
|
|
131
|
+
if (!busy) {
|
|
132
|
+
setSelectedModal(null);
|
|
133
|
+
}
|
|
134
|
+
}, [busy, setSelectedModal]);
|
|
135
|
+
const install = (0, react_1.useCallback)(async () => {
|
|
136
|
+
setInstallState({ type: 'installing' });
|
|
137
|
+
try {
|
|
138
|
+
await (0, exports.installOptionalPackage)(packageName);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
setInstallState({ type: 'error', error: error });
|
|
142
|
+
}
|
|
143
|
+
}, [packageName]);
|
|
144
|
+
if (installed) {
|
|
145
|
+
return children;
|
|
146
|
+
}
|
|
147
|
+
return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabel: ariaLabel, onEscape: dismiss, onOutsideClick: dismiss, panelStyle: panelStyle, children: [
|
|
148
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: title, onClose: dismiss }), jsx_runtime_1.jsx("div", { style: contentStyle, children: busy ? (jsx_runtime_1.jsxs("div", { style: statusStyle, children: [
|
|
149
|
+
jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: 18 }), `Installing ${packagesLabel}…`] })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["This requires installing", ' ', packageNames.map((name, index) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [index > 0 ? ' and ' : null, jsx_runtime_1.jsx("code", { style: codeStyle, children: name })
|
|
150
|
+
] }, name))), ". Continue?", installState.type === 'error' ? (jsx_runtime_1.jsx("div", { style: errorStyle, children: installState.error.message })) : null] })) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
151
|
+
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: busy, onClick: dismiss, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx(ModalButton_1.ModalButton, { disabled: busy, onClick: install, autoFocus: true, children: installState.type === 'error' ? 'Retry' : 'Continue' })
|
|
152
|
+
] }) })
|
|
153
|
+
] }));
|
|
154
|
+
};
|
|
155
|
+
exports.OptionalPackageModal = OptionalPackageModal;
|
|
@@ -147,36 +147,32 @@ const PlayPauseInner = ({ playbackRate, loop, bufferStateDelayInMilliseconds, mu
|
|
|
147
147
|
});
|
|
148
148
|
const space = keybindings.registerKeybinding({
|
|
149
149
|
event: 'keydown',
|
|
150
|
-
|
|
150
|
+
action: 'playPause',
|
|
151
151
|
callback: onSpace,
|
|
152
|
-
commandCtrlKey: false,
|
|
153
152
|
preventDefault: true,
|
|
154
153
|
triggerIfInputFieldFocused: false,
|
|
155
154
|
keepRegisteredWhenNotHighestContext: false,
|
|
156
155
|
});
|
|
157
156
|
const enter = keybindings.registerKeybinding({
|
|
158
157
|
event: 'keydown',
|
|
159
|
-
|
|
158
|
+
action: 'pauseAndReturnToPlaybackStart',
|
|
160
159
|
callback: onEnter,
|
|
161
|
-
commandCtrlKey: false,
|
|
162
160
|
preventDefault: false,
|
|
163
161
|
triggerIfInputFieldFocused: false,
|
|
164
162
|
keepRegisteredWhenNotHighestContext: false,
|
|
165
163
|
});
|
|
166
164
|
const a = keybindings.registerKeybinding({
|
|
167
165
|
event: 'keydown',
|
|
168
|
-
|
|
166
|
+
action: 'jumpToBeginning',
|
|
169
167
|
callback: jumpToStart,
|
|
170
|
-
commandCtrlKey: false,
|
|
171
168
|
preventDefault: true,
|
|
172
169
|
triggerIfInputFieldFocused: false,
|
|
173
170
|
keepRegisteredWhenNotHighestContext: false,
|
|
174
171
|
});
|
|
175
172
|
const e = keybindings.registerKeybinding({
|
|
176
173
|
event: 'keydown',
|
|
177
|
-
|
|
174
|
+
action: 'jumpToEnd',
|
|
178
175
|
callback: jumpToEnd,
|
|
179
|
-
commandCtrlKey: false,
|
|
180
176
|
preventDefault: true,
|
|
181
177
|
triggerIfInputFieldFocused: false,
|
|
182
178
|
keepRegisteredWhenNotHighestContext: false,
|
|
@@ -46,27 +46,24 @@ const PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
|
46
46
|
(0, react_1.useEffect)(() => {
|
|
47
47
|
const jKey = keybindings.registerKeybinding({
|
|
48
48
|
event: 'keydown',
|
|
49
|
-
|
|
49
|
+
action: 'reversePlayback',
|
|
50
50
|
callback: onJKey,
|
|
51
|
-
commandCtrlKey: false,
|
|
52
51
|
preventDefault: true,
|
|
53
52
|
triggerIfInputFieldFocused: false,
|
|
54
53
|
keepRegisteredWhenNotHighestContext: false,
|
|
55
54
|
});
|
|
56
55
|
const kKey = keybindings.registerKeybinding({
|
|
57
56
|
event: 'keydown',
|
|
58
|
-
|
|
57
|
+
action: 'pausePlayback',
|
|
59
58
|
callback: onKKey,
|
|
60
|
-
commandCtrlKey: false,
|
|
61
59
|
preventDefault: true,
|
|
62
60
|
triggerIfInputFieldFocused: false,
|
|
63
61
|
keepRegisteredWhenNotHighestContext: false,
|
|
64
62
|
});
|
|
65
63
|
const lKey = keybindings.registerKeybinding({
|
|
66
64
|
event: 'keydown',
|
|
67
|
-
|
|
65
|
+
action: 'playForward',
|
|
68
66
|
callback: onLKey,
|
|
69
|
-
commandCtrlKey: false,
|
|
70
67
|
preventDefault: true,
|
|
71
68
|
triggerIfInputFieldFocused: false,
|
|
72
69
|
keepRegisteredWhenNotHighestContext: false,
|
|
@@ -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 use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
8
9
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
9
10
|
const ellipsis_1 = require("../icons/ellipsis");
|
|
10
11
|
const checkerboard_1 = require("../state/checkerboard");
|
|
@@ -21,6 +22,8 @@ const clickButton = (id) => {
|
|
|
21
22
|
};
|
|
22
23
|
const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLoop, showCanvasViewControls, showCompositionControls, playbackRate, setPlaybackRate, loop, setLoop, }) => {
|
|
23
24
|
const keyboardShortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
25
|
+
const fullscreenShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('enterFullscreen');
|
|
26
|
+
const checkerboardShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleCheckerboard');
|
|
24
27
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
25
28
|
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
26
29
|
const { editorShowGuides, setEditorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
@@ -93,7 +96,9 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
93
96
|
label: 'Transparency as checkerboard',
|
|
94
97
|
value: 'checkerboard',
|
|
95
98
|
onClick: () => setCheckerboard((current) => !current),
|
|
96
|
-
keyHint: keyboardShortcutsDisabled
|
|
99
|
+
keyHint: keyboardShortcutsDisabled || checkerboardShortcut === ''
|
|
100
|
+
? null
|
|
101
|
+
: checkerboardShortcut,
|
|
97
102
|
leftItem: checkerboard ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
98
103
|
subMenu: null,
|
|
99
104
|
quickSwitcherLabel: null,
|
|
@@ -145,7 +150,9 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
145
150
|
label: 'Fullscreen',
|
|
146
151
|
value: 'fullscreen',
|
|
147
152
|
onClick: () => clickButton('fullscreen-toggle'),
|
|
148
|
-
keyHint: keyboardShortcutsDisabled
|
|
153
|
+
keyHint: keyboardShortcutsDisabled || fullscreenShortcut === ''
|
|
154
|
+
? null
|
|
155
|
+
: fullscreenShortcut,
|
|
149
156
|
leftItem: null,
|
|
150
157
|
subMenu: null,
|
|
151
158
|
quickSwitcherLabel: null,
|
|
@@ -153,6 +160,8 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
153
160
|
}
|
|
154
161
|
return items;
|
|
155
162
|
}, [
|
|
163
|
+
checkerboardShortcut,
|
|
164
|
+
fullscreenShortcut,
|
|
156
165
|
previewSizeItems,
|
|
157
166
|
playbackRateItems,
|
|
158
167
|
selectedPlaybackRate,
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ExplorerQuickSwitcherTrigger = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const ShortcutHint_1 = require("../../error-overlay/remotion-overlay/ShortcutHint");
|
|
7
6
|
const colors_1 = require("../../helpers/colors");
|
|
8
7
|
const hoverable_1 = require("../../helpers/hoverable");
|
|
9
8
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
9
|
+
const use_keyboard_shortcut_label_1 = require("../../helpers/use-keyboard-shortcut-label");
|
|
10
10
|
const ellipsis_1 = require("../../icons/ellipsis");
|
|
11
11
|
const modals_1 = require("../../state/modals");
|
|
12
12
|
const InlineDropdown_1 = require("../InlineDropdown");
|
|
@@ -60,8 +60,11 @@ const ExplorerQuickSwitcherTrigger = ({ mode, showShortcut, tabIndex, getActions
|
|
|
60
60
|
return jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { svgProps: ellipsisSvgProps, fill: color });
|
|
61
61
|
}, []);
|
|
62
62
|
const moreActionsTitle = mode === 'assets' ? 'More asset actions' : 'More composition actions';
|
|
63
|
+
const quickSwitcherShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('quickSwitcher');
|
|
63
64
|
return (jsx_runtime_1.jsxs("div", { style: quickSwitcherArea, children: [
|
|
64
|
-
jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, children: ["Search...", showShortcut &&
|
|
65
|
+
jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, children: ["Search...", showShortcut &&
|
|
66
|
+
!(0, use_keybinding_1.areKeyboardShortcutsDisabled)() &&
|
|
67
|
+
quickSwitcherShortcut !== '' ? (jsx_runtime_1.jsx("span", { style: shortcutLabel, children: quickSwitcherShortcut })) : null] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { variant: null, title: moreActionsTitle, renderAction: renderMoreActions, getItems: getActions, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME })
|
|
65
68
|
] }));
|
|
66
69
|
};
|
|
67
70
|
exports.ExplorerQuickSwitcherTrigger = ExplorerQuickSwitcherTrigger;
|