Problem: the mascot's right-click menu was non-interactive — RadialMenu's root div rendered inside MascotLayer's pointer-events-none root (and the new DockedLayer wrapper compounded it) without re-enabling pointer-events, so clicks passed straight through. The desktop right-click menu was a hand-rolled positioned div, inconsistent with the rest of the UI. Change: both menus now use the shadcn-svelte context-menu primitive (bits-ui, portaled to <body>). - Mascot: MascotMenu.svelte renders the action tree recursively — children become ContextMenu.Sub (native hover sub-menu navigation, replacing the manual breadcrumb stack), leaves become ContextMenu.Item with onSelect. MascotLayer wraps <Mascot> in a ContextMenu.Trigger; visibility predicates read reactively off ctx.model so items appear/disappear live. Removed the manual menuPos/openMenu/closeMenu machinery. RadialMenu.svelte deleted. - Desktop: the surface's bare-desktop hit area is now a ContextMenu.Trigger layer (absolute inset-0, pointer-events-auto) placed before the icons/windows in the DOM. The DOM-structure gate (icons/windows are pointer-events-auto siblings that paint on top and intercept their own right-clicks; bare desktop falls through to the trigger) replaces the old fragile e.currentTarget === e.target check. Left-click blur moved onto the trigger; Undo/Redo disabled state snapshotted via onOpenChange (canUndo/canRedo are wmkit methods). Risk: the blocker that made the mascot menu non-interactive in the first place — Mascot.svelte's handleContextMenu called e.stopPropagation(), which would have prevented a ContextMenu.Trigger wrapper from ever seeing the right-click. Removed that handler; bits-ui now owns right-click on the mascot, left-click drag/pet passes through. The context-menu content portals to <body>, escaping the pointer-events-none mascot and docked layers entirely — the structural fix, not just a component swap. Verification: vitest 38/38; svelte-check + tsc clean for changed files; eslint clean (the shadcn-generated ui/context-menu/* files carry the same baseline custom_element_props_identifier warnings as the rest of the ui/ folder, not from this change); vite build green; runtime confirmed — right-click mascot opens the action tree with hover sub-menus, right-click bare desktop opens Cascade/Tile/Show/Reset/ Undo/Redo, right-click on an icon or window does not.
55 lines
1.4 KiB
JSON
55 lines
1.4 KiB
JSON
{
|
|
"name": "oikos-web",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint .",
|
|
"lint:fix": "eslint . --fix",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check .",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest"
|
|
},
|
|
"devDependencies": {
|
|
"@internationalized/date": "^3.12.2",
|
|
"@lucide/svelte": "^1.25.0",
|
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
"@tailwindcss/vite": "^4.3.2",
|
|
"@tsconfig/svelte": "^5.0.0",
|
|
"@types/d3-force": "^3.0.10",
|
|
"@vincjo/datatables": "^2.8.1",
|
|
"bits-ui": "^2.18.1",
|
|
"eslint": "^9.0.0",
|
|
"eslint-plugin-svelte": "^2.46.0",
|
|
"globals": "^15.0.0",
|
|
"jsdom": "^25.0.0",
|
|
"prettier": "^3.3.0",
|
|
"prettier-plugin-svelte": "^3.3.0",
|
|
"svelte": "^5.0.0",
|
|
"svelte-check": "^4.0.0",
|
|
"svelte-sonner": "^1.1.1",
|
|
"tailwind-variants": "^3.2.2",
|
|
"tailwindcss": "^4.3.2",
|
|
"typescript": "^5.5.0",
|
|
"typescript-eslint": "^8.0.0",
|
|
"vite": "^6.0.0",
|
|
"vitest": "^2.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@surdeddd/wmkit": "^0.3.0",
|
|
"clsx": "^2.1.1",
|
|
"d3-force": "^3.0.0",
|
|
"dompurify": "^3.4.11",
|
|
"marked": "^18.0.5",
|
|
"svelte-splitpanes": "^8.0.12",
|
|
"tailwind-merge": "^3.6.0",
|
|
"uplot": "^1.6.32"
|
|
}
|
|
}
|