diff --git a/package-lock.json b/package-lock.json index 19881b7..c2eaa79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,7 @@ "react-day-picker": "^9.13.2", "react-dom": "^19.2.4", "react-hook-form": "^7.71.1", - "react-resizable-panels": "^3.0.6", + "react-resizable-panels": "^4.6.2", "react-router-dom": "^7.13.0", "recharts": "^3.7.0", "sonner": "^2.0.7", @@ -5154,13 +5154,13 @@ } }, "node_modules/react-resizable-panels": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/react-resizable-panels/-/react-resizable-panels-3.0.6.tgz", - "integrity": "sha512-b3qKHQ3MLqOgSS+FRYKapNkJZf5EQzuf6+RLiq1/IlTHw99YrZ2NJZLk4hQIzTnnIkRg2LUqyVinu6YWWpUYew==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/react-resizable-panels/-/react-resizable-panels-4.6.2.tgz", + "integrity": "sha512-d6hyD6s7ewNAI+oINrZznR/08GUyAszrowXouUDztePEn/tQ2z/LEI2qRvrizYBe3TpgBi0cCjc10pXTTOc4jw==", "license": "MIT", "peerDependencies": { - "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc", - "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" } }, "node_modules/react-router": { diff --git a/package.json b/package.json index 2338cb2..6ba96ea 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "react-day-picker": "^9.13.2", "react-dom": "^19.2.4", "react-hook-form": "^7.71.1", - "react-resizable-panels": "^3.0.6", + "react-resizable-panels": "^4.6.2", "react-router-dom": "^7.13.0", "recharts": "^3.7.0", "sonner": "^2.0.7", diff --git a/src/components/pages/downloader/playlistDownloader.tsx b/src/components/pages/downloader/playlistDownloader.tsx index ebbb345..eb1184e 100644 --- a/src/components/pages/downloader/playlistDownloader.tsx +++ b/src/components/pages/downloader/playlistDownloader.tsx @@ -10,6 +10,7 @@ import { PlaylistToggleGroup, PlaylistToggleGroupItem } from "@/components/custo import { getMergedBestFormat } from "@/utils"; import { Switch } from "@/components/ui/switch"; import { FormatToggleGroup, FormatToggleGroupItem } from "@/components/custom/formatToggleGroup"; +import { Layout } from "react-resizable-panels"; interface PlaylistPreviewSelectionProps { videoMetadata: RawVideoInfo; @@ -348,18 +349,22 @@ export function PlaylistDownloader({ videoMetadata, audioOnlyFormats, videoOnlyF return (
setPlaylistPanelSizes(sizes)} + onLayoutChanged={(layout: Layout) => { + const firstPanelSize = layout[Object.keys(layout)[0]]; + const secondPanelSize = layout[Object.keys(layout)[1]]; + setPlaylistPanelSizes([firstPanelSize, secondPanelSize]); + }} > - +
setVideoPanelSizes(sizes)} + onLayoutChanged={(layout: Layout) => { + const firstPanelSize = layout[Object.keys(layout)[0]]; + const secondPanelSize = layout[Object.keys(layout)[1]]; + setVideoPanelSizes([firstPanelSize, secondPanelSize]); + }} > - +
) => ( - -) +}: ResizablePrimitive.GroupProps) { + return ( + + ) +} -const ResizablePanel = ResizablePrimitive.Panel +function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) { + return +} -const ResizableHandle = ({ +function ResizableHandle({ withHandle, className, ...props -}: React.ComponentProps & { +}: ResizablePrimitive.SeparatorProps & { withHandle?: boolean -}) => ( - div]:rotate-90", - className - )} - {...props} - > - {withHandle && ( -
- -
- )} -
-) +}) { + return ( + div]:rotate-90", + className + )} + {...props} + > + {withHandle && ( +
+ )} + + ) +} -export { ResizablePanelGroup, ResizablePanel, ResizableHandle } +export { ResizableHandle, ResizablePanel, ResizablePanelGroup }