-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement new drag-and-drop engine #598
Merged
Changes from all commits
Commits
Show all changes
133 commits
Select commit
Hold shift + click to select a range
a9b5e42
feat: introduce new drag-and-drop engine
chrisvxd 83b00c4
docs: update demo to use new dnd engine
chrisvxd 6f849a2
fix: render DropZones the same in Puck and Render
chrisvxd 8e2052f
fix: don't trigger move action if source / destination the same
chrisvxd 1c520a9
refactor: don't consider dragged item as pointer candidate
chrisvxd abd0331
refactor: default pointer candidate to default zone
chrisvxd b4d04f7
refactor: debounce pointer area changes
chrisvxd da7fc6e
refactor: use closest corners when no collision found
chrisvxd 7208b31
refactor: use x-axis for grids and flex rows
chrisvxd e2dcf82
feat: add DropZone collisionAxis API for forcing collision direction
chrisvxd f13d5d3
refactor: force fallback collision with intersected area first
chrisvxd 7ef9ad1
refactor: use full intersection instead of center-in-intersection for…
chrisvxd ea66897
refactor: tidy up NestedDroppablePlugin
chrisvxd cd01875
refactor: set deepest candidates on drag start
chrisvxd feb766d
refactor: change default collision axis for CSS grid to dynamic
chrisvxd 28ea37d
feat: reduce DropZone to height of items unless empty
chrisvxd 72f7923
feat: control empty DropZone height with minEmptyHeight prop
chrisvxd dea772a
fix: set root DropZone to 100% height
chrisvxd 15f3950
fix: trigger iframe resize when closing devtools
chrisvxd 9feb380
docs: make demo Header sticky
chrisvxd 55d327f
refactor: use correct DropZone for nested render DropZones
chrisvxd 4d9ce65
refactor: add missing dragRef to Preview component
chrisvxd 8c5d030
refactor: enable autoscroller and other dnd-kit plugins
chrisvxd e72ad11
fix: stop actions from overflowing outside left of frame
chrisvxd 06d105f
refactor: support disabled permission with new dnd engine
chrisvxd 0dbe338
fix: always respect history hotkeys inside iframes
chrisvxd bb2a306
refactor: prevent ghosting when dragging quickly between zones
chrisvxd 94105b0
refactor: reduce area change debounce to make more responsive
chrisvxd bbafd65
refactor: prevent overlay flicker on drop
chrisvxd 8414992
refactor: add types for dnd data
chrisvxd f38c1cf
refactor: tidy up imports and removed unused CSS
chrisvxd e06a0b2
docs: tweak demo to use Grid instead of Flex
chrisvxd 726c84e
docs: document new drag-and-drop functionality
chrisvxd e0de893
refactor: ensure new drag-and-drop engine runs on server
chrisvxd 9443e34
docs: document DropZone className and style props
chrisvxd fe95743
docs: document minEmptyHeight API
chrisvxd 2708d57
feat: support inline Drawers, deprecating unnecessary props
chrisvxd 447a20b
docs: add missing isDragDisabled API docs
chrisvxd 89f8401
refactor: support drag cancelling
chrisvxd 9056652
docs: swap direction and justify content on Flex component
chrisvxd f25aaac
docs: document collisionAxis API
chrisvxd cacee1a
refactor: provide displayName for preview component
chrisvxd 0756e00
refactor: use correct import for @dnd-kit/state
chrisvxd a49e0bd
build: use latest dndkit beta
chrisvxd a78ccc8
build: upgrade to nightly dndkit
chrisvxd b4038b6
refactor: only debounce area changes, not zone changes
chrisvxd 76b1c54
refactor: infer collision axis for inline display modes
chrisvxd 76abae6
docs: improve multi-column layout docs
chrisvxd 2ef58fc
refactor: wrap dnd-kit hooks in server-safe wrappers
chrisvxd 1f8d69b
build: remove cost dist before running dev server
chrisvxd a7365b8
docs: add missing link to Multi Column Layouts docs
chrisvxd 48a740e
refactor: improve performance of overlay position sync
chrisvxd 9739306
refactor: ensure selected outline is shown over hover outline
chrisvxd 26a35ea
refactor: always set outline-offset when dragging
chrisvxd 4996f3e
refactor: remove unnecessary Safari fallback mode
chrisvxd 8bd214f
refactor: don't show hover overlay during item drop
chrisvxd 979c8e2
build: exclude dndkit from bundle
chrisvxd 78832b4
refactor: defer loading of DragDropContext until mounted
chrisvxd 6cad938
refactor: don't recreate manager on each render
chrisvxd f876e28
refactor: don't rerender DragDropContext on pointer move
chrisvxd 0416e8f
refactor: show overlay consistently on hover
chrisvxd 35abf73
refactor: partially fix strict mode support for new dnd engine
chrisvxd a769e32
refactor: tidy up cancelled drags properly
chrisvxd 2ab1da7
refactor: ensure overlay renders correctly outside of iframes
chrisvxd adfeda7
refactor: fix remaining flickering of overlay before sync finished
chrisvxd 540db9b
chore: add debug mode to DraggableComponent
chrisvxd 071f051
feat: deselect item on viewport change
chrisvxd e7898ac
refactor: update to latest dndkit nightly to fix strict mode
chrisvxd b4f936e
fix: remove unnecessary transpile from next recipe
chrisvxd 22d5c92
refactor: defer iframe event bubbling until after load
chrisvxd 377088d
refactor: never collide with Drawer droppable
chrisvxd 43dd6f9
refactor: reduce area change deboucne to 100ms
chrisvxd 26846fb
refactor: add missing grab pointer to Drawer.Item
chrisvxd dc977d1
refactor: prevent pointer events within draggable components
chrisvxd 7b04502
refactor: fix touch dragging
chrisvxd 7e43724
refactor: don't show overlay during drag on touch devices
chrisvxd cff4736
refactor: recalculate auto drag axis on viewport change
chrisvxd be04a20
fix: factor in border when setting viewport size
chrisvxd 60b9601
chore: remove old comment
chrisvxd f912547
refactor: clear deepest droppable ref on drag end for touch
chrisvxd 28513b2
refactor: extend delay after drop to prevent ghosting
chrisvxd 61ccd7a
refactor: make overlay syncing more deterministic
chrisvxd c964019
refactor: don't show ActionBar on hover, matching main behaviour
chrisvxd 7e151f7
refactor: cancel drop if user drops before preview is set
chrisvxd 33cbbdc
refactor: prevent render ghosting when dragging between areas
chrisvxd ee855ae
refactor: fulfill insertion rather than cancel on fast drag
chrisvxd 84491a9
refactor: select new item after duplicate
chrisvxd 2bfd333
fix: select new item when dispatching duplicate action
chrisvxd 3b544ed
refactor: don't scroll to top when drag starts
chrisvxd 4ff2b2b
refactor: prevent actions from leaking outside either side of viewport
chrisvxd 0607637
refactor: prevent action bar from flashing
chrisvxd 03bcbad
refactor: ensure frame can exceed 100vh
chrisvxd 2d3a8c9
refactor: use custom PointerSensor to address orphaned event issues
chrisvxd 7a1344c
refactor: refactor DragDropContext preview code to prevent race condi…
chrisvxd 83bed85
docs: adjust DropZone disallows in demo
chrisvxd e02e641
refactor: don't set deepest zone if parent zone not droppable
chrisvxd cc085f6
refactor: fix overlay position in custom interfaces
chrisvxd fbf3bc5
refactor: rework overlay positioning to account for docs
chrisvxd 455ca8a
refactor: resize overlay if ref changes size
chrisvxd e62a8d0
build: don't bundle any dnd-kit libs
chrisvxd 12a9fdc
refactor: always set the correct area for the zone
chrisvxd 8d6d5a1
refactor: rewrite area debounce behaviour
chrisvxd dbdea44
refactor: ensure DropZone debug mode is visible
chrisvxd 266b54b
refactor: use better names for debouncing refs
chrisvxd 92c3c76
fix: prevent propagation of custom ActionBar actions by default
chrisvxd c92b4cb
feat: add ActionBar.Label component for adding labels to action bars
chrisvxd 80ccb06
feat: add action to select parent component to ActionBar
chrisvxd 5d9a07f
refactor: move drag styles into separate file, but retain injection h…
chrisvxd c65d0e1
refactor: reinstate disableAutoScroll behaviour
chrisvxd 4b5b8a5
refactor: fix action bar flicker regression
chrisvxd c973744
refactor: set initialValue for ref following React 19 upgrade
chrisvxd 934af1f
fix: prevent user pollution of ActionBar styles
chrisvxd 0bbdc46
refactor: check if dnd item exists before accessing data
chrisvxd 794f7f7
refactor: flush containsActiveZone when child zones removed
chrisvxd 40fb832
refactor: delay selection until box has rendered
chrisvxd e4911b8
fix: improve heading-analyzer reliability
chrisvxd 5cb8215
test: add e2e testing tools, and smoke test script
chrisvxd 84a57fc
refactor: don't reset actions bounds offset after correction
chrisvxd cb0a65b
test: add multi-test support to smoke testing framework
chrisvxd 47d507a
refactor: rework NestedPointerSensor to avoid recalculating all shapes
chrisvxd 83fc54a
refactor: tidy up DropZone code
chrisvxd fb0f456
refactor: don't reference PointerEvent on server
chrisvxd b3bc3ed
refactor: memoize DropZone context for minor perf boost
chrisvxd 4cd396f
refactor: don't resize DropZone on initial render
chrisvxd b169025
refactor: account for iframe offset in NestedDroppablePlugin since re…
chrisvxd af49603
refactor: retain previous DropZone height during drag
chrisvxd 9788d0f
refactor: don't reset deepest on drag start
chrisvxd ba1b677
test: add more smoke test cases
chrisvxd e6226d4
refactor: retain original drawer item during drag
chrisvxd 01bf755
refactor: handle overlapping drawer since Nested plugin refactor
chrisvxd c6fbd4a
refactor: rewrite ArrayField to use dnd-kit
chrisvxd 34600af
feat: forward the ref to the DropZone component
chrisvxd 5b485b7
refactor: add missing displayNames to DropZone
chrisvxd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.Hero { | ||
.Blank { | ||
background: hotpink; | ||
padding: 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from "react"; | ||
import { ComponentConfig } from "@/core/types"; | ||
import { Button as _Button } from "@/core/components/Button"; | ||
|
||
export type ButtonProps = { | ||
label: string; | ||
href: string; | ||
variant: "primary" | "secondary"; | ||
}; | ||
|
||
export const Button: ComponentConfig<ButtonProps> = { | ||
label: "Button", | ||
fields: { | ||
label: { type: "text" }, | ||
href: { type: "text" }, | ||
variant: { | ||
type: "radio", | ||
options: [ | ||
{ label: "primary", value: "primary" }, | ||
{ label: "secondary", value: "secondary" }, | ||
], | ||
}, | ||
}, | ||
defaultProps: { | ||
label: "Button", | ||
href: "#", | ||
variant: "primary", | ||
}, | ||
render: ({ href, variant, label, puck }) => { | ||
return ( | ||
<div> | ||
<_Button | ||
href={puck.isEditing ? "#" : href} | ||
variant={variant} | ||
size="large" | ||
tabIndex={puck.isEditing ? -1 : undefined} | ||
> | ||
{label} | ||
</_Button> | ||
</div> | ||
); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe consider adding
grid-auto-flow: column;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the intention of adding that be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just thinking if the grid layout was column and they start adding colums this setting would be advantageous, and vice-versa if they wanted rows