{"id":19529885,"url":"https://github.com/loopmode/dnd-details","last_synced_at":"2026-06-15T11:31:36.259Z","repository":{"id":57213595,"uuid":"143722524","full_name":"loopmode/dnd-details","owner":"loopmode","description":"retrieve details from a DragEvent after drop","archived":false,"fork":false,"pushed_at":"2018-08-06T16:08:08.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-20T11:03:35.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loopmode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-06T12:01:56.000Z","updated_at":"2018-08-06T16:08:09.000Z","dependencies_parsed_at":"2022-08-24T21:01:40.389Z","dependency_job_id":null,"html_url":"https://github.com/loopmode/dnd-details","commit_stats":null,"previous_names":["loopmode/html5-drop-details"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/loopmode/dnd-details","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Fdnd-details","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Fdnd-details/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Fdnd-details/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Fdnd-details/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopmode","download_url":"https://codeload.github.com/loopmode/dnd-details/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Fdnd-details/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34358707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:28:00.710Z","updated_at":"2026-06-15T11:31:36.240Z","avatar_url":"https://github.com/loopmode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dnd-details\n\nTakes a `DragEvent` object and returns information about the dropped content.\n\n## Installation\n\n```bash\nyarn add dnd-details\n```\n\n## Resources\n\n-   [Documentation](https://loopmode.github.io/dnd-details/)\n-   [npm page](https://www.npmjs.com/package/dnd-details)\n\n## Usage\n\n```javascript\nimport dndDetails from 'dnd-details';\n\n...\n\nonDrop(event) {\n    const details = dndDetails(event);\n    console.log(details);\n}\n```\n\n## Returned object\n\nThe returned object has the shape\n\n```javascript\nexport interface IDropDetails {\n    files: FileList;\n    links: string[];\n    images: string[];\n    text: string;\n    html: string;\n}\n```\n\n### Dragging from desktop\n\nWhen files were dragged in from the local filesystem, the `files` list will be populated.\nNone of the other values will be populated.\n\n### Dragging from other browser windows\n\nWhen dragging content from other browser windows, the `files` list will always be empty, but several of the other values will be populated.\n\n-   When a single link is dragged, `text` should contain the displayed text of the link, and `links` should have one entry with the `href` URL of the link\n-   When a single image is dragged, `images` should have one entry with the `src` URL of the image\n-   When a linked image is dragged, both `links` and `images` should be populated\n-   When dragging in entire websites, e.g. `Ctrl+A` then drag and drop, you might have the data for many images and links\n-   The `links` and `images` arrays will always exist, even if they're empty. So it's safe write code like `if (details.images.length \u003e 0)` and you don't need `if (details.images \u0026\u0026 details.images.length \u003e 0)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopmode%2Fdnd-details","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopmode%2Fdnd-details","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopmode%2Fdnd-details/lists"}