Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

use backend camera capture for preview

Brendan Allana7846eb46e15
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index ed3c034f1..e9ec47e14 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -13,7 +13,7 @@
"@cap/ui-solid": "workspace:*",
"@cap/utils": "workspace:*",
"@corvu/tooltip": "^0.2.1",
- "@kobalte/core": "^0.13.6",
+ "@kobalte/core": "^0.13.7",
"@solid-primitives/bounds": "^0.0.122",
"@solid-primitives/context": "^0.2.3",
"@solid-primitives/date": "^2.0.23",
diff --git a/apps/desktop/src-tauri/src/camera.rs b/apps/desktop/src-tauri/src/camera.rs
index 5ab242ba8..f4da50798 100644
--- a/apps/desktop/src-tauri/src/camera.rs
+++ b/apps/desktop/src-tauri/src/camera.rs
@@ -3,6 +3,7 @@ use serde::Serialize;
use specta::Type;
use std::{
path::PathBuf,
+ sync::Arc,
time::{Instant, SystemTime},
};
use tokio::sync::{oneshot, watch};
@@ -101,55 +102,48 @@ pub struct CameraInfo {
pub async fn start_capturing(
output_path: PathBuf,
- camera_info: nokhwa::utils::CameraInfo,
+ camera_feed: &CameraFeed,
mut start_writing_rx: watch::Receiver<bool>,
) -> CaptureController {
let controller = CaptureController::new(output_path);
let (start_tx, start_rx) = oneshot::channel();
+ let handle = tokio::runtime::Handle::current();
+ let mut frames_rx = camera_feed.frame_rx.clone();
+ let format = camera_feed.camera_format.clone();
+
std::thread::spawn({
let controller = controller.clone();
move || {
- use nokhwa::{pixel_format::*, utils::*, *};
-
- nokhwa::nokhwa_initialize(move |granted| {
- if granted {
- println!("Camera access granted");
- } else {
- println!("Camera access denied");
- }
- });
-
- let format =
- RequestedFormat::new::<RgbFormat>(RequestedFormatType::AbsoluteHighestFrameRate);
- let mut camera = Camera::new(camera_info.index().clone(), format).unwrap();
-
- let format = camera.camera_format();
-
- let capture_format = ffmpeg::format::Pixel::UYVY422;
- let output_format = H264Encoder::output_format();
-
- let (width, height) = (format.resolution().width(), format.resolution().height());
-
- let mut encoder = H264Encoder::new(&controller.output_path, width, height, 30.0);
-
- let mut scaler =
- ffmpeg::software::converter((width, height), capture_format, output_format)
- .unwrap();
-
- camera.open_stream().unwrap();
+ let mut encoder = H264Encoder::new(
+ &controller.output_path,
+ format.resolution().width(),
+ format.resolution().height(),
+ 30.0,
+ );
let mut start_tx = Some(start_tx);
+ let mut scaler = ffmpeg::software::converter(
+ (format.resolution().width(), format.resolution().height()),
+ nokhwa_format_to_ffmpeg(format.format()),
+ H264Encoder::output_format(),
+ )
+ .unwrap();
+
loop {
+ handle.block_on(frames_rx.changed());
+
if controller.is_stopped() {
println!("Stopping receiving camera frames");
break;
}
- let frame = camera.frame().unwrap();
- let timestamp = SystemTime::now();
+ let frame = frames_rx.borrow_and_update();
+ let Some((frame, timestamp)) = frame.as_ref() else {
+ continue;
+ };
if controller.is_paused() {
continue;
@@ -163,7 +157,11 @@ pub async fn start_capturing(
continue;
}
- let yuyv422_frame = uyvy422_frame(frame.buffer(), width, height);
+ let yuyv422_frame = uyvy422_frame(
+ frame.buffer(),
+ frame.resolution().width(),
+ frame.resolution().height(),
+ );
let mut yuv_frame = ffmpeg::util::frame::Video::empty();
scaler.run(&yuyv422_frame, &mut yuv_frame).unwrap();
@@ -185,3 +183,176 @@ pub async fn start_capturing(
controller
}
+
+fn nokhwa_format_to_ffmpeg(nokhwa_format: nokhwa::utils::FrameFormat) -> ffmpeg::format::Pixel {
+ match nokhwa_format {
+ nokhwa::utils::FrameFormat::YUYV => ffmpeg::format::Pixel::UYVY422,
+ _ => todo!(),
+ }
+}
+
+type CameraFrame = (nokhwa::Buffer, SystemTime);
+
+pub async fn create_camera_ws(frame_rx: watch::Receiver<Option<CameraFrame>>) -> u16 {
+ use axum::{
+ extract::{
+ ws::{Message, WebSocket, WebSocketUpgrade},
+ State,
+ },
+ response::IntoResponse,
+ routing::get,
+ };
+ use tokio::sync::Mutex;
+
+ type RouterState = Arc<Mutex<watch::Receiver<Option<CameraFrame>>>>;
+
+ async fn ws_handler(
+ ws: WebSocketUpgrade,
+ State(state): State<RouterState>,
+ ) -> impl IntoResponse {
+ ws.on_upgrade(move |socket| handle_socket(socket, state))
+ }
+
+ async fn handle_socket(mut socket: WebSocket, state: RouterState) {
+ let mut rx = state.lock().await;
+ println!("socket connection established");
+ let now = std::time::Instant::now();
+
+ loop {
+ tokio::select! {
+ _ = socket.recv() => {
+ break;
+ }
+ _ = rx.changed() => {
+ let data = {
+ let msg = rx.borrow_and_update();
+
+ let Some((buffer, _)) = msg.as_ref() else {
+ continue;
+ };
+
+ let source_fmt = nokhwa_format_to_ffmpeg(buffer.source_frame_format());
+ let out_fmt = ffmpeg::format::Pixel::RGBA;
+
+ let out_size = (buffer.resolution().width(), buffer.resolution().height());
+
+ let mut scaler = ffmpeg::software::converter(
+ (buffer.resolution().width(), buffer.resolution().height()),
+ source_fmt,
+ out_fmt,
+ )
+ .unwrap();
+
+ let uyvy422_frame = uyvy422_frame(
+ buffer.buffer(),
+ buffer.resolution().width(),
+ buffer.resolution().height(),
+ );
+
+ let mut frame = ffmpeg::frame::Video::empty();
+ scaler.run(&uyvy422_frame, &mut frame).unwrap();
+
+ let mut data = frame.data(0).to_vec();
+
+ let height_bytes: [u8; 4] = out_size.1.to_le_bytes();
+ data.extend_from_slice(height_bytes.as_slice());
+ let width_bytes: [u8; 4] = out_size.0.to_le_bytes();
+ data.extend_from_slice(width_bytes.as_slice());
+
+ data
+ };
+
+ socket.send(Message::Binary(data)).await.unwrap();
+ }
+ }
+ }
+ let elapsed = now.elapsed();
+ println!("Websocket closing after {elapsed:.2?}");
+ }
+
+ let router = axum::Router::new()
+ .route("/", get(ws_handler))
+ .with_state(Arc::new(Mutex::new(frame_rx)));
+
+ let listener = tokio::net::TcpListener::bind("127.0.0.1:9182")
+ .await
+ .unwrap();
+ let port = listener.local_addr().unwrap().port();
+ tokio::spawn(async move {
+ axum::serve(listener, router.into_make_service())
+ .await
+ .unwrap();
+ });
+
+ port
+}
+
+pub type LatestFrame = Option<(nokhwa::Buffer, SystemTime)>;
+
+pub struct CameraFeed {
+ pub camera_info: nokhwa::utils::CameraInfo,
+ pub camera_format: nokhwa::utils::CameraFormat,
+ pub frame_rx: watch::Receiver<LatestFrame>,
+ shutdown_tx: Option<oneshot::Sender<()>>,
+}
+
+impl CameraFeed {
+ pub async fn new(label: &str, frame_tx: watch::Sender<LatestFrame>) -> Self {
+ let camera_info = find_camera_by_label(&label).unwrap();
+
+ use nokhwa::{pixel_format::*, utils::*, *};
+
+ let format =
+ RequestedFormat::new::<RgbFormat>(RequestedFormatType::Closest(CameraFormat::new(
+ Resolution {
+ width_x: 1920,
+ height_y: 1080,
+ },
+ FrameFormat::YUYV,
+ 30,
+ )));
+
+ let (shutdown_tx, mut shutdown_rx) = oneshot::channel();
+
+ let (setup_tx, setup_rx) = oneshot::channel();
+
+ let frame_rx = frame_tx.subscribe();
+
+ std::thread::spawn({
+ let camera_info = camera_info.clone();
+ move || {
+ let mut camera = Camera::new(camera_info.index().clone(), format).unwrap();
+
+ camera.open_stream().unwrap();
+
+ setup_tx.send(camera.camera_format());
+
+ loop {
+ if shutdown_rx.try_recv().is_ok() {
+ return;
+ }
+
+ let frame = camera.frame().unwrap();
+ let timestamp = SystemTime::now();
+
+ frame_tx.send(Some((frame, timestamp))).unwrap();
+ }
+ }
+ });
+
+ let camera_format = setup_rx.await.unwrap();
+
+ Self {
+ camera_info,
+ camera_format,
+ frame_rx,
+ shutdown_tx: Some(shutdown_tx),
+ }
+ }
+}
+
+impl Drop for CameraFeed {
+ fn drop(&mut self) {
+ self.shutdown_tx.take().unwrap().send(()).unwrap();
+ }
+}
diff --git a/apps/desktop/src-tauri/src/encoder.rs b/apps/desktop/src-tauri/src/encoder.rs
index 6ba6e6d53..a5e62b397 100644
--- a/apps/desktop/src-tauri/src/encoder.rs
+++ b/apps/desktop/src-tauri/src/encoder.rs
@@ -168,6 +168,14 @@ pub fn uyvy422_frame(bytes: &[u8], width: u32, height: u32) -> ffmpeg::frame::Vi
frame
}
+pub fn yuyv422_frame(bytes: &[u8], width: u32, height: u32) -> ffmpeg::frame::Video {
+ let mut frame = ffmpeg::frame::Video::new(ffmpeg::format::Pixel::YUYV422, width, height);
+
+ frame.data_mut(0).copy_from_slice(bytes);
+
+ frame
+}
+
pub fn nv12_frame(bytes: &[u8], width: u32, height: u32) -> ffmpeg::frame::Video {
let mut frame = ffmpeg::frame::Video::new(ffmpeg::format::Pixel::NV12, width, height);
let y_size = (width * height) as usize;
diff --git a/apps/desktop/src-tauri/src/hotkeys.rs b/apps/desktop/src-tauri/src/hotkeys.rs
index c3e34550a..c7d826469 100644
--- a/apps/desktop/src-tauri/src/hotkeys.rs
+++ b/apps/desktop/src-tauri/src/hotkeys.rs
@@ -4,8 +4,8 @@ use crate::{
use global_hotkey::HotKeyState;
use serde::{Deserialize, Serialize};
use specta::Type;
-use std::collections::HashMap;
use std::sync::Mutex;
+use std::{collections::HashMap, time::Instant};
use tauri::{AppHandle, Manager, Wry};
use tauri_plugin_global_shortcut::{Code, GlobalShortcutExt, Modifiers, Shortcut};
use tauri_plugin_store::{with_store, StoreCollection};
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 9b6ad7a62..a63e2faf4 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -21,7 +21,7 @@ mod web_api;
use audio::AppSounds;
use auth::AuthStore;
-use camera::{create_camera_window, list_cameras};
+use camera::{create_camera_window, find_camera_by_label, list_cameras, CameraFeed};
use cap_ffmpeg::FFmpeg;
use cap_project::{
ProjectConfiguration, RecordingMeta, SharingMeta, TimelineConfiguration, TimelineSegment,
@@ -46,7 +46,7 @@ use specta::Type;
use std::fs::File;
use std::io::BufWriter;
use std::io::{BufReader, Write};
-use std::time::{SystemTime, UNIX_EPOCH};
+use std::time::{Instant, SystemTime, UNIX_EPOCH};
use std::{
collections::HashMap, marker::PhantomData, path::PathBuf, process::Command, sync::Arc,
time::Duration,
@@ -58,7 +58,7 @@ use tauri_plugin_notification::PermissionState;
use tauri_plugin_shell::ShellExt;
use tauri_specta::Event;
use tokio::io::AsyncWriteExt;
-use tokio::sync::mpsc;
+use tokio::sync::{mpsc, oneshot, watch};
use tokio::task;
use tokio::{
sync::{Mutex, RwLock},
@@ -91,6 +91,10 @@ impl RecordingOptions {
pub struct App {
start_recording_options: RecordingOptions,
#[serde(skip)]
+ camera_tx: watch::Sender<camera::LatestFrame>,
+ #[serde(skip)]
+ camera_feed: Option<camera::CameraFeed>,
+ #[serde(skip)]
handle: AppHandle,
#[serde(skip)]
current_recording: Option<InProgressRecording>,
@@ -182,20 +186,38 @@ impl App {
.map(|window| window.close().ok());
}
- fn set_start_recording_options(&mut self, new_value: RecordingOptions) {
- self.start_recording_options = new_value;
- let options = &self.start_recording_options;
-
+ async fn set_start_recording_options(&mut self, new_options: RecordingOptions) {
match self.handle.get_webview_window(camera::WINDOW_LABEL) {
- Some(window) if options.camera_label.is_none() => {
+ Some(window) if new_options.camera_label.is_none() => {
+ println!("closing camera window");
window.close().ok();
}
- None if options.camera_label.is_some() => {
+ None if new_options.camera_label.is_some() => {
+ println!("creating camera window");
create_camera_window(self.handle.clone());
}
_ => {}
}
+ match &new_options.camera_label {
+ Some(camera_label) => {
+ if self
+ .camera_feed
+ .as_ref()
+ .map(|f| &f.camera_info.human_name() != camera_label)
+ .unwrap_or(true)
+ {
+ self.camera_feed =
+ Some(CameraFeed::new(&camera_label, self.camera_tx.clone()).await);
+ }
+ }
+ None => {
+ self.camera_feed = None;
+ }
+ }
+
+ self.start_recording_options = new_options;
+
RecordingOptionsChanged.emit(&self.handle).ok();
}
}
@@ -257,7 +279,11 @@ async fn set_recording_options(
state: MutableState<'_, App>,
options: RecordingOptions,
) -> Result<(), ()> {
- state.write().await.set_start_recording_options(options);
+ state
+ .write()
+ .await
+ .set_start_recording_options(options)
+ .await;
Ok(())
}
@@ -308,7 +334,12 @@ async fn start_recording(app: AppHandle, state: MutableState<'_, App>) -> Result
.join("recordings")
.join(format!("{id}.cap"));
- let recording = recording::start(recording_dir, &state.start_recording_options).await;
+ let recording = recording::start(
+ recording_dir,
+ &state.start_recording_options,
+ state.camera_feed.as_ref(),
+ )
+ .await;
state.set_current_recording(recording);
@@ -2317,8 +2348,14 @@ pub fn run() {
permissions::open_permissions_window(app_handle.clone());
}
+ let (camera_tx, camera_rx) = watch::channel(None);
+
+ tokio::spawn(camera::create_camera_ws(camera_rx.clone()));
+
app.manage(Arc::new(RwLock::new(App {
handle: app_handle.clone(),
+ camera_tx,
+ camera_feed: None,
start_recording_options: RecordingOptions {
capture_target: CaptureTarget::Screen,
camera_label: None,
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index 950ddc7bc..f05c2a1af 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -1,4 +1,5 @@
use crate::audio::AudioCapturer;
+use crate::camera::CameraFeed;
use crate::capture::CaptureController;
use crate::flags;
use cap_ffmpeg::{FFmpeg, FFmpegInput, FFmpegProcess, FFmpegRawAudioInput};
@@ -223,6 +224,7 @@ pub struct FFmpegCaptureOutput<T> {
pub async fn start(
recording_dir: PathBuf,
recording_options: &RecordingOptions,
+ camera_feed: Option<&CameraFeed>,
) -> InProgressRecording {
let content_dir = recording_dir.join("content");
@@ -240,18 +242,13 @@ pub async fn start(
&recording_options.capture_target,
start_writing_rx.clone(),
),
- OptionFuture::from(
- recording_options
- .camera_label()
- .and_then(camera::find_camera_by_label)
- .map(|camera_info| {
- camera::start_capturing(
- content_dir.join("camera.mp4"),
- camera_info,
- start_writing_rx.clone(),
- )
- }),
- ),
+ OptionFuture::from(camera_feed.map(|camera_feed| {
+ camera::start_capturing(
+ content_dir.join("camera.mp4"),
+ camera_feed,
+ start_writing_rx.clone(),
+ )
+ }),),
OptionFuture::from(
recording_options
.audio_input_name()
diff --git a/apps/desktop/src/routes/(window-chrome)/index.tsx b/apps/desktop/src/routes/(window-chrome)/index.tsx
index 5d525cdfe..d42c986eb 100644
--- a/apps/desktop/src/routes/(window-chrome)/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/index.tsx
@@ -2,7 +2,7 @@ import { Button, SwitchTab } from "@cap/ui-solid";
import { Select as KSelect } from "@kobalte/core/select";
import { createEventListener } from "@solid-primitives/event-listener";
import { cache, createAsync, redirect, useNavigate } from "@solidjs/router";
-import { createMutation } from "@tanstack/solid-query";
+import { createMutation, createQuery } from "@tanstack/solid-query";
import { getVersion } from "@tauri-apps/api/app";
import { cx } from "cva";
import {
@@ -11,7 +11,6 @@ import {
createEffect,
createResource,
createSignal,
- onCleanup,
onMount,
} from "solid-js";
import { createStore } from "solid-js/store";
@@ -19,12 +18,12 @@ import { createStore } from "solid-js/store";
import { authStore } from "~/store";
import { clientEnv } from "~/utils/env";
import {
- createAudioDevicesQuery,
createCurrentRecordingQuery,
createOptionsQuery,
- createPermissionsQuery,
+ listWindows,
+ listAudioDevices,
+ getPermissions,
createVideoDevicesQuery,
- createWindowsQuery,
} from "~/utils/queries";
import { type CaptureWindow, commands, events } from "~/utils/tauri";
import {
@@ -34,7 +33,6 @@ import {
topLeftAnimateClasses,
topRightAnimateClasses,
} from "../editor/ui";
-import { stopMediaStream } from "~/utils/media";
const getAuth = cache(async () => {
const value = await authStore.get();
@@ -48,15 +46,14 @@ export const route = {
export default function () {
const options = createOptionsQuery();
- const windows = createWindowsQuery();
- const videoDevicesQuery = createVideoDevicesQuery();
- const audioDevicesQuery = createAudioDevicesQuery();
+ const windows = createQuery(() => listWindows);
+ const videoDevices = createVideoDevicesQuery();
+ const audioDevices = createQuery(() => listAudioDevices);
const currentRecording = createCurrentRecordingQuery();
const [windowSelectOpen, setWindowSelectOpen] = createSignal(false);
- const permissions = createPermissionsQuery();
+ const permissions = createQuery(() => getPermissions);
- const [cameraSelectOpen, setCameraSelectOpen] = createSignal(false);
const [microphoneSelectOpen, setMicrophoneSelectOpen] = createSignal(false);
events.showCapturesPanel.listen(() => {
@@ -67,8 +64,6 @@ export default function () {
commands.showPreviousRecordingsWindow();
});
- type CameraOption = MediaDeviceInfo | { deviceId: string; label: string };
-
const isRecording = () => !!currentRecording.data;
const toggleRecording = createMutation(() => ({
@@ -77,7 +72,6 @@ export default function () {
await commands.startRecording();
} else {
await commands.stopRecording();
- await stopMediaStream("both");
}
},
}));
@@ -149,9 +143,6 @@ export default function () {
}
};
- const camera = () =>
- videoDevicesQuery?.data.find((d) => d.label === options.data?.cameraLabel);
-
const selectedWindow = () => {
const d = options.data?.captureTarget;
if (d?.type !== "window") return;
@@ -159,7 +150,7 @@ export default function () {
};
const audioDevice = () =>
- audioDevicesQuery?.data?.find(
+ audioDevices?.data?.find(
(d) => d.name === options.data?.audioInputName
) ?? { name: "No Audio", deviceId: "" };
@@ -167,10 +158,8 @@ export default function () {
try {
if (type === "camera") {
await commands.resetCameraPermissions();
- await navigator.mediaDevices.getUserMedia({ video: true });
} else if (type === "microphone") {
await commands.resetMicrophonePermissions();
- await navigator.mediaDevices.getUserMedia({ audio: true });
}
// Refresh permissions after request
await permissions.refetch();
@@ -179,17 +168,15 @@ export default function () {
}
};
- const handleCameraChange = async (item: CameraOption | null) => {
+ const handleCameraChange = async (item: string | null) => {
+ console.log({ item });
if (!item && permissions?.data?.camera !== "granted") {
return requestPermission("camera");
}
if (!options.data) return;
- // Stop the current camera stream before changing
- await stopMediaStream("video");
-
- if (!item || item.label === "No Camera") {
+ if (!item) {
await commands.setRecordingOptions({
...options.data,
cameraLabel: null,
@@ -197,7 +184,7 @@ export default function () {
} else {
await commands.setRecordingOptions({
...options.data,
- cameraLabel: item.label,
+ cameraLabel: item,
});
}
};
@@ -211,21 +198,12 @@ export default function () {
if (!item || !options.data) return;
- // Stop the current audio stream before changing
- if (options.data.audioInputName) {
- await stopMediaStream("audio");
- }
-
commands.setRecordingOptions({
...options.data,
audioInputName: item.name !== "No Audio" ? item.name : null,
});
};
- onCleanup(() => {
- stopMediaStream("both");
- });
-
return (
<div class="flex justify-center flex-col p-[1rem] gap-[0.75rem] text-[0.875rem] font-[400] bg-gray-50 h-full">
<div class="absolute top-3 right-3">
@@ -359,38 +337,19 @@ export default function () {
</KSelect>
<div class="flex flex-col gap-[0.25rem] items-stretch">
<label class="text-gray-400 text-[0.875rem]">Camera</label>
- <KSelect<CameraOption>
- options={[
- { deviceId: "", label: "No Camera" },
- ...(videoDevicesQuery.data ?? []),
- ]}
- optionValue="deviceId"
- optionTextValue="label"
+ <KSelect<string>
+ options={videoDevices}
placeholder="No Camera"
- value={camera() ?? { deviceId: "", label: "No Camera" }}
+ value={options.data?.cameraLabel}
disabled={isRecording()}
onChange={handleCameraChange}
itemComponent={(props) => (
<MenuItem<typeof KSelect.Item> as={KSelect.Item} item={props.item}>
<KSelect.ItemLabel class="flex-1">
- {props.item.rawValue.label}
+ {props.item.rawValue}
</KSelect.ItemLabel>
</MenuItem>
)}
- open={cameraSelectOpen()}
- onOpenChange={async (isOpen: boolean) => {
- if (isOpen) {
- if (camera()) {
- setCameraSelectOpen(true);
- } else {
- setCameraSelectOpen(false);
- await videoDevicesQuery.refetch();
- setCameraSelectOpen(true);
- }
- } else {
- setCameraSelectOpen(false);
- }
- }}
>
<KSelect.Trigger
class="flex flex-row items-center h-[2rem] px-[0.375rem] gap-[0.375rem] border rounded-lg border-gray-200 w-full disabled:text-gray-400 transition-colors KSelect"
@@ -401,10 +360,8 @@ export default function () {
}}
>
<IconCapCamera class="text-gray-400 size-[1.25rem]" />
- <KSelect.Value<{
- label: string;
- }> class="flex-1 text-left truncate">
- {(state) => <span>{state.selectedOption().label}</span>}
+ <KSelect.Value<string> class="flex-1 text-left truncate">
+ {(state) => <span>{state.selectedOption()}</span>}
</KSelect.Value>
<button
type="button"
@@ -451,7 +408,7 @@ export default function () {
<KSelect<{ name: string; deviceId: string }>
options={[
{ name: "No Audio", deviceId: "" },
- ...(audioDevicesQuery.data ?? []),
+ ...(audioDevices.data ?? []),
]}
optionValue="deviceId"
optionTextValue="name"
@@ -471,7 +428,7 @@ export default function () {
if (isOpen) {
if (audioDevice().name === "No Audio") {
setMicrophoneSelectOpen(false);
- await audioDevicesQuery.refetch();
+ await audioDevices.refetch();
}
setMicrophoneSelectOpen(true);
} else {
diff --git a/apps/desktop/src/routes/camera.tsx b/apps/desktop/src/routes/camera.tsx
index 08a11ec83..943e21a8d 100644
--- a/apps/desktop/src/routes/camera.tsx
+++ b/apps/desktop/src/routes/camera.tsx
@@ -10,17 +10,17 @@ import {
Show,
Suspense,
createEffect,
+ createResource,
createSignal,
- on,
onCleanup,
} from "solid-js";
import { createStore } from "solid-js/store";
import { ToggleButton as KToggleButton } from "@kobalte/core/toggle-button";
import { cx } from "cva";
-import { createCameraForLabel } from "~/utils/media";
import { createOptionsQuery } from "~/utils/queries";
import { commands } from "~/utils/tauri";
+import { createImageDataWS, createLazySignal } from "~/utils/socket";
namespace CameraWindow {
export type Size = "sm" | "lg";
@@ -32,14 +32,10 @@ namespace CameraWindow {
};
}
-export default function() {
- const options = createOptionsQuery();
-
- const camera = createCameraForLabel(() => options.data?.cameraLabel ?? "");
+const BAR_HEIGHT = 56;
- const [cameraPreviewRef, getCameraStream] = createCameraPreview(
- () => camera()?.deviceId
- );
+export default function () {
+ const options = createOptionsQuery();
const [state, setState] = makePersisted(
createStore<CameraWindow.State>({
@@ -49,45 +45,40 @@ export default function() {
})
);
- createEffect(on(() => state.size, resizeWindow));
-
- const [isLoading, setIsLoading] = createSignal(true);
- const [loadingText, setLoadingText] = createSignal("Camera is loading");
+ const [latestFrame, setLatestFrame] = createLazySignal<ImageData | null>();
- createEffect(() => {
- const stream = getCameraStream();
- if (stream) {
- setIsLoading(false);
- } else {
- setIsLoading(true);
- }
+ createImageDataWS("ws://localhost:9182", (imageData) => {
+ setLatestFrame(imageData);
+ const ctx = cameraCanvasRef?.getContext("2d");
+ ctx?.putImageData(imageData, 0, 0);
});
- createEffect(() => {
- if (isLoading()) {
- const loadingMessages = [
- "Camera is loading",
- "Acquiring lock on camera",
- "Camera is starting",
- "Almost there...",
- "Just a moment longer",
- ];
- let index = 0;
- const interval = setInterval(() => {
- setLoadingText(loadingMessages[index]);
- index = (index + 1) % loadingMessages.length;
- }, 1000);
+ const [windowSize] = createResource(
+ () => state.size,
+ async (size) => {
+ const monitor = await currentMonitor();
+
+ const windowSize = size === "sm" ? 230 : 400;
+ const windowHeight = windowSize + BAR_HEIGHT;
+
+ if (!monitor) return;
+
+ const scalingFactor = monitor.scaleFactor;
+ const width = monitor.size.width / scalingFactor - windowSize - 100;
+ const height = monitor.size.height / scalingFactor - windowHeight - 100;
- onCleanup(() => clearInterval(interval));
+ const currentWindow = getCurrentWindow();
+ currentWindow.setSize(new LogicalSize(windowSize, windowHeight));
+ currentWindow.setPosition(new LogicalPosition(width, height));
+
+ return { width, height, size: windowSize };
}
- });
+ );
+
+ let cameraCanvasRef: HTMLCanvasElement | undefined;
return (
- <Suspense
- fallback={
- <CameraLoadingState shape={state.shape} loadingText={loadingText()} />
- }
- >
+ <Suspense fallback={<CameraLoadingState shape={state.shape} />}>
<Show when={options.data}>
{(options) => (
<div
@@ -95,33 +86,8 @@ export default function() {
class="cursor-move group w-screen h-screen relative flex flex-col bg-black"
style={{ "border-radius": cameraBorderRadius(state) }}
>
- <div class="h-16" data-tauri-drag-region />
- <div class="flex flex-col flex-1 relative" data-tauri-drag-region>
- <Show
- when={!isLoading()}
- fallback={
- <CameraLoadingState
- shape={state.shape}
- loadingText={loadingText()}
- />
- }
- >
- <video
- data-tauri-drag-region
- autoplay
- playsinline
- muted
- class={cx(
- "w-full h-full object-cover pointer-events-none border-none shadow-lg",
- state.shape === "round" ? "rounded-full" : "rounded-3xl"
- )}
- style={{
- transform: state.mirrored ? "scaleX(1)" : "scaleX(-1)",
- }}
- ref={cameraPreviewRef}
- />
- </Show>
- <div class="flex flex-row items-center justify-center absolute -top-14 inset-x-0">
+ <div class="h-14">
+ <div class="flex flex-row items-center justify-center">
<div class="flex flex-row gap-[0.25rem] p-[0.25rem] opacity-0 group-hover:opacity-100 translate-y-2 group-hover:translate-y-0 rounded-xl transition-[opacity,transform] bg-gray-500 border border-white-transparent-20 text-gray-400">
<ControlButton
onClick={() => {
@@ -160,6 +126,61 @@ export default function() {
</div>
</div>
</div>
+ <div
+ class={cx(
+ "flex flex-col flex-1 relative overflow-hidden pointer-events-none border-none shadow-lg",
+ state.shape === "round" ? "rounded-full" : "rounded-3xl"
+ )}
+ data-tauri-drag-region
+ >
+ <Show when={latestFrame()}>
+ {(latestFrame) => {
+ const style = () => {
+ const aspectRatio =
+ latestFrame().width / latestFrame().height;
+
+ const windowWidth = windowSize()?.size ?? 0;
+
+ const size = (() => {
+ if (aspectRatio > 1)
+ return {
+ width: windowWidth * aspectRatio,
+ height: windowWidth,
+ };
+ else
+ return {
+ width: windowWidth,
+ height: windowWidth * aspectRatio,
+ };
+ })();
+
+ const left =
+ aspectRatio > 1 ? (size.width - windowWidth) / 2 : 0;
+ const top =
+ aspectRatio > 1 ? 0 : (windowWidth - size.height) / 2;
+
+ return {
+ width: `${size.width}px`,
+ height: `${size.height}px`,
+ left: `-${left}px`,
+ top: `-${top}px`,
+ transform: state.mirrored ? "scaleX(-1)" : "scaleX(1)",
+ };
+ };
+
+ return (
+ <canvas
+ data-tauri-drag-region
+ class={cx("absolute")}
+ style={style()}
+ width={latestFrame().width}
+ height={latestFrame().height}
+ ref={cameraCanvasRef!}
+ />
+ );
+ }}
+ </Show>
+ </div>
</div>
)}
</Show>
@@ -167,21 +188,37 @@ export default function() {
);
}
-function CameraLoadingState({
- shape,
- loadingText,
-}: {
- shape: CameraWindow.Shape;
- loadingText: string;
-}) {
+function CameraLoadingState(props: { shape: CameraWindow.Shape }) {
+ const [loadingText, setLoadingText] = createSignal("Camera is loading");
+
+ createEffect(() => {
+ const loadingMessages = [
+ "Camera is loading",
+ "Acquiring lock on camera",
+ "Camera is starting",
+ "Almost there...",
+ "Just a moment longer",
+ ];
+ let index = 0;
+ const interval = setInterval(() => {
+ setLoadingText(loadingMessages[index]);
+ index = (index + 1) % loadingMessages.length;
+ }, 1000);
+
+ onCleanup(() => clearInterval(interval));
+ });
+
return (
- <div
- class={cx(
- "w-full h-full bg-gray-500 flex items-center justify-center",
- shape === "round" ? "rounded-full" : "rounded-3xl"
- )}
- >
- <div class="text-gray-300 text-sm">{loadingText}</div>
+ <div class="flex flex-col w-full h-full">
+ <div class="h-14" />
+ <div
+ class={cx(
+ "w-full flex-1 bg-gray-500 flex items-center justify-center",
+ props.shape === "round" ? "rounded-full" : "rounded-3xl"
+ )}
+ >
+ <div class="text-gray-300 text-sm">{loadingText()}</div>
+ </div>
</div>
);
}
@@ -192,97 +229,6 @@ function cameraBorderRadius(state: CameraWindow.State) {
return "4rem";
}
-const BAR_HEIGHT = 56;
-async function resizeWindow(size: CameraWindow.Size) {
- const monitor = await currentMonitor();
-
- const windowWidth = size === "sm" ? 230 : 400;
- const windowHeight = windowWidth + BAR_HEIGHT;
-
- if (!monitor) return;
-
- const scalingFactor = monitor.scaleFactor;
- const x = monitor.size.width / scalingFactor - windowWidth - 100;
- const y = monitor.size.height / scalingFactor - windowHeight - 100;
-
- const currentWindow = getCurrentWindow();
- currentWindow.setSize(new LogicalSize(windowWidth, windowHeight));
- currentWindow.setPosition(new LogicalPosition(x, y));
-}
-
-function createCameraPreview(deviceId: () => string | undefined) {
- const [cameraStream, setCameraStream] = createSignal<MediaStream | null>(
- null
- );
- const [cameraRef, setCameraRef] = createSignal<HTMLVideoElement>();
-
- createEffect(async () => {
- const id = deviceId();
- if (!id) {
- setCameraStream(null);
- return;
- }
-
- try {
- const stream = await navigator.mediaDevices.getUserMedia({
- video: {
- deviceId: { exact: id },
- height: 720,
- },
- });
-
- setCameraStream(stream);
-
- // Get the actual settings of the stream
- const videoTrack = stream.getVideoTracks()[0];
- const settings = videoTrack.getSettings();
- console.log("Camera settings:", settings);
- } catch (error) {
- console.error("Error accessing camera:", error);
- setCameraStream(null);
- }
- });
-
- createEffect(() => {
- const stream = cameraStream();
- const ref = cameraRef();
-
- if (ref && stream) {
- ref.srcObject = stream;
- ref.play().catch(console.error);
- } else if (ref) {
- ref.srcObject = null;
- }
-
- // Cleanup effect
- onCleanup(() => {
- if (stream) {
- stream.getTracks().forEach((track) => track.stop());
- }
- if (ref?.srcObject) {
- ref.srcObject = null;
- }
- });
- });
-
-
- return [setCameraRef, () => cameraStream()] as const;
-}
-
-// {
-// "title": "Cap Permissions",
-// "label": "permissions",
-// "width": 400,
-// "height": 400,
-// "decorations": false,
-// "resizable": false,
-// "maximized": false,
-// "shadow": true,
-// "transparent": true,
-// "acceptFirstMouse": true,
-// "url": "/permissions-macos"
-// }
-
function ControlButton(
props: Omit<ComponentProps<typeof KToggleButton>, "type" | "class"> & {
active?: boolean;
diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
index 0e4a8f797..0cd947444 100644
--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx
+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
@@ -4,14 +4,7 @@ import {
} from "@kobalte/core/radio-group";
import { Tabs as KTabs } from "@kobalte/core/tabs";
import { cx } from "cva";
-import {
- type Component,
- createRoot,
- createSignal,
- For,
- ParentProps,
- Show,
-} from "solid-js";
+import { type Component, createRoot, For, Show } from "solid-js";
import { Dynamic } from "solid-js/web";
import { createWritableMemo } from "@solid-primitives/memo";
diff --git a/apps/desktop/src/routes/editor/Player.tsx b/apps/desktop/src/routes/editor/Player.tsx
index 885d2f8da..89060e8be 100644
--- a/apps/desktop/src/routes/editor/Player.tsx
+++ b/apps/desktop/src/routes/editor/Player.tsx
@@ -28,7 +28,7 @@ export function Player() {
videoId,
editorInstance,
history,
- currentFrame,
+ latestFrame,
setDialog,
playbackTime,
playing,
@@ -40,10 +40,10 @@ export function Player() {
let canvasRef: HTMLCanvasElement;
createEffect(() => {
- const frame = currentFrame();
+ const frame = latestFrame();
if (!frame) return;
const ctx = canvasRef.getContext("2d");
- ctx?.putImageData(frame.data, 0, 0);
+ ctx?.putImageData(frame, 0, 0);
});
const [canvasContainerRef, setCanvasContainerRef] =
@@ -109,7 +109,7 @@ export function Player() {
</div>
</div>
<div ref={setCanvasContainerRef} class="bg-gray-100 flex-1 relative">
- <Show when={currentFrame()}>
+ <Show when={latestFrame()}>
{(currentFrame) => {
const padding = 16;
diff --git a/apps/desktop/src/routes/editor/editorInstanceContext.ts b/apps/desktop/src/routes/editor/editorInstanceContext.ts
index 408d3b1be..e78138d60 100644
--- a/apps/desktop/src/routes/editor/editorInstanceContext.ts
+++ b/apps/desktop/src/routes/editor/editorInstanceContext.ts
@@ -1,9 +1,9 @@
import { createContextProvider } from "@solid-primitives/context";
-import { createResource, createSignal } from "solid-js";
+import { createEffect, createResource } from "solid-js";
import { events, commands } from "~/utils/tauri";
-import { DEFAULT_PROJECT_CONFIG } from "./projectConfig";
import { createPresets } from "~/utils/createPresets";
+import { createImageDataWS, createLazySignal } from "~/utils/socket";
export const OUTPUT_SIZE = {
width: 1920,
@@ -14,57 +14,21 @@ export type FrameData = { width: number; height: number; data: ImageData };
export const [EditorInstanceContextProvider, useEditorInstanceContext] =
createContextProvider((props: { videoId: string }) => {
- let res: ((frame: FrameData) => void) | undefined;
-
- const [currentFrame, currentFrameActions] = createResource(
- () =>
- new Promise<FrameData>((r) => {
- res = r;
- })
- );
+ const [latestFrame, setLatestFrame] = createLazySignal<ImageData>();
const [editorInstance] = createResource(async () => {
const instance = await commands.createEditorInstance(props.videoId);
if (instance.status !== "ok") throw new Error("Failed to start editor");
- const ws = new WebSocket(instance.data.framesSocketUrl);
+ const ws = createImageDataWS(
+ instance.data.framesSocketUrl,
+ setLatestFrame
+ );
ws.onopen = () => {
events.renderFrameEvent.emit({
frame_number: Math.floor(0),
});
};
- ws.binaryType = "arraybuffer";
- ws.onmessage = (event) => {
- const buffer = event.data as ArrayBuffer;
- const clamped = new Uint8ClampedArray(buffer);
-
- const widthArr = clamped.slice(clamped.length - 4);
- const heightArr = clamped.slice(clamped.length - 8, clamped.length - 4);
-
- const width =
- widthArr[0] +
- (widthArr[1] << 8) +
- (widthArr[2] << 16) +
- (widthArr[3] << 24);
- const height =
- heightArr[0] +
- (heightArr[1] << 8) +
- (heightArr[2] << 16) +
- (heightArr[3] << 24);
-
- const imageData = new ImageData(
- clamped.slice(0, clamped.length - 8),
- width,
- height
- );
-
- if (res) {
- res({ data: imageData, width, height });
- res = undefined;
- } else {
- currentFrameActions.mutate({ data: imageData, width, height });
- }
- };
return instance.data;
});
@@ -72,7 +36,7 @@ export const [EditorInstanceContextProvider, useEditorInstanceContext] =
return {
editorInstance,
videoId: props.videoId,
- currentFrame,
+ latestFrame,
presets: createPresets(),
};
}, null!);
diff --git a/apps/desktop/src/utils/media.ts b/apps/desktop/src/utils/media.ts
deleted file mode 100644
index 375e63022..000000000
--- a/apps/desktop/src/utils/media.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import {
- type Accessor,
- createEffect,
- createResource,
- on,
- onCleanup,
- onMount,
-} from "solid-js";
-import { commands } from "./tauri";
-
-export function createDevices() {
- const [devices, { refetch }] = createResource(async () => {
- try {
- const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false });
- const result = await navigator.mediaDevices.enumerateDevices();
- // this is not a better solution, since `navigator.mediaDevices.getUserMedia` is always return a new instance of the stream
- // we need to clean up the stream because we just want to get the devices.
- stream.getTracks().forEach(track => track.stop())
- return result
- } catch (error) {
- console.error("Error accessing media devices:", error);
- return [];
- }
- });
-
- onMount(() => {
- if (navigator.mediaDevices) {
- navigator.mediaDevices.addEventListener("devicechange", refetch);
- onCleanup(() =>
- navigator.mediaDevices.removeEventListener("devicechange", refetch)
- );
- }
- });
-
- return () => devices.latest ?? [];
-}
-
-export function createCameras() {
- const devices = createDevices();
-
- const [rustCameras, { refetch }] = createResource(async () => {
- try {
- return await commands.listCameras();
- } catch (error) {
- console.error("Error listing cameras:", error);
- return [];
- }
- });
-
- createEffect(on(devices, refetch));
-
- return () => {
- const videoDevices = devices().filter(
- (device) => device.kind === "videoinput"
- );
-
- const cameras = rustCameras.latest ?? [];
-
- return videoDevices.filter((device) =>
- cameras.some((c) => c === device.label)
- );
- };
-}
-
-export function createCameraForLabel(label: Accessor<string>) {
- const cameras = createCameras();
-
- return () => {
- const camera = cameras().find((camera) => camera.label === label());
- return camera || null;
- };
-}
-
-export async function stopMediaStream(kind: "audio" | "video" | "both") {
- const streams = await navigator.mediaDevices.getUserMedia({
- audio: kind === "audio" || kind === "both",
- video: kind === "video" || kind === "both",
- });
-
- streams.getTracks().forEach((track) => {
- if ((kind === "audio" && track.kind === "audio") ||
- (kind === "video" && track.kind === "video") ||
- kind === "both") {
- track.stop();
- }
- });
-}
diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts
index 0f19939f3..b6d9ec1f8 100644
--- a/apps/desktop/src/utils/queries.ts
+++ b/apps/desktop/src/utils/queries.ts
@@ -3,11 +3,14 @@ import { createTimer } from "@solid-primitives/timer";
import { commands } from "./tauri";
import { createQueryInvalidate } from "./events";
+import { createStore, reconcile } from "solid-js/store";
+import { createMemo } from "solid-js";
-export const getWindows = queryOptions({
+export const listWindows = queryOptions({
queryKey: ["capture", "windows"] as const,
queryFn: () => commands.listCaptureWindows(),
reconcile: "id",
+ refetchInterval: 1000,
});
const getOptions = queryOptions({
@@ -26,24 +29,40 @@ const getCurrentRecording = queryOptions({
},
});
+const listVideoDevices = queryOptions({
+ queryKey: ["videoDevices"] as const,
+ queryFn: () => commands.listCameras(),
+ refetchInterval: 1000,
+});
+
+export function createVideoDevicesQuery() {
+ const query = createQuery(() => listVideoDevices);
+
+ const [videoDevicesStore, setVideoDevices] = createStore<string[]>([]);
+
+ createMemo(() => {
+ setVideoDevices(reconcile(query.data ?? []));
+ });
+
+ return videoDevicesStore;
+}
+
export const listAudioDevices = queryOptions({
queryKey: ["audioDevices"] as const,
queryFn: async () => {
const r = await commands.listAudioDevices();
- if (r.status === "ok") return r.data.map((name) => ({ name, deviceId: name }));
+ if (r.status === "ok")
+ return r.data.map((name) => ({ name, deviceId: name }));
},
reconcile: "name",
- refetchInterval: 1000
+ refetchInterval: 1000,
});
-export const permissions = queryOptions({
+export const getPermissions = queryOptions({
queryKey: ["permissionsOS"] as const,
- queryFn: async () => {
- const result = await commands.doPermissionsCheck(true)
- return result
- },
+ queryFn: () => commands.doPermissionsCheck(true),
refetchInterval: 1000,
-})
+});
export function createOptionsQuery() {
const options = createQuery(() => getOptions);
@@ -52,55 +71,9 @@ export function createOptionsQuery() {
return options;
}
-export function createWindowsQuery() {
- const windows = createQuery(() => getWindows);
- createTimer(() => windows.refetch(), 1000, setInterval);
-
- return windows;
-}
-
-export function createAudioDevicesQuery() {
- const devices = createQuery(() => listAudioDevices);
-
- return devices;
-}
-
-export function createVideoDevicesQuery() {
- const permissions = createPermissionsQuery()
- const options = () => queryOptions({
- queryKey: ["videoDevices"] as const,
- queryFn: async () => {
- const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false });
- const browserDevices = await navigator.mediaDevices.enumerateDevices();
- const rustCameras = await commands.listCameras();
- const result = browserDevices.filter(device => device.kind === "videoinput"
- && rustCameras.some(rDevice => rDevice === device.label)
- )
- // this is not a better solution, since `navigator.mediaDevices.getUserMedia` is always return a new instance of the stream
- // we need to clean up the stream because we just want to get the devices.
- stream.getTracks().forEach(track => track.stop())
- return result
- },
- initialData: [],
- reconcile: (oldData, newData) => permissions?.data?.camera === 'granted' ? newData
- : Array.isArray(oldData) && oldData.length === 0 ? oldData : [],
- refetchOnWindowFocus: "always",
- enabled: permissions.data?.camera === 'granted',
- })
- const devices = createQuery(options);
-
- return devices;
-}
-
export function createCurrentRecordingQuery() {
const currentRecording = createQuery(() => getCurrentRecording);
createQueryInvalidate(currentRecording, "currentRecordingChanged");
return currentRecording;
}
-
-export function createPermissionsQuery() {
- const permission = createQuery(() => permissions);
-
- return permission;
-}
diff --git a/apps/desktop/src/utils/socket.ts b/apps/desktop/src/utils/socket.ts
new file mode 100644
index 000000000..f19065092
--- /dev/null
+++ b/apps/desktop/src/utils/socket.ts
@@ -0,0 +1,60 @@
+import { createWS } from "@solid-primitives/websocket";
+import { createResource } from "solid-js";
+
+export function createImageDataWS(
+ url: string,
+ onmessage: (data: ImageData) => void
+): Omit<WebSocket, "onmessage"> {
+ const ws = createWS(url);
+ ws.binaryType = "arraybuffer";
+ ws.onmessage = (event) => {
+ const buffer = event.data as ArrayBuffer;
+ const clamped = new Uint8ClampedArray(buffer);
+
+ const widthArr = clamped.slice(clamped.length - 4);
+ const heightArr = clamped.slice(clamped.length - 8, clamped.length - 4);
+
+ const width =
+ widthArr[0] +
+ (widthArr[1] << 8) +
+ (widthArr[2] << 16) +
+ (widthArr[3] << 24);
+ const height =
+ heightArr[0] +
+ (heightArr[1] << 8) +
+ (heightArr[2] << 16) +
+ (heightArr[3] << 24);
+
+ const imageData = new ImageData(
+ clamped.slice(0, clamped.length - 8),
+ width,
+ height
+ );
+
+ onmessage(imageData);
+ };
+ return ws;
+}
+
+export function createLazySignal<T>() {
+ let res: ((value: T) => void) | undefined;
+
+ const [value, { mutate: setValue }] = createResource(
+ () =>
+ new Promise<T>((r) => {
+ res = r;
+ })
+ );
+
+ return [
+ value,
+ (value: T) => {
+ if (res) {
+ res(value);
+ res = undefined;
+ } else {
+ setValue(() => value);
+ }
+ },
+ ] as const;
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8a672767a..002578ae9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -50,8 +50,8 @@ importers:
specifier: ^0.2.1
version: 0.2.1([email protected])
'@kobalte/core':
- specifier: ^0.13.6
- version: 0.13.6(patch_hash=vzpkmmroj2yro75ebs5pnjs3u4)([email protected])
+ specifier: ^0.13.7
+ version: 0.13.7([email protected])
'@solid-primitives/bounds':
specifier: ^0.0.122
version: 0.0.122([email protected])
@@ -220,7 +220,7 @@ importers:
version: 2.30.1
next:
specifier: 14.2.9
next-auth:
specifier: ^4.24.5
@@ -696,7 +696,7 @@ importers:
version: 5.0.7
next:
specifier: 14.2.9
next-auth:
specifier: ^4.24.5
@@ -2438,6 +2438,11 @@ packages:
peerDependencies:
solid-js: ^1.8.15
+ '@kobalte/[email protected]':
+ resolution: {integrity: sha512-COhjWk1KnCkl3qMJDvdrOsvpTlJ9gMLdemkAn5SWfbPn/lxJYabejnNOk+b/ILGg7apzQycgbuo48qb8ppqsAg==}
+ peerDependencies:
+ solid-js: ^1.8.15
+
'@kobalte/[email protected]':
resolution: {integrity: sha512-WbueJTVRiO4yrmfHIBwp07y3M5iibJ/gauEAQ7mOyg1tZulvpO7SM/UdgzX95a9a0KDt1mQFxwO7RmpOUXWOWA==}
peerDependencies:
@@ -12149,6 +12154,18 @@ snapshots:
solid-presence: 0.1.8([email protected])
solid-prevent-scroll: 0.1.10([email protected])
+ dependencies:
+ '@floating-ui/dom': 1.6.11
+ '@internationalized/date': 3.5.5
+ '@internationalized/number': 3.5.3
+ '@kobalte/utils': 0.9.1([email protected])
+ '@solid-primitives/props': 3.1.11([email protected])
+ '@solid-primitives/resize-observer': 2.0.26([email protected])
+ solid-js: 1.9.1
+ solid-presence: 0.1.8([email protected])
+ solid-prevent-scroll: 0.1.10([email protected])
+
dependencies:
@@ -16514,7 +16531,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
hasown: 2.0.2
is-core-module: 2.15.1
is-glob: 4.0.3
@@ -19180,7 +19197,7 @@ snapshots:
'@panva/hkdf': 1.2.1
cookie: 0.5.0
jose: 4.15.9
oauth: 0.9.15
openid-client: 5.7.0
preact: 10.24.1
@@ -19229,7 +19246,7 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
dependencies:
'@next/env': 14.2.9
'@swc/helpers': 0.5.5