mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
With a document open, the desktop app ran File › Place on a swatch or graphic style library, a Libraries panel file, a presets file or a plug-in dropped on it. A desktop drop has no position, and without one the app opened only documents and ran File › Place on every other file. On the web, the app also ran File › Place on these files when they were dropped on the canvas. File › Place can't read them, and the drop failed with "Couldn't place X: ... not a format VectorCraft reads". VectorcraftApp::drop_target now returns Open for these files, with or without a drop position, and they open as File › Open opens them: plug-ins are installed, presets are imported, swatch and graphic style libraries open in the library panel, and a Libraries panel file is added to the Libraries panel as a new library. A dropped library, presets file or plug-in that has a path is added to Open Recent Files when it opens, as File › Open adds it. io::opens_as returns the kind of each of these files from its extension, and drop_target and io::open_bytes both call it. The rules from #472 still apply to documents, pictures and text. On the web the browser gives no file name before the drop, so the app still outlines the canvas while such a file is dragged over it. Tests: drop_target returns Open for each of the eleven extensions, with no position and with a position on the canvas. A .gpl dropped through the desktop drop path loads in the library panel and is added to Open Recent Files, and a .vclibrary dropped the same way becomes a new library in the Libraries panel. Docs: docs/control-protocol.md (file.place), docs/development.md (Drag-and-drop), docs/target-app-parity.md (Evidence, UI).