pragmatic-drag-and-drop README

The project's README from github.com/atlassian/pragmatic-drag-and-drop. As one markdown file: README.md.

Fast drag and drop for any experience on any tech stack

📖 Documentation | 🤹 Examples | 🎥 How it works

Show case of some examples


About

Pragmatic drag and drop is a low level drag and drop toolchain that enables safe and successful usage of the browsers built in drag and drop functionality. Pragmatic drag and drop can be used with any view layer (react, svelte, vue, angular and so on). Pragmatic drag and drop is powering some of the biggest products on the web, including Trello, Jira and Confluence.

Capabilities

Pragmatic drag and drop consists of a few high level pieces:

  1. Low level drag and drop behavior

Pragmatic drag and drop contains a core package, and a number of optional packages, that provide you the pieces to create any drag and drop experience.

These pieces are unopinionated about visual language or accessibility, and have no dependency on the Atlassian Design System.

  • Tiny: ~`4.7kB` core
  • Incremental: Only use the pieces that you need
  • Headless: Full rendering and style control
  • Framework agnostic: Works with any frontend framework
  • Deferred compatible: Delay the loading the core packages and optional packages in order to further improve page load speeds
  • Flexible: create any experience you want, make any changes you want during a drag operation.
  • Works everywhere: Full feature support in Firefox, Safari, and Chrome, iOS and Android
  • Virtualization support: create any virtual experience you want!
  1. Optional visual outputs

We have created optional visual outputs (eg our drop indicator) to make it super fast for us to build consistent Atlassian user experiences. Non Atlassian consumers are welcome to use these outputs, create their own that copy the visual styling, or go a totally different direction.

  1. Optional assistive technology controls

Not all users can achieve pointer based drag and drop experiences. In order to achieve fantastic experiences for assistive technology users, we provide a toolchain to allow you to quickly wire up performant assistive technology friendly flows for any experience.

The optional assistive controls we provide are based on the Atlassian Design System. If you do not want to use the Atlassian Design System, you can use our guidelines and substitute our components with your own components, or you can go about accessibility in a different way if you choose.

What is this repository?

This repository is currently one way mirror from our internal monorepo that contains all the code for Pragmatic drag and drop.

Diagram of how the mirror works

The intention of this repository is to make public our code, but not to accept code contributions (at this stage). In the future we could explore setting up a two way mirror so that contributions to this repo can also make their way back to our monorepo. You are still welcome to raise issues or suggestions on this repository!

All documentation and npm packages are public and available for use by everyone.

Can I use this with my own Design System?

Yep! Pragmatic drag and drop as a small core package, and then a range of optional packages. Some of the optional packages have dependencies on styling solutions (eg emotion), view libraries (eg react) or on some additional Atlassian outputs (eg @atlaskit/tokens). We have separated out optional packages that have other dependencies so they can be easily swapped with your own pieces that use your own tech stack and visual outputs.

Can I use my own design language?

Yep! We have created some design guidelines which embody how we want to achieve drag and drop in our products, and some of those decisions are embodied in some optional packages. However, you are free to use whatever design language you like, including ours!

What is @atlaskit?

The Pragmatic drag and drop packages are published under the @atlaskit namespace on npm

import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';

@atlaskit is the npm namespace that we publish all of our public packages on from inside our internal monorepo. We could look at creating a separate namespace in the future just for Pragmatic drag and drop. If we do that, we'll release some tooling to help folks automatically switch over.

npm release and repo sync timing

This mirror repository is currently being synced with our internal repository once a day. We publish packages to npm immediately as we merge new versions into the internal repository. This means that code can be released onto npm up to 24 hours before it is available in this mirror repository.

Credits

Made with love by:

Pragmatic drag and drop stands on the shoulders of giants, including the folks who created the drag and drop specifications, implemented drag and drop in browsers, and the many drag and drop libraries that came before this.

pragmatic-drag-and-drop (atlassian/pragmatic-drag-and-drop)

Searching Database…

这是什么?Pragmatic drag and drop 是一套底层的拖放工具链,基于浏览器原生的拖放 API 构建,用于支撑 Trello、Jira 和 Confluence 中的拖放功能。
它是框架还是库?它是一个无界面(headless)、不强加设计风格的库:核心包很小,另有可选包提供视觉效果和无障碍支持,不需要任何必须使用的 UI 框架。
我该如何把它加入项目?从 @atlaskit 的 npm 命名空间安装你需要的包,然后只接入实现拖放体验所必需的部分。
它会把我绑定到 Atlassian Design System 或某个特定的前端框架上吗?不会,它可以搭配任何视图层使用(React、Svelte、Vue、Angular 等);只有部分可选包依赖 emotion 或 Atlassian 设计令牌之类的东西,这些都可以替换掉。
它实际支持哪些浏览器和平台?它力求在 Firefox、Safari 和 Chrome 上实现完整功能支持,同时也支持 iOS 和 Android。
它自带拖动指示器和视觉效果吗?有的,它包含可选的视觉输出,比如 Atlassian 用来保持一致体验的放置指示器,其他人可以复用、复制或完全替换。
它支持无法使用指针拖动的用户吗?支持,它提供基于 Atlassian Design System 的可选辅助技术控件,可为键盘用户和屏幕阅读器用户打造无障碍的拖放流程。
即使 GitHub 镜像有延迟,我能使用 npm 上发布的包吗?可以,npm 包会在内部合并后立即发布,而这个镜像仓库每天同步一次,因此 npm 上的版本可能比你在这里看到的领先多达 24 小时。
它支持虚拟化列表吗?支持,该工具链明确支持构建虚拟化的拖放体验。
Creator
atlassian
Size
11.5 MB
Stars
12.8K
Updated
CommitOct 16
Age
2y
Commits · 90 Days