@crievo/omni 0.0.0-stage → 0.1.1
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/.env.example +41 -0
- package/README.md +2 -2
- package/bin/omni.mjs +18 -0
- package/docs/onboarding/clone-voice.png +0 -0
- package/docs/onboarding/getting-started.png +0 -0
- package/docs/onboarding/new-video.png +0 -0
- package/docs/onboarding/providers.png +0 -0
- package/docs/onboarding/publish.png +0 -0
- package/docs/onboarding/references.png +0 -0
- package/docs/onboarding.md +212 -0
- package/omnivideo.config.example.json +437 -0
- package/package.json +40 -4
- package/reference/captions.md +156 -0
- package/reference/carousel-contract.md +91 -0
- package/reference/cloud.md +96 -0
- package/reference/learnings.md +792 -0
- package/reference/omnichat.md +305 -0
- package/reference/premiere-mcp.md +91 -0
- package/reference/publish.md +305 -0
- package/reference/scenes-contract.md +109 -0
- package/reference/studio.md +666 -0
- package/reference/voicestudio.md +81 -0
- package/reference/writing-for-voice.md +67 -0
- package/requirements.txt +3 -0
- package/studio/api/app.ts +87 -0
- package/studio/api/lib/errors.ts +33 -0
- package/studio/api/lib/files.ts +41 -0
- package/studio/api/lib/hono.ts +9 -0
- package/studio/api/lib/result.ts +14 -0
- package/studio/api/lib/validate.ts +31 -0
- package/studio/api/lib/video.ts +10 -0
- package/studio/api/middleware/json-charset.ts +11 -0
- package/studio/api/middleware/local-only.ts +32 -0
- package/studio/api/middleware/no-timeout.ts +10 -0
- package/studio/api/routes/admin.ts +18 -0
- package/studio/api/routes/agent-cascade.ts +100 -0
- package/studio/api/routes/agent-history.ts +23 -0
- package/studio/api/routes/agent.ts +162 -0
- package/studio/api/routes/analytics.ts +31 -0
- package/studio/api/routes/approval.ts +60 -0
- package/studio/api/routes/archive.ts +12 -0
- package/studio/api/routes/captions.ts +28 -0
- package/studio/api/routes/carousel.ts +38 -0
- package/studio/api/routes/clone.ts +27 -0
- package/studio/api/routes/create.ts +19 -0
- package/studio/api/routes/events.ts +11 -0
- package/studio/api/routes/export.ts +14 -0
- package/studio/api/routes/media.ts +30 -0
- package/studio/api/routes/omnichat.ts +113 -0
- package/studio/api/routes/onboarding.ts +14 -0
- package/studio/api/routes/publish.ts +40 -0
- package/studio/api/routes/queue.ts +14 -0
- package/studio/api/routes/references.ts +40 -0
- package/studio/api/routes/runner.ts +17 -0
- package/studio/api/routes/schedule.ts +47 -0
- package/studio/api/routes/services.ts +11 -0
- package/studio/api/routes/sessions.ts +27 -0
- package/studio/api/routes/settings.ts +102 -0
- package/studio/api/routes/sound.ts +45 -0
- package/studio/api/routes/thumbnail.ts +18 -0
- package/studio/api/routes/usage.ts +13 -0
- package/studio/api/routes/videos.ts +41 -0
- package/studio/api/routes/voices.ts +71 -0
- package/studio/api/services/admin.ts +113 -0
- package/studio/api/services/agent-cascade.ts +975 -0
- package/studio/api/services/agent-claude.ts +47 -0
- package/studio/api/services/agent-history.ts +103 -0
- package/studio/api/services/agent-persona.ts +77 -0
- package/studio/api/services/agent-tools.ts +2237 -0
- package/studio/api/services/agent-ui-tools.ts +259 -0
- package/studio/api/services/agent-wait.ts +32 -0
- package/studio/api/services/agent.ts +553 -0
- package/studio/api/services/analytics.ts +92 -0
- package/studio/api/services/approval.ts +134 -0
- package/studio/api/services/archive.ts +38 -0
- package/studio/api/services/captions.ts +268 -0
- package/studio/api/services/carousel.ts +206 -0
- package/studio/api/services/classify.ts +196 -0
- package/studio/api/services/clone-phrases.ts +75 -0
- package/studio/api/services/clone.ts +722 -0
- package/studio/api/services/create.ts +421 -0
- package/studio/api/services/events.ts +215 -0
- package/studio/api/services/media.ts +32 -0
- package/studio/api/services/omnichat.ts +624 -0
- package/studio/api/services/onboarding.ts +77 -0
- package/studio/api/services/publish.ts +287 -0
- package/studio/api/services/queue.ts +150 -0
- package/studio/api/services/references.ts +269 -0
- package/studio/api/services/root.ts +60 -0
- package/studio/api/services/services.ts +114 -0
- package/studio/api/services/sessions.ts +1007 -0
- package/studio/api/services/settings.ts +983 -0
- package/studio/api/services/sound.ts +311 -0
- package/studio/api/services/thumbnail.ts +133 -0
- package/studio/api/services/usage.ts +27 -0
- package/studio/api/services/videos.ts +418 -0
- package/studio/api/services/voice-pause.ts +98 -0
- package/studio/api/services/voices.ts +324 -0
- package/studio/runner/runner.ts +244 -0
- package/studio/shared/omni-actions.ts +68 -0
- package/studio/shared/omni-admin.ts +52 -0
- package/studio/shared/omni-farewell.ts +48 -0
- package/studio/shared/omni-hotword.ts +20 -0
- package/studio/shared/omni-screens.ts +228 -0
- package/studio/shared/schemas/admin.ts +15 -0
- package/studio/shared/schemas/agent-cascade.ts +58 -0
- package/studio/shared/schemas/agent-history.ts +73 -0
- package/studio/shared/schemas/agent.ts +50 -0
- package/studio/shared/schemas/analytics.ts +6 -0
- package/studio/shared/schemas/approval.ts +22 -0
- package/studio/shared/schemas/captions.ts +19 -0
- package/studio/shared/schemas/carousel.ts +26 -0
- package/studio/shared/schemas/clone.ts +40 -0
- package/studio/shared/schemas/common.ts +16 -0
- package/studio/shared/schemas/omnichat.ts +54 -0
- package/studio/shared/schemas/onboarding.ts +5 -0
- package/studio/shared/schemas/publish.ts +45 -0
- package/studio/shared/schemas/references.ts +20 -0
- package/studio/shared/schemas/settings.ts +82 -0
- package/studio/shared/schemas/sound.ts +22 -0
- package/studio/shared/schemas/videos.ts +38 -0
- package/studio/shared/schemas/voices.ts +23 -0
- package/studio/shared/types/api.ts +1290 -0
- package/studio/studio.ts +148 -0
- package/studio/tsconfig.json +15 -0
- package/studio/web/assets/logos/cartesia.svg +4 -0
- package/studio/web/assets/logos/elevenlabs.svg +12 -0
- package/studio/web/assets/logos/fish.svg +24 -0
- package/studio/web/assets/logos/omni-black.png +0 -0
- package/studio/web/assets/logos/omni-white.png +0 -0
- package/studio/web/assets/logos/voicestudio.svg +21 -0
- package/studio/web/components/AgentMark.tsx +7 -0
- package/studio/web/components/AgentWalking.tsx +11 -0
- package/studio/web/components/ApiKeyField.tsx +104 -0
- package/studio/web/components/AppShell.tsx +64 -0
- package/studio/web/components/ApprovalNotice.tsx +65 -0
- package/studio/web/components/AvatarGroupIcon.tsx +22 -0
- package/studio/web/components/AvatarNameField.tsx +86 -0
- package/studio/web/components/AvatarPicker.tsx +84 -0
- package/studio/web/components/BrandLogo.tsx +16 -0
- package/studio/web/components/CartesiaPlanSetting.tsx +90 -0
- package/studio/web/components/ClaudeWalking.tsx +32 -0
- package/studio/web/components/CloneVoiceDialog/GuidedScript.tsx +39 -0
- package/studio/web/components/CloneVoiceDialog/LanguageBar.tsx +37 -0
- package/studio/web/components/CloneVoiceDialog/LevelMeter.tsx +31 -0
- package/studio/web/components/CloneVoiceDialog/ProviderChoice.tsx +81 -0
- package/studio/web/components/CloneVoiceDialog/QualityPanel.tsx +62 -0
- package/studio/web/components/CloneVoiceDialog/RecordStep.tsx +50 -0
- package/studio/web/components/CloneVoiceDialog/RecorderBar.tsx +79 -0
- package/studio/web/components/CloneVoiceDialog/RedoSummary.tsx +54 -0
- package/studio/web/components/CloneVoiceDialog/SaveStep.tsx +91 -0
- package/studio/web/components/CloneVoiceDialog/SourceBar.tsx +30 -0
- package/studio/web/components/CloneVoiceDialog/index.tsx +141 -0
- package/studio/web/components/CloneVoiceDialog/types.ts +28 -0
- package/studio/web/components/CloneVoiceDialog/useCloneVoice.ts +528 -0
- package/studio/web/components/ConnectionSignals.tsx +51 -0
- package/studio/web/components/EditVoiceDialog/EditVoiceFooter.tsx +72 -0
- package/studio/web/components/EditVoiceDialog/ProviderCards.tsx +81 -0
- package/studio/web/components/EditVoiceDialog/index.tsx +256 -0
- package/studio/web/components/ErrorBanner.tsx +115 -0
- package/studio/web/components/FinishedTask.tsx +41 -0
- package/studio/web/components/FishModelSetting.tsx +69 -0
- package/studio/web/components/FishPriceSetting.tsx +44 -0
- package/studio/web/components/HumanBanner.tsx +64 -0
- package/studio/web/components/Lightbox.tsx +41 -0
- package/studio/web/components/LogStream.tsx +42 -0
- package/studio/web/components/Markdown.tsx +21 -0
- package/studio/web/components/MissingDmsPanel/BatchSend.tsx +137 -0
- package/studio/web/components/MissingDmsPanel/CommentCard.tsx +168 -0
- package/studio/web/components/MissingDmsPanel/CommentFeed.tsx +45 -0
- package/studio/web/components/MissingDmsPanel/DmBubble.tsx +38 -0
- package/studio/web/components/MissingDmsPanel/ReplyComposer.tsx +63 -0
- package/studio/web/components/MissingDmsPanel/index.tsx +98 -0
- package/studio/web/components/NotFound.tsx +48 -0
- package/studio/web/components/Omni/OmniAvatarPicker.tsx +92 -0
- package/studio/web/components/Omni/OmniCards.tsx +202 -0
- package/studio/web/components/Omni/OmniGlow.tsx +183 -0
- package/studio/web/components/Omni/OmniHistory.tsx +119 -0
- package/studio/web/components/Omni/OmniHotword.tsx +40 -0
- package/studio/web/components/Omni/OmniMicSelect.tsx +92 -0
- package/studio/web/components/Omni/OmniVoiceSample.tsx +81 -0
- package/studio/web/components/Omni/OmniWidget.tsx +743 -0
- package/studio/web/components/Omni/PendingActions.tsx +200 -0
- package/studio/web/components/Omni/Transcript.tsx +127 -0
- package/studio/web/components/OmnichatAccountStatus.tsx +87 -0
- package/studio/web/components/OmnichatRulePanel/RuleConfig.tsx +150 -0
- package/studio/web/components/OmnichatRulePanel/RuleDryRun.tsx +15 -0
- package/studio/web/components/OmnichatRulePanel/RuleEnableConfirm.tsx +42 -0
- package/studio/web/components/OmnichatRulePanel/RuleSkeleton.tsx +18 -0
- package/studio/web/components/OmnichatRulePanel/RuleStatus.tsx +55 -0
- package/studio/web/components/OmnichatRulePanel/index.tsx +115 -0
- package/studio/web/components/OmnichatRulePanel/rule-steps.ts +67 -0
- package/studio/web/components/OmnichatRulePanel/steps/MessageStep.tsx +91 -0
- package/studio/web/components/OmnichatRulePanel/steps/RepliesStep.tsx +201 -0
- package/studio/web/components/OmnichatRulePanel/steps/TriggerStep.tsx +76 -0
- package/studio/web/components/OmnichatRulePanel/steps/types.ts +11 -0
- package/studio/web/components/Palette.tsx +17 -0
- package/studio/web/components/PlatformCard.tsx +109 -0
- package/studio/web/components/PlatformIcon.tsx +19 -0
- package/studio/web/components/ProviderCard.tsx +80 -0
- package/studio/web/components/ProviderDetail.tsx +367 -0
- package/studio/web/components/ProviderLogo.tsx +20 -0
- package/studio/web/components/QueuePanel.tsx +77 -0
- package/studio/web/components/ReferenceActions.tsx +89 -0
- package/studio/web/components/ReferencePicker.tsx +136 -0
- package/studio/web/components/ResultMessage.tsx +7 -0
- package/studio/web/components/RuleForm.tsx +138 -0
- package/studio/web/components/RuleLog.tsx +151 -0
- package/studio/web/components/RunningTask.tsx +23 -0
- package/studio/web/components/SampleList.tsx +55 -0
- package/studio/web/components/SessionPanel.tsx +352 -0
- package/studio/web/components/SettingRow.tsx +14 -0
- package/studio/web/components/SettingsCategorySkeleton.tsx +25 -0
- package/studio/web/components/SidePanel.tsx +77 -0
- package/studio/web/components/Sidebar.tsx +289 -0
- package/studio/web/components/StageStepper.tsx +87 -0
- package/studio/web/components/StudioOffline.tsx +80 -0
- package/studio/web/components/TaskName.tsx +17 -0
- package/studio/web/components/TopBanners.tsx +30 -0
- package/studio/web/components/VideoOmnichatPanel.tsx +287 -0
- package/studio/web/components/VoiceAvatar.tsx +33 -0
- package/studio/web/components/VoiceCarousel.tsx +196 -0
- package/studio/web/components/VoiceCategory.tsx +9 -0
- package/studio/web/components/VoiceModal.tsx +39 -0
- package/studio/web/components/VoiceProfileCard.tsx +75 -0
- package/studio/web/components/VoiceProfilePicker.tsx +107 -0
- package/studio/web/components/VoiceProfilesSettings.tsx +150 -0
- package/studio/web/components/VoiceProviderCard.tsx +118 -0
- package/studio/web/components/VoiceProvidersCard.tsx +26 -0
- package/studio/web/components/WaitList.tsx +21 -0
- package/studio/web/components/icons.tsx +247 -0
- package/studio/web/components/ui/accordion.tsx +47 -0
- package/studio/web/components/ui/badge.tsx +18 -0
- package/studio/web/components/ui/calendar.tsx +43 -0
- package/studio/web/components/ui/chart.tsx +229 -0
- package/studio/web/components/ui/checkbox.tsx +26 -0
- package/studio/web/components/ui/cx.ts +2 -0
- package/studio/web/components/ui/date-time-picker.tsx +84 -0
- package/studio/web/components/ui/panel.tsx +23 -0
- package/studio/web/components/ui/picker.tsx +58 -0
- package/studio/web/components/ui/popover.tsx +24 -0
- package/studio/web/components/ui/select.tsx +89 -0
- package/studio/web/components/ui/skeleton.tsx +10 -0
- package/studio/web/components/ui/slider.tsx +68 -0
- package/studio/web/components/ui/switch.tsx +13 -0
- package/studio/web/components/ui/tooltip.tsx +59 -0
- package/studio/web/hooks/useAccounts.ts +27 -0
- package/studio/web/hooks/useAdmin.ts +12 -0
- package/studio/web/hooks/useAnalytics.ts +21 -0
- package/studio/web/hooks/useAvatarAudioReactive.ts +87 -0
- package/studio/web/hooks/useBrowserConnect.ts +48 -0
- package/studio/web/hooks/useClonePlan.ts +14 -0
- package/studio/web/hooks/useConnected.ts +7 -0
- package/studio/web/hooks/useLiveQuery.ts +29 -0
- package/studio/web/hooks/useMenuCollapsed.ts +32 -0
- package/studio/web/hooks/useMicDevices.ts +53 -0
- package/studio/web/hooks/useMissingDms.ts +211 -0
- package/studio/web/hooks/useMissingSetupSteps.ts +26 -0
- package/studio/web/hooks/useNow.ts +11 -0
- package/studio/web/hooks/useOmniAgent.ts +278 -0
- package/studio/web/hooks/useOmniClaude.ts +124 -0
- package/studio/web/hooks/useOmniDock.ts +142 -0
- package/studio/web/hooks/useOmniGreeting.ts +60 -0
- package/studio/web/hooks/useOmniHotword.ts +128 -0
- package/studio/web/hooks/useOmnichat.ts +26 -0
- package/studio/web/hooks/useOnboarding.ts +27 -0
- package/studio/web/hooks/usePost.ts +23 -0
- package/studio/web/hooks/useQueue.ts +10 -0
- package/studio/web/hooks/useReferences.ts +20 -0
- package/studio/web/hooks/useRuleEditor.ts +101 -0
- package/studio/web/hooks/useRunner.ts +24 -0
- package/studio/web/hooks/useSaveAction.ts +23 -0
- package/studio/web/hooks/useSchedule.ts +11 -0
- package/studio/web/hooks/useServices.ts +10 -0
- package/studio/web/hooks/useSessions.ts +15 -0
- package/studio/web/hooks/useSettings.ts +11 -0
- package/studio/web/hooks/useSettingsSection.ts +30 -0
- package/studio/web/hooks/useSidePanel.ts +23 -0
- package/studio/web/hooks/useSound.ts +30 -0
- package/studio/web/hooks/useUsage.ts +11 -0
- package/studio/web/hooks/useVideoVoice.ts +36 -0
- package/studio/web/hooks/useVideos.ts +21 -0
- package/studio/web/hooks/useVoiceProfilePreview.ts +52 -0
- package/studio/web/hooks/useVoiceProfiles.ts +7 -0
- package/studio/web/hooks/useVoiceRunning.ts +10 -0
- package/studio/web/hooks/useVoiceStudioClosed.ts +8 -0
- package/studio/web/index.html +19 -0
- package/studio/web/lib/agent.ts +7 -0
- package/studio/web/lib/alerts.ts +210 -0
- package/studio/web/lib/analytics-metrics.ts +351 -0
- package/studio/web/lib/api.ts +70 -0
- package/studio/web/lib/audio.ts +39 -0
- package/studio/web/lib/avatars.ts +41 -0
- package/studio/web/lib/calendar.ts +218 -0
- package/studio/web/lib/caption-position.ts +249 -0
- package/studio/web/lib/carousel.ts +24 -0
- package/studio/web/lib/chime.ts +42 -0
- package/studio/web/lib/clone-voice.ts +55 -0
- package/studio/web/lib/export.ts +11 -0
- package/studio/web/lib/files.ts +8 -0
- package/studio/web/lib/format.ts +93 -0
- package/studio/web/lib/media.ts +29 -0
- package/studio/web/lib/mic-device.ts +72 -0
- package/studio/web/lib/missing-dms.ts +70 -0
- package/studio/web/lib/omni-cards.ts +42 -0
- package/studio/web/lib/omni-cascade.ts +1067 -0
- package/studio/web/lib/omni-greeting-audio.ts +24 -0
- package/studio/web/lib/omni-hotword.ts +231 -0
- package/studio/web/lib/omni-panel.ts +67 -0
- package/studio/web/lib/omni-realtime.ts +811 -0
- package/studio/web/lib/omni-ui.ts +402 -0
- package/studio/web/lib/omni-wait.ts +174 -0
- package/studio/web/lib/omnichat-api.ts +44 -0
- package/studio/web/lib/orb.ts +270 -0
- package/studio/web/lib/pcm-recorder.ts +115 -0
- package/studio/web/lib/platforms.ts +17 -0
- package/studio/web/lib/providers.ts +27 -0
- package/studio/web/lib/publish-draft.ts +52 -0
- package/studio/web/lib/publish-settings.ts +81 -0
- package/studio/web/lib/query-client.ts +122 -0
- package/studio/web/lib/references.ts +13 -0
- package/studio/web/lib/services.ts +40 -0
- package/studio/web/lib/sessions.ts +103 -0
- package/studio/web/lib/settings-categories.ts +58 -0
- package/studio/web/lib/sound-audio.ts +33 -0
- package/studio/web/lib/sound-timeline.ts +291 -0
- package/studio/web/lib/sse.ts +86 -0
- package/studio/web/lib/stage-history.ts +141 -0
- package/studio/web/lib/stages.ts +344 -0
- package/studio/web/lib/studio-offline.ts +60 -0
- package/studio/web/lib/upload.ts +24 -0
- package/studio/web/lib/video-tabs.ts +118 -0
- package/studio/web/lib/voice-profile-draft.ts +34 -0
- package/studio/web/lib/voice-profiles.ts +3 -0
- package/studio/web/main.tsx +14 -0
- package/studio/web/pages/AdminPage/index.tsx +123 -0
- package/studio/web/pages/AgentPage/components/Measurements.tsx +102 -0
- package/studio/web/pages/AgentPage/index.tsx +28 -0
- package/studio/web/pages/AnalyticsPage/components/About.tsx +52 -0
- package/studio/web/pages/AnalyticsPage/components/ChannelCards.tsx +106 -0
- package/studio/web/pages/AnalyticsPage/components/ChannelView.tsx +137 -0
- package/studio/web/pages/AnalyticsPage/components/CollectionStatus.tsx +46 -0
- package/studio/web/pages/AnalyticsPage/components/Comparison.tsx +68 -0
- package/studio/web/pages/AnalyticsPage/components/Diagnosis.tsx +50 -0
- package/studio/web/pages/AnalyticsPage/components/Highlights.tsx +49 -0
- package/studio/web/pages/AnalyticsPage/components/Hint.tsx +11 -0
- package/studio/web/pages/AnalyticsPage/components/HookVsBody.tsx +100 -0
- package/studio/web/pages/AnalyticsPage/components/HourlyWave.tsx +133 -0
- package/studio/web/pages/AnalyticsPage/components/Insights.tsx +70 -0
- package/studio/web/pages/AnalyticsPage/components/MetricCard.tsx +46 -0
- package/studio/web/pages/AnalyticsPage/components/PlanSection.tsx +40 -0
- package/studio/web/pages/AnalyticsPage/components/ProgressionChart.tsx +155 -0
- package/studio/web/pages/AnalyticsPage/components/ReelBarsChart.tsx +154 -0
- package/studio/web/pages/AnalyticsPage/components/ReelThumb.tsx +19 -0
- package/studio/web/pages/AnalyticsPage/components/ReelView.tsx +290 -0
- package/studio/web/pages/AnalyticsPage/components/ReelsTable.tsx +269 -0
- package/studio/web/pages/AnalyticsPage/components/RequestWithFocus.tsx +38 -0
- package/studio/web/pages/AnalyticsPage/components/SegmentedControl.tsx +35 -0
- package/studio/web/pages/AnalyticsPage/components/VsMedian.tsx +31 -0
- package/studio/web/pages/AnalyticsPage/index.tsx +17 -0
- package/studio/web/pages/GettingStartedPage/index.tsx +174 -0
- package/studio/web/pages/NewVideoPage/components/DeliverablesPicker.tsx +62 -0
- package/studio/web/pages/NewVideoPage/components/FormatPicker.tsx +33 -0
- package/studio/web/pages/NewVideoPage/index.tsx +133 -0
- package/studio/web/pages/NotFoundPage/index.tsx +9 -0
- package/studio/web/pages/OmnichatPage/components/NewFromLink.tsx +59 -0
- package/studio/web/pages/OmnichatPage/components/RuleListItem.tsx +64 -0
- package/studio/web/pages/OmnichatPage/components/RulePreview.tsx +14 -0
- package/studio/web/pages/OmnichatPage/components/RuleView.tsx +88 -0
- package/studio/web/pages/OmnichatPage/index.tsx +153 -0
- package/studio/web/pages/QueuePage/index.tsx +22 -0
- package/studio/web/pages/ReferencePage/components/ReferenceTexts.tsx +131 -0
- package/studio/web/pages/ReferencePage/index.tsx +216 -0
- package/studio/web/pages/ReferencesPage/components/NewReferenceForm.tsx +150 -0
- package/studio/web/pages/ReferencesPage/components/ReferenceCard.tsx +42 -0
- package/studio/web/pages/ReferencesPage/components/ReferenceGridSkeleton.tsx +31 -0
- package/studio/web/pages/ReferencesPage/index.tsx +67 -0
- package/studio/web/pages/SchedulePage/components/CalendarSkeleton.tsx +18 -0
- package/studio/web/pages/SchedulePage/components/DayView.tsx +177 -0
- package/studio/web/pages/SchedulePage/components/HourPicker.tsx +103 -0
- package/studio/web/pages/SchedulePage/components/MonthDayCell.tsx +111 -0
- package/studio/web/pages/SchedulePage/components/MonthView.tsx +47 -0
- package/studio/web/pages/SchedulePage/components/PlatformIcons.tsx +12 -0
- package/studio/web/pages/SchedulePage/components/PostThumb.tsx +15 -0
- package/studio/web/pages/SchedulePage/components/WeekColumn.tsx +75 -0
- package/studio/web/pages/SchedulePage/components/WeekView.tsx +35 -0
- package/studio/web/pages/SchedulePage/index.tsx +285 -0
- package/studio/web/pages/SettingsPage/components/AgentAccounts.tsx +263 -0
- package/studio/web/pages/SettingsPage/components/AgentCategory.tsx +20 -0
- package/studio/web/pages/SettingsPage/components/ModelPicker.tsx +49 -0
- package/studio/web/pages/SettingsPage/components/ModelsSettings.tsx +138 -0
- package/studio/web/pages/SettingsPage/components/PlatformsCategory.tsx +23 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/AccountStatus.tsx +29 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/AutoPublishPanel.tsx +90 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/BrowserConnect.tsx +62 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/CheckField.tsx +19 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/InstagramPanel.tsx +113 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/OmnichatSettingsPanel.tsx +146 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SaveBar.tsx +33 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SchedulePanel.tsx +132 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SettingsCard.tsx +47 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SettingsCardGroup.tsx +19 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/TextPanel.tsx +55 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/TiktokPanel.tsx +123 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/YoutubePanel.tsx +100 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/badges.tsx +15 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/index.tsx +40 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/types.ts +10 -0
- package/studio/web/pages/SettingsPage/components/UsageCategory.tsx +389 -0
- package/studio/web/pages/SettingsPage/components/VoiceProvidersCategory.tsx +97 -0
- package/studio/web/pages/SettingsPage/index.tsx +85 -0
- package/studio/web/pages/VideoPage/components/AudioPlayer.tsx +113 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/AxisField.tsx +50 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionList.tsx +56 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionListItem.tsx +92 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionMargins.tsx +57 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionStyleFields.tsx +70 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionTextForm.tsx +87 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/ColorField.tsx +37 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/MarginField.tsx +59 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/NumberField.tsx +57 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/PositionControls.tsx +140 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/captionEditor.ts +215 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/useCaptionPosition.ts +154 -0
- package/studio/web/pages/VideoPage/components/CarouselChangeRequest.tsx +72 -0
- package/studio/web/pages/VideoPage/components/CarouselCompositionStage.tsx +80 -0
- package/studio/web/pages/VideoPage/components/CarouselCreate.tsx +63 -0
- package/studio/web/pages/VideoPage/components/CarouselMissing.tsx +19 -0
- package/studio/web/pages/VideoPage/components/CarouselPublishStage.tsx +173 -0
- package/studio/web/pages/VideoPage/components/CarouselScriptStage.tsx +82 -0
- package/studio/web/pages/VideoPage/components/CarouselSlideCard.tsx +49 -0
- package/studio/web/pages/VideoPage/components/CarouselViewer.tsx +55 -0
- package/studio/web/pages/VideoPage/components/ChangedVoices.tsx +53 -0
- package/studio/web/pages/VideoPage/components/CompositionStage.tsx +78 -0
- package/studio/web/pages/VideoPage/components/CoverPicker.tsx +32 -0
- package/studio/web/pages/VideoPage/components/EditorStage.tsx +53 -0
- package/studio/web/pages/VideoPage/components/LineTakes.tsx +160 -0
- package/studio/web/pages/VideoPage/components/LineTextEditor.tsx +124 -0
- package/studio/web/pages/VideoPage/components/LineVoicePicker.tsx +37 -0
- package/studio/web/pages/VideoPage/components/MediaImage.tsx +25 -0
- package/studio/web/pages/VideoPage/components/MotionScriptStage.tsx +39 -0
- package/studio/web/pages/VideoPage/components/NarrationStage.tsx +70 -0
- package/studio/web/pages/VideoPage/components/PublishForm.tsx +387 -0
- package/studio/web/pages/VideoPage/components/PublishStage.tsx +76 -0
- package/studio/web/pages/VideoPage/components/PublishText.tsx +149 -0
- package/studio/web/pages/VideoPage/components/ScenesApprovalPanel.tsx +278 -0
- package/studio/web/pages/VideoPage/components/ScheduledInfo.tsx +72 -0
- package/studio/web/pages/VideoPage/components/ScriptApprovalPanel.tsx +189 -0
- package/studio/web/pages/VideoPage/components/ScriptStage.tsx +17 -0
- package/studio/web/pages/VideoPage/components/SequencePlayer.tsx +146 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/AddSound.tsx +117 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/AreaSelection.tsx +74 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/BedPanel.tsx +94 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/BedRow.tsx +45 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionOverlay.tsx +44 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionSaveBar.tsx +32 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionsPanel.tsx +22 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/ClipBlock.tsx +111 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/ClipPanel.tsx +76 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CutsPanel.tsx +44 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EditorTabBar.tsx +73 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectChoice.tsx +46 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectItem.tsx +89 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectPanel.tsx +232 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectsRow.tsx +21 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/Lane.tsx +39 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/MarkerRow.tsx +40 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/MuteButton.tsx +36 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/NumberInput.tsx +37 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/PlanWarnings.tsx +19 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/PlayerResizeHandle.tsx +50 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/PreviewControls.tsx +51 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SceneRow.tsx +54 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SettingsPanel.tsx +65 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SoundLibrary.tsx +99 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SoundPreview.tsx +82 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SpeedPanel.tsx +128 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineDock.tsx +56 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineFooter.tsx +26 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineSkeleton.tsx +21 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineToolbar.tsx +160 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineTracks.tsx +121 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TrackSidebar.tsx +30 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/VoiceRow.tsx +53 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/Waveform.tsx +97 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/clipActions.ts +50 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/effectActions.ts +161 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/index.tsx +161 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/timelineGeometry.ts +45 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/types.ts +43 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useAutosave.ts +107 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useEditorShortcuts.ts +168 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useFitHeight.ts +40 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useFollowPlayhead.ts +21 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useListenMix.ts +43 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/usePlayback.ts +231 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/usePlayerWidth.ts +27 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useSoundData.ts +124 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useSoundTimeline.ts +511 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/CompareVersions.tsx +111 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/VersionCard.tsx +81 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/VersionMedia.tsx +24 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/VersionText.tsx +15 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/index.tsx +109 -0
- package/studio/web/pages/VideoPage/components/StageProcess.tsx +126 -0
- package/studio/web/pages/VideoPage/components/StageResult.tsx +69 -0
- package/studio/web/pages/VideoPage/components/SwapReference.tsx +92 -0
- package/studio/web/pages/VideoPage/components/ThumbnailPanel.tsx +252 -0
- package/studio/web/pages/VideoPage/components/TimingPanel.tsx +89 -0
- package/studio/web/pages/VideoPage/components/VideoPlayer.tsx +18 -0
- package/studio/web/pages/VideoPage/components/VideoSkeleton.tsx +50 -0
- package/studio/web/pages/VideoPage/components/VideoVoiceInfo.tsx +33 -0
- package/studio/web/pages/VideoPage/components/VideoVoicePicker.tsx +165 -0
- package/studio/web/pages/VideoPage/components/VoicePauseBanner.tsx +56 -0
- package/studio/web/pages/VideoPage/components/WithLogo.tsx +10 -0
- package/studio/web/pages/VideoPage/index.tsx +295 -0
- package/studio/web/pages/VideosPage/components/PublishedOn.tsx +85 -0
- package/studio/web/pages/VideosPage/components/ServicesPanel.tsx +81 -0
- package/studio/web/pages/VideosPage/components/SessionsPanel.tsx +62 -0
- package/studio/web/pages/VideosPage/components/VideoListSkeleton.tsx +25 -0
- package/studio/web/pages/VideosPage/components/VideoRow.tsx +122 -0
- package/studio/web/pages/VideosPage/index.tsx +134 -0
- package/studio/web/pages/VoicePage/index.tsx +28 -0
- package/studio/web/router.tsx +201 -0
- package/studio/web/styles/base/elements.css +55 -0
- package/studio/web/styles/base/utilities.css +25 -0
- package/studio/web/styles/components/badge.css +33 -0
- package/studio/web/styles/components/claude-running.css +27 -0
- package/studio/web/styles/components/claude-session.css +212 -0
- package/studio/web/styles/components/claude-walking.css +92 -0
- package/studio/web/styles/components/clone-voice-save.css +136 -0
- package/studio/web/styles/components/clone-voice.css +379 -0
- package/studio/web/styles/components/controls.css +70 -0
- package/studio/web/styles/components/data-and-image.css +54 -0
- package/studio/web/styles/components/forms.css +132 -0
- package/studio/web/styles/components/human-banner.css +99 -0
- package/studio/web/styles/components/lightbox.css +50 -0
- package/studio/web/styles/components/markdown.css +68 -0
- package/studio/web/styles/components/modal.css +70 -0
- package/studio/web/styles/components/omni-cards.css +105 -0
- package/studio/web/styles/components/omni.css +859 -0
- package/studio/web/styles/components/omnichat.css +538 -0
- package/studio/web/styles/components/panel.css +115 -0
- package/studio/web/styles/components/platform-card.css +140 -0
- package/studio/web/styles/components/provider-card.css +132 -0
- package/studio/web/styles/components/queue.css +185 -0
- package/studio/web/styles/components/reference-actions.css +133 -0
- package/studio/web/styles/components/reference-picker.css +146 -0
- package/studio/web/styles/components/results-drawer.css +224 -0
- package/studio/web/styles/components/segmented.css +115 -0
- package/studio/web/styles/components/side-panel-tab.css +23 -0
- package/studio/web/styles/components/status-signals.css +66 -0
- package/studio/web/styles/components/stepper.css +208 -0
- package/studio/web/styles/components/table.css +19 -0
- package/studio/web/styles/components/tabs.css +24 -0
- package/studio/web/styles/components/ui/accordion.css +71 -0
- package/studio/web/styles/components/ui/chart.css +162 -0
- package/studio/web/styles/components/ui/checkbox.css +37 -0
- package/studio/web/styles/components/ui/date-picker.css +153 -0
- package/studio/web/styles/components/ui/select.css +110 -0
- package/studio/web/styles/components/ui/skeleton.css +25 -0
- package/studio/web/styles/components/ui/slider.css +81 -0
- package/studio/web/styles/components/ui/switch.css +41 -0
- package/studio/web/styles/components/ui/tooltip.css +24 -0
- package/studio/web/styles/components/voice-carousel.css +255 -0
- package/studio/web/styles/components/voice-editor.css +179 -0
- package/studio/web/styles/components/voice-grid.css +56 -0
- package/studio/web/styles/components/voice-profiles.css +192 -0
- package/studio/web/styles/design-system.md +136 -0
- package/studio/web/styles/index.css +116 -0
- package/studio/web/styles/layout/page.css +41 -0
- package/studio/web/styles/layout/sidebar-groups.css +39 -0
- package/studio/web/styles/layout/sidebar.css +111 -0
- package/studio/web/styles/pages/agent.css +26 -0
- package/studio/web/styles/pages/analytics/dashboard.css +614 -0
- package/studio/web/styles/pages/analytics/insights.css +48 -0
- package/studio/web/styles/pages/getting-started.css +166 -0
- package/studio/web/styles/pages/new-video/form.css +32 -0
- package/studio/web/styles/pages/not-found.css +59 -0
- package/studio/web/styles/pages/references.css +204 -0
- package/studio/web/styles/pages/schedule/calendar.css +541 -0
- package/studio/web/styles/pages/schedule/chip-states.css +60 -0
- package/studio/web/styles/pages/settings/models.css +72 -0
- package/studio/web/styles/pages/settings/shell.css +361 -0
- package/studio/web/styles/pages/settings/usage.css +63 -0
- package/studio/web/styles/pages/studio-offline.css +105 -0
- package/studio/web/styles/pages/video/caption-controls.css +194 -0
- package/studio/web/styles/pages/video/captions-grid.css +70 -0
- package/studio/web/styles/pages/video/captions.css +79 -0
- package/studio/web/styles/pages/video/editor-chat.css +103 -0
- package/studio/web/styles/pages/video/export.css +50 -0
- package/studio/web/styles/pages/video/frames.css +29 -0
- package/studio/web/styles/pages/video/fullscreen-stage.css +400 -0
- package/studio/web/styles/pages/video/instagram-carousel.css +309 -0
- package/studio/web/styles/pages/video/layout.css +285 -0
- package/studio/web/styles/pages/video/narration.css +138 -0
- package/studio/web/styles/pages/video/preview-overview.css +11 -0
- package/studio/web/styles/pages/video/processing-notice.css +34 -0
- package/studio/web/styles/pages/video/publish-when.css +76 -0
- package/studio/web/styles/pages/video/publish.css +97 -0
- package/studio/web/styles/pages/video/result.css +96 -0
- package/studio/web/styles/pages/video/scenes.css +167 -0
- package/studio/web/styles/pages/video/sound-timeline.css +672 -0
- package/studio/web/styles/pages/video/sound-toolbar.css +149 -0
- package/studio/web/styles/pages/video/take-player.css +100 -0
- package/studio/web/styles/pages/video/thumbnail.css +157 -0
- package/studio/web/styles/pages/video/timeline.css +117 -0
- package/studio/web/styles/pages/video/voice-picker.css +14 -0
- package/studio/web/styles/pages/video-list/active-row.css +27 -0
- package/studio/web/styles/pages/video-list/card-link.css +49 -0
- package/studio/web/styles/pages/video-list/list.css +86 -0
- package/studio/web/styles/theme/identity/details.css +204 -0
- package/studio/web/styles/theme/identity/shell.css +249 -0
- package/studio/web/styles/theme/identity/surfaces.css +183 -0
- package/studio/web/styles/theme/identity/titles-and-buttons.css +120 -0
- package/studio/web/styles/theme/no-borders/blocks.css +208 -0
- package/studio/web/styles/theme/no-borders/controls.css +256 -0
- package/studio/web/styles/tokens.css +245 -0
- package/studio/web/types/api.ts +2 -0
- package/studio/web/types/assets.d.ts +9 -0
- package/templates/brief.md +27 -0
- package/templates/captions.html +204 -0
- package/templates/carousel-composition.md +47 -0
- package/templates/carousel-script.md +60 -0
- package/templates/components/voiceavatar/README.md +87 -0
- package/templates/components/voiceavatar/demo.html +50 -0
- package/templates/components/voiceavatar/voiceavatar.js +415 -0
- package/templates/motion.md +80 -0
- package/templates/playbook.md +43 -0
- package/templates/reference.md +123 -0
- package/templates/scene.html +112 -0
- package/templates/scenes.example.json +96 -0
- package/templates/script.md +63 -0
- package/templates/slide.html +71 -0
- package/templates/wireframe.html +91 -0
- package/tools/analysis.mjs +300 -0
- package/tools/approval.mjs +442 -0
- package/tools/assemble.mjs +942 -0
- package/tools/build-motion.mjs +437 -0
- package/tools/captions.mjs +246 -0
- package/tools/carousel.mjs +558 -0
- package/tools/compose.mjs +307 -0
- package/tools/cuts.mjs +74 -0
- package/tools/editor.mjs +419 -0
- package/tools/epidemic-capture.js +54 -0
- package/tools/fanout.mjs +69 -0
- package/tools/history.mjs +70 -0
- package/tools/history.py +61 -0
- package/tools/job-queue.mjs +180 -0
- package/tools/job_queue.py +430 -0
- package/tools/lib/agents.mjs +412 -0
- package/tools/lib/channel.mjs +399 -0
- package/tools/lib/claude-settings.mjs +67 -0
- package/tools/lib/cli.mjs +9 -0
- package/tools/lib/fanout.mjs +234 -0
- package/tools/lib/http.mjs +94 -0
- package/tools/lib/index.js +14 -0
- package/tools/lib/mcp-server.mjs +69 -0
- package/tools/lib/metrics/metrics.mjs +204 -0
- package/tools/lib/narration.mjs +15 -0
- package/tools/lib/oauth-client.mjs +295 -0
- package/tools/lib/omnichat/config.mjs +139 -0
- package/tools/lib/omnichat/errors.mjs +42 -0
- package/tools/lib/omnichat/extract.mjs +82 -0
- package/tools/lib/omnichat/gate.mjs +151 -0
- package/tools/lib/omnichat/manual.mjs +166 -0
- package/tools/lib/omnichat/match.mjs +78 -0
- package/tools/lib/omnichat/pass.mjs +393 -0
- package/tools/lib/omnichat/record.mjs +208 -0
- package/tools/lib/omnichat/text.mjs +315 -0
- package/tools/lib/omnichat/webhook.mjs +166 -0
- package/tools/lib/pairing.mjs +99 -0
- package/tools/lib/paths.mjs +41 -0
- package/tools/lib/platforms/instagram.mjs +469 -0
- package/tools/lib/platforms/tiktok.mjs +343 -0
- package/tools/lib/platforms/youtube.mjs +228 -0
- package/tools/lib/publish/publish.mjs +244 -0
- package/tools/lib/schedule/schedule.mjs +191 -0
- package/tools/lib/service.mjs +134 -0
- package/tools/lib/skill-client.mjs +126 -0
- package/tools/lib/skills-release.mjs +196 -0
- package/tools/lib/testing.mjs +52 -0
- package/tools/lib/up.mjs +187 -0
- package/tools/metrics.mjs +415 -0
- package/tools/models.mjs +134 -0
- package/tools/narrate.mjs +257 -0
- package/tools/omni.mjs +298 -0
- package/tools/omni_paths.py +12 -0
- package/tools/omnichat.mjs +1577 -0
- package/tools/omnivideo.py +1122 -0
- package/tools/package.mjs +130 -0
- package/tools/platforms.mjs +236 -0
- package/tools/premiere.mjs +533 -0
- package/tools/publish.mjs +1496 -0
- package/tools/reference.mjs +1408 -0
- package/tools/render.mjs +426 -0
- package/tools/runner.mjs +156 -0
- package/tools/setup.mjs +466 -0
- package/tools/skills-release.mjs +93 -0
- package/tools/sound.mjs +1323 -0
- package/tools/soundtrack.mjs +217 -0
- package/tools/thumbnail.mjs +271 -0
- package/tools/timing.mjs +108 -0
- package/tools/usage.py +628 -0
- package/tools/voice-envelope.mjs +185 -0
- package/tools/voice.py +448 -0
- package/tools/voice_sample.py +75 -0
- package/tools/wireframe.mjs +230 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/* The short omnichat section of the Publish stage (the video's Reel or, with `carousel`, the
|
|
2
|
+
content's carousel): it comes on, asks only for the term and turns on when saved, because
|
|
3
|
+
writing the term is the authorization (user decision). DM, replies and the rest of the rule
|
|
4
|
+
live on the /omnichat page. */
|
|
5
|
+
|
|
6
|
+
import { useEffect, useState, type FormEvent, type ReactNode } from "react";
|
|
7
|
+
import { Link } from "@tanstack/react-router";
|
|
8
|
+
import { useOmnichatRule, useOmnichatState } from "../hooks/useOmnichat";
|
|
9
|
+
import type { ClientResponse } from "hono/client";
|
|
10
|
+
import { api, send, type ActionResult } from "../lib/api";
|
|
11
|
+
import { ruleApi } from "../lib/omnichat-api";
|
|
12
|
+
import { capitalize, formatDayTime, timeAgo } from "../lib/format";
|
|
13
|
+
import type { VideoDetail } from "../types/api";
|
|
14
|
+
import { Power } from "./icons";
|
|
15
|
+
import { RuleSkeleton } from "./OmnichatRulePanel";
|
|
16
|
+
import { toDisplay, triggerLabel } from "./RuleForm";
|
|
17
|
+
import { Skeleton } from "./ui/skeleton";
|
|
18
|
+
import { Switch } from "./ui/switch";
|
|
19
|
+
|
|
20
|
+
function SectionStatus({ variant, children }: { variant: "ok" | "warning" | "subtle"; children: ReactNode }) {
|
|
21
|
+
return <span className={`omnichat-status ${variant}`}>{children}</span>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* `carousel`: the rule of the content's carousel (videos/<slug>/carousel), on its Publish stage */
|
|
25
|
+
export function VideoOmnichatPanel({ video, carousel = false }: { video: VideoDetail; carousel?: boolean }) {
|
|
26
|
+
const { state, reload: reloadState } = useOmnichatState(false);
|
|
27
|
+
const target = { slug: video.slug, carousel };
|
|
28
|
+
const { detail: d, error: readError, reload } = useOmnichatRule(target);
|
|
29
|
+
const pageLink = (children: ReactNode, className = "link") => (
|
|
30
|
+
<Link
|
|
31
|
+
to="/omnichat/$kind/$id"
|
|
32
|
+
params={{ kind: carousel ? "carousel" : "video", id: video.slug }}
|
|
33
|
+
className={className}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</Link>
|
|
37
|
+
);
|
|
38
|
+
const thePost = carousel ? "o carrossel" : "o Reel";
|
|
39
|
+
const rule = d?.rule ?? null;
|
|
40
|
+
const enabled = !!rule?.enabled;
|
|
41
|
+
/* null: the default, on without a rule and what the rule is when it exists; the switch only
|
|
42
|
+
keeps the wish while the rule is not on */
|
|
43
|
+
const [wants, setWants] = useState<boolean | null>(null);
|
|
44
|
+
/* with omnichat.instagram.enable_on_publish, the rule turns on by itself when the Reel goes up,
|
|
45
|
+
unless the user turned it off (disabled_at): without a rule, with the narration's term */
|
|
46
|
+
const auto = !!d?.on_publish?.enable && !d.published && !enabled && !rule?.any_comment && !rule?.disabled_at;
|
|
47
|
+
const wantsOn = enabled || (wants ?? (!rule || auto));
|
|
48
|
+
const ruleKeywords = (rule?.keywords ?? []).join(", ");
|
|
49
|
+
/* without a rule, the term comes from the narration's ask ("comenta REA que eu te mando o link") */
|
|
50
|
+
const narrationTerm = d?.on_publish?.term ?? "";
|
|
51
|
+
const autoTerm = rule ? ruleKeywords : narrationTerm;
|
|
52
|
+
const [term, setTerm] = useState("");
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
setTerm(ruleKeywords || narrationTerm);
|
|
55
|
+
}, [ruleKeywords, narrationTerm]);
|
|
56
|
+
const [busy, setBusy] = useState<string | null>(null);
|
|
57
|
+
const [result, setResult] = useState<ActionResult>(null);
|
|
58
|
+
|
|
59
|
+
const request = async <R extends ClientResponse<unknown, number, "json" | "text" | "redirect">>(
|
|
60
|
+
name: string,
|
|
61
|
+
call: () => Promise<R>,
|
|
62
|
+
) => {
|
|
63
|
+
setBusy(name);
|
|
64
|
+
setResult(null);
|
|
65
|
+
const r = await send(call());
|
|
66
|
+
setBusy(null);
|
|
67
|
+
if (!r.ok) setResult(r);
|
|
68
|
+
return r;
|
|
69
|
+
};
|
|
70
|
+
const enableWithTerm = async (e: FormEvent) => {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
if (!term.trim()) return;
|
|
73
|
+
setWants(true);
|
|
74
|
+
const r = await request("enable", () => ruleApi(target).term(term));
|
|
75
|
+
reload();
|
|
76
|
+
if (r.ok) setWants(null);
|
|
77
|
+
};
|
|
78
|
+
const disable = async () => {
|
|
79
|
+
const r = await request("disable", () => ruleApi(target).enable(false));
|
|
80
|
+
reload();
|
|
81
|
+
if (r.ok) setWants(false);
|
|
82
|
+
};
|
|
83
|
+
const enableAgent = async () => {
|
|
84
|
+
await request("agent", () => api.omnichat.agent.$post({ json: { enable: true } }));
|
|
85
|
+
reloadState();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
if (!d) {
|
|
89
|
+
return (
|
|
90
|
+
<section className="omnichat">
|
|
91
|
+
<header>
|
|
92
|
+
<h3>Omnichat no Instagram</h3>
|
|
93
|
+
</header>
|
|
94
|
+
{readError ? <p className="response error">{readError}</p> : <RuleSkeleton />}
|
|
95
|
+
</section>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const account = state?.account.ready ? state.account.username : null;
|
|
100
|
+
const anyComment = !!rule?.any_comment;
|
|
101
|
+
const generic = rule ? rule.generic_phrases !== false : true;
|
|
102
|
+
const publicReplies = rule?.public_replies ?? d.defaults.public_replies ?? [];
|
|
103
|
+
/* the rule's DM (or the default one) uses {link}: without a link, the CLI won't turn on */
|
|
104
|
+
const needsLink = (rule?.dm || d.defaults.dm || "").includes("{link}");
|
|
105
|
+
const link = rule?.link || d.found_link?.link || "";
|
|
106
|
+
const found = !rule?.link && !!d.found_link;
|
|
107
|
+
const showTerm = !enabled && wantsOn && !anyComment;
|
|
108
|
+
const ready = !!term.trim() && (!needsLink || !!link);
|
|
109
|
+
const t = d.log?.totals;
|
|
110
|
+
|
|
111
|
+
/* one line: what blocks first (account and token), then the rule */
|
|
112
|
+
let line: ReactNode;
|
|
113
|
+
if (!state) line = <Skeleton className="row" aria-busy="true" style={{ width: 240 }} />;
|
|
114
|
+
else if (!state.account.ready) {
|
|
115
|
+
line = (
|
|
116
|
+
<SectionStatus variant="warning">
|
|
117
|
+
Instagram não conectado: conecte em{" "}
|
|
118
|
+
<Link to="/settings/$category" params={{ category: "platforms" }} className="link">
|
|
119
|
+
Configurações → Plataformas
|
|
120
|
+
</Link>
|
|
121
|
+
</SectionStatus>
|
|
122
|
+
);
|
|
123
|
+
} else if (state.comments?.ready === false) {
|
|
124
|
+
line = (
|
|
125
|
+
<SectionStatus variant="warning">
|
|
126
|
+
O token não tem permissão para ler os comentários: {pageLink("veja como resolver")}
|
|
127
|
+
</SectionStatus>
|
|
128
|
+
);
|
|
129
|
+
} else if (enabled) {
|
|
130
|
+
if (state.pause)
|
|
131
|
+
line = (
|
|
132
|
+
<SectionStatus variant="warning">
|
|
133
|
+
Ligada, em pausa até {formatDayTime(state.pause.until)}: {state.pause.reason}
|
|
134
|
+
</SectionStatus>
|
|
135
|
+
);
|
|
136
|
+
else if (state.agent && !state.agent.loaded) {
|
|
137
|
+
line = (
|
|
138
|
+
<SectionStatus variant="warning">
|
|
139
|
+
Ligada, mas o agente está desligado: nada é respondido sozinho.{" "}
|
|
140
|
+
<button className="button small" disabled={!!busy} onClick={enableAgent}>
|
|
141
|
+
<Power className="ic" /> {busy === "agent" ? "Ligando…" : "Ligar o agente"}
|
|
142
|
+
</button>
|
|
143
|
+
</SectionStatus>
|
|
144
|
+
);
|
|
145
|
+
} else if (!d.published)
|
|
146
|
+
line = <SectionStatus variant="subtle">Ligada: começa a responder quando {thePost} subir</SectionStatus>;
|
|
147
|
+
else if (d.log?.warning) line = <SectionStatus variant="warning">{d.log.warning}</SectionStatus>;
|
|
148
|
+
else {
|
|
149
|
+
line = (
|
|
150
|
+
<SectionStatus variant="ok">
|
|
151
|
+
Ligada e respondendo{t ? ` · ${t.dms} ${t.dms === 1 ? "DM" : "DMs"}` : ""}
|
|
152
|
+
{t?.queued ? ` · ${t.queued} na fila` : ""}
|
|
153
|
+
{d.log?.checked_at ? ` · conferido ${timeAgo(d.log.checked_at)}` : ""}
|
|
154
|
+
</SectionStatus>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
} else if (!wantsOn)
|
|
158
|
+
line = (
|
|
159
|
+
<SectionStatus variant="subtle">
|
|
160
|
+
Desligada: nada é respondido {carousel ? "neste carrossel" : "neste vídeo"}
|
|
161
|
+
</SectionStatus>
|
|
162
|
+
);
|
|
163
|
+
else if (anyComment)
|
|
164
|
+
line = (
|
|
165
|
+
<SectionStatus variant="subtle">
|
|
166
|
+
Esta regra dispara com qualquer comentário: ligue pela {pageLink("página do Omnichat")}
|
|
167
|
+
</SectionStatus>
|
|
168
|
+
);
|
|
169
|
+
else if (auto && autoTerm && (!needsLink || link))
|
|
170
|
+
line = (
|
|
171
|
+
<SectionStatus variant="subtle">
|
|
172
|
+
Liga sozinha com “{autoTerm}” quando {thePost} subir
|
|
173
|
+
</SectionStatus>
|
|
174
|
+
);
|
|
175
|
+
else if (!term.trim()) line = <SectionStatus variant="warning">Falta o termo</SectionStatus>;
|
|
176
|
+
else if (needsLink && !link) line = <SectionStatus variant="warning">Falta o link</SectionStatus>;
|
|
177
|
+
else
|
|
178
|
+
line = (
|
|
179
|
+
<SectionStatus variant="subtle">
|
|
180
|
+
{d.published ? "Pronta para ligar" : `Pronta: liga agora e começa quando ${thePost} subir`}
|
|
181
|
+
</SectionStatus>
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<section className="omnichat">
|
|
186
|
+
<header>
|
|
187
|
+
<h3>
|
|
188
|
+
Omnichat no Instagram{" "}
|
|
189
|
+
<span className="subtle">Quem comenta o termo recebe o link por DM e uma resposta no comentário</span>
|
|
190
|
+
</h3>
|
|
191
|
+
</header>
|
|
192
|
+
<div className="auto-rule-status">
|
|
193
|
+
<label
|
|
194
|
+
className="toggle-switch"
|
|
195
|
+
title={enabled ? "Ligada: responde os comentários que disparam" : "Desligada: nada é respondido"}
|
|
196
|
+
>
|
|
197
|
+
{/* turning off what would turn on by itself is saved, otherwise the post going up would turn it on anyway */}
|
|
198
|
+
<Switch
|
|
199
|
+
checked={wantsOn}
|
|
200
|
+
disabled={!!busy}
|
|
201
|
+
onCheckedChange={on => (enabled || (auto && !on) ? !on && disable() : setWants(on))}
|
|
202
|
+
/>
|
|
203
|
+
<span>{busy === "enable" ? "Ligando…" : busy === "disable" ? "Desligando…" : "Auto-resposta"}</span>
|
|
204
|
+
</label>
|
|
205
|
+
{line}
|
|
206
|
+
{pageLink("Abrir no Omnichat", "subtle-link push-end")}
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
{showTerm && (
|
|
210
|
+
<form className="omnichat-term" onSubmit={enableWithTerm}>
|
|
211
|
+
<label className="field">
|
|
212
|
+
<span>
|
|
213
|
+
Termo <em>a palavra que a pessoa comenta · maiúscula e acento não contam</em>
|
|
214
|
+
</span>
|
|
215
|
+
<div className="setting-row">
|
|
216
|
+
<input
|
|
217
|
+
value={term}
|
|
218
|
+
disabled={!!busy}
|
|
219
|
+
placeholder="REA"
|
|
220
|
+
spellCheck={false}
|
|
221
|
+
aria-label="Termo"
|
|
222
|
+
onChange={e => {
|
|
223
|
+
setTerm(e.target.value);
|
|
224
|
+
setResult(null);
|
|
225
|
+
}}
|
|
226
|
+
/>
|
|
227
|
+
<button className="button primary" type="submit" disabled={!!busy || !ready}>
|
|
228
|
+
<Power className="ic" /> {busy === "enable" ? "Ligando…" : "Ligar com este termo"}
|
|
229
|
+
</button>
|
|
230
|
+
</div>
|
|
231
|
+
</label>
|
|
232
|
+
</form>
|
|
233
|
+
)}
|
|
234
|
+
|
|
235
|
+
{(rule || wantsOn) && (
|
|
236
|
+
<dl className="data">
|
|
237
|
+
{!showTerm && rule && (
|
|
238
|
+
<>
|
|
239
|
+
<dt>Termo</dt>
|
|
240
|
+
<dd>
|
|
241
|
+
{triggerLabel(rule)}
|
|
242
|
+
{!anyComment && generic ? " · também pedidos genéricos" : ""}
|
|
243
|
+
</dd>
|
|
244
|
+
</>
|
|
245
|
+
)}
|
|
246
|
+
<dt>Link</dt>
|
|
247
|
+
<dd>
|
|
248
|
+
{link ? (
|
|
249
|
+
<>
|
|
250
|
+
<a className="link mono" href={link} target="_blank" rel="noreferrer">
|
|
251
|
+
{link}
|
|
252
|
+
</a>
|
|
253
|
+
{found && <span className="subtle"> · achado {d.found_link!.found_in}</span>}
|
|
254
|
+
{" · "}
|
|
255
|
+
{pageLink("trocar no Omnichat", "subtle-link")}
|
|
256
|
+
</>
|
|
257
|
+
) : needsLink ? (
|
|
258
|
+
<>
|
|
259
|
+
<span className="warning">
|
|
260
|
+
Falta o link: nada {carousel ? "no conteúdo" : "no vídeo"} para a DM entregar.
|
|
261
|
+
</span>{" "}
|
|
262
|
+
{pageLink("Preencher no Omnichat")}
|
|
263
|
+
</>
|
|
264
|
+
) : (
|
|
265
|
+
<>A DM vai sem link · {pageLink("trocar no Omnichat", "subtle-link")}</>
|
|
266
|
+
)}
|
|
267
|
+
</dd>
|
|
268
|
+
</dl>
|
|
269
|
+
)}
|
|
270
|
+
|
|
271
|
+
{showTerm && (
|
|
272
|
+
<p className="hint">
|
|
273
|
+
Quem comentar o termo{generic ? " ou pedir o link (“quero”, “me manda”…)" : ""} recebe a DM
|
|
274
|
+
{publicReplies.length ? " e uma resposta no comentário" : ""},{" "}
|
|
275
|
+
{account ? `em nome de ${account}` : "em nome da conta"}.
|
|
276
|
+
{d.published
|
|
277
|
+
? " Os comentários dos últimos 7 dias também entram."
|
|
278
|
+
: auto
|
|
279
|
+
? ` Liga sozinha quando ${thePost} subir; o botão liga agora.`
|
|
280
|
+
: ` Começa quando ${thePost} subir.`}{" "}
|
|
281
|
+
DM, respostas e o resto da regra ficam no Omnichat.
|
|
282
|
+
</p>
|
|
283
|
+
)}
|
|
284
|
+
{result && !result.ok && <p className="response error">{capitalize(toDisplay(result.error ?? ""))}</p>}
|
|
285
|
+
</section>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* The voice avatar: a liquid orb in the voice's own colors (the same for the same voice), drawn by
|
|
2
|
+
lib/orb.ts, which shares one WebGL context among all the avatars on the page. It flows on its own
|
|
3
|
+
and, while a voice plays, reacts to it (useAvatarAudioReactive). */
|
|
4
|
+
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
|
+
import { attachOrb } from "../lib/orb";
|
|
7
|
+
|
|
8
|
+
/* `framed`: the same orb, but filling a whole 9:16 frame (no circular crop), like the
|
|
9
|
+
"o agente de IA escolhe" reference card. `still`: drawn once, no flow (the menu icon). */
|
|
10
|
+
export function VoiceAvatar({
|
|
11
|
+
seed,
|
|
12
|
+
size = 72,
|
|
13
|
+
framed = false,
|
|
14
|
+
still = false,
|
|
15
|
+
}: {
|
|
16
|
+
seed: string;
|
|
17
|
+
size?: number;
|
|
18
|
+
framed?: boolean;
|
|
19
|
+
still?: boolean;
|
|
20
|
+
}) {
|
|
21
|
+
const canvas = useRef<HTMLCanvasElement>(null);
|
|
22
|
+
useEffect(
|
|
23
|
+
() => (canvas.current ? attachOrb(canvas.current, { seed, fill: framed, still }) : undefined),
|
|
24
|
+
[seed, framed, still],
|
|
25
|
+
);
|
|
26
|
+
return (
|
|
27
|
+
<canvas
|
|
28
|
+
ref={canvas}
|
|
29
|
+
className={`voice-avatar${framed ? " frame" : ""}`}
|
|
30
|
+
style={framed ? undefined : { width: size, height: size }}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/* The carousel (Configurações → Voz). The center voice is the selected one; the neighbors are
|
|
2
|
+
smaller and lighter. From there it becomes the active voice, or opens to edit. The carousel's
|
|
3
|
+
last item adds a voice. */
|
|
4
|
+
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { useAvatarAudioReactive } from "../hooks/useAvatarAudioReactive";
|
|
7
|
+
import { useVoiceProfilePreview } from "../hooks/useVoiceProfilePreview";
|
|
8
|
+
import type { ActionResult } from "../lib/api";
|
|
9
|
+
import type { VoiceProfile } from "../types/api";
|
|
10
|
+
import { ArrowLeft, ArrowRight, Check, Pause, Pencil, Play, Plus } from "./icons";
|
|
11
|
+
import { VoiceAvatar } from "./VoiceAvatar";
|
|
12
|
+
import { ProviderIcons } from "./VoiceProfileCard";
|
|
13
|
+
|
|
14
|
+
export function VoiceCarousel({
|
|
15
|
+
profiles,
|
|
16
|
+
defaultId,
|
|
17
|
+
focus,
|
|
18
|
+
onActivate,
|
|
19
|
+
onEdit,
|
|
20
|
+
onAdd,
|
|
21
|
+
}: {
|
|
22
|
+
profiles: VoiceProfile[];
|
|
23
|
+
defaultId: string | null;
|
|
24
|
+
focus: string | null;
|
|
25
|
+
onActivate: (id: string) => Promise<{ ok: boolean; output?: string; error?: string }>;
|
|
26
|
+
onEdit: (id: string) => void;
|
|
27
|
+
onAdd: () => void;
|
|
28
|
+
}) {
|
|
29
|
+
const total = profiles.length; /* after the last voice comes the "+": it opens the modal, it is not a carousel step */
|
|
30
|
+
const last = Math.max(0, total - 1);
|
|
31
|
+
const initial = Math.max(
|
|
32
|
+
0,
|
|
33
|
+
profiles.findIndex(p => p.id === (focus ?? defaultId)),
|
|
34
|
+
);
|
|
35
|
+
const [index, setIndex] = useState(initial);
|
|
36
|
+
const [activating, setActivating] = useState(false);
|
|
37
|
+
const [result, setResult] = useState<ActionResult>(null);
|
|
38
|
+
const { listening, error: sampleError, listen, stop, analyser, clearError } = useVoiceProfilePreview();
|
|
39
|
+
const root = useRef<HTMLDivElement>(null);
|
|
40
|
+
/* the center avatar moves faster while the voice plays; the edit/listen overlay pulses with it, same size */
|
|
41
|
+
useAvatarAudioReactive(listening === "playing", root, analyser, r =>
|
|
42
|
+
Array.from(r.querySelectorAll<HTMLElement>(".carousel-item.d0 .voice-avatar, .carousel-actions")),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/* the voice just created or edited comes to the center */
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const i = profiles.findIndex(p => p.id === focus);
|
|
48
|
+
if (i >= 0) setIndex(i);
|
|
49
|
+
}, [focus, profiles.length]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
setIndex(i => Math.min(i, last));
|
|
52
|
+
}, [last]);
|
|
53
|
+
|
|
54
|
+
const profile = profiles[index] as VoiceProfile | undefined;
|
|
55
|
+
const active = !!profile && profile.id === defaultId;
|
|
56
|
+
const go = (i: number) => {
|
|
57
|
+
stop();
|
|
58
|
+
clearError();
|
|
59
|
+
setResult(null);
|
|
60
|
+
setIndex(Math.max(0, Math.min(last, i)));
|
|
61
|
+
};
|
|
62
|
+
const activate = async () => {
|
|
63
|
+
if (!profile) return;
|
|
64
|
+
setActivating(true);
|
|
65
|
+
setResult(await onActivate(profile.id));
|
|
66
|
+
setActivating(false);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const play = () => {
|
|
70
|
+
if (!profile) return;
|
|
71
|
+
setResult(null);
|
|
72
|
+
listen(profile.id);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
ref={root}
|
|
78
|
+
className="carousel"
|
|
79
|
+
tabIndex={0}
|
|
80
|
+
role="group"
|
|
81
|
+
aria-label="Vozes"
|
|
82
|
+
onKeyDown={e => {
|
|
83
|
+
if (e.key === "ArrowLeft") {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
go(index - 1);
|
|
86
|
+
}
|
|
87
|
+
if (e.key === "ArrowRight") {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
go(index + 1);
|
|
90
|
+
}
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<div className="carousel-canvas">
|
|
94
|
+
<div className="carousel-window">
|
|
95
|
+
<div className="carousel-rail" style={{ transform: `translateX(calc(${-(index + 0.5)} * var(--slot)))` }}>
|
|
96
|
+
{profiles.map((p, i) => (
|
|
97
|
+
<button
|
|
98
|
+
key={p.id}
|
|
99
|
+
type="button"
|
|
100
|
+
className={`carousel-item d${Math.min(Math.abs(i - index), 3)}${p.id === defaultId ? " active" : ""}`}
|
|
101
|
+
onClick={() => go(i)}
|
|
102
|
+
aria-label={p.name}
|
|
103
|
+
aria-current={i === index}
|
|
104
|
+
tabIndex={-1}
|
|
105
|
+
>
|
|
106
|
+
<VoiceAvatar seed={p.avatar || p.id} size={160} />
|
|
107
|
+
</button>
|
|
108
|
+
))}
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
className={`carousel-item more d${Math.min(Math.abs(total - index), 3)}`}
|
|
112
|
+
onClick={onAdd}
|
|
113
|
+
aria-label="Adicionar voz"
|
|
114
|
+
title="Adicionar voz"
|
|
115
|
+
>
|
|
116
|
+
<span className="avatar-more large">
|
|
117
|
+
<Plus />
|
|
118
|
+
</span>
|
|
119
|
+
</button>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
{profile && (
|
|
123
|
+
<div className="carousel-actions">
|
|
124
|
+
<button
|
|
125
|
+
type="button"
|
|
126
|
+
onClick={() => onEdit(profile.id)}
|
|
127
|
+
aria-label={`Editar ${profile.name}`}
|
|
128
|
+
title="Editar"
|
|
129
|
+
>
|
|
130
|
+
<Pencil />
|
|
131
|
+
</button>
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
onClick={play}
|
|
135
|
+
disabled={listening === "generating"}
|
|
136
|
+
aria-label={listening === "playing" ? "Parar a amostra" : `Ouvir ${profile.name}`}
|
|
137
|
+
title={
|
|
138
|
+
listening === "generating" ? "Gerando a amostra…" : listening === "playing" ? "Parar" : "Ouvir voz"
|
|
139
|
+
}
|
|
140
|
+
>
|
|
141
|
+
{listening === "playing" ? <Pause weight="fill" /> : <Play weight="fill" />}
|
|
142
|
+
</button>
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
<button
|
|
146
|
+
type="button"
|
|
147
|
+
className="carousel-arrow start"
|
|
148
|
+
onClick={() => go(index - 1)}
|
|
149
|
+
disabled={index === 0}
|
|
150
|
+
aria-label="Voz anterior"
|
|
151
|
+
>
|
|
152
|
+
<ArrowLeft weight="bold" />
|
|
153
|
+
</button>
|
|
154
|
+
<button
|
|
155
|
+
type="button"
|
|
156
|
+
className="carousel-arrow end"
|
|
157
|
+
onClick={() => go(index + 1)}
|
|
158
|
+
disabled={index >= last}
|
|
159
|
+
aria-label="Próxima voz"
|
|
160
|
+
>
|
|
161
|
+
<ArrowRight weight="bold" />
|
|
162
|
+
</button>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div className="carousel-caption">
|
|
166
|
+
{profile ? (
|
|
167
|
+
<>
|
|
168
|
+
<h3>
|
|
169
|
+
{profile.name}
|
|
170
|
+
{active && <span className="default-profile">Ativa</span>}
|
|
171
|
+
</h3>
|
|
172
|
+
<ProviderIcons order={profile.order} size={32} />
|
|
173
|
+
{!active && (
|
|
174
|
+
<div className="profile-actions center">
|
|
175
|
+
<button className="button" disabled={activating} onClick={activate}>
|
|
176
|
+
<Check className="ic" /> {activating ? "Ativando…" : "Usar esta voz"}
|
|
177
|
+
</button>
|
|
178
|
+
</div>
|
|
179
|
+
)}
|
|
180
|
+
</>
|
|
181
|
+
) : (
|
|
182
|
+
<>
|
|
183
|
+
<h3>Nenhuma voz ainda</h3>
|
|
184
|
+
<p className="carousel-empty">
|
|
185
|
+
Clique no + para clonar a sua voz ou informar uma que já existe nos provedores
|
|
186
|
+
</p>
|
|
187
|
+
</>
|
|
188
|
+
)}
|
|
189
|
+
{result && (
|
|
190
|
+
<p className={`response ${result.ok ? "ok" : "error"}`}>{result.ok ? result.output : result.error}</p>
|
|
191
|
+
)}
|
|
192
|
+
{!result && sampleError && <p className="response error">{sampleError}</p>}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* Configurações → Voz and the /voice page: the voice carousel with the providers card beside it */
|
|
2
|
+
|
|
3
|
+
import type { Settings } from "../types/api";
|
|
4
|
+
import { VoiceProfilesSettings } from "./VoiceProfilesSettings";
|
|
5
|
+
import { VoiceProvidersCard } from "./VoiceProvidersCard";
|
|
6
|
+
|
|
7
|
+
export function VoiceCategory({ settings, reload }: { settings: Settings; reload: () => void }) {
|
|
8
|
+
return <VoiceProfilesSettings settings={settings} reload={reload} aside={<VoiceProvidersCard />} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* The two-half frame the voice modal uses, in the create view (CloneVoiceDialog) and in the edit
|
|
2
|
+
one (EditVoiceDialog, in VoiceProfilesSettings): the modal shell. `locked`: with something in
|
|
3
|
+
progress (recording, creating) the modal doesn't close. */
|
|
4
|
+
|
|
5
|
+
import { useEffect, type ReactNode } from "react";
|
|
6
|
+
import { X } from "./icons";
|
|
7
|
+
|
|
8
|
+
export function VoiceModal({
|
|
9
|
+
title,
|
|
10
|
+
onClose,
|
|
11
|
+
locked = false,
|
|
12
|
+
children,
|
|
13
|
+
}: {
|
|
14
|
+
title: string;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
locked?: boolean;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}) {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const key = (e: KeyboardEvent) => {
|
|
21
|
+
if (e.key === "Escape" && !locked) onClose();
|
|
22
|
+
};
|
|
23
|
+
window.addEventListener("keydown", key);
|
|
24
|
+
return () => window.removeEventListener("keydown", key);
|
|
25
|
+
}, [onClose, locked]);
|
|
26
|
+
return (
|
|
27
|
+
<div className="modal-backdrop" onClick={() => !locked && onClose()}>
|
|
28
|
+
<div className="modal wide" role="dialog" aria-modal="true" aria-label={title} onClick={e => e.stopPropagation()}>
|
|
29
|
+
<header className="modal-top">
|
|
30
|
+
<h2>{title}</h2>
|
|
31
|
+
<button type="button" className="button small" onClick={onClose} disabled={locked} aria-label="Fechar">
|
|
32
|
+
<X weight="bold" />
|
|
33
|
+
</button>
|
|
34
|
+
</header>
|
|
35
|
+
<div className="clone-frame">{children}</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* A voice profile as a pickable card (new video and Voice stage). */
|
|
2
|
+
|
|
3
|
+
import type { ListenPhase } from "../hooks/useVoiceProfilePreview";
|
|
4
|
+
import { PROVIDER_NAME } from "../lib/providers";
|
|
5
|
+
import type { VoiceProfile } from "../types/api";
|
|
6
|
+
import { Pause, Play } from "./icons";
|
|
7
|
+
import { ProviderLogo } from "./ProviderLogo";
|
|
8
|
+
import { VoiceAvatar } from "./VoiceAvatar";
|
|
9
|
+
|
|
10
|
+
/* only each provider's logo, in try order; the name shows on hover */
|
|
11
|
+
export function ProviderIcons({ order, size }: { order: string[]; size: number }) {
|
|
12
|
+
return (
|
|
13
|
+
<span className="provider-icons">
|
|
14
|
+
{order.map((id, i) => {
|
|
15
|
+
const name = PROVIDER_NAME[id] ?? id;
|
|
16
|
+
const hint = order.length > 1 ? `${i + 1}º · ${name}` : name;
|
|
17
|
+
return (
|
|
18
|
+
<span key={id} className="hint" data-hint={hint} role="img" aria-label={hint}>
|
|
19
|
+
<ProviderLogo id={id} size={size} />
|
|
20
|
+
</span>
|
|
21
|
+
);
|
|
22
|
+
})}
|
|
23
|
+
</span>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function VoiceProfileCard({
|
|
28
|
+
profile,
|
|
29
|
+
chosen,
|
|
30
|
+
onChoose,
|
|
31
|
+
listening,
|
|
32
|
+
onListen,
|
|
33
|
+
}: {
|
|
34
|
+
profile: VoiceProfile;
|
|
35
|
+
chosen: boolean;
|
|
36
|
+
onChoose: () => void;
|
|
37
|
+
/* with `onListen`, the card gets the listen button (icon only) in the bottom corner; `listening` is this voice's phase */
|
|
38
|
+
listening?: ListenPhase;
|
|
39
|
+
onListen?: () => void;
|
|
40
|
+
}) {
|
|
41
|
+
const button = (
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
className={`voice-profile${chosen ? " chosen" : ""}`}
|
|
45
|
+
onClick={onChoose}
|
|
46
|
+
aria-pressed={chosen}
|
|
47
|
+
>
|
|
48
|
+
<VoiceAvatar seed={profile.avatar || profile.id} size={72} />
|
|
49
|
+
<b>{profile.name}</b>
|
|
50
|
+
</button>
|
|
51
|
+
);
|
|
52
|
+
if (!onListen) return button;
|
|
53
|
+
/* the listen button is a sibling, not a child: a button inside a button is not valid HTML */
|
|
54
|
+
return (
|
|
55
|
+
<div className="voice-profile-card" data-voice={profile.id}>
|
|
56
|
+
{button}
|
|
57
|
+
<button
|
|
58
|
+
type="button"
|
|
59
|
+
className={`voice-profile-listen${listening ? " active" : ""}`}
|
|
60
|
+
onClick={onListen}
|
|
61
|
+
disabled={listening === "generating"}
|
|
62
|
+
aria-label={`${listening === "playing" ? "Parar" : "Ouvir"} a voz ${profile.name}`}
|
|
63
|
+
title={listening === "generating" ? "Gerando a amostra…" : listening === "playing" ? "Parar" : "Ouvir"}
|
|
64
|
+
>
|
|
65
|
+
{listening === "generating" ? (
|
|
66
|
+
<span className="spinning" aria-hidden="true" />
|
|
67
|
+
) : listening === "playing" ? (
|
|
68
|
+
<Pause weight="fill" />
|
|
69
|
+
) : (
|
|
70
|
+
<Play weight="fill" />
|
|
71
|
+
)}
|
|
72
|
+
</button>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|