markupr 2.1.8 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -15
- package/dist/cli/index.mjs +3593 -0
- package/dist/main/index.mjs +743 -220
- package/dist/mcp/index.mjs +4053 -0
- package/package.json +32 -7
- package/.claude/commands/review-feedback.md +0 -47
- package/.eslintrc.json +0 -35
- package/.github/CODEOWNERS +0 -16
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -56
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -54
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -89
- package/.github/dependabot.yml +0 -70
- package/.github/workflows/ci.yml +0 -184
- package/.github/workflows/deploy-landing.yml +0 -134
- package/.github/workflows/nightly.yml +0 -288
- package/.github/workflows/release.yml +0 -318
- package/CHANGELOG.md +0 -127
- package/CLAUDE.md +0 -137
- package/CODE_OF_CONDUCT.md +0 -9
- package/CONTRIBUTING.md +0 -390
- package/PRODUCT_VISION.md +0 -277
- package/SECURITY.md +0 -51
- package/SIGNING_INSTRUCTIONS.md +0 -284
- package/assets/DMG_BACKGROUND_INSTRUCTIONS.md +0 -130
- package/assets/svg-source/dmg-background.svg +0 -70
- package/assets/svg-source/icon.svg +0 -20
- package/assets/svg-source/tray-icon-processing.svg +0 -7
- package/assets/svg-source/tray-icon-recording.svg +0 -7
- package/assets/svg-source/tray-icon.svg +0 -6
- package/assets/tray-complete.png +0 -0
- package/assets/tray-complete@2x.png +0 -0
- package/assets/tray-completeTemplate.png +0 -0
- package/assets/tray-completeTemplate@2x.png +0 -0
- package/assets/tray-error.png +0 -0
- package/assets/tray-error@2x.png +0 -0
- package/assets/tray-errorTemplate.png +0 -0
- package/assets/tray-errorTemplate@2x.png +0 -0
- package/assets/tray-icon-processing.png +0 -0
- package/assets/tray-icon-processing@2x.png +0 -0
- package/assets/tray-icon-processingTemplate.png +0 -0
- package/assets/tray-icon-processingTemplate@2x.png +0 -0
- package/assets/tray-icon-recording.png +0 -0
- package/assets/tray-icon-recording@2x.png +0 -0
- package/assets/tray-icon-recordingTemplate.png +0 -0
- package/assets/tray-icon-recordingTemplate@2x.png +0 -0
- package/assets/tray-icon.png +0 -0
- package/assets/tray-icon@2x.png +0 -0
- package/assets/tray-iconTemplate.png +0 -0
- package/assets/tray-iconTemplate@2x.png +0 -0
- package/assets/tray-idle.png +0 -0
- package/assets/tray-idle@2x.png +0 -0
- package/assets/tray-idleTemplate.png +0 -0
- package/assets/tray-idleTemplate@2x.png +0 -0
- package/assets/tray-processing-0.png +0 -0
- package/assets/tray-processing-0@2x.png +0 -0
- package/assets/tray-processing-0Template.png +0 -0
- package/assets/tray-processing-0Template@2x.png +0 -0
- package/assets/tray-processing-1.png +0 -0
- package/assets/tray-processing-1@2x.png +0 -0
- package/assets/tray-processing-1Template.png +0 -0
- package/assets/tray-processing-1Template@2x.png +0 -0
- package/assets/tray-processing-2.png +0 -0
- package/assets/tray-processing-2@2x.png +0 -0
- package/assets/tray-processing-2Template.png +0 -0
- package/assets/tray-processing-2Template@2x.png +0 -0
- package/assets/tray-processing-3.png +0 -0
- package/assets/tray-processing-3@2x.png +0 -0
- package/assets/tray-processing-3Template.png +0 -0
- package/assets/tray-processing-3Template@2x.png +0 -0
- package/assets/tray-processing.png +0 -0
- package/assets/tray-processing@2x.png +0 -0
- package/assets/tray-processingTemplate.png +0 -0
- package/assets/tray-processingTemplate@2x.png +0 -0
- package/assets/tray-recording.png +0 -0
- package/assets/tray-recording@2x.png +0 -0
- package/assets/tray-recordingTemplate.png +0 -0
- package/assets/tray-recordingTemplate@2x.png +0 -0
- package/build/DMG_BACKGROUND_SPEC.md +0 -50
- package/build/dmg-background.png +0 -0
- package/build/dmg-background@2x.png +0 -0
- package/build/entitlements.mac.inherit.plist +0 -27
- package/build/entitlements.mac.plist +0 -41
- package/build/favicon-16.png +0 -0
- package/build/favicon-180.png +0 -0
- package/build/favicon-192.png +0 -0
- package/build/favicon-32.png +0 -0
- package/build/favicon-48.png +0 -0
- package/build/favicon-512.png +0 -0
- package/build/favicon-64.png +0 -0
- package/build/icon-128.png +0 -0
- package/build/icon-16.png +0 -0
- package/build/icon-24.png +0 -0
- package/build/icon-256.png +0 -0
- package/build/icon-32.png +0 -0
- package/build/icon-48.png +0 -0
- package/build/icon-64.png +0 -0
- package/build/icon.icns +0 -0
- package/build/icon.ico +0 -0
- package/build/icon.iconset/icon_128x128.png +0 -0
- package/build/icon.iconset/icon_128x128@2x.png +0 -0
- package/build/icon.iconset/icon_16x16.png +0 -0
- package/build/icon.iconset/icon_16x16@2x.png +0 -0
- package/build/icon.iconset/icon_256x256.png +0 -0
- package/build/icon.iconset/icon_256x256@2x.png +0 -0
- package/build/icon.iconset/icon_32x32.png +0 -0
- package/build/icon.iconset/icon_32x32@2x.png +0 -0
- package/build/icon.iconset/icon_512x512.png +0 -0
- package/build/icon.iconset/icon_512x512@2x.png +0 -0
- package/build/icon.png +0 -0
- package/build/installer-header.bmp +0 -0
- package/build/installer-header.png +0 -0
- package/build/installer-sidebar.bmp +0 -0
- package/build/installer-sidebar.png +0 -0
- package/build/installer.nsh +0 -45
- package/build/overlay-processing.png +0 -0
- package/build/overlay-recording.png +0 -0
- package/build/toolbar-record.png +0 -0
- package/build/toolbar-screenshot.png +0 -0
- package/build/toolbar-settings.png +0 -0
- package/build/toolbar-stop.png +0 -0
- package/dist/preload/index.mjs +0 -907
- package/dist/renderer/assets/index-CCmUjl9K.js +0 -19495
- package/dist/renderer/assets/index-CUqz_Gs6.css +0 -2270
- package/dist/renderer/index.html +0 -27
- package/docs/AI_AGENT_QUICKSTART.md +0 -42
- package/docs/AI_PIPELINE_DESIGN.md +0 -595
- package/docs/API.md +0 -514
- package/docs/ARCHITECTURE.md +0 -460
- package/docs/CONFIGURATION.md +0 -336
- package/docs/DEVELOPMENT.md +0 -508
- package/docs/EXPORT_FORMATS.md +0 -451
- package/docs/GETTING_STARTED.md +0 -236
- package/docs/KEYBOARD_SHORTCUTS.md +0 -334
- package/docs/TROUBLESHOOTING.md +0 -418
- package/docs/landing/index.html +0 -672
- package/docs/landing/script.js +0 -342
- package/docs/landing/styles.css +0 -1543
- package/electron-builder.yml +0 -140
- package/electron.vite.config.ts +0 -63
- package/railway.json +0 -12
- package/scripts/build.mjs +0 -51
- package/scripts/generate-icons.mjs +0 -314
- package/scripts/generate-installer-images.cjs +0 -253
- package/scripts/generate-tray-icons.mjs +0 -258
- package/scripts/notarize.cjs +0 -180
- package/scripts/one-click-clean-test.sh +0 -147
- package/scripts/postinstall.mjs +0 -36
- package/scripts/setup-markupr.sh +0 -55
- package/setup +0 -17
- package/site/index.html +0 -1835
- package/site/package.json +0 -11
- package/site/railway.json +0 -12
- package/site/server.js +0 -31
- package/src/main/AutoUpdater.ts +0 -392
- package/src/main/CrashRecovery.ts +0 -655
- package/src/main/ErrorHandler.ts +0 -703
- package/src/main/HotkeyManager.ts +0 -399
- package/src/main/MenuManager.ts +0 -529
- package/src/main/PermissionManager.ts +0 -420
- package/src/main/SessionController.ts +0 -1465
- package/src/main/TrayManager.ts +0 -540
- package/src/main/ai/AIPipelineManager.ts +0 -199
- package/src/main/ai/ClaudeAnalyzer.ts +0 -339
- package/src/main/ai/ImageOptimizer.ts +0 -176
- package/src/main/ai/StructuredMarkdownBuilder.ts +0 -379
- package/src/main/ai/index.ts +0 -16
- package/src/main/ai/types.ts +0 -258
- package/src/main/analysis/ClarificationGenerator.ts +0 -385
- package/src/main/analysis/FeedbackAnalyzer.ts +0 -531
- package/src/main/analysis/index.ts +0 -19
- package/src/main/audio/AudioCapture.ts +0 -978
- package/src/main/audio/audioUtils.ts +0 -100
- package/src/main/audio/index.ts +0 -20
- package/src/main/capture/index.ts +0 -1
- package/src/main/index.ts +0 -1693
- package/src/main/ipc/captureHandlers.ts +0 -272
- package/src/main/ipc/index.ts +0 -45
- package/src/main/ipc/outputHandlers.ts +0 -302
- package/src/main/ipc/sessionHandlers.ts +0 -56
- package/src/main/ipc/settingsHandlers.ts +0 -471
- package/src/main/ipc/types.ts +0 -56
- package/src/main/ipc/windowHandlers.ts +0 -277
- package/src/main/output/ClipboardService.ts +0 -369
- package/src/main/output/ExportService.ts +0 -539
- package/src/main/output/FileManager.ts +0 -416
- package/src/main/output/MarkdownGenerator.ts +0 -791
- package/src/main/output/MarkdownPatcher.ts +0 -299
- package/src/main/output/index.ts +0 -186
- package/src/main/output/sessionAdapter.ts +0 -207
- package/src/main/output/templates/html-template.ts +0 -553
- package/src/main/pipeline/FrameExtractor.ts +0 -330
- package/src/main/pipeline/PostProcessor.ts +0 -399
- package/src/main/pipeline/TranscriptAnalyzer.ts +0 -226
- package/src/main/pipeline/index.ts +0 -36
- package/src/main/platform/WindowsTaskbar.ts +0 -600
- package/src/main/platform/index.ts +0 -16
- package/src/main/settings/SettingsManager.ts +0 -730
- package/src/main/settings/index.ts +0 -19
- package/src/main/transcription/ModelDownloadManager.ts +0 -494
- package/src/main/transcription/TierManager.ts +0 -219
- package/src/main/transcription/TranscriptionRecoveryService.ts +0 -340
- package/src/main/transcription/WhisperService.ts +0 -748
- package/src/main/transcription/index.ts +0 -56
- package/src/main/transcription/types.ts +0 -135
- package/src/main/windows/PopoverManager.ts +0 -284
- package/src/main/windows/TaskbarIntegration.ts +0 -452
- package/src/main/windows/index.ts +0 -23
- package/src/preload/index.ts +0 -1047
- package/src/renderer/App.tsx +0 -515
- package/src/renderer/AppWrapper.tsx +0 -28
- package/src/renderer/assets/logo-dark.svg +0 -7
- package/src/renderer/assets/logo.svg +0 -7
- package/src/renderer/audio/AudioCaptureRenderer.ts +0 -454
- package/src/renderer/capture/ScreenRecordingRenderer.ts +0 -492
- package/src/renderer/components/AnnotationOverlay.tsx +0 -836
- package/src/renderer/components/AudioWaveform.tsx +0 -811
- package/src/renderer/components/ClarificationQuestions.tsx +0 -656
- package/src/renderer/components/CountdownTimer.tsx +0 -495
- package/src/renderer/components/CrashRecoveryDialog.tsx +0 -632
- package/src/renderer/components/DonateButton.tsx +0 -127
- package/src/renderer/components/ErrorBoundary.tsx +0 -308
- package/src/renderer/components/ExportDialog.tsx +0 -872
- package/src/renderer/components/HotkeyHint.tsx +0 -261
- package/src/renderer/components/KeyboardShortcuts.tsx +0 -787
- package/src/renderer/components/ModelDownloadDialog.tsx +0 -844
- package/src/renderer/components/Onboarding.tsx +0 -1830
- package/src/renderer/components/ProcessingOverlay.tsx +0 -157
- package/src/renderer/components/RecordingOverlay.tsx +0 -423
- package/src/renderer/components/SessionHistory.tsx +0 -1746
- package/src/renderer/components/SessionReview.tsx +0 -1321
- package/src/renderer/components/SettingsPanel.tsx +0 -217
- package/src/renderer/components/Skeleton.tsx +0 -347
- package/src/renderer/components/StatusIndicator.tsx +0 -86
- package/src/renderer/components/ThemeProvider.tsx +0 -429
- package/src/renderer/components/Tooltip.tsx +0 -370
- package/src/renderer/components/TranscriptionPreview.tsx +0 -183
- package/src/renderer/components/TranscriptionTierSelector.tsx +0 -640
- package/src/renderer/components/UpdateNotification.tsx +0 -377
- package/src/renderer/components/WindowSelector.tsx +0 -947
- package/src/renderer/components/index.ts +0 -99
- package/src/renderer/components/primitives/ApiKeyInput.tsx +0 -98
- package/src/renderer/components/primitives/ColorPicker.tsx +0 -65
- package/src/renderer/components/primitives/DangerButton.tsx +0 -45
- package/src/renderer/components/primitives/DirectoryPicker.tsx +0 -41
- package/src/renderer/components/primitives/Dropdown.tsx +0 -34
- package/src/renderer/components/primitives/KeyRecorder.tsx +0 -117
- package/src/renderer/components/primitives/SettingsSection.tsx +0 -32
- package/src/renderer/components/primitives/Slider.tsx +0 -43
- package/src/renderer/components/primitives/Toggle.tsx +0 -36
- package/src/renderer/components/primitives/index.ts +0 -10
- package/src/renderer/components/settings/AdvancedTab.tsx +0 -174
- package/src/renderer/components/settings/AppearanceTab.tsx +0 -77
- package/src/renderer/components/settings/GeneralTab.tsx +0 -40
- package/src/renderer/components/settings/HotkeysTab.tsx +0 -79
- package/src/renderer/components/settings/RecordingTab.tsx +0 -84
- package/src/renderer/components/settings/index.ts +0 -9
- package/src/renderer/components/settings/settingsStyles.ts +0 -673
- package/src/renderer/components/settings/tabConfig.tsx +0 -85
- package/src/renderer/components/settings/useSettingsPanel.ts +0 -447
- package/src/renderer/contexts/ProcessingContext.tsx +0 -227
- package/src/renderer/contexts/RecordingContext.tsx +0 -683
- package/src/renderer/contexts/UIContext.tsx +0 -326
- package/src/renderer/contexts/index.ts +0 -24
- package/src/renderer/donateMessages.ts +0 -69
- package/src/renderer/hooks/index.ts +0 -75
- package/src/renderer/hooks/useAnimation.tsx +0 -544
- package/src/renderer/hooks/useTheme.ts +0 -313
- package/src/renderer/index.html +0 -26
- package/src/renderer/main.tsx +0 -52
- package/src/renderer/styles/animations.css +0 -1093
- package/src/renderer/styles/app-shell.css +0 -662
- package/src/renderer/styles/globals.css +0 -515
- package/src/renderer/styles/theme.ts +0 -578
- package/src/renderer/types/electron.d.ts +0 -385
- package/src/shared/hotkeys.ts +0 -283
- package/src/shared/types.ts +0 -809
- package/tests/clipboard.test.ts +0 -228
- package/tests/e2e/criticalPaths.test.ts +0 -594
- package/tests/feedbackAnalyzer.test.ts +0 -303
- package/tests/integration/sessionFlow.test.ts +0 -583
- package/tests/markdownGenerator.test.ts +0 -418
- package/tests/output.test.ts +0 -96
- package/tests/setup.ts +0 -486
- package/tests/unit/appIntegration.test.ts +0 -676
- package/tests/unit/appViewState.test.ts +0 -281
- package/tests/unit/audioIpcChannels.test.ts +0 -17
- package/tests/unit/exportService.test.ts +0 -492
- package/tests/unit/hotkeys.test.ts +0 -92
- package/tests/unit/navigationPreload.test.ts +0 -94
- package/tests/unit/onboardingFlow.test.ts +0 -345
- package/tests/unit/permissionManager.test.ts +0 -175
- package/tests/unit/permissionManagerExpanded.test.ts +0 -296
- package/tests/unit/screenRecordingRenderer.test.ts +0 -368
- package/tests/unit/sessionController.test.ts +0 -515
- package/tests/unit/tierManager.test.ts +0 -61
- package/tests/unit/tierManagerExpanded.test.ts +0 -142
- package/tests/unit/transcriptAnalyzer.test.ts +0 -64
- package/tsconfig.json +0 -25
- package/vitest.config.ts +0 -46
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* markupr UI Components
|
|
3
|
-
*
|
|
4
|
-
* Re-exports all components for clean imports:
|
|
5
|
-
* import { RecordingOverlay, StatusIndicator, SessionReview, Onboarding, ErrorBoundary, AnnotationOverlay, AudioWaveform } from './components';
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export { RecordingOverlay } from './RecordingOverlay';
|
|
9
|
-
export { ProcessingOverlay } from './ProcessingOverlay';
|
|
10
|
-
export { CountdownTimer } from './CountdownTimer';
|
|
11
|
-
export { default as StatusIndicator } from './StatusIndicator';
|
|
12
|
-
export { SessionReview } from './SessionReview';
|
|
13
|
-
export { Onboarding } from './Onboarding';
|
|
14
|
-
export { ErrorBoundary, MinimalErrorBoundary } from './ErrorBoundary';
|
|
15
|
-
export { AnnotationOverlay } from './AnnotationOverlay';
|
|
16
|
-
export { AudioWaveform, CompactAudioIndicator, AudioLevelMeter } from './AudioWaveform';
|
|
17
|
-
export { WindowSelector } from './WindowSelector';
|
|
18
|
-
export { UpdateNotification } from './UpdateNotification';
|
|
19
|
-
export { CrashRecoveryDialog, useCrashRecovery } from './CrashRecoveryDialog';
|
|
20
|
-
export { ExportDialog } from './ExportDialog';
|
|
21
|
-
export { ClarificationQuestions } from './ClarificationQuestions';
|
|
22
|
-
|
|
23
|
-
// Theme components
|
|
24
|
-
export { ThemeProvider, ThemeToggle, AccentColorPicker } from './ThemeProvider';
|
|
25
|
-
|
|
26
|
-
// Animation components
|
|
27
|
-
export { default as Skeleton } from './Skeleton';
|
|
28
|
-
export {
|
|
29
|
-
SkeletonText,
|
|
30
|
-
SkeletonAvatar,
|
|
31
|
-
SkeletonThumbnail,
|
|
32
|
-
SkeletonButton,
|
|
33
|
-
SkeletonCard,
|
|
34
|
-
SkeletonListItem,
|
|
35
|
-
SkeletonFeedbackItem,
|
|
36
|
-
SkeletonWindowSource,
|
|
37
|
-
} from './Skeleton';
|
|
38
|
-
|
|
39
|
-
export { default as Tooltip } from './Tooltip';
|
|
40
|
-
export { Tooltip as TooltipComponent, HotkeyTooltip, StatusTooltip } from './Tooltip';
|
|
41
|
-
|
|
42
|
-
// Keyboard shortcuts panel
|
|
43
|
-
export { KeyboardShortcuts, default as KeyboardShortcutsPanel } from './KeyboardShortcuts';
|
|
44
|
-
|
|
45
|
-
// Hotkey hint component (platform-aware)
|
|
46
|
-
export { HotkeyHint, ToggleRecordingHint, ManualScreenshotHint, getHotkeyText } from './HotkeyHint';
|
|
47
|
-
|
|
48
|
-
// Transcription tier selector
|
|
49
|
-
export { TranscriptionTierSelector, type TranscriptionTier } from './TranscriptionTierSelector';
|
|
50
|
-
|
|
51
|
-
// Settings panel
|
|
52
|
-
export { SettingsPanel, default as SettingsPanelDefault } from './SettingsPanel';
|
|
53
|
-
|
|
54
|
-
// Donate button
|
|
55
|
-
export { DonateButton, default as DonateButtonDefault } from './DonateButton';
|
|
56
|
-
|
|
57
|
-
// Session history
|
|
58
|
-
export { SessionHistory } from './SessionHistory';
|
|
59
|
-
|
|
60
|
-
// Transcription preview (post-processing results viewer)
|
|
61
|
-
export { TranscriptionPreview, TranscriptionPreviewAnimated } from './TranscriptionPreview';
|
|
62
|
-
export type { TranscriptSegment, TranscriptionPreviewProps } from './TranscriptionPreview';
|
|
63
|
-
|
|
64
|
-
// Model download dialog
|
|
65
|
-
export { ModelDownloadDialog, useModelCheck } from './ModelDownloadDialog';
|
|
66
|
-
|
|
67
|
-
// Type exports for external use
|
|
68
|
-
export type { default as RecordingOverlayType } from './RecordingOverlay';
|
|
69
|
-
export type { SessionReviewProps } from './SessionReview';
|
|
70
|
-
export type { AudioWaveformProps } from './AudioWaveform';
|
|
71
|
-
export type { TooltipProps, TooltipPlacement, TooltipStatus } from './Tooltip';
|
|
72
|
-
export type {
|
|
73
|
-
CrashRecoveryDialogProps,
|
|
74
|
-
RecoverableSession,
|
|
75
|
-
RecoverableFeedbackItem,
|
|
76
|
-
UseCrashRecoveryReturn,
|
|
77
|
-
} from './CrashRecoveryDialog';
|
|
78
|
-
export type {
|
|
79
|
-
KeyboardShortcutsProps,
|
|
80
|
-
Shortcut,
|
|
81
|
-
ShortcutCategory,
|
|
82
|
-
} from './KeyboardShortcuts';
|
|
83
|
-
export type {
|
|
84
|
-
ExportDialogProps,
|
|
85
|
-
ExportOptions as ExportDialogOptions,
|
|
86
|
-
ExportFormat as DialogExportFormat,
|
|
87
|
-
} from './ExportDialog';
|
|
88
|
-
export type { CountdownTimerProps } from './CountdownTimer';
|
|
89
|
-
export type {
|
|
90
|
-
ThemeProviderProps,
|
|
91
|
-
ThemeToggleProps,
|
|
92
|
-
AccentColorPickerProps,
|
|
93
|
-
} from './ThemeProvider';
|
|
94
|
-
export type {
|
|
95
|
-
ClarificationQuestionsProps,
|
|
96
|
-
ClarificationQuestion,
|
|
97
|
-
ClarificationType,
|
|
98
|
-
} from './ClarificationQuestions';
|
|
99
|
-
export type { DonateButtonProps } from './DonateButton';
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useTheme } from '../../hooks/useTheme';
|
|
3
|
-
import { styles } from '../settings/settingsStyles';
|
|
4
|
-
|
|
5
|
-
export interface ApiKeyState {
|
|
6
|
-
value: string;
|
|
7
|
-
visible: boolean;
|
|
8
|
-
testing: boolean;
|
|
9
|
-
valid: boolean | null;
|
|
10
|
-
error: string | null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const ApiKeyInput: React.FC<{
|
|
14
|
-
label: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
serviceName: string;
|
|
17
|
-
apiKey: ApiKeyState;
|
|
18
|
-
onApiKeyChange: (value: string) => void;
|
|
19
|
-
onToggleVisibility: () => void;
|
|
20
|
-
onTest: () => void;
|
|
21
|
-
}> = ({ label, description, serviceName, apiKey, onApiKeyChange, onToggleVisibility, onTest }) => {
|
|
22
|
-
const { colors } = useTheme();
|
|
23
|
-
return (
|
|
24
|
-
<div style={styles.settingRowVertical}>
|
|
25
|
-
<div style={styles.settingInfo}>
|
|
26
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
27
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
28
|
-
</div>
|
|
29
|
-
<div style={styles.apiKeyContainer}>
|
|
30
|
-
<div style={styles.apiKeyInputWrapper}>
|
|
31
|
-
<input
|
|
32
|
-
type={apiKey.visible ? 'text' : 'password'}
|
|
33
|
-
value={apiKey.value}
|
|
34
|
-
onChange={(e) => onApiKeyChange(e.target.value)}
|
|
35
|
-
placeholder={`Enter your ${serviceName} API key`}
|
|
36
|
-
style={{
|
|
37
|
-
...styles.apiKeyInput,
|
|
38
|
-
borderColor: apiKey.error ? colors.status.error : apiKey.valid ? colors.status.success : colors.border.default,
|
|
39
|
-
}}
|
|
40
|
-
/>
|
|
41
|
-
<button style={styles.apiKeyVisibilityButton} onClick={onToggleVisibility} title={apiKey.visible ? 'Hide' : 'Show'}>
|
|
42
|
-
{apiKey.visible ? (
|
|
43
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
44
|
-
<path
|
|
45
|
-
d="M2.636 9.364S4.91 5.182 9 5.182s6.364 4.182 6.364 4.182-2.273 4.182-6.364 4.182-6.364-4.182-6.364-4.182z"
|
|
46
|
-
stroke="currentColor"
|
|
47
|
-
strokeWidth="1.5"
|
|
48
|
-
strokeLinecap="round"
|
|
49
|
-
/>
|
|
50
|
-
<circle cx="9" cy="9" r="2" stroke="currentColor" strokeWidth="1.5" />
|
|
51
|
-
</svg>
|
|
52
|
-
) : (
|
|
53
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
54
|
-
<path
|
|
55
|
-
d="M2 2l14 14M7.455 7.455a2 2 0 002.828 2.828M14.182 10.727c.6-.527.975-.961 1.182-1.363-1.636-3.273-4.364-5.182-6.364-5.182-.545 0-1.09.127-1.636.382M3.818 5.273C2.818 6.073 2.273 6.909 2 7.636c1.636 3.273 4.364 5.182 6.364 5.182.818 0 1.636-.255 2.454-.727"
|
|
56
|
-
stroke="currentColor"
|
|
57
|
-
strokeWidth="1.5"
|
|
58
|
-
strokeLinecap="round"
|
|
59
|
-
/>
|
|
60
|
-
</svg>
|
|
61
|
-
)}
|
|
62
|
-
</button>
|
|
63
|
-
</div>
|
|
64
|
-
<button
|
|
65
|
-
style={{
|
|
66
|
-
...styles.apiKeyTestButton,
|
|
67
|
-
backgroundColor: apiKey.testing ? colors.bg.tertiary : apiKey.valid ? colors.status.success : colors.accent.default,
|
|
68
|
-
cursor: !apiKey.value ? 'not-allowed' : 'pointer',
|
|
69
|
-
opacity: !apiKey.value ? 0.5 : 1,
|
|
70
|
-
}}
|
|
71
|
-
onClick={onTest}
|
|
72
|
-
disabled={!apiKey.value}
|
|
73
|
-
>
|
|
74
|
-
{apiKey.testing ? (
|
|
75
|
-
<span style={styles.spinner} />
|
|
76
|
-
) : apiKey.valid ? (
|
|
77
|
-
<>
|
|
78
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
79
|
-
<path
|
|
80
|
-
d="M7 2.25a4.75 4.75 0 104.39 2.92"
|
|
81
|
-
stroke="currentColor"
|
|
82
|
-
strokeWidth="1.4"
|
|
83
|
-
strokeLinecap="round"
|
|
84
|
-
/>
|
|
85
|
-
<path d="M10.7 2.3h1.2v1.2" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />
|
|
86
|
-
</svg>
|
|
87
|
-
Retest
|
|
88
|
-
</>
|
|
89
|
-
) : (
|
|
90
|
-
'Test Connection'
|
|
91
|
-
)}
|
|
92
|
-
</button>
|
|
93
|
-
</div>
|
|
94
|
-
{apiKey.error && <span style={styles.apiKeyError}>{apiKey.error}</span>}
|
|
95
|
-
{apiKey.valid && <span style={styles.apiKeySuccess}>API key verified and saved securely.</span>}
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { accentColors } from '../../styles/theme';
|
|
3
|
-
import { useTheme } from '../../hooks/useTheme';
|
|
4
|
-
import { styles } from '../settings/settingsStyles';
|
|
5
|
-
|
|
6
|
-
export const ACCENT_COLORS = [
|
|
7
|
-
{ name: accentColors.blue.name, value: accentColors.blue.default },
|
|
8
|
-
{ name: accentColors.violet.name, value: accentColors.violet.default },
|
|
9
|
-
{ name: accentColors.pink.name, value: accentColors.pink.default },
|
|
10
|
-
{ name: accentColors.red.name, value: accentColors.red.default },
|
|
11
|
-
{ name: accentColors.orange.name, value: accentColors.orange.default },
|
|
12
|
-
{ name: accentColors.amber.name, value: accentColors.amber.default },
|
|
13
|
-
{ name: accentColors.emerald.name, value: accentColors.emerald.default },
|
|
14
|
-
{ name: accentColors.teal.name, value: accentColors.teal.default },
|
|
15
|
-
{ name: accentColors.cyan.name, value: accentColors.cyan.default },
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export const ColorPicker: React.FC<{
|
|
19
|
-
label: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
value: string;
|
|
22
|
-
onChange: (value: string) => void;
|
|
23
|
-
}> = ({ label, description, value, onChange }) => {
|
|
24
|
-
const [customColor, setCustomColor] = useState(value);
|
|
25
|
-
const { colors } = useTheme();
|
|
26
|
-
|
|
27
|
-
const isPreset = ACCENT_COLORS.some((c) => c.value === value);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div style={styles.settingRowVertical}>
|
|
31
|
-
<div style={styles.settingInfo}>
|
|
32
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
33
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
34
|
-
</div>
|
|
35
|
-
<div style={styles.colorPickerContainer}>
|
|
36
|
-
{ACCENT_COLORS.map((color) => (
|
|
37
|
-
<button
|
|
38
|
-
key={color.value}
|
|
39
|
-
style={{
|
|
40
|
-
...styles.colorSwatch,
|
|
41
|
-
backgroundColor: color.value,
|
|
42
|
-
boxShadow: value === color.value ? `0 0 0 2px ${colors.bg.primary}, 0 0 0 4px ${color.value}` : 'none',
|
|
43
|
-
}}
|
|
44
|
-
onClick={() => onChange(color.value)}
|
|
45
|
-
title={color.name}
|
|
46
|
-
aria-label={`Select ${color.name} accent color`}
|
|
47
|
-
/>
|
|
48
|
-
))}
|
|
49
|
-
<div style={styles.customColorContainer}>
|
|
50
|
-
<input
|
|
51
|
-
type="color"
|
|
52
|
-
value={isPreset ? customColor : value}
|
|
53
|
-
onChange={(e) => {
|
|
54
|
-
setCustomColor(e.target.value);
|
|
55
|
-
onChange(e.target.value);
|
|
56
|
-
}}
|
|
57
|
-
style={styles.customColorInput}
|
|
58
|
-
title="Custom color"
|
|
59
|
-
/>
|
|
60
|
-
<span style={styles.customColorLabel}>Custom</span>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import { useTheme } from '../../hooks/useTheme';
|
|
3
|
-
import { styles } from '../settings/settingsStyles';
|
|
4
|
-
|
|
5
|
-
export const DangerButton: React.FC<{
|
|
6
|
-
label: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
buttonText: string;
|
|
9
|
-
onConfirm: () => void;
|
|
10
|
-
confirmText?: string;
|
|
11
|
-
}> = ({ label, description, buttonText, onConfirm, confirmText }) => {
|
|
12
|
-
const [confirming, setConfirming] = useState(false);
|
|
13
|
-
const { colors } = useTheme();
|
|
14
|
-
|
|
15
|
-
const handleClick = useCallback(() => {
|
|
16
|
-
if (confirming) {
|
|
17
|
-
onConfirm();
|
|
18
|
-
setConfirming(false);
|
|
19
|
-
} else {
|
|
20
|
-
setConfirming(true);
|
|
21
|
-
// Auto-reset after 3 seconds
|
|
22
|
-
setTimeout(() => setConfirming(false), 3000);
|
|
23
|
-
}
|
|
24
|
-
}, [confirming, onConfirm]);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div style={styles.settingRow}>
|
|
28
|
-
<div style={styles.settingInfo}>
|
|
29
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
30
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
31
|
-
</div>
|
|
32
|
-
<button
|
|
33
|
-
style={{
|
|
34
|
-
...styles.dangerButton,
|
|
35
|
-
backgroundColor: confirming ? colors.status.error : colors.status.errorSubtle,
|
|
36
|
-
color: confirming ? colors.text.inverse : colors.status.error,
|
|
37
|
-
borderColor: confirming ? colors.status.error : colors.status.errorSubtle,
|
|
38
|
-
}}
|
|
39
|
-
onClick={handleClick}
|
|
40
|
-
>
|
|
41
|
-
{confirming ? confirmText || 'Click again to confirm' : buttonText}
|
|
42
|
-
</button>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import { styles } from '../settings/settingsStyles';
|
|
3
|
-
|
|
4
|
-
export const DirectoryPicker: React.FC<{
|
|
5
|
-
label: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
value: string;
|
|
8
|
-
onChange: (value: string) => void;
|
|
9
|
-
}> = ({ label, description, value, onChange }) => {
|
|
10
|
-
const handleBrowse = useCallback(async () => {
|
|
11
|
-
try {
|
|
12
|
-
const result = await window.markupr.settings.selectDirectory();
|
|
13
|
-
if (result) {
|
|
14
|
-
onChange(result);
|
|
15
|
-
}
|
|
16
|
-
} catch {
|
|
17
|
-
// User cancelled or error
|
|
18
|
-
}
|
|
19
|
-
}, [onChange]);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div style={styles.settingRow}>
|
|
23
|
-
<div style={styles.settingInfo}>
|
|
24
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
25
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
26
|
-
</div>
|
|
27
|
-
<div style={styles.directoryPicker}>
|
|
28
|
-
<input
|
|
29
|
-
type="text"
|
|
30
|
-
value={value}
|
|
31
|
-
readOnly
|
|
32
|
-
style={styles.directoryInput}
|
|
33
|
-
placeholder="Select output directory..."
|
|
34
|
-
/>
|
|
35
|
-
<button style={styles.browseButton} onClick={handleBrowse}>
|
|
36
|
-
Browse...
|
|
37
|
-
</button>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { styles } from '../settings/settingsStyles';
|
|
3
|
-
|
|
4
|
-
export const DropdownSetting: React.FC<{
|
|
5
|
-
label: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
value: string | number;
|
|
8
|
-
options: { value: string | number; label: string }[];
|
|
9
|
-
onChange: (value: string | number) => void;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}> = ({ label, description, value, options, onChange, disabled }) => (
|
|
12
|
-
<div style={styles.settingRow}>
|
|
13
|
-
<div style={styles.settingInfo}>
|
|
14
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
15
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
16
|
-
</div>
|
|
17
|
-
<select
|
|
18
|
-
style={{
|
|
19
|
-
...styles.select,
|
|
20
|
-
opacity: disabled ? 0.5 : 1,
|
|
21
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
22
|
-
}}
|
|
23
|
-
value={value}
|
|
24
|
-
onChange={(e) => onChange(e.target.value)}
|
|
25
|
-
disabled={disabled}
|
|
26
|
-
>
|
|
27
|
-
{options.map((opt) => (
|
|
28
|
-
<option key={opt.value} value={opt.value}>
|
|
29
|
-
{opt.label}
|
|
30
|
-
</option>
|
|
31
|
-
))}
|
|
32
|
-
</select>
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
|
-
import { useTheme } from '../../hooks/useTheme';
|
|
3
|
-
import { styles } from '../settings/settingsStyles';
|
|
4
|
-
|
|
5
|
-
export const KeyRecorder: React.FC<{
|
|
6
|
-
label: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
value: string;
|
|
9
|
-
onChange: (value: string) => void;
|
|
10
|
-
conflict?: string | null;
|
|
11
|
-
}> = ({ label, description, value, onChange, conflict }) => {
|
|
12
|
-
const [recording, setRecording] = useState(false);
|
|
13
|
-
const { colors } = useTheme();
|
|
14
|
-
const inputRef = useRef<HTMLButtonElement>(null);
|
|
15
|
-
const isMac = typeof navigator !== 'undefined' && navigator.platform.toLowerCase().includes('mac');
|
|
16
|
-
|
|
17
|
-
const formatHotkey = useCallback((hotkey: string): string => {
|
|
18
|
-
return hotkey
|
|
19
|
-
.replace('CommandOrControl', isMac ? 'Cmd' : 'Ctrl')
|
|
20
|
-
.replace('Command', 'Cmd')
|
|
21
|
-
.replace('Control', 'Ctrl')
|
|
22
|
-
.replace('Alt', isMac ? 'Option' : 'Alt')
|
|
23
|
-
.replace('Shift', 'Shift')
|
|
24
|
-
.replace(/\+/g, ' + ');
|
|
25
|
-
}, [isMac]);
|
|
26
|
-
|
|
27
|
-
const handleKeyDown = useCallback(
|
|
28
|
-
(e: KeyboardEvent) => {
|
|
29
|
-
if (!recording) return;
|
|
30
|
-
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
|
|
34
|
-
const modifiers: string[] = [];
|
|
35
|
-
if (e.metaKey || e.ctrlKey) modifiers.push('CommandOrControl');
|
|
36
|
-
if (e.altKey) modifiers.push('Alt');
|
|
37
|
-
if (e.shiftKey) modifiers.push('Shift');
|
|
38
|
-
|
|
39
|
-
// Ignore modifier-only keys
|
|
40
|
-
const key = e.key;
|
|
41
|
-
if (['Meta', 'Control', 'Alt', 'Shift'].includes(key)) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Build hotkey string
|
|
46
|
-
const hotkeyKey = key.length === 1 ? key.toUpperCase() : key;
|
|
47
|
-
const hotkey = [...modifiers, hotkeyKey].join('+');
|
|
48
|
-
|
|
49
|
-
onChange(hotkey);
|
|
50
|
-
setRecording(false);
|
|
51
|
-
},
|
|
52
|
-
[recording, onChange]
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (recording) {
|
|
57
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
58
|
-
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
59
|
-
}
|
|
60
|
-
}, [recording, handleKeyDown]);
|
|
61
|
-
|
|
62
|
-
// Cancel recording on click outside
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (!recording) return;
|
|
65
|
-
|
|
66
|
-
const handleClickOutside = (e: MouseEvent) => {
|
|
67
|
-
if (inputRef.current && !inputRef.current.contains(e.target as Node)) {
|
|
68
|
-
setRecording(false);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
73
|
-
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
74
|
-
}, [recording]);
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<div style={styles.settingRow}>
|
|
78
|
-
<div style={styles.settingInfo}>
|
|
79
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
80
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
81
|
-
{conflict && (
|
|
82
|
-
<span style={styles.conflictWarning}>
|
|
83
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
84
|
-
<path
|
|
85
|
-
d="M7 4.5v3M7 9.5h.005"
|
|
86
|
-
stroke={colors.status.warning}
|
|
87
|
-
strokeWidth="1.5"
|
|
88
|
-
strokeLinecap="round"
|
|
89
|
-
/>
|
|
90
|
-
<path
|
|
91
|
-
d="M6.134 1.944L1.06 10.5a1 1 0 00.866 1.5h10.148a1 1 0 00.866-1.5L7.866 1.944a1 1 0 00-1.732 0z"
|
|
92
|
-
stroke={colors.status.warning}
|
|
93
|
-
strokeWidth="1.5"
|
|
94
|
-
/>
|
|
95
|
-
</svg>
|
|
96
|
-
Conflicts with: {conflict}
|
|
97
|
-
</span>
|
|
98
|
-
)}
|
|
99
|
-
</div>
|
|
100
|
-
<button
|
|
101
|
-
ref={inputRef}
|
|
102
|
-
style={{
|
|
103
|
-
...styles.keyRecorder,
|
|
104
|
-
borderColor: recording ? colors.accent.default : conflict ? colors.status.warning : colors.border.default,
|
|
105
|
-
backgroundColor: recording ? colors.accent.subtle : colors.surface.inset,
|
|
106
|
-
}}
|
|
107
|
-
onClick={() => setRecording(true)}
|
|
108
|
-
>
|
|
109
|
-
{recording ? (
|
|
110
|
-
<span style={styles.keyRecorderRecording}>Press keys...</span>
|
|
111
|
-
) : (
|
|
112
|
-
<span style={styles.keyRecorderValue}>{formatHotkey(value)}</span>
|
|
113
|
-
)}
|
|
114
|
-
</button>
|
|
115
|
-
</div>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { styles } from '../settings/settingsStyles';
|
|
3
|
-
|
|
4
|
-
export const SettingsSection: React.FC<{
|
|
5
|
-
title: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
onReset?: () => void;
|
|
9
|
-
}> = ({ title, description, children, onReset }) => (
|
|
10
|
-
<div style={styles.section}>
|
|
11
|
-
<div style={styles.sectionHeader}>
|
|
12
|
-
<div>
|
|
13
|
-
<h3 style={styles.sectionTitle}>{title}</h3>
|
|
14
|
-
{description && <p style={styles.sectionDescription}>{description}</p>}
|
|
15
|
-
</div>
|
|
16
|
-
{onReset && (
|
|
17
|
-
<button style={styles.resetSectionButton} onClick={onReset} title="Reset section to defaults">
|
|
18
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
19
|
-
<path
|
|
20
|
-
d="M1.75 7a5.25 5.25 0 109.006-3.668M7 3.5V1.75L9.625 4.375 7 7"
|
|
21
|
-
stroke="currentColor"
|
|
22
|
-
strokeWidth="1.25"
|
|
23
|
-
strokeLinecap="round"
|
|
24
|
-
strokeLinejoin="round"
|
|
25
|
-
/>
|
|
26
|
-
</svg>
|
|
27
|
-
</button>
|
|
28
|
-
)}
|
|
29
|
-
</div>
|
|
30
|
-
<div style={styles.sectionContent}>{children}</div>
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { styles } from '../settings/settingsStyles';
|
|
3
|
-
|
|
4
|
-
export const SliderSetting: React.FC<{
|
|
5
|
-
label: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
value: number;
|
|
8
|
-
min: number;
|
|
9
|
-
max: number;
|
|
10
|
-
step: number;
|
|
11
|
-
unit?: string;
|
|
12
|
-
onChange: (value: number) => void;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
formatValue?: (value: number) => string;
|
|
15
|
-
}> = ({ label, description, value, min, max, step, unit = '', onChange, disabled, formatValue }) => {
|
|
16
|
-
const displayValue = formatValue ? formatValue(value) : `${value}${unit}`;
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div style={styles.settingRow}>
|
|
20
|
-
<div style={styles.settingInfo}>
|
|
21
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
22
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
23
|
-
</div>
|
|
24
|
-
<div style={styles.sliderContainer}>
|
|
25
|
-
<span style={styles.sliderValue}>{displayValue}</span>
|
|
26
|
-
<input
|
|
27
|
-
type="range"
|
|
28
|
-
min={min}
|
|
29
|
-
max={max}
|
|
30
|
-
step={step}
|
|
31
|
-
value={value}
|
|
32
|
-
onChange={(e) => onChange(Number(e.target.value))}
|
|
33
|
-
disabled={disabled}
|
|
34
|
-
style={{
|
|
35
|
-
...styles.slider,
|
|
36
|
-
opacity: disabled ? 0.5 : 1,
|
|
37
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
38
|
-
}}
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { styles } from '../settings/settingsStyles';
|
|
3
|
-
|
|
4
|
-
export const ToggleSetting: React.FC<{
|
|
5
|
-
label: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
value: boolean;
|
|
8
|
-
onChange: (value: boolean) => void;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}> = ({ label, description, value, onChange, disabled }) => (
|
|
11
|
-
<div style={styles.settingRow}>
|
|
12
|
-
<div style={styles.settingInfo}>
|
|
13
|
-
<span style={styles.settingLabel}>{label}</span>
|
|
14
|
-
{description && <span style={styles.settingDescription}>{description}</span>}
|
|
15
|
-
</div>
|
|
16
|
-
<button
|
|
17
|
-
style={{
|
|
18
|
-
...styles.toggle,
|
|
19
|
-
backgroundColor: value ? 'var(--accent-default)' : 'var(--bg-tertiary)',
|
|
20
|
-
opacity: disabled ? 0.5 : 1,
|
|
21
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
22
|
-
}}
|
|
23
|
-
onClick={() => !disabled && onChange(!value)}
|
|
24
|
-
disabled={disabled}
|
|
25
|
-
role="switch"
|
|
26
|
-
aria-checked={value}
|
|
27
|
-
>
|
|
28
|
-
<span
|
|
29
|
-
style={{
|
|
30
|
-
...styles.toggleKnob,
|
|
31
|
-
transform: value ? 'translateX(18px)' : 'translateX(2px)',
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
</button>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { SettingsSection } from './SettingsSection';
|
|
2
|
-
export { ToggleSetting } from './Toggle';
|
|
3
|
-
export { SliderSetting } from './Slider';
|
|
4
|
-
export { DropdownSetting } from './Dropdown';
|
|
5
|
-
export { DirectoryPicker } from './DirectoryPicker';
|
|
6
|
-
export { ColorPicker, ACCENT_COLORS } from './ColorPicker';
|
|
7
|
-
export { KeyRecorder } from './KeyRecorder';
|
|
8
|
-
export { ApiKeyInput } from './ApiKeyInput';
|
|
9
|
-
export type { ApiKeyState } from './ApiKeyInput';
|
|
10
|
-
export { DangerButton } from './DangerButton';
|