Upgrade Vite deps and fix windows DnD

This commit is contained in:
Gregory Schier
2024-02-17 14:57:12 -08:00
parent 37dea50c91
commit 2328973de5
4 changed files with 671 additions and 1598 deletions

2251
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -76,7 +76,7 @@
"@types/uuid": "^9.0.1", "@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0", "@typescript-eslint/parser": "^5.57.0",
"@vitejs/plugin-react": "^3.1.0", "@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.13",
"eslint": "^8.34.0", "eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
@@ -90,13 +90,13 @@
"postcss": "^8.4.21", "postcss": "^8.4.21",
"postcss-nesting": "^11.2.1", "postcss-nesting": "^11.2.1",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"react-devtools": "^4.28.5", "react-devtools": "^4.27.2",
"tailwindcss": "^3.2.7", "tailwindcss": "^3.2.7",
"typescript": "^5.0.2", "typescript": "^5.0.2",
"vite": "^5.1.1", "vite": "^5.1.1",
"vite-plugin-svgr": "^2.4.0", "vite-plugin-svgr": "^4.2.0",
"vite-plugin-top-level-await": "^1.2.4", "vite-plugin-top-level-await": "^1.4.1",
"vitest": "^0.29.2" "vitest": "^1.3.0"
}, },
"lint-staged": { "lint-staged": {
"*.{ts,tsx}": "eslint --cache --fix", "*.{ts,tsx}": "eslint --cache --fix",

View File

@@ -1356,7 +1356,7 @@ fn is_dev() -> bool {
} }
fn create_window(handle: &AppHandle, url: Option<&str>) -> Window { fn create_window(handle: &AppHandle, url: Option<&str>) -> Window {
let app_menu = window_menu::os_default("Yaak".to_string().as_str()); // let app_menu = window_menu::os_default("Yaak".to_string().as_str());
let window_num = handle.windows().len(); let window_num = handle.windows().len();
let window_id = format!("wnd_{}", window_num); let window_id = format!("wnd_{}", window_num);
let mut win_builder = tauri::WindowBuilder::new( let mut win_builder = tauri::WindowBuilder::new(
@@ -1366,6 +1366,7 @@ fn create_window(handle: &AppHandle, url: Option<&str>) -> Window {
) )
.fullscreen(false) .fullscreen(false)
.resizable(true) .resizable(true)
.disable_file_drop_handler() // Required for frontend Dnd on windows
.inner_size(1100.0, 600.0) .inner_size(1100.0, 600.0)
.position( .position(
// Randomly offset so windows don't stack exactly // Randomly offset so windows don't stack exactly

View File

@@ -480,6 +480,7 @@ function SidebarItems({
<Fragment key={child.item.id}> <Fragment key={child.item.id}>
{hoveredIndex === i && hoveredTree?.item.id === tree.item.id && <DropMarker />} {hoveredIndex === i && hoveredTree?.item.id === tree.item.id && <DropMarker />}
<DraggableSidebarItem <DraggableSidebarItem
draggable
selected={selectedId === child.item.id} selected={selectedId === child.item.id}
itemId={child.item.id} itemId={child.item.id}
itemName={child.item.name} itemName={child.item.name}
@@ -563,6 +564,7 @@ const SidebarItem = forwardRef(function SidebarItem(
onSelect, onSelect,
isCollapsed, isCollapsed,
child, child,
draggable,
}: SidebarItemProps, }: SidebarItemProps,
ref: ForwardedRef<HTMLLIElement>, ref: ForwardedRef<HTMLLIElement>,
) { ) {
@@ -644,7 +646,7 @@ const SidebarItem = forwardRef(function SidebarItem(
}, []); }, []);
return ( return (
<li ref={ref}> <li ref={ref} draggable={draggable}>
<div className={classNames(className, 'block relative group/item px-2 pb-0.5')}> <div className={classNames(className, 'block relative group/item px-2 pb-0.5')}>
<ContextMenu <ContextMenu
show={showContextMenu} show={showContextMenu}
@@ -864,7 +866,6 @@ function DraggableSidebarItem({
return ( return (
<SidebarItem <SidebarItem
ref={ref} ref={ref}
draggable
className={classNames(isDragging && 'opacity-20')} className={classNames(isDragging && 'opacity-20')}
itemName={itemName} itemName={itemName}
itemId={itemId} itemId={itemId}