Upgrade Vite deps and fix windows DnD

This commit is contained in:
Gregory Schier
2024-02-17 14:57:12 -08:00
parent d842b168e6
commit a7d9e2432b
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",
"@typescript-eslint/eslint-plugin": "^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",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
@@ -90,13 +90,13 @@
"postcss": "^8.4.21",
"postcss-nesting": "^11.2.1",
"prettier": "^2.8.4",
"react-devtools": "^4.28.5",
"react-devtools": "^4.27.2",
"tailwindcss": "^3.2.7",
"typescript": "^5.0.2",
"vite": "^5.1.1",
"vite-plugin-svgr": "^2.4.0",
"vite-plugin-top-level-await": "^1.2.4",
"vitest": "^0.29.2"
"vite-plugin-svgr": "^4.2.0",
"vite-plugin-top-level-await": "^1.4.1",
"vitest": "^1.3.0"
},
"lint-staged": {
"*.{ts,tsx}": "eslint --cache --fix",

View File

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

View File

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