npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vasakgroup/plugin-drag-and-drop-wayland

v2.0.0

Published

A Tauri plugin for drag-and-drop on Wayland.

Downloads

25

Readme

tauri-plugin-drag-and-drop-wayland

Plugin de Tauri para iniciar operaciones de arrastrar y soltar (drag & drop) en Wayland utilizando GTK GDK drag.

Requisitos

  • Tauri 2.x
  • Linux con Wayland
  • GTK3 (desarrollo)
  • Soporte de WebKitGTK

Instalación

1. Agregar el crate a Rust

[dependencies]
tauri-plugin-drag-and-drop-wayland = "0.1"

2. Agregar el plugin en lib.rs

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_drag_and_drop_wayland::init())
        .run(tauri::generate_context!())
        .expect("error al iniciar la aplicación");
}

3. Agregar el paquete npm (frontend)

npm install @vasakgroup/plugin-drag-and-drop-wayland

Uso

import { startDrag } from "@vasakgroup/plugin-drag-and-drop-wayland";

// Arrastrar archivos
await startDrag(
  ["/ruta/al/archivo1.txt", "/ruta/al/archivo2.txt"],
  "data:image/png;base64,iVBOR...",
  { mode: "copy" },
  (payload) => {
    console.log("Resultado:", payload.result);
    console.log("Posición:", payload.cursorPos);
  }
);

API

startDrag(item, icon?, options?, onEvent?)

Inicia una operación de arrastre.

Parámetros:

| Parámetro | Tipo | Descripción | |-----------|------|-------------| | item | string[] \| { data: string \| Record<string, string>, types: string[] } | Rutas de archivos o datos para arrastrar | | icon | string (opcional) | Icono a mostrar durante el arrastre (base64 o ruta) | | options | { mode?: "copy" \| "move" } (opcional) | Opciones de arrastre | | onEvent | (payload: CallbackPayload) => void (opcional) | Callback para eventos de resultado |

CallbackPayload:

{
  result: "Dropped" | "Cancelled";
  cursorPos: { x: number; y: number };
}

Permisos

Agrega el permiso en tauri.conf.json:

{
  "permissions": ["drag-and-drop-wayland:default"]
}

Cómo funciona

El plugin utiliza GDK drag de GTK para iniciar operaciones de arrastre nativas en Wayland. Cuando se invoca start_drag:

  1. Busca el widget WebKitWebView dentro de la ventana de Tauri
  2. Configura el widget como fuente de arrastre con los targets apropiados (URI para archivos, texto para datos)
  3. Inicia la operación de arrastre con GDK
  4. Reporta eventos de resultado (soltado/cancelado) a través de un canal Tauri

Rendimiento

| Aspecto | Mejora | |---------|--------| | Búsqueda de widget | Caché por ventana para evitar recorrer el árbol GTK en cada arrastre | | Clonación de rutas | Las rutas se pasan por ownership, eliminando clonaciones duplicadas | | Manejo de errores | Los canales utilizan ? en lugar de unwrap() para evitar panics | | Decodificación de imagen | Se utiliza el engine estándar de base64, que es un singleton estático |

Licencia

GPL-3.0-or-later