How atlassian/pragmatic-drag-and-drop works
Main Components
• A central “Drag and Drop Engine” (the core) that abstracts native browser events and manages drag state.
• Optional functionality modules such as Auto-scroll, Hitbox detection, Live region announcements, and React Accessibility — components that layer on top of the core to provide enhanced experiences.
• Visual output packages like the ones prefixed with “react-beautiful-dnd-…”, and “react-drop-indicator” that may also manage styling and presentation.
• “Documentation” and “Unit Testing” as supporting components that help illustrate usage and ensure quality.
• The “Flourish” package that likely provides additional templates or effects on top of the core behaviors.
Out Their Relationships
• That the optional packages (for instance, those handling visual outputs or assistive controls) depend on having low-level functionalities and “speak” to the core API.
Important Architectural Patterns and Design Principles
• The monorepo structure organizes various packages by their specific responsibilities. This shows an adherence to modularity and separation of concerns.
• The system is “framework agnostic” — a brief note on this (e.g., “Works with React, Svelte, Vue, Angular, etc.”) could help underline the design’s flexibility.
• The use of unit and integration tests, along with configuration files (like tsconfig.json, jest.config.js, etc.), reflects the disciplined development process and high testability.
Technologies, Frameworks, and Libraries
• TypeScript and TSX use across the modules.
• Testing frameworks such as Jest and Playwright are also part of the system design, though they might be represented as “development support” tools rather than runtime components.
• Although the packages are built to work with any view layer, some components (especially under “react-beautiful-dnd…” and “react-drop-indicator”) show a tight coupling with React paradigms. This can be noted as a common integration style when using the optional visual outputs.