Skip to content

The swiss army knife of lossless video/audio editing

improve UI and dark mode #2561

Mikael Finstad251031b2c2a4
diff --git a/README.md b/README.md
index 2d2b09d5..8cf849d3 100644
--- a/README.md
+++ b/README.md
@@ -183,7 +183,7 @@ LosslessCut uses the Chromium browser's HTML5 video player, and not all formats/
## Attributions
- App icon made by [Dimi Kazak](http://www.flaticon.com/authors/dimi-kazak "Dimi Kazak") from [www.flaticon.com](http://www.flaticon.com "Flaticon") is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/ "Creative Commons BY 3.0").
- [Lottie animation by Chris Gannon](https://lottiefiles.com/7077-magic-flow).
-- Thanks to Adi Abinun for UI work.
+- Thanks to Adi Abinun and [@abdul-alhasany](https://github.com/mifi/lossless-cut/issues/2561) for UI work.
- Thanks to translators who helped translate the app. [You can too!](translation.md)
- [Thanks to everyone for supporting](https://mifi.no/thanks/) my open source work 🙌
diff --git a/package.json b/package.json
index 014b51e1..e2633790 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,8 @@
"@fontsource/open-sans": "^4.5.14",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-checkbox": "^1.2.3",
+ "@radix-ui/react-dialog": "^1.1.15",
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-switch": "^1.2.2",
"@tanstack/react-virtual": "^3.13.10",
"@tsconfig/node18": "^18.2.2",
@@ -92,7 +94,6 @@
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unicorn": "^51.0.1",
- "evergreen-ui": "^7.1.9",
"fast-xml-parser": "^4.4.1",
"framer-motion": "^9.0.3",
"i18next-parser": "^9.0.1",
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index dbd6e531..d5ee19b5 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -2,7 +2,6 @@ import { memo, useEffect, useState, useCallback, useRef, useMemo, CSSProperties,
import { FaAngleLeft, FaRegTimesCircle } from 'react-icons/fa';
import { MdRotate90DegreesCcw } from 'react-icons/md';
import { AnimatePresence, MotionConfig } from 'framer-motion';
-import { ThemeProvider } from 'evergreen-ui';
import i18n from 'i18next';
import { useTranslation } from 'react-i18next';
import { produce } from 'immer';
@@ -14,7 +13,6 @@ import sum from 'lodash/sum';
import invariant from 'tiny-invariant';
import { SweetAlertOptions } from 'sweetalert2';
-import theme from './theme';
import useTimelineScroll from './hooks/useTimelineScroll';
import useUserSettingsRoot from './hooks/useUserSettingsRoot';
import useFfmpegOperations, { OutputNotWritableError } from './hooks/useFfmpegOperations';
@@ -31,7 +29,6 @@ import { UserSettingsContext, SegColorsContext, UserSettingsContextType, AppCont
import NoFileLoaded from './NoFileLoaded';
import MediaSourcePlayer from './MediaSourcePlayer';
import TopMenu from './TopMenu';
-import Sheet from './components/Sheet';
import LastCommandsSheet from './LastCommandsSheet';
import StreamsSelector from './StreamsSelector';
import SegmentList from './SegmentList';
@@ -47,6 +44,7 @@ import ConcatDialog from './components/ConcatDialog';
import KeyboardShortcuts from './components/KeyboardShortcuts';
import Working from './components/Working';
import OutputFormatSelect from './components/OutputFormatSelect';
+import * as Dialog from './components/Dialog';
import { loadMifiLink, runStartupCheck } from './mifi';
import { darkModeTransition } from './colors';
@@ -104,6 +102,7 @@ import useStreamsMeta from './hooks/useStreamsMeta';
import { bottomStyle, videoStyle } from './styles';
import styles from './App.module.css';
import { DirectoryAccessDeclinedError } from '../errors';
+import SwalContainer from './components/SwalContainer';
const electron = window.require('electron');
const { exists } = window.require('fs-extra');
@@ -2525,322 +2524,339 @@ function App() {
<AppContext.Provider value={appContext}>
<SegColorsContext.Provider value={segColorsContext}>
<UserSettingsContext.Provider value={userSettingsContext}>
- <ThemeProvider value={theme}>
- <div className={rootClass} style={rootStyle}>
- <TopMenu
- filePath={filePath}
- fileFormat={fileFormat}
- changeEnabledStreamsFilter={changeEnabledStreamsFilter}
- applyEnabledStreamsFilter={applyEnabledStreamsFilter}
- enabledStreamsFilter={enabledStreamsFilter}
- clearOutDir={clearOutDir}
- isCustomFormatSelected={isCustomFormatSelected}
- renderOutFmt={renderOutFmt}
- toggleSettings={toggleSettings}
- numStreamsToCopy={numStreamsToCopy}
- numStreamsTotal={numStreamsTotal}
- setStreamsSelectorShown={setStreamsSelectorShown}
- selectedSegments={segmentsOrInverse.selected}
- />
+ <div className={rootClass} style={rootStyle} id="app-root">
+ <TopMenu
+ filePath={filePath}
+ fileFormat={fileFormat}
+ changeEnabledStreamsFilter={changeEnabledStreamsFilter}
+ applyEnabledStreamsFilter={applyEnabledStreamsFilter}
+ enabledStreamsFilter={enabledStreamsFilter}
+ clearOutDir={clearOutDir}
+ isCustomFormatSelected={isCustomFormatSelected}
+ renderOutFmt={renderOutFmt}
+ toggleSettings={toggleSettings}
+ numStreamsToCopy={numStreamsToCopy}
+ numStreamsTotal={numStreamsTotal}
+ setStreamsSelectorShown={setStreamsSelectorShown}
+ selectedSegments={segmentsOrInverse.selected}
+ toggleDarkMode={toggleDarkMode}
+ />
+
+ <div style={{ flexGrow: 1, display: 'flex', overflowY: 'hidden' }}>
+ <AnimatePresence>
+ {showLeftBar && (
+ <BatchFilesList
+ selectedBatchFiles={selectedBatchFiles}
+ filePath={filePath}
+ width={leftBarWidth}
+ batchFiles={batchFiles}
+ setBatchFiles={setBatchFiles}
+ onBatchFileSelect={onBatchFileSelect}
+ batchListRemoveFile={batchListRemoveFile}
+ closeBatch={closeBatch}
+ onMergeFilesClick={concatBatch}
+ onBatchConvertToSupportedFormatClick={convertFormatBatch}
+ onDrop={handleBatchFilesDrop}
+ />
+ )}
+ </AnimatePresence>
- <div style={{ flexGrow: 1, display: 'flex', overflowY: 'hidden' }}>
- <AnimatePresence>
- {showLeftBar && (
- <BatchFilesList
- selectedBatchFiles={selectedBatchFiles}
- filePath={filePath}
- width={leftBarWidth}
- batchFiles={batchFiles}
- setBatchFiles={setBatchFiles}
- onBatchFileSelect={onBatchFileSelect}
- batchListRemoveFile={batchListRemoveFile}
- closeBatch={closeBatch}
- onMergeFilesClick={concatBatch}
- onBatchConvertToSupportedFormatClick={convertFormatBatch}
- onDrop={handleBatchFilesDrop}
- />
- )}
- </AnimatePresence>
-
- {/* Middle part (also shown in fullscreen): */}
- <div style={{ position: 'relative', flexGrow: 1, overflow: 'hidden' }} ref={videoContainerRef}>
- {!isFileOpened && <NoFileLoaded mifiLink={mifiLink} currentCutSeg={currentCutSeg} onClick={openFilesDialog} darkMode={darkMode} keyBindingByAction={keyBindingByAction} />}
-
- <div className="no-user-select" style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, visibility: !isFileOpened || !hasVideo || bigWaveformEnabled ? 'hidden' : undefined }} onWheel={onTimelineWheel}>
- {/* eslint-disable-next-line jsx-a11y/media-has-caption */}
- <video
- className={styles['video']}
- tabIndex={-1}
- muted={playbackVolume === 0 || compatPlayerEnabled}
- ref={videoRef}
- style={videoStyle}
- src={fileUri}
- onPlay={onStartPlaying}
- onPause={onStopPlaying}
- onAbort={onVideoAbort}
- onDurationChange={onDurationChange}
- onTimeUpdate={onTimeUpdate}
- onError={onVideoError}
- onClick={onVideoClick}
- onDoubleClick={toggleFullscreenVideo}
- onFocusCapture={onVideoFocus}
- onSeeked={onSeeked}
- >
- {renderSubtitles()}
- </video>
-
- {filePath != null && compatPlayerEnabled && <MediaSourcePlayer rotate={effectiveRotation} filePath={filePath} videoStream={activeVideoStream} audioStreams={activeAudioStreams} masterVideoRef={videoRef} mediaSourceQuality={mediaSourceQuality} />}
- </div>
+ {/* Middle part (also shown in fullscreen): */}
+ <div style={{ position: 'relative', flexGrow: 1, overflow: 'hidden' }} ref={videoContainerRef}>
+ {!isFileOpened && <NoFileLoaded mifiLink={mifiLink} currentCutSeg={currentCutSeg} onClick={openFilesDialog} darkMode={darkMode} keyBindingByAction={keyBindingByAction} />}
+
+ <div className="no-user-select" style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, visibility: !isFileOpened || !hasVideo || bigWaveformEnabled ? 'hidden' : undefined }} onWheel={onTimelineWheel}>
+ {/* eslint-disable-next-line jsx-a11y/media-has-caption */}
+ <video
+ className={styles['video']}
+ tabIndex={-1}
+ muted={playbackVolume === 0 || compatPlayerEnabled}
+ ref={videoRef}
+ style={videoStyle}
+ src={fileUri}
+ onPlay={onStartPlaying}
+ onPause={onStopPlaying}
+ onAbort={onVideoAbort}
+ onDurationChange={onDurationChange}
+ onTimeUpdate={onTimeUpdate}
+ onError={onVideoError}
+ onClick={onVideoClick}
+ onDoubleClick={toggleFullscreenVideo}
+ onFocusCapture={onVideoFocus}
+ onSeeked={onSeeked}
+ >
+ {renderSubtitles()}
+ </video>
+
+ {filePath != null && compatPlayerEnabled && <MediaSourcePlayer rotate={effectiveRotation} filePath={filePath} videoStream={activeVideoStream} audioStreams={activeAudioStreams} masterVideoRef={videoRef} mediaSourceQuality={mediaSourceQuality} />}
+ </div>
- {bigWaveformEnabled && <BigWaveform waveforms={waveforms} relevantTime={relevantTime} playing={playing} fileDurationNonZero={fileDurationNonZero} zoom={zoomUnrounded} seekRel={seekRel} darkMode={darkMode} />}
-
- {compatPlayerEnabled && (
- <div style={{ position: 'absolute', top: 0, right: 0, left: 0, marginTop: '1em', marginLeft: '1em', color: 'white', opacity: 0.7, display: 'flex', alignItems: 'center', pointerEvents: 'none' }}>
- {isRotationSet ? (
- <>
- <MdRotate90DegreesCcw size={26} style={{ marginRight: 5 }} />
- {t('Rotation preview')}
- </>
- ) : (
- <>
- {t('FFmpeg-assisted playback')}
- </>
- )}
-
- <div style={{ cursor: 'pointer', pointerEvents: 'initial', color: 'white', opacity: 0.7, padding: '.2em', marginLeft: '.5em' }} role="button" onClick={() => incrementMediaSourceQuality()} title={t('Select playback quality')}>{mediaSourceQualities[mediaSourceQuality]}</div>
-
- {!compatPlayerRequired && <FaRegTimesCircle role="button" style={{ cursor: 'pointer', pointerEvents: 'initial', verticalAlign: 'middle', padding: '.2em' }} onClick={handleHideCompatPlayerClick} />}
- </div>
- )}
+ {bigWaveformEnabled && <BigWaveform waveforms={waveforms} relevantTime={relevantTime} playing={playing} fileDurationNonZero={fileDurationNonZero} zoom={zoomUnrounded} seekRel={seekRel} darkMode={darkMode} />}
- {isFileOpened && (
- <div className="no-user-select" style={{ position: 'absolute', right: 0, bottom: 0, marginBottom: 10, display: 'flex', alignItems: 'flex-end' }}>
- <VolumeControl playbackVolume={playbackVolume} setPlaybackVolume={setPlaybackVolume} onToggleMutedClick={toggleMuted} />
-
- {shouldShowPlaybackStreamSelector && (
- <PlaybackStreamSelector subtitleStreams={subtitleStreams} videoStreams={videoStreams} audioStreams={audioStreams} activeSubtitleStreamIndex={activeSubtitleStreamIndex} activeVideoStreamIndex={activeVideoStreamIndex} activeAudioStreamIndexes={activeAudioStreamIndexes} onActiveSubtitleChange={onActiveSubtitleChange} onActiveVideoStreamChange={onActiveVideoStreamChange} onActiveAudioStreamsChange={onActiveAudioStreamsChange} />
- )}
-
- {!showRightBar && (
- <FaAngleLeft
- title={t('Show sidebar')}
- size={30}
- role="button"
- style={{ marginRight: 10, color: 'var(--gray-12)', opacity: 0.7 }}
- onClick={toggleSegmentsList}
- />
- )}
- </div>
- )}
- </div>
+ {compatPlayerEnabled && (
+ <div style={{ position: 'absolute', top: 0, right: 0, left: 0, marginTop: '1em', marginLeft: '1em', color: 'var(--gray-12)', opacity: 0.7, display: 'flex', alignItems: 'center', pointerEvents: 'none' }}>
+ {isRotationSet ? (
+ <>
+ <MdRotate90DegreesCcw size={26} style={{ marginRight: 5 }} />
+ {t('Rotation preview')}
+ </>
+ ) : (
+ <>
+ {t('FFmpeg-assisted playback')}
+ </>
+ )}
- <AnimatePresence>
- {showRightBar && isFileOpened && filePath != null && (
- <SegmentList
- width={rightBarWidth}
- currentSegIndex={currentSegIndexSafe}
- cutSegments={cutSegments}
- inverseCutSegments={inverseCutSegments}
- getFrameCount={getFrameCount}
- formatTimecode={formatTimecode}
- onSegClick={setCurrentSegIndex}
- updateSegOrder={updateSegOrder}
- updateSegOrders={updateSegOrders}
- onLabelSegment={labelSegment}
- currentCutSeg={currentCutSeg}
- firstSegmentAtCursor={firstSegmentAtCursor}
- addSegment={addSegment}
- onDuplicateSegmentClick={duplicateSegment}
- removeSegment={removeSegment}
- onRemoveSelected={removeSelectedSegments}
- toggleSegmentsList={toggleSegmentsList}
- splitCurrentSegment={splitCurrentSegment}
- selectedSegments={segmentsOrInverse.selected}
- onSelectSingleSegment={selectOnlySegment}
- onToggleSegmentSelected={toggleSegmentSelected}
- onDeselectAllSegments={deselectAllSegments}
- onSelectAllSegments={selectAllSegments}
- onInvertSelectedSegments={invertSelectedSegments}
- onExtractSegmentsFramesAsImages={extractSegmentsFramesAsImages}
- onExtractSelectedSegmentsFramesAsImages={extractSelectedSegmentsFramesAsImages}
- jumpSegStart={jumpSegStart}
- jumpSegEnd={jumpSegEnd}
- onSelectSegmentsByLabel={selectSegmentsByLabel}
- onSelectSegmentsByExpr={selectSegmentsByExpr}
- onSelectAllMarkers={selectAllMarkers}
- onMutateSegmentsByExpr={mutateSegmentsByExpr}
- onLabelSelectedSegments={labelSelectedSegments}
- updateSegAtIndex={updateSegAtIndex}
- editingSegmentTags={editingSegmentTags}
- editingSegmentTagsSegmentIndex={editingSegmentTagsSegmentIndex}
- setEditingSegmentTags={setEditingSegmentTags}
- setEditingSegmentTagsSegmentIndex={setEditingSegmentTagsSegmentIndex}
- onEditSegmentTags={onEditSegmentTags}
- />
- )}
- </AnimatePresence>
- </div>
+ <div style={{ cursor: 'pointer', pointerEvents: 'initial', color: 'var(--gray-12)', opacity: 0.7, padding: '.2em', marginLeft: '.5em' }} role="button" onClick={() => incrementMediaSourceQuality()} title={t('Select playback quality')}>{mediaSourceQualities[mediaSourceQuality]}</div>
+
+ {!compatPlayerRequired && <FaRegTimesCircle role="button" style={{ cursor: 'pointer', pointerEvents: 'initial', verticalAlign: 'middle', padding: '.2em' }} onClick={handleHideCompatPlayerClick} />}
+ </div>
+ )}
- <div className="no-user-select" style={bottomStyle}>
- <Timeline
- shouldShowKeyframes={shouldShowKeyframes}
- waveforms={waveforms}
- overviewWaveform={overviewWaveform}
- shouldShowWaveform={shouldShowWaveform}
- waveformEnabled={waveformEnabled}
- waveformHeight={waveformHeight}
- showThumbnails={showThumbnails}
- neighbouringKeyFrames={neighbouringKeyFrames}
- thumbnails={thumbnailsSorted}
- playerTime={playerTime}
- commandedTime={commandedTime}
- relevantTime={relevantTime}
- commandedTimeRef={commandedTimeRef}
- startTimeOffset={startTimeOffset}
- zoom={zoom}
- seekAbs={seekAbs}
- fileDurationNonZero={fileDurationNonZero}
- cutSegments={cutSegments}
- setCurrentSegIndex={setCurrentSegIndex}
- currentSegIndexSafe={currentSegIndexSafe}
- inverseCutSegments={inverseCutSegments}
- formatTimecode={formatTimecode}
- formatTimeAndFrames={formatTimeAndFrames}
- zoomWindowStartTime={zoomWindowStartTime}
- zoomWindowEndTime={zoomWindowEndTime}
- onZoomWindowStartTimeChange={setZoomWindowStartTime}
- onGenerateOverviewWaveformClick={onGenerateOverviewWaveformClick}
- playing={playing}
- isFileOpened={isFileOpened}
- onWheel={onTimelineWheel}
- goToTimecode={goToTimecode}
- darkMode={darkMode}
- />
-
- <BottomBar
- zoom={zoom}
- setZoom={zoomAbs}
- timelineToggleComfortZoom={timelineToggleComfortZoom}
- hasVideo={hasVideo}
- isRotationSet={isRotationSet}
- rotation={rotation}
- areWeCutting={areWeCutting}
- increaseRotation={increaseRotation}
- cleanupFilesDialog={cleanupFilesDialog}
- captureSnapshot={captureSnapshot}
- onExportPress={onExportPress}
- segmentsToExport={segmentsToExport}
- seekAbs={seekAbs}
- currentSegIndexSafe={currentSegIndexSafe}
- cutSegments={cutSegments}
- currentCutSeg={currentCutSeg}
- selectedSegments={selectedSegments}
- setCutStart={setCutStart}
- setCutEnd={setCutEnd}
- setCurrentSegIndex={setCurrentSegIndex}
- jumpCutEnd={jumpCutEnd}
- jumpCutStart={jumpCutStart}
- jumpTimelineStart={jumpTimelineStart}
- jumpTimelineEnd={jumpTimelineEnd}
- startTimeOffset={startTimeOffset}
- setCutTime={setCutTime}
- playing={playing}
- shortStep={shortStep}
- seekClosestKeyframe={seekClosestKeyframe}
- togglePlay={togglePlay}
- showThumbnails={showThumbnails}
- toggleShowThumbnails={toggleShowThumbnails}
- toggleWaveformMode={toggleWaveformMode}
- waveformMode={waveformMode}
- hasAudio={hasAudio}
- keyframesEnabled={keyframesEnabled}
- toggleShowKeyframes={toggleShowKeyframes}
- detectedFps={detectedFps}
- toggleLoopSelectedSegments={toggleLoopSelectedSegments}
- isFileOpened={isFileOpened}
- darkMode={darkMode}
- toggleDarkMode={toggleDarkMode}
- outputPlaybackRate={outputPlaybackRate}
- setOutputPlaybackRate={setOutputPlaybackRate}
- formatTimecode={formatTimecode}
- parseTimecode={parseTimecode}
- playbackRate={playbackRate}
- currentFrame={currentFrame}
- />
+ {isFileOpened && (
+ <div className="no-user-select" style={{ position: 'absolute', right: 0, bottom: 0, marginBottom: 10, display: 'flex', alignItems: 'flex-end' }}>
+ <VolumeControl playbackVolume={playbackVolume} setPlaybackVolume={setPlaybackVolume} onToggleMutedClick={toggleMuted} />
+
+ {shouldShowPlaybackStreamSelector && (
+ <PlaybackStreamSelector subtitleStreams={subtitleStreams} videoStreams={videoStreams} audioStreams={audioStreams} activeSubtitleStreamIndex={activeSubtitleStreamIndex} activeVideoStreamIndex={activeVideoStreamIndex} activeAudioStreamIndexes={activeAudioStreamIndexes} onActiveSubtitleChange={onActiveSubtitleChange} onActiveVideoStreamChange={onActiveVideoStreamChange} onActiveAudioStreamsChange={onActiveAudioStreamsChange} />
+ )}
+
+ {!showRightBar && (
+ <FaAngleLeft
+ title={t('Show sidebar')}
+ size={30}
+ role="button"
+ style={{ marginRight: 10, color: 'var(--gray-12)', opacity: 0.7 }}
+ onClick={toggleSegmentsList}
+ />
+ )}
+ </div>
+ )}
</div>
- {tunerVisible != null && <ValueTuners type={tunerVisible} onFinished={() => setTunerVisible(undefined)} />}
-
- {/* Dialogs */}
-
- <ExportConfirm areWeCutting={areWeCutting} segmentsOrInverse={segmentsOrInverse} segmentsToExport={segmentsToExport} willMerge={willMerge} visible={exportConfirmVisible} onClosePress={closeExportConfirm} onExportConfirm={onExportConfirm} renderOutFmt={renderOutFmt} outputDir={outputDir} numStreamsTotal={numStreamsTotal} numStreamsToCopy={numStreamsToCopy} onShowStreamsSelectorClick={handleShowStreamsSelectorClick} outFormat={fileFormat} setOutSegTemplate={setOutSegTemplate} outSegTemplate={outSegTemplateOrDefault} mergedFileTemplate={mergedFileTemplateOrDefault} setMergedFileTemplate={setMergedFileTemplate} generateOutSegFileNames={generateOutSegFileNames} generateMergedFileNames={generateMergedFileNames} currentSegIndexSafe={currentSegIndexSafe} mainCopiedThumbnailStreams={mainCopiedThumbnailStreams} needSmartCut={needSmartCut} isEncoding={isEncoding} encBitrate={encBitrate} setEncBitrate={setEncBitrate} toggleSettings={toggleSettings} outputPlaybackRate={outputPlaybackRate} lossyMode={lossyMode} />
-
- <Sheet visible={streamsSelectorShown} onClosePress={() => setStreamsSelectorShown(false)} maxWidth={1000}>
- {mainStreams && filePath != null && (
- <StreamsSelector
- mainFilePath={filePath}
- mainFileFormatData={mainFileFormatData}
- mainFileChapters={mainFileChapters}
- allFilesMeta={allFilesMeta}
- externalFilesMeta={externalFilesMeta}
- setExternalFilesMeta={setExternalFilesMeta}
- showAddStreamSourceDialog={showIncludeExternalStreamsDialog}
- mainFileStreams={mainStreams}
- isCopyingStreamId={isCopyingStreamId}
- toggleCopyStreamId={toggleCopyStreamId}
- setCopyStreamIdsForPath={setCopyStreamIdsForPath}
- onExtractAllStreamsPress={extractAllStreams}
- onExtractStreamPress={extractSingleStream}
- shortestFlag={shortestFlag}
- setShortestFlag={setShortestFlag}
- nonCopiedExtraStreams={nonCopiedExtraStreams}
- customTagsByFile={customTagsByFile}
- setCustomTagsByFile={setCustomTagsByFile}
- paramsByStreamId={paramsByStreamId}
- updateStreamParams={updateStreamParams}
+ <AnimatePresence>
+ {showRightBar && isFileOpened && filePath != null && (
+ <SegmentList
+ width={rightBarWidth}
+ currentSegIndex={currentSegIndexSafe}
+ cutSegments={cutSegments}
+ inverseCutSegments={inverseCutSegments}
+ getFrameCount={getFrameCount}
formatTimecode={formatTimecode}
- loadSubtitleTrackToSegments={loadSubtitleTrackToSegments}
- toggleCopyStreamIds={toggleCopyStreamIds}
- changeEnabledStreamsFilter={changeEnabledStreamsFilter}
- toggleCopyAllStreamsForPath={toggleCopyAllStreamsForPath}
- onStreamSourceFileDrop={handleStreamSourceFileDrop}
+ onSegClick={setCurrentSegIndex}
+ updateSegOrder={updateSegOrder}
+ updateSegOrders={updateSegOrders}
+ onLabelSegment={labelSegment}
+ currentCutSeg={currentCutSeg}
+ firstSegmentAtCursor={firstSegmentAtCursor}
+ addSegment={addSegment}
+ onDuplicateSegmentClick={duplicateSegment}
+ removeSegment={removeSegment}
+ onRemoveSelected={removeSelectedSegments}
+ toggleSegmentsList={toggleSegmentsList}
+ splitCurrentSegment={splitCurrentSegment}
+ selectedSegments={segmentsOrInverse.selected}
+ onSelectSingleSegment={selectOnlySegment}
+ onToggleSegmentSelected={toggleSegmentSelected}
+ onDeselectAllSegments={deselectAllSegments}
+ onSelectAllSegments={selectAllSegments}
+ onInvertSelectedSegments={invertSelectedSegments}
+ onExtractSegmentsFramesAsImages={extractSegmentsFramesAsImages}
+ onExtractSelectedSegmentsFramesAsImages={extractSelectedSegmentsFramesAsImages}
+ jumpSegStart={jumpSegStart}
+ jumpSegEnd={jumpSegEnd}
+ onSelectSegmentsByLabel={selectSegmentsByLabel}
+ onSelectSegmentsByExpr={selectSegmentsByExpr}
+ onSelectAllMarkers={selectAllMarkers}
+ onMutateSegmentsByExpr={mutateSegmentsByExpr}
+ onLabelSelectedSegments={labelSelectedSegments}
+ updateSegAtIndex={updateSegAtIndex}
+ editingSegmentTags={editingSegmentTags}
+ editingSegmentTagsSegmentIndex={editingSegmentTagsSegmentIndex}
+ setEditingSegmentTags={setEditingSegmentTags}
+ setEditingSegmentTagsSegmentIndex={setEditingSegmentTagsSegmentIndex}
+ onEditSegmentTags={onEditSegmentTags}
/>
)}
- </Sheet>
+ </AnimatePresence>
+ </div>
- <LastCommandsSheet
- visible={lastCommandsVisible}
- onTogglePress={toggleLastCommands}
- ffmpegCommandLog={ffmpegCommandLog}
- setFfmpegCommandLog={setFfmpegCommandLog}
+ <div className="no-user-select" style={bottomStyle}>
+ <Timeline
+ shouldShowKeyframes={shouldShowKeyframes}
+ waveforms={waveforms}
+ overviewWaveform={overviewWaveform}
+ shouldShowWaveform={shouldShowWaveform}
+ waveformEnabled={waveformEnabled}
+ waveformHeight={waveformHeight}
+ showThumbnails={showThumbnails}
+ neighbouringKeyFrames={neighbouringKeyFrames}
+ thumbnails={thumbnailsSorted}
+ playerTime={playerTime}
+ commandedTime={commandedTime}
+ relevantTime={relevantTime}
+ commandedTimeRef={commandedTimeRef}
+ startTimeOffset={startTimeOffset}
+ zoom={zoom}
+ seekAbs={seekAbs}
+ fileDurationNonZero={fileDurationNonZero}
+ cutSegments={cutSegments}
+ setCurrentSegIndex={setCurrentSegIndex}
+ currentSegIndexSafe={currentSegIndexSafe}
+ inverseCutSegments={inverseCutSegments}
+ formatTimecode={formatTimecode}
+ formatTimeAndFrames={formatTimeAndFrames}
+ zoomWindowStartTime={zoomWindowStartTime}
+ zoomWindowEndTime={zoomWindowEndTime}
+ onZoomWindowStartTimeChange={setZoomWindowStartTime}
+ onGenerateOverviewWaveformClick={onGenerateOverviewWaveformClick}
+ playing={playing}
+ isFileOpened={isFileOpened}
+ onWheel={onTimelineWheel}
+ goToTimecode={goToTimecode}
+ darkMode={darkMode}
/>
- <Sheet visible={settingsVisible} onClosePress={toggleSettings}>
- <Settings
- onTunerRequested={onTunerRequested}
- onKeyboardShortcutsDialogRequested={toggleKeyboardShortcuts}
- askForCleanupChoices={askForCleanupChoices}
- toggleStoreProjectInWorkingDir={toggleStoreProjectInWorkingDir}
- simpleMode={simpleMode}
- clearOutDir={clearOutDir}
- />
- </Sheet>
+ <BottomBar
+ zoom={zoom}
+ setZoom={zoomAbs}
+ timelineToggleComfortZoom={timelineToggleComfortZoom}
+ hasVideo={hasVideo}
+ isRotationSet={isRotationSet}
+ rotation={rotation}
+ areWeCutting={areWeCutting}
+ increaseRotation={increaseRotation}
+ cleanupFilesDialog={cleanupFilesDialog}
+ captureSnapshot={captureSnapshot}
+ onExportPress={onExportPress}
+ segmentsToExport={segmentsToExport}
+ seekAbs={seekAbs}
+ currentSegIndexSafe={currentSegIndexSafe}
+ cutSegments={cutSegments}
+ currentCutSeg={currentCutSeg}
+ selectedSegments={selectedSegments}
+ setCutStart={setCutStart}
+ setCutEnd={setCutEnd}
+ setCurrentSegIndex={setCurrentSegIndex}
+ jumpCutEnd={jumpCutEnd}
+ jumpCutStart={jumpCutStart}
+ jumpTimelineStart={jumpTimelineStart}
+ jumpTimelineEnd={jumpTimelineEnd}
+ startTimeOffset={startTimeOffset}
+ setCutTime={setCutTime}
+ playing={playing}
+ shortStep={shortStep}
+ seekClosestKeyframe={seekClosestKeyframe}
+ togglePlay={togglePlay}
+ showThumbnails={showThumbnails}
+ toggleShowThumbnails={toggleShowThumbnails}
+ toggleWaveformMode={toggleWaveformMode}
+ waveformMode={waveformMode}
+ hasAudio={hasAudio}
+ keyframesEnabled={keyframesEnabled}
+ toggleShowKeyframes={toggleShowKeyframes}
+ detectedFps={detectedFps}
+ toggleLoopSelectedSegments={toggleLoopSelectedSegments}
+ isFileOpened={isFileOpened}
+ darkMode={darkMode}
+ outputPlaybackRate={outputPlaybackRate}
+ setOutputPlaybackRate={setOutputPlaybackRate}
+ formatTimecode={formatTimecode}
+ parseTimecode={parseTimecode}
+ playbackRate={playbackRate}
+ currentFrame={currentFrame}
+ />
+ </div>
+
+ {tunerVisible != null && <ValueTuners type={tunerVisible} onFinished={() => setTunerVisible(undefined)} />}
+
+ {/* Dialogs */}
+
+ <ExportConfirm areWeCutting={areWeCutting} segmentsOrInverse={segmentsOrInverse} segmentsToExport={segmentsToExport} willMerge={willMerge} visible={exportConfirmVisible} onClosePress={closeExportConfirm} onExportConfirm={onExportConfirm} renderOutFmt={renderOutFmt} outputDir={outputDir} numStreamsTotal={numStreamsTotal} numStreamsToCopy={numStreamsToCopy} onShowStreamsSelectorClick={handleShowStreamsSelectorClick} outFormat={fileFormat} setOutSegTemplate={setOutSegTemplate} outSegTemplate={outSegTemplateOrDefault} mergedFileTemplate={mergedFileTemplateOrDefault} setMergedFileTemplate={setMergedFileTemplate} generateOutSegFileNames={generateOutSegFileNames} generateMergedFileNames={generateMergedFileNames} currentSegIndexSafe={currentSegIndexSafe} mainCopiedThumbnailStreams={mainCopiedThumbnailStreams} needSmartCut={needSmartCut} isEncoding={isEncoding} encBitrate={encBitrate} setEncBitrate={setEncBitrate} toggleSettings={toggleSettings} outputPlaybackRate={outputPlaybackRate} lossyMode={lossyMode} />
+
+ <Dialog.Root open={streamsSelectorShown} onOpenChange={setStreamsSelectorShown}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '80em' }}>
+ <Dialog.Title>{t('Tracks')}</Dialog.Title>
+ <Dialog.Description>{t('Click to select which tracks to keep when exporting:')}</Dialog.Description>
+
+ {mainStreams && filePath != null && (
+ <StreamsSelector
+ mainFilePath={filePath}
+ mainFileFormatData={mainFileFormatData}
+ mainFileChapters={mainFileChapters}
+ allFilesMeta={allFilesMeta}
+ externalFilesMeta={externalFilesMeta}
+ setExternalFilesMeta={setExternalFilesMeta}
+ showAddStreamSourceDialog={showIncludeExternalStreamsDialog}
+ mainFileStreams={mainStreams}
+ isCopyingStreamId={isCopyingStreamId}
+ toggleCopyStreamId={toggleCopyStreamId}
+ setCopyStreamIdsForPath={setCopyStreamIdsForPath}
+ onExtractAllStreamsPress={extractAllStreams}
+ onExtractStreamPress={extractSingleStream}
+ shortestFlag={shortestFlag}
+ setShortestFlag={setShortestFlag}
+ nonCopiedExtraStreams={nonCopiedExtraStreams}
+ customTagsByFile={customTagsByFile}
+ setCustomTagsByFile={setCustomTagsByFile}
+ paramsByStreamId={paramsByStreamId}
+ updateStreamParams={updateStreamParams}
+ formatTimecode={formatTimecode}
+ loadSubtitleTrackToSegments={loadSubtitleTrackToSegments}
+ toggleCopyStreamIds={toggleCopyStreamIds}
+ changeEnabledStreamsFilter={changeEnabledStreamsFilter}
+ toggleCopyAllStreamsForPath={toggleCopyAllStreamsForPath}
+ onStreamSourceFileDrop={handleStreamSourceFileDrop}
+ />
+ )}
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
+
+ <LastCommandsSheet
+ visible={lastCommandsVisible}
+ onTogglePress={toggleLastCommands}
+ ffmpegCommandLog={ffmpegCommandLog}
+ setFfmpegCommandLog={setFfmpegCommandLog}
+ />
+
+ <Dialog.Root open={settingsVisible} onOpenChange={toggleSettings}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '60em' }}>
+ <Dialog.Title>{t('Settings')}</Dialog.Title>
+ <Dialog.Description>{t('Hover mouse over buttons in the main interface to see which function they have')}</Dialog.Description>
+
+ <Settings
+ onTunerRequested={onTunerRequested}
+ onKeyboardShortcutsDialogRequested={toggleKeyboardShortcuts}
+ askForCleanupChoices={askForCleanupChoices}
+ toggleStoreProjectInWorkingDir={toggleStoreProjectInWorkingDir}
+ simpleMode={simpleMode}
+ clearOutDir={clearOutDir}
+ />
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
- <ConcatDialog isShown={batchFiles.length > 0 && concatDialogVisible} onHide={() => setConcatDialogVisible(false)} paths={batchFilePaths} onConcat={userConcatFiles} setAlwaysConcatMultipleFiles={setAlwaysConcatMultipleFiles} alwaysConcatMultipleFiles={alwaysConcatMultipleFiles} exportCount={exportCount} maxLabelLength={maxLabelLength} />
+ <ConcatDialog isShown={batchFiles.length > 0 && concatDialogVisible} onHide={() => setConcatDialogVisible(false)} paths={batchFilePaths} onConcat={userConcatFiles} setAlwaysConcatMultipleFiles={setAlwaysConcatMultipleFiles} alwaysConcatMultipleFiles={alwaysConcatMultipleFiles} exportCount={exportCount} maxLabelLength={maxLabelLength} />
- <KeyboardShortcuts isShown={keyboardShortcutsVisible} onHide={() => setKeyboardShortcutsVisible(false)} keyBindings={keyBindings} setKeyBindings={setKeyBindings} currentCutSeg={currentCutSeg} resetKeyBindings={resetKeyBindings} />
+ <KeyboardShortcuts isShown={keyboardShortcutsVisible} onHide={() => setKeyboardShortcutsVisible(false)} keyBindings={keyBindings} setKeyBindings={setKeyBindings} currentCutSeg={currentCutSeg} resetKeyBindings={resetKeyBindings} />
- {/* This should probably be last, so that it's always on top */}
- <AnimatePresence>
- {working && <Working text={working.text} progress={progress} onAbortClick={abortWorking} />}
- </AnimatePresence>
- </div>
- </ThemeProvider>
+ {/* This should probably be last, so that it's always on top */}
+ <AnimatePresence>
+ {working && <Working text={working.text} progress={progress} onAbortClick={abortWorking} />}
+ </AnimatePresence>
+ </div>
+
+ <SwalContainer darkMode={darkMode} style={baseColorStyle} />
</UserSettingsContext.Provider>
</SegColorsContext.Provider>
</AppContext.Provider>
-
- <div id="swal2-container-wrapper" className={darkMode ? 'dark-theme' : undefined} style={baseColorStyle} />
</MotionConfig>
);
}
diff --git a/src/renderer/src/BottomBar.tsx b/src/renderer/src/BottomBar.tsx
index b52c4eff..52de0553 100644
--- a/src/renderer/src/BottomBar.tsx
+++ b/src/renderer/src/BottomBar.tsx
@@ -3,7 +3,7 @@ import { motion } from 'framer-motion';
import { MdRotate90DegreesCcw } from 'react-icons/md';
import { useTranslation } from 'react-i18next';
import { IoIosCamera, IoMdKey, IoMdSpeedometer } from 'react-icons/io';
-import { FaYinYang, FaTrashAlt, FaStepBackward, FaStepForward, FaCaretLeft, FaCaretRight, FaPause, FaPlay, FaImages, FaKey, FaSun } from 'react-icons/fa';
+import { FaYinYang, FaTrashAlt, FaStepBackward, FaStepForward, FaCaretLeft, FaCaretRight, FaPause, FaPlay, FaImages, FaKey } from 'react-icons/fa';
import { GiSoundWaves } from 'react-icons/gi';
// import useTraceUpdate from 'use-trace-update';
import invariant from 'tiny-invariant';
@@ -228,7 +228,7 @@ function BottomBar({
jumpTimelineStart, jumpTimelineEnd, jumpCutEnd, jumpCutStart, startTimeOffset, setCutTime,
playing, shortStep, togglePlay, toggleLoopSelectedSegments, hasAudio,
keyframesEnabled, toggleShowKeyframes, seekClosestKeyframe, detectedFps, isFileOpened, selectedSegments,
- darkMode, toggleDarkMode,
+ darkMode,
toggleShowThumbnails, toggleWaveformMode, waveformMode, showThumbnails,
outputPlaybackRate, setOutputPlaybackRate,
formatTimecode, parseTimecode, playbackRate,
@@ -271,7 +271,6 @@ function BottomBar({
isFileOpened: boolean,
selectedSegments: SegmentColorIndex[],
darkMode: boolean,
- toggleDarkMode: () => void,
toggleShowThumbnails: () => void,
toggleWaveformMode: () => void,
waveformMode: WaveformMode | undefined,
@@ -286,8 +285,20 @@ function BottomBar({
const { t } = useTranslation();
const { getSegColor } = useSegColors();
+ const playStyle = useMemo<CSSProperties>(() => ({
+ paddingLeft: playing ? 0 : '.1em',
+ color: 'white',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: '2.3em',
+ height: '2.3em',
+ borderRadius: '50%',
+ boxSizing: 'border-box',
+ }), [playing]);
+
// ok this is a bit over-engineered but what the hell!
- const loopSelectedSegmentsButtonStyle = useMemo(() => {
+ const loopSelectedSegmentsButtonStyle = useMemo<CSSProperties>(() => {
// need at least 2 gradient elements:
const selectedSegmentsSafe = (
selectedSegments.length >= 2
@@ -305,20 +316,14 @@ function BottomBar({
}).join(', ');
return {
- paddingLeft: 2,
+ ...playStyle,
+ fontSize: '.7em',
+ margin: '.1em .2em 0 -.6em',
backgroundOffset: 30,
background: `linear-gradient(90deg, ${gradientColors})`,
- border: '1px solid var(--gray-8)',
- color: 'white',
- margin: '0px 5px 0 0px',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- width: 20,
- height: 24,
- borderRadius: 4,
+ border: '1px solid var(--gray-10)',
};
- }, [selectedSegments]);
+ }, [playStyle, selectedSegments]);
const keyframeStyle = useMemo(() => ({
color: currentFrame != null && currentFrame.keyframe ? primaryTextColor : undefined,
@@ -376,8 +381,6 @@ function BottomBar({
<div style={{ display: 'flex', alignItems: 'center', flexBasis: leftRightWidth }}>
{!simpleMode && (
<>
- <FaSun color="var(--gray-12)" role="button" onClick={toggleDarkMode} style={{ padding: '0 .2em 0 .3em' }} title={t('Toggle dark mode')} />
-
{hasAudio && (
<GiSoundWaves
size={24}
@@ -390,16 +393,14 @@ function BottomBar({
{hasVideo && (
<>
<FaImages
- size={20}
- style={{ padding: '0 .2em', color: showThumbnails ? primaryTextColor : undefined }}
+ style={{ fontSize: '1em', padding: '0 .2em', color: showThumbnails ? primaryTextColor : undefined }}
role="button"
title={t('Show thumbnails')}
onClick={toggleShowThumbnails}
/>
<FaKey
- size={16}
- style={{ padding: '0 .2em', color: keyframesEnabled ? primaryTextColor : undefined }}
+ style={{ fontSize: '.9em', padding: '0 .2em', color: keyframesEnabled ? primaryTextColor : undefined }}
role="button"
title={t('Show keyframes')}
onClick={toggleShowKeyframes}
@@ -450,11 +451,12 @@ function BottomBar({
/>
)}
- <div role="button" onClick={() => togglePlay()} style={{ background: primaryColor, margin: '2px 5px 0 5px', display: 'flex', alignItems: 'center', justifyContent: 'center', width: 34, height: 34, borderRadius: 17, color: 'white' }}>
- <PlayPause
- style={{ paddingLeft: playing ? 0 : 2 }}
- size={16}
- />
+ <div role="button" onClick={() => togglePlay()} style={{ ...playStyle, margin: '.1em .1em 0 .2em', background: primaryColor }}>
+ <PlayPause style={{ fontSize: '.9em' }} />
+ </div>
+
+ <div role="button" onClick={toggleLoopSelectedSegments} title={t('Play selected segments in order')} style={loopSelectedSegmentsButtonStyle}>
+ <PlayPause style={{ fontSize: '.9em' }} />
</div>
{!simpleMode && (
@@ -535,10 +537,9 @@ function BottomBar({
{hasVideo && (
<>
- <span style={{ textAlign: 'right', display: 'inline-block' }}>{isRotationSet && rotationStr}</span>
+ <span style={{ textAlign: 'right', display: 'inline-block', fontSize: '.8em', marginRight: '.3em' }}>{isRotationSet && rotationStr}</span>
<MdRotate90DegreesCcw
- size={24}
- style={{ margin: '0px 0px 0 2px', verticalAlign: 'middle', color: isRotationSet ? primaryTextColor : undefined }}
+ style={{ fontSize: '1.2em', verticalAlign: 'middle', color: isRotationSet ? primaryTextColor : undefined }}
title={`${t('Set output rotation. Current: ')} ${isRotationSet ? rotationStr : t('Don\'t modify')}`}
onClick={increaseRotation}
role="button"
@@ -549,8 +550,7 @@ function BottomBar({
{!simpleMode && isFileOpened && (
<FaTrashAlt
title={t('Close file and clean up')}
- style={{ padding: '5px 10px' }}
- size={16}
+ style={{ padding: '0 .7em', fontSize: '1em' }}
onClick={cleanupFilesDialog}
role="button"
/>
@@ -561,7 +561,7 @@ function BottomBar({
{!simpleMode && <CaptureFormatButton style={{ width: '3.7em', textAlign: 'center' }} />}
<IoIosCamera
- style={{ paddingLeft: 5, paddingRight: 15 }}
+ style={{ paddingLeft: '.1em', paddingRight: '.5em' }}
size={25}
title={t('Capture frame')}
onClick={captureSnapshot}
@@ -569,13 +569,7 @@ function BottomBar({
</>
)}
- <div role="button" onClick={toggleLoopSelectedSegments} title={t('Play selected segments in order')} style={loopSelectedSegmentsButtonStyle}>
- <FaPlay
- size={14}
- />
- </div>
-
- {(!simpleMode || !exportConfirmEnabled) && <ToggleExportConfirm style={{ marginRight: 5 }} />}
+ {(!simpleMode || !exportConfirmEnabled) && <ToggleExportConfirm style={{ marginRight: '.5em' }} />}
<ExportButton size={1.3} segmentsToExport={segmentsToExport} areWeCutting={areWeCutting} onClick={onExportPress} />
</div>
diff --git a/src/renderer/src/LastCommandsSheet.tsx b/src/renderer/src/LastCommandsSheet.tsx
index e7c8dfbf..934c41ef 100644
--- a/src/renderer/src/LastCommandsSheet.tsx
+++ b/src/renderer/src/LastCommandsSheet.tsx
@@ -4,9 +4,9 @@ import { DateTime } from 'luxon';
import sortBy from 'lodash/sortBy.js';
import CopyClipboardButton from './components/CopyClipboardButton';
-import Sheet from './components/Sheet';
import { FfmpegCommandLog } from './types';
import Button from './components/Button';
+import * as Dialog from './components/Dialog';
function LastCommandsSheet({ visible, onTogglePress, ffmpegCommandLog, setFfmpegCommandLog }: {
visible: boolean,
@@ -17,26 +17,32 @@ function LastCommandsSheet({ visible, onTogglePress, ffmpegCommandLog, setFfmpeg
const { t } = useTranslation();
return (
- <Sheet visible={visible} onClosePress={onTogglePress} style={{ padding: '0 1em' }} maxWidth={2000}>
- <h1>{t('Last ffmpeg commands')}</h1>
+ <Dialog.Root open={visible} onOpenChange={onTogglePress}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '200em' }}>
+ <Dialog.Title>{t('Last ffmpeg commands')}</Dialog.Title>
+ <Dialog.Description>{t('The last executed ffmpeg commands will show up here after you run operations. You can copy them to clipboard and modify them to your needs before running on your command line.')}</Dialog.Description>
- {ffmpegCommandLog.length > 0 ? (
- <div>
- <Button onClick={() => setFfmpegCommandLog([])} style={{ fontSize: '1em', marginBottom: '.5em' }}>{t('Clear')}</Button>
+ {ffmpegCommandLog.length > 0 && (
+ <div>
+ <Button onClick={() => setFfmpegCommandLog([])} style={{ fontSize: '1em', marginBottom: '.5em' }}>{t('Clear')}</Button>
- {sortBy(ffmpegCommandLog, (l) => -l.time).map(({ command, time }, i) => (
- // eslint-disable-next-line react/no-array-index-key
- <div key={i} style={{ whiteSpace: 'pre', margin: '5px 0', fontFamily: 'monospace' }}>
- <CopyClipboardButton text={command} style={{ marginRight: '.5em', verticalAlign: 'middle' }} />
- <span style={{ opacity: 0.5, marginRight: '.5em' }}>{DateTime.fromJSDate(time).toLocaleString(DateTime.TIME_WITH_SECONDS)}</span>
- {command}
+ {sortBy(ffmpegCommandLog, (l) => -l.time).map(({ command, time }, i) => (
+ // eslint-disable-next-line react/no-array-index-key
+ <div key={i} style={{ whiteSpace: 'pre', padding: '.3em 0', fontFamily: 'monospace', overflow: 'scroll' }}>
+ <CopyClipboardButton text={command} style={{ marginRight: '.5em', verticalAlign: 'middle' }} />
+ <span style={{ opacity: 0.5, marginRight: '.5em' }}>{DateTime.fromJSDate(time).toLocaleString(DateTime.TIME_WITH_SECONDS)}</span>
+ {command}
+ </div>
+ ))}
</div>
- ))}
- </div>
- ) : (
- <p>{t('The last executed ffmpeg commands will show up here after you run operations. You can copy them to clipboard and modify them to your needs before running on your command line.')}</p>
- )}
- </Sheet>
+ )}
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
);
}
diff --git a/src/renderer/src/MediaSourcePlayer.tsx b/src/renderer/src/MediaSourcePlayer.tsx
index 569b2515..2c505e26 100644
--- a/src/renderer/src/MediaSourcePlayer.tsx
+++ b/src/renderer/src/MediaSourcePlayer.tsx
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState, useCallback, useMemo, memo, CSSProperties, RefObject, ReactEventHandler, FocusEventHandler } from 'react';
-import { Spinner } from 'evergreen-ui';
import invariant from 'tiny-invariant';
import debounce from 'lodash/debounce.js';
+import { FaVideo } from 'react-icons/fa';
import isDev from './isDev';
import { ChromiumHTMLVideoElement } from './types';
@@ -403,7 +403,9 @@ function MediaSourcePlayer({ rotate, filePath, videoStream, audioStreams, master
<canvas style={{ ...videoStyle, display: showCanvas ? 'initial' : 'none' }} ref={canvasRef} />
{loading && (
- <div style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, display: 'flex', justifyContent: 'center', alignItems: 'center' }}><Spinner /></div>
+ <div style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
+ <FaVideo className="loading-animation" style={{ padding: '1em', background: 'rgba(0,0,0,0.2)', borderRadius: '50%' }} />
+ </div>
)}
</div>
);
diff --git a/src/renderer/src/SegmentList.tsx b/src/renderer/src/SegmentList.tsx
index 9b87efb8..293e8a00 100644
--- a/src/renderer/src/SegmentList.tsx
+++ b/src/renderer/src/SegmentList.tsx
@@ -9,7 +9,6 @@ import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
import { useVirtualizer } from '@tanstack/react-virtual';
import { CSS } from '@dnd-kit/utilities';
-import Dialog, { ConfirmButton } from './components/Dialog';
import Swal from './swal';
import useContextMenu from './hooks/useContextMenu';
import useUserSettings from './hooks/useUserSettings';
@@ -19,6 +18,7 @@ import { getSegmentTags } from './segments';
import TagEditor from './components/TagEditor';
import { ContextMenuTemplate, DefiniteSegmentBase, FormatTimecode, GetFrameCount, InverseCutSegment, SegmentBase, SegmentTags, StateSegment } from './types';
import { UseSegments } from './hooks/useSegments';
+import * as Dialog from './components/Dialog';
const buttonBaseStyle = {
@@ -156,7 +156,7 @@ const Segment = memo(({
function renderNumber() {
if (invertCutSegments || !('segColorIndex' in seg)) {
- return <FaSave style={{ color: saveColor, marginRight: 5, verticalAlign: 'middle' }} size={14} />;
+ return <FaSave style={{ color: saveColor, marginRight: '.2em', verticalAlign: 'middle' }} size={14} />;
}
const segColor = getSegColor(seg);
@@ -165,7 +165,7 @@ const Segment = memo(({
const borderColor = darkMode ? color.lighten(0.5) : color.darken(0.3);
return (
- <b style={{ color: 'white', padding: '0 4px', marginRight: 3, marginLeft: -3, background: color.string(), border: `1px solid ${isActive ? borderColor.string() : 'transparent'}`, borderRadius: 10, fontSize: 12 }}>
+ <b style={{ color: 'white', padding: '0 .3em', marginRight: '.3em', marginLeft: '-.23em', background: color.string(), border: `.05em solid ${isActive ? borderColor.string() : 'transparent'}`, borderRadius: '.35em', fontSize: '.7em' }}>
{index + 1}
</b>
);
@@ -212,7 +212,7 @@ const Segment = memo(({
position: 'relative',
transform: CSS.Transform.toString(sortable.transform),
transition: transitions.length > 0 ? transitions.join(', ') : undefined,
- background: 'var(--gray-2)',
+ background: 'var(--gray-1)',
border: `1px solid ${isActive ? 'var(--gray-10)' : 'transparent'}`,
borderRadius: 5,
opacity: !selected && !invertCutSegments ? 0.5 : undefined,
@@ -496,6 +496,7 @@ function SegmentList({
const rowVirtualizer = useVirtualizer({
count: sortableList.length,
+ gap: 7,
getScrollElement: () => scrollerRef.current,
estimateSize: () => 66, // todo this probably needs to be changed if the segment height changes
overscan: 5,
@@ -570,15 +571,23 @@ function SegmentList({
return (
<>
- {editingSegmentTagsSegmentIndex != null && (
- <Dialog autoOpen onClose={onSegmentTagsCloseComplete} style={{ width: '100%', maxWidth: '40em' }}>
- <h1 style={{ marginTop: 0 }}>{t('Edit segment tags')}</h1>
+ <Dialog.Root open={editingSegmentTagsSegmentIndex != null} onOpenChange={onSegmentTagsCloseComplete}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '40em' }} aria-describedby={undefined}>
+ <Dialog.Title>{t('Edit segment tags')}</Dialog.Title>
- <TagEditor customTags={editingSegmentTags} editingTag={editingTag} setEditingTag={setEditingTag} onTagsChange={onTagsChange} onTagReset={onTagReset} addTagTitle={t('Add segment tag')} />
+ <TagEditor customTags={editingSegmentTags} editingTag={editingTag} setEditingTag={setEditingTag} onTagsChange={onTagsChange} onTagReset={onTagReset} addTagTitle={t('Add segment tag')} />
- <ConfirmButton onClick={onSegmentTagsConfirm} disabled={editingTag != null}><FaSave style={{ verticalAlign: 'baseline', fontSize: '.8em', marginRight: '.3em' }} />{t('Save')}</ConfirmButton>
- </Dialog>
- )}
+ <Dialog.ConfirmButton onClick={onSegmentTagsConfirm} disabled={editingTag != null}>
+ <FaSave style={{ verticalAlign: 'baseline', fontSize: '.8em', marginRight: '.3em' }} />
+ {t('Save')}
+ </Dialog.ConfirmButton>
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
<motion.div
style={{ width, background: controlsBackground, borderLeft: '1px solid var(--gray-7)', color: 'var(--gray-11)', transition: darkModeTransition, display: 'flex', flexDirection: 'column', overflow: 'hidden' }}
@@ -587,11 +596,11 @@ function SegmentList({
exit={{ x: width }}
transition={springAnimation}
>
- <div style={{ fontSize: 14, padding: '0 5px', color: 'var(--gray-12)' }} className="no-user-select">
+ <div style={{ fontSize: '.8em', padding: '.3em .5em', color: 'var(--gray-12)' }} className="no-user-select">
<FaAngleRight
title={t('Close sidebar')}
size={20}
- style={{ verticalAlign: 'middle', color: 'var(--gray-11)', cursor: 'pointer', padding: 2 }}
+ style={{ verticalAlign: 'middle', color: 'var(--gray-11)', cursor: 'pointer', padding: '.1em' }}
role="button"
onClick={toggleSegmentsList}
/>
@@ -601,7 +610,7 @@ function SegmentList({
<DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd} onDragStart={handleDragStart} modifiers={[restrictToVerticalAxis]}>
<SortableContext items={sortableList} strategy={verticalListSortingStrategy}>
- <div ref={scrollerRef} style={{ padding: '0 .1em 0 .3em', overflowX: 'hidden', overflowY: 'scroll', flexGrow: 1 }} className="consistent-scrollbar">
+ <div ref={scrollerRef} style={{ padding: '0 .2em 0 .5em', overflowX: 'hidden', overflowY: 'scroll', flexGrow: 1 }} className="consistent-scrollbar">
<div style={{ height: rowVirtualizer.getTotalSize(), position: 'relative', overflowX: 'hidden' }}>
{rowVirtualizer.getVirtualItems().map((virtualRow) => {
const { id, seg } = sortableList[virtualRow.index]!;
diff --git a/src/renderer/src/StreamsSelector.module.css b/src/renderer/src/StreamsSelector.module.css
index b37e4901..3b4dfe91 100644
--- a/src/renderer/src/StreamsSelector.module.css
+++ b/src/renderer/src/StreamsSelector.module.css
@@ -8,6 +8,7 @@
}
th, td {
+ vertical-align: top;
padding-left: .2em;
padding-right: .2em;
}
diff --git a/src/renderer/src/StreamsSelector.tsx b/src/renderer/src/StreamsSelector.tsx
index 85abc107..99763120 100644
--- a/src/renderer/src/StreamsSelector.tsx
+++ b/src/renderer/src/StreamsSelector.tsx
@@ -1,27 +1,26 @@
import { memo, useState, useMemo, useCallback, Dispatch, SetStateAction, CSSProperties, ReactNode, ChangeEventHandler, DragEventHandler } from 'react';
-import { FaImage, FaPaperclip, FaVideo, FaVideoSlash, FaFileImport, FaVolumeUp, FaVolumeMute, FaBan, FaFileExport } from 'react-icons/fa';
+import { FaImage, FaPaperclip, FaVideo, FaVideoSlash, FaFileImport, FaVolumeUp, FaVolumeMute, FaBan, FaFileExport, FaBook, FaInfoCircle, FaFilter, FaEye, FaEdit, FaTrash, FaSortNumericDown, FaSortNumericUp, FaHamburger, FaMap } from 'react-icons/fa';
import { GoFileBinary } from 'react-icons/go';
import { MdSubtitles } from 'react-icons/md';
-import { BookIcon, MoreIcon, Position, Popover, Menu, TrashIcon, EditIcon, InfoSignIcon, IconButton, SortAscIcon, SortDescIcon, ForkIcon, EyeOpenIcon, FilterIcon } from 'evergreen-ui';
-import { useTranslation } from 'react-i18next';
+import { useTranslation, Trans } from 'react-i18next';
import prettyBytes from 'pretty-bytes';
-import Dialog from './components/Dialog';
+import * as DropdownMenu from './components/DropdownMenu';
+import * as Dialog from './components/Dialog';
import AutoExportToggler from './components/AutoExportToggler';
import Select from './components/Select';
-import { showJson5Dialog } from './dialogs';
import { FileStream, getStreamFps } from './ffmpeg';
import { deleteDispositionValue } from './util';
import { getActiveDisposition, attachedPicDisposition, isGpsStream } from './util/streams';
import TagEditor from './components/TagEditor';
import { FFprobeChapter, FFprobeFormat, FFprobeStream } from '../../../ffprobe';
import { CustomTagsByFile, FilesMeta, FormatTimecode, ParamsByStreamId, StreamParams } from './types';
-import useUserSettings from './hooks/useUserSettings';
-import tryShowGpsMap from './gps';
import Button from './components/Button';
import Checkbox from './components/Checkbox';
import styles from './StreamsSelector.module.css';
+import Json5Dialog from './components/Json5Dialog';
+import GpsMap from './components/GpsMap';
const dispositionOptions = ['default', 'dub', 'original', 'comment', 'lyrics', 'karaoke', 'forced', 'hearing_impaired', 'visual_impaired', 'clean_effects', 'attached_pic', 'captions', 'descriptions', 'dependent', 'metadata'];
@@ -143,23 +142,28 @@ const EditStreamDialog = memo(({ editingStream: { streamId: editingStreamId, pat
});
}, [editingFile, editingStreamId, updateStreamParams]);
- if (!editingStream) return null;
-
return (
- <Dialog autoOpen onClose={() => setEditingStream(undefined)} style={{ width: '100%', maxWidth: '40em' }}>
- <h1 style={{ marginTop: 0 }}>{t('Edit track {{trackNum}} metadata', { trackNum: editingStream && (editingStream.index + 1) })}</h1>
-
- <h2>Parameters</h2>
- {editingStream != null && <StreamParametersEditor stream={editingStream} streamParams={streamParams} updateStreamParams={(setter) => updateStreamParams(editingFile, editingStreamId, setter)} />}
-
- <h2>Tags</h2>
- <TagEditor existingTags={existingTags} customTags={customTags} editingTag={editingTag} setEditingTag={setEditingTag} onTagsChange={onTagsChange} onTagReset={onTagReset} addTagTitle={t('Add metadata')} />
- </Dialog>
+ <Dialog.Root open={editingStream != null} onOpenChange={(v) => v === false && setEditingStream(undefined)}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '40em' }} aria-describedby={undefined}>
+ <Dialog.Title>{t('Edit track {{trackNum}} metadata', { trackNum: editingStream && (editingStream.index + 1) })}</Dialog.Title>
+
+ <h2>Parameters</h2>
+ {editingStream != null && <StreamParametersEditor stream={editingStream} streamParams={streamParams} updateStreamParams={(setter) => updateStreamParams(editingFile, editingStreamId, setter)} />}
+
+ <h2>Tags</h2>
+ <TagEditor existingTags={existingTags} customTags={customTags} editingTag={editingTag} setEditingTag={setEditingTag} onTagsChange={onTagsChange} onTagReset={onTagReset} addTagTitle={t('Add metadata')} />
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
);
});
// eslint-disable-next-line react/display-name
-const Stream = memo(({ filePath, stream, onToggle, toggleCopyStreamIds, copyStream, fileDuration, setEditingStream, onExtractStreamPress, paramsByStreamId, updateStreamParams, formatTimecode, loadSubtitleTrackToSegments, onInfoClick }: {
+const Stream = memo(({ filePath, stream, onToggle, toggleCopyStreamIds, copyStream, fileDuration, setEditingStream, onExtractStreamPress, paramsByStreamId, updateStreamParams, formatTimecode, loadSubtitleTrackToSegments }: {
filePath: string,
stream: FileStream,
onToggle: (a: number) => void,
@@ -171,7 +175,6 @@ const Stream = memo(({ filePath, stream, onToggle, toggleCopyStreamIds, copyStre
updateStreamParams: UpdateStreamParams,
formatTimecode: FormatTimecode,
loadSubtitleTrackToSegments?: (index: number) => void,
- onInfoClick: (json: unknown, title: string) => void,
}) => {
const { t } = useTranslation();
@@ -230,22 +233,20 @@ const Stream = memo(({ filePath, stream, onToggle, toggleCopyStreamIds, copyStre
loadSubtitleTrackToSegments?.(stream.index);
}, [loadSubtitleTrackToSegments, stream.index]);
- const onLoadGpsTrackClick = useCallback(async () => {
- await tryShowGpsMap(filePath, stream.index);
- }, [filePath, stream.index]);
-
const codecTag = stream.codec_tag !== '0x0000' && stream.codec_tag_string;
return (
<tr style={{ opacity: copyStream ? undefined : 0.4 }}>
- <td style={{ whiteSpace: 'nowrap', display: 'flex', alignItems: 'center' }}>
- <IconButton iconSize={20} color={copyStream ? '#52BD95' : '#D14343'} title={`${t('Click to toggle track inclusion when exporting')} (type ${codecTypeHuman})`} appearance="minimal" icon={Icon} onClick={onClick} />
- <div style={{ width: 20, textAlign: 'center' }}>{stream.index + 1}</div>
+ <td style={{ whiteSpace: 'nowrap' }}>
+ <Button style={{ marginRight: '.5em', color: copyStream ? '#52BD95' : '#D14343' }} title={`${t('Click to toggle track inclusion when exporting')} (type ${codecTypeHuman})`} onClick={onClick}>
+ <Icon style={{ verticalAlign: 'middle', fontSize: '1.5em', padding: '.1em' }} />
+ </Button>
+ <span style={{ verticalAlign: 'middle', width: '.15em', textAlign: 'center' }}>{stream.index + 1}</span>
</td>
<td style={{ maxWidth: '3em', overflow: 'hidden' }} title={stream.codec_name}>{stream.codec_name} {codecTag}</td>
<td>
{duration != null && !Number.isNaN(duration) && `${formatTimecode({ seconds: duration, shorten: true })}`}
- {stream.nb_frames != null ? <div>{stream.nb_frames}f</div> : null}
+ {stream.nb_frames != null ? <span> {stream.nb_frames}f</span> : null}
</td>
<td>{!Number.isNaN(bitrate) && (stream.codec_type === 'audio' ? `${Math.round(bitrate / 1000)} kbps` : prettyBytes(bitrate, { bits: true }))}</td>
<td style={{ maxWidth: '2.5em', wordBreak: 'break-word' }} title={title}>{title}</td>
@@ -261,53 +262,82 @@ const Stream = memo(({ filePath, stream, onToggle, toggleCopyStreamIds, copyStre
<option key={key} value={key}>{key}</option>
))}
</Select>
-
</td>
- <td style={{ display: 'flex', justifyContent: 'flex-end' }}>
- <IconButton icon={InfoSignIcon} title={t('Track {{num}} info', { num: stream.index + 1 })} onClick={() => onInfoClick(stream, t('Track {{num}} info', { num: stream.index + 1 }))} appearance="minimal" iconSize={18} />
-
- <Popover
- position={Position.BOTTOM_LEFT}
- content={(
- <Menu>
- <Menu.Group>
- <Menu.Item icon={EditIcon} onClick={() => setEditingStream({ streamId: stream.index, path: filePath })}>
- {t('Edit track metadata')}
- </Menu.Item>
- {onExtractStreamPress && (
- <Menu.Item icon={<FaFileExport color="black" />} onClick={onExtractStreamPress}>
- {t('Extract this track as file')}
- </Menu.Item>
- )}
- {stream.codec_type === 'subtitle' && (
- <Menu.Item icon={<MdSubtitles color="black" />} onClick={onLoadSubtitleTrackToSegmentsClick}>
- {t('Create segments from subtitles')}
- </Menu.Item>
- )}
- {isGpsStream(stream) && (
- <Menu.Item icon={<MdSubtitles color="black" />} onClick={onLoadGpsTrackClick}>
- {t('Show GPS map')}
- </Menu.Item>
- )}
- </Menu.Group>
- <Menu.Divider />
- <Menu.Group>
- <Menu.Item icon={<EyeOpenIcon color="black" />} intent="success" onClick={() => toggleCopyStreamIds((s) => s.codec_type === stream.codec_type)}>
- {t('Toggle {{type}} tracks', { type: codecTypeHuman })}
- </Menu.Item>
- </Menu.Group>
- </Menu>
- )}
- >
- <IconButton icon={MoreIcon} appearance="minimal" />
- </Popover>
+ <td style={{ textAlign: 'right', fontSize: '1.1em' }}>
+ <Json5Dialog title={t('Track {{num}} info', { num: stream.index + 1 })} json={stream}>
+ <Button title={t('Track {{num}} info', { num: stream.index + 1 })}>
+ <FaInfoCircle style={{ verticalAlign: 'middle', padding: '.4em' }} />
+ </Button>
+ </Json5Dialog>
+
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger asChild>
+ <Button><FaHamburger style={{ verticalAlign: 'middle', padding: '.4em' }} /></Button>
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.Content sideOffset={5}>
+ <DropdownMenu.Item onClick={() => setEditingStream({ streamId: stream.index, path: filePath })}>
+ <FaEdit style={{ marginRight: '.3em' }} />
+ {t('Edit track metadata')}
+ </DropdownMenu.Item>
+
+ {onExtractStreamPress && (
+ <DropdownMenu.Item onClick={onExtractStreamPress}>
+ <FaFileExport style={{ marginRight: '.3em' }} />
+ {t('Extract this track as file')}
+ </DropdownMenu.Item>
+ )}
+
+ {stream.codec_type === 'subtitle' && (
+ <DropdownMenu.Item onClick={onLoadSubtitleTrackToSegmentsClick}>
+ <MdSubtitles style={{ marginRight: '.3em' }} />
+ {t('Create segments from subtitles')}
+ </DropdownMenu.Item>
+ )}
+
+ {isGpsStream(stream) && (
+ <Dialog.Root>
+ <Dialog.Trigger asChild>
+ {/* https://github.com/radix-ui/primitives/issues/1836#issuecomment-1674338372 */}
+ <DropdownMenu.Item onSelect={(e) => e.preventDefault()}>
+ <FaMap style={{ marginRight: '.3em' }} />
+ {t('Show GPS map')}
+ </DropdownMenu.Item>
+ </Dialog.Trigger>
+
+ <Dialog.Portal>
+ <Dialog.Overlay />
+
+ <Dialog.Content aria-describedby={undefined}>
+ <Dialog.Title>
+ <Trans>GPS track</Trans>
+ </Dialog.Title>
+
+ <GpsMap filePath={filePath} streamIndex={stream.index} />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
+ )}
+
+ <DropdownMenu.Separator />
+
+ <DropdownMenu.Item onClick={() => toggleCopyStreamIds((s) => s.codec_type === stream.codec_type)}>
+ <FaEye style={{ marginRight: '.3em' }} />
+ {t('Toggle {{type}} tracks', { type: codecTypeHuman })}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Arrow />
+ </DropdownMenu.Content>
+ </DropdownMenu.Portal>
+ </DropdownMenu.Root>
</td>
</tr>
);
});
-function FileHeading({ path, formatData, chapters, onTrashClick, onEditClick, toggleCopyAllStreams, onExtractAllStreamsPress, onInfoClick, changeEnabledStreamsFilter }: {
+function FileHeading({ path, formatData, chapters, onTrashClick, onEditClick, toggleCopyAllStreams, onExtractAllStreamsPress, changeEnabledStreamsFilter }: {
path: string,
formatData: FFprobeFormat | undefined,
chapters?: FFprobeChapter[] | undefined,
@@ -315,7 +345,6 @@ function FileHeading({ path, formatData, chapters, onTrashClick, onEditClick, to
onEditClick?: (() => void) | undefined,
toggleCopyAllStreams: () => void,
onExtractAllStreamsPress?: () => Promise<void>,
- onInfoClick: (json: unknown, title: string) => void,
changeEnabledStreamsFilter?: (() => void) | undefined,
}) {
const { t } = useTranslation();
@@ -326,14 +355,22 @@ function FileHeading({ path, formatData, chapters, onTrashClick, onEditClick, to
<div style={{ flexGrow: 1 }} />
- {chapters && chapters.length > 0 && <IconButton icon={BookIcon} onClick={() => onInfoClick(chapters, t('Chapters'))} appearance="minimal" iconSize={18} />}
- <IconButton iconSize={18} icon={EyeOpenIcon} title={t('Toggle all tracks')} onClick={() => toggleCopyAllStreams()} appearance="minimal" />
- {changeEnabledStreamsFilter && <IconButton icon={FilterIcon} title={t('Filter tracks')} onClick={changeEnabledStreamsFilter} appearance="minimal" iconSize={18} />}
- <IconButton icon={InfoSignIcon} title={t('File info')} onClick={() => onInfoClick(formatData, t('File info'))} appearance="minimal" iconSize={18} />
- {onEditClick && <IconButton icon={EditIcon} title={t('Edit file metadata')} onClick={onEditClick} appearance="minimal" iconSize={18} />}
- {onExtractAllStreamsPress && <IconButton iconSize={16} title={t('Export each track as individual files')} icon={ForkIcon} onClick={onExtractAllStreamsPress} appearance="minimal" />}
-
- {onTrashClick && <IconButton icon={TrashIcon} onClick={onTrashClick} appearance="minimal" intent="danger" iconSize={18} />}
+ <div style={{ fontSize: '1.3em', marginBottom: '.2em' }}>
+ {chapters && chapters.length > 0 && (
+ <Json5Dialog title={t('Chapters')} json={chapters}>
+ <Button title={t('Chapters')}><FaBook style={{ verticalAlign: 'middle' }} /></Button>
+ </Json5Dialog>
+ )}
+ <Json5Dialog title={t('File info')} json={formatData}>
+ <Button title={t('File info')}><FaInfoCircle style={{ verticalAlign: 'middle' }} /></Button>
+ </Json5Dialog>
+ {onEditClick && <Button title={t('Edit file metadata')} onClick={onEditClick}><FaEdit style={{ verticalAlign: 'middle' }} /></Button>}
+ <Button title={t('Toggle all tracks')} onClick={() => toggleCopyAllStreams()}><FaEye style={{ verticalAlign: 'middle' }} /></Button>
+ {changeEnabledStreamsFilter && <Button title={t('Filter tracks')} onClick={changeEnabledStreamsFilter}><FaFilter style={{ verticalAlign: 'middle' }} /></Button>}
+ {onExtractAllStreamsPress && <Button title={t('Export each track as individual files')} onClick={onExtractAllStreamsPress}><FaFileExport style={{ verticalAlign: 'middle' }} /></Button>}
+
+ {onTrashClick && <Button onClick={onTrashClick}><FaTrash style={{ verticalAlign: 'middle' }} /></Button>}
+ </div>
</div>
);
}
@@ -357,7 +394,7 @@ function Thead() {
);
}
-const fileStyle: CSSProperties = { margin: '1.5em 1em 1.5em 1em', padding: 5, overflowX: 'auto' };
+const fileStyle: CSSProperties = { marginBottom: '2em', padding: '.5em 0', overflowX: 'auto' };
function StreamsSelector({
@@ -394,7 +431,6 @@ function StreamsSelector({
const [editingStream, setEditingStream] = useState<EditingStream>();
const [editingTag, setEditingTag] = useState<string>();
const { t } = useTranslation();
- const { darkMode } = useUserSettings();
function getFormatDuration(formatData: FFprobeFormat | undefined) {
if (!formatData || !formatData.duration) return undefined;
@@ -414,17 +450,11 @@ function StreamsSelector({
const externalFilesEntries = Object.entries(externalFilesMeta);
- const onInfoClick = useCallback((json: unknown, title: string) => {
- showJson5Dialog({ title, json, darkMode });
- }, [darkMode]);
-
return (
<>
- <p style={{ margin: '.5em 2em .5em 1em' }}>{t('Click to select which tracks to keep when exporting:')}</p>
-
<div style={fileStyle} onDrop={onStreamSourceFileDrop}>
{/* We only support editing main file metadata for now */}
- <FileHeading onInfoClick={onInfoClick} path={mainFilePath} formatData={mainFileFormatData} chapters={mainFileChapters} onEditClick={() => setEditingFile(mainFilePath)} toggleCopyAllStreams={() => toggleCopyAllStreamsForPath(mainFilePath)} onExtractAllStreamsPress={onExtractAllStreamsPress} changeEnabledStreamsFilter={changeEnabledStreamsFilter} />
+ <FileHeading path={mainFilePath} formatData={mainFileFormatData} chapters={mainFileChapters} onEditClick={() => setEditingFile(mainFilePath)} toggleCopyAllStreams={() => toggleCopyAllStreamsForPath(mainFilePath)} onExtractAllStreamsPress={onExtractAllStreamsPress} changeEnabledStreamsFilter={changeEnabledStreamsFilter} />
<table className={styles['table']}>
<Thead />
@@ -444,7 +474,6 @@ function StreamsSelector({
updateStreamParams={updateStreamParams}
formatTimecode={formatTimecode}
loadSubtitleTrackToSegments={loadSubtitleTrackToSegments}
- onInfoClick={onInfoClick}
/>
))}
</tbody>
@@ -453,7 +482,7 @@ function StreamsSelector({
{externalFilesEntries.map(([path, { streams: externalFileStreams, formatData }]) => (
<div key={path} style={fileStyle}>
- <FileHeading path={path} formatData={formatData} onTrashClick={() => removeFile(path)} toggleCopyAllStreams={() => toggleCopyAllStreamsForPath(path)} onInfoClick={onInfoClick} />
+ <FileHeading path={path} formatData={formatData} onTrashClick={() => removeFile(path)} toggleCopyAllStreams={() => toggleCopyAllStreamsForPath(path)} />
<table className={styles['table']}>
<Thead />
@@ -471,7 +500,6 @@ function StreamsSelector({
paramsByStreamId={paramsByStreamId}
updateStreamParams={updateStreamParams}
formatTimecode={formatTimecode}
- onInfoClick={onInfoClick}
/>
))}
</tbody>
@@ -479,7 +507,7 @@ function StreamsSelector({
</div>
))}
- <div style={{ margin: '1em 1em' }}>
+ <div style={{ margin: '1em 0' }}>
<Button style={{ marginBottom: '1em', padding: '0.3em 1em' }} onClick={showAddStreamSourceDialog}>
<FaFileImport style={{ verticalAlign: 'middle', marginRight: '.5em' }} /> {t('Include more tracks from other file')}
</Button>
@@ -495,18 +523,25 @@ function StreamsSelector({
<div style={{ marginBottom: '1em' }}>
<div style={{ marginBottom: '.5em' }}>{t('When tracks have different lengths, do you want to make the output file as long as the longest or the shortest track?')}</div>
<Button style={{ padding: '0.3em 1em' }} onClick={() => setShortestFlag((value) => !value)}>
- {shortestFlag ? <><SortDescIcon verticalAlign="middle" marginRight=".5em" />{t('Shortest')}</> : <><SortAscIcon verticalAlign="middle" marginRight=".5em" />{t('Longest')}</>}
+ {shortestFlag ? <><FaSortNumericDown style={{ verticalAlign: 'middle', marginRight: '.5em' }} />{t('Shortest')}</> : <><FaSortNumericUp style={{ verticalAlign: 'middle', marginRight: '.5em' }} />{t('Longest')}</>}
</Button>
</div>
)}
</div>
{editingFile != null && (
- <Dialog autoOpen onClose={() => setEditingFile(undefined)} style={{ width: '100%', maxWidth: '40em' }}>
- <h1 style={{ marginTop: 0 }}>{t('Edit file metadata')}</h1>
-
- <EditFileDialog editingFile={editingFile} editingTag={editingTag} setEditingTag={setEditingTag} allFilesMeta={allFilesMeta} customTagsByFile={customTagsByFile} setCustomTagsByFile={setCustomTagsByFile} />
- </Dialog>
+ <Dialog.Root defaultOpen onOpenChange={(v) => v === false && setEditingFile(undefined)}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '40em' }} aria-describedby={undefined}>
+ <Dialog.Title>{t('Edit file metadata')}</Dialog.Title>
+
+ <EditFileDialog editingFile={editingFile} editingTag={editingTag} setEditingTag={setEditingTag} allFilesMeta={allFilesMeta} customTagsByFile={customTagsByFile} setCustomTagsByFile={setCustomTagsByFile} />
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
)}
{editingStream != null && (
diff --git a/src/renderer/src/Timeline.tsx b/src/renderer/src/Timeline.tsx
index 3902df99..b9ace7ec 100644
--- a/src/renderer/src/Timeline.tsx
+++ b/src/renderer/src/Timeline.tsx
@@ -423,7 +423,7 @@ function Timeline({
})}
{shouldShowKeyframes && !areKeyframesTooClose && keyFramesInZoomWindow.map((f) => (
- <div key={f.time} style={{ position: 'absolute', top: 0, bottom: 0, left: `${(f.time / fileDurationNonZero) * 100}%`, marginLeft: -1, width: 1, background: 'var(--gray-11)', pointerEvents: 'none' }} />
+ <div key={f.time} style={{ position: 'absolute', top: 0, bottom: 0, left: `${(f.time / fileDurationNonZero) * 100}%`, marginLeft: -1, width: 1, background: 'var(--gray-10)', pointerEvents: 'none' }} />
))}
{currentTimePercent !== undefined && (
diff --git a/src/renderer/src/TopMenu.module.css b/src/renderer/src/TopMenu.module.css
new file mode 100644
index 00000000..ae8a5e63
--- /dev/null
+++ b/src/renderer/src/TopMenu.module.css
@@ -0,0 +1,11 @@
+.wrapper button, .wrapper select {
+ background-color: var(--gray-1);
+}
+
+.wrapper button {
+ padding: .3em .3em;
+}
+
+.wrapper select {
+ padding: .3em 1.4em .3em .3em;
+}
\ No newline at end of file
diff --git a/src/renderer/src/TopMenu.tsx b/src/renderer/src/TopMenu.tsx
index 9b41a52f..f01a9b9e 100644
--- a/src/renderer/src/TopMenu.tsx
+++ b/src/renderer/src/TopMenu.tsx
@@ -1,7 +1,6 @@
import { CSSProperties, ReactNode, memo, useCallback, useEffect, useRef } from 'react';
import { IoIosSettings } from 'react-icons/io';
-import { FaFilter, FaLock, FaUnlock } from 'react-icons/fa';
-import { CrossIcon, FilterIcon, ListIcon } from 'evergreen-ui';
+import { FaFilter, FaList, FaLock, FaMoon, FaSun, FaTimes, FaUnlock } from 'react-icons/fa';
import { useTranslation } from 'react-i18next';
import Button from './components/Button';
@@ -10,12 +9,13 @@ import ExportModeButton from './components/ExportModeButton';
import { withBlur } from './util';
import { primaryTextColor, controlsBackground, darkModeTransition } from './colors';
import useUserSettings from './hooks/useUserSettings';
+import styles from './TopMenu.module.css';
const { stat } = window.require('fs/promises');
const { webUtils } = window.require('electron');
-const outFmtStyle = { height: 20, maxWidth: 100 };
+const outFmtStyle = { maxWidth: 100 };
const exportModeStyle = { flexGrow: 0, flexBasis: 140 };
function TopMenu({
@@ -32,6 +32,7 @@ function TopMenu({
selectedSegments,
isCustomFormatSelected,
clearOutDir,
+ toggleDarkMode,
}: {
filePath: string | undefined,
fileFormat: string | undefined,
@@ -46,18 +47,25 @@ function TopMenu({
selectedSegments: unknown[],
isCustomFormatSelected: boolean,
clearOutDir: () => void,
+ toggleDarkMode: () => void,
}) {
const { t } = useTranslation();
- const { customOutDir, changeOutDir, setCustomOutDir, simpleMode, outFormatLocked, setOutFormatLocked } = useUserSettings();
+ const { customOutDir, changeOutDir, setCustomOutDir, simpleMode, outFormatLocked, setOutFormatLocked, darkMode } = useUserSettings();
const workingDirButtonRef = useRef<HTMLButtonElement>(null);
+ const DarkMode = darkMode ? FaSun : FaMoon;
+
const onOutFormatLockedClick = useCallback(() => setOutFormatLocked((v) => (v ? undefined : fileFormat)), [fileFormat, setOutFormatLocked]);
const showClearWorkingDirButton = !!customOutDir;
function renderFormatLock() {
const Icon = outFormatLocked ? FaLock : FaUnlock;
- return <Icon onClick={onOutFormatLockedClick} title={t('Lock/unlock output format')} size={14} style={{ marginRight: 7, marginLeft: 2, color: outFormatLocked ? primaryTextColor : undefined }} />;
+ return (
+ <Button style={{ marginRight: '.7em' }}>
+ <Icon onClick={onOutFormatLockedClick} title={t('Lock/unlock output format')} style={{ fontSize: '.8em', color: outFormatLocked ? primaryTextColor : undefined }} />
+ </Button>
+ );
}
// Convenience for drag and drop: https://github.com/mifi/lossless-cut/issues/2147
@@ -78,30 +86,31 @@ function TopMenu({
return (
<div
- className="no-user-select"
- style={{ background: controlsBackground, transition: darkModeTransition, display: 'flex', alignItems: 'center', padding: '3px 5px', justifyContent: 'space-between', flexWrap: 'wrap' }}
+ className={`no-user-select ${styles['wrapper']}`}
+ style={{ background: controlsBackground, transition: darkModeTransition, display: 'flex', alignItems: 'center', padding: '.3em .3em', gap: '.3em', justifyContent: 'space-between', flexWrap: 'wrap' }}
>
{filePath && (
<>
<Button onClick={withBlur(() => setStreamsSelectorShown(true))}>
- <ListIcon size={'1em' as unknown as number} verticalAlign="middle" marginRight=".3em" />
+ <FaList style={{ fontSize: '.7em', marginRight: '.5em' }} />
{t('Tracks')} ({numStreamsToCopy}/{numStreamsTotal})
</Button>
{enabledStreamsFilter != null && (
- <FilterIcon
- role="button"
- tabIndex={0}
- style={{ width: 20 }}
+ <Button
onClick={withBlur(() => applyEnabledStreamsFilter())}
title={t('Toggle tracks using current filter')}
- />
+ >
+ <FaFilter
+ style={{ fontSize: '.8em', verticalAlign: 'middle' }}
+ />
+ </Button>
)}
<Button
onClick={changeEnabledStreamsFilter}
>
- <FaFilter style={{ fontSize: '.7em', marginRight: '.4em' }} />
+ {enabledStreamsFilter == null && <FaFilter style={{ fontSize: '.7em', marginRight: '.4em' }} />}
{t('Filter tracks')}
</Button>
</>
@@ -110,20 +119,21 @@ function TopMenu({
<div style={{ flexGrow: 1 }} />
{showClearWorkingDirButton && (
- <CrossIcon
- role="button"
- tabIndex={0}
- style={{ width: 20 }}
+ <Button
onClick={withBlur(clearOutDir)}
title={t('Clear working directory')}
- />
+ >
+ <FaTimes
+ style={{ fontSize: '.9em', verticalAlign: 'middle' }}
+ />
+ </Button>
)}
<Button
ref={workingDirButtonRef}
onClick={withBlur(changeOutDir)}
title={customOutDir}
- style={{ paddingLeft: showClearWorkingDirButton ? 4 : undefined }}
+ style={{ paddingLeft: showClearWorkingDirButton ? '.4em' : undefined }}
>
{customOutDir ? t('Working dir set') : t('Working dir unset')}
</Button>
@@ -138,7 +148,15 @@ function TopMenu({
</>
)}
- <IoIosSettings size={24} role="button" onClick={toggleSettings} style={{ marginLeft: 5 }} />
+ {!simpleMode && (
+ <Button onClick={toggleDarkMode} title={t('Toggle dark mode')}>
+ <DarkMode style={{ verticalAlign: 'middle', fontSize: '.9em' }} />
+ </Button>
+ )}
+
+ <Button onClick={toggleSettings}>
+ <IoIosSettings style={{ fontSize: '1em', verticalAlign: 'bottom' }} />
+ </Button>
</div>
);
}
diff --git a/src/renderer/src/components/Action.tsx b/src/renderer/src/components/Action.tsx
index 6c1e61c1..77f38c9a 100644
--- a/src/renderer/src/components/Action.tsx
+++ b/src/renderer/src/components/Action.tsx
@@ -1,12 +1,11 @@
-import { TakeActionIcon } from 'evergreen-ui';
-
+import { FaBolt } from 'react-icons/fa';
import { KeyboardAction } from '../../../../types';
export default function Action({ name }: { name: KeyboardAction }) {
return (
<span style={{ whiteSpace: 'nowrap' }}>
- <TakeActionIcon verticalAlign="middle" style={{ marginRight: '.2em' }} />
+ <FaBolt style={{ verticalAlign: 'middle', marginRight: '.2em' }} />
<span style={{ textDecoration: 'underline', textDecorationStyle: 'dotted', textUnderlineOffset: '.2em', cursor: 'alias' }}>{name}</span>
</span>
);
diff --git a/src/renderer/src/components/AutoExportToggler.tsx b/src/renderer/src/components/AutoExportToggler.tsx
index ee4d9879..c00e4b9e 100644
--- a/src/renderer/src/components/AutoExportToggler.tsx
+++ b/src/renderer/src/components/AutoExportToggler.tsx
@@ -1,6 +1,6 @@
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import { ForkIcon, DisableIcon } from 'evergreen-ui';
+import { FaBan, FaFileExport } from 'react-icons/fa';
import useUserSettings from '../hooks/useUserSettings';
import Button from './Button';
@@ -9,11 +9,11 @@ function AutoExportToggler() {
const { t } = useTranslation();
const { autoExportExtraStreams, setAutoExportExtraStreams } = useUserSettings();
- const Icon = autoExportExtraStreams ? ForkIcon : DisableIcon;
+ const Icon = autoExportExtraStreams ? FaFileExport : FaBan;
return (
<Button style={{ padding: '0.3em 1em' }} onClick={() => setAutoExportExtraStreams(!autoExportExtraStreams)}>
- <Icon verticalAlign="middle" marginRight=".5em" />{autoExportExtraStreams ? t('Extract') : t('Discard')}
+ <Icon style={{ verticalAlign: 'middle', marginRight: '.5em' }} />{autoExportExtraStreams ? t('Extract') : t('Discard')}
</Button>
);
}
diff --git a/src/renderer/src/components/BatchFilesList.tsx b/src/renderer/src/components/BatchFilesList.tsx
index 77ec3e76..9f7c93fa 100644
--- a/src/renderer/src/components/BatchFilesList.tsx
+++ b/src/renderer/src/components/BatchFilesList.tsx
@@ -1,9 +1,8 @@
import { DragEventHandler, memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { motion } from 'framer-motion';
-import { FaTimes, FaHatWizard } from 'react-icons/fa';
+import { FaTimes, FaHatWizard, FaSortAlphaDown, FaSortAlphaUp } from 'react-icons/fa';
import { AiOutlineMergeCells } from 'react-icons/ai';
-import { SortAlphabeticalIcon, SortAlphabeticalDescIcon } from 'evergreen-ui';
import { DndContext, closestCenter, PointerSensor, useSensor, useSensors, DragEndEvent, DragStartEvent, DragOverlay, UniqueIdentifier } from '@dnd-kit/core';
import { SortableContext, verticalListSortingStrategy, arrayMove } from '@dnd-kit/sortable';
import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
@@ -54,7 +53,7 @@ function BatchFilesList({ selectedBatchFiles, filePath, width, batchFiles, setBa
setSortDesc(newSortDesc);
}, [batchFiles, setBatchFiles, sortDesc]);
- const SortIcon = sortDesc ? SortAlphabeticalDescIcon : SortAlphabeticalIcon;
+ const SortIcon = sortDesc ? FaSortAlphaDown : FaSortAlphaUp;
const sensors = useSensors(useSensor(PointerSensor, {
activationConstraint: {
@@ -90,13 +89,13 @@ function BatchFilesList({ selectedBatchFiles, filePath, width, batchFiles, setBa
transition={springAnimation}
onDrop={onDrop}
>
- <div style={{ fontSize: 14, paddingBottom: 3, paddingTop: 0, paddingLeft: 10, display: 'flex', alignItems: 'center', justifyContent: 'flex-end', flexWrap: 'wrap' }}>
- <div>{t('Batch file list')}{batchFiles.length > 0 && ` (${batchFiles.length})`}</div>
+ <div style={{ paddingBottom: '.5em', paddingTop: 0, paddingLeft: '.5em', display: 'flex', alignItems: 'center', justifyContent: 'flex-end', flexWrap: 'wrap', gap: '.2em' }}>
+ <div style={{ fontSize: '.9em' }}>{t('Batch file list')}{batchFiles.length > 0 && ` (${batchFiles.length})`}</div>
<div style={{ flexGrow: 1 }} />
- <FaHatWizard size={17} role="button" title={`${t('Convert to supported format')}...`} style={iconStyle} onClick={onBatchConvertToSupportedFormatClick} />
- <SortIcon size={25} role="button" title={t('Sort items')} style={iconStyle} onClick={onSortClick} />
- <AiOutlineMergeCells size={20} role="button" title={`${t('Merge/concatenate files')}...`} style={{ ...iconStyle, color: 'white', background: primaryColor, borderRadius: '.5em' }} onClick={onMergeFilesClick} />
- <FaTimes size={20} role="button" title={t('Close batch')} style={{ ...iconStyle, color: 'var(--gray-11)' }} onClick={closeBatch} />
+ <FaHatWizard role="button" title={`${t('Convert to supported format')}...`} style={iconStyle} onClick={onBatchConvertToSupportedFormatClick} />
+ <SortIcon role="button" title={t('Sort items')} style={iconStyle} onClick={onSortClick} />
+ <AiOutlineMergeCells className="export-animation" role="button" title={`${t('Merge/concatenate files')}...`} style={{ ...iconStyle, color: 'white', background: primaryColor, borderRadius: '.5em' }} onClick={onMergeFilesClick} />
+ <FaTimes role="button" title={t('Close batch')} style={{ ...iconStyle, color: 'var(--gray-11)' }} onClick={closeBatch} />
</div>
<DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd} onDragStart={handleDragStart} modifiers={[restrictToVerticalAxis]}>
diff --git a/src/renderer/src/components/BigWaveform.tsx b/src/renderer/src/components/BigWaveform.tsx
index 57f4ed5b..5ec49d4b 100644
--- a/src/renderer/src/components/BigWaveform.tsx
+++ b/src/renderer/src/components/BigWaveform.tsx
@@ -1,8 +1,8 @@
import { memo, useEffect, useState, useCallback, useRef, CSSProperties, MouseEventHandler, WheelEventHandler, useMemo } from 'react';
-import { Spinner } from 'evergreen-ui';
import { ffmpegExtractWindow } from '../util/constants';
import { WaveformSlice } from '../types';
+import Spinner from './Spinner';
function BigWaveform({ waveforms, relevantTime, playing, fileDurationNonZero, zoom, seekRel, darkMode }: {
diff --git a/src/renderer/src/components/Button.module.css b/src/renderer/src/components/Button.module.css
index 1f53da33..ade0415a 100644
--- a/src/renderer/src/components/Button.module.css
+++ b/src/renderer/src/components/Button.module.css
@@ -1,12 +1,13 @@
.button {
appearance: none;
font: inherit;
- line-height: 140%;
+ line-height: 1.2;
font-size: .8em;
background-color: var(--gray-3);
color: var(--gray-12);
border-radius: .3em;
- padding: 0 .5em 0 .3em;
+ padding: 0 .5em;
+ outline: .05em solid var(--gray-8);
border: .05em solid var(--gray-7);
cursor: pointer;
outline-offset: 0;
@@ -22,5 +23,5 @@
}
.button:hover {
- filter: brightness(1.1);
+ filter: brightness(1.2);
}
diff --git a/src/renderer/src/components/Checkbox.module.css b/src/renderer/src/components/Checkbox.module.css
index 9816b1b8..09bbd4e4 100644
--- a/src/renderer/src/components/Checkbox.module.css
+++ b/src/renderer/src/components/Checkbox.module.css
@@ -4,9 +4,10 @@
.CheckboxRoot {
flex-shrink: 0;
- background-color: var(--gray-8);
+ background-color: var(--gray-1);
width: 1em;
height: 1em;
+ border: .1em solid var(--gray-8);
border-radius: .2em;
display: flex;
align-items: center;
@@ -14,7 +15,7 @@
box-shadow: 0 2px 10px var(--gray-1);
}
.CheckboxRoot:hover {
- background-color: var(--gray-9);
+ background-color: var(--gray-3);
}
.CheckboxRoot:focus {
box-shadow: 0 0 0 2px var(--gray-1);
@@ -31,4 +32,4 @@
.Label {
padding-left: .5em;
line-height: 1.2;
-}
\ No newline at end of file
+}
diff --git a/src/renderer/src/components/ConcatDialog.tsx b/src/renderer/src/components/ConcatDialog.tsx
index f42e5f91..f2651f69 100644
--- a/src/renderer/src/components/ConcatDialog.tsx
+++ b/src/renderer/src/components/ConcatDialog.tsx
@@ -1,12 +1,11 @@
import { memo, useState, useCallback, useEffect, useMemo, CSSProperties } from 'react';
import { useTranslation } from 'react-i18next';
-import { IconButton } from 'evergreen-ui';
import { AiOutlineMergeCells } from 'react-icons/ai';
import { FaQuestionCircle, FaExclamationTriangle, FaCog } from 'react-icons/fa';
import i18n from 'i18next';
import invariant from 'tiny-invariant';
-import Checkbox from './Checkbox';
+import Checkbox from './Checkbox';
import { ReactSwal } from '../swal';
import { readFileMeta, getDefaultOutFormat, mapRecommendedDefaultFormat } from '../ffmpeg';
import useFileFormatState from '../hooks/useFileFormatState';
@@ -18,9 +17,9 @@ import { FFprobeChapter, FFprobeFormat, FFprobeStream } from '../../../../ffprob
import TextInput from './TextInput';
import Button from './Button';
import { defaultMergedFileTemplate, generateMergedFileNames, maxFileNameLength } from '../util/outputNameTemplate';
-import Dialog from './Dialog';
import { primaryColor } from '../colors';
import ExportDialog from './ExportDialog';
+import * as Dialog from './Dialog';
const { basename } = window.require('path');
@@ -222,7 +221,7 @@ function ConcatDialog({ isShown, onHide, paths, onConcat, alwaysConcatMultipleFi
<span style={{ opacity: 0.7, marginRight: '.4em' }}>{`${index + 1}.`}</span>
<span>{basename(path)}</span>
{!allFilesMetaCache[path] && <FaQuestionCircle style={{ color: 'var(--orange-8)', verticalAlign: 'middle', marginLeft: '1em' }} />}
- {problemsByFile[path] && <IconButton appearance="minimal" icon={FaExclamationTriangle} onClick={() => onProblemsByFileClick(path)} title={i18n.t('Mismatches detected')} style={{ color: 'var(--orange-8)', marginLeft: '1em' }} />}
+ {problemsByFile[path] && <Button onClick={() => onProblemsByFileClick(path)} title={i18n.t('Mismatches detected')} style={{ color: 'var(--orange-8)', marginLeft: '1em' }}><FaExclamationTriangle /></Button>}
</div>
</div>
))}
@@ -254,25 +253,30 @@ function ConcatDialog({ isShown, onHide, paths, onConcat, alwaysConcatMultipleFi
)}
</div>
- {settingsVisible && (
- <Dialog autoOpen onClose={() => setSettingsVisible(false)} style={{ maxWidth: '40em' }}>
- <h1 style={{ marginTop: 0 }}>{t('Merge options')}</h1>
+ <Dialog.Root open={settingsVisible} onOpenChange={setSettingsVisible}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '40em' }} aria-describedby={undefined}>
+ <Dialog.Title>{t('Merge options')}</Dialog.Title>
- <Checkbox checked={includeAllStreams} onCheckedChange={(checked) => setIncludeAllStreams(checked === true)} label={`${t('Include all tracks?')} - ${t('If this is checked, all audio/video/subtitle/data tracks will be included. This may not always work for all file types. If not checked, only default streams will be included.')}`} />
+ <Checkbox checked={includeAllStreams} onCheckedChange={(checked) => setIncludeAllStreams(checked === true)} label={`${t('Include all tracks?')} - ${t('If this is checked, all audio/video/subtitle/data tracks will be included. This may not always work for all file types. If not checked, only default streams will be included.')}`} />
- <Checkbox checked={preserveMetadataOnMerge} onCheckedChange={(checked) => setPreserveMetadataOnMerge(checked === true)} label={t('Preserve original metadata when merging? (slow)')} />
+ <Checkbox checked={preserveMetadataOnMerge} onCheckedChange={(checked) => setPreserveMetadataOnMerge(checked === true)} label={t('Preserve original metadata when merging? (slow)')} />
- {fileFormat != null && isMov(fileFormat) && <Checkbox checked={preserveMovData} onCheckedChange={(checked) => setPreserveMovData(checked === true)} label={t('Preserve all MP4/MOV metadata?')} />}
+ {fileFormat != null && isMov(fileFormat) && <Checkbox checked={preserveMovData} onCheckedChange={(checked) => setPreserveMovData(checked === true)} label={t('Preserve all MP4/MOV metadata?')} />}
- <Checkbox checked={segmentsToChapters} onCheckedChange={(checked) => setSegmentsToChapters(checked === true)} label={t('Create chapters from merged segments? (slow)')} />
+ <Checkbox checked={segmentsToChapters} onCheckedChange={(checked) => setSegmentsToChapters(checked === true)} label={t('Create chapters from merged segments? (slow)')} />
- <Checkbox checked={alwaysConcatMultipleFiles} onCheckedChange={(checked) => setAlwaysConcatMultipleFiles(checked === true)} label={t('Always open this dialog when opening multiple files')} />
+ <Checkbox checked={alwaysConcatMultipleFiles} onCheckedChange={(checked) => setAlwaysConcatMultipleFiles(checked === true)} label={t('Always open this dialog when opening multiple files')} />
- <Checkbox checked={clearBatchFilesAfterConcat} onCheckedChange={(checked) => setClearBatchFilesAfterConcat(checked === true)} label={t('Clear batch file list after merge')} />
+ <Checkbox checked={clearBatchFilesAfterConcat} onCheckedChange={(checked) => setClearBatchFilesAfterConcat(checked === true)} label={t('Clear batch file list after merge')} />
- <p>{t('Note that also other settings from the normal export dialog apply to this merge function. For more information about all options, see the export dialog.')}</p>
- </Dialog>
- )}
+ <p>{t('Note that also other settings from the normal export dialog apply to this merge function. For more information about all options, see the export dialog.')}</p>
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
</ExportDialog>
);
}
diff --git a/src/renderer/src/components/CopyClipboardButton.tsx b/src/renderer/src/components/CopyClipboardButton.tsx
index 4d35c10b..8c7164a2 100644
--- a/src/renderer/src/components/CopyClipboardButton.tsx
+++ b/src/renderer/src/components/CopyClipboardButton.tsx
@@ -16,8 +16,8 @@ function CopyClipboardButton({ text, style, children = ({ onClick }) => <FaClipb
const onClick = useCallback(() => {
clipboard.writeText(text);
animation.start({
- scale: [1, 2, 1],
- transition: { duration: 0.3 },
+ scale: [1, 1.5, 1],
+ transition: { duration: 0.2 },
});
}, [animation, text]);
diff --git a/src/renderer/src/components/Dialog.module.css b/src/renderer/src/components/Dialog.module.css
index 78f710a3..e7ff696b 100644
--- a/src/renderer/src/components/Dialog.module.css
+++ b/src/renderer/src/components/Dialog.module.css
@@ -1,56 +1,113 @@
-.dialog {
- --duration: 0.2s;
+.DialogOverlay {
+ background-color: var(--black-a9);
+ position: fixed;
+ inset: 0;
- box-sizing: border-box;
- border: .1em solid var(--black-a5);
- background: var(--white-a8);
+ &[data-state="open"] {
+ animation: overlayShow 500ms cubic-bezier(0.16, 1, 0.3, 1);
+ }
+
+ &[data-state="closed"] {
+ animation: overlayHide 500ms cubic-bezier(0.16, 1, 0.3, 1);
+ }
+}
+
+:global(.dark-theme) .DialogOverlay {
+ background-color: var(--black-a8);
+}
+
+.DialogContent {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ box-sizing: border-box;
+
+ overflow: scroll;
+
+ max-width: 90vw;
+ max-height: 85vh;
+
+ border: .1em solid var(--black-a2);
+ background: var(--white-a11);
color: var(--gray-12);
backdrop-filter: blur(2em);
border-radius: .5em;
padding: 1.7em;
box-shadow: 0 0 1em .3em var(--black-a1);
- transform-origin: center;
- transition:
- translate var(--duration) ease-out,
- scale var(--duration) ease-out,
- opacity var(--duration) ease-out,
- display var(--duration) ease-out allow-discrete;
-
- &[open] {
- /* Post-Entry (Normal) State */
- scale: 1;
- opacity: 1;
-
- /* Pre-Entry State */
- @starting-style {
- scale: 0.6;
- opacity: 0;
- }
- }
-
- &::backdrop {
- background-color: var(--black-a7);
- animation: overlayShow 600ms cubic-bezier(0.16, 1, 0.3, 1);
- }
-
- h1 {
- text-transform: uppercase;
- font-size: 1.3em;
- margin-top: 0;
- }
-}
-
-:global(.dark-theme) .dialog {
+
+ &[data-state="open"] {
+ animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
+ }
+
+ &[data-state="closed"] {
+ animation: contentHide 150ms cubic-bezier(0.16, 1, 0.3, 1);
+ }
+}
+
+:global(.dark-theme) .DialogContent {
border: .1em solid var(--white-a3);
background: var(--black-a4);
box-shadow: 0 0 1em .3em var(--black-a2);
}
+.DialogContent:focus {
+ outline: none;
+}
+
+.DialogTitle {
+ margin-top: 0;
+ margin-bottom: .5em;
+ font-weight: 500;
+ font-size: 1.3em;
+ padding-bottom: .3em;
+ border-bottom: .1em solid var(--black-a3);
+}
+
+:global(.dark-theme) .DialogTitle {
+ border-bottom: .1em solid var(--white-a4);
+}
+
+.DialogDescription {
+ margin-bottom: 1em;
+}
+
@keyframes overlayShow {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
-}
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+@keyframes overlayHide {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+
+@keyframes contentShow {
+ from {
+ opacity: 0;
+ transform: translate(-50%, -48%) scale(0.96);
+ }
+ to {
+ opacity: 1;
+ transform: translate(-50%, -50%) scale(1);
+ }
+}
+
+@keyframes contentHide {
+ from {
+ opacity: 1;
+ transform: translate(-50%, -50%) scale(1);
+ }
+ to {
+ opacity: 0;
+ transform: translate(-50%, -48%) scale(0.96);
+ }
+}
\ No newline at end of file
diff --git a/src/renderer/src/components/Dialog.tsx b/src/renderer/src/components/Dialog.tsx
index cc55598e..c2823c73 100644
--- a/src/renderer/src/components/Dialog.tsx
+++ b/src/renderer/src/components/Dialog.tsx
@@ -1,62 +1,32 @@
-import { DetailedHTMLProps, DialogHTMLAttributes, useCallback, useEffect, forwardRef, useRef } from 'react';
-import invariant from 'tiny-invariant';
+import * as Dialog from '@radix-ui/react-dialog';
-import styles from './Dialog.module.css';
import Button, { ButtonProps } from './Button';
-import CloseButton from './CloseButton';
-
-
-type Props = Omit<DetailedHTMLProps<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, 'open'> & {
- autoOpen?: boolean | undefined,
-};
-
-// eslint-disable-next-line react/display-name
-const Dialog = forwardRef<HTMLDialogElement, Props>(({ children, autoOpen, onClose, onClick, ...props }, refArg) => {
- const localRef = useRef<HTMLDialogElement>(null);
- const ref = refArg ?? localRef;
-
- useEffect(() => {
- invariant('current' in ref);
- // eslint-disable-next-line react/destructuring-assignment
- if (autoOpen) {
- ref.current?.showModal();
- }
- return undefined;
- }, [autoOpen, ref]);
-
- const handleClose = useCallback((e: React.MouseEvent<HTMLDialogElement>) => {
- invariant('current' in ref);
- onClose?.(e);
- }, [onClose, ref]);
-
- const handleClick = useCallback((e: React.MouseEvent<HTMLDialogElement>) => {
- if (!(ref != null && 'current' in ref && ref.current != null)) return;
- const dialogDimensions = ref.current.getBoundingClientRect();
- if (e.clientX < dialogDimensions.left
- || e.clientX > dialogDimensions.right
- || e.clientY < dialogDimensions.top
- || e.clientY > dialogDimensions.bottom) {
- ref.current?.close();
- }
- onClick?.(e);
- }, [onClick, ref]);
-
- return (
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, react/jsx-props-no-spreading
- <dialog {...props} className={styles['dialog']} ref={ref} onClose={handleClose} onClick={handleClick}>
- {children}
-
- <form method="dialog">
- <CloseButton type="submit" style={{ top: 0, right: 0 }} />
- </form>
- </dialog>
- );
-});
+
+import styles from './Dialog.module.css';
+import { withClass } from './util';
+import CloseButtonRaw from './CloseButton';
+
+export * from '@radix-ui/react-dialog';
+
+
+export const Overlay = withClass(Dialog.Overlay, styles['DialogOverlay']!);
+
+export const Content = withClass(Dialog.Content, styles['DialogContent']!);
+
+export const Description = withClass(Dialog.Description, styles['DialogDescription']!);
+
+export const Title = withClass(Dialog.Title, styles['DialogTitle']!);
+
+// eslint-disable-next-line react/jsx-props-no-spreading
+export const Portal = (props: Dialog.DialogPortalProps) => <Dialog.Portal container={document.getElementById('app-root')!} {...props} />;
export const ConfirmButton = ({ style, ...props }: ButtonProps) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<Button style={{ fontSize: '1.2em', ...style }} {...props} />
);
-
-export default Dialog;
+export const CloseButton = () => (
+ <Dialog.Close asChild>
+ <CloseButtonRaw style={{ top: 0, right: 0 }} />
+ </Dialog.Close>
+);
diff --git a/src/renderer/src/components/DropdownMenu.module.css b/src/renderer/src/components/DropdownMenu.module.css
new file mode 100644
index 00000000..285ee4e5
--- /dev/null
+++ b/src/renderer/src/components/DropdownMenu.module.css
@@ -0,0 +1,97 @@
+.DropdownMenuContent {
+ font-size: .9em;
+ color: var(--gray-12);
+ min-width: 10em;
+ border: .1em solid var(--gray-3);
+ background-color: var(--gray-1);
+ border-radius: .3em;
+ padding: .2em;
+ box-shadow:
+ 0px 1em 3.8em -1em rgba(22, 23, 24, 0.35),
+ 0px 1em 2em -1.5em rgba(22, 23, 24, 0.2);
+ animation-duration: 400ms;
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
+ will-change: transform, opacity;
+}
+.DropdownMenuContent[data-side="top"] {
+ animation-name: slideDownAndFade;
+}
+.DropdownMenuContent[data-side="right"] {
+ animation-name: slideLeftAndFade;
+}
+.DropdownMenuContent[data-side="bottom"] {
+ animation-name: slideUpAndFade;
+}
+.DropdownMenuContent[data-side="left"] {
+ animation-name: slideRightAndFade;
+}
+
+.DropdownMenuItem {
+ line-height: 1.2;
+ display: flex;
+ align-items: center;
+ padding: .5em .8em;
+ border-radius: .3em;
+ position: relative;
+ user-select: none;
+ outline: none;
+}
+.DropdownMenuItem[data-disabled],
+.DropdownMenuItem[data-highlighted] {
+ background-color: var(--gray-3);
+ cursor: pointer;
+}
+
+.DropdownMenuSeparator {
+ height: .1em;
+ background-color: var(--gray-3);
+ margin: .1em .5em;
+}
+
+.DropdownMenuArrow {
+ fill: var(--gray-3);
+}
+
+@keyframes slideUpAndFade {
+ from {
+ opacity: 0;
+ transform: translateY(2px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+@keyframes slideRightAndFade {
+ from {
+ opacity: 0;
+ transform: translateX(-.2em);
+ }
+ to {
+ opacity: 1;
+ transform: translateX(0);
+ }
+}
+
+@keyframes slideDownAndFade {
+ from {
+ opacity: 0;
+ transform: translateY(.2em);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+@keyframes slideLeftAndFade {
+ from {
+ opacity: 0;
+ transform: translateX(.2em);
+ }
+ to {
+ opacity: 1;
+ transform: translateX(0);
+ }
+}
\ No newline at end of file
diff --git a/src/renderer/src/components/DropdownMenu.tsx b/src/renderer/src/components/DropdownMenu.tsx
new file mode 100644
index 00000000..0308420c
--- /dev/null
+++ b/src/renderer/src/components/DropdownMenu.tsx
@@ -0,0 +1,17 @@
+import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
+
+import styles from './DropdownMenu.module.css';
+import { withClass } from './util';
+
+export * from '@radix-ui/react-dropdown-menu';
+
+export const Content = withClass(DropdownMenu.Content, styles['DropdownMenuContent']!);
+
+export const Item = withClass(DropdownMenu.Item, styles['DropdownMenuItem']!);
+
+export const Arrow = withClass(DropdownMenu.Arrow, styles['DropdownMenuArrow']!);
+
+export const Separator = withClass(DropdownMenu.Separator, styles['DropdownMenuSeparator']!);
+
+// eslint-disable-next-line react/jsx-props-no-spreading
+export const Portal = (props: DropdownMenu.DropdownMenuPortalProps) => <DropdownMenu.Portal container={document.getElementById('app-root')!} {...props} />;
diff --git a/src/renderer/src/components/ExportConfirm.module.css b/src/renderer/src/components/ExportConfirm.module.css
index b4c771d4..4068f47f 100644
--- a/src/renderer/src/components/ExportConfirm.module.css
+++ b/src/renderer/src/components/ExportConfirm.module.css
@@ -11,6 +11,10 @@ table.options td:last-child {
width: 1.7em;
}
+table.options td {
+ padding: .5em 0em;
+}
+
table.options td {
vertical-align: top;
}
diff --git a/src/renderer/src/components/ExportConfirm.tsx b/src/renderer/src/components/ExportConfirm.tsx
index 395ef679..17529d2c 100644
--- a/src/renderer/src/components/ExportConfirm.tsx
+++ b/src/renderer/src/components/ExportConfirm.tsx
@@ -40,7 +40,9 @@ const rightIconStyle: CSSProperties = { fontSize: '1.2em', verticalAlign: 'middl
const adjustCutFromValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const adjustCutToValues = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-const HelpIcon = ({ onClick, style }: { onClick: () => void, style?: CSSProperties }) => <IoIosHelpCircle size={20} role="button" onClick={withBlur(onClick)} style={{ cursor: 'pointer', color: primaryTextColor, verticalAlign: 'middle', ...style }} />;
+const HelpIcon = ({ onClick, style }: { onClick: () => void, style?: CSSProperties }) => (
+ <IoIosHelpCircle role="button" onClick={withBlur(onClick)} style={{ cursor: 'pointer', color: primaryTextColor, verticalAlign: 'middle', fontSize: '1.5em', ...style }} />
+);
function ShiftTimes({ values, num, setNum }: { values: number[], num: number, setNum: (n: number) => void }) {
const { t } = useTranslation();
@@ -330,7 +332,7 @@ function ExportConfirm({
{renderNotice(notices.specific['exportMode'])}
</td>
<td>
- <ExportModeButton selectedSegments={segmentsOrInverse.selected} />
+ <ExportModeButton selectedSegments={segmentsOrInverse.selected} style={{ height: '1.8em' }} />
</td>
<td>
{renderNoticeIcon(notices.specific['exportMode'], rightIconStyle) ?? <HelpIcon onClick={onExportModeHelpPress} />}
@@ -342,7 +344,7 @@ function ExportConfirm({
{t('Output container format:')}
</td>
<td>
- {renderOutFmt({ height: 20, maxWidth: 150 })}
+ {renderOutFmt({ height: '1.8em', maxWidth: 150 })}
</td>
<td>
<HelpIcon onClick={onOutFmtHelpPress} />
@@ -413,6 +415,13 @@ function ExportConfirm({
<table className={styles['options']}>
<tbody>
+ <tr>
+ <td style={{ paddingTop: '.5em', color: 'var(--gray-11)', fontSize: '.9em' }} colSpan={2}>
+ {t('Depending on your specific file/player, you may have to try different options for best results.')}
+ </td>
+ <td />
+ </tr>
+
{areWeCutting && (
<>
<tr>
@@ -524,13 +533,6 @@ function ExportConfirm({
</>
)}
- <tr>
- <td style={{ paddingTop: '.5em', color: 'var(--gray-11)', fontSize: '.9em' }} colSpan={2}>
- {t('Depending on your specific file/player, you may have to try different options for best results.')}
- </td>
- <td />
- </tr>
-
{areWeCutting && (
<>
<tr>
diff --git a/src/renderer/src/components/ExportDialog.module.css b/src/renderer/src/components/ExportDialog.module.css
index fd49fd05..4367c298 100644
--- a/src/renderer/src/components/ExportDialog.module.css
+++ b/src/renderer/src/components/ExportDialog.module.css
@@ -4,7 +4,7 @@
right: 0;
top: 0;
bottom: 0;
- background: var(--white-a11);
+ background: var(--white-a9);
color: var(--gray-12);
backdrop-filter: blur(30px);
overflow-y: scroll;
@@ -14,7 +14,7 @@
}
:global(.dark-theme) .sheet {
- background: var(--black-a11);
+ background: var(--black-a9);
}
.box {
diff --git a/src/renderer/src/components/ExportDialog.tsx b/src/renderer/src/components/ExportDialog.tsx
index b0a839e2..fbea8806 100644
--- a/src/renderer/src/components/ExportDialog.tsx
+++ b/src/renderer/src/components/ExportDialog.tsx
@@ -15,7 +15,7 @@ function ExportDialog({
} : {
visible: boolean,
renderBottom?: (() => ReactNode | null) | undefined,
- renderButton?: (() => ReactNode | null) | undefined,
+ renderButton: (() => ReactNode | null),
children: ReactNode,
onClosePress: () => void,
title: string,
@@ -43,15 +43,17 @@ function ExportDialog({
</motion.div>
<div style={{ position: 'fixed', right: 0, bottom: 0, display: 'flex', alignItems: 'center', margin: 5 }}>
- <motion.div
- initial={{ opacity: 0, translateX: 50 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: 50 }}
- transition={{ duration: 0.4, easings: ['easeOut'] }}
- style={{ display: 'flex', alignItems: 'flex-end', background: 'var(--gray-2)', borderRadius: '.5em', padding: '.3em' }}
- >
- {renderBottom?.()}
- </motion.div>
+ {renderBottom != null && (
+ <motion.div
+ initial={{ opacity: 0, translateX: 50 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: 50 }}
+ transition={{ duration: 0.4, easings: ['easeOut'] }}
+ style={{ display: 'flex', alignItems: 'flex-end', background: 'var(--gray-2)', borderRadius: '.5em', padding: '.3em' }}
+ >
+ {renderBottom?.()}
+ </motion.div>
+ )}
<motion.div
style={{ transformOrigin: 'bottom right' }}
@@ -60,7 +62,7 @@ function ExportDialog({
exit={{ scale: 0.7, opacity: 0 }}
transition={{ duration: 0.4, easings: ['easeOut'] }}
>
- {renderButton?.()}
+ {renderButton()}
</motion.div>
</div>
</>
diff --git a/src/renderer/src/components/ExportModeButton.tsx b/src/renderer/src/components/ExportModeButton.tsx
index 23b4ec86..63576d4b 100644
--- a/src/renderer/src/components/ExportModeButton.tsx
+++ b/src/renderer/src/components/ExportModeButton.tsx
@@ -52,7 +52,7 @@ function ExportModeButton({ selectedSegments, style }: { selectedSegments: unkno
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<Select
- style={{ height: 20, ...style }}
+ style={style}
value={effectiveExportMode}
onChange={withBlur((e) => onChange(e.target.value as ExportMode))}
>
diff --git a/src/renderer/src/components/FileNameTemplateEditor.tsx b/src/renderer/src/components/FileNameTemplateEditor.tsx
index 22c6807b..2e5f34d0 100644
--- a/src/renderer/src/components/FileNameTemplateEditor.tsx
+++ b/src/renderer/src/components/FileNameTemplateEditor.tsx
@@ -2,10 +2,9 @@ import { memo, useState, useEffect, useCallback, useRef, useMemo, ChangeEventHan
import { useDebounce } from 'use-debounce';
import i18n from 'i18next';
import { useTranslation } from 'react-i18next';
-import { WarningSignIcon, ErrorIcon, Button, IconButton, TickIcon, ResetIcon } from 'evergreen-ui';
import { IoIosHelpCircle } from 'react-icons/io';
import { motion, AnimatePresence } from 'framer-motion';
-import { FaEdit } from 'react-icons/fa';
+import { FaCheck, FaEdit, FaExclamationTriangle, FaUndo } from 'react-icons/fa';
import { ReactSwal } from '../swal';
import HighlightedText from './HighlightedText';
@@ -14,6 +13,7 @@ import useUserSettings from '../hooks/useUserSettings';
import Switch from './Switch';
import Select from './Select';
import TextInput from './TextInput';
+import Button from './Button';
const electron = window.require('electron');
@@ -179,10 +179,14 @@ function FileNameTemplateEditor(opts: {
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '.2em' }}>
<TextInput ref={inputRef} onChange={onTextChange} value={text} autoComplete="off" autoCapitalize="off" autoCorrect="off" />
- {!mergeMode && fileNames != null && <Button height={20} onClick={onAllFilesPreviewPress} marginLeft={5}>{t('Preview')}</Button>}
+ {!mergeMode && fileNames != null && (
+ <Button onClick={onAllFilesPreviewPress} style={{ marginLeft: '.3em' }}>{t('Preview')}</Button>
+ )}
- <IconButton title={t('Reset')} icon={ResetIcon} height={20} onClick={reset} marginLeft={5} intent="danger" />
- {!haveImportantMessage && <IconButton title={t('Close')} icon={TickIcon} height={20} onClick={onHideClick} marginLeft={5} intent="success" appearance="primary" />}
+ <Button title={t('Reset')} onClick={reset} style={{ marginLeft: '.3em' }}><FaUndo style={{ fontSize: '.8em', color: 'var(--red-11)' }} /></Button>
+ {!haveImportantMessage && (
+ <Button title={t('Close')} onClick={onHideClick} style={{ marginLeft: '.3em' }}><FaCheck style={{ fontSize: '.8em' }} /></Button>
+ )}
</div>
<div style={{ fontSize: '.8em', color: 'var(--gray-11)', display: 'flex', gap: '.3em', flexWrap: 'wrap', alignItems: 'center', marginBottom: '.7em' }}>
@@ -207,28 +211,28 @@ function FileNameTemplateEditor(opts: {
<Switch checked={safeOutputFileName} onCheckedChange={toggleSafeOutputFileName} style={{ verticalAlign: 'middle', marginRight: '.5em' }} />
<span>{t('Sanitize file names')}</span>
- {!safeOutputFileName && <WarningSignIcon color="var(--amber-9)" style={{ marginLeft: '.5em', verticalAlign: 'middle' }} />}
+ {!safeOutputFileName && <FaExclamationTriangle color="var(--amber-9)" style={{ marginLeft: '.5em', verticalAlign: 'middle' }} />}
</div>
</motion.div>
)}
</AnimatePresence>
{problems.error != null ? (
- <div style={{ marginBottom: '1em' }}>
- <ErrorIcon color="var(--red-9)" size={14} verticalAlign="baseline" /> {problems.error}
+ <div style={{ marginBottom: '1em', fontSize: '.9em' }}>
+ <FaExclamationTriangle color="var(--red-9)" style={{ verticalAlign: 'middle', fontSize: '1.1em' }} /> {problems.error}
</div>
) : (
<>
{problems.sameAsInputFileNameWarning && (
<div style={{ marginBottom: '1em' }}>
- <WarningSignIcon verticalAlign="middle" color="var(--amber-9)" />{' '}
+ <FaExclamationTriangle style={{ verticalAlign: 'middle', marginRight: '.3em' }} color="var(--amber-9)" />
{i18n.t('Output file name is the same as the source file name. This increases the risk of accidentally overwriting or deleting source files!')}
</div>
)}
{isMissingExtension && (
<div style={{ marginBottom: '1em' }}>
- <WarningSignIcon verticalAlign="middle" color="var(--amber-9)" />{' '}
+ <FaExclamationTriangle style={{ verticalAlign: 'middle', marginRight: '.3em' }} color="var(--amber-9)" />
{i18n.t('The file name template is missing {{ext}} and will result in a file without the suggested extension. This may result in an unplayable output file.', { ext: extVariableFormatted })}
</div>
)}
diff --git a/src/renderer/src/components/GpsMap.tsx b/src/renderer/src/components/GpsMap.tsx
new file mode 100644
index 00000000..9f7ad028
--- /dev/null
+++ b/src/renderer/src/components/GpsMap.tsx
@@ -0,0 +1,91 @@
+import { useEffect, useState } from 'react';
+import { MapContainer, Popup, TileLayer } from 'react-leaflet';
+import { Marker } from '@adamscybot/react-leaflet-component-marker';
+import 'leaflet/dist/leaflet.css';
+import { FaMapMarkerAlt } from 'react-icons/fa';
+
+import { extractSrtGpsTrack } from '../ffmpeg';
+import { handleError } from '../util';
+import { parseDjiGps1, parseDjiGps2 } from '../edlFormats';
+import * as Dialog from './Dialog';
+
+
+// https://www.openstreetmap.org/copyright
+
+async function getGpsTrack({ filePath, streamIndex }: { filePath: string, streamIndex: number }) {
+ const subtitles = await extractSrtGpsTrack(filePath, streamIndex);
+ return subtitles.flatMap((subtitle) => {
+ const { index } = subtitle;
+ if (index == null) return [];
+
+ const parsed = parseDjiGps1(subtitle.lines) ?? parseDjiGps2(subtitle.lines);
+ if (parsed == null) return [];
+
+ return [{
+ ...parsed,
+ index,
+ raw: subtitle.lines,
+ }];
+ });
+}
+
+export default function GpsMap({ filePath, streamIndex }: {
+ filePath: string,
+ streamIndex: number,
+}) {
+ const [points, setPoints] = useState<Awaited<ReturnType<typeof getGpsTrack>>>();
+
+ useEffect(() => {
+ (async () => {
+ try {
+ const allGpsPoints = await getGpsTrack({ filePath, streamIndex });
+
+ // limit number of points, or else severe map slowdown
+ const maxPointsToShow = 500;
+ let gpsPoints = allGpsPoints;
+ if (allGpsPoints.length > maxPointsToShow) {
+ gpsPoints = Array.from({ length: maxPointsToShow }).flatMap((_, i) => {
+ const p = allGpsPoints[Math.floor(i * (allGpsPoints.length / maxPointsToShow))];
+ return p != null ? [p] : [];
+ });
+ }
+
+ if (gpsPoints.length === 0) {
+ throw new Error('No GPS points found');
+ }
+
+ setPoints(gpsPoints);
+ } catch (err) {
+ handleError(err);
+ }
+ })();
+ }, [filePath, streamIndex]);
+
+ const firstPoint = points?.[0];
+
+ if (points == null || firstPoint == null) {
+ return null;
+ }
+
+ return (
+ <div style={{ width: '80vw', height: '60vh' }}>
+ <MapContainer center={[firstPoint.lat, firstPoint.lng]} zoom={16} style={{ width: '100%', height: '100%' }}>
+ <TileLayer
+ attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
+ />
+
+ {points.map((point, i) => (
+ <Marker key={point.index} position={[point.lat, point.lng]} icon={<FaMapMarkerAlt color="#af0e0e" size={20} />}>
+ <Popup>
+ <div>Point {i + 1} / {points.length}</div>
+ {point.raw}
+ </Popup>
+ </Marker>
+ ))}
+ </MapContainer>
+
+ <Dialog.CloseButton />
+ </div>
+ );
+}
diff --git a/src/renderer/src/components/Json5Dialog.tsx b/src/renderer/src/components/Json5Dialog.tsx
new file mode 100644
index 00000000..b33261ee
--- /dev/null
+++ b/src/renderer/src/components/Json5Dialog.tsx
@@ -0,0 +1,38 @@
+import SyntaxHighlighter from 'react-syntax-highlighter';
+import { tomorrow as lightSyntaxStyle, tomorrowNight as darkSyntaxStyle } from 'react-syntax-highlighter/dist/esm/styles/hljs';
+import JSON5 from 'json5';
+
+import * as Dialog from './Dialog';
+import useUserSettings from '../hooks/useUserSettings';
+
+
+export default function Json5Dialog({ title, json, children }: {
+ title: string;
+ json: unknown;
+ children: React.ReactNode;
+}) {
+ const { darkMode } = useUserSettings();
+
+ return (
+ <Dialog.Root>
+ <Dialog.Trigger asChild>
+ {children}
+ </Dialog.Trigger>
+
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content aria-describedby={undefined}>
+ <Dialog.Title>
+ {title}
+ </Dialog.Title>
+
+ <SyntaxHighlighter language="javascript" style={darkMode ? darkSyntaxStyle : lightSyntaxStyle} customStyle={{ textAlign: 'left', maxHeight: '50vh', overflowY: 'auto', fontSize: 14 }}>
+ {JSON5.stringify(json, null, 2)}
+ </SyntaxHighlighter>
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
+ );
+}
diff --git a/src/renderer/src/components/KeyboardShortcuts.tsx b/src/renderer/src/components/KeyboardShortcuts.tsx
index d8c977f9..6d3d4927 100644
--- a/src/renderer/src/components/KeyboardShortcuts.tsx
+++ b/src/renderer/src/components/KeyboardShortcuts.tsx
@@ -1,7 +1,6 @@
import { memo, Fragment, useEffect, useMemo, useCallback, useState, ReactNode, SetStateAction, Dispatch, useRef } from 'react';
import { useTranslation } from 'react-i18next';
-import { UndoIcon, IconButton, DeleteIcon, AddIcon } from 'evergreen-ui';
-import { FaMouse, FaPlus, FaStepForward, FaStepBackward } from 'react-icons/fa';
+import { FaMouse, FaPlus, FaStepForward, FaStepBackward, FaUndo, FaTrash, FaSave } from 'react-icons/fa';
import Mousetrap from 'mousetrap';
import groupBy from 'lodash/groupBy';
import orderBy from 'lodash/orderBy';
@@ -14,9 +13,8 @@ import SegmentCutpointButton from './SegmentCutpointButton';
import { getModifier } from '../hooks/useTimelineScroll';
import { KeyBinding, KeyboardAction, ModifierKey } from '../../../../types';
import { StateSegment } from '../types';
-import Sheet from './Sheet';
import { splitKeyboardKeys } from '../util';
-import Dialog, { ConfirmButton } from './Dialog';
+import * as Dialog from './Dialog';
import Warning from './Warning';
import Button from './Button';
import Action from './Action';
@@ -99,37 +97,46 @@ const CreateBinding = memo(({
const fixedKeys = useMemo(() => fixKeys(keysDown), [keysDown]);
- if (!isShown) return null;
+ if (action == null) return null;
return (
- <Dialog autoOpen onClose={() => setCreatingBinding(undefined)} style={{ maxWidth: '40em' }}>
- <h1 style={{ marginTop: 0 }}>{t('Bind new key to action')}</h1>
-
- <p>{t('Action:')} {actionsMap[action].name} <span style={{ color: 'var(--gray-10)', marginLeft: '.5em' }}><Action name={action} /></span></p>
-
- <p>{t('Please press your desired key combination. Make sure it doesn\'t conflict with any other binding or system hotkeys.')}</p>
-
- <div style={{ minHeight: '2em' }}>{renderKeys(validKeysDown.length > 0 ? validKeysDown : keysDown)}</div>
-
- <AnimatePresence>
- {isComboInvalid && (
- <motion.div
- initial={{ height: 0, opacity: 0 }}
- animate={{ height: 'auto', opacity: 1 }}
- exit={{ height: 0, opacity: 0 }}
- >
- <Warning style={{ paddingBottom: '1em' }}>{t('Combination is invalid')}</Warning>
- </motion.div>
- )}
- </AnimatePresence>
+ <Dialog.Root open={isShown} onOpenChange={(v) => v === false && setCreatingBinding(undefined)}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '40em' }} aria-describedby={undefined}>
+ <Dialog.Title>{t('Bind new key to action')}</Dialog.Title>
+
+ <p>{t('Action:')} {actionsMap[action].name} <span style={{ color: 'var(--gray-10)', marginLeft: '.5em' }}><Action name={action} /></span></p>
+
+ <p>{t('Please press your desired key combination. Make sure it doesn\'t conflict with any other binding or system hotkeys.')}</p>
+
+ <div style={{ minHeight: '2em' }}>{renderKeys(validKeysDown.length > 0 ? validKeysDown : keysDown)}</div>
+
+ <AnimatePresence>
+ {isComboInvalid && (
+ <motion.div
+ initial={{ height: 0, opacity: 0 }}
+ animate={{ height: 'auto', opacity: 1 }}
+ exit={{ height: 0, opacity: 0 }}
+ >
+ <Warning style={{ paddingBottom: '1em' }}>{t('Combination is invalid')}</Warning>
+ </motion.div>
+ )}
+ </AnimatePresence>
+
+ <div style={{ marginBottom: '1em', display: 'flex', gap: '.5em', flexWrap: 'wrap' }}>
+ {!keysDown.includes('esc') && <Button style={{ padding: '.2em .4em' }} onClick={() => addKeyDown('esc')}>ESC</Button>}
+ {keysDown.length > 0 && (
+ <Button onClick={() => setKeysDown([])}><FaUndo style={{ fontSize: '.8em', verticalAlign: 'middle', marginRight: '.3em' }} />{t('Start over')}</Button>
+ )}
+ </div>
- <div style={{ marginBottom: '1em' }}>
- <Button disabled={keysDown.includes('esc')} style={{ padding: '.2em .4em' }} onClick={() => addKeyDown('esc')}>ESC</Button>
- {keysDown.length > 0 && <Button style={{ padding: '.2em .4em' }} onClick={() => setKeysDown([])}><UndoIcon size={10} marginRight=".3em" />{t('Start over')}</Button>}
- </div>
+ <Dialog.ConfirmButton disabled={fixedKeys.length === 0 || isComboInvalid} onClick={() => action != null && onNewKeyBindingConfirmed(action, keysDown)}><FaSave style={{ marginRight: '.3em', verticalAlign: 'middle' }} />{t('Save')}</Dialog.ConfirmButton>
- <ConfirmButton disabled={fixedKeys.length === 0 || isComboInvalid} onClick={() => action != null && onNewKeyBindingConfirmed(action, keysDown)}>{t('Save')}</ConfirmButton>
- </Dialog>
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
);
});
@@ -764,8 +771,7 @@ const KeyboardShortcuts = memo(({
const searchQueryTrimmed = searchQuery.toLowerCase().trim();
const isSearching = !!searchQueryTrimmed;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const actionEntries = useMemo(() => (Object.entries(actionsMap) as any as [keyof typeof actionsMap, typeof actionsMap[keyof typeof actionsMap]][]).filter(([key, { name, category }]) => (
+ const actionEntries = useMemo(() => (Object.entries(actionsMap) as unknown as [keyof typeof actionsMap, typeof actionsMap[keyof typeof actionsMap]][]).filter(([key, { name, category }]) => (
!isSearching
|| key.toLocaleLowerCase().includes(searchQueryTrimmed)
|| name.toLowerCase().includes(searchQueryTrimmed)
@@ -784,6 +790,9 @@ const KeyboardShortcuts = memo(({
const onResetClick = useCallback(() => {
+ // Double confirmation!
+ // eslint-disable-next-line no-alert
+ if (!window.confirm(t('Are you sure you want to reset all keyboard bindings?'))) return;
// eslint-disable-next-line no-alert
if (!window.confirm(t('Are you sure you want to reset all keyboard bindings?'))) return;
@@ -825,7 +834,7 @@ const KeyboardShortcuts = memo(({
<>
<div style={{ marginBottom: '1em' }}>
<div style={{ marginBottom: '1em' }}>
- <TextInput ref={searchInputRef} value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} placeholder="Search" style={{ width: '100%', padding: '.4em .8em' }} />
+ <TextInput ref={searchInputRef} value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} placeholder="Search" style={{ width: '100%', padding: '.4em .8em', boxSizing: 'border-box' }} />
</div>
{categoriesWithActions.map(([category, actionsInCategory]) => (
@@ -853,14 +862,14 @@ const KeyboardShortcuts = memo(({
<div key={keys} style={{ display: 'flex', alignItems: 'center' }}>
{renderKeys(splitKeyboardKeys(keys))}
- <IconButton title={t('Remove key binding')} appearance="minimal" intent="danger" icon={DeleteIcon} onClick={() => onDeleteBindingClick({ action, keys })} />
+ <Button title={t('Remove key binding')} onClick={() => onDeleteBindingClick({ action, keys })} style={{ marginLeft: '.9em' }}><FaTrash style={{ fontSize: '.8em', verticalAlign: 'middle' }} /></Button>
</div>
))}
{bindingsForThisAction.length === 0 && <span style={{ opacity: 0.8, fontSize: '.8em' }}>{t('No binding')}</span>}
</div>
- <IconButton title={t('Bind new key to action')} appearance="minimal" intent="success" icon={AddIcon} onClick={() => onAddBindingClick(action)} />
+ <Button title={t('Bind new key to action')} onClick={() => onAddBindingClick(action)} style={{ marginLeft: '.5em' }}><FaPlus style={{ fontSize: '.8em', verticalAlign: 'middle' }} /></Button>
</div>
);
})}
@@ -870,7 +879,7 @@ const KeyboardShortcuts = memo(({
))}
</div>
- {!isSearching && <Button onClick={onResetClick} style={{ marginBottom: '1em' }}>{t('Reset')}</Button>}
+ {!isSearching && <Button onClick={onResetClick} style={{ marginBottom: '1em' }}><FaUndo style={{ marginRight: '.3em', verticalAlign: 'middle', padding: '.5em' }} />{t('Reset')}</Button>}
<CreateBinding actionsMap={actionsMap} action={creatingBinding} setCreatingBinding={setCreatingBinding} onNewKeyBindingConfirmed={onNewKeyBindingConfirmed} />
</>
@@ -890,11 +899,18 @@ function KeyboardShortcutsDialog({
const { t } = useTranslation();
return (
- <Sheet visible={isShown} onClosePress={onHide} maxWidth="40em" style={{ padding: '0 2em' }}>
- <h1>{t('Keyboard & mouse shortcuts')}</h1>
-
- <KeyboardShortcuts keyBindings={keyBindings} setKeyBindings={setKeyBindings} currentCutSeg={currentCutSeg} resetKeyBindings={resetKeyBindings} />
- </Sheet>
+ <Dialog.Root open={isShown} onOpenChange={(v) => v === false && onHide()}>
+ <Dialog.Portal>
+ <Dialog.Overlay />
+ <Dialog.Content style={{ width: '40em' }} aria-describedby={undefined}>
+ <Dialog.Title>{t('Keyboard & mouse shortcuts')}</Dialog.Title>
+
+ <KeyboardShortcuts keyBindings={keyBindings} setKeyBindings={setKeyBindings} currentCutSeg={currentCutSeg} resetKeyBindings={resetKeyBindings} />
+
+ <Dialog.CloseButton />
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
);
}
diff --git a/src/renderer/src/components/Select.module.css b/src/renderer/src/components/Select.module.css
index 5cccd156..ea55437d 100644
--- a/src/renderer/src/components/Select.module.css
+++ b/src/renderer/src/components/Select.module.css
@@ -1,12 +1,12 @@
.select {
appearance: none;
font: inherit;
- line-height: 120%;
+ line-height: 1.2;
font-size: .8em;
background-color: var(--gray-3);
color: var(--gray-12);
border-radius: .3em;
- padding: 0 1.2em 0 .3em;
+ padding: 0 1.4em 0 .3em;
outline: .05em solid var(--gray-8);
border: .05em solid var(--gray-7);
@@ -17,6 +17,10 @@
background-size: auto 100%;
}
+.select:hover {
+ filter: brightness(1.2);
+}
+
:global(.dark-theme) .select {
background-image: url("data:image/svg+xml;utf8,<svg fill='rgba(255,255,255,0.6)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
}
\ No newline at end of file
diff --git a/src/renderer/src/components/Select.tsx b/src/renderer/src/components/Select.tsx
index 5391426c..c7a4a9a3 100644
--- a/src/renderer/src/components/Select.tsx
+++ b/src/renderer/src/components/Select.tsx
@@ -2,8 +2,9 @@ import { SelectHTMLAttributes, memo } from 'react';
import styles from './Select.module.css';
+export type SelectProps = SelectHTMLAttributes<HTMLSelectElement>;
-function Select(props: SelectHTMLAttributes<HTMLSelectElement>) {
+function Select(props: SelectProps) {
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<select className={styles['select']} {...props} />
diff --git a/src/renderer/src/components/Settings.module.css b/src/renderer/src/components/Settings.module.css
index ecfd18bc..15fdc386 100644
--- a/src/renderer/src/components/Settings.module.css
+++ b/src/renderer/src/components/Settings.module.css
@@ -3,10 +3,10 @@
}
.settings td:first-child, .settings th:first-child {
- padding: 1em 2em 1em 2em;
+ padding: 1em 1em 1em 0;
}
.settings td:nth-child(2), .settings th:nth-child(2) {
- padding: 1em 2em 1em 0em;
+ padding: 1em 0 1em 0;
}
.settings th {
@@ -14,11 +14,11 @@
}
.settings tr.header {
- background-color: var(--black-a3);
+ border-bottom: .1em solid var(--black-a3);
}
:global(.dark-theme) .settings tr.header {
- background-color: var(--white-a3);
+ border-bottom: .1em solid var(--white-a4);
}
.settings {
diff --git a/src/renderer/src/components/Settings.tsx b/src/renderer/src/components/Settings.tsx
index 3d9c48fb..b8cbf3eb 100644
--- a/src/renderer/src/components/Settings.tsx
+++ b/src/renderer/src/components/Settings.tsx
@@ -1,6 +1,5 @@
import { CSSProperties, ChangeEventHandler, TdHTMLAttributes, memo, useCallback, useMemo, useState } from 'react';
-import { FaYinYang, FaKeyboard } from 'react-icons/fa';
-import { GlobeIcon, CleanIcon, CogIcon, Button, NumericalIcon, FolderCloseIcon, DocumentIcon, TimeIcon, CrossIcon } from 'evergreen-ui';
+import { FaYinYang, FaKeyboard, FaGlobe, FaBroom, FaCogs, FaHashtag, FaClock, FaFolder, FaFile, FaTimes } from 'react-icons/fa';
import { useTranslation } from 'react-i18next';
import { HTMLMotionProps, motion } from 'framer-motion';
import invariant from 'tiny-invariant';
@@ -13,12 +12,18 @@ import { askForFfPath } from '../dialogs';
import { isMasBuild, isStoreBuild } from '../util';
import { Config, LanguageKey, ModifierKey, TimecodeFormat, langNames } from '../../../../types';
import styles from './Settings.module.css';
-import Select from './Select';
-
+import SelectRaw, { SelectProps } from './Select';
+import ButtonRaw, { ButtonProps } from './Button';
import { getModifierKeyNames } from '../hooks/useTimelineScroll';
import { TunerType } from '../types';
import Truncated from './Truncated';
+// eslint-disable-next-line react/jsx-props-no-spreading
+const Button = ({ style, ...props }: ButtonProps) => <ButtonRaw style={{ padding: '.5em .9em', ...style }} {...props} />;
+
+// eslint-disable-next-line react/jsx-props-no-spreading
+const Select = ({ style, ...props }: SelectProps) => <SelectRaw style={{ padding: '.5em 1.9em .5em .9em', ...style }} {...props} />;
+
const Row = (props: HTMLMotionProps<'tr'>) => (
<motion.tr
@@ -105,447 +110,442 @@ function Settings({
}, [customFfPath, setCustomFfPath]);
return (
- <>
- <div style={{ padding: '1.5em 2em' }}>
- <div>{t('Hover mouse over buttons in the main interface to see which function they have')}</div>
- </div>
-
- <table className={styles['settings']}>
- <thead>
- <tr className={styles['header']}>
- <th>{t('Settings')}</th>
- <th style={{ width: 300 }}>{t('Current setting')}</th>
- </tr>
- </thead>
-
- <tbody>
- <Row>
- <KeyCell><GlobeIcon style={{ verticalAlign: 'middle', marginRight: '.5em' }} /> App language</KeyCell>
- <td>
- <Select value={language || ''} onChange={onLangChange} style={{ fontSize: '1.2em' }}>
- <option key="" value="">{t('System language')}</option>
- {Object.keys(langNames).map((lang) => <option key={lang} value={lang}>{langNames[lang as keyof typeof langNames]}</option>)}
- </Select>
- </td>
- </Row>
-
- <Row>
- <KeyCell>
- {t('Show advanced settings')}
- <div style={detailsStyle}>
- {!showAdvanced && t('Advanced settings are currently not visible.')}
- </div>
- </KeyCell>
- <td>
- <Switch checked={showAdvanced} onCheckedChange={setShowAdvanced} />
- </td>
- </Row>
-
+ <table className={styles['settings']}>
+ <thead>
+ <tr className={styles['header']}>
+ <th>{t('Setting')}</th>
+ <th style={{ maxWidth: '15em' }}>{t('Current setting')}</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <Row>
+ <KeyCell><FaGlobe style={{ verticalAlign: 'middle', fontSize: '1.2em', marginRight: '.3em' }} /> App language</KeyCell>
+ <td>
+ <Select value={language || ''} onChange={onLangChange} style={{ fontSize: '1em' }}>
+ <option key="" value="">{t('System language')}</option>
+ {Object.keys(langNames).map((lang) => <option key={lang} value={lang}>{langNames[lang as keyof typeof langNames]}</option>)}
+ </Select>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>
+ {t('Show advanced settings')}
+ <div style={detailsStyle}>
+ {!showAdvanced && t('Advanced settings are currently not visible.')}
+ </div>
+ </KeyCell>
+ <td>
+ <Switch checked={showAdvanced} onCheckedChange={setShowAdvanced} />
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>
+ {t('Show export options screen before exporting?')}
+ <div style={detailsStyle}>
+ {t('This gives you an overview of the export and allows you to customise more parameters before exporting, like changing the output file name.')}
+ </div>
+ </KeyCell>
+ <td>
+ <Switch checked={exportConfirmEnabled} onCheckedChange={toggleExportConfirmEnabled} />
+ </td>
+ </Row>
+
+ {showAdvanced && (
<Row>
<KeyCell>
- {t('Show export options screen before exporting?')}
- <div style={detailsStyle}>
- {t('This gives you an overview of the export and allows you to customise more parameters before exporting, like changing the output file name.')}
- </div>
+ {t('Auto save project file?')}<br />
</KeyCell>
<td>
- <Switch checked={exportConfirmEnabled} onCheckedChange={toggleExportConfirmEnabled} />
+ <Switch checked={autoSaveProjectFile} onCheckedChange={setAutoSaveProjectFile} />
</td>
</Row>
+ )}
- {showAdvanced && (
- <Row>
- <KeyCell>
- {t('Auto save project file?')}<br />
- </KeyCell>
- <td>
- <Switch checked={autoSaveProjectFile} onCheckedChange={setAutoSaveProjectFile} />
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Store project file (.llc) in the working directory or next to loaded media file?')}</KeyCell>
- <td>
- <Button iconBefore={storeProjectInWorkingDir ? FolderCloseIcon : DocumentIcon} disabled={!autoSaveProjectFile} onClick={toggleStoreProjectInWorkingDir}>
- {storeProjectInWorkingDir ? t('Store in working directory') : t('Store next to media file')}
- </Button>
- </td>
- </Row>
- )}
-
- {showAdvanced && !isMasBuild && (
- <Row>
- <KeyCell>
- {t('Custom FFmpeg directory (experimental)')}<br />
- <div style={detailsStyle}>
- {t('This allows you to specify custom FFmpeg and FFprobe binaries to use. Make sure the "ffmpeg" and "ffprobe" executables exist in the same directory, and then select the directory.')}
- </div>
- </KeyCell>
- <td>
- <Button iconBefore={CogIcon} onClick={changeCustomFfPath}>
- {customFfPath ? t('Using external ffmpeg') : t('Using built-in ffmpeg')}
- </Button>
- <Truncated maxWidth="15em">{customFfPath}</Truncated>
- </td>
- </Row>
- )}
-
- {showAdvanced && !isStoreBuild && (
- <Row>
- <KeyCell>{t('Check for updates on startup?')}</KeyCell>
- <td>
- <Switch checked={enableUpdateCheck} onCheckedChange={setEnableUpdateCheck} />
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Allow multiple instances of LosslessCut to run concurrently? (experimental)')}</KeyCell>
- <td>
- <Switch checked={allowMultipleInstances} onCheckedChange={setAllowMultipleInstances} />
- </td>
- </Row>
- )}
-
-
- <Header title={t('Options affecting exported files')} />
-
+ {showAdvanced && (
<Row>
- <KeyCell>
- {t('Choose cutting mode: Remove or keep selected segments from video when exporting?')}<br />
- <div style={detailsStyle}>
- {invertCutSegments ? (
- <><b>{t('Remove')}</b>: {t('The video inside segments will be discarded, while the video surrounding them will be kept.')}</>
- ) : (
- <><b>{t('Keep')}</b>: {t('The video inside segments will be kept, while the video outside will be discarded.')}</>
- )}
- </div>
- </KeyCell>
+ <KeyCell>{t('Store project file (.llc) in the working directory or next to loaded media file?')}</KeyCell>
<td>
- <Button iconBefore={FaYinYang} appearance="primary" intent={invertCutSegments ? 'danger' : 'success'} onClick={() => setInvertCutSegments((v) => !v)}>
- {invertCutSegments ? t('Remove') : t('Keep')}
+ <Button disabled={!autoSaveProjectFile} onClick={toggleStoreProjectInWorkingDir}>
+ {storeProjectInWorkingDir ? <FaFolder style={{ verticalAlign: 'middle', fontSize: '1.1em', marginRight: '.3em' }} /> : <FaFile style={{ verticalAlign: 'middle', fontSize: '1.1em', marginRight: '.3em' }} />}
+ {storeProjectInWorkingDir ? t('Store in working directory') : t('Store next to media file')}
</Button>
</td>
</Row>
+ )}
+ {showAdvanced && !isMasBuild && (
<Row>
<KeyCell>
- {t('Working directory')}<br />
+ {t('Custom FFmpeg directory (experimental)')}<br />
<div style={detailsStyle}>
- {t('This is where working files and exported files are stored.')}
+ {t('This allows you to specify custom FFmpeg and FFprobe binaries to use. Make sure the "ffmpeg" and "ffprobe" executables exist in the same directory, and then select the directory.')}
</div>
</KeyCell>
<td>
- <Truncated maxWidth="15em">{customOutDir}</Truncated>
- <Button iconBefore={customOutDir ? FolderCloseIcon : DocumentIcon} onClick={changeOutDir}>
- {customOutDir ? t('Custom working directory') : t('Same directory as input file')}...
+ <Button onClick={changeCustomFfPath}>
+ <FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} />{customFfPath ? t('Using external ffmpeg') : t('Using built-in ffmpeg')}
</Button>
- {customOutDir && (
- <Button
- height={20}
- iconBefore={CrossIcon}
- onClick={clearOutDir}
- >
- {t('Clear working directory')}
- </Button>
- )}
+ <Truncated maxWidth="15em">{customFfPath}</Truncated>
</td>
</Row>
+ )}
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Set file modification date/time of output files to:')}</KeyCell>
- <td>
- <Select value={typeof treatOutputFileModifiedTimeAsStart === 'boolean' ? String(treatOutputFileModifiedTimeAsStart) : 'disabled'} onChange={(e) => setTreatOutputFileModifiedTimeAsStart(e.target.value === 'disabled' ? null : (e.target.value === 'true'))}>
- <option value="disabled">{t('Current time')}</option>
- <option value="true">{t('Source file\'s time plus segment start cut time')}</option>
- <option value="false">{t('Source file\'s time minus segment end cut time')}</option>
- </Select>
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Treat source file modification date/time as:')}</KeyCell>
- <td>
- <Select disabled={treatOutputFileModifiedTimeAsStart == null} value={String(treatInputFileModifiedTimeAsStart)} onChange={(e) => setTreatInputFileModifiedTimeAsStart((e.target.value === 'true'))}>
- <option value="true">{t('Start of video')}</option>
- <option value="false">{t('End of video')}</option>
- </Select>
- </td>
- </Row>
- )}
-
+ {showAdvanced && !isStoreBuild && (
<Row>
- <KeyCell>
- {t('Keyframe cut mode')}<br />
- <div style={detailsStyle}>
- {keyframeCut ? (
- <>
- <b>{t('Keyframe cut')}</b>: {t('Cut at the preceding keyframe (not accurate time.) Equiv to')}:<br />
- <code className="highlighted">ffmpeg -ss N -i input.mp4</code>
- </>
- ) : (
- <>
- <b>{t('Normal cut')}</b>: {t('Accurate time but could leave an empty portion at the beginning of the video. Equiv to')}:<br />
- <code className="highlighted">ffmpeg -i input -ss N</code>
- </>
- )}
- </div>
- </KeyCell>
+ <KeyCell>{t('Check for updates on startup?')}</KeyCell>
<td>
- <Switch checked={keyframeCut} onCheckedChange={() => toggleKeyframeCut()} />
+ <Switch checked={enableUpdateCheck} onCheckedChange={setEnableUpdateCheck} />
</td>
</Row>
+ )}
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Cleanup files after export?')}</KeyCell>
+ <KeyCell>{t('Allow multiple instances of LosslessCut to run concurrently? (experimental)')}</KeyCell>
<td>
- <Button iconBefore={<CleanIcon />} onClick={askForCleanupChoices}>{t('Change preferences')}</Button>
+ <Switch checked={allowMultipleInstances} onCheckedChange={setAllowMultipleInstances} />
</td>
</Row>
+ )}
- {showAdvanced && (
- <Row>
- <KeyCell>
- {t('Extract unprocessable tracks to separate files or discard them?')}<br />
- <div style={detailsStyle}>
- {t('(data tracks such as GoPro GPS, telemetry etc. are not copied over by default because ffmpeg cannot cut them, thus they will cause the media duration to stay the same after cutting video/audio)')}
- </div>
- </KeyCell>
- <td>
- <AutoExportToggler />
- </td>
- </Row>
- )}
+ <Header title={t('Options affecting exported files')} />
- <Header title={t('Snapshots and frame extraction')} />
+ <Row>
+ <KeyCell>
+ {t('Choose cutting mode: Remove or keep selected segments from video when exporting?')}<br />
+ <div style={detailsStyle}>
+ {invertCutSegments ? (
+ <><b>{t('Remove')}</b>: {t('The video inside segments will be discarded, while the video surrounding them will be kept.')}</>
+ ) : (
+ <><b>{t('Keep')}</b>: {t('The video inside segments will be kept, while the video outside will be discarded.')}</>
+ )}
+ </div>
+ </KeyCell>
+ <td>
+ <Button onClick={() => setInvertCutSegments((v) => !v)}>
+ <FaYinYang style={{ verticalAlign: 'middle', marginRight: '.3em' }} /> {invertCutSegments ? t('Remove') : t('Keep')}
+ </Button>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>
+ {t('Working directory')}<br />
+ <div style={detailsStyle}>
+ {t('This is where working files and exported files are stored.')}
+ </div>
+ </KeyCell>
+ <td>
+ <Truncated maxWidth="15em">{customOutDir}</Truncated>
+ <Button onClick={changeOutDir}>
+ {customOutDir ? <FaFolder style={{ marginRight: '.3em', verticalAlign: 'middle' }} /> : <FaFile style={{ marginRight: '.3em', verticalAlign: 'middle' }} />}
+ {customOutDir ? t('Custom working directory') : t('Same directory as input file')}...
+ </Button>
+ {customOutDir && (
+ <Button onClick={clearOutDir}>
+ <FaTimes style={{ marginRight: '.3em' }} />{t('Clear working directory')}
+ </Button>
+ )}
+ </td>
+ </Row>
+ {showAdvanced && (
<Row>
- <KeyCell>
- {t('Snapshot capture format')}
- </KeyCell>
+ <KeyCell>{t('Set file modification date/time of output files to:')}</KeyCell>
<td>
- <CaptureFormatButton showIcon style={{ padding: '.5em 1em' }} />
+ <Select value={typeof treatOutputFileModifiedTimeAsStart === 'boolean' ? String(treatOutputFileModifiedTimeAsStart) : 'disabled'} onChange={(e) => setTreatOutputFileModifiedTimeAsStart(e.target.value === 'disabled' ? null : (e.target.value === 'true'))}>
+ <option value="disabled">{t('Current time')}</option>
+ <option value="true">{t('Source file\'s time plus segment start cut time')}</option>
+ <option value="false">{t('Source file\'s time minus segment end cut time')}</option>
+ </Select>
</td>
</Row>
+ )}
- {showAdvanced && (
- <Row>
- <KeyCell>
- {t('Snapshot capture method')}
- <div style={detailsStyle}>{t('FFmpeg capture method might sometimes capture more correct colors, but the captured snapshot might be off by one or more frames, relative to the preview.')}</div>
- </KeyCell>
- <td>
- <Button onClick={() => setCaptureFrameMethod((existing) => (existing === 'ffmpeg' ? 'videotag' : 'ffmpeg'))}>
- {captureFrameMethod === 'ffmpeg' ? t('FFmpeg') : t('HTML video tag')}
- </Button>
- </td>
- </Row>
- )}
-
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Snapshot capture quality')}</KeyCell>
+ <KeyCell>{t('Treat source file modification date/time as:')}</KeyCell>
<td>
- <input type="range" min={1} max={1000} style={{ width: 200 }} value={Math.round(captureFrameQuality * 1000)} onChange={(e) => setCaptureFrameQuality(Math.max(Math.min(1, parseInt(e.target.value, 10) / 1000), 0))} /><br />
- {Math.round(captureFrameQuality * 100)}%
+ <Select disabled={treatOutputFileModifiedTimeAsStart == null} value={String(treatInputFileModifiedTimeAsStart)} onChange={(e) => setTreatInputFileModifiedTimeAsStart((e.target.value === 'true'))}>
+ <option value="true">{t('Start of video')}</option>
+ <option value="false">{t('End of video')}</option>
+ </Select>
</td>
</Row>
-
- {showAdvanced && (
- <Row>
- <KeyCell>
- {t('File names of extracted video frames')}
- <div style={detailsStyle}>{t('Note that this only applies when extracting multiple frames. When "Frame number" is selected, frame numbers are relative to the start of the segment (starting from 1).')}</div>
- </KeyCell>
- <td>
- <Button iconBefore={captureFrameFileNameFormat === 'timestamp' ? TimeIcon : NumericalIcon} onClick={() => setCaptureFrameFileNameFormat((existing) => (existing === 'timestamp' ? 'index' : 'timestamp'))}>
- {captureFrameFileNameFormat === 'timestamp' ? t('Frame timestamp') : t('Frame number')}
- </Button>
- </td>
- </Row>
- )}
-
-
- <Header title={t('Keyboard, mouse and input')} />
-
+ )}
+
+ <Row>
+ <KeyCell>
+ {t('Keyframe cut mode')}<br />
+ <div style={detailsStyle}>
+ {keyframeCut ? (
+ <>
+ <b>{t('Keyframe cut')}</b>: {t('Cut at the preceding keyframe (not accurate time.) Equiv to')}:<br />
+ <code className="highlighted">ffmpeg -ss N -i input.mp4</code>
+ </>
+ ) : (
+ <>
+ <b>{t('Normal cut')}</b>: {t('Accurate time but could leave an empty portion at the beginning of the video. Equiv to')}:<br />
+ <code className="highlighted">ffmpeg -i input -ss N</code>
+ </>
+ )}
+ </div>
+ </KeyCell>
+ <td>
+ <Switch checked={keyframeCut} onCheckedChange={() => toggleKeyframeCut()} />
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Cleanup files after export?')}</KeyCell>
+ <td>
+ <Button onClick={askForCleanupChoices}><FaBroom style={{ verticalAlign: 'middle', marginRight: '.3em' }} />{t('Change preferences')}</Button>
+ </td>
+ </Row>
+
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Keyboard & mouse shortcuts')}</KeyCell>
+ <KeyCell>
+ {t('Extract unprocessable tracks to separate files or discard them?')}<br />
+ <div style={detailsStyle}>
+ {t('(data tracks such as GoPro GPS, telemetry etc. are not copied over by default because ffmpeg cannot cut them, thus they will cause the media duration to stay the same after cutting video/audio)')}
+ </div>
+ </KeyCell>
<td>
- <Button iconBefore={<FaKeyboard />} onClick={onKeyboardShortcutsDialogRequested}>{t('Keyboard & mouse shortcuts')}</Button>
+ <AutoExportToggler />
</td>
</Row>
+ )}
- <ModifierKeySetting text={t('Mouse wheel zoom modifier key')} value={mouseWheelZoomModifierKey} setValue={setMouseWheelZoomModifierKey} />
- <ModifierKeySetting text={t('Mouse wheel frame seek modifier key')} value={mouseWheelFrameSeekModifierKey} setValue={setMouseWheelFrameSeekModifierKey} />
- <ModifierKeySetting text={t('Mouse wheel keyframe seek modifier key')} value={mouseWheelKeyframeSeekModifierKey} setValue={setMouseWheelKeyframeSeekModifierKey} />
- <Row>
- <KeyCell>{t('Timeline trackpad/wheel sensitivity')}</KeyCell>
- <td>
- <Button iconBefore={CogIcon} onClick={() => onTunerRequested('wheelSensitivity')}>{t('Change value')}</Button>
- </td>
- </Row>
+ <Header title={t('Snapshots and frame extraction')} />
- <Row>
- <KeyCell>{t('Timeline keyboard seek interval')}</KeyCell>
- <td>
- <Button iconBefore={CogIcon} onClick={() => onTunerRequested('keyboardNormalSeekSpeed')}>{t('Change value')}</Button>
- </td>
- </Row>
+ <Row>
+ <KeyCell>
+ {t('Snapshot capture format')}
+ </KeyCell>
+ <td>
+ <CaptureFormatButton showIcon style={{ padding: '.5em 1em' }} />
+ </td>
+ </Row>
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Timeline keyboard seek interval (longer)')}</KeyCell>
+ <KeyCell>
+ {t('Snapshot capture method')}
+ <div style={detailsStyle}>{t('FFmpeg capture method might sometimes capture more correct colors, but the captured snapshot might be off by one or more frames, relative to the preview.')}</div>
+ </KeyCell>
<td>
- <Button iconBefore={CogIcon} onClick={() => onTunerRequested('keyboardSeekSpeed2')}>{t('Change value')}</Button>
+ <Button onClick={() => setCaptureFrameMethod((existing) => (existing === 'ffmpeg' ? 'videotag' : 'ffmpeg'))}>
+ {captureFrameMethod === 'ffmpeg' ? t('FFmpeg') : t('HTML video tag')}
+ </Button>
</td>
</Row>
+ )}
- <Row>
- <KeyCell>{t('Timeline keyboard seek interval (longest)')}</KeyCell>
- <td>
- <Button iconBefore={CogIcon} onClick={() => onTunerRequested('keyboardSeekSpeed3')}>{t('Change value')}</Button>
- </td>
- </Row>
+ <Row>
+ <KeyCell>{t('Snapshot capture quality')}</KeyCell>
+ <td>
+ <input type="range" min={1} max={1000} style={{ width: 200 }} value={Math.round(captureFrameQuality * 1000)} onChange={(e) => setCaptureFrameQuality(Math.max(Math.min(1, parseInt(e.target.value, 10) / 1000), 0))} /><br />
+ {Math.round(captureFrameQuality * 100)}%
+ </td>
+ </Row>
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Timeline keyboard seek acceleration')}</KeyCell>
+ <KeyCell>
+ {t('File names of extracted video frames')}
+ <div style={detailsStyle}>{t('Note that this only applies when extracting multiple frames. When "Frame number" is selected, frame numbers are relative to the start of the segment (starting from 1).')}</div>
+ </KeyCell>
<td>
- <Button iconBefore={CogIcon} onClick={() => onTunerRequested('keyboardSeekAccFactor')}>{t('Change value')}</Button>
+ <Button onClick={() => setCaptureFrameFileNameFormat((existing) => (existing === 'timestamp' ? 'index' : 'timestamp'))}>
+ {captureFrameFileNameFormat === 'timestamp' ? <FaClock style={{ verticalAlign: 'middle', marginRight: '.3em' }} /> : <FaHashtag style={{ verticalAlign: 'middle', marginRight: '.3em' }} />}
+ {captureFrameFileNameFormat === 'timestamp' ? t('Frame timestamp') : t('Frame number')}
+ </Button>
</td>
</Row>
-
+ )}
+
+
+ <Header title={t('Keyboard, mouse and input')} />
+
+ <Row>
+ <KeyCell>{t('Keyboard & mouse shortcuts')}</KeyCell>
+ <td>
+ <Button onClick={onKeyboardShortcutsDialogRequested}><FaKeyboard style={{ verticalAlign: 'middle', marginRight: '.3em' }} /> {t('Keyboard & mouse shortcuts')}</Button>
+ </td>
+ </Row>
+
+ <ModifierKeySetting text={t('Mouse wheel zoom modifier key')} value={mouseWheelZoomModifierKey} setValue={setMouseWheelZoomModifierKey} />
+ <ModifierKeySetting text={t('Mouse wheel frame seek modifier key')} value={mouseWheelFrameSeekModifierKey} setValue={setMouseWheelFrameSeekModifierKey} />
+ <ModifierKeySetting text={t('Mouse wheel keyframe seek modifier key')} value={mouseWheelKeyframeSeekModifierKey} setValue={setMouseWheelKeyframeSeekModifierKey} />
+
+ <Row>
+ <KeyCell>{t('Timeline trackpad/wheel sensitivity')}</KeyCell>
+ <td>
+ <Button onClick={() => onTunerRequested('wheelSensitivity')}><FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} />{t('Change value')}</Button>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Timeline keyboard seek interval')}</KeyCell>
+ <td>
+ <Button onClick={() => onTunerRequested('keyboardNormalSeekSpeed')}><FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} /> {t('Change value')}</Button>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Timeline keyboard seek interval (longer)')}</KeyCell>
+ <td>
+ <Button onClick={() => onTunerRequested('keyboardSeekSpeed2')}><FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} /> {t('Change value')}</Button>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Timeline keyboard seek interval (longest)')}</KeyCell>
+ <td>
+ <Button onClick={() => onTunerRequested('keyboardSeekSpeed3')}><FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} /> {t('Change value')}</Button>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Timeline keyboard seek acceleration')}</KeyCell>
+ <td>
+ <Button onClick={() => onTunerRequested('keyboardSeekAccFactor')}><FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} /> {t('Change value')}</Button>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Invert timeline trackpad/wheel direction?')}</KeyCell>
+ <td>
+ <Switch checked={invertTimelineScroll ?? false} onCheckedChange={setInvertTimelineScroll} />
+ </td>
+ </Row>
+
+
+ <Header title={t('User interface')} />
+
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Invert timeline trackpad/wheel direction?')}</KeyCell>
+ <KeyCell>{t('Remember window size and position')}</KeyCell>
<td>
- <Switch checked={invertTimelineScroll ?? false} onCheckedChange={setInvertTimelineScroll} />
+ <Switch checked={storeWindowBounds} onCheckedChange={setStoreWindowBounds} />
</td>
</Row>
+ )}
-
- <Header title={t('User interface')} />
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Remember window size and position')}</KeyCell>
- <td>
- <Switch checked={storeWindowBounds} onCheckedChange={setStoreWindowBounds} />
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Waveform height')}</KeyCell>
- <td>
- <Button iconBefore={CogIcon} onClick={() => onTunerRequested('waveformHeight')}>{t('Change value')}</Button>
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Auto load timecode from file as an offset in the timeline?')}</KeyCell>
- <td>
- <Switch checked={autoLoadTimecode} onCheckedChange={setAutoLoadTimecode} />
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Enable HEVC / H265 hardware decoding (you may need to turn this off if you have problems with HEVC files)')}</KeyCell>
- <td>
- <Switch checked={enableNativeHevc} onCheckedChange={setEnableNativeHevc} />
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Try to automatically convert to supported format when opening unsupported file?')}</KeyCell>
- <td>
- <Switch checked={enableAutoHtml5ify} onCheckedChange={setEnableAutoHtml5ify} />
- </td>
- </Row>
- )}
-
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Prefer strong colors')}</KeyCell>
+ <KeyCell>{t('Waveform height')}</KeyCell>
<td>
- <Switch checked={preferStrongColors} onCheckedChange={setPreferStrongColors} />
+ <Button onClick={() => onTunerRequested('waveformHeight')}><FaCogs style={{ verticalAlign: 'middle', marginRight: '.4em' }} /> {t('Change value')}</Button>
</td>
</Row>
+ )}
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Reduce motion in user interface')}</KeyCell>
+ <KeyCell>{t('Auto load timecode from file as an offset in the timeline?')}</KeyCell>
<td>
- <Select value={reducedMotion} onChange={(e) => setReducedMotion(e.target.value as Config['reducedMotion'])}>
- {Object.entries({ user: t('System default'), always: t('Yes'), never: t('No') } satisfies Record<Config['reducedMotion'], string>).map(([key, value]) => (
- <option key={key} value={key}>{value}</option>
- ))}
- </Select>
+ <Switch checked={autoLoadTimecode} onCheckedChange={setAutoLoadTimecode} />
</td>
</Row>
+ )}
+ {showAdvanced && (
<Row>
- <KeyCell>{t('In timecode show')}</KeyCell>
+ <KeyCell>{t('Enable HEVC / H265 hardware decoding (you may need to turn this off if you have problems with HEVC files)')}</KeyCell>
<td>
- <Button iconBefore={timecodeFormat === 'frameCount' ? NumericalIcon : TimeIcon} onClick={onTimecodeFormatClick}>
- {timecodeFormatOptions[timecodeFormat]}
- </Button>
+ <Switch checked={enableNativeHevc} onCheckedChange={setEnableNativeHevc} />
</td>
</Row>
+ )}
-
- <Header title={t('Prompts and dialogs')} />
-
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Show notifications')}</KeyCell>
+ <KeyCell>{t('Try to automatically convert to supported format when opening unsupported file?')}</KeyCell>
<td>
- <Switch checked={!hideOsNotifications} onCheckedChange={(v) => setHideOsNotifications(v ? undefined : 'all')} />
+ <Switch checked={enableAutoHtml5ify} onCheckedChange={setEnableAutoHtml5ify} />
</td>
</Row>
-
+ )}
+
+ <Row>
+ <KeyCell>{t('Prefer strong colors')}</KeyCell>
+ <td>
+ <Switch checked={preferStrongColors} onCheckedChange={setPreferStrongColors} />
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Reduce motion in user interface')}</KeyCell>
+ <td>
+ <Select value={reducedMotion} onChange={(e) => setReducedMotion(e.target.value as Config['reducedMotion'])}>
+ {Object.entries({ user: t('System default'), always: t('Yes'), never: t('No') } satisfies Record<Config['reducedMotion'], string>).map(([key, value]) => (
+ <option key={key} value={key}>{value}</option>
+ ))}
+ </Select>
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('In timecode show')}</KeyCell>
+ <td>
+ <Button onClick={onTimecodeFormatClick}>
+ {timecodeFormat === 'frameCount'
+ ? <FaHashtag style={{ verticalAlign: 'middle', marginRight: '.3em' }} />
+ : <FaClock style={{ verticalAlign: 'middle', marginRight: '.3em' }} />}{timecodeFormatOptions[timecodeFormat]}
+ </Button>
+ </td>
+ </Row>
+
+
+ <Header title={t('Prompts and dialogs')} />
+
+ <Row>
+ <KeyCell>{t('Show notifications')}</KeyCell>
+ <td>
+ <Switch checked={!hideOsNotifications} onCheckedChange={(v) => setHideOsNotifications(v ? undefined : 'all')} />
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Show informational in-app notifications')}</KeyCell>
+ <td>
+ <Switch checked={!hideNotifications} onCheckedChange={(v) => setHideNotifications(v ? undefined : 'all')} />
+ </td>
+ </Row>
+
+ <Row>
+ <KeyCell>{t('Ask for confirmation when closing app or file?')}</KeyCell>
+ <td>
+ <Switch checked={askBeforeClose} onCheckedChange={setAskBeforeClose} />
+ </td>
+ </Row>
+
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Show informational in-app notifications')}</KeyCell>
+ <KeyCell>{t('Ask about what to do when opening a new file when another file is already already open?')}</KeyCell>
<td>
- <Switch checked={!hideNotifications} onCheckedChange={(v) => setHideNotifications(v ? undefined : 'all')} />
+ <Switch checked={enableAskForFileOpenAction} onCheckedChange={setEnableAskForFileOpenAction} />
</td>
</Row>
+ )}
+ {showAdvanced && (
<Row>
- <KeyCell>{t('Ask for confirmation when closing app or file?')}</KeyCell>
+ <KeyCell>{t('Ask about importing chapters from opened file?')}</KeyCell>
<td>
- <Switch checked={askBeforeClose} onCheckedChange={setAskBeforeClose} />
+ <Switch checked={enableAskForImportChapters} onCheckedChange={setEnableAskForImportChapters} />
</td>
</Row>
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Ask about what to do when opening a new file when another file is already already open?')}</KeyCell>
- <td>
- <Switch checked={enableAskForFileOpenAction} onCheckedChange={setEnableAskForFileOpenAction} />
- </td>
- </Row>
- )}
-
- {showAdvanced && (
- <Row>
- <KeyCell>{t('Ask about importing chapters from opened file?')}</KeyCell>
- <td>
- <Switch checked={enableAskForImportChapters} onCheckedChange={setEnableAskForImportChapters} />
- </td>
- </Row>
- )}
- </tbody>
- </table>
- </>
+ )}
+ </tbody>
+ </table>
);
}
diff --git a/src/renderer/src/components/Sheet.module.css b/src/renderer/src/components/Sheet.module.css
deleted file mode 100644
index 9f563675..00000000
--- a/src/renderer/src/components/Sheet.module.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.sheet {
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- background: var(--white-a11);
- color: var(--gray-12);
- backdrop-filter: blur(30px);
-
- h1 {
- text-transform: uppercase;
- font-size: 1.3em;
- }
-}
-
-:global(.dark-theme) .sheet {
- background: var(--black-a11);
-}
diff --git a/src/renderer/src/components/Sheet.tsx b/src/renderer/src/components/Sheet.tsx
deleted file mode 100644
index 420c431e..00000000
--- a/src/renderer/src/components/Sheet.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { CSSProperties, ReactNode, memo } from 'react';
-import { motion, AnimatePresence } from 'framer-motion';
-
-import styles from './Sheet.module.css';
-import CloseButton from './CloseButton';
-
-
-function Sheet({ visible, onClosePress, children, maxWidth = 800, style }: {
- visible: boolean,
- onClosePress: () => void,
- children: ReactNode,
- maxWidth?: number | string,
- style?: CSSProperties,
-}) {
- return (
- <AnimatePresence>
- {visible && (
- <motion.div
- initial={{ scale: 0, opacity: 0.5 }}
- animate={{ scale: 1, opacity: 1 }}
- exit={{ scale: 0, opacity: 0 }}
- className={styles['sheet']}
- >
- <div style={{ margin: 'auto', maxWidth, height: '100%', position: 'relative' }}>
- <div style={{ overflowY: 'scroll', height: '100%', ...style }}>
- {children}
- </div>
-
- <CloseButton style={{ top: 0, right: 0 }} onClick={onClosePress} />
- </div>
- </motion.div>
- )}
- </AnimatePresence>
- );
-}
-
-export default memo(Sheet);
diff --git a/src/renderer/src/components/Spinner.tsx b/src/renderer/src/components/Spinner.tsx
new file mode 100644
index 00000000..61e1033e
--- /dev/null
+++ b/src/renderer/src/components/Spinner.tsx
@@ -0,0 +1,7 @@
+import { FaSpinner } from 'react-icons/fa';
+
+export default function Spinner() {
+ return (
+ <FaSpinner className="spinner-animation" />
+ );
+}
diff --git a/src/renderer/src/components/SwalContainer.tsx b/src/renderer/src/components/SwalContainer.tsx
new file mode 100644
index 00000000..be9557d6
--- /dev/null
+++ b/src/renderer/src/components/SwalContainer.tsx
@@ -0,0 +1,14 @@
+import { HTMLAttributes } from 'react';
+import { swalContainerWrapperId } from '../swal';
+
+export default function SwalContainer({ darkMode, ...props }: HTMLAttributes<HTMLDivElement> & { darkMode: boolean }) {
+ return (
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
+ <div
+ id={swalContainerWrapperId}
+ className={darkMode ? 'dark-theme' : undefined}
+ // eslint-disable-next-line react/jsx-props-no-spreading
+ {...props}
+ />
+ );
+}
diff --git a/src/renderer/src/components/TagEditor.tsx b/src/renderer/src/components/TagEditor.tsx
index 7640c447..69ea8501 100644
--- a/src/renderer/src/components/TagEditor.tsx
+++ b/src/renderer/src/components/TagEditor.tsx
@@ -1,8 +1,8 @@
import { memo, useRef, useState, useMemo, useCallback, useEffect, FormEventHandler } from 'react';
import { useTranslation } from 'react-i18next';
-import { TrashIcon, ResetIcon, TickIcon, EditIcon, PlusIcon, IconButton } from 'evergreen-ui';
import invariant from 'tiny-invariant';
import { motion } from 'framer-motion';
+import { FaCheck, FaEdit, FaPlus, FaTrash, FaUndo } from 'react-icons/fa';
import { SegmentTags, segmentTagsSchema } from '../types';
import CopyClipboardButton from './CopyClipboardButton';
@@ -120,7 +120,7 @@ function TagEditor({ existingTags = emptyObject, customTags = emptyObject, editi
<tbody>
{Object.keys(mergedTags).map((tag) => {
const editingThis = tag === editingTag;
- const Icon = editingThis ? TickIcon : EditIcon;
+ const Icon = editingThis ? FaCheck : FaEdit;
const thisTagCustom = customTags[tag] != null;
const thisTagNew = existingTags[tag] == null;
@@ -143,8 +143,14 @@ function TagEditor({ existingTags = emptyObject, customTags = emptyObject, editi
) : (
<span style={{ padding: '.5em 0', color: thisTagCustom ? activeColor : 'var(--gray-11)', fontWeight: thisTagCustom ? 'bold' : undefined }}>{mergedTags[tag] ? String(mergedTags[tag]) : `<${t('empty')}>`}</span>
)}
- {(editingTag == null || editingThis) && <IconButton icon={Icon} title={t('Edit')} appearance="minimal" style={{ marginLeft: '.4em' }} onClick={() => onEditClick(tag)} intent={editingThis ? 'success' : 'none'} />}
- {editingThis && <IconButton icon={thisTagNew ? TrashIcon : ResetIcon} title={thisTagNew ? t('Delete') : t('Reset')} appearance="minimal" onClick={onResetClick} intent="danger" />}
+ {(editingTag == null || editingThis) && (
+ <Button title={t('Edit')} style={{ marginLeft: '.4em' }} onClick={() => onEditClick(tag)}><Icon style={{ fontSize: '.9em', padding: '.7em', verticalAlign: 'middle' }} /></Button>
+ )}
+ {editingThis && (
+ <Button title={thisTagNew ? t('Delete') : t('Reset')} onClick={onResetClick}>
+ {thisTagNew ? <FaTrash style={{ fontSize: '.9em', padding: '.7em', verticalAlign: 'middle' }} /> : <FaUndo style={{ fontSize: '.9em', padding: '.7em', verticalAlign: 'middle' }} />}
+ </Button>
+ )}
</td>
</motion.tr>
);
@@ -152,9 +158,9 @@ function TagEditor({ existingTags = emptyObject, customTags = emptyObject, editi
</tbody>
</table>
- <form onSubmit={onAddSubmit} style={{ opacity: canAdd ? undefined : 0.5 }}>
- <TextInput ref={ref} disabled={!canAdd} value={newTagKeyInput} onChange={(e) => setNewTagKeyInput(e.target.value)} placeholder={addTagTitle} style={{ marginBottom: '1em', padding: '.4em', marginRight: '1em' }} />
- <Button type="button" disabled={!canAdd} title={addTagTitle} onClick={add} style={{ padding: '.3em' }}><PlusIcon style={{ verticalAlign: 'middle' }} /></Button>
+ <form onSubmit={onAddSubmit} style={{ opacity: canAdd ? undefined : 0.5, marginBottom: '1em' }}>
+ <TextInput ref={ref} disabled={!canAdd} value={newTagKeyInput} onChange={(e) => setNewTagKeyInput(e.target.value)} placeholder={addTagTitle} style={{ padding: '.4em', marginRight: '1em', verticalAlign: 'middle' }} />
+ <Button type="button" disabled={!canAdd} title={addTagTitle} onClick={add}><FaPlus style={{ padding: '.6em', verticalAlign: 'middle' }} /></Button>
</form>
{newTagKeyInputError && <Warning>{t('Invalid character(s) found in key')}</Warning>}
diff --git a/src/renderer/src/components/util.tsx b/src/renderer/src/components/util.tsx
new file mode 100644
index 00000000..d47fb834
--- /dev/null
+++ b/src/renderer/src/components/util.tsx
@@ -0,0 +1,13 @@
+import React from 'react';
+
+
+// eslint-disable-next-line import/prefer-default-export
+export function withClass<P extends { className?: string | undefined }>(Component: React.ForwardRefExoticComponent<P>, cls: string) {
+ // eslint-disable-next-line react/display-name,@typescript-eslint/no-explicit-any
+ return React.forwardRef<React.ForwardRefExoticComponent<P>, P>((props, ref) => {
+ const { className, ...rest } = props ?? {};
+ // @ts-expect-error dunno
+ // eslint-disable-next-line react/jsx-props-no-spreading
+ return <Component ref={ref} className={[cls, className].filter(Boolean).join(' ')} {...rest} />;
+ });
+}
diff --git a/src/renderer/src/dialogs/index.tsx b/src/renderer/src/dialogs/index.tsx
index fa759a1d..daad9c94 100644
--- a/src/renderer/src/dialogs/index.tsx
+++ b/src/renderer/src/dialogs/index.tsx
@@ -1,12 +1,9 @@
import { CSSProperties, ReactNode, useState } from 'react';
-import { ArrowRightIcon, HelpIcon, TickCircleIcon, WarningSignIcon, InfoSignIcon, IconComponent } from 'evergreen-ui';
import i18n from 'i18next';
import { Trans } from 'react-i18next';
-import SyntaxHighlighter from 'react-syntax-highlighter';
-import { tomorrow as lightSyntaxStyle, tomorrowNight as darkSyntaxStyle } from 'react-syntax-highlighter/dist/esm/styles/hljs';
-import JSON5 from 'json5';
import type { SweetAlertOptions } from 'sweetalert2';
import invariant from 'tiny-invariant';
+import { FaArrowRight, FaCheckCircle, FaExclamationTriangle, FaInfoCircle, FaQuestionCircle } from 'react-icons/fa';
import { formatDuration } from '../util/duration';
import Swal, { ReactSwal, swalToastOptions, toast } from '../swal';
@@ -142,12 +139,12 @@ export async function askForFileOpenAction(inputOptions: Record<string, string>)
{Object.entries(inputOptions).map(([key, text]) => (
<button type="button" key={key} onClick={() => onClick(key)} className="button-unstyled" style={{ display: 'block', marginBottom: '.5em' }}>
- <ArrowRightIcon style={{ color: 'var(--gray-10)' }} verticalAlign="middle" /> {text}
+ <FaArrowRight style={{ color: 'var(--gray-10)', verticalAlign: 'middle' }} /> {text}
</button>
))}
<button type="button" onClick={() => onClick()} className="button-unstyled" style={{ display: 'block', marginTop: '.5em' }}>
- <ArrowRightIcon style={{ color: 'var(--red-11)' }} /> {i18n.t('Cancel')}
+ <FaArrowRight style={{ color: 'var(--red-11)' }} /> {i18n.t('Cancel')}
</button>
</div>
@@ -701,21 +698,6 @@ export async function mutateSegmentsByExprDialog(inputValidator: (v: string) =>
});
}
-export function showJson5Dialog({ title, json, darkMode }: { title: string, json: unknown, darkMode: boolean }) {
- const html = (
- <SyntaxHighlighter language="javascript" style={darkMode ? darkSyntaxStyle : lightSyntaxStyle} customStyle={{ textAlign: 'left', maxHeight: 300, overflowY: 'auto', fontSize: 14 }}>
- {JSON5.stringify(json, null, 2)}
- </SyntaxHighlighter>
- );
-
- ReactSwal.fire({
- showCloseButton: true,
- title,
- html,
- width: '50em',
- });
-}
-
export async function openDirToast({ filePath, text, html, ...props }: SweetAlertOptions & { filePath: string }) {
const swal = text ? toast : ReactSwal;
@@ -736,29 +718,29 @@ export async function openDirToast({ filePath, text, html, ...props }: SweetAler
const UnorderedList = ({ children }: { children: ReactNode }) => (
<ul style={{ paddingLeft: '1em' }}>{children}</ul>
);
-const ListItem = ({ icon: Icon, iconColor, children, style }: { icon: IconComponent, iconColor?: string, children: ReactNode, style?: CSSProperties }) => (
- <li style={{ listStyle: 'none', ...style }}>
- {Icon && <Icon style={{ color: iconColor }} size={14} marginRight=".4em" />}
+const ListItem = ({ icon, iconColor, children, style }: { icon: ReactNode, iconColor?: string, children: ReactNode, style?: CSSProperties }) => (
+ <li style={{ listStyle: 'none', color: iconColor, ...style }}>
+ <span style={{ fontSize: '.8em', marginRight: '.3em' }}>{icon}</span>
{children}
</li>
);
const Notices = ({ notices }: { notices: string[] }) => notices.map((msg) => (
- <ListItem key={msg} icon={InfoSignIcon} iconColor="var(--blue-9)">{msg}</ListItem>
+ <ListItem key={msg} icon={<FaInfoCircle />} iconColor="var(--blue-9)">{msg}</ListItem>
));
const Warnings = ({ warnings }: { warnings: string[] }) => warnings.map((msg) => (
- <ListItem key={msg} icon={WarningSignIcon} iconColor="var(--orange-8)">{msg}</ListItem>
+ <ListItem key={msg} icon={<FaExclamationTriangle />} iconColor="var(--orange-8)">{msg}</ListItem>
));
const OutputIncorrectSeeHelpMenu = () => (
- <ListItem icon={HelpIcon}>{i18n.t('If output does not look right, see the Help menu.')}</ListItem>
+ <ListItem icon={<FaQuestionCircle />}>{i18n.t('If output does not look right, see the Help menu.')}</ListItem>
);
export async function openExportFinishedToast({ filePath, warnings, notices }: { filePath: string, warnings: string[], notices: string[] }) {
const hasWarnings = warnings.length > 0;
const html = (
<UnorderedList>
- <ListItem icon={TickCircleIcon} iconColor={hasWarnings ? 'var(--orange-8)' : 'var(--green-11)'} style={{ fontWeight: 'bold' }}>{hasWarnings ? i18n.t('Export finished with warning(s)', { count: warnings.length }) : i18n.t('Export is done!')}</ListItem>
- <ListItem icon={InfoSignIcon}>{i18n.t('Please test the output file in your desired player/editor before you delete the source file.')}</ListItem>
+ <ListItem icon={<FaCheckCircle />} iconColor={hasWarnings ? 'var(--orange-8)' : 'var(--green-11)'} style={{ fontWeight: 'bold' }}>{hasWarnings ? i18n.t('Export finished with warning(s)', { count: warnings.length }) : i18n.t('Export is done!')}</ListItem>
+ <ListItem icon={<FaInfoCircle />}>{i18n.t('Please test the output file in your desired player/editor before you delete the source file.')}</ListItem>
<OutputIncorrectSeeHelpMenu />
<Notices notices={notices} />
<Warnings warnings={warnings} />
@@ -773,8 +755,8 @@ export async function openConcatFinishedToast({ filePath, warnings, notices }: {
const hasWarnings = warnings.length > 0;
const html = (
<UnorderedList>
- <ListItem icon={TickCircleIcon} iconColor={hasWarnings ? 'warning' : 'success'} style={{ fontWeight: 'bold' }}>{hasWarnings ? i18n.t('Files merged with warning(s)', { count: warnings.length }) : i18n.t('Files merged!')}</ListItem>
- <ListItem icon={InfoSignIcon}>{i18n.t('Please test the output files in your desired player/editor before you delete the source files.')}</ListItem>
+ <ListItem icon={<FaCheckCircle />} iconColor={hasWarnings ? 'warning' : 'success'} style={{ fontWeight: 'bold' }}>{hasWarnings ? i18n.t('Files merged with warning(s)', { count: warnings.length }) : i18n.t('Files merged!')}</ListItem>
+ <ListItem icon={<FaInfoCircle />}>{i18n.t('Please test the output files in your desired player/editor before you delete the source files.')}</ListItem>
<OutputIncorrectSeeHelpMenu />
<Notices notices={notices} />
<Warnings warnings={warnings} />
diff --git a/src/renderer/src/gps.tsx b/src/renderer/src/gps.tsx
deleted file mode 100644
index 619fbac5..00000000
--- a/src/renderer/src/gps.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { MapContainer, Popup, TileLayer } from 'react-leaflet';
-import { Marker } from '@adamscybot/react-leaflet-component-marker';
-import { Trans } from 'react-i18next';
-import 'leaflet/dist/leaflet.css';
-import { FaMapMarkerAlt } from 'react-icons/fa';
-
-import { extractSrtGpsTrack } from './ffmpeg';
-import { ReactSwal } from './swal';
-import { handleError } from './util';
-import { parseDjiGps1, parseDjiGps2 } from './edlFormats';
-
-
-export default async function tryShowGpsMap(filePath: string, streamIndex: number) {
- try {
- const subtitles = await extractSrtGpsTrack(filePath, streamIndex);
- const allGpsPoints = subtitles.flatMap((subtitle) => {
- const { index } = subtitle;
- if (index == null) return [];
-
- const parsed = parseDjiGps1(subtitle.lines) ?? parseDjiGps2(subtitle.lines);
- if (parsed == null) return [];
-
- return [{
- ...parsed,
- index,
- raw: subtitle.lines,
- }];
- });
- // console.log(allGpsPoints)
-
- // limit number of points, or else severe map slowdown
- const maxPointsToShow = 500;
- let gpsPoints = allGpsPoints;
- if (allGpsPoints.length > maxPointsToShow) {
- gpsPoints = Array.from({ length: maxPointsToShow }).flatMap((_, i) => {
- const p = allGpsPoints[Math.floor(i * (allGpsPoints.length / maxPointsToShow))];
- return p != null ? [p] : [];
- });
- }
-
- const firstPoint = gpsPoints[0];
-
- if (firstPoint == null) {
- throw new Error('No GPS points found');
- }
-
- // https://www.openstreetmap.org/copyright
- ReactSwal.fire({
- width: '100%',
- html: (
- <>
- <div style={{ marginBottom: '1em' }}><Trans>GPS track</Trans></div>
-
- <MapContainer center={[firstPoint.lng, firstPoint.lat]} zoom={16} style={{ height: 500 }}>
- <TileLayer
- attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
- url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
- />
-
- {gpsPoints.map((point, i) => (
- <Marker key={point.index} position={[point.lng, point.lat]} icon={<FaMapMarkerAlt color="#af0e0e" size={20} />}>
- <Popup>
- <div>Point {i + 1} / {gpsPoints.length}</div>
- {point.raw}
- </Popup>
- </Marker>
- ))}
- </MapContainer>
- </>
- ),
- showCloseButton: true,
- showConfirmButton: false,
- });
- } catch (err) {
- handleError(err);
- }
-}
diff --git a/src/renderer/src/main.css b/src/renderer/src/main.css
index 375e5926..4594d4dd 100644
--- a/src/renderer/src/main.css
+++ b/src/renderer/src/main.css
@@ -121,13 +121,26 @@ input:focus-visible, select:focus-visible {
50% { transform: scale(1.15) }
55% { transform: scale(1.03) }
100% { transform: scale(1) }
-}
+}
+
+@keyframes spin {
+ 0% { transform: rotate(0) }
+ 100% { transform: rotate(360deg); }
+}
/* because some people have a hard time finding the button */
.export-animation {
animation: pulse 2s linear infinite;
}
+.spinner-animation {
+ animation: spin 0.8s linear infinite;
+}
+
+.loading-animation {
+ animation: pulse 1s linear infinite;
+}
+
.no-animations * {
transition: none !important;
animation: none !important;
diff --git a/src/renderer/src/swal.ts b/src/renderer/src/swal.ts
index 4defade5..2f15c154 100644
--- a/src/renderer/src/swal.ts
+++ b/src/renderer/src/swal.ts
@@ -5,9 +5,10 @@ import withReactContent from 'sweetalert2-react-content';
import i18n from './i18n';
import { prefersReducedMotion } from './animations';
+export const swalContainerWrapperId = 'swal2-container-wrapper';
let commonSwalOptions: SweetAlertOptions = {
- target: '#swal2-container-wrapper',
+ target: `#${swalContainerWrapperId}`,
};
if (prefersReducedMotion()) {
diff --git a/src/renderer/src/theme.ts b/src/renderer/src/theme.ts
deleted file mode 100644
index 64655fc7..00000000
--- a/src/renderer/src/theme.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { DefaultTheme, IntentTypes, defaultTheme } from 'evergreen-ui';
-import { ProviderProps } from 'react';
-
-
-function colorKeyForIntent(intent: IntentTypes) {
- if (intent === 'danger') return 'var(--red-12)';
- if (intent === 'success') return 'var(--green-12)';
- return 'var(--gray-12)';
-}
-
-function borderColorForIntent(intent: IntentTypes, isHover?: boolean) {
- if (intent === 'danger') return isHover ? 'var(--red-8)' : 'var(--red-7)';
- if (intent === 'success') return isHover ? 'var(--green-8)' : 'var(--green-7)';
- return 'var(--gray-8)';
-}
-
-const customTheme: ProviderProps<DefaultTheme>['value'] = {
- ...defaultTheme,
- colors: {
- ...defaultTheme.colors,
- icon: {
- default: 'var(--gray-12)',
- muted: 'var(--gray-11)',
- disabled: 'var(--gray-8)',
- selected: 'var(--gray-12)',
- },
- },
- components: {
- ...defaultTheme.components,
- Button: {
- ...defaultTheme.components.Button,
- appearances: {
- ...defaultTheme.components.Button.appearances,
- default: {
- ...defaultTheme.components.Button.appearances.default,
- backgroundColor: 'var(--gray-3)',
-
- // https://github.com/segmentio/evergreen/blob/master/src/themes/default/components/button.js
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- border: ((_theme: unknown, props: { intent: IntentTypes }) => `1px solid ${borderColorForIntent(props.intent)}`) as any as string, // todo types
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- color: ((_theme: unknown, props: { color: string, intent: IntentTypes }) => props.color || colorKeyForIntent(props.intent)) as any as string, // todo types
-
- selectors: {
- _hover: {
- backgroundColor: 'var(--gray-4)',
- },
- _active: {
- backgroundColor: 'var(--gray-5)',
- },
- _focus: {
- backgroundColor: 'var(--gray-5)',
- boxShadow: '0 0 0 1px var(--gray-8)',
- },
- },
- disabled: {
- opacity: 0.5,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- } as any as boolean, // todo types
- },
- minimal: {
- ...defaultTheme.components.Button.appearances.minimal,
-
- // https://github.com/segmentio/evergreen/blob/master/src/themes/default/components/button.js
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- color: ((_theme: unknown, props: { color: string, intent: IntentTypes }) => props.color || colorKeyForIntent(props.intent)) as any as string, // todo types
-
- selectors: {
- _hover: {
- backgroundColor: 'var(--gray-4)',
- },
- _active: {
- backgroundColor: 'var(--gray-5)',
- },
- },
- disabled: {
- opacity: 0.5,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- } as any as boolean, // todo types,
- },
- },
- },
- },
-};
-
-export default customTheme;
diff --git a/src/renderer/src/util/constants.ts b/src/renderer/src/util/constants.ts
index 22685dd3..ce45dce0 100644
--- a/src/renderer/src/util/constants.ts
+++ b/src/renderer/src/util/constants.ts
@@ -5,5 +5,5 @@ export const ffmpegExtractWindow = 60;
export const zoomMax = 2 ** 14;
-export const rightBarWidth = 200;
+export const rightBarWidth = 220;
export const leftBarWidth = 240;
diff --git a/yarn.lock b/yarn.lock
index 7c323613..4fe761df 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -217,7 +217,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.24.8, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.7":
+"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.24.8, @babel/runtime@npm:^7.3.1":
version: 7.26.10
resolution: "@babel/runtime@npm:7.26.10"
dependencies:
@@ -507,13 +507,6 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/hash@npm:^0.7.1":
- version: 0.7.4
- resolution: "@emotion/hash@npm:0.7.4"
- checksum: 10/c137a8bed4b3b1f777d14887cfb5707767c15f08836e03753b09f44a21314a26486c99822927a87ca1c4c89b76aecca23a6bc7d9276d246a9f66d06ce5964b41
- languageName: node
- linkType: hard
-
"@emotion/is-prop-valid@npm:^0.8.2":
version: 0.8.8
resolution: "@emotion/is-prop-valid@npm:0.8.8"
@@ -1230,6 +1223,44 @@ __metadata:
languageName: node
linkType: hard
+"@floating-ui/core@npm:^1.7.3":
+ version: 1.7.3
+ resolution: "@floating-ui/core@npm:1.7.3"
+ dependencies:
+ "@floating-ui/utils": "npm:^0.2.10"
+ checksum: 10/a8952ff2673ddf28f12feeb86d90c54949e45bcb1af5758b7672850ac0dadb36d4bd61aa45dad1b6a35ba40d4756d3573afac6610b90502639d7266b91e0864e
+ languageName: node
+ linkType: hard
+
+"@floating-ui/dom@npm:^1.7.4":
+ version: 1.7.4
+ resolution: "@floating-ui/dom@npm:1.7.4"
+ dependencies:
+ "@floating-ui/core": "npm:^1.7.3"
+ "@floating-ui/utils": "npm:^0.2.10"
+ checksum: 10/d3d6a23e7b9804ba56338c7c666590258683af14b6026270d32afc1202f72b5b82cca359004bdc7830bf2463a045da6c7bd4e7d5351218cf270ff94206197971
+ languageName: node
+ linkType: hard
+
+"@floating-ui/react-dom@npm:^2.0.0":
+ version: 2.1.6
+ resolution: "@floating-ui/react-dom@npm:2.1.6"
+ dependencies:
+ "@floating-ui/dom": "npm:^1.7.4"
+ peerDependencies:
+ react: ">=16.8.0"
+ react-dom: ">=16.8.0"
+ checksum: 10/fbfd3319b42edb9c156e4e872f500d2edb112bc9cfd1b45892bff16ccf21c2484ddc9c416f7631c2aaaadec1b2f98b205db8a3f89eb78ca870905fcfe3917c35
+ languageName: node
+ linkType: hard
+
+"@floating-ui/utils@npm:^0.2.10":
+ version: 0.2.10
+ resolution: "@floating-ui/utils@npm:0.2.10"
+ checksum: 10/b635ea865a8be2484b608b7157f5abf9ed439f351011a74b7e988439e2898199a9a8b790f52291e05bdcf119088160dc782d98cff45cc98c5a271bc6f51327ae
+ languageName: node
+ linkType: hard
+
"@fontsource/open-sans@npm:^4.5.14":
version: 4.5.14
resolution: "@fontsource/open-sans@npm:4.5.14"
@@ -1602,6 +1633,32 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/primitive@npm:1.1.3":
+ version: 1.1.3
+ resolution: "@radix-ui/primitive@npm:1.1.3"
+ checksum: 10/ee27abbff0d6d305816e9314655eb35e72478ba47416bc9d5cb0581728be35e3408cfc0748313837561d635f0cb7dfaae26e61831f0e16c0fd7d669a612f2cb0
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-arrow@npm:1.1.7":
+ version: 1.1.7
+ resolution: "@radix-ui/react-arrow@npm:1.1.7"
+ dependencies:
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/6cdf74f06090f8994cdf6d3935a44ea3ac309163a4f59c476482c4907e8e0775f224045030abf10fa4f9e1cb7743db034429249b9e59354988e247eeb0f4fdcf
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-checkbox@npm:^1.2.3":
version: 1.2.3
resolution: "@radix-ui/react-checkbox@npm:1.2.3"
@@ -1628,6 +1685,28 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-collection@npm:1.1.7":
+ version: 1.1.7
+ resolution: "@radix-ui/react-collection@npm:1.1.7"
+ dependencies:
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-context": "npm:1.1.2"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-slot": "npm:1.2.3"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/cd53e2a2be82be7bc4014164cac0b42948401a203e5d0294d3947a5193f1d56bd23eb60e878a98dba50d08283254e79c3b873de5f935276b849686a868d51dd5
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-compose-refs@npm:1.1.2":
version: 1.1.2
resolution: "@radix-ui/react-compose-refs@npm:1.1.2"
@@ -1654,6 +1733,232 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-dialog@npm:^1.1.15":
+ version: 1.1.15
+ resolution: "@radix-ui/react-dialog@npm:1.1.15"
+ dependencies:
+ "@radix-ui/primitive": "npm:1.1.3"
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-context": "npm:1.1.2"
+ "@radix-ui/react-dismissable-layer": "npm:1.1.11"
+ "@radix-ui/react-focus-guards": "npm:1.1.3"
+ "@radix-ui/react-focus-scope": "npm:1.1.7"
+ "@radix-ui/react-id": "npm:1.1.1"
+ "@radix-ui/react-portal": "npm:1.1.9"
+ "@radix-ui/react-presence": "npm:1.1.5"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-slot": "npm:1.2.3"
+ "@radix-ui/react-use-controllable-state": "npm:1.2.2"
+ aria-hidden: "npm:^1.2.4"
+ react-remove-scroll: "npm:^2.6.3"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/90ad9ea36d927a05bcc2701b471c2965f6d5d4f446511cd471e62235fc674186997dea081f52e18cb17a1e593828d94da3848e68864fa3acebe29df9b068b240
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-direction@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@radix-ui/react-direction@npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/8cc330285f1d06829568042ca9aabd3295be4690ae93683033fc8632b5c4dfc60f5c1312f6e2cae27c196189c719de3cfbcf792ff74800f9ccae0ab4abc1bc92
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-dismissable-layer@npm:1.1.11":
+ version: 1.1.11
+ resolution: "@radix-ui/react-dismissable-layer@npm:1.1.11"
+ dependencies:
+ "@radix-ui/primitive": "npm:1.1.3"
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-use-callback-ref": "npm:1.1.1"
+ "@radix-ui/react-use-escape-keydown": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/c20772588423379dee47fbe1d45c238c45a3bbe612eaf64a86576bf81821975e256d92ac71f9151e91b94a73068656143a11da9a3e77de7564d2a9926468e37a
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-dropdown-menu@npm:^2.1.16":
+ version: 2.1.16
+ resolution: "@radix-ui/react-dropdown-menu@npm:2.1.16"
+ dependencies:
+ "@radix-ui/primitive": "npm:1.1.3"
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-context": "npm:1.1.2"
+ "@radix-ui/react-id": "npm:1.1.1"
+ "@radix-ui/react-menu": "npm:2.1.16"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-use-controllable-state": "npm:1.2.2"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/da215196b5dde5619cdb424b1b5236159e4bb949974b7f4ffbf047d467c55116229a8f9cf07eae6457afefb4a2b07888bb30542f303045e05d90a4b072941ae2
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-focus-guards@npm:1.1.3":
+ version: 1.1.3
+ resolution: "@radix-ui/react-focus-guards@npm:1.1.3"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/b57878f6cf0ebc3e8d7c5c6bbaad44598daac19c921551ca541c104201048a9a902f3d69196e7a09995fd46e998c309aab64dc30fa184b3609d67d187a6a9c24
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-focus-scope@npm:1.1.7":
+ version: 1.1.7
+ resolution: "@radix-ui/react-focus-scope@npm:1.1.7"
+ dependencies:
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-use-callback-ref": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/2a7cd00e39e01756999ebf0bdb3401d6a8efa489a7b19e6b629b40bad3022b7b1f616555ccb4b0505bc0ba53e13a1fb51be905db138b16ec39c4fe319fe701d3
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-id@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@radix-ui/react-id@npm:1.1.1"
+ dependencies:
+ "@radix-ui/react-use-layout-effect": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/8d68e200778eb3038906870fc869b3d881f4a46715fb20cddd9c76cba42fdaaa4810a3365b6ec2daf0f185b9201fc99d009167f59c7921bc3a139722c2e976db
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-menu@npm:2.1.16":
+ version: 2.1.16
+ resolution: "@radix-ui/react-menu@npm:2.1.16"
+ dependencies:
+ "@radix-ui/primitive": "npm:1.1.3"
+ "@radix-ui/react-collection": "npm:1.1.7"
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-context": "npm:1.1.2"
+ "@radix-ui/react-direction": "npm:1.1.1"
+ "@radix-ui/react-dismissable-layer": "npm:1.1.11"
+ "@radix-ui/react-focus-guards": "npm:1.1.3"
+ "@radix-ui/react-focus-scope": "npm:1.1.7"
+ "@radix-ui/react-id": "npm:1.1.1"
+ "@radix-ui/react-popper": "npm:1.2.8"
+ "@radix-ui/react-portal": "npm:1.1.9"
+ "@radix-ui/react-presence": "npm:1.1.5"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-roving-focus": "npm:1.1.11"
+ "@radix-ui/react-slot": "npm:1.2.3"
+ "@radix-ui/react-use-callback-ref": "npm:1.1.1"
+ aria-hidden: "npm:^1.2.4"
+ react-remove-scroll: "npm:^2.6.3"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/2ffdfa08822c8c4ffc265d02d16c83d725114f9c0e9b510e73e431306dedddd507ef2861ccd67ec8c0d21cb24cd6401e42f16f3e65b30be627c7e22159151e40
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-popper@npm:1.2.8":
+ version: 1.2.8
+ resolution: "@radix-ui/react-popper@npm:1.2.8"
+ dependencies:
+ "@floating-ui/react-dom": "npm:^2.0.0"
+ "@radix-ui/react-arrow": "npm:1.1.7"
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-context": "npm:1.1.2"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-use-callback-ref": "npm:1.1.1"
+ "@radix-ui/react-use-layout-effect": "npm:1.1.1"
+ "@radix-ui/react-use-rect": "npm:1.1.1"
+ "@radix-ui/react-use-size": "npm:1.1.1"
+ "@radix-ui/rect": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/01366054e1e63dd9394f77afb9da3367709478a5adf4436c080fc5bbe9456170192ff9d1425d9fae5b246e1ba95173848f84b6f2a06b21b47d966367ec7cb997
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-portal@npm:1.1.9":
+ version: 1.1.9
+ resolution: "@radix-ui/react-portal@npm:1.1.9"
+ dependencies:
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-use-layout-effect": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/bd6be39bf021d5c917e2474ecba411e2625171f7ef96862b9af04bbd68833bb3662a7f1fbdeb5a7a237111b10e811e76d2cd03e957dadd6e668ef16541bfbd68
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-presence@npm:1.1.4":
version: 1.1.4
resolution: "@radix-ui/react-presence@npm:1.1.4"
@@ -1674,6 +1979,26 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-presence@npm:1.1.5":
+ version: 1.1.5
+ resolution: "@radix-ui/react-presence@npm:1.1.5"
+ dependencies:
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-use-layout-effect": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/4cdb05844c18877efb4b9739b46b7e5850b81d7ede994e75b5d62e8153a43c6e16b3ff9e55ff716e20b74b99b9415a94e97fd636bcb8698d5bbf7ab7b8663f9b
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-primitive@npm:2.1.0":
version: 2.1.0
resolution: "@radix-ui/react-primitive@npm:2.1.0"
@@ -1693,6 +2018,52 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-primitive@npm:2.1.3":
+ version: 2.1.3
+ resolution: "@radix-ui/react-primitive@npm:2.1.3"
+ dependencies:
+ "@radix-ui/react-slot": "npm:1.2.3"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/1dbbf932a3527f4e62f210bb72944eff605c3e38c8d3275ed5a5c570c02820ab156169756a65ad9a638d2089a828a04a7903795377384e98c87d0ca456303253
+ languageName: node
+ linkType: hard
+
+"@radix-ui/react-roving-focus@npm:1.1.11":
+ version: 1.1.11
+ resolution: "@radix-ui/react-roving-focus@npm:1.1.11"
+ dependencies:
+ "@radix-ui/primitive": "npm:1.1.3"
+ "@radix-ui/react-collection": "npm:1.1.7"
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ "@radix-ui/react-context": "npm:1.1.2"
+ "@radix-ui/react-direction": "npm:1.1.1"
+ "@radix-ui/react-id": "npm:1.1.1"
+ "@radix-ui/react-primitive": "npm:2.1.3"
+ "@radix-ui/react-use-callback-ref": "npm:1.1.1"
+ "@radix-ui/react-use-controllable-state": "npm:1.2.2"
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: 10/0eddafa942332c95622ab8b53cce2fa25fd0dcaf4797218e9e6725da0734a81a438852cdcb3f588521018f68d38c6c5e50c64fda78c655f4e69dd45681ecc5e7
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-slot@npm:1.2.0":
version: 1.2.0
resolution: "@radix-ui/react-slot@npm:1.2.0"
@@ -1708,6 +2079,21 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-slot@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@radix-ui/react-slot@npm:1.2.3"
+ dependencies:
+ "@radix-ui/react-compose-refs": "npm:1.1.2"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/fe484c2741e31d9c20a8fb53c5790a73c0664e2bea35e27f4d484a90c42135fcfffe11a08abfcacb7a8ee2faf013471f0e856818f3ddac8ac51ceb8869e0fd08
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-switch@npm:^1.2.2":
version: 1.2.2
resolution: "@radix-ui/react-switch@npm:1.2.2"
@@ -1733,6 +2119,19 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-use-callback-ref@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@radix-ui/react-use-callback-ref@npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/cde8c40f1d4e79e6e71470218163a746858304bad03758ac84dc1f94247a046478e8e397518350c8d6609c84b7e78565441d7505bb3ed573afce82cfdcd19faf
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-use-controllable-state@npm:1.2.2":
version: 1.2.2
resolution: "@radix-ui/react-use-controllable-state@npm:1.2.2"
@@ -1764,6 +2163,21 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-use-escape-keydown@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@radix-ui/react-use-escape-keydown@npm:1.1.1"
+ dependencies:
+ "@radix-ui/react-use-callback-ref": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/0eb0756c2c55ddcde9ff01446ab01c085ab2bf799173e97db7ef5f85126f9e8600225570801a1f64740e6d14c39ffe8eed7c14d29737345a5797f4622ac96f6f
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-use-layout-effect@npm:1.1.1":
version: 1.1.1
resolution: "@radix-ui/react-use-layout-effect@npm:1.1.1"
@@ -1790,6 +2204,21 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-use-rect@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@radix-ui/react-use-rect@npm:1.1.1"
+ dependencies:
+ "@radix-ui/rect": "npm:1.1.1"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/116461bebc49472f7497e66a9bd413541181b3d00c5e0aaeef45d790dc1fbd7c8dcea80b169ea273306228b9a3c2b70067e902d1fd5004b3057e3bbe35b9d55d
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-use-size@npm:1.1.1":
version: 1.1.1
resolution: "@radix-ui/react-use-size@npm:1.1.1"
@@ -1805,6 +2234,13 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/rect@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@radix-ui/rect@npm:1.1.1"
+ checksum: 10/b6c5eb787640775b53dd52fa47218a089f0a0d8220d3ebff079c0b754e1fb82d89b6bdf08a82fd0d59549bdeb52678c0cca091c302da49dcf74c3c989cb55678
+ languageName: node
+ linkType: hard
+
"@react-leaflet/core@npm:^2.1.0":
version: 2.1.0
resolution: "@react-leaflet/core@npm:2.1.0"
@@ -1963,17 +2399,6 @@ __metadata:
languageName: node
linkType: hard
-"@segment/react-tiny-virtual-list@npm:^2.2.1":
- version: 2.2.1
- resolution: "@segment/react-tiny-virtual-list@npm:2.2.1"
- dependencies:
- prop-types: "npm:^15.5.7"
- peerDependencies:
- react: ">=16.3"
- checksum: 10/b94216e84f35c85bd2c64b76b32a81e02045be0fa96d95a6b51cfbecbf6b90ce4f0c24ee9338bcb6613ef4ddb8c8edb8459096290a14010395c4e11b929348bb
- languageName: node
- linkType: hard
-
"@sindresorhus/is@npm:^4.0.0":
version: 4.6.0
resolution: "@sindresorhus/is@npm:4.6.0"
@@ -2445,15 +2870,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/react-transition-group@npm:^4.4.0":
- version: 4.4.4
- resolution: "@types/react-transition-group@npm:4.4.4"
- dependencies:
- "@types/react": "npm:*"
- checksum: 10/f67a95c1bb1465cd695392b8e10b39e4af6898650d9e3b907b61b0421e46ae331860bc3f713aa856d38850ee3cd883e4d4eef889ed65ce1a904e88da25442e69
- languageName: node
- linkType: hard
-
"@types/react@npm:*, @types/react@npm:^18.2.66":
version: 18.2.66
resolution: "@types/react@npm:18.2.66"
@@ -3035,6 +3451,15 @@ __metadata:
languageName: node
linkType: hard
+"aria-hidden@npm:^1.2.4":
+ version: 1.2.6
+ resolution: "aria-hidden@npm:1.2.6"
+ dependencies:
+ tslib: "npm:^2.0.0"
+ checksum: 10/1914e5a36225dccdb29f0b88cc891eeca736cdc5b0c905ab1437b90b28b5286263ed3a221c75b7dc788f25b942367be0044b2ac8ccf073a72e07a50b1d964202
+ languageName: node
+ linkType: hard
+
"aria-query@npm:^5.3.0":
version: 5.3.0
resolution: "aria-query@npm:5.3.0"
@@ -3160,13 +3585,6 @@ __metadata:
languageName: node
linkType: hard
-"arrify@npm:^1.0.1":
- version: 1.0.1
- resolution: "arrify@npm:1.0.1"
- checksum: 10/745075dd4a4624ff0225c331dacb99be501a515d39bcb7c84d24660314a6ec28e68131b137e6f7e16318170842ce97538cd298fc4cd6b2cc798e0b957f2747e7
- languageName: node
- linkType: hard
-
"assert-plus@npm:^1.0.0":
version: 1.0.0
resolution: "assert-plus@npm:1.0.0"
@@ -4013,7 +4431,7 @@ __metadata:
languageName: node
linkType: hard
-"compute-scroll-into-view@npm:^1.0.14, compute-scroll-into-view@npm:^1.0.17":
+"compute-scroll-into-view@npm:^1.0.17":
version: 1.0.17
resolution: "compute-scroll-into-view@npm:1.0.17"
checksum: 10/9c7b730442081a812dba2d7d26a66968f0f3fdbba94b3cb60637808e8ba9afb33f9aa0997f71d3c2cebc71762c4145dc4b2bf5b814e0ff6d05215aa22f7c5ad2
@@ -4430,6 +4848,13 @@ __metadata:
languageName: node
linkType: hard
+"detect-node-es@npm:^1.1.0":
+ version: 1.1.0
+ resolution: "detect-node-es@npm:1.1.0"
+ checksum: 10/e46307d7264644975b71c104b9f028ed1d3d34b83a15b8a22373640ce5ea630e5640b1078b8ea15f202b54641da71e4aa7597093bd4b91f113db520a26a37449
+ languageName: node
+ linkType: hard
+
"detect-node@npm:^2.0.4":
version: 2.1.0
resolution: "detect-node@npm:2.1.0"
@@ -4510,16 +4935,6 @@ __metadata:
languageName: node
linkType: hard
-"dom-helpers@npm:^5.0.1":
- version: 5.2.1
- resolution: "dom-helpers@npm:5.2.1"
- dependencies:
- "@babel/runtime": "npm:^7.8.7"
- csstype: "npm:^3.0.2"
- checksum: 10/bed2341adf8864bf932b3289c24f35fdd99930af77df46688abf2d753ff291df49a15850c874d686d9be6ec4e1c6835673906e64dbd8b2839d227f117a11fd41
- languageName: node
- linkType: hard
-
"dom-serializer@npm:^2.0.0":
version: 2.0.0
resolution: "dom-serializer@npm:2.0.0"
@@ -4583,20 +4998,6 @@ __metadata:
languageName: node
linkType: hard
-"downshift@npm:^5.2.0":
- version: 5.4.7
- resolution: "downshift@npm:5.4.7"
- dependencies:
- "@babel/runtime": "npm:^7.10.2"
- compute-scroll-into-view: "npm:^1.0.14"
- prop-types: "npm:^15.7.2"
- react-is: "npm:^16.13.1"
- peerDependencies:
- react: ">=16.8.0"
- checksum: 10/df3686bdba31d962de5becdc590b50562dceecd49d6f8daa4937128f001898e9fd2ae6a5c347c8cc91a71820e0ff6eee940843b3c69a562d97dd32c1fc6ccd55
- languageName: node
- linkType: hard
-
"dunder-proto@npm:^1.0.1":
version: 1.0.1
resolution: "dunder-proto@npm:1.0.1"
@@ -5685,35 +6086,6 @@ __metadata:
languageName: node
linkType: hard
-"evergreen-ui@npm:^7.1.9":
- version: 7.1.9
- resolution: "evergreen-ui@npm:7.1.9"
- dependencies:
- "@babel/runtime": "npm:^7.1.2"
- "@segment/react-tiny-virtual-list": "npm:^2.2.1"
- "@types/react-transition-group": "npm:^4.4.0"
- arrify: "npm:^1.0.1"
- downshift: "npm:^5.2.0"
- fuzzaldrin-plus: "npm:^0.6.0"
- humanize-plus: "npm:^1.8.2"
- lodash.debounce: "npm:^4.0.8"
- lodash.differencewith: "npm:^4.5.0"
- lodash.isempty: "npm:^4.4.0"
- lodash.merge: "npm:^4.6.2"
- lodash.omit: "npm:^4.5.0"
- lodash.uniqby: "npm:^4.7.0"
- prop-types: "npm:^15.6.2"
- react-fast-compare: "npm:^3.2.0"
- react-transition-group: "npm:^4.4.1"
- ui-box: "npm:^5.4.1"
- peerDependencies:
- react: ^16.8.0 || ^17.0.0 || ^18.0.0
- react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
- react-is: ^16.8.0 || ^17.0.0 || ^18.0.0
- checksum: 10/a12fa6658b194fff3af080ed1a39f54028a2ba010715d6e5ef20acad8e38dc7e053cb43c20ebf28c77cabdd97c10aa2bf0a7a595c4169fbe93f1a15f896bec14
- languageName: node
- linkType: hard
-
"execa@npm:^9.5.1":
version: 9.5.1
resolution: "execa@npm:9.5.1"
@@ -6286,13 +6658,6 @@ __metadata:
languageName: node
linkType: hard
-"fuzzaldrin-plus@npm:^0.6.0":
- version: 0.6.0
- resolution: "fuzzaldrin-plus@npm:0.6.0"
- checksum: 10/3cdd27e594167526fee3946953fbeae57b212ac495ebde7e8805333529d073b58f5790f85ac03a933db36796e51f6ab366b5e9c386ea2c863aacb711df6e2ba8
- languageName: node
- linkType: hard
-
"gauge@npm:^4.0.3":
version: 4.0.4
resolution: "gauge@npm:4.0.4"
@@ -6341,6 +6706,13 @@ __metadata:
languageName: node
linkType: hard
+"get-nonce@npm:^1.0.0":
+ version: 1.0.1
+ resolution: "get-nonce@npm:1.0.1"
+ checksum: 10/ad5104871d114a694ecc506a2d406e2331beccb961fe1e110dc25556b38bcdbf399a823a8a375976cd8889668156a9561e12ebe3fa6a4c6ba169c8466c2ff868
+ languageName: node
+ linkType: hard
+
"get-proto@npm:^1.0.1":
version: 1.0.1
resolution: "get-proto@npm:1.0.1"
@@ -6815,13 +7187,6 @@ __metadata:
languageName: node
linkType: hard
-"humanize-plus@npm:^1.8.2":
- version: 1.8.2
- resolution: "humanize-plus@npm:1.8.2"
- checksum: 10/3c60707ec52157d0e73ad53e4c0928804485580696b58bd9e01bccb39e42115ef92f7967c41135f359601d760d72315bd35578e3b7efcb3477eca74a9b3b2c94
- languageName: node
- linkType: hard
-
"hyphenate-style-name@npm:^1.0.2":
version: 1.0.4
resolution: "hyphenate-style-name@npm:1.0.4"
@@ -7010,15 +7375,6 @@ __metadata:
languageName: node
linkType: hard
-"inline-style-prefixer@npm:^5.0.4":
- version: 5.1.2
- resolution: "inline-style-prefixer@npm:5.1.2"
- dependencies:
- css-in-js-utils: "npm:^2.0.0"
- checksum: 10/b6ba42b7dbb9eeb43eeecaae926b4eeb9019f47ae1fa904389fff6badf3036e27ca0ae2ae6a8c333b558d31a35f7654c8e5aaf960cbb60b0d8fc0520a15c7d51
- languageName: node
- linkType: hard
-
"inline-style-prefixer@npm:^6.0.0":
version: 6.0.1
resolution: "inline-style-prefixer@npm:6.0.1"
@@ -7795,20 +8151,6 @@ __metadata:
languageName: node
linkType: hard
-"lodash.differencewith@npm:^4.5.0":
- version: 4.5.0
- resolution: "lodash.differencewith@npm:4.5.0"
- checksum: 10/7dfa40756f7b8ed3ac425c4ecb33362478db7f99c2d8a2bcdcfeafab4cd78ca900318ff8a619f779da060ca02a2748dfdcf34a8c735ecd343d9e8f6b6b93434b
- languageName: node
- linkType: hard
-
-"lodash.isempty@npm:^4.4.0":
- version: 4.4.0
- resolution: "lodash.isempty@npm:4.4.0"
- checksum: 10/b69de4e08038f3d802fa2f510fd97f6b1785a359a648382ba30fb59e17ce0bcdad9bef2cdb9f9501abb9064c74c6edbb8db86a6d827e0d380a50a6738e051ec3
- languageName: node
- linkType: hard
-
"lodash.merge@npm:^4.6.2":
version: 4.6.2
resolution: "lodash.merge@npm:4.6.2"
@@ -7816,20 +8158,6 @@ __metadata:
languageName: node
linkType: hard
-"lodash.omit@npm:^4.5.0":
- version: 4.5.0
- resolution: "lodash.omit@npm:4.5.0"
- checksum: 10/f5c67cd1df11f1275662060febb629a4d4e7b547c4bea66454508b5e6096162c2af882aab1ff8cb5dcf2b328f22252416de6ca9c1334588f6310edfac525e511
- languageName: node
- linkType: hard
-
-"lodash.uniqby@npm:^4.7.0":
- version: 4.7.0
- resolution: "lodash.uniqby@npm:4.7.0"
- checksum: 10/256616bd1bd6be84d8a5eceb61338a0ab8d8b34314ba7bfd5f0de35227d0e2c1e659c61ff4ac31eba6a664085cc7e397bc34c3534fba208102db660a4f98f211
- languageName: node
- linkType: hard
-
"lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.21":
version: 4.17.21
resolution: "lodash@npm:4.17.21"
@@ -7884,6 +8212,8 @@ __metadata:
"@octokit/core": "npm:5"
"@radix-ui/colors": "npm:^3.0.0"
"@radix-ui/react-checkbox": "npm:^1.2.3"
+ "@radix-ui/react-dialog": "npm:^1.1.15"
+ "@radix-ui/react-dropdown-menu": "npm:^2.1.16"
"@radix-ui/react-switch": "npm:^1.2.2"
"@tanstack/react-virtual": "npm:^3.13.10"
"@tsconfig/node18": "npm:^18.2.2"
@@ -7933,7 +8263,6 @@ __metadata:
eslint-plugin-react: "npm:^7.28.0"
eslint-plugin-react-hooks: "npm:^4.3.0"
eslint-plugin-unicorn: "npm:^51.0.1"
- evergreen-ui: "npm:^7.1.9"
execa: "npm:^9.5.1"
express: "npm:^4.20.0"
express-async-handler: "npm:^1.2.0"
@@ -9267,7 +9596,7 @@ __metadata:
languageName: node
linkType: hard
-"prop-types@npm:^15.5.7, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1":
+"prop-types@npm:^15.8.1":
version: 15.8.1
resolution: "prop-types@npm:15.8.1"
dependencies:
@@ -9400,13 +9729,6 @@ __metadata:
languageName: node
linkType: hard
-"react-fast-compare@npm:^3.2.0":
- version: 3.2.0
- resolution: "react-fast-compare@npm:3.2.0"
- checksum: 10/26ed35d425f197f04c85d572eac943d901a2713335b79483d4f3f94ee5caf97f20678f89bedd385ace9b1637890c88fc5442d732bad0871135643d9703312cd7
- languageName: node
- linkType: hard
-
"react-i18next@npm:^15.0.0":
version: 15.0.0
resolution: "react-i18next@npm:15.0.0"
@@ -9481,6 +9803,41 @@ __metadata:
languageName: node
linkType: hard
+"react-remove-scroll-bar@npm:^2.3.7":
+ version: 2.3.8
+ resolution: "react-remove-scroll-bar@npm:2.3.8"
+ dependencies:
+ react-style-singleton: "npm:^2.2.2"
+ tslib: "npm:^2.0.0"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/6c0f8cff98b9f49a4ee2263f1eedf12926dced5ce220fbe83bd93544460e2a7ec8ec39b35d1b2a75d2fced0b2d64afeb8e66f830431ca896e05a20585f9fc350
+ languageName: node
+ linkType: hard
+
+"react-remove-scroll@npm:^2.6.3":
+ version: 2.7.1
+ resolution: "react-remove-scroll@npm:2.7.1"
+ dependencies:
+ react-remove-scroll-bar: "npm:^2.3.7"
+ react-style-singleton: "npm:^2.2.3"
+ tslib: "npm:^2.1.0"
+ use-callback-ref: "npm:^1.3.3"
+ use-sidecar: "npm:^1.1.3"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/5e571ba35ba527047c54c9c4a271363167770556fb85ee45ead8310673197719425cc8f7a2b7f672abf530294c41c8c34bdae325a571994cc1e694b664b52734
+ languageName: node
+ linkType: hard
+
"react-reverse-portal@npm:^2.1.2":
version: 2.1.2
resolution: "react-reverse-portal@npm:2.1.2"
@@ -9491,6 +9848,22 @@ __metadata:
languageName: node
linkType: hard
+"react-style-singleton@npm:^2.2.2, react-style-singleton@npm:^2.2.3":
+ version: 2.2.3
+ resolution: "react-style-singleton@npm:2.2.3"
+ dependencies:
+ get-nonce: "npm:^1.0.0"
+ tslib: "npm:^2.0.0"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/62498094ff3877a37f351b29e6cad9e38b2eb1ac3c0cb27ebf80aee96554f80b35e17bdb552bcd7ac8b7cb9904fea93ea5668f2057c73d38f90b5d46bb9b27ab
+ languageName: node
+ linkType: hard
+
"react-syntax-highlighter@npm:^15.4.3":
version: 15.4.5
resolution: "react-syntax-highlighter@npm:15.4.5"
@@ -9506,21 +9879,6 @@ __metadata:
languageName: node
linkType: hard
-"react-transition-group@npm:^4.4.1":
- version: 4.4.2
- resolution: "react-transition-group@npm:4.4.2"
- dependencies:
- "@babel/runtime": "npm:^7.5.5"
- dom-helpers: "npm:^5.0.1"
- loose-envify: "npm:^1.4.0"
- prop-types: "npm:^15.6.2"
- peerDependencies:
- react: ">=16.6.0"
- react-dom: ">=16.6.0"
- checksum: 10/99b1e807b422878da6b183bd9264fe77fc8270201f683c85364bae20411128cadf2246eaa4d1afd95acf71e2f12ea0deab13e4170a67755d057c156e19ece9d2
- languageName: node
- linkType: hard
-
"react-universal-interface@npm:^0.6.2":
version: 0.6.2
resolution: "react-universal-interface@npm:0.6.2"
@@ -11363,19 +11721,6 @@ __metadata:
languageName: node
linkType: hard
-"ui-box@npm:^5.4.1":
- version: 5.4.1
- resolution: "ui-box@npm:5.4.1"
- dependencies:
- "@emotion/hash": "npm:^0.7.1"
- inline-style-prefixer: "npm:^5.0.4"
- prop-types: "npm:^15.7.2"
- peerDependencies:
- react: ^16.0.0 || ^17.0.0 || ^18.0.0
- checksum: 10/9b8b69e214baf06b570f173cefd41cf6d0ac1153192f528b53622989beff8b1ef9dc1fe1156eb7f7b5711c856c54df9c3955212c98dfbcbbf69d988f6b3bfa45
- languageName: node
- linkType: hard
-
"uint8array-extras@npm:^1.3.0":
version: 1.4.0
resolution: "uint8array-extras@npm:1.4.0"
@@ -11506,6 +11851,21 @@ __metadata:
languageName: node
linkType: hard
+"use-callback-ref@npm:^1.3.3":
+ version: 1.3.3
+ resolution: "use-callback-ref@npm:1.3.3"
+ dependencies:
+ tslib: "npm:^2.0.0"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/adf06a7b6a27d3651c325ac9b66d2b82ccacaed7450b85b211d123e91d9a23cb5a587fcc6db5b4fd07ac7233e5abf024d30cf02ddc2ec46bca712151c0836151
+ languageName: node
+ linkType: hard
+
"use-debounce@npm:^5.1.0":
version: 5.2.1
resolution: "use-debounce@npm:5.2.1"
@@ -11515,6 +11875,22 @@ __metadata:
languageName: node
linkType: hard
+"use-sidecar@npm:^1.1.3":
+ version: 1.1.3
+ resolution: "use-sidecar@npm:1.1.3"
+ dependencies:
+ detect-node-es: "npm:^1.1.0"
+ tslib: "npm:^2.0.0"
+ peerDependencies:
+ "@types/react": "*"
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ checksum: 10/2fec05eb851cdfc4a4657b1dfb434e686f346c3265ffc9db8a974bb58f8128bd4a708a3cc00e8f51655fccf81822ed4419ebed42f41610589e3aab0cf2492edb
+ languageName: node
+ linkType: hard
+
"use-trace-update@npm:^1.3.0":
version: 1.3.2
resolution: "use-trace-update@npm:1.3.2"